diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyBusinessUnitsByIDTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyBusinessUnitsByIDTest.php new file mode 100644 index 00000000000..1f6381fb86e --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyBusinessUnitsByIDTest.php @@ -0,0 +1,513 @@ +assertSame(strtolower($method), strtolower($request->getMethod())); + $this->assertSame($relativeUri, (string) $request->getUri()); + if (!is_null($body)) { + $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); + } else { + $this->assertSame("", (string) $request->getBody()); + } + } + + + + /** + * @dataProvider getRequestBuilderResponses() + */ + public function testMapFromResponse(callable $builderFunction, $statusCode) + { + $builder = new ApiRequestBuilder(); + $request = $builderFunction($builder); + $this->assertInstanceOf(ApiRequest::class, $request); + + $response = new Response($statusCode, [], "{}"); + $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteClientException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); + + $this->expectException(ApiClientException::class); + $request->execute(); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteServerException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); + + $this->expectException(ApiServerException::class); + $request->execute(); + } + + public function getRequests() + { + return [ + 'ByProjectKeyBusinessUnitsByIDGet_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->businessUnits() + ->withId('test_ID') + ->get() + ->withExpand('expand'); + }, + 'get', + 'test_projectKey/business-units/test_ID?expand=expand', + ], + 'ByProjectKeyBusinessUnitsByIDGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->businessUnits() + ->withId("test_ID") + ->get(); + }, + 'get', + 'test_projectKey/business-units/test_ID', + ], + 'ByProjectKeyBusinessUnitsByIDPost_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->businessUnits() + ->withId('test_ID') + ->post(null) + ->withExpand('expand'); + }, + 'post', + 'test_projectKey/business-units/test_ID?expand=expand', + ], + 'ByProjectKeyBusinessUnitsByIDPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->businessUnits() + ->withId("test_ID") + ->post(null); + }, + 'post', + 'test_projectKey/business-units/test_ID', + ], + 'ByProjectKeyBusinessUnitsByIDDelete_withVersion' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->businessUnits() + ->withId('test_ID') + ->delete() + ->withVersion('version'); + }, + 'delete', + 'test_projectKey/business-units/test_ID?version=version', + ], + 'ByProjectKeyBusinessUnitsByIDDelete_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->businessUnits() + ->withId('test_ID') + ->delete() + ->withExpand('expand'); + }, + 'delete', + 'test_projectKey/business-units/test_ID?expand=expand', + ], + 'ByProjectKeyBusinessUnitsByIDDelete' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->businessUnits() + ->withId("test_ID") + ->delete(); + }, + 'delete', + 'test_projectKey/business-units/test_ID', + ] + ]; + } + + public function getResources() + { + return [ + ]; + } + + public function getRequestBuilders() + { + return [ + 'ByProjectKeyBusinessUnitsByIDGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->get(); + } + ], + 'ByProjectKeyBusinessUnitsByIDPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->post(null); + } + ], + 'ByProjectKeyBusinessUnitsByIDDelete' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->delete(); + } + ] + ]; + } + + public function getRequestBuilderResponses() + { + return [ + 'ByProjectKeyBusinessUnitsByIDGet_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->get(); + }, + 200 + ], + 'ByProjectKeyBusinessUnitsByIDGet_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->get(); + }, + 400 + ], + 'ByProjectKeyBusinessUnitsByIDGet_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->get(); + }, + 401 + ], + 'ByProjectKeyBusinessUnitsByIDGet_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->get(); + }, + 403 + ], + 'ByProjectKeyBusinessUnitsByIDGet_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->get(); + }, + 404 + ], + 'ByProjectKeyBusinessUnitsByIDGet_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->get(); + }, + 500 + ], + 'ByProjectKeyBusinessUnitsByIDGet_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->get(); + }, + 502 + ], + 'ByProjectKeyBusinessUnitsByIDGet_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->get(); + }, + 503 + ], + 'ByProjectKeyBusinessUnitsByIDGet_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->get(); + }, + 599 + ], + 'ByProjectKeyBusinessUnitsByIDPost_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 200 + ], + 'ByProjectKeyBusinessUnitsByIDPost_409' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 409 + ], + 'ByProjectKeyBusinessUnitsByIDPost_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 400 + ], + 'ByProjectKeyBusinessUnitsByIDPost_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 401 + ], + 'ByProjectKeyBusinessUnitsByIDPost_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 403 + ], + 'ByProjectKeyBusinessUnitsByIDPost_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 404 + ], + 'ByProjectKeyBusinessUnitsByIDPost_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 500 + ], + 'ByProjectKeyBusinessUnitsByIDPost_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 502 + ], + 'ByProjectKeyBusinessUnitsByIDPost_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 503 + ], + 'ByProjectKeyBusinessUnitsByIDPost_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 599 + ], + 'ByProjectKeyBusinessUnitsByIDDelete_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 200 + ], + 'ByProjectKeyBusinessUnitsByIDDelete_409' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 409 + ], + 'ByProjectKeyBusinessUnitsByIDDelete_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 400 + ], + 'ByProjectKeyBusinessUnitsByIDDelete_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 401 + ], + 'ByProjectKeyBusinessUnitsByIDDelete_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 403 + ], + 'ByProjectKeyBusinessUnitsByIDDelete_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 404 + ], + 'ByProjectKeyBusinessUnitsByIDDelete_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 500 + ], + 'ByProjectKeyBusinessUnitsByIDDelete_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 502 + ], + 'ByProjectKeyBusinessUnitsByIDDelete_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 503 + ], + 'ByProjectKeyBusinessUnitsByIDDelete_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 599 + ] + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyBusinessUnitsKeyByKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyBusinessUnitsKeyByKeyTest.php new file mode 100644 index 00000000000..f82340609e8 --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyBusinessUnitsKeyByKeyTest.php @@ -0,0 +1,513 @@ +assertSame(strtolower($method), strtolower($request->getMethod())); + $this->assertSame($relativeUri, (string) $request->getUri()); + if (!is_null($body)) { + $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); + } else { + $this->assertSame("", (string) $request->getBody()); + } + } + + + + /** + * @dataProvider getRequestBuilderResponses() + */ + public function testMapFromResponse(callable $builderFunction, $statusCode) + { + $builder = new ApiRequestBuilder(); + $request = $builderFunction($builder); + $this->assertInstanceOf(ApiRequest::class, $request); + + $response = new Response($statusCode, [], "{}"); + $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteClientException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); + + $this->expectException(ApiClientException::class); + $request->execute(); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteServerException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); + + $this->expectException(ApiServerException::class); + $request->execute(); + } + + public function getRequests() + { + return [ + 'ByProjectKeyBusinessUnitsKeyByKeyGet_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->businessUnits() + ->withKey('test_key') + ->get() + ->withExpand('expand'); + }, + 'get', + 'test_projectKey/business-units/key=test_key?expand=expand', + ], + 'ByProjectKeyBusinessUnitsKeyByKeyGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->businessUnits() + ->withKey("test_key") + ->get(); + }, + 'get', + 'test_projectKey/business-units/key=test_key', + ], + 'ByProjectKeyBusinessUnitsKeyByKeyPost_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->businessUnits() + ->withKey('test_key') + ->post(null) + ->withExpand('expand'); + }, + 'post', + 'test_projectKey/business-units/key=test_key?expand=expand', + ], + 'ByProjectKeyBusinessUnitsKeyByKeyPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->businessUnits() + ->withKey("test_key") + ->post(null); + }, + 'post', + 'test_projectKey/business-units/key=test_key', + ], + 'ByProjectKeyBusinessUnitsKeyByKeyDelete_withVersion' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->businessUnits() + ->withKey('test_key') + ->delete() + ->withVersion('version'); + }, + 'delete', + 'test_projectKey/business-units/key=test_key?version=version', + ], + 'ByProjectKeyBusinessUnitsKeyByKeyDelete_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->businessUnits() + ->withKey('test_key') + ->delete() + ->withExpand('expand'); + }, + 'delete', + 'test_projectKey/business-units/key=test_key?expand=expand', + ], + 'ByProjectKeyBusinessUnitsKeyByKeyDelete' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->businessUnits() + ->withKey("test_key") + ->delete(); + }, + 'delete', + 'test_projectKey/business-units/key=test_key', + ] + ]; + } + + public function getResources() + { + return [ + ]; + } + + public function getRequestBuilders() + { + return [ + 'ByProjectKeyBusinessUnitsKeyByKeyGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->get(); + } + ], + 'ByProjectKeyBusinessUnitsKeyByKeyPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->post(null); + } + ], + 'ByProjectKeyBusinessUnitsKeyByKeyDelete' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->delete(); + } + ] + ]; + } + + public function getRequestBuilderResponses() + { + return [ + 'ByProjectKeyBusinessUnitsKeyByKeyGet_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->get(); + }, + 200 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyGet_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->get(); + }, + 400 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyGet_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->get(); + }, + 401 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyGet_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->get(); + }, + 403 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyGet_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->get(); + }, + 404 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyGet_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->get(); + }, + 500 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyGet_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->get(); + }, + 502 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyGet_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->get(); + }, + 503 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyGet_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->get(); + }, + 599 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyPost_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 200 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyPost_409' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 409 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyPost_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 400 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyPost_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 401 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyPost_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 403 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyPost_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 404 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyPost_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 500 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyPost_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 502 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyPost_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 503 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyPost_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 599 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyDelete_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 200 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyDelete_409' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 409 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyDelete_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 400 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyDelete_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 401 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyDelete_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 403 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyDelete_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 404 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyDelete_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 500 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyDelete_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 502 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyDelete_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 503 + ], + 'ByProjectKeyBusinessUnitsKeyByKeyDelete_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 599 + ] + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyBusinessUnitsTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyBusinessUnitsTest.php new file mode 100644 index 00000000000..1348557429d --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyBusinessUnitsTest.php @@ -0,0 +1,433 @@ +assertSame(strtolower($method), strtolower($request->getMethod())); + $this->assertSame($relativeUri, (string) $request->getUri()); + if (!is_null($body)) { + $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); + } else { + $this->assertSame("", (string) $request->getBody()); + } + } + + /** + * @dataProvider getResources() + */ + public function testResources(callable $builderFunction, string $class, array $expectedArgs) + { + $builder = new ApiRequestBuilder(); + $resource = $builderFunction($builder); + $this->assertInstanceOf($class, $resource); + $this->assertEquals($expectedArgs, $resource->getArgs()); + } + + /** + * @dataProvider getRequestBuilderResponses() + */ + public function testMapFromResponse(callable $builderFunction, $statusCode) + { + $builder = new ApiRequestBuilder(); + $request = $builderFunction($builder); + $this->assertInstanceOf(ApiRequest::class, $request); + + $response = new Response($statusCode, [], "{}"); + $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteClientException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); + + $this->expectException(ApiClientException::class); + $request->execute(); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteServerException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); + + $this->expectException(ApiServerException::class); + $request->execute(); + } + + public function getRequests() + { + return [ + 'ByProjectKeyBusinessUnitsGet_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->businessUnits() + ->get() + ->withExpand('expand'); + }, + 'get', + 'test_projectKey/business-units?expand=expand', + ], + 'ByProjectKeyBusinessUnitsGet_withSort' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->businessUnits() + ->get() + ->withSort('sort'); + }, + 'get', + 'test_projectKey/business-units?sort=sort', + ], + 'ByProjectKeyBusinessUnitsGet_withLimit' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->businessUnits() + ->get() + ->withLimit('limit'); + }, + 'get', + 'test_projectKey/business-units?limit=limit', + ], + 'ByProjectKeyBusinessUnitsGet_withOffset' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->businessUnits() + ->get() + ->withOffset('offset'); + }, + 'get', + 'test_projectKey/business-units?offset=offset', + ], + 'ByProjectKeyBusinessUnitsGet_withWithTotal' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->businessUnits() + ->get() + ->withWithTotal('withTotal'); + }, + 'get', + 'test_projectKey/business-units?withTotal=withTotal', + ], + 'ByProjectKeyBusinessUnitsGet_withWhere' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->businessUnits() + ->get() + ->withWhere('where'); + }, + 'get', + 'test_projectKey/business-units?where=where', + ], + 'ByProjectKeyBusinessUnitsGet_withPredicateVar' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->businessUnits() + ->get() + ->withPredicateVar('varName', 'var.varName'); + }, + 'get', + 'test_projectKey/business-units?var.varName=var.varName', + ], + 'ByProjectKeyBusinessUnitsGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->businessUnits() + ->get(); + }, + 'get', + 'test_projectKey/business-units', + ], + 'ByProjectKeyBusinessUnitsPost_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->businessUnits() + ->post(null) + ->withExpand('expand'); + }, + 'post', + 'test_projectKey/business-units?expand=expand', + ], + 'ByProjectKeyBusinessUnitsPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->businessUnits() + ->post(null); + }, + 'post', + 'test_projectKey/business-units', + ] + ]; + } + + public function getResources() + { + return [ + 'ResourceByProjectKeyBusinessUnitsKeyByKey' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyBusinessUnitsKeyByKey { + return $builder + ->withProjectKey("test_projectKey") + ->businessUnits() + ->withKey("test_key"); + }, + ResourceByProjectKeyBusinessUnitsKeyByKey::class, + ['projectKey' => 'test_projectKey', 'key' => 'test_key'], + '/{projectKey}/business-units/key={key}' + ], + 'ResourceByProjectKeyBusinessUnitsByID' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyBusinessUnitsByID { + return $builder + ->withProjectKey("test_projectKey") + ->businessUnits() + ->withId("test_ID"); + }, + ResourceByProjectKeyBusinessUnitsByID::class, + ['projectKey' => 'test_projectKey', 'ID' => 'test_ID'], + '/{projectKey}/business-units/{ID}' + ] + ]; + } + + public function getRequestBuilders() + { + return [ + 'ByProjectKeyBusinessUnitsGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->get(); + } + ], + 'ByProjectKeyBusinessUnitsPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->post(null); + } + ] + ]; + } + + public function getRequestBuilderResponses() + { + return [ + 'ByProjectKeyBusinessUnitsGet_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->get(); + }, + 200 + ], + 'ByProjectKeyBusinessUnitsGet_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->get(); + }, + 400 + ], + 'ByProjectKeyBusinessUnitsGet_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->get(); + }, + 401 + ], + 'ByProjectKeyBusinessUnitsGet_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->get(); + }, + 403 + ], + 'ByProjectKeyBusinessUnitsGet_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->get(); + }, + 404 + ], + 'ByProjectKeyBusinessUnitsGet_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->get(); + }, + 500 + ], + 'ByProjectKeyBusinessUnitsGet_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->get(); + }, + 502 + ], + 'ByProjectKeyBusinessUnitsGet_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->get(); + }, + 503 + ], + 'ByProjectKeyBusinessUnitsGet_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->get(); + }, + 599 + ], + 'ByProjectKeyBusinessUnitsPost_201' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->post(null); + }, + 201 + ], + 'ByProjectKeyBusinessUnitsPost_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->post(null); + }, + 400 + ], + 'ByProjectKeyBusinessUnitsPost_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->post(null); + }, + 401 + ], + 'ByProjectKeyBusinessUnitsPost_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->post(null); + }, + 403 + ], + 'ByProjectKeyBusinessUnitsPost_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->post(null); + }, + 404 + ], + 'ByProjectKeyBusinessUnitsPost_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->post(null); + }, + 500 + ], + 'ByProjectKeyBusinessUnitsPost_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->post(null); + }, + 502 + ], + 'ByProjectKeyBusinessUnitsPost_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->post(null); + }, + 503 + ], + 'ByProjectKeyBusinessUnitsPost_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->post(null); + }, + 599 + ] + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomersTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomersTest.php new file mode 100644 index 00000000000..b89675d1590 --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomersTest.php @@ -0,0 +1,157 @@ +assertSame(strtolower($method), strtolower($request->getMethod())); + $this->assertSame($relativeUri, (string) $request->getUri()); + if (!is_null($body)) { + $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); + } else { + $this->assertSame("", (string) $request->getBody()); + } + } + + + + /** + * @dataProvider getRequestBuilderResponses() + */ + public function testMapFromResponse(callable $builderFunction, $statusCode) + { + $builder = new ApiRequestBuilder(); + $request = $builderFunction($builder); + $this->assertInstanceOf(ApiRequest::class, $request); + + $response = new Response($statusCode, [], "{}"); + $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteClientException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); + + $this->expectException(ApiClientException::class); + $request->execute(); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteServerException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); + + $this->expectException(ApiServerException::class); + $request->execute(); + } + + public function getRequests() + { + return [ + 'ByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomersPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->inBusinessUnitKeyWithBusinessUnitKeyValue("test_businessUnitKey") + ->me() + ->customers() + ->post(null); + }, + 'post', + 'test_projectKey/in-business-unit/key=test_businessUnitKey/me/customers', + ] + ]; + } + + public function getResources() + { + return [ + ]; + } + + public function getRequestBuilders() + { + return [ + 'ByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomersPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey") + ->me() + ->customers() + ->post(null); + } + ] + ]; + } + + public function getRequestBuilderResponses() + { + return [ + 'ByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomersPost_201' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey") + ->me() + ->customers() + ->post(null); + }, + 201 + ], + 'ByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomersPost_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey") + ->me() + ->customers() + ->post(null); + }, + 599 + ] + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeTest.php new file mode 100644 index 00000000000..d2b470d3018 --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeTest.php @@ -0,0 +1,81 @@ +assertInstanceOf($class, $resource); + $this->assertEquals($expectedArgs, $resource->getArgs()); + } + + + + + + + + public function getRequests() + { + return [ + ]; + } + + public function getResources() + { + return [ + 'ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomers' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomers { + return $builder + ->withProjectKey("test_projectKey") + ->inBusinessUnitKeyWithBusinessUnitKeyValue("test_businessUnitKey") + ->me() + ->customers(); + }, + ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomers::class, + ['projectKey' => 'test_projectKey', 'businessUnitKey' => 'test_businessUnitKey'], + '/{projectKey}/in-business-unit/key={businessUnitKey}/me/customers' + ] + ]; + } + + public function getRequestBuilders() + { + return [ + ]; + } + + public function getRequestBuilderResponses() + { + return [ + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyTest.php new file mode 100644 index 00000000000..6a8f709ef7c --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyTest.php @@ -0,0 +1,80 @@ +assertInstanceOf($class, $resource); + $this->assertEquals($expectedArgs, $resource->getArgs()); + } + + + + + + + + public function getRequests() + { + return [ + ]; + } + + public function getResources() + { + return [ + 'ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMe' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMe { + return $builder + ->withProjectKey("test_projectKey") + ->inBusinessUnitKeyWithBusinessUnitKeyValue("test_businessUnitKey") + ->me(); + }, + ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMe::class, + ['projectKey' => 'test_projectKey', 'businessUnitKey' => 'test_businessUnitKey'], + '/{projectKey}/in-business-unit/key={businessUnitKey}/me' + ] + ]; + } + + public function getRequestBuilders() + { + return [ + ]; + } + + public function getRequestBuilderResponses() + { + return [ + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDTest.php index fad2d1ea66b..075e7d09567 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDTest.php @@ -90,6 +90,71 @@ public function testExecuteServerException(callable $builderFunction) public function getRequests() { return [ + 'ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet_withPriceCurrency' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->productProjections() + ->withId('test_ID') + ->get() + ->withPriceCurrency('priceCurrency'); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/product-projections/test_ID?priceCurrency=priceCurrency', + ], + 'ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet_withPriceCountry' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->productProjections() + ->withId('test_ID') + ->get() + ->withPriceCountry('priceCountry'); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/product-projections/test_ID?priceCountry=priceCountry', + ], + 'ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet_withPriceCustomerGroup' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->productProjections() + ->withId('test_ID') + ->get() + ->withPriceCustomerGroup('priceCustomerGroup'); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/product-projections/test_ID?priceCustomerGroup=priceCustomerGroup', + ], + 'ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet_withPriceChannel' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->productProjections() + ->withId('test_ID') + ->get() + ->withPriceChannel('priceChannel'); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/product-projections/test_ID?priceChannel=priceChannel', + ], + 'ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet_withLocaleProjection' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->productProjections() + ->withId('test_ID') + ->get() + ->withLocaleProjection('localeProjection'); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/product-projections/test_ID?localeProjection=localeProjection', + ], 'ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet_withExpand' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyTest.php index a82caeb1b96..982c0e05f20 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyTest.php @@ -90,6 +90,71 @@ public function testExecuteServerException(callable $builderFunction) public function getRequests() { return [ + 'ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet_withPriceCurrency' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->productProjections() + ->withKey('test_key') + ->get() + ->withPriceCurrency('priceCurrency'); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/product-projections/key=test_key?priceCurrency=priceCurrency', + ], + 'ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet_withPriceCountry' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->productProjections() + ->withKey('test_key') + ->get() + ->withPriceCountry('priceCountry'); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/product-projections/key=test_key?priceCountry=priceCountry', + ], + 'ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet_withPriceCustomerGroup' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->productProjections() + ->withKey('test_key') + ->get() + ->withPriceCustomerGroup('priceCustomerGroup'); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/product-projections/key=test_key?priceCustomerGroup=priceCustomerGroup', + ], + 'ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet_withPriceChannel' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->productProjections() + ->withKey('test_key') + ->get() + ->withPriceChannel('priceChannel'); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/product-projections/key=test_key?priceChannel=priceChannel', + ], + 'ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet_withLocaleProjection' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->productProjections() + ->withKey('test_key') + ->get() + ->withLocaleProjection('localeProjection'); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/product-projections/key=test_key?localeProjection=localeProjection', + ], 'ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet_withExpand' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeActiveCartTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeActiveCartTest.php index 79252ec016e..f4bade6d46d 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeActiveCartTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeActiveCartTest.php @@ -90,6 +90,18 @@ public function testExecuteServerException(callable $builderFunction) public function getRequests() { return [ + 'ByProjectKeyMeActiveCartGet_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->activeCart() + ->get() + ->withExpand('expand'); + }, + 'get', + 'test_projectKey/me/active-cart?expand=expand', + ], 'ByProjectKeyMeActiveCartGet' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeBusinessUnitsByIDTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeBusinessUnitsByIDTest.php new file mode 100644 index 00000000000..40d1275c051 --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeBusinessUnitsByIDTest.php @@ -0,0 +1,552 @@ +assertSame(strtolower($method), strtolower($request->getMethod())); + $this->assertSame($relativeUri, (string) $request->getUri()); + if (!is_null($body)) { + $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); + } else { + $this->assertSame("", (string) $request->getBody()); + } + } + + + + /** + * @dataProvider getRequestBuilderResponses() + */ + public function testMapFromResponse(callable $builderFunction, $statusCode) + { + $builder = new ApiRequestBuilder(); + $request = $builderFunction($builder); + $this->assertInstanceOf(ApiRequest::class, $request); + + $response = new Response($statusCode, [], "{}"); + $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteClientException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); + + $this->expectException(ApiClientException::class); + $request->execute(); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteServerException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); + + $this->expectException(ApiServerException::class); + $request->execute(); + } + + public function getRequests() + { + return [ + 'ByProjectKeyMeBusinessUnitsByIDGet_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->businessUnits() + ->withId('test_ID') + ->get() + ->withExpand('expand'); + }, + 'get', + 'test_projectKey/me/business-units/test_ID?expand=expand', + ], + 'ByProjectKeyMeBusinessUnitsByIDGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->businessUnits() + ->withId("test_ID") + ->get(); + }, + 'get', + 'test_projectKey/me/business-units/test_ID', + ], + 'ByProjectKeyMeBusinessUnitsByIDPost_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->businessUnits() + ->withId('test_ID') + ->post(null) + ->withExpand('expand'); + }, + 'post', + 'test_projectKey/me/business-units/test_ID?expand=expand', + ], + 'ByProjectKeyMeBusinessUnitsByIDPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->businessUnits() + ->withId("test_ID") + ->post(null); + }, + 'post', + 'test_projectKey/me/business-units/test_ID', + ], + 'ByProjectKeyMeBusinessUnitsByIDDelete_withVersion' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->businessUnits() + ->withId('test_ID') + ->delete() + ->withVersion('version'); + }, + 'delete', + 'test_projectKey/me/business-units/test_ID?version=version', + ], + 'ByProjectKeyMeBusinessUnitsByIDDelete_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->businessUnits() + ->withId('test_ID') + ->delete() + ->withExpand('expand'); + }, + 'delete', + 'test_projectKey/me/business-units/test_ID?expand=expand', + ], + 'ByProjectKeyMeBusinessUnitsByIDDelete' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->businessUnits() + ->withId("test_ID") + ->delete(); + }, + 'delete', + 'test_projectKey/me/business-units/test_ID', + ] + ]; + } + + public function getResources() + { + return [ + ]; + } + + public function getRequestBuilders() + { + return [ + 'ByProjectKeyMeBusinessUnitsByIDGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->get(); + } + ], + 'ByProjectKeyMeBusinessUnitsByIDPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->post(null); + } + ], + 'ByProjectKeyMeBusinessUnitsByIDDelete' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->delete(); + } + ] + ]; + } + + public function getRequestBuilderResponses() + { + return [ + 'ByProjectKeyMeBusinessUnitsByIDGet_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->get(); + }, + 200 + ], + 'ByProjectKeyMeBusinessUnitsByIDGet_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->get(); + }, + 400 + ], + 'ByProjectKeyMeBusinessUnitsByIDGet_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->get(); + }, + 401 + ], + 'ByProjectKeyMeBusinessUnitsByIDGet_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->get(); + }, + 403 + ], + 'ByProjectKeyMeBusinessUnitsByIDGet_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->get(); + }, + 404 + ], + 'ByProjectKeyMeBusinessUnitsByIDGet_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->get(); + }, + 500 + ], + 'ByProjectKeyMeBusinessUnitsByIDGet_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->get(); + }, + 502 + ], + 'ByProjectKeyMeBusinessUnitsByIDGet_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->get(); + }, + 503 + ], + 'ByProjectKeyMeBusinessUnitsByIDGet_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->get(); + }, + 599 + ], + 'ByProjectKeyMeBusinessUnitsByIDPost_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 200 + ], + 'ByProjectKeyMeBusinessUnitsByIDPost_409' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 409 + ], + 'ByProjectKeyMeBusinessUnitsByIDPost_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 400 + ], + 'ByProjectKeyMeBusinessUnitsByIDPost_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 401 + ], + 'ByProjectKeyMeBusinessUnitsByIDPost_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 403 + ], + 'ByProjectKeyMeBusinessUnitsByIDPost_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 404 + ], + 'ByProjectKeyMeBusinessUnitsByIDPost_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 500 + ], + 'ByProjectKeyMeBusinessUnitsByIDPost_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 502 + ], + 'ByProjectKeyMeBusinessUnitsByIDPost_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 503 + ], + 'ByProjectKeyMeBusinessUnitsByIDPost_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->post(null); + }, + 599 + ], + 'ByProjectKeyMeBusinessUnitsByIDDelete_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 200 + ], + 'ByProjectKeyMeBusinessUnitsByIDDelete_409' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 409 + ], + 'ByProjectKeyMeBusinessUnitsByIDDelete_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 400 + ], + 'ByProjectKeyMeBusinessUnitsByIDDelete_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 401 + ], + 'ByProjectKeyMeBusinessUnitsByIDDelete_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 403 + ], + 'ByProjectKeyMeBusinessUnitsByIDDelete_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 404 + ], + 'ByProjectKeyMeBusinessUnitsByIDDelete_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 500 + ], + 'ByProjectKeyMeBusinessUnitsByIDDelete_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 502 + ], + 'ByProjectKeyMeBusinessUnitsByIDDelete_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 503 + ], + 'ByProjectKeyMeBusinessUnitsByIDDelete_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->delete(); + }, + 599 + ] + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeBusinessUnitsKeyByKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeBusinessUnitsKeyByKeyTest.php new file mode 100644 index 00000000000..178c5da179e --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeBusinessUnitsKeyByKeyTest.php @@ -0,0 +1,552 @@ +assertSame(strtolower($method), strtolower($request->getMethod())); + $this->assertSame($relativeUri, (string) $request->getUri()); + if (!is_null($body)) { + $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); + } else { + $this->assertSame("", (string) $request->getBody()); + } + } + + + + /** + * @dataProvider getRequestBuilderResponses() + */ + public function testMapFromResponse(callable $builderFunction, $statusCode) + { + $builder = new ApiRequestBuilder(); + $request = $builderFunction($builder); + $this->assertInstanceOf(ApiRequest::class, $request); + + $response = new Response($statusCode, [], "{}"); + $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteClientException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); + + $this->expectException(ApiClientException::class); + $request->execute(); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteServerException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); + + $this->expectException(ApiServerException::class); + $request->execute(); + } + + public function getRequests() + { + return [ + 'ByProjectKeyMeBusinessUnitsKeyByKeyGet_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->businessUnits() + ->withKey('test_key') + ->get() + ->withExpand('expand'); + }, + 'get', + 'test_projectKey/me/business-units/key=test_key?expand=expand', + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->businessUnits() + ->withKey("test_key") + ->get(); + }, + 'get', + 'test_projectKey/me/business-units/key=test_key', + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyPost_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->businessUnits() + ->withKey('test_key') + ->post(null) + ->withExpand('expand'); + }, + 'post', + 'test_projectKey/me/business-units/key=test_key?expand=expand', + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->businessUnits() + ->withKey("test_key") + ->post(null); + }, + 'post', + 'test_projectKey/me/business-units/key=test_key', + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyDelete_withVersion' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->businessUnits() + ->withKey('test_key') + ->delete() + ->withVersion('version'); + }, + 'delete', + 'test_projectKey/me/business-units/key=test_key?version=version', + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyDelete_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->businessUnits() + ->withKey('test_key') + ->delete() + ->withExpand('expand'); + }, + 'delete', + 'test_projectKey/me/business-units/key=test_key?expand=expand', + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyDelete' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->businessUnits() + ->withKey("test_key") + ->delete(); + }, + 'delete', + 'test_projectKey/me/business-units/key=test_key', + ] + ]; + } + + public function getResources() + { + return [ + ]; + } + + public function getRequestBuilders() + { + return [ + 'ByProjectKeyMeBusinessUnitsKeyByKeyGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->get(); + } + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->post(null); + } + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyDelete' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->delete(); + } + ] + ]; + } + + public function getRequestBuilderResponses() + { + return [ + 'ByProjectKeyMeBusinessUnitsKeyByKeyGet_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->get(); + }, + 200 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyGet_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->get(); + }, + 400 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyGet_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->get(); + }, + 401 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyGet_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->get(); + }, + 403 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyGet_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->get(); + }, + 404 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyGet_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->get(); + }, + 500 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyGet_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->get(); + }, + 502 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyGet_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->get(); + }, + 503 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyGet_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->get(); + }, + 599 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyPost_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 200 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyPost_409' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 409 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyPost_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 400 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyPost_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 401 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyPost_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 403 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyPost_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 404 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyPost_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 500 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyPost_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 502 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyPost_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 503 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyPost_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->post(null); + }, + 599 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyDelete_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 200 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyDelete_409' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 409 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyDelete_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 400 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyDelete_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 401 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyDelete_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 403 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyDelete_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 404 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyDelete_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 500 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyDelete_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 502 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyDelete_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 503 + ], + 'ByProjectKeyMeBusinessUnitsKeyByKeyDelete_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->delete(); + }, + 599 + ] + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeBusinessUnitsTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeBusinessUnitsTest.php new file mode 100644 index 00000000000..5a134ab7e1e --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeBusinessUnitsTest.php @@ -0,0 +1,465 @@ +assertSame(strtolower($method), strtolower($request->getMethod())); + $this->assertSame($relativeUri, (string) $request->getUri()); + if (!is_null($body)) { + $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); + } else { + $this->assertSame("", (string) $request->getBody()); + } + } + + /** + * @dataProvider getResources() + */ + public function testResources(callable $builderFunction, string $class, array $expectedArgs) + { + $builder = new ApiRequestBuilder(); + $resource = $builderFunction($builder); + $this->assertInstanceOf($class, $resource); + $this->assertEquals($expectedArgs, $resource->getArgs()); + } + + /** + * @dataProvider getRequestBuilderResponses() + */ + public function testMapFromResponse(callable $builderFunction, $statusCode) + { + $builder = new ApiRequestBuilder(); + $request = $builderFunction($builder); + $this->assertInstanceOf(ApiRequest::class, $request); + + $response = new Response($statusCode, [], "{}"); + $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteClientException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); + + $this->expectException(ApiClientException::class); + $request->execute(); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteServerException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); + + $this->expectException(ApiServerException::class); + $request->execute(); + } + + public function getRequests() + { + return [ + 'ByProjectKeyMeBusinessUnitsGet_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->businessUnits() + ->get() + ->withExpand('expand'); + }, + 'get', + 'test_projectKey/me/business-units?expand=expand', + ], + 'ByProjectKeyMeBusinessUnitsGet_withSort' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->businessUnits() + ->get() + ->withSort('sort'); + }, + 'get', + 'test_projectKey/me/business-units?sort=sort', + ], + 'ByProjectKeyMeBusinessUnitsGet_withLimit' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->businessUnits() + ->get() + ->withLimit('limit'); + }, + 'get', + 'test_projectKey/me/business-units?limit=limit', + ], + 'ByProjectKeyMeBusinessUnitsGet_withOffset' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->businessUnits() + ->get() + ->withOffset('offset'); + }, + 'get', + 'test_projectKey/me/business-units?offset=offset', + ], + 'ByProjectKeyMeBusinessUnitsGet_withWithTotal' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->businessUnits() + ->get() + ->withWithTotal('withTotal'); + }, + 'get', + 'test_projectKey/me/business-units?withTotal=withTotal', + ], + 'ByProjectKeyMeBusinessUnitsGet_withWhere' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->businessUnits() + ->get() + ->withWhere('where'); + }, + 'get', + 'test_projectKey/me/business-units?where=where', + ], + 'ByProjectKeyMeBusinessUnitsGet_withPredicateVar' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->businessUnits() + ->get() + ->withPredicateVar('varName', 'var.varName'); + }, + 'get', + 'test_projectKey/me/business-units?var.varName=var.varName', + ], + 'ByProjectKeyMeBusinessUnitsGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->businessUnits() + ->get(); + }, + 'get', + 'test_projectKey/me/business-units', + ], + 'ByProjectKeyMeBusinessUnitsPost_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->businessUnits() + ->post(null) + ->withExpand('expand'); + }, + 'post', + 'test_projectKey/me/business-units?expand=expand', + ], + 'ByProjectKeyMeBusinessUnitsPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->businessUnits() + ->post(null); + }, + 'post', + 'test_projectKey/me/business-units', + ] + ]; + } + + public function getResources() + { + return [ + 'ResourceByProjectKeyMeBusinessUnitsByID' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyMeBusinessUnitsByID { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->businessUnits() + ->withId("test_ID"); + }, + ResourceByProjectKeyMeBusinessUnitsByID::class, + ['projectKey' => 'test_projectKey', 'ID' => 'test_ID'], + '/{projectKey}/me/business-units/{ID}' + ], + 'ResourceByProjectKeyMeBusinessUnitsKeyByKey' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyMeBusinessUnitsKeyByKey { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->businessUnits() + ->withKey("test_key"); + }, + ResourceByProjectKeyMeBusinessUnitsKeyByKey::class, + ['projectKey' => 'test_projectKey', 'key' => 'test_key'], + '/{projectKey}/me/business-units/key={key}' + ] + ]; + } + + public function getRequestBuilders() + { + return [ + 'ByProjectKeyMeBusinessUnitsGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->get(); + } + ], + 'ByProjectKeyMeBusinessUnitsPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->post(null); + } + ] + ]; + } + + public function getRequestBuilderResponses() + { + return [ + 'ByProjectKeyMeBusinessUnitsGet_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->get(); + }, + 200 + ], + 'ByProjectKeyMeBusinessUnitsGet_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->get(); + }, + 400 + ], + 'ByProjectKeyMeBusinessUnitsGet_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->get(); + }, + 401 + ], + 'ByProjectKeyMeBusinessUnitsGet_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->get(); + }, + 403 + ], + 'ByProjectKeyMeBusinessUnitsGet_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->get(); + }, + 404 + ], + 'ByProjectKeyMeBusinessUnitsGet_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->get(); + }, + 500 + ], + 'ByProjectKeyMeBusinessUnitsGet_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->get(); + }, + 502 + ], + 'ByProjectKeyMeBusinessUnitsGet_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->get(); + }, + 503 + ], + 'ByProjectKeyMeBusinessUnitsGet_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->get(); + }, + 599 + ], + 'ByProjectKeyMeBusinessUnitsPost_201' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->post(null); + }, + 201 + ], + 'ByProjectKeyMeBusinessUnitsPost_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->post(null); + }, + 400 + ], + 'ByProjectKeyMeBusinessUnitsPost_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->post(null); + }, + 401 + ], + 'ByProjectKeyMeBusinessUnitsPost_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->post(null); + }, + 403 + ], + 'ByProjectKeyMeBusinessUnitsPost_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->post(null); + }, + 404 + ], + 'ByProjectKeyMeBusinessUnitsPost_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->post(null); + }, + 500 + ], + 'ByProjectKeyMeBusinessUnitsPost_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->post(null); + }, + 502 + ], + 'ByProjectKeyMeBusinessUnitsPost_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->post(null); + }, + 503 + ], + 'ByProjectKeyMeBusinessUnitsPost_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->post(null); + }, + 599 + ] + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeQuotesByIDTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeQuotesByIDTest.php new file mode 100644 index 00000000000..717da0bf481 --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeQuotesByIDTest.php @@ -0,0 +1,393 @@ +assertSame(strtolower($method), strtolower($request->getMethod())); + $this->assertSame($relativeUri, (string) $request->getUri()); + if (!is_null($body)) { + $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); + } else { + $this->assertSame("", (string) $request->getBody()); + } + } + + + + /** + * @dataProvider getRequestBuilderResponses() + */ + public function testMapFromResponse(callable $builderFunction, $statusCode) + { + $builder = new ApiRequestBuilder(); + $request = $builderFunction($builder); + $this->assertInstanceOf(ApiRequest::class, $request); + + $response = new Response($statusCode, [], "{}"); + $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteClientException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); + + $this->expectException(ApiClientException::class); + $request->execute(); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteServerException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); + + $this->expectException(ApiServerException::class); + $request->execute(); + } + + public function getRequests() + { + return [ + 'ByProjectKeyMeQuotesByIDGet_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->quotes() + ->withId('test_ID') + ->get() + ->withExpand('expand'); + }, + 'get', + 'test_projectKey/me/quotes/test_ID?expand=expand', + ], + 'ByProjectKeyMeQuotesByIDGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->quotes() + ->withId("test_ID") + ->get(); + }, + 'get', + 'test_projectKey/me/quotes/test_ID', + ], + 'ByProjectKeyMeQuotesByIDPost_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->quotes() + ->withId('test_ID') + ->post(null) + ->withExpand('expand'); + }, + 'post', + 'test_projectKey/me/quotes/test_ID?expand=expand', + ], + 'ByProjectKeyMeQuotesByIDPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->quotes() + ->withId("test_ID") + ->post(null); + }, + 'post', + 'test_projectKey/me/quotes/test_ID', + ] + ]; + } + + public function getResources() + { + return [ + ]; + } + + public function getRequestBuilders() + { + return [ + 'ByProjectKeyMeQuotesByIDGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->get(); + } + ], + 'ByProjectKeyMeQuotesByIDPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->post(null); + } + ] + ]; + } + + public function getRequestBuilderResponses() + { + return [ + 'ByProjectKeyMeQuotesByIDGet_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->get(); + }, + 200 + ], + 'ByProjectKeyMeQuotesByIDGet_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->get(); + }, + 400 + ], + 'ByProjectKeyMeQuotesByIDGet_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->get(); + }, + 401 + ], + 'ByProjectKeyMeQuotesByIDGet_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->get(); + }, + 403 + ], + 'ByProjectKeyMeQuotesByIDGet_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->get(); + }, + 404 + ], + 'ByProjectKeyMeQuotesByIDGet_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->get(); + }, + 500 + ], + 'ByProjectKeyMeQuotesByIDGet_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->get(); + }, + 502 + ], + 'ByProjectKeyMeQuotesByIDGet_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->get(); + }, + 503 + ], + 'ByProjectKeyMeQuotesByIDGet_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->get(); + }, + 599 + ], + 'ByProjectKeyMeQuotesByIDPost_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->post(null); + }, + 200 + ], + 'ByProjectKeyMeQuotesByIDPost_409' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->post(null); + }, + 409 + ], + 'ByProjectKeyMeQuotesByIDPost_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->post(null); + }, + 400 + ], + 'ByProjectKeyMeQuotesByIDPost_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->post(null); + }, + 401 + ], + 'ByProjectKeyMeQuotesByIDPost_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->post(null); + }, + 403 + ], + 'ByProjectKeyMeQuotesByIDPost_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->post(null); + }, + 404 + ], + 'ByProjectKeyMeQuotesByIDPost_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->post(null); + }, + 500 + ], + 'ByProjectKeyMeQuotesByIDPost_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->post(null); + }, + 502 + ], + 'ByProjectKeyMeQuotesByIDPost_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->post(null); + }, + 503 + ], + 'ByProjectKeyMeQuotesByIDPost_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->post(null); + }, + 599 + ] + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeQuotesKeyByKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeQuotesKeyByKeyTest.php new file mode 100644 index 00000000000..2f958e467bf --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeQuotesKeyByKeyTest.php @@ -0,0 +1,393 @@ +assertSame(strtolower($method), strtolower($request->getMethod())); + $this->assertSame($relativeUri, (string) $request->getUri()); + if (!is_null($body)) { + $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); + } else { + $this->assertSame("", (string) $request->getBody()); + } + } + + + + /** + * @dataProvider getRequestBuilderResponses() + */ + public function testMapFromResponse(callable $builderFunction, $statusCode) + { + $builder = new ApiRequestBuilder(); + $request = $builderFunction($builder); + $this->assertInstanceOf(ApiRequest::class, $request); + + $response = new Response($statusCode, [], "{}"); + $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteClientException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); + + $this->expectException(ApiClientException::class); + $request->execute(); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteServerException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); + + $this->expectException(ApiServerException::class); + $request->execute(); + } + + public function getRequests() + { + return [ + 'ByProjectKeyMeQuotesKeyByKeyGet_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->quotes() + ->withKey('test_key') + ->get() + ->withExpand('expand'); + }, + 'get', + 'test_projectKey/me/quotes/key=test_key?expand=expand', + ], + 'ByProjectKeyMeQuotesKeyByKeyGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->quotes() + ->withKey("test_key") + ->get(); + }, + 'get', + 'test_projectKey/me/quotes/key=test_key', + ], + 'ByProjectKeyMeQuotesKeyByKeyPost_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->quotes() + ->withKey('test_key') + ->post(null) + ->withExpand('expand'); + }, + 'post', + 'test_projectKey/me/quotes/key=test_key?expand=expand', + ], + 'ByProjectKeyMeQuotesKeyByKeyPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->quotes() + ->withKey("test_key") + ->post(null); + }, + 'post', + 'test_projectKey/me/quotes/key=test_key', + ] + ]; + } + + public function getResources() + { + return [ + ]; + } + + public function getRequestBuilders() + { + return [ + 'ByProjectKeyMeQuotesKeyByKeyGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->get(); + } + ], + 'ByProjectKeyMeQuotesKeyByKeyPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->post(null); + } + ] + ]; + } + + public function getRequestBuilderResponses() + { + return [ + 'ByProjectKeyMeQuotesKeyByKeyGet_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->get(); + }, + 200 + ], + 'ByProjectKeyMeQuotesKeyByKeyGet_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->get(); + }, + 400 + ], + 'ByProjectKeyMeQuotesKeyByKeyGet_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->get(); + }, + 401 + ], + 'ByProjectKeyMeQuotesKeyByKeyGet_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->get(); + }, + 403 + ], + 'ByProjectKeyMeQuotesKeyByKeyGet_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->get(); + }, + 404 + ], + 'ByProjectKeyMeQuotesKeyByKeyGet_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->get(); + }, + 500 + ], + 'ByProjectKeyMeQuotesKeyByKeyGet_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->get(); + }, + 502 + ], + 'ByProjectKeyMeQuotesKeyByKeyGet_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->get(); + }, + 503 + ], + 'ByProjectKeyMeQuotesKeyByKeyGet_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->get(); + }, + 599 + ], + 'ByProjectKeyMeQuotesKeyByKeyPost_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->post(null); + }, + 200 + ], + 'ByProjectKeyMeQuotesKeyByKeyPost_409' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->post(null); + }, + 409 + ], + 'ByProjectKeyMeQuotesKeyByKeyPost_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->post(null); + }, + 400 + ], + 'ByProjectKeyMeQuotesKeyByKeyPost_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->post(null); + }, + 401 + ], + 'ByProjectKeyMeQuotesKeyByKeyPost_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->post(null); + }, + 403 + ], + 'ByProjectKeyMeQuotesKeyByKeyPost_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->post(null); + }, + 404 + ], + 'ByProjectKeyMeQuotesKeyByKeyPost_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->post(null); + }, + 500 + ], + 'ByProjectKeyMeQuotesKeyByKeyPost_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->post(null); + }, + 502 + ], + 'ByProjectKeyMeQuotesKeyByKeyPost_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->post(null); + }, + 503 + ], + 'ByProjectKeyMeQuotesKeyByKeyPost_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->post(null); + }, + 599 + ] + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeQuotesTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeQuotesTest.php new file mode 100644 index 00000000000..b1b1be9ffda --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeQuotesTest.php @@ -0,0 +1,342 @@ +assertSame(strtolower($method), strtolower($request->getMethod())); + $this->assertSame($relativeUri, (string) $request->getUri()); + if (!is_null($body)) { + $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); + } else { + $this->assertSame("", (string) $request->getBody()); + } + } + + /** + * @dataProvider getResources() + */ + public function testResources(callable $builderFunction, string $class, array $expectedArgs) + { + $builder = new ApiRequestBuilder(); + $resource = $builderFunction($builder); + $this->assertInstanceOf($class, $resource); + $this->assertEquals($expectedArgs, $resource->getArgs()); + } + + /** + * @dataProvider getRequestBuilderResponses() + */ + public function testMapFromResponse(callable $builderFunction, $statusCode) + { + $builder = new ApiRequestBuilder(); + $request = $builderFunction($builder); + $this->assertInstanceOf(ApiRequest::class, $request); + + $response = new Response($statusCode, [], "{}"); + $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteClientException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); + + $this->expectException(ApiClientException::class); + $request->execute(); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteServerException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); + + $this->expectException(ApiServerException::class); + $request->execute(); + } + + public function getRequests() + { + return [ + 'ByProjectKeyMeQuotesGet_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->quotes() + ->get() + ->withExpand('expand'); + }, + 'get', + 'test_projectKey/me/quotes?expand=expand', + ], + 'ByProjectKeyMeQuotesGet_withSort' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->quotes() + ->get() + ->withSort('sort'); + }, + 'get', + 'test_projectKey/me/quotes?sort=sort', + ], + 'ByProjectKeyMeQuotesGet_withLimit' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->quotes() + ->get() + ->withLimit('limit'); + }, + 'get', + 'test_projectKey/me/quotes?limit=limit', + ], + 'ByProjectKeyMeQuotesGet_withOffset' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->quotes() + ->get() + ->withOffset('offset'); + }, + 'get', + 'test_projectKey/me/quotes?offset=offset', + ], + 'ByProjectKeyMeQuotesGet_withWithTotal' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->quotes() + ->get() + ->withWithTotal('withTotal'); + }, + 'get', + 'test_projectKey/me/quotes?withTotal=withTotal', + ], + 'ByProjectKeyMeQuotesGet_withWhere' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->quotes() + ->get() + ->withWhere('where'); + }, + 'get', + 'test_projectKey/me/quotes?where=where', + ], + 'ByProjectKeyMeQuotesGet_withPredicateVar' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->quotes() + ->get() + ->withPredicateVar('varName', 'var.varName'); + }, + 'get', + 'test_projectKey/me/quotes?var.varName=var.varName', + ], + 'ByProjectKeyMeQuotesGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->quotes() + ->get(); + }, + 'get', + 'test_projectKey/me/quotes', + ] + ]; + } + + public function getResources() + { + return [ + 'ResourceByProjectKeyMeQuotesByID' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyMeQuotesByID { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->quotes() + ->withId("test_ID"); + }, + ResourceByProjectKeyMeQuotesByID::class, + ['projectKey' => 'test_projectKey', 'ID' => 'test_ID'], + '/{projectKey}/me/quotes/{ID}' + ], + 'ResourceByProjectKeyMeQuotesKeyByKey' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyMeQuotesKeyByKey { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->quotes() + ->withKey("test_key"); + }, + ResourceByProjectKeyMeQuotesKeyByKey::class, + ['projectKey' => 'test_projectKey', 'key' => 'test_key'], + '/{projectKey}/me/quotes/key={key}' + ] + ]; + } + + public function getRequestBuilders() + { + return [ + 'ByProjectKeyMeQuotesGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->get(); + } + ] + ]; + } + + public function getRequestBuilderResponses() + { + return [ + 'ByProjectKeyMeQuotesGet_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->get(); + }, + 200 + ], + 'ByProjectKeyMeQuotesGet_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->get(); + }, + 400 + ], + 'ByProjectKeyMeQuotesGet_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->get(); + }, + 401 + ], + 'ByProjectKeyMeQuotesGet_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->get(); + }, + 403 + ], + 'ByProjectKeyMeQuotesGet_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->get(); + }, + 404 + ], + 'ByProjectKeyMeQuotesGet_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->get(); + }, + 500 + ], + 'ByProjectKeyMeQuotesGet_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->get(); + }, + 502 + ], + 'ByProjectKeyMeQuotesGet_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->get(); + }, + 503 + ], + 'ByProjectKeyMeQuotesGet_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->get(); + }, + 599 + ] + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeTest.php index fa67740a5ae..bdfbbf65923 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeTest.php @@ -10,6 +10,7 @@ use Commercetools\Api\Client\ApiRequestBuilder; use Commercetools\Api\Client\Resource\ResourceByProjectKeyMeActiveCart; +use Commercetools\Api\Client\Resource\ResourceByProjectKeyMeBusinessUnits; use Commercetools\Api\Client\Resource\ResourceByProjectKeyMeCarts; use Commercetools\Api\Client\Resource\ResourceByProjectKeyMeEmailConfirm; use Commercetools\Api\Client\Resource\ResourceByProjectKeyMeLogin; @@ -17,6 +18,7 @@ use Commercetools\Api\Client\Resource\ResourceByProjectKeyMePassword; use Commercetools\Api\Client\Resource\ResourceByProjectKeyMePayments; use Commercetools\Api\Client\Resource\ResourceByProjectKeyMeQuoteRequests; +use Commercetools\Api\Client\Resource\ResourceByProjectKeyMeQuotes; use Commercetools\Api\Client\Resource\ResourceByProjectKeyMeShoppingLists; use Commercetools\Api\Client\Resource\ResourceByProjectKeyMeSignup; use Commercetools\Base\JsonObject; @@ -290,6 +292,17 @@ function (ApiRequestBuilder $builder): ResourceByProjectKeyMeActiveCart { ['projectKey' => 'test_projectKey'], '/{projectKey}/me/active-cart' ], + 'ResourceByProjectKeyMeBusinessUnits' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyMeBusinessUnits { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->businessUnits(); + }, + ResourceByProjectKeyMeBusinessUnits::class, + ['projectKey' => 'test_projectKey'], + '/{projectKey}/me/business-units' + ], 'ResourceByProjectKeyMeCarts' => [ function (ApiRequestBuilder $builder): ResourceByProjectKeyMeCarts { return $builder @@ -334,6 +347,17 @@ function (ApiRequestBuilder $builder): ResourceByProjectKeyMeQuoteRequests { ['projectKey' => 'test_projectKey'], '/{projectKey}/me/quote-requests' ], + 'ResourceByProjectKeyMeQuotes' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyMeQuotes { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->quotes(); + }, + ResourceByProjectKeyMeQuotes::class, + ['projectKey' => 'test_projectKey'], + '/{projectKey}/me/quotes' + ], 'ResourceByProjectKeyMeShoppingLists' => [ function (ApiRequestBuilder $builder): ResourceByProjectKeyMeShoppingLists { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyOrdersQuotesTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyOrdersQuotesTest.php new file mode 100644 index 00000000000..333bf3413f3 --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyOrdersQuotesTest.php @@ -0,0 +1,223 @@ +assertSame(strtolower($method), strtolower($request->getMethod())); + $this->assertSame($relativeUri, (string) $request->getUri()); + if (!is_null($body)) { + $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); + } else { + $this->assertSame("", (string) $request->getBody()); + } + } + + + + /** + * @dataProvider getRequestBuilderResponses() + */ + public function testMapFromResponse(callable $builderFunction, $statusCode) + { + $builder = new ApiRequestBuilder(); + $request = $builderFunction($builder); + $this->assertInstanceOf(ApiRequest::class, $request); + + $response = new Response($statusCode, [], "{}"); + $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteClientException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); + + $this->expectException(ApiClientException::class); + $request->execute(); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteServerException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); + + $this->expectException(ApiServerException::class); + $request->execute(); + } + + public function getRequests() + { + return [ + 'ByProjectKeyOrdersQuotesPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->orders() + ->orderQuote() + ->post(null); + }, + 'post', + 'test_projectKey/orders/quotes', + ] + ]; + } + + public function getResources() + { + return [ + ]; + } + + public function getRequestBuilders() + { + return [ + 'ByProjectKeyOrdersQuotesPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->orders() + ->orderQuote() + ->post(null); + } + ] + ]; + } + + public function getRequestBuilderResponses() + { + return [ + 'ByProjectKeyOrdersQuotesPost_201' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->orders() + ->orderQuote() + ->post(null); + }, + 201 + ], + 'ByProjectKeyOrdersQuotesPost_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->orders() + ->orderQuote() + ->post(null); + }, + 400 + ], + 'ByProjectKeyOrdersQuotesPost_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->orders() + ->orderQuote() + ->post(null); + }, + 401 + ], + 'ByProjectKeyOrdersQuotesPost_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->orders() + ->orderQuote() + ->post(null); + }, + 403 + ], + 'ByProjectKeyOrdersQuotesPost_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->orders() + ->orderQuote() + ->post(null); + }, + 404 + ], + 'ByProjectKeyOrdersQuotesPost_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->orders() + ->orderQuote() + ->post(null); + }, + 500 + ], + 'ByProjectKeyOrdersQuotesPost_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->orders() + ->orderQuote() + ->post(null); + }, + 502 + ], + 'ByProjectKeyOrdersQuotesPost_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->orders() + ->orderQuote() + ->post(null); + }, + 503 + ], + 'ByProjectKeyOrdersQuotesPost_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->orders() + ->orderQuote() + ->post(null); + }, + 599 + ] + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyOrdersTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyOrdersTest.php index 76d1a40fbc1..7483d727a5d 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyOrdersTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyOrdersTest.php @@ -13,6 +13,7 @@ use Commercetools\Api\Client\Resource\ResourceByProjectKeyOrdersEdits; use Commercetools\Api\Client\Resource\ResourceByProjectKeyOrdersImport; use Commercetools\Api\Client\Resource\ResourceByProjectKeyOrdersOrderNumberByOrderNumber; +use Commercetools\Api\Client\Resource\ResourceByProjectKeyOrdersQuotes; use Commercetools\Api\Client\Resource\ResourceByProjectKeyOrdersSearch; use Commercetools\Base\JsonObject; use Commercetools\Client\ApiRequest; @@ -230,6 +231,17 @@ function (ApiRequestBuilder $builder): ResourceByProjectKeyOrdersImport { ['projectKey' => 'test_projectKey'], '/{projectKey}/orders/import' ], + 'ResourceByProjectKeyOrdersQuotes' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyOrdersQuotes { + return $builder + ->withProjectKey("test_projectKey") + ->orders() + ->orderQuote(); + }, + ResourceByProjectKeyOrdersQuotes::class, + ['projectKey' => 'test_projectKey'], + '/{projectKey}/orders/quotes' + ], 'ResourceByProjectKeyOrdersOrderNumberByOrderNumber' => [ function (ApiRequestBuilder $builder): ResourceByProjectKeyOrdersOrderNumberByOrderNumber { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductTypesByIDTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductTypesByIDTest.php index 1fee3a60a42..1a4088c5d68 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductTypesByIDTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductTypesByIDTest.php @@ -22,6 +22,7 @@ /** * @covers \Commercetools\Api\Client\Resource\ByProjectKeyProductTypesByIDGet + * @covers \Commercetools\Api\Client\Resource\ByProjectKeyProductTypesByIDHead * @covers \Commercetools\Api\Client\Resource\ByProjectKeyProductTypesByIDPost * @covers \Commercetools\Api\Client\Resource\ByProjectKeyProductTypesByIDDelete * @covers \Commercetools\Api\Client\Resource\ResourceByProjectKeyProductTypesByID @@ -115,6 +116,17 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/product-types/test_ID', ], + 'ByProjectKeyProductTypesByIDHead' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->productTypes() + ->withId("test_ID") + ->head(); + }, + 'head', + 'test_projectKey/product-types/test_ID', + ], 'ByProjectKeyProductTypesByIDPost_withExpand' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -194,6 +206,15 @@ function (ApiRequestBuilder $builder): RequestInterface { ->get(); } ], + 'ByProjectKeyProductTypesByIDHead' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withId("ID") + ->head(); + } + ], 'ByProjectKeyProductTypesByIDPost' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -308,6 +329,96 @@ function (ApiRequestBuilder $builder): RequestInterface { }, 599 ], + 'ByProjectKeyProductTypesByIDHead_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withId("ID") + ->head(); + }, + 200 + ], + 'ByProjectKeyProductTypesByIDHead_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withId("ID") + ->head(); + }, + 404 + ], + 'ByProjectKeyProductTypesByIDHead_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withId("ID") + ->head(); + }, + 400 + ], + 'ByProjectKeyProductTypesByIDHead_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withId("ID") + ->head(); + }, + 401 + ], + 'ByProjectKeyProductTypesByIDHead_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withId("ID") + ->head(); + }, + 403 + ], + 'ByProjectKeyProductTypesByIDHead_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withId("ID") + ->head(); + }, + 500 + ], + 'ByProjectKeyProductTypesByIDHead_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withId("ID") + ->head(); + }, + 502 + ], + 'ByProjectKeyProductTypesByIDHead_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withId("ID") + ->head(); + }, + 503 + ], + 'ByProjectKeyProductTypesByIDHead_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withId("ID") + ->head(); + }, + 599 + ], 'ByProjectKeyProductTypesByIDPost_200' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductTypesKeyByKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductTypesKeyByKeyTest.php index 5c129ac2604..f02cda3197a 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductTypesKeyByKeyTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductTypesKeyByKeyTest.php @@ -22,6 +22,7 @@ /** * @covers \Commercetools\Api\Client\Resource\ByProjectKeyProductTypesKeyByKeyGet + * @covers \Commercetools\Api\Client\Resource\ByProjectKeyProductTypesKeyByKeyHead * @covers \Commercetools\Api\Client\Resource\ByProjectKeyProductTypesKeyByKeyPost * @covers \Commercetools\Api\Client\Resource\ByProjectKeyProductTypesKeyByKeyDelete * @covers \Commercetools\Api\Client\Resource\ResourceByProjectKeyProductTypesKeyByKey @@ -115,6 +116,17 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/product-types/key=test_key', ], + 'ByProjectKeyProductTypesKeyByKeyHead' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->productTypes() + ->withKey("test_key") + ->head(); + }, + 'head', + 'test_projectKey/product-types/key=test_key', + ], 'ByProjectKeyProductTypesKeyByKeyPost_withExpand' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -194,6 +206,15 @@ function (ApiRequestBuilder $builder): RequestInterface { ->get(); } ], + 'ByProjectKeyProductTypesKeyByKeyHead' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withKey("key") + ->head(); + } + ], 'ByProjectKeyProductTypesKeyByKeyPost' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -308,6 +329,96 @@ function (ApiRequestBuilder $builder): RequestInterface { }, 599 ], + 'ByProjectKeyProductTypesKeyByKeyHead_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withKey("key") + ->head(); + }, + 200 + ], + 'ByProjectKeyProductTypesKeyByKeyHead_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withKey("key") + ->head(); + }, + 404 + ], + 'ByProjectKeyProductTypesKeyByKeyHead_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withKey("key") + ->head(); + }, + 400 + ], + 'ByProjectKeyProductTypesKeyByKeyHead_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withKey("key") + ->head(); + }, + 401 + ], + 'ByProjectKeyProductTypesKeyByKeyHead_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withKey("key") + ->head(); + }, + 403 + ], + 'ByProjectKeyProductTypesKeyByKeyHead_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withKey("key") + ->head(); + }, + 500 + ], + 'ByProjectKeyProductTypesKeyByKeyHead_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withKey("key") + ->head(); + }, + 502 + ], + 'ByProjectKeyProductTypesKeyByKeyHead_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withKey("key") + ->head(); + }, + 503 + ], + 'ByProjectKeyProductTypesKeyByKeyHead_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withKey("key") + ->head(); + }, + 599 + ], 'ByProjectKeyProductTypesKeyByKeyPost_200' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductTypesTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductTypesTest.php index 5a4c4984c56..cf099644799 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductTypesTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductTypesTest.php @@ -24,6 +24,7 @@ /** * @covers \Commercetools\Api\Client\Resource\ByProjectKeyProductTypesGet + * @covers \Commercetools\Api\Client\Resource\ByProjectKeyProductTypesHead * @covers \Commercetools\Api\Client\Resource\ByProjectKeyProductTypesPost * @covers \Commercetools\Api\Client\Resource\ResourceByProjectKeyProductTypes */ @@ -189,6 +190,27 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/product-types', ], + 'ByProjectKeyProductTypesHead_withWhere' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->productTypes() + ->head() + ->withWhere('where'); + }, + 'head', + 'test_projectKey/product-types?where=where', + ], + 'ByProjectKeyProductTypesHead' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->productTypes() + ->head(); + }, + 'head', + 'test_projectKey/product-types', + ], 'ByProjectKeyProductTypesPost_withExpand' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -252,6 +274,14 @@ function (ApiRequestBuilder $builder): RequestInterface { ->get(); } ], + 'ByProjectKeyProductTypesHead' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->head(); + } + ], 'ByProjectKeyProductTypesPost' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -347,6 +377,87 @@ function (ApiRequestBuilder $builder): RequestInterface { }, 599 ], + 'ByProjectKeyProductTypesHead_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->head(); + }, + 200 + ], + 'ByProjectKeyProductTypesHead_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->head(); + }, + 404 + ], + 'ByProjectKeyProductTypesHead_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->head(); + }, + 400 + ], + 'ByProjectKeyProductTypesHead_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->head(); + }, + 401 + ], + 'ByProjectKeyProductTypesHead_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->head(); + }, + 403 + ], + 'ByProjectKeyProductTypesHead_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->head(); + }, + 500 + ], + 'ByProjectKeyProductTypesHead_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->head(); + }, + 502 + ], + 'ByProjectKeyProductTypesHead_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->head(); + }, + 503 + ], + 'ByProjectKeyProductTypesHead_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->productTypes() + ->head(); + }, + 599 + ], 'ByProjectKeyProductTypesPost_201' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsByIDTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsByIDTest.php index 4fbbb93fd3b..128cb648afa 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsByIDTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsByIDTest.php @@ -152,30 +152,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/products/test_ID?priceChannel=priceChannel', ], - 'ByProjectKeyProductsByIDGet_withLocaleProjection' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->products() - ->withId('test_ID') - ->get() - ->withLocaleProjection('localeProjection'); - }, - 'get', - 'test_projectKey/products/test_ID?localeProjection=localeProjection', - ], - 'ByProjectKeyProductsByIDGet_withStoreProjection' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->products() - ->withId('test_ID') - ->get() - ->withStoreProjection('storeProjection'); - }, - 'get', - 'test_projectKey/products/test_ID?storeProjection=storeProjection', - ], 'ByProjectKeyProductsByIDGet_withExpand' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -258,30 +234,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'post', 'test_projectKey/products/test_ID?priceChannel=priceChannel', ], - 'ByProjectKeyProductsByIDPost_withLocaleProjection' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->products() - ->withId('test_ID') - ->post(null) - ->withLocaleProjection('localeProjection'); - }, - 'post', - 'test_projectKey/products/test_ID?localeProjection=localeProjection', - ], - 'ByProjectKeyProductsByIDPost_withStoreProjection' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->products() - ->withId('test_ID') - ->post(null) - ->withStoreProjection('storeProjection'); - }, - 'post', - 'test_projectKey/products/test_ID?storeProjection=storeProjection', - ], 'ByProjectKeyProductsByIDPost_withExpand' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -353,30 +305,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'delete', 'test_projectKey/products/test_ID?priceChannel=priceChannel', ], - 'ByProjectKeyProductsByIDDelete_withLocaleProjection' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->products() - ->withId('test_ID') - ->delete() - ->withLocaleProjection('localeProjection'); - }, - 'delete', - 'test_projectKey/products/test_ID?localeProjection=localeProjection', - ], - 'ByProjectKeyProductsByIDDelete_withStoreProjection' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->products() - ->withId('test_ID') - ->delete() - ->withStoreProjection('storeProjection'); - }, - 'delete', - 'test_projectKey/products/test_ID?storeProjection=storeProjection', - ], 'ByProjectKeyProductsByIDDelete_withVersion' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsKeyByKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsKeyByKeyTest.php index 2d04da3f418..267d0316128 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsKeyByKeyTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsKeyByKeyTest.php @@ -151,30 +151,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/products/key=test_key?priceChannel=priceChannel', ], - 'ByProjectKeyProductsKeyByKeyGet_withLocaleProjection' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->products() - ->withKey('test_key') - ->get() - ->withLocaleProjection('localeProjection'); - }, - 'get', - 'test_projectKey/products/key=test_key?localeProjection=localeProjection', - ], - 'ByProjectKeyProductsKeyByKeyGet_withStoreProjection' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->products() - ->withKey('test_key') - ->get() - ->withStoreProjection('storeProjection'); - }, - 'get', - 'test_projectKey/products/key=test_key?storeProjection=storeProjection', - ], 'ByProjectKeyProductsKeyByKeyGet_withExpand' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -257,30 +233,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'post', 'test_projectKey/products/key=test_key?priceChannel=priceChannel', ], - 'ByProjectKeyProductsKeyByKeyPost_withLocaleProjection' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->products() - ->withKey('test_key') - ->post(null) - ->withLocaleProjection('localeProjection'); - }, - 'post', - 'test_projectKey/products/key=test_key?localeProjection=localeProjection', - ], - 'ByProjectKeyProductsKeyByKeyPost_withStoreProjection' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->products() - ->withKey('test_key') - ->post(null) - ->withStoreProjection('storeProjection'); - }, - 'post', - 'test_projectKey/products/key=test_key?storeProjection=storeProjection', - ], 'ByProjectKeyProductsKeyByKeyPost_withExpand' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -352,30 +304,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'delete', 'test_projectKey/products/key=test_key?priceChannel=priceChannel', ], - 'ByProjectKeyProductsKeyByKeyDelete_withLocaleProjection' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->products() - ->withKey('test_key') - ->delete() - ->withLocaleProjection('localeProjection'); - }, - 'delete', - 'test_projectKey/products/key=test_key?localeProjection=localeProjection', - ], - 'ByProjectKeyProductsKeyByKeyDelete_withStoreProjection' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->products() - ->withKey('test_key') - ->delete() - ->withStoreProjection('storeProjection'); - }, - 'delete', - 'test_projectKey/products/key=test_key?storeProjection=storeProjection', - ], 'ByProjectKeyProductsKeyByKeyDelete_withVersion' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsTest.php index 83d61ee56e7..04b85b8bbef 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductsTest.php @@ -103,6 +103,17 @@ public function testExecuteServerException(callable $builderFunction) public function getRequests() { return [ + 'ByProjectKeyProductsGet_withWhere' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->products() + ->get() + ->withWhere('where'); + }, + 'get', + 'test_projectKey/products?where=where', + ], 'ByProjectKeyProductsGet_withPriceCurrency' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -147,28 +158,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/products?priceChannel=priceChannel', ], - 'ByProjectKeyProductsGet_withLocaleProjection' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->products() - ->get() - ->withLocaleProjection('localeProjection'); - }, - 'get', - 'test_projectKey/products?localeProjection=localeProjection', - ], - 'ByProjectKeyProductsGet_withStoreProjection' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->products() - ->get() - ->withStoreProjection('storeProjection'); - }, - 'get', - 'test_projectKey/products?storeProjection=storeProjection', - ], 'ByProjectKeyProductsGet_withExpand' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -224,17 +213,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/products?withTotal=withTotal', ], - 'ByProjectKeyProductsGet_withWhere' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->products() - ->get() - ->withWhere('where'); - }, - 'get', - 'test_projectKey/products?where=where', - ], 'ByProjectKeyProductsGet_withPredicateVar' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -256,6 +234,17 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/products', ], + 'ByProjectKeyProductsHead_withWhere' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->products() + ->head() + ->withWhere('where'); + }, + 'head', + 'test_projectKey/products?where=where', + ], 'ByProjectKeyProductsHead' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -310,28 +299,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'post', 'test_projectKey/products?priceChannel=priceChannel', ], - 'ByProjectKeyProductsPost_withLocaleProjection' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->products() - ->post(null) - ->withLocaleProjection('localeProjection'); - }, - 'post', - 'test_projectKey/products?localeProjection=localeProjection', - ], - 'ByProjectKeyProductsPost_withStoreProjection' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->products() - ->post(null) - ->withStoreProjection('storeProjection'); - }, - 'post', - 'test_projectKey/products?storeProjection=storeProjection', - ], 'ByProjectKeyProductsPost_withExpand' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsByIDHealthTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsByIDHealthTest.php new file mode 100644 index 00000000000..997289b2cb6 --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsByIDHealthTest.php @@ -0,0 +1,179 @@ +assertSame(strtolower($method), strtolower($request->getMethod())); + $this->assertSame($relativeUri, (string) $request->getUri()); + if (!is_null($body)) { + $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); + } else { + $this->assertSame("", (string) $request->getBody()); + } + } + + + + /** + * @dataProvider getRequestBuilderResponses() + */ + public function testMapFromResponse(callable $builderFunction, $statusCode) + { + $builder = new ApiRequestBuilder(); + $request = $builderFunction($builder); + $this->assertInstanceOf(ApiRequest::class, $request); + + $response = new Response($statusCode, [], "{}"); + $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteClientException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); + + $this->expectException(ApiClientException::class); + $request->execute(); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteServerException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); + + $this->expectException(ApiServerException::class); + $request->execute(); + } + + public function getRequests() + { + return [ + 'ByProjectKeySubscriptionsByIDHealthGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->subscriptions() + ->withId("test_ID") + ->withIdHealth() + ->get(); + }, + 'get', + 'test_projectKey/subscriptions/test_ID/health', + ] + ]; + } + + public function getResources() + { + return [ + ]; + } + + public function getRequestBuilders() + { + return [ + 'ByProjectKeySubscriptionsByIDHealthGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->subscriptions() + ->withId("ID") + ->withIdHealth() + ->get(); + } + ] + ]; + } + + public function getRequestBuilderResponses() + { + return [ + 'ByProjectKeySubscriptionsByIDHealthGet_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->subscriptions() + ->withId("ID") + ->withIdHealth() + ->get(); + }, + 200 + ], + 'ByProjectKeySubscriptionsByIDHealthGet_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->subscriptions() + ->withId("ID") + ->withIdHealth() + ->get(); + }, + 400 + ], + 'ByProjectKeySubscriptionsByIDHealthGet_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->subscriptions() + ->withId("ID") + ->withIdHealth() + ->get(); + }, + 503 + ], + 'ByProjectKeySubscriptionsByIDHealthGet_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->subscriptions() + ->withId("ID") + ->withIdHealth() + ->get(); + }, + 599 + ] + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsByIDTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsByIDTest.php index 7a95a764a31..edb80c88d6a 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsByIDTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsByIDTest.php @@ -9,6 +9,7 @@ namespace Commercetools\Api\Test\Client\Resource; use Commercetools\Api\Client\ApiRequestBuilder; +use Commercetools\Api\Client\Resource\ResourceByProjectKeySubscriptionsByIDHealth; use Commercetools\Base\JsonObject; use Commercetools\Client\ApiRequest; use Commercetools\Exception\ApiClientException; @@ -44,7 +45,16 @@ public function testBuilder(callable $builderFunction, string $method, string $r } } - + /** + * @dataProvider getResources() + */ + public function testResources(callable $builderFunction, string $class, array $expectedArgs) + { + $builder = new ApiRequestBuilder(); + $resource = $builderFunction($builder); + $this->assertInstanceOf($class, $resource); + $this->assertEquals($expectedArgs, $resource->getArgs()); + } /** * @dataProvider getRequestBuilderResponses() @@ -179,6 +189,18 @@ function (ApiRequestBuilder $builder): RequestInterface { public function getResources() { return [ + 'ResourceByProjectKeySubscriptionsByIDHealth' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeySubscriptionsByIDHealth { + return $builder + ->withProjectKey("test_projectKey") + ->subscriptions() + ->withId("test_ID") + ->withIdHealth(); + }, + ResourceByProjectKeySubscriptionsByIDHealth::class, + ['projectKey' => 'test_projectKey', 'ID' => 'test_ID'], + '/{projectKey}/subscriptions/{ID}/health' + ] ]; } diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyTest.php index 845a6715eba..6f8ccc65e54 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyTest.php @@ -10,6 +10,7 @@ use Commercetools\Api\Client\ApiRequestBuilder; use Commercetools\Api\Client\Resource\ResourceByProjectKeyApiClients; +use Commercetools\Api\Client\Resource\ResourceByProjectKeyBusinessUnits; use Commercetools\Api\Client\Resource\ResourceByProjectKeyCartDiscounts; use Commercetools\Api\Client\Resource\ResourceByProjectKeyCarts; use Commercetools\Api\Client\Resource\ResourceByProjectKeyCategories; @@ -20,6 +21,7 @@ use Commercetools\Api\Client\Resource\ResourceByProjectKeyDiscountCodes; use Commercetools\Api\Client\Resource\ResourceByProjectKeyExtensions; use Commercetools\Api\Client\Resource\ResourceByProjectKeyGraphql; +use Commercetools\Api\Client\Resource\ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKey; use Commercetools\Api\Client\Resource\ResourceByProjectKeyInStoreKeyByStoreKey; use Commercetools\Api\Client\Resource\ResourceByProjectKeyInventory; use Commercetools\Api\Client\Resource\ResourceByProjectKeyLogin; @@ -160,6 +162,16 @@ function (ApiRequestBuilder $builder): RequestInterface { public function getResources() { return [ + 'ResourceByProjectKeyBusinessUnits' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyBusinessUnits { + return $builder + ->withProjectKey("test_projectKey") + ->businessUnits(); + }, + ResourceByProjectKeyBusinessUnits::class, + ['projectKey' => 'test_projectKey'], + '/{projectKey}/business-units' + ], 'ResourceByProjectKeyCategories' => [ function (ApiRequestBuilder $builder): ResourceByProjectKeyCategories { return $builder @@ -519,6 +531,16 @@ function (ApiRequestBuilder $builder): ResourceByProjectKeyStandalonePrices { ResourceByProjectKeyStandalonePrices::class, ['projectKey' => 'test_projectKey'], '/{projectKey}/standalone-prices' + ], + 'ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKey' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKey { + return $builder + ->withProjectKey("test_projectKey") + ->inBusinessUnitKeyWithBusinessUnitKeyValue("test_businessUnitKey"); + }, + ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKey::class, + ['projectKey' => 'test_projectKey', 'businessUnitKey' => 'test_businessUnitKey'], + '/{projectKey}/in-business-unit/key={businessUnitKey}' ] ]; } diff --git a/lib/commercetools-api/docs/RequestBuilder.md b/lib/commercetools-api/docs/RequestBuilder.md index 89bf10d17fc..67ec6be4151 100644 --- a/lib/commercetools-api/docs/RequestBuilder.md +++ b/lib/commercetools-api/docs/RequestBuilder.md @@ -92,6 +92,124 @@ $request = $builder ->withId("ID") ->delete(); ``` +## `withProjectKey("projectKey")->businessUnits()->get()` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->get(); +``` +## `withProjectKey("projectKey")->businessUnits()->post(null)` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->post(null); +``` +## `withProjectKey("projectKey")->businessUnits()->withId("ID")->get()` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->get(); +``` +## `withProjectKey("projectKey")->businessUnits()->withId("ID")->post(null)` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->post(null); +``` +## `withProjectKey("projectKey")->businessUnits()->withId("ID")->delete()` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withId("ID") + ->delete(); +``` +## `withProjectKey("projectKey")->businessUnits()->withKey("key")->get()` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->get(); +``` +## `withProjectKey("projectKey")->businessUnits()->withKey("key")->post(null)` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->post(null); +``` +## `withProjectKey("projectKey")->businessUnits()->withKey("key")->delete()` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->businessUnits() + ->withKey("key") + ->delete(); +``` ## `withProjectKey("projectKey")->cartDiscounts()->get()` null @@ -388,7 +506,7 @@ $request = $builder Either the [scope](/../api/scopes) `manage_products:{projectKey}` or `manage_categories:{projectKey}` is required. -Creating a Category produces the [CategoryCreatedMessage](/../api/message-types#categorycreatedmessage). +Creating a Category produces the [CategoryCreated](ctp:api:type:CategoryCreatedMessage) Message. ### Example @@ -782,9 +900,9 @@ $request = $builder ``` ## `withProjectKey("projectKey")->customers()->post(null)` -Creates a customer. If an anonymous cart is passed in, -then the cart is assigned to the created customer and the version number of the Cart will increase. -If the ID of an anonymous session is given, all carts and orders will be assigned to the created customer. +If the `anonymousCart` field is set on the [CustomerDraft](ctp:api:type:CustomerDraft), then the newly created Customer will be assigned to that [Cart](ctp:api:type:Cart). +Similarly, if the `anonymousId` field is set, the Customer will be set on all [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [ShoppingLists](ctp:api:type:ShoppingList) and [Payments](ctp:api:type:Payment) with the same `anonymousId`. +Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. ### Example @@ -829,7 +947,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->customers()->withId("ID")->delete()` -null +Deleting a Customer produces the [CustomerDeleted](ctp:api:type:CustomerDeletedMessage) Message. + ### Example ```php @@ -844,7 +963,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->customers()->emailConfirm()->post(null)` -Verifies customer's email using a token. +Verifying the email of the Customer produces the [CustomerEmailVerified](ctp:api:type:CustomerEmailVerifiedMessage) Message. + ### Example ```php @@ -859,7 +979,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->customers()->emailToken()->post(null)` -Create a Token for verifying the Customer's Email +null ### Example ```php @@ -919,7 +1039,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->customers()->withKey("key")->delete()` -null +Deleting a Customer produces the [CustomerDeleted](ctp:api:type:CustomerDeletedMessage) Message. + ### Example ```php @@ -934,7 +1055,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->customers()->password()->post(null)` -Change a customers password +Changing the password produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=false`. + ### Example ```php @@ -949,7 +1071,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->customers()->passwordReset()->post(null)` -Set a new password using a token. +Resetting the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=true`. + ### Example ```php @@ -964,9 +1087,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->customers()->passwordToken()->post(null)` -The token value is used to reset the password of the customer with the given email. The token is -valid only for 10 minutes. - +null ### Example ```php @@ -1199,6 +1320,26 @@ $request = $builder ->graphql() ->post(null); ``` +## `withProjectKey("projectKey")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->me()->customers()->post(null)` + +The My Business Unit endpoint does not support assigning existing Customers to a Business Unit. +Use this endpoint to create a new Customer and associate it with the Business Unit. +The user must have the `Admin` role within the Business Unit to perform this request. +The new Customer is created with an empty set of roles. + + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey") + ->me() + ->customers() + ->post(null); +``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->get()` Queries carts in a specific Store. @@ -1401,14 +1542,12 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->post(null)` -Creates a customer in a specific Store. -When using this endpoint, if omitted, -the customer's stores field is set to the store specified in the path parameter. -If an anonymous cart is passed in as when using this method, -then the cart is assigned to the created customer and the version number of the Cart increases. -If the ID of an anonymous session is given, all carts and orders will be assigned to the created customer and -the store specified. If you pass in a cart with a store field specified, -the store field must reference the same store specified in the {storeKey} path parameter. +When using this endpoint, if omitted, the Customer `stores` field is set to the Store specified in the path parameter. + +If the `anonymousCart` field is set on the [CustomerDraft](ctp:api:type:CustomerDraft), then the newly created Customer will be assigned to that [Cart](ctp:api:type:Cart). +Similarly, if the `anonymousId` field is set, the Customer will be set on all [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [ShoppingLists](ctp:api:type:ShoppingList) and [Payments](ctp:api:type:Payment) with the same `anonymousId`. +If a Cart with a `store` field specified, the `store` field must reference the same Store specified in the `{storeKey}` path parameter. +Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. ### Example @@ -1424,10 +1563,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withId("ID")->get()` -Returns a customer by its ID from a specific Store. -It also considers customers that do not have the stores field. -If the customer exists in the project but the stores field references different stores, -this method returns a ResourceNotFound error. +If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -1444,9 +1580,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withId("ID")->post(null)` -Updates a customer in the store specified by {storeKey}. -If the customer exists in the project but the stores field references a different store, -this method returns a ResourceNotFound error. +If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -1463,7 +1597,10 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withId("ID")->delete()` -null +Deleting a Customer produces the [CustomerDeleted](ctp:api:type:CustomerDeletedMessage) Message. + +If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. + ### Example ```php @@ -1479,7 +1616,11 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->emailConfirm()->post(null)` -Verifies customer's email using a token. +The customer verifies the email using the token value. +Verifying the email of the Customer produces the [CustomerEmailVerified](ctp:api:type:CustomerEmailVerifiedMessage) Message. + +If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. + ### Example ```php @@ -1495,7 +1636,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->emailToken()->post(null)` -Create a Token for verifying the Customer's Email in store +If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. + ### Example ```php @@ -1511,7 +1653,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withEmailToken("emailToken")->get()` -null +If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. + ### Example ```php @@ -1527,10 +1670,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withKey("key")->get()` -Returns a customer by its Key from a specific Store. -It also considers customers that do not have the stores field. -If the customer exists in the project but the stores field references different stores, -this method returns a ResourceNotFound error. +If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -1547,8 +1687,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withKey("key")->post(null)` -If the customer exists in the project but the stores field references a different store, -this method returns a ResourceNotFound error. +If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -1565,7 +1704,10 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withKey("key")->delete()` -null +Deleting a Customer produces the [CustomerDeleted](ctp:api:type:CustomerDeletedMessage) Message. + +If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. + ### Example ```php @@ -1581,7 +1723,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->password()->post(null)` -Change a customers password +Changing the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=false`. + ### Example ```php @@ -1597,7 +1740,10 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->passwordReset()->post(null)` -Set a new password using a token. +Resetting the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=true`. + +If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. + ### Example ```php @@ -1613,8 +1759,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->passwordToken()->post(null)` -The token value is used to reset the password of the customer with the given email. The token is -valid only for 10 minutes. +If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -1631,7 +1776,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withPasswordToken("passwordToken")->get()` -null +If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. + ### Example ```php @@ -1647,7 +1793,10 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->login()->post(null)` -Authenticate Customer (Sign In) in store +Authenticates a Customer associated with a Store. For more information, see [Global versus Store-specific Customers](/../api/customers-overview#global-versus-store-specific-customers). + +If the Customer exists in the Project but the `stores` field references a different Store, this method returns an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error. + ### Example ```php @@ -1677,7 +1826,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->post(null)` -Update my customer in a store +null ### Example ```php @@ -1692,7 +1841,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->delete()` -Delete my Customer in a store +null ### Example ```php @@ -1806,7 +1955,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->emailConfirm()->post(null)` -null +This is the last step in the [email verification process of a Customer](/../api/projects/customers#email-verification-of-customer-in-store). + ### Example ```php @@ -1822,7 +1972,15 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->login()->post(null)` -null +Retrieves the authenticated Customer (that matches the given email/password pair) if they are part of a specific [Store](ctp:api:type:Store). + +- If the Customer does not have a Cart, the most recently modified anonymous cart becomes the Customer's Cart. +- If the Customer already has a Cart, the most recently modified anonymous cart is handled according to [AnonymousCartSignInMode](ctp:api:type:AnonymousCartSignInMode). + +If a Cart is returned as part of [CustomerSignInResult](ctp:api:type:CustomerSignInResult), it has been [recalculated](/../api/projects/carts#recalculate) with up-to-date prices, taxes, discounts, and invalid line items removed. + +If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned. + ### Example ```php @@ -1887,7 +2045,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->password()->post(null)` -null +Changing the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=false`. + ### Example ```php @@ -1903,7 +2062,10 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->password()->reset()->post(null)` -null +This is the last step in the [password reset process of the authenticated Customer](/../api/projects/customers#password-reset-of-customer-in-store). + +Resetting a password produces the of the Customer [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=true`. + ### Example ```php @@ -2054,7 +2216,10 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->signup()->post(null)` -null +If omitted in the request body, the [Customer](ctp:api:type:Customer) `stores` field is set to the Store specified in the path parameter. + +Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. + ### Example ```php @@ -2429,7 +2594,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inventory()->post(null)` -Produces the [InventoryEntryCreatedMessage](ctp:api:type:InventoryEntryCreatedMessage). +Produces the [InventoryEntryCreated](ctp:api:type:InventoryEntryCreatedMessage) Message. ### Example ```php @@ -2473,7 +2638,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inventory()->withId("ID")->delete()` -Produces the [InventoryEntryDeletedMessage](ctp:api:type:InventoryEntryDeletedMessage). +Produces the [InventoryEntryDeleted](ctp:api:type:InventoryEntryDeletedMessage) Message. ### Example ```php @@ -2518,7 +2683,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inventory()->withKey("key")->delete()` -Produces the [InventoryEntryDeletedMessage](ctp:api:type:InventoryEntryDeletedMessage). +Produces the [InventoryEntryDeleted](ctp:api:type:InventoryEntryDeletedMessage) Message. ### Example ```php @@ -2533,13 +2698,11 @@ $request = $builder ``` ## `withProjectKey("projectKey")->login()->post(null)` -Authenticate Customer (Sign In). Retrieves the authenticated -customer (a customer that matches the given email/password pair). -If used with an access token for Anonymous Sessions, -all orders and carts belonging to the anonymousId will be assigned to the newly created customer. -If a cart is is returned as part of the CustomerSignInResult, -it has been recalculated (It will have up-to-date prices, taxes and discounts, -and invalid line items have been removed.). +Authenticates a global Customer not associated with a Store. +For more information, see [Global versus Store-specific Customers](/../api/customers-overview#global-versus-store-specific-customers). +If the Customer is registered in a Store, use the [Authenticate (sign in) Customer in Store](/../api/projects/customers#authenticate-sign-in-customer-in-store) method. + +If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned. ### Example @@ -2568,7 +2731,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->me()->post(null)` -Update my customer +null ### Example ```php @@ -2582,7 +2745,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->me()->delete()` -Delete my Customer +null ### Example ```php @@ -2609,6 +2772,132 @@ $request = $builder ->activeCart() ->get(); ``` +## `withProjectKey("projectKey")->me()->businessUnits()->get()` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->get(); +``` +## `withProjectKey("projectKey")->me()->businessUnits()->post(null)` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->post(null); +``` +## `withProjectKey("projectKey")->me()->businessUnits()->withId("ID")->get()` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->get(); +``` +## `withProjectKey("projectKey")->me()->businessUnits()->withId("ID")->post(null)` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->post(null); +``` +## `withProjectKey("projectKey")->me()->businessUnits()->withId("ID")->delete()` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withId("ID") + ->delete(); +``` +## `withProjectKey("projectKey")->me()->businessUnits()->withKey("key")->get()` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->get(); +``` +## `withProjectKey("projectKey")->me()->businessUnits()->withKey("key")->post(null)` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->post(null); +``` +## `withProjectKey("projectKey")->me()->businessUnits()->withKey("key")->delete()` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->me() + ->businessUnits() + ->withKey("key") + ->delete(); +``` ## `withProjectKey("projectKey")->me()->carts()->get()` null @@ -2753,7 +3042,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->me()->emailConfirm()->post(null)` -null +This is the last step in the [email verification process of a Customer](/../api/projects/customers#email-verification-of-customer). + ### Example ```php @@ -2768,7 +3058,17 @@ $request = $builder ``` ## `withProjectKey("projectKey")->me()->login()->post(null)` -null +Retrieves the authenticated customer (that matches the given email/password pair). + +If used with [an access token for an anonymous session](/../api/authorization#tokens-for-anonymous-sessions), all Orders and Carts that belong to the `anonymousId` are assigned to the newly logged-in Customer. + +- If the Customer does not have a Cart yet, the most recently modified anonymous cart becomes the Customer's Cart. +- If the Customer already has a Cart, the most recently modified anonymous cart is handled in accordance with [AnonymousCartSignInMode](ctp:api:type:AnonymousCartSignInMode). + +A Cart returned as part of the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) is [recalculated](ctp:api:type:Recalculate) with up-to-date prices, taxes, discounts, and invalid line items removed. + +If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned. + ### Example ```php @@ -2829,7 +3129,10 @@ $request = $builder ``` ## `withProjectKey("projectKey")->me()->password()->post(null)` -null +Changing the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=false`. + +If the current password does not match, an [InvalidCurrentPassword](ctp:api:type:InvalidCurrentPasswordError) error is returned. + ### Example ```php @@ -2844,7 +3147,10 @@ $request = $builder ``` ## `withProjectKey("projectKey")->me()->password()->reset()->post(null)` -null +This is the last step in the [password reset process of a Customer](/../api/projects/customers#password-reset-of-customer). + +Resetting a password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=true`. + ### Example ```php @@ -3110,6 +3416,85 @@ $request = $builder ->withKey("key") ->delete(); ``` +## `withProjectKey("projectKey")->me()->quotes()->get()` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->get(); +``` +## `withProjectKey("projectKey")->me()->quotes()->withId("ID")->get()` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->get(); +``` +## `withProjectKey("projectKey")->me()->quotes()->withId("ID")->post(null)` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withId("ID") + ->post(null); +``` +## `withProjectKey("projectKey")->me()->quotes()->withKey("key")->get()` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->get(); +``` +## `withProjectKey("projectKey")->me()->quotes()->withKey("key")->post(null)` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->me() + ->quotes() + ->withKey("key") + ->post(null); +``` ## `withProjectKey("projectKey")->me()->shoppingLists()->get()` null @@ -3238,7 +3623,10 @@ $request = $builder ``` ## `withProjectKey("projectKey")->me()->signup()->post(null)` -null +If used with an [access token for an anonymous session](/../api/authorization#tokens-for-anonymous-sessions), all Orders and Carts that belong to the `anonymousId` are assigned to the newly created Customer. + +Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. + ### Example ```php @@ -3253,7 +3641,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->messages()->get()` -null +Deprecated scope: `view_orders:{projectKey}` ### Example ```php @@ -3267,7 +3655,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->messages()->withId("ID")->get()` -null +Deprecated scope: `view_orders:{projectKey}` ### Example ```php @@ -3561,6 +3949,21 @@ $request = $builder ->withOrderNumber("orderNumber") ->delete(); ``` +## `withProjectKey("projectKey")->orders()->orderQuote()->post(null)` + +Create an Order from a Quote + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->orders() + ->orderQuote() + ->post(null); +``` ## `withProjectKey("projectKey")->orders()->search()->post(null)` null @@ -4106,6 +4509,20 @@ $request = $builder ->productTypes() ->get(); ``` +## `withProjectKey("projectKey")->productTypes()->head()` + +Check if Product Types exist. Responds with a `200 OK` status if any Product Types match the Query Predicate, or `404 Not Found` otherwise. + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->productTypes() + ->head(); +``` ## `withProjectKey("projectKey")->productTypes()->post(null)` null @@ -4135,6 +4552,21 @@ $request = $builder ->withId("ID") ->get(); ``` +## `withProjectKey("projectKey")->productTypes()->withId("ID")->head()` + +Checks if a Product Type with given `id` exists. Responds with a `200 OK` status if the `Product Type` exists or `404 Not Found` otherwise. + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withId("ID") + ->head(); +``` ## `withProjectKey("projectKey")->productTypes()->withId("ID")->post(null)` null @@ -4180,6 +4612,21 @@ $request = $builder ->withKey("key") ->get(); ``` +## `withProjectKey("projectKey")->productTypes()->withKey("key")->head()` + +Checks if a Product Type with given `key` exists. Responds with a `200 OK` status if the `Product Type` exists or `404 Not Found` otherwise. + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->productTypes() + ->withKey("key") + ->head(); +``` ## `withProjectKey("projectKey")->productTypes()->withKey("key")->post(null)` null @@ -4212,10 +4659,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->products()->get()` -You can use the query endpoint to get the full representations of products. -REMARK: We suggest to use the performance optimized search endpoint which has a bunch functionalities, -the query API lacks like sorting on custom attributes, etc. - +If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. ### Example ```php @@ -4229,7 +4673,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->products()->head()` -Checks if products exist. +Check if Products exist. Responds with a `200 OK` status if any Products match the Query Predicate, or `404 Not Found` otherwise. ### Example ```php @@ -4243,9 +4687,9 @@ $request = $builder ``` ## `withProjectKey("projectKey")->products()->post(null)` -To create a new product, send a representation that is going to become the initial staged representation -of the new product in the master catalog. If price selection query parameters are provided, -the selected prices will be added to the response. +To create a new Product, send a representation that is going to become the initial _staged_ representation of the new Product in the master catalog. +If [Price Selection](ctp:api:type:ProductPriceSelection) query parameters are provided, selected Prices will be added to the response. +Produces the [ProductCreated](/projects/messages#product-created) Message. ### Example @@ -4260,7 +4704,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->products()->withId("ID")->get()` -Gets the full representation of a product by ID. +If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. ### Example ```php @@ -4275,7 +4719,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->products()->withId("ID")->head()` -Checks if product with given ID exists. +Check if a Product exists with a specified `id`. Responds with a `200 OK` status if the Product exists or `404 Not Found` otherwise. ### Example ```php @@ -4290,7 +4734,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->products()->withId("ID")->post(null)` -null +If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. ### Example ```php @@ -4305,7 +4749,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->products()->withId("ID")->delete()` -null +If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. +Produces the [ProductDeleted](/projects/messages#product-deleted) Message. ### Example ```php @@ -4320,7 +4765,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->products()->withId("ID")->images()->post(null)` -Uploads a binary image file to a given product variant. The supported image formats are JPEG, PNG and GIF. +Upload a JPEG, PNG and GIF file to a [ProductVariant](ctp:api:type:ProductVariant). The maximum file size of the image is 10MB. `variant` or `sku` is required to update a specific ProductVariant. The image is uploaded to the Master Variant if `variant` or `sku` are not included. Produces the [ProductImageAdded](/projects/messages#product-image-added) Message when the `Small` version of the image has been uploaded to the CDN. ### Example @@ -4353,7 +4798,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->products()->withKey("key")->get()` -Gets the full representation of a product by Key. +If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. ### Example ```php @@ -4368,7 +4813,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->products()->withKey("key")->head()` -Checks if product with given key exists. +Check if a Product exists with a specified `key`. Responds with a `200 OK` status if the Product exists or `404 Not Found` otherwise. ### Example ```php @@ -4398,7 +4843,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->products()->withKey("key")->delete()` -null +If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. +Produces the [ProductDeleted](/projects/messages#product-deleted) Message. ### Example ```php @@ -5205,7 +5651,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->standalonePrices()->post(null)` -Produces the [StandalonePriceCreatedMessage](ctp:api:type:StandalonePriceCreatedMessage). +Produces the [StandalonePriceCreated](ctp:api:type:StandalonePriceCreatedMessage) Message. ### Example @@ -5250,7 +5696,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->standalonePrices()->withId("ID")->delete()` -Produces the [StandalonePriceDeletedMessage](ctp:api:type:StandalonePriceDeletedMessage). +Produces the [StandalonePriceDeleted](ctp:api:type:StandalonePriceDeletedMessage) Message. ### Example @@ -5296,7 +5742,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->standalonePrices()->withKey("key")->delete()` -Produces the [StandalonePriceDeletedMessage](ctp:api:type:StandalonePriceDeletedMessage). +Produces the [StandalonePriceDeleted](ctp:api:type:StandalonePriceDeletedMessage) Message. ### Example @@ -5562,11 +6008,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->subscriptions()->post(null)` -The creation of a Subscription is eventually consistent, it may take up to a minute before it becomes fully active. -In order to test that the destination is correctly configured, a test message will be put into the queue. -If the message could not be delivered, the subscription will not be created. -The payload of the test message is a notification of type ResourceCreated for the resourceTypeId subscription. -Currently, a maximum of 25 subscriptions can be created per project. +A test message is sent to ensure the correct configuration of the Destination. If the message cannot be delivered, the Subscription will not be created. The payload of the test message is a notification of type [ResourceCreated](/../api/projects/subscriptions#resourcecreateddeliverypayload) for the `resourceTypeId` `subscription`. ### Example @@ -5581,7 +6023,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->subscriptions()->withId("ID")->get()` -Retrieves the representation of a subscription by its id. +null ### Example ```php @@ -5624,9 +6066,26 @@ $request = $builder ->withId("ID") ->delete(); ``` +## `withProjectKey("projectKey")->subscriptions()->withId("ID")->withIdHealth()->get()` + +This endpoint can be polled by a monitoring or alerting system that checks the health of your Subscriptions. To ease integration with such systems this endpoint does not require [Authorization](/../api/authorization). + + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->subscriptions() + ->withId("ID") + ->withIdHealth() + ->get(); +``` ## `withProjectKey("projectKey")->subscriptions()->withKey("key")->get()` -Retrieves the representation of a subscription by its key. +null ### Example ```php diff --git a/lib/commercetools-api/src/Client/ApiRequestBuilder.php b/lib/commercetools-api/src/Client/ApiRequestBuilder.php index c4ab8a5a325..1c94c0696ab 100644 --- a/lib/commercetools-api/src/Client/ApiRequestBuilder.php +++ b/lib/commercetools-api/src/Client/ApiRequestBuilder.php @@ -13,6 +13,9 @@ use Commercetools\Client\ApiResource; use GuzzleHttp\ClientInterface; +/** + * + */ class ApiRequestBuilder extends ApiResource { /** diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyApiClientsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyApiClientsByIDDelete.php index 0fc0310bd73..790cf1bdbca 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyApiClientsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyApiClientsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable * @template-implements Deprecatable200 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyApiClientsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyApiClientsByIDGet.php index 9e706ac54c4..a02b637139f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyApiClientsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyApiClientsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable * @template-implements Deprecatable200 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyApiClientsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyApiClientsGet.php index 60c6579206e..6b3169edc7c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyApiClientsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyApiClientsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyApiClientsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyApiClientsPost.php index 1ec0c7b281c..bd646c3e495 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyApiClientsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyApiClientsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsByIDDelete.php new file mode 100644 index 00000000000..d5d7a53ab1b --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsByIDDelete.php @@ -0,0 +1,170 @@ + + * @template-implements Conflicting + * @template-implements Expandable + * @template-implements Errorable + * @template-implements Deprecatable200 + */ +class ByProjectKeyBusinessUnitsByIDDelete extends ApiRequest implements Versioned, Conflicting, Expandable, Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $ID, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{ID}'], [$projectKey, $ID], '{projectKey}/business-units/{ID}'); + parent::__construct($client, 'DELETE', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return BusinessUnit|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = BusinessUnitModel::class; + + break; + case '409': + $resultType = ErrorResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|BusinessUnit|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $version + */ + public function withVersion($version): ByProjectKeyBusinessUnitsByIDDelete + { + return $this->withQueryParam('version', $version); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyBusinessUnitsByIDDelete + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsByIDGet.php new file mode 100644 index 00000000000..b3062a5561d --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsByIDGet.php @@ -0,0 +1,155 @@ + + * @template-implements Errorable + * @template-implements Deprecatable200 + */ +class ByProjectKeyBusinessUnitsByIDGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $ID, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{ID}'], [$projectKey, $ID], '{projectKey}/business-units/{ID}'); + parent::__construct($client, 'GET', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return BusinessUnit|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = BusinessUnitModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|BusinessUnit|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyBusinessUnitsByIDGet + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsByIDPost.php new file mode 100644 index 00000000000..e61447dcecb --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsByIDPost.php @@ -0,0 +1,160 @@ + + * @template-implements Expandable + * @template-implements Deprecatable200 + * @template-implements Errorable + */ +class ByProjectKeyBusinessUnitsByIDPost extends ApiRequest implements Conflicting, Expandable, Deprecatable200, Errorable +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $ID, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{ID}'], [$projectKey, $ID], '{projectKey}/business-units/{ID}'); + parent::__construct($client, 'POST', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return BusinessUnit|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = BusinessUnitModel::class; + + break; + case '409': + $resultType = ErrorResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|BusinessUnit|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyBusinessUnitsByIDPost + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsGet.php new file mode 100644 index 00000000000..4b8d9b29aa7 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsGet.php @@ -0,0 +1,212 @@ + + * @template-implements Sortable + * @template-implements Paging + * @template-implements Query + * @template-implements Errorable + * @template-implements Deprecatable200 + */ +class ByProjectKeyBusinessUnitsGet extends ApiRequest implements Expandable, Sortable, Paging, Query, Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}'], [$projectKey], '{projectKey}/business-units'); + parent::__construct($client, 'GET', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return BusinessUnitPagedQueryResponse|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = BusinessUnitPagedQueryResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|BusinessUnitPagedQueryResponse|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyBusinessUnitsGet + { + return $this->withQueryParam('expand', $expand); + } + + /** + * + * @psalm-param scalar|scalar[] $sort + */ + public function withSort($sort): ByProjectKeyBusinessUnitsGet + { + return $this->withQueryParam('sort', $sort); + } + + /** + * + * @psalm-param scalar|scalar[] $limit + */ + public function withLimit($limit): ByProjectKeyBusinessUnitsGet + { + return $this->withQueryParam('limit', $limit); + } + + /** + * + * @psalm-param scalar|scalar[] $offset + */ + public function withOffset($offset): ByProjectKeyBusinessUnitsGet + { + return $this->withQueryParam('offset', $offset); + } + + /** + * + * @psalm-param scalar|scalar[] $withTotal + */ + public function withWithTotal($withTotal): ByProjectKeyBusinessUnitsGet + { + return $this->withQueryParam('withTotal', $withTotal); + } + + /** + * + * @psalm-param scalar|scalar[] $where + */ + public function withWhere($where): ByProjectKeyBusinessUnitsGet + { + return $this->withQueryParam('where', $where); + } + + /** + * @psalm-param string $varName + * @psalm-param scalar|scalar[] $predicateVar + */ + public function withPredicateVar(string $varName, $predicateVar): ByProjectKeyBusinessUnitsGet + { + return $this->withQueryParam(sprintf('var.%s', $varName), $predicateVar); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsKeyByKeyDelete.php new file mode 100644 index 00000000000..833d0ed44b3 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsKeyByKeyDelete.php @@ -0,0 +1,170 @@ + + * @template-implements Conflicting + * @template-implements Expandable + * @template-implements Errorable + * @template-implements Deprecatable200 + */ +class ByProjectKeyBusinessUnitsKeyByKeyDelete extends ApiRequest implements Versioned, Conflicting, Expandable, Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $key, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{key}'], [$projectKey, $key], '{projectKey}/business-units/key={key}'); + parent::__construct($client, 'DELETE', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return BusinessUnit|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = BusinessUnitModel::class; + + break; + case '409': + $resultType = ErrorResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|BusinessUnit|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $version + */ + public function withVersion($version): ByProjectKeyBusinessUnitsKeyByKeyDelete + { + return $this->withQueryParam('version', $version); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyBusinessUnitsKeyByKeyDelete + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsKeyByKeyGet.php new file mode 100644 index 00000000000..2ddf459ea66 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsKeyByKeyGet.php @@ -0,0 +1,155 @@ + + * @template-implements Errorable + * @template-implements Deprecatable200 + */ +class ByProjectKeyBusinessUnitsKeyByKeyGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $key, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{key}'], [$projectKey, $key], '{projectKey}/business-units/key={key}'); + parent::__construct($client, 'GET', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return BusinessUnit|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = BusinessUnitModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|BusinessUnit|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyBusinessUnitsKeyByKeyGet + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsKeyByKeyPost.php new file mode 100644 index 00000000000..b82366018af --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsKeyByKeyPost.php @@ -0,0 +1,160 @@ + + * @template-implements Expandable + * @template-implements Deprecatable200 + * @template-implements Errorable + */ +class ByProjectKeyBusinessUnitsKeyByKeyPost extends ApiRequest implements Conflicting, Expandable, Deprecatable200, Errorable +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $key, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{key}'], [$projectKey, $key], '{projectKey}/business-units/key={key}'); + parent::__construct($client, 'POST', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return BusinessUnit|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = BusinessUnitModel::class; + + break; + case '409': + $resultType = ErrorResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|BusinessUnit|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyBusinessUnitsKeyByKeyPost + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsPost.php new file mode 100644 index 00000000000..8514975fd64 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyBusinessUnitsPost.php @@ -0,0 +1,155 @@ + + * @template-implements Deprecatable201 + * @template-implements Errorable + */ +class ByProjectKeyBusinessUnitsPost extends ApiRequest implements Expandable, Deprecatable201, Errorable +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}'], [$projectKey], '{projectKey}/business-units'); + parent::__construct($client, 'POST', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return BusinessUnit|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '201': + $resultType = BusinessUnitModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|BusinessUnit|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyBusinessUnitsPost + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsByIDDelete.php index 9c5a553ba15..66b93efcdab 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsByIDGet.php index 7d2030254a8..75189ae6bfb 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsByIDPost.php index 14081d7a3c3..9b3673fd3f0 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsGet.php index b567845922a..1794e465c87 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsKeyByKeyDelete.php index b05e0dec2f3..d484b30b251 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsKeyByKeyGet.php index b197774538d..803938c2735 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsKeyByKeyPost.php index 7cebd5770bc..19798afcdf3 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsPost.php index 1af3d85617f..ea21f53e9f5 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartDiscountsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsByIDDelete.php index 90357d58d3e..401453909ef 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsByIDGet.php index 1d57138e418..009ce4a2864 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsByIDPost.php index 1e28b68cfb4..2495a06990b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsCustomerIdByCustomerIdGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsCustomerIdByCustomerIdGet.php index 67fad9dcd32..62eb6607e29 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsCustomerIdByCustomerIdGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsCustomerIdByCustomerIdGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsGet.php index 060f02ee7f2..d3ce6a6dd04 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsKeyByKeyDelete.php index 1ece62ad80f..9fccbc63683 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsKeyByKeyGet.php index 9167ce6109e..b8a4b473661 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsKeyByKeyPost.php index 34522c37349..c0efdcfae3e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsPost.php index f3bd45374ce..39dad717c25 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsReplicatePost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsReplicatePost.php index c398173f92f..60d09d18270 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsReplicatePost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCartsReplicatePost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesByIDDelete.php index 3912836f847..953c3ed09b3 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesByIDGet.php index 6ab7535142e..65bf7ad636b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesByIDPost.php index c588f0883d2..5281f218f6f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesGet.php index bc1ed1deba2..18a8bb25f4b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesKeyByKeyDelete.php index 714afeb94e5..fbaf5785c35 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesKeyByKeyGet.php index 7cc671866e8..3aabcffcf1b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesKeyByKeyPost.php index b29a1f3f13e..28a9b479fc9 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesPost.php index 3c167259937..0c3b99a7cfd 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCategoriesPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsByIDDelete.php index 5f83a678531..2b0f8750673 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsByIDGet.php index 0391c09351c..cd8af4c4a04 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsByIDPost.php index 792fd6ceb62..38794d90434 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsGet.php index 253a0e066ba..78e99ef35c2 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsPost.php index c2ce5a327a4..8140e2983ce 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyChannelsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsByContainerByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsByContainerByKeyDelete.php index bb003824a87..610292a173d 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsByContainerByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsByContainerByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsByContainerByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsByContainerByKeyGet.php index 64f3cf43240..48b915670d7 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsByContainerByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsByContainerByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsByContainerGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsByContainerGet.php index 6b27b99883e..292f77a4839 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsByContainerGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsByContainerGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Query * @template-implements Paging diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsGet.php index 655afb55d6b..d548cbf1e93 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @deprecated * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsPost.php index b17e9b830b9..24aa3c7e569 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomObjectsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsByIDDelete.php index 894b2a470be..d62a43378f2 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsByIDGet.php index 68551ba301a..4a3b6242995 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsByIDPost.php index f06f4b500db..da7949a6405 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsGet.php index 9138c867903..42a67d08031 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsKeyByKeyDelete.php index c5697eda5e1..bd1d056e4cb 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsKeyByKeyGet.php index 0580eb3565b..0e3667b033e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsKeyByKeyPost.php index da9f94f51ee..0d2553a0757 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsPost.php index 1ef26890939..1a2a0b38cfa 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomerGroupsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersByIDDelete.php index 8d4ada43fc1..c000cfd7533 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersByIDGet.php index f9933db6e16..bbf6f1f052e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersByIDPost.php index 0f9c76567fa..a0aebb1bb83 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersEmailConfirmPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersEmailConfirmPost.php index 1f34877e210..c64efe37538 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersEmailConfirmPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersEmailConfirmPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersEmailTokenByEmailTokenGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersEmailTokenByEmailTokenGet.php index 50fd01a0aae..2baf52b2b0a 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersEmailTokenByEmailTokenGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersEmailTokenByEmailTokenGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersEmailTokenPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersEmailTokenPost.php index 5401d319bd8..d4751d6bf19 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersEmailTokenPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersEmailTokenPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersGet.php index 2b81a2ccb52..b055db902a2 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersKeyByKeyDelete.php index ec43ac756b2..07ccf1446ee 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersKeyByKeyGet.php index 1cc2445eff9..751bb3a599f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersKeyByKeyPost.php index 7f6057cc08d..b44912406ec 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPasswordPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPasswordPost.php index 0126ebc1994..c9cf7d66a03 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPasswordPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPasswordPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPasswordResetPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPasswordResetPost.php index 4cb8350e221..da843000878 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPasswordResetPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPasswordResetPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPasswordTokenByPasswordTokenGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPasswordTokenByPasswordTokenGet.php index 98a63e38182..878b3413955 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPasswordTokenByPasswordTokenGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPasswordTokenByPasswordTokenGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPasswordTokenPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPasswordTokenPost.php index e3fcbb35456..f62ebd3989e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPasswordTokenPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPasswordTokenPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPost.php index d76dc6c1111..69b81b96cae 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyCustomersPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesByIDDelete.php index a95c1824211..cc80b41fcd4 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesByIDGet.php index f8dd276b715..15ca61d302b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesByIDPost.php index ff90d3a2089..30ead2966ad 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesGet.php index c97be28f4db..19cc7bb8fc6 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesPost.php index 4979a1a6b74..b4011a6f6c9 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyDiscountCodesPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDDelete.php index bd89708f9c9..66fc6010f59 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDGet.php index b68c686ab3e..0a777057bdb 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDPost.php index 7fa1192b263..ad0a5a02a57 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsGet.php index 10c0dd5b004..82f033cc34d 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyDelete.php index 887bc608e2c..61e87d37ed8 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyGet.php index 561580c4812..86db4cbce59 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyPost.php index f470b473d2f..7b9e08641e0 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsPost.php index 4e331645b79..bac8cf6a02b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyGet.php index 684e117c637..1405d5caa7e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable * @template-implements Deprecatable200 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyGraphqlPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyGraphqlPost.php index 4a67c517119..c970f004a02 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyGraphqlPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyGraphqlPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomersPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomersPost.php new file mode 100644 index 00000000000..8c52d970f17 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomersPost.php @@ -0,0 +1,118 @@ + $headers + */ + public function __construct(string $projectKey, string $businessUnitKey, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{businessUnitKey}'], [$projectKey, $businessUnitKey], '{projectKey}/in-business-unit/key={businessUnitKey}/me/customers'); + parent::__construct($client, 'POST', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return CustomerSignInResult|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '201': + $resultType = CustomerSignInResultModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|CustomerSignInResult|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsByIDDelete.php index 5132490df6d..f9328c51306 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsByIDGet.php index b20da413058..877bd19ebf4 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsByIDPost.php index 22d968b07c8..1136ecb2803 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdGet.php index 7c6c735a9bf..bb1d4b78b0c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsGet.php index a2849a8ad87..9bd2c96de59 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyDelete.php index 41cfceb62f9..bb0f19e5945 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyGet.php index bd9eaa0cf53..d1e8323990c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyPost.php index ba1b76fe276..23fe23c10cf 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsPost.php index fb591c67a1d..307178509fb 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsReplicatePost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsReplicatePost.php index 37919694bb5..b36414f29a8 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsReplicatePost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartsReplicatePost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersByIDDelete.php index 4f59b0094fa..c1e1025f96b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersByIDGet.php index 33eb6c65075..20854f6e188 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersByIDPost.php index 9236d6147cd..ed02948792a 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersEmailConfirmPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersEmailConfirmPost.php index 88becd4ac2a..ee6b2c9fb8c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersEmailConfirmPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersEmailConfirmPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenByEmailTokenGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenByEmailTokenGet.php index 3a35ea6ca8a..02a7db012d4 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenByEmailTokenGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenByEmailTokenGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenPost.php index be777bb9c99..1e7c5e26490 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersEmailTokenPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersGet.php index 0ef94670612..aa9bb898434 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyDelete.php index ee078a94035..18bc8d029e0 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyGet.php index 2727598e3ba..8ef57798c7c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyPost.php index 2b04d213ae1..60c8a832267 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordPost.php index b5058f7ca22..6f58e1524b8 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetPost.php index a987383f6ab..430bf74265f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenByPasswordTokenGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenByPasswordTokenGet.php index 903d50e4647..8595268d59b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenByPasswordTokenGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenByPasswordTokenGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenPost.php index 37c27548c00..b37b07f5ec5 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordTokenPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPost.php index 3b275099789..43da24d675b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCustomersPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyLoginPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyLoginPost.php index 3a6e5209248..6249c91b763 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyLoginPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyLoginPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeActiveCartGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeActiveCartGet.php index 58551f4358f..9d3f97e72f5 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeActiveCartGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeActiveCartGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable * @template-implements Deprecatable200 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDDelete.php index 437002c052a..452cd8c55aa 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDGet.php index b0189c930fb..34d6c92ae12 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDPost.php index 15cca993432..fa2420635cf 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsGet.php index 191becd5559..df6b9209e93 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsPost.php index 93564faeb7c..ed3cca9c589 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeCartsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeDelete.php index cc9909c33f3..30d18252ec3 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmPost.php index 05d89cafa71..5dd1fae4de1 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeGet.php index 54a349311b1..10ce3a2dda6 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeGet.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Sortable * @template-implements Paging diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeLoginPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeLoginPost.php index ed4ab9ada90..10377a791f7 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeLoginPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeLoginPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeOrdersByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeOrdersByIDGet.php index a2ffeaa13e4..323021aedec 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeOrdersByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeOrdersByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeOrdersGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeOrdersGet.php index d2756f0149a..c36eb3d5fbb 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeOrdersGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeOrdersGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeOrdersPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeOrdersPost.php index a87cc0f1e5c..40da3ec38f2 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeOrdersPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeOrdersPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMePasswordPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMePasswordPost.php index 899b131b2fa..2ab1710dd12 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMePasswordPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMePasswordPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMePasswordResetPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMePasswordResetPost.php index 4bc4c93b3b3..ca5b25e54f3 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMePasswordResetPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMePasswordResetPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMePost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMePost.php index 2b33fc10f1a..ddf24a8f3b4 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMePost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMePost.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDDelete.php index c9dfb5435f0..c281b74cfa6 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDGet.php index 9351a0a5d92..f55d8e4c147 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDPost.php index f4630b4f0b5..485b29e5d00 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsGet.php index edfdab6b30c..02ebbcce6de 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyDelete.php index 234cbbe6398..859bd9d603c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyGet.php index 1af3cf3078b..494fcfa9ff3 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyPost.php index 00b5468e6f3..90512a39510 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsPost.php index 17aa0361797..884d9e71498 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeSignupPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeSignupPost.php index fb952e29a19..864df7dc162 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeSignupPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyMeSignupPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersByIDDelete.php index c9c5d8af64c..b5a962c94d2 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersByIDGet.php index fe65f1b429f..a5a017d7291 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersByIDPost.php index 0d5bbfa52cc..7eb0467db54 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersGet.php index 832dcb472fe..a281228c84e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberDelete.php index ceed96c8b7b..9c81e8d2866 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberGet.php index 07bd377ea7b..25a974bc2c7 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberPost.php index 2b8b885cd36..44ccab2a742 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersPost.php index 6365d300135..274d504acad 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyOrdersPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet.php index a79032f9cf2..2a8036319e6 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet.php @@ -28,12 +28,15 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor + * @template-implements PriceSelecting + * @template-implements LocaleProjecting * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 +class ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet extends ApiRequest implements PriceSelecting, LocaleProjecting, Expandable, Errorable, Deprecatable200 { /** * @param ?object|array|string $body @@ -143,6 +146,51 @@ function (RequestException $e) use ($resultType) { ); } + /** + * + * @psalm-param scalar|scalar[] $priceCurrency + */ + public function withPriceCurrency($priceCurrency): ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet + { + return $this->withQueryParam('priceCurrency', $priceCurrency); + } + + /** + * + * @psalm-param scalar|scalar[] $priceCountry + */ + public function withPriceCountry($priceCountry): ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet + { + return $this->withQueryParam('priceCountry', $priceCountry); + } + + /** + * + * @psalm-param scalar|scalar[] $priceCustomerGroup + */ + public function withPriceCustomerGroup($priceCustomerGroup): ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet + { + return $this->withQueryParam('priceCustomerGroup', $priceCustomerGroup); + } + + /** + * + * @psalm-param scalar|scalar[] $priceChannel + */ + public function withPriceChannel($priceChannel): ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet + { + return $this->withQueryParam('priceChannel', $priceChannel); + } + + /** + * + * @psalm-param scalar|scalar[] $localeProjection + */ + public function withLocaleProjection($localeProjection): ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet + { + return $this->withQueryParam('localeProjection', $localeProjection); + } + /** * * @psalm-param scalar|scalar[] $expand diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet.php index 242341ca671..93f5b938f96 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet.php @@ -28,12 +28,15 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor + * @template-implements PriceSelecting + * @template-implements LocaleProjecting * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 +class ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet extends ApiRequest implements PriceSelecting, LocaleProjecting, Expandable, Errorable, Deprecatable200 { /** * @param ?object|array|string $body @@ -143,6 +146,51 @@ function (RequestException $e) use ($resultType) { ); } + /** + * + * @psalm-param scalar|scalar[] $priceCurrency + */ + public function withPriceCurrency($priceCurrency): ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet + { + return $this->withQueryParam('priceCurrency', $priceCurrency); + } + + /** + * + * @psalm-param scalar|scalar[] $priceCountry + */ + public function withPriceCountry($priceCountry): ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet + { + return $this->withQueryParam('priceCountry', $priceCountry); + } + + /** + * + * @psalm-param scalar|scalar[] $priceCustomerGroup + */ + public function withPriceCustomerGroup($priceCustomerGroup): ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet + { + return $this->withQueryParam('priceCustomerGroup', $priceCustomerGroup); + } + + /** + * + * @psalm-param scalar|scalar[] $priceChannel + */ + public function withPriceChannel($priceChannel): ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet + { + return $this->withQueryParam('priceChannel', $priceChannel); + } + + /** + * + * @psalm-param scalar|scalar[] $localeProjection + */ + public function withLocaleProjection($localeProjection): ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet + { + return $this->withQueryParam('localeProjection', $localeProjection); + } + /** * * @psalm-param scalar|scalar[] $expand diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsGet.php index 60632159e45..9f270a73406 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShippingMethodsMatchingCartGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShippingMethodsMatchingCartGet.php index fabcb81e4bb..90e61ee471c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShippingMethodsMatchingCartGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShippingMethodsMatchingCartGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDDelete.php index 4c66b0392ae..786ca836ccb 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDGet.php index ece4f95944b..cbd4c67d414 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDPost.php index c335c0c60e8..e6924affa08 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsGet.php index 84f6d380353..2e72fe78fcb 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyDelete.php index ec8a5c33bbb..28bd4e2c1cf 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyGet.php index 6028076a400..a8b75e05f2e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyPost.php index 5cf216f2f9e..b6cc50c431f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsPost.php index 92e7fa113b7..f4b7325043b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyShoppingListsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryByIDDelete.php index 60e51f9521f..e0316500677 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryByIDGet.php index db8a65adf88..224bea3e99d 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryByIDPost.php index e48c50d5cc5..8ca30bc0d3e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryGet.php index a649cac8f4a..00228bb6c67 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryKeyByKeyDelete.php index 3cbee98a4f0..de8eb802ece 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryKeyByKeyGet.php index 50a8dedc72e..6bfb6f7028c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryKeyByKeyPost.php index 2b8fe5bce15..8adf8ec4b01 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryPost.php index cdcc1413bfa..245ce190c22 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInventoryPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyLoginPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyLoginPost.php index aad182457b8..5e6c033d3f9 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyLoginPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyLoginPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeActiveCartGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeActiveCartGet.php index 88358ea6235..3b46f201992 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeActiveCartGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeActiveCartGet.php @@ -28,11 +28,13 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor + * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyMeActiveCartGet extends ApiRequest implements Errorable, Deprecatable200 +class ByProjectKeyMeActiveCartGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 { /** * @param ?object|array|string $body @@ -141,4 +143,13 @@ function (RequestException $e) use ($resultType) { } ); } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyMeActiveCartGet + { + return $this->withQueryParam('expand', $expand); + } } diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsByIDDelete.php new file mode 100644 index 00000000000..b7a22faf846 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsByIDDelete.php @@ -0,0 +1,170 @@ + + * @template-implements Conflicting + * @template-implements Expandable + * @template-implements Errorable + * @template-implements Deprecatable200 + */ +class ByProjectKeyMeBusinessUnitsByIDDelete extends ApiRequest implements Versioned, Conflicting, Expandable, Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $ID, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{ID}'], [$projectKey, $ID], '{projectKey}/me/business-units/{ID}'); + parent::__construct($client, 'DELETE', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return BusinessUnit|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = BusinessUnitModel::class; + + break; + case '409': + $resultType = ErrorResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|BusinessUnit|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $version + */ + public function withVersion($version): ByProjectKeyMeBusinessUnitsByIDDelete + { + return $this->withQueryParam('version', $version); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyMeBusinessUnitsByIDDelete + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsByIDGet.php new file mode 100644 index 00000000000..46d297f46f5 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsByIDGet.php @@ -0,0 +1,155 @@ + + * @template-implements Errorable + * @template-implements Deprecatable200 + */ +class ByProjectKeyMeBusinessUnitsByIDGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $ID, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{ID}'], [$projectKey, $ID], '{projectKey}/me/business-units/{ID}'); + parent::__construct($client, 'GET', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return BusinessUnit|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = BusinessUnitModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|BusinessUnit|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyMeBusinessUnitsByIDGet + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsByIDPost.php new file mode 100644 index 00000000000..03efea4dbb5 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsByIDPost.php @@ -0,0 +1,160 @@ + + * @template-implements Expandable + * @template-implements Deprecatable200 + * @template-implements Errorable + */ +class ByProjectKeyMeBusinessUnitsByIDPost extends ApiRequest implements Conflicting, Expandable, Deprecatable200, Errorable +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $ID, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{ID}'], [$projectKey, $ID], '{projectKey}/me/business-units/{ID}'); + parent::__construct($client, 'POST', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return BusinessUnit|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = BusinessUnitModel::class; + + break; + case '409': + $resultType = ErrorResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|BusinessUnit|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyMeBusinessUnitsByIDPost + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsGet.php new file mode 100644 index 00000000000..1bb12071db2 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsGet.php @@ -0,0 +1,212 @@ + + * @template-implements Sortable + * @template-implements Paging + * @template-implements Query + * @template-implements Errorable + * @template-implements Deprecatable200 + */ +class ByProjectKeyMeBusinessUnitsGet extends ApiRequest implements Expandable, Sortable, Paging, Query, Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}'], [$projectKey], '{projectKey}/me/business-units'); + parent::__construct($client, 'GET', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return BusinessUnitPagedQueryResponse|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = BusinessUnitPagedQueryResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|BusinessUnitPagedQueryResponse|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyMeBusinessUnitsGet + { + return $this->withQueryParam('expand', $expand); + } + + /** + * + * @psalm-param scalar|scalar[] $sort + */ + public function withSort($sort): ByProjectKeyMeBusinessUnitsGet + { + return $this->withQueryParam('sort', $sort); + } + + /** + * + * @psalm-param scalar|scalar[] $limit + */ + public function withLimit($limit): ByProjectKeyMeBusinessUnitsGet + { + return $this->withQueryParam('limit', $limit); + } + + /** + * + * @psalm-param scalar|scalar[] $offset + */ + public function withOffset($offset): ByProjectKeyMeBusinessUnitsGet + { + return $this->withQueryParam('offset', $offset); + } + + /** + * + * @psalm-param scalar|scalar[] $withTotal + */ + public function withWithTotal($withTotal): ByProjectKeyMeBusinessUnitsGet + { + return $this->withQueryParam('withTotal', $withTotal); + } + + /** + * + * @psalm-param scalar|scalar[] $where + */ + public function withWhere($where): ByProjectKeyMeBusinessUnitsGet + { + return $this->withQueryParam('where', $where); + } + + /** + * @psalm-param string $varName + * @psalm-param scalar|scalar[] $predicateVar + */ + public function withPredicateVar(string $varName, $predicateVar): ByProjectKeyMeBusinessUnitsGet + { + return $this->withQueryParam(sprintf('var.%s', $varName), $predicateVar); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsKeyByKeyDelete.php new file mode 100644 index 00000000000..a86eafa2151 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsKeyByKeyDelete.php @@ -0,0 +1,170 @@ + + * @template-implements Conflicting + * @template-implements Expandable + * @template-implements Errorable + * @template-implements Deprecatable200 + */ +class ByProjectKeyMeBusinessUnitsKeyByKeyDelete extends ApiRequest implements Versioned, Conflicting, Expandable, Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $key, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{key}'], [$projectKey, $key], '{projectKey}/me/business-units/key={key}'); + parent::__construct($client, 'DELETE', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return BusinessUnit|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = BusinessUnitModel::class; + + break; + case '409': + $resultType = ErrorResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|BusinessUnit|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $version + */ + public function withVersion($version): ByProjectKeyMeBusinessUnitsKeyByKeyDelete + { + return $this->withQueryParam('version', $version); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyMeBusinessUnitsKeyByKeyDelete + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsKeyByKeyGet.php new file mode 100644 index 00000000000..cc09b569328 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsKeyByKeyGet.php @@ -0,0 +1,155 @@ + + * @template-implements Errorable + * @template-implements Deprecatable200 + */ +class ByProjectKeyMeBusinessUnitsKeyByKeyGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $key, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{key}'], [$projectKey, $key], '{projectKey}/me/business-units/key={key}'); + parent::__construct($client, 'GET', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return BusinessUnit|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = BusinessUnitModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|BusinessUnit|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyMeBusinessUnitsKeyByKeyGet + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsKeyByKeyPost.php new file mode 100644 index 00000000000..3695dea9320 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsKeyByKeyPost.php @@ -0,0 +1,160 @@ + + * @template-implements Expandable + * @template-implements Deprecatable200 + * @template-implements Errorable + */ +class ByProjectKeyMeBusinessUnitsKeyByKeyPost extends ApiRequest implements Conflicting, Expandable, Deprecatable200, Errorable +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $key, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{key}'], [$projectKey, $key], '{projectKey}/me/business-units/key={key}'); + parent::__construct($client, 'POST', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return BusinessUnit|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = BusinessUnitModel::class; + + break; + case '409': + $resultType = ErrorResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|BusinessUnit|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyMeBusinessUnitsKeyByKeyPost + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsPost.php new file mode 100644 index 00000000000..21d6d83c520 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeBusinessUnitsPost.php @@ -0,0 +1,155 @@ + + * @template-implements Deprecatable201 + * @template-implements Errorable + */ +class ByProjectKeyMeBusinessUnitsPost extends ApiRequest implements Expandable, Deprecatable201, Errorable +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}'], [$projectKey], '{projectKey}/me/business-units'); + parent::__construct($client, 'POST', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return BusinessUnit|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '201': + $resultType = BusinessUnitModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|BusinessUnit|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyMeBusinessUnitsPost + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsByIDDelete.php index 977bfa75f69..e752ab704a2 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsByIDGet.php index 8bd6a5999be..36c86514364 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsByIDPost.php index 5dd69a8a871..a4a675652dc 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsGet.php index 6c44a03aa51..d1440fd2673 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsKeyByKeyDelete.php index e1fa73951b6..5daf32b4c5e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsKeyByKeyGet.php index 9ec618c4ba3..e9accdf61c4 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsKeyByKeyPost.php index 3ad0ae09002..f94f7eef3cf 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsPost.php index d5d900dc373..1f448c7f105 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsReplicatePost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsReplicatePost.php index 5112011bc70..5f43dff645e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsReplicatePost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeCartsReplicatePost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeDelete.php index a7652623d4f..7f507d84bbb 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeEmailConfirmPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeEmailConfirmPost.php index 23754944b27..3fa6e7ed788 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeEmailConfirmPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeEmailConfirmPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeGet.php index 778107e5500..5b01371c340 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Sortable * @template-implements Paging diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeLoginPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeLoginPost.php index fb53c386b39..08a589b5002 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeLoginPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeLoginPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersByIDGet.php index 2f2d3955a93..569746c0163 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersGet.php index 785976bb183..eae6c135857 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersPost.php index b2a352ea8a1..4036095a161 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePasswordPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePasswordPost.php index 2c54230d68e..668260059d9 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePasswordPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePasswordPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePasswordResetPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePasswordResetPost.php index ea1ce757ab8..65a732883da 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePasswordResetPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePasswordResetPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsByIDDelete.php index f85f6ccc81f..c19e7d3160b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsByIDGet.php index 29ce83c1ab9..0f21b7387cb 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsByIDPost.php index 840d3c3a05b..8170f8d6584 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsGet.php index 7ca82376150..e01121e29ed 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyDelete.php index 08c6c36981a..bd8f872ad2e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyGet.php index c9adf029916..4756917cf7b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyPost.php index 20df9447658..4cee545ef45 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsPost.php index c321d19ad47..4567d2ccf46 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePost.php index 889be680e27..1036c17c548 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsByIDDelete.php index 8edb3b2c27d..4f2874cf93d 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsByIDGet.php index 605ee31eef8..d374a408b6a 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsByIDPost.php index dc4cdce7813..e2aa21b29a1 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsGet.php index 7910b230f95..006b0a78401 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsKeyByKeyDelete.php index 5d2a7f86f1c..038526b8429 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsKeyByKeyGet.php index 4f4b9c7f6b5..9139a8fa5bf 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsKeyByKeyPost.php index 078b22e3955..8e5249285c8 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsPost.php index a2a4daf585e..3d2c969eb82 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuoteRequestsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuotesByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuotesByIDGet.php new file mode 100644 index 00000000000..91d21ea770e --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuotesByIDGet.php @@ -0,0 +1,155 @@ + + * @template-implements Errorable + * @template-implements Deprecatable200 + */ +class ByProjectKeyMeQuotesByIDGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $ID, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{ID}'], [$projectKey, $ID], '{projectKey}/me/quotes/{ID}'); + parent::__construct($client, 'GET', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return ErrorResponse|JsonObject|Quote|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = QuoteModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|ErrorResponse|JsonObject|Quote + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyMeQuotesByIDGet + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuotesByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuotesByIDPost.php new file mode 100644 index 00000000000..ea58b20eb88 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuotesByIDPost.php @@ -0,0 +1,160 @@ + + * @template-implements Expandable + * @template-implements Deprecatable200 + * @template-implements Errorable + */ +class ByProjectKeyMeQuotesByIDPost extends ApiRequest implements Conflicting, Expandable, Deprecatable200, Errorable +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $ID, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{ID}'], [$projectKey, $ID], '{projectKey}/me/quotes/{ID}'); + parent::__construct($client, 'POST', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return ErrorResponse|JsonObject|Quote|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = QuoteModel::class; + + break; + case '409': + $resultType = ErrorResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|ErrorResponse|JsonObject|Quote + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyMeQuotesByIDPost + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuotesGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuotesGet.php new file mode 100644 index 00000000000..0c96598836d --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuotesGet.php @@ -0,0 +1,212 @@ + + * @template-implements Sortable + * @template-implements Paging + * @template-implements Query + * @template-implements Errorable + * @template-implements Deprecatable200 + */ +class ByProjectKeyMeQuotesGet extends ApiRequest implements Expandable, Sortable, Paging, Query, Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}'], [$projectKey], '{projectKey}/me/quotes'); + parent::__construct($client, 'GET', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return ErrorResponse|JsonObject|QuotePagedQueryResponse|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = QuotePagedQueryResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|ErrorResponse|JsonObject|QuotePagedQueryResponse + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyMeQuotesGet + { + return $this->withQueryParam('expand', $expand); + } + + /** + * + * @psalm-param scalar|scalar[] $sort + */ + public function withSort($sort): ByProjectKeyMeQuotesGet + { + return $this->withQueryParam('sort', $sort); + } + + /** + * + * @psalm-param scalar|scalar[] $limit + */ + public function withLimit($limit): ByProjectKeyMeQuotesGet + { + return $this->withQueryParam('limit', $limit); + } + + /** + * + * @psalm-param scalar|scalar[] $offset + */ + public function withOffset($offset): ByProjectKeyMeQuotesGet + { + return $this->withQueryParam('offset', $offset); + } + + /** + * + * @psalm-param scalar|scalar[] $withTotal + */ + public function withWithTotal($withTotal): ByProjectKeyMeQuotesGet + { + return $this->withQueryParam('withTotal', $withTotal); + } + + /** + * + * @psalm-param scalar|scalar[] $where + */ + public function withWhere($where): ByProjectKeyMeQuotesGet + { + return $this->withQueryParam('where', $where); + } + + /** + * @psalm-param string $varName + * @psalm-param scalar|scalar[] $predicateVar + */ + public function withPredicateVar(string $varName, $predicateVar): ByProjectKeyMeQuotesGet + { + return $this->withQueryParam(sprintf('var.%s', $varName), $predicateVar); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuotesKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuotesKeyByKeyGet.php new file mode 100644 index 00000000000..bab68effd43 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuotesKeyByKeyGet.php @@ -0,0 +1,155 @@ + + * @template-implements Errorable + * @template-implements Deprecatable200 + */ +class ByProjectKeyMeQuotesKeyByKeyGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $key, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{key}'], [$projectKey, $key], '{projectKey}/me/quotes/key={key}'); + parent::__construct($client, 'GET', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return ErrorResponse|JsonObject|Quote|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = QuoteModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|ErrorResponse|JsonObject|Quote + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyMeQuotesKeyByKeyGet + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuotesKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuotesKeyByKeyPost.php new file mode 100644 index 00000000000..1b745d34a55 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeQuotesKeyByKeyPost.php @@ -0,0 +1,160 @@ + + * @template-implements Expandable + * @template-implements Deprecatable200 + * @template-implements Errorable + */ +class ByProjectKeyMeQuotesKeyByKeyPost extends ApiRequest implements Conflicting, Expandable, Deprecatable200, Errorable +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $key, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{key}'], [$projectKey, $key], '{projectKey}/me/quotes/key={key}'); + parent::__construct($client, 'POST', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return ErrorResponse|JsonObject|Quote|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = QuoteModel::class; + + break; + case '409': + $resultType = ErrorResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|ErrorResponse|JsonObject|Quote + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyMeQuotesKeyByKeyPost + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsByIDDelete.php index 9d1c43a614c..13f049d6c3b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsByIDGet.php index f7403811401..882f2331c95 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsByIDPost.php index b84cff0a1f1..d3739e47b36 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsGet.php index e3c5601c21d..50b4e5b1d95 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsKeyByKeyDelete.php index 06379b3a01b..d768ac622c0 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsKeyByKeyGet.php index 8bb0ddc0c7c..f2a6f9e3026 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsKeyByKeyPost.php index 73daf13c536..58551d6ffb7 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsPost.php index 707333c7ec2..35342f9fc6e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeShoppingListsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeSignupPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeSignupPost.php index 296c3694d6a..0a86556f7f6 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeSignupPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeSignupPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMessagesByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMessagesByIDGet.php index 8d77d45db89..1313e3308f9 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMessagesByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMessagesByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMessagesGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMessagesGet.php index a013d4a8799..24c80453760 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMessagesGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMessagesGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersByIDDelete.php index 7812e2dc547..4fb73f9f158 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersByIDGet.php index 3d758b20626..0876baa9cee 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersByIDPost.php index 776940e4d90..c82bcf0d3e0 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsByIDApplyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsByIDApplyPost.php index 56340d5c1a7..dbfaab8a1e3 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsByIDApplyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsByIDApplyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsByIDDelete.php index 5c880932e5e..65501404342 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsByIDGet.php index cfdf94061b9..0e7e0b91d79 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsByIDPost.php index a8afc37467a..27cbedfa396 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsGet.php index 19d08c033e1..77ba4d05527 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsKeyByKeyDelete.php index 75151f70f4a..e6bc0db2285 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsKeyByKeyGet.php index acf7fc12586..17449d64712 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsKeyByKeyPost.php index e5d7ddb3925..e5968ec1021 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsPost.php index c67e3c487f7..29312c2af6b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersEditsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersGet.php index 4ff964a19a2..3f5371e739e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersImportPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersImportPost.php index 02875afa4bd..d58b06385c4 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersImportPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersImportPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersOrderNumberByOrderNumberDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersOrderNumberByOrderNumberDelete.php index 92a8dede019..099a286446d 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersOrderNumberByOrderNumberDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersOrderNumberByOrderNumberDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersOrderNumberByOrderNumberGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersOrderNumberByOrderNumberGet.php index 65d3c9973bd..18cc9526143 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersOrderNumberByOrderNumberGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersOrderNumberByOrderNumberGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersOrderNumberByOrderNumberPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersOrderNumberByOrderNumberPost.php index faf475bb48f..f17c5705d52 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersOrderNumberByOrderNumberPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersOrderNumberByOrderNumberPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersPost.php index 348f1c2e2bb..31d150eb9be 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersQuotesPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersQuotesPost.php new file mode 100644 index 00000000000..0d05aa15620 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersQuotesPost.php @@ -0,0 +1,144 @@ + + */ +class ByProjectKeyOrdersQuotesPost extends ApiRequest implements Errorable +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}'], [$projectKey], '{projectKey}/orders/quotes'); + parent::__construct($client, 'POST', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return ErrorResponse|JsonObject|Order|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '201': + $resultType = OrderModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|ErrorResponse|JsonObject|Order + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersSearchHead.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersSearchHead.php index 69a36c739fb..b6112fe8e13 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersSearchHead.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersSearchHead.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable * @template-implements Deprecatable200 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersSearchPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersSearchPost.php index 190b33195f5..f908d16cf66 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersSearchPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyOrdersSearchPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsByIDDelete.php index d4d0778a2e0..4b5397207fa 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsByIDGet.php index 43129a5e895..236698fec45 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsByIDPost.php index 375e96aa3a9..8e7d3d69aec 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsGet.php index 48aaaac619b..f754364ca4f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsKeyByKeyDelete.php index e7d9fe0401a..b0541422df3 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsKeyByKeyGet.php index 873c884f324..6292c0bf37e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsKeyByKeyPost.php index 38a5fad2b61..077e114b467 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsPost.php index f2a3c551872..702798e9958 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPaymentsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPost.php index c52ec17e6ae..51516bcef07 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsByIDDelete.php index 7b079600ff9..abcc70daef9 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsByIDGet.php index 564855712c4..e183ac8f533 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsByIDPost.php index 0285d799d38..42aad84b534 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsGet.php index dda79ce168f..8b3451845c8 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsKeyByKeyDelete.php index 8c8ff65a693..2934dd34d1c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsKeyByKeyGet.php index 79b4195be1f..01ac17269eb 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsKeyByKeyPost.php index 39cecab6423..e23b6c098b6 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsMatchingPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsMatchingPost.php index 4fcd628e99a..042d6108171 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsMatchingPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsMatchingPost.php @@ -30,6 +30,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsPost.php index 263623c0836..47e60d6d273 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductDiscountsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsByIDGet.php index 3deaa04e728..2aa78e65e4f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsByIDGet.php @@ -28,13 +28,16 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements PriceSelecting + * @template-implements LocaleProjecting + * @template-implements StoreProjecting * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyProductProjectionsByIDGet extends ApiRequest implements PriceSelecting, Expandable, Errorable, Deprecatable200 +class ByProjectKeyProductProjectionsByIDGet extends ApiRequest implements PriceSelecting, LocaleProjecting, StoreProjecting, Expandable, Errorable, Deprecatable200 { /** * @param ?object|array|string $body diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsGet.php index bc759187666..ca0ca74c48d 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsGet.php @@ -28,8 +28,11 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements PriceSelecting + * @template-implements LocaleProjecting + * @template-implements StoreProjecting * @template-implements Expandable * @template-implements Sortable * @template-implements Paging @@ -37,7 +40,7 @@ * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyProductProjectionsGet extends ApiRequest implements PriceSelecting, Expandable, Sortable, Paging, Query, Errorable, Deprecatable200 +class ByProjectKeyProductProjectionsGet extends ApiRequest implements PriceSelecting, LocaleProjecting, StoreProjecting, Expandable, Sortable, Paging, Query, Errorable, Deprecatable200 { /** * @param ?object|array|string $body diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsKeyByKeyGet.php index 748bc2d38ab..3c3fa5cdfd8 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsKeyByKeyGet.php @@ -28,13 +28,16 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements PriceSelecting + * @template-implements LocaleProjecting + * @template-implements StoreProjecting * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyProductProjectionsKeyByKeyGet extends ApiRequest implements PriceSelecting, Expandable, Errorable, Deprecatable200 +class ByProjectKeyProductProjectionsKeyByKeyGet extends ApiRequest implements PriceSelecting, LocaleProjecting, StoreProjecting, Expandable, Errorable, Deprecatable200 { /** * @param ?object|array|string $body diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSearchGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSearchGet.php index 077058d6dca..d639b6f6776 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSearchGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSearchGet.php @@ -28,15 +28,18 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Sortable * @template-implements Paging * @template-implements PriceSelecting + * @template-implements LocaleProjecting + * @template-implements StoreProjecting * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyProductProjectionsSearchGet extends ApiRequest implements Sortable, Paging, PriceSelecting, Expandable, Errorable, Deprecatable200 +class ByProjectKeyProductProjectionsSearchGet extends ApiRequest implements Sortable, Paging, PriceSelecting, LocaleProjecting, StoreProjecting, Expandable, Errorable, Deprecatable200 { /** * @param ?object|array|string $body diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSearchPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSearchPost.php index 5a440180d7b..aa0f13ce804 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSearchPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSearchPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSuggestGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSuggestGet.php index a3cb8b2d7be..cb368c88f63 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSuggestGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSuggestGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Sortable * @template-implements Paging diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDDelete.php index 966a4c6d0f3..75d12a8d0c6 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDGet.php index 28795e151e8..31472fa4f2a 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDPost.php index 7c0461ab029..61bbe81672a 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDProductsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDProductsGet.php index b4dfe6c543a..93bc34125d4 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDProductsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsByIDProductsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Paging diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsGet.php index aa9d8afb9d1..79b34d68761 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyDelete.php index d3b508b83cf..f8792901c16 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyGet.php index 307af584b72..57e396a9ae4 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyPost.php index 8512151d276..1ffda0a6d5c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyProductsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyProductsGet.php index bfd2e776015..035747cdf6e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyProductsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsKeyByKeyProductsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Paging diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsPost.php index cb1833fbaf3..4868fa33d92 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductSelectionsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesByIDDelete.php index d850a514a28..977b2428cf2 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesByIDGet.php index a1dbbf31996..3d2cc33baac 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesByIDHead.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesByIDHead.php new file mode 100644 index 00000000000..72d71cbdfe4 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesByIDHead.php @@ -0,0 +1,139 @@ + + * @template-implements Deprecatable200 + */ +class ByProjectKeyProductTypesByIDHead extends ApiRequest implements Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $ID, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{ID}'], [$projectKey, $ID], '{projectKey}/product-types/{ID}'); + parent::__construct($client, 'HEAD', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesByIDPost.php index b8904bd4fd9..99c1d2d08fd 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesGet.php index 2e94f1e3d2a..5f424cbdb34 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesHead.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesHead.php new file mode 100644 index 00000000000..a1f9f0d8ab0 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesHead.php @@ -0,0 +1,148 @@ + + * @template-implements Deprecatable200 + */ +class ByProjectKeyProductTypesHead extends ApiRequest implements Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}'], [$projectKey], '{projectKey}/product-types'); + parent::__construct($client, 'HEAD', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $where + */ + public function withWhere($where): ByProjectKeyProductTypesHead + { + return $this->withQueryParam('where', $where); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesKeyByKeyDelete.php index adb03a9f463..b640f8a0059 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesKeyByKeyGet.php index 955ade59926..fe986dada74 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesKeyByKeyHead.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesKeyByKeyHead.php new file mode 100644 index 00000000000..0a190e6baaa --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesKeyByKeyHead.php @@ -0,0 +1,139 @@ + + * @template-implements Deprecatable200 + */ +class ByProjectKeyProductTypesKeyByKeyHead extends ApiRequest implements Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $key, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{key}'], [$projectKey, $key], '{projectKey}/product-types/key={key}'); + parent::__construct($client, 'HEAD', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesKeyByKeyPost.php index c3189f2122a..0d5bb1cbfa8 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesPost.php index 0d838c80695..209229302be 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductTypesPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDDelete.php index f4de9f4c739..bd618cd742b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements PriceSelecting * @template-implements Versioned @@ -186,24 +187,6 @@ public function withPriceChannel($priceChannel): ByProjectKeyProductsByIDDelete return $this->withQueryParam('priceChannel', $priceChannel); } - /** - * - * @psalm-param scalar|scalar[] $localeProjection - */ - public function withLocaleProjection($localeProjection): ByProjectKeyProductsByIDDelete - { - return $this->withQueryParam('localeProjection', $localeProjection); - } - - /** - * - * @psalm-param scalar|scalar[] $storeProjection - */ - public function withStoreProjection($storeProjection): ByProjectKeyProductsByIDDelete - { - return $this->withQueryParam('storeProjection', $storeProjection); - } - /** * * @psalm-param scalar|scalar[] $version diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDGet.php index 44fe36bad79..3d1f0804649 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements PriceSelecting * @template-implements Expandable @@ -180,24 +181,6 @@ public function withPriceChannel($priceChannel): ByProjectKeyProductsByIDGet return $this->withQueryParam('priceChannel', $priceChannel); } - /** - * - * @psalm-param scalar|scalar[] $localeProjection - */ - public function withLocaleProjection($localeProjection): ByProjectKeyProductsByIDGet - { - return $this->withQueryParam('localeProjection', $localeProjection); - } - - /** - * - * @psalm-param scalar|scalar[] $storeProjection - */ - public function withStoreProjection($storeProjection): ByProjectKeyProductsByIDGet - { - return $this->withQueryParam('storeProjection', $storeProjection); - } - /** * * @psalm-param scalar|scalar[] $expand diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDHead.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDHead.php index 967b7219f61..7ad8ede6055 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDHead.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDHead.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable * @template-implements Deprecatable200 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDImagesPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDImagesPost.php index d89415a56b7..ffe85fcb2a6 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDImagesPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDImagesPost.php @@ -26,6 +26,7 @@ use Psr\Http\Message\UploadedFileInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDPost.php index eb1f85f0ce9..0b0d1ef6f29 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements PriceSelecting * @template-implements Conflicting @@ -185,24 +186,6 @@ public function withPriceChannel($priceChannel): ByProjectKeyProductsByIDPost return $this->withQueryParam('priceChannel', $priceChannel); } - /** - * - * @psalm-param scalar|scalar[] $localeProjection - */ - public function withLocaleProjection($localeProjection): ByProjectKeyProductsByIDPost - { - return $this->withQueryParam('localeProjection', $localeProjection); - } - - /** - * - * @psalm-param scalar|scalar[] $storeProjection - */ - public function withStoreProjection($storeProjection): ByProjectKeyProductsByIDPost - { - return $this->withQueryParam('storeProjection', $storeProjection); - } - /** * * @psalm-param scalar|scalar[] $expand diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDProductSelectionsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDProductSelectionsGet.php index a15f94e2a0f..181e0798482 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDProductSelectionsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsByIDProductSelectionsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsGet.php index f4c65a4b9e8..24b493a7681 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements PriceSelecting * @template-implements Expandable @@ -147,6 +148,15 @@ function (RequestException $e) use ($resultType) { ); } + /** + * + * @psalm-param scalar|scalar[] $where + */ + public function withWhere($where): ByProjectKeyProductsGet + { + return $this->withQueryParam('where', $where); + } + /** * * @psalm-param scalar|scalar[] $priceCurrency @@ -183,24 +193,6 @@ public function withPriceChannel($priceChannel): ByProjectKeyProductsGet return $this->withQueryParam('priceChannel', $priceChannel); } - /** - * - * @psalm-param scalar|scalar[] $localeProjection - */ - public function withLocaleProjection($localeProjection): ByProjectKeyProductsGet - { - return $this->withQueryParam('localeProjection', $localeProjection); - } - - /** - * - * @psalm-param scalar|scalar[] $storeProjection - */ - public function withStoreProjection($storeProjection): ByProjectKeyProductsGet - { - return $this->withQueryParam('storeProjection', $storeProjection); - } - /** * * @psalm-param scalar|scalar[] $expand @@ -246,15 +238,6 @@ public function withWithTotal($withTotal): ByProjectKeyProductsGet return $this->withQueryParam('withTotal', $withTotal); } - /** - * - * @psalm-param scalar|scalar[] $where - */ - public function withWhere($where): ByProjectKeyProductsGet - { - return $this->withQueryParam('where', $where); - } - /** * @psalm-param string $varName * @psalm-param scalar|scalar[] $predicateVar diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsHead.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsHead.php index ccf0e7a45a6..f59c2feb0ba 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsHead.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsHead.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable * @template-implements Deprecatable200 @@ -135,4 +136,13 @@ function (RequestException $e) use ($resultType) { } ); } + + /** + * + * @psalm-param scalar|scalar[] $where + */ + public function withWhere($where): ByProjectKeyProductsHead + { + return $this->withQueryParam('where', $where); + } } diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyDelete.php index 26919f730fb..63e8a62c0fc 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements PriceSelecting * @template-implements Versioned @@ -186,24 +187,6 @@ public function withPriceChannel($priceChannel): ByProjectKeyProductsKeyByKeyDel return $this->withQueryParam('priceChannel', $priceChannel); } - /** - * - * @psalm-param scalar|scalar[] $localeProjection - */ - public function withLocaleProjection($localeProjection): ByProjectKeyProductsKeyByKeyDelete - { - return $this->withQueryParam('localeProjection', $localeProjection); - } - - /** - * - * @psalm-param scalar|scalar[] $storeProjection - */ - public function withStoreProjection($storeProjection): ByProjectKeyProductsKeyByKeyDelete - { - return $this->withQueryParam('storeProjection', $storeProjection); - } - /** * * @psalm-param scalar|scalar[] $version diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyGet.php index b28dd6c0359..3f6e494d036 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements PriceSelecting * @template-implements Expandable @@ -180,24 +181,6 @@ public function withPriceChannel($priceChannel): ByProjectKeyProductsKeyByKeyGet return $this->withQueryParam('priceChannel', $priceChannel); } - /** - * - * @psalm-param scalar|scalar[] $localeProjection - */ - public function withLocaleProjection($localeProjection): ByProjectKeyProductsKeyByKeyGet - { - return $this->withQueryParam('localeProjection', $localeProjection); - } - - /** - * - * @psalm-param scalar|scalar[] $storeProjection - */ - public function withStoreProjection($storeProjection): ByProjectKeyProductsKeyByKeyGet - { - return $this->withQueryParam('storeProjection', $storeProjection); - } - /** * * @psalm-param scalar|scalar[] $expand diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyHead.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyHead.php index 2cae36a0d3f..1ca31f2c1da 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyHead.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyHead.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable * @template-implements Deprecatable200 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyPost.php index 1ca8e2d6af3..28d9a74006c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements PriceSelecting * @template-implements Conflicting @@ -185,24 +186,6 @@ public function withPriceChannel($priceChannel): ByProjectKeyProductsKeyByKeyPos return $this->withQueryParam('priceChannel', $priceChannel); } - /** - * - * @psalm-param scalar|scalar[] $localeProjection - */ - public function withLocaleProjection($localeProjection): ByProjectKeyProductsKeyByKeyPost - { - return $this->withQueryParam('localeProjection', $localeProjection); - } - - /** - * - * @psalm-param scalar|scalar[] $storeProjection - */ - public function withStoreProjection($storeProjection): ByProjectKeyProductsKeyByKeyPost - { - return $this->withQueryParam('storeProjection', $storeProjection); - } - /** * * @psalm-param scalar|scalar[] $expand diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyProductSelectionsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyProductSelectionsGet.php index cf55a90f345..fb18cc002e4 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyProductSelectionsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsKeyByKeyProductSelectionsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsPost.php index 7290e3cd21a..27034c93110 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements PriceSelecting * @template-implements Expandable @@ -180,24 +181,6 @@ public function withPriceChannel($priceChannel): ByProjectKeyProductsPost return $this->withQueryParam('priceChannel', $priceChannel); } - /** - * - * @psalm-param scalar|scalar[] $localeProjection - */ - public function withLocaleProjection($localeProjection): ByProjectKeyProductsPost - { - return $this->withQueryParam('localeProjection', $localeProjection); - } - - /** - * - * @psalm-param scalar|scalar[] $storeProjection - */ - public function withStoreProjection($storeProjection): ByProjectKeyProductsPost - { - return $this->withQueryParam('storeProjection', $storeProjection); - } - /** * * @psalm-param scalar|scalar[] $expand diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsByIDDelete.php index 6e56606e9b9..992fe10bca5 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsByIDGet.php index 581ab1d0f7c..8db53693a0c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsByIDPost.php index 81f25008651..8300090a1c8 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsGet.php index 7774e4455dc..1537879b5ce 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsKeyByKeyDelete.php index f42bdde5fd3..5aeafc4aa59 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsKeyByKeyGet.php index 850ba3e109a..9f7ba7d62f4 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsKeyByKeyPost.php index 559f470f9d1..8986441b18c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsPost.php index 23aeaa4dfb6..aa3bfa2cd4a 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuoteRequestsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesByIDDelete.php index 72a92f54288..6111a3abe01 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesByIDGet.php index 40c0e25f1c0..3c2cd78676d 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesByIDPost.php index c04b8e3d38b..74dc1c33a18 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesGet.php index 06399995781..8b9382e8cbd 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesKeyByKeyDelete.php index 25ba56f22f9..0a7a3432922 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesKeyByKeyGet.php index 0f6d25aee26..7afd7561714 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesKeyByKeyPost.php index 8dfec24fb3d..1f0c086fbba 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesPost.php index 7fe8bd5f4d7..e209580c49c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyQuotesPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsByIDDelete.php index b49d4527d46..a7b4bbdf017 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsByIDGet.php index e47f41d12a1..d7036929e0b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsByIDPost.php index 9d7b18d41af..c39b9a213a2 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsGet.php index 7e7668daf2c..6de2c2a71c5 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsKeyByKeyDelete.php index 3134c89772a..f746cdc73c0 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsKeyByKeyGet.php index 1260d3577b2..84312e96eac 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsKeyByKeyPost.php index 395a3dfbb65..d0eb931dd03 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsPost.php index 703c16044b1..76383ced7db 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyReviewsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsByIDDelete.php index f5e84304b1c..dda0aed704c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsByIDGet.php index 7538f12c759..5a9380106ca 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsByIDPost.php index 0979589c610..95730dfd539 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsGet.php index dd898d8313b..457cb72b0f9 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsKeyByKeyDelete.php index 9184db8d1fc..04c6ada5643 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsKeyByKeyGet.php index 03cf47d83e6..88a8dc55139 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsKeyByKeyPost.php index 3270420e1ae..ec9e4b0d135 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsMatchingCartGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsMatchingCartGet.php index dedf834aaa8..c33e422efc5 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsMatchingCartGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsMatchingCartGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsMatchingLocationGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsMatchingLocationGet.php index fed6fb7ad20..032eb1079fd 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsMatchingLocationGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsMatchingLocationGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsMatchingOrdereditGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsMatchingOrdereditGet.php index 9bd7af8a014..c5cce94ec26 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsMatchingOrdereditGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsMatchingOrdereditGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Errorable * @template-implements Deprecatable200 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsPost.php index 39b16c8adf6..e8a5ea9ce42 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShippingMethodsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsByIDDelete.php index bd8fd8573f2..fc0a3f6db4b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsByIDGet.php index c29ec8852b7..6a0f27ca23c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsByIDPost.php index 1413758159c..851265a8c56 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsGet.php index 15e73e0b249..e003c9dc813 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsKeyByKeyDelete.php index cf41b131e68..340f3e88f3f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsKeyByKeyGet.php index 385c2fed434..1a2861b2392 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsKeyByKeyPost.php index e08704937c9..b3d3692c1b7 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsPost.php index b89a0f4c126..bd4e88544b2 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyShoppingListsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesByIDDelete.php index feb24778e1b..af9aefc0ff3 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesByIDGet.php index e457a59b08b..6c58f35b61c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesByIDPost.php index af0df833bc4..9b8a60bb74c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesGet.php index 91bae093892..af87f9d892f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesKeyByKeyDelete.php index 8dbca1d29e7..6045b9e561a 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements DataErasure * @template-implements Versioned diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesKeyByKeyGet.php index 410371eb382..75a50936f0a 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesKeyByKeyPost.php index 314602ae245..df27056fc99 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesPost.php index 2574f6796e4..0758df1740a 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStagedQuotesPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesByIDDelete.php index 5b58e37272d..f2a12785c1a 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesByIDGet.php index fcf86578ab4..a36598c6a49 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesByIDPost.php index 63d38031b92..2972060d82c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesGet.php index 69f161bd100..1df4d56d1b0 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesKeyByKeyDelete.php index ca56707fd62..db45d5c7a28 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesKeyByKeyGet.php index 311f5088434..fc2748ab0ab 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesKeyByKeyPost.php index 6d5bd8edbed..a3de8d6d17d 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesPost.php index e50a8a31848..0790b962f49 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStandalonePricesPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesByIDDelete.php index 37331208bc4..ee4788142e8 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesByIDGet.php index fa7b400c419..949e82c4b15 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesByIDPost.php index e978ac8f7d4..0f2b9253144 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesGet.php index f4feee60a19..09b475b4ce3 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesKeyByKeyDelete.php index 2fe6fafce31..a314233b502 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesKeyByKeyGet.php index ad82cea1a51..e8497aeb42c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesKeyByKeyPost.php index 2f767d0f06a..9415e0e54fe 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesPost.php index cbc4cac1b30..6deff82c9e6 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStatesPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresByIDDelete.php index 1b69b810910..f09d120b65b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresByIDGet.php index 210491e51d1..1e7873921dc 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresByIDPost.php index 4364f4b4adc..1d735aa1d59 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresGet.php index 1b07853b30e..b87f2504fa9 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresKeyByKeyDelete.php index 0b46ad910b4..f92966f5f41 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresKeyByKeyGet.php index 8b7c8458538..cc0b1917137 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresKeyByKeyPost.php index 3ec4aa905d6..c4504e0e13c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresPost.php index 7f16ad8b28d..5d0349c5976 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyStoresPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDDelete.php index fa4ec4849d5..a76802595a5 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDGet.php index ff7a3d76021..a0b188c17e4 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDHealthGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDHealthGet.php new file mode 100644 index 00000000000..3a9177ff1fa --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDHealthGet.php @@ -0,0 +1,112 @@ + $headers + */ + public function __construct(string $projectKey, string $ID, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{ID}'], [$projectKey, $ID], '{projectKey}/subscriptions/{ID}/health'); + parent::__construct($client, 'GET', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDPost.php index 301301e0480..1df884dbceb 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsGet.php index 9f1f29ab246..d4f4bb6afb8 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyDelete.php index 186709bc1c8..7043a6d44e6 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyGet.php index 01dca1873ff..9a331dd124e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyPost.php index 3fc42f2c12d..e5c94dee8e0 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsPost.php index 1de15825c8a..6e713045691 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesByIDDelete.php index 000e93d5da3..299ac34fd1f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesByIDGet.php index b0e400da708..5adab97ed9f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesByIDPost.php index cb573419f71..e4b85bba6b0 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesGet.php index 67fe9cd1d55..b21a43583de 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesKeyByKeyDelete.php index 6fa64fe5b1e..4c9de8876de 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesKeyByKeyGet.php index 504242adac8..b44d4166b8b 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesKeyByKeyPost.php index 59d99961259..2259b5cd343 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesPost.php index 4ea9f2bd34e..bdacd134ebc 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTaxCategoriesPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesByIDDelete.php index 462eae09c76..8ff4d5cca64 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesByIDGet.php index 95041e2d237..d98423c9917 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesByIDPost.php index 52d62cc1af6..79c9f711917 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesGet.php index 3db2ad30983..3efba336b1d 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesKeyByKeyDelete.php index 3eb7a866d0d..7995194f00f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesKeyByKeyGet.php index c81f1d59e4b..5ac8d479bfb 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesKeyByKeyPost.php index b606ab1c6fc..dc767b1a3e4 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesPost.php index 4937b492140..6fd89b0b07d 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyTypesPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesByIDDelete.php index 0df64b32921..0a1aafdf5b6 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesByIDDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesByIDGet.php index d489c78c96f..913736892ba 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesByIDPost.php index ff2bc53897b..3352083de5c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesByIDPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesGet.php index 19f59e66113..d60ae8d7a96 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Sortable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesKeyByKeyDelete.php index 1bc9381743a..9fc54ff281d 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesKeyByKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesKeyByKeyGet.php index e570f2fe4f0..01728060038 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesKeyByKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Errorable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesKeyByKeyPost.php index 80f310f60a7..75f7bb4b3a5 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesKeyByKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting * @template-implements Expandable diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesPost.php index 4691bfb8717..f1f60a7e173 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyZonesPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable * @template-implements Deprecatable201 diff --git a/lib/commercetools-api/src/Client/Resource/LocaleProjecting.php b/lib/commercetools-api/src/Client/Resource/LocaleProjecting.php new file mode 100644 index 00000000000..92fa3ffd7e2 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/LocaleProjecting.php @@ -0,0 +1,24 @@ + + */ +interface LocaleProjecting extends ApiRequestInterface +{ + /** + * @return ApiRequestInterface + * @psalm-return T + */ + public function withLocaleProjection(string $localeProjection); +} diff --git a/lib/commercetools-api/src/Client/Resource/PriceSelecting.php b/lib/commercetools-api/src/Client/Resource/PriceSelecting.php index 5f56ce87d5d..5f48d221e3d 100644 --- a/lib/commercetools-api/src/Client/Resource/PriceSelecting.php +++ b/lib/commercetools-api/src/Client/Resource/PriceSelecting.php @@ -39,16 +39,4 @@ public function withPriceCustomerGroup(string $priceCustomerGroup); * @psalm-return T */ public function withPriceChannel(string $priceChannel); - - /** - * @return ApiRequestInterface - * @psalm-return T - */ - public function withLocaleProjection(string $localeProjection); - - /** - * @return ApiRequestInterface - * @psalm-return T - */ - public function withStoreProjection(string $storeProjection); } diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKey.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKey.php index 4f3ae75f39e..228be09aa85 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKey.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKey.php @@ -26,6 +26,14 @@ public function __construct(array $args = [], ClientInterface $client = null) parent::__construct('/{projectKey}', $args, $client); } + /** + */ + public function businessUnits(): ResourceByProjectKeyBusinessUnits + { + $args = $this->getArgs(); + + return new ResourceByProjectKeyBusinessUnits($args, $this->getClient()); + } /** */ public function categories(): ResourceByProjectKeyCategories @@ -317,6 +325,17 @@ public function standalonePrices(): ResourceByProjectKeyStandalonePrices return new ResourceByProjectKeyStandalonePrices($args, $this->getClient()); } + /** + */ + public function inBusinessUnitKeyWithBusinessUnitKeyValue(string $businessUnitKey = null): ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKey + { + $args = $this->getArgs(); + if (!is_null($businessUnitKey)) { + $args['businessUnitKey'] = $businessUnitKey; + } + + return new ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKey($args, $this->getClient()); + } /** * @psalm-param ?object|array|string $body diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyBusinessUnits.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyBusinessUnits.php new file mode 100644 index 00000000000..8a85c925ce8 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyBusinessUnits.php @@ -0,0 +1,72 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/business-units', $args, $client); + } + + /** + */ + public function withKey(string $key = null): ResourceByProjectKeyBusinessUnitsKeyByKey + { + $args = $this->getArgs(); + if (!is_null($key)) { + $args['key'] = $key; + } + + return new ResourceByProjectKeyBusinessUnitsKeyByKey($args, $this->getClient()); + } + /** + */ + public function withId(string $ID = null): ResourceByProjectKeyBusinessUnitsByID + { + $args = $this->getArgs(); + if (!is_null($ID)) { + $args['ID'] = $ID; + } + + return new ResourceByProjectKeyBusinessUnitsByID($args, $this->getClient()); + } + + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function get($body = null, array $headers = []): ByProjectKeyBusinessUnitsGet + { + $args = $this->getArgs(); + + return new ByProjectKeyBusinessUnitsGet($args['projectKey'], $body, $headers, $this->getClient()); + } + /** + * @psalm-param ?BusinessUnitDraft $body + * @psalm-param array $headers + */ + public function post(?BusinessUnitDraft $body = null, array $headers = []): ByProjectKeyBusinessUnitsPost + { + $args = $this->getArgs(); + + return new ByProjectKeyBusinessUnitsPost($args['projectKey'], $body, $headers, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyBusinessUnitsByID.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyBusinessUnitsByID.php new file mode 100644 index 00000000000..d86c14ba499 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyBusinessUnitsByID.php @@ -0,0 +1,59 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/business-units/{ID}', $args, $client); + } + + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function get($body = null, array $headers = []): ByProjectKeyBusinessUnitsByIDGet + { + $args = $this->getArgs(); + + return new ByProjectKeyBusinessUnitsByIDGet($args['projectKey'], $args['ID'], $body, $headers, $this->getClient()); + } + /** + * @psalm-param ?BusinessUnitUpdate $body + * @psalm-param array $headers + */ + public function post(?BusinessUnitUpdate $body = null, array $headers = []): ByProjectKeyBusinessUnitsByIDPost + { + $args = $this->getArgs(); + + return new ByProjectKeyBusinessUnitsByIDPost($args['projectKey'], $args['ID'], $body, $headers, $this->getClient()); + } + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function delete($body = null, array $headers = []): ByProjectKeyBusinessUnitsByIDDelete + { + $args = $this->getArgs(); + + return new ByProjectKeyBusinessUnitsByIDDelete($args['projectKey'], $args['ID'], $body, $headers, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyBusinessUnitsKeyByKey.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyBusinessUnitsKeyByKey.php new file mode 100644 index 00000000000..a812ba15b2c --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyBusinessUnitsKeyByKey.php @@ -0,0 +1,59 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/business-units/key={key}', $args, $client); + } + + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function get($body = null, array $headers = []): ByProjectKeyBusinessUnitsKeyByKeyGet + { + $args = $this->getArgs(); + + return new ByProjectKeyBusinessUnitsKeyByKeyGet($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); + } + /** + * @psalm-param ?BusinessUnitUpdate $body + * @psalm-param array $headers + */ + public function post(?BusinessUnitUpdate $body = null, array $headers = []): ByProjectKeyBusinessUnitsKeyByKeyPost + { + $args = $this->getArgs(); + + return new ByProjectKeyBusinessUnitsKeyByKeyPost($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); + } + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function delete($body = null, array $headers = []): ByProjectKeyBusinessUnitsKeyByKeyDelete + { + $args = $this->getArgs(); + + return new ByProjectKeyBusinessUnitsKeyByKeyDelete($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyCustomObjects.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyCustomObjects.php index 2e6bcff7bd8..19153d41628 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyCustomObjects.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyCustomObjects.php @@ -56,6 +56,7 @@ public function withContainer(string $container = null): ResourceByProjectKeyCus /** * @psalm-param ?object|array|string $body * @psalm-param array $headers + * @deprecated */ public function get($body = null, array $headers = []): ByProjectKeyCustomObjectsGet { diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKey.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKey.php new file mode 100644 index 00000000000..ea50bf74f03 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKey.php @@ -0,0 +1,36 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/in-business-unit/key={businessUnitKey}', $args, $client); + } + + /** + */ + public function me(): ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMe + { + $args = $this->getArgs(); + + return new ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMe($args, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMe.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMe.php new file mode 100644 index 00000000000..12b9d3ea3cd --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMe.php @@ -0,0 +1,36 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/in-business-unit/key={businessUnitKey}/me', $args, $client); + } + + /** + */ + public function customers(): ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomers + { + $args = $this->getArgs(); + + return new ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomers($args, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomers.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomers.php new file mode 100644 index 00000000000..83a61fa0add --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomers.php @@ -0,0 +1,39 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/in-business-unit/key={businessUnitKey}/me/customers', $args, $client); + } + + /** + * @psalm-param ?MyBusinessUnitAssociateDraft $body + * @psalm-param array $headers + */ + public function post(?MyBusinessUnitAssociateDraft $body = null, array $headers = []): ByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomersPost + { + $args = $this->getArgs(); + + return new ByProjectKeyInBusinessUnitKeyByBusinessUnitKeyMeCustomersPost($args['projectKey'], $args['businessUnitKey'], $body, $headers, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersPasswordReset.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersPasswordReset.php index 344320c5cc8..f94971bde0b 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersPasswordReset.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCustomersPasswordReset.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Client\Resource; -use Commercetools\Api\Models\Customer\MyCustomerResetPassword; +use Commercetools\Api\Models\Customer\CustomerResetPassword; use Commercetools\Client\ApiResource; use GuzzleHttp\ClientInterface; use Psr\Http\Message\UploadedFileInterface; @@ -27,10 +27,10 @@ public function __construct(array $args = [], ClientInterface $client = null) } /** - * @psalm-param ?MyCustomerResetPassword $body + * @psalm-param ?CustomerResetPassword $body * @psalm-param array $headers */ - public function post(?MyCustomerResetPassword $body = null, array $headers = []): ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetPost + public function post(?CustomerResetPassword $body = null, array $headers = []): ByProjectKeyInStoreKeyByStoreKeyCustomersPasswordResetPost { $args = $this->getArgs(); diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyMeEmailConfirm.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyMeEmailConfirm.php index f36ad5f53bd..38b8f11522b 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyMeEmailConfirm.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyMeEmailConfirm.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Client\Resource; -use Commercetools\Api\Models\Customer\CustomerEmailVerify; +use Commercetools\Api\Models\Customer\MyCustomerEmailVerify; use Commercetools\Client\ApiResource; use GuzzleHttp\ClientInterface; use Psr\Http\Message\UploadedFileInterface; @@ -27,10 +27,10 @@ public function __construct(array $args = [], ClientInterface $client = null) } /** - * @psalm-param ?CustomerEmailVerify $body + * @psalm-param ?MyCustomerEmailVerify $body * @psalm-param array $headers */ - public function post(?CustomerEmailVerify $body = null, array $headers = []): ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmPost + public function post(?MyCustomerEmailVerify $body = null, array $headers = []): ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmPost { $args = $this->getArgs(); diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMe.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMe.php index e43989c8c0e..a3985f6c77e 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMe.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMe.php @@ -66,6 +66,14 @@ public function activeCart(): ResourceByProjectKeyMeActiveCart return new ResourceByProjectKeyMeActiveCart($args, $this->getClient()); } + /** + */ + public function businessUnits(): ResourceByProjectKeyMeBusinessUnits + { + $args = $this->getArgs(); + + return new ResourceByProjectKeyMeBusinessUnits($args, $this->getClient()); + } /** */ public function carts(): ResourceByProjectKeyMeCarts @@ -98,6 +106,14 @@ public function quoteRequests(): ResourceByProjectKeyMeQuoteRequests return new ResourceByProjectKeyMeQuoteRequests($args, $this->getClient()); } + /** + */ + public function quotes(): ResourceByProjectKeyMeQuotes + { + $args = $this->getArgs(); + + return new ResourceByProjectKeyMeQuotes($args, $this->getClient()); + } /** */ public function shoppingLists(): ResourceByProjectKeyMeShoppingLists diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeBusinessUnits.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeBusinessUnits.php new file mode 100644 index 00000000000..b14da7b1b5c --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeBusinessUnits.php @@ -0,0 +1,72 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/me/business-units', $args, $client); + } + + /** + */ + public function withId(string $ID = null): ResourceByProjectKeyMeBusinessUnitsByID + { + $args = $this->getArgs(); + if (!is_null($ID)) { + $args['ID'] = $ID; + } + + return new ResourceByProjectKeyMeBusinessUnitsByID($args, $this->getClient()); + } + /** + */ + public function withKey(string $key = null): ResourceByProjectKeyMeBusinessUnitsKeyByKey + { + $args = $this->getArgs(); + if (!is_null($key)) { + $args['key'] = $key; + } + + return new ResourceByProjectKeyMeBusinessUnitsKeyByKey($args, $this->getClient()); + } + + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function get($body = null, array $headers = []): ByProjectKeyMeBusinessUnitsGet + { + $args = $this->getArgs(); + + return new ByProjectKeyMeBusinessUnitsGet($args['projectKey'], $body, $headers, $this->getClient()); + } + /** + * @psalm-param ?MyBusinessUnitDraft $body + * @psalm-param array $headers + */ + public function post(?MyBusinessUnitDraft $body = null, array $headers = []): ByProjectKeyMeBusinessUnitsPost + { + $args = $this->getArgs(); + + return new ByProjectKeyMeBusinessUnitsPost($args['projectKey'], $body, $headers, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeBusinessUnitsByID.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeBusinessUnitsByID.php new file mode 100644 index 00000000000..e7a23f7d2af --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeBusinessUnitsByID.php @@ -0,0 +1,59 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/me/business-units/{ID}', $args, $client); + } + + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function get($body = null, array $headers = []): ByProjectKeyMeBusinessUnitsByIDGet + { + $args = $this->getArgs(); + + return new ByProjectKeyMeBusinessUnitsByIDGet($args['projectKey'], $args['ID'], $body, $headers, $this->getClient()); + } + /** + * @psalm-param ?MyBusinessUnitUpdate $body + * @psalm-param array $headers + */ + public function post(?MyBusinessUnitUpdate $body = null, array $headers = []): ByProjectKeyMeBusinessUnitsByIDPost + { + $args = $this->getArgs(); + + return new ByProjectKeyMeBusinessUnitsByIDPost($args['projectKey'], $args['ID'], $body, $headers, $this->getClient()); + } + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function delete($body = null, array $headers = []): ByProjectKeyMeBusinessUnitsByIDDelete + { + $args = $this->getArgs(); + + return new ByProjectKeyMeBusinessUnitsByIDDelete($args['projectKey'], $args['ID'], $body, $headers, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeBusinessUnitsKeyByKey.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeBusinessUnitsKeyByKey.php new file mode 100644 index 00000000000..543793e8948 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeBusinessUnitsKeyByKey.php @@ -0,0 +1,59 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/me/business-units/key={key}', $args, $client); + } + + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function get($body = null, array $headers = []): ByProjectKeyMeBusinessUnitsKeyByKeyGet + { + $args = $this->getArgs(); + + return new ByProjectKeyMeBusinessUnitsKeyByKeyGet($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); + } + /** + * @psalm-param ?MyBusinessUnitUpdate $body + * @psalm-param array $headers + */ + public function post(?MyBusinessUnitUpdate $body = null, array $headers = []): ByProjectKeyMeBusinessUnitsKeyByKeyPost + { + $args = $this->getArgs(); + + return new ByProjectKeyMeBusinessUnitsKeyByKeyPost($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); + } + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function delete($body = null, array $headers = []): ByProjectKeyMeBusinessUnitsKeyByKeyDelete + { + $args = $this->getArgs(); + + return new ByProjectKeyMeBusinessUnitsKeyByKeyDelete($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeEmailConfirm.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeEmailConfirm.php index 7ca37e06270..60fb536539e 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeEmailConfirm.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeEmailConfirm.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Client\Resource; -use Commercetools\Api\Models\Customer\CustomerEmailVerify; +use Commercetools\Api\Models\Customer\MyCustomerEmailVerify; use Commercetools\Client\ApiResource; use GuzzleHttp\ClientInterface; use Psr\Http\Message\UploadedFileInterface; @@ -27,10 +27,10 @@ public function __construct(array $args = [], ClientInterface $client = null) } /** - * @psalm-param ?CustomerEmailVerify $body + * @psalm-param ?MyCustomerEmailVerify $body * @psalm-param array $headers */ - public function post(?CustomerEmailVerify $body = null, array $headers = []): ByProjectKeyMeEmailConfirmPost + public function post(?MyCustomerEmailVerify $body = null, array $headers = []): ByProjectKeyMeEmailConfirmPost { $args = $this->getArgs(); diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeQuotes.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeQuotes.php new file mode 100644 index 00000000000..088d2daadfa --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeQuotes.php @@ -0,0 +1,61 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/me/quotes', $args, $client); + } + + /** + */ + public function withId(string $ID = null): ResourceByProjectKeyMeQuotesByID + { + $args = $this->getArgs(); + if (!is_null($ID)) { + $args['ID'] = $ID; + } + + return new ResourceByProjectKeyMeQuotesByID($args, $this->getClient()); + } + /** + */ + public function withKey(string $key = null): ResourceByProjectKeyMeQuotesKeyByKey + { + $args = $this->getArgs(); + if (!is_null($key)) { + $args['key'] = $key; + } + + return new ResourceByProjectKeyMeQuotesKeyByKey($args, $this->getClient()); + } + + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function get($body = null, array $headers = []): ByProjectKeyMeQuotesGet + { + $args = $this->getArgs(); + + return new ByProjectKeyMeQuotesGet($args['projectKey'], $body, $headers, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeQuotesByID.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeQuotesByID.php new file mode 100644 index 00000000000..f1951aa7ddc --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeQuotesByID.php @@ -0,0 +1,49 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/me/quotes/{ID}', $args, $client); + } + + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function get($body = null, array $headers = []): ByProjectKeyMeQuotesByIDGet + { + $args = $this->getArgs(); + + return new ByProjectKeyMeQuotesByIDGet($args['projectKey'], $args['ID'], $body, $headers, $this->getClient()); + } + /** + * @psalm-param ?MyQuoteUpdate $body + * @psalm-param array $headers + */ + public function post(?MyQuoteUpdate $body = null, array $headers = []): ByProjectKeyMeQuotesByIDPost + { + $args = $this->getArgs(); + + return new ByProjectKeyMeQuotesByIDPost($args['projectKey'], $args['ID'], $body, $headers, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeQuotesKeyByKey.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeQuotesKeyByKey.php new file mode 100644 index 00000000000..c308b8dee44 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeQuotesKeyByKey.php @@ -0,0 +1,49 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/me/quotes/key={key}', $args, $client); + } + + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function get($body = null, array $headers = []): ByProjectKeyMeQuotesKeyByKeyGet + { + $args = $this->getArgs(); + + return new ByProjectKeyMeQuotesKeyByKeyGet($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); + } + /** + * @psalm-param ?MyQuoteUpdate $body + * @psalm-param array $headers + */ + public function post(?MyQuoteUpdate $body = null, array $headers = []): ByProjectKeyMeQuotesKeyByKeyPost + { + $args = $this->getArgs(); + + return new ByProjectKeyMeQuotesKeyByKeyPost($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyOrders.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyOrders.php index d16b7819118..390ac1ef718 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyOrders.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyOrders.php @@ -34,6 +34,14 @@ public function importOrder(): ResourceByProjectKeyOrdersImport return new ResourceByProjectKeyOrdersImport($args, $this->getClient()); } + /** + */ + public function orderQuote(): ResourceByProjectKeyOrdersQuotes + { + $args = $this->getArgs(); + + return new ResourceByProjectKeyOrdersQuotes($args, $this->getClient()); + } /** */ public function withOrderNumber(string $orderNumber = null): ResourceByProjectKeyOrdersOrderNumberByOrderNumber diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyOrdersQuotes.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyOrdersQuotes.php new file mode 100644 index 00000000000..f3baf883377 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyOrdersQuotes.php @@ -0,0 +1,39 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/orders/quotes', $args, $client); + } + + /** + * @psalm-param ?OrderFromQuoteDraft $body + * @psalm-param array $headers + */ + public function post(?OrderFromQuoteDraft $body = null, array $headers = []): ByProjectKeyOrdersQuotesPost + { + $args = $this->getArgs(); + + return new ByProjectKeyOrdersQuotesPost($args['projectKey'], $body, $headers, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyProductTypes.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyProductTypes.php index 25a2b2c5a28..44022d235c4 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyProductTypes.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyProductTypes.php @@ -59,6 +59,16 @@ public function get($body = null, array $headers = []): ByProjectKeyProductTypes return new ByProjectKeyProductTypesGet($args['projectKey'], $body, $headers, $this->getClient()); } + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function head($body = null, array $headers = []): ByProjectKeyProductTypesHead + { + $args = $this->getArgs(); + + return new ByProjectKeyProductTypesHead($args['projectKey'], $body, $headers, $this->getClient()); + } /** * @psalm-param ?ProductTypeDraft $body * @psalm-param array $headers diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyProductTypesByID.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyProductTypesByID.php index 9e5fbcf7390..8325d29cdf7 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyProductTypesByID.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyProductTypesByID.php @@ -36,6 +36,16 @@ public function get($body = null, array $headers = []): ByProjectKeyProductTypes return new ByProjectKeyProductTypesByIDGet($args['projectKey'], $args['ID'], $body, $headers, $this->getClient()); } + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function head($body = null, array $headers = []): ByProjectKeyProductTypesByIDHead + { + $args = $this->getArgs(); + + return new ByProjectKeyProductTypesByIDHead($args['projectKey'], $args['ID'], $body, $headers, $this->getClient()); + } /** * @psalm-param ?ProductTypeUpdate $body * @psalm-param array $headers diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyProductTypesKeyByKey.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyProductTypesKeyByKey.php index 9c8e64b3718..d0f48c503f1 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyProductTypesKeyByKey.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyProductTypesKeyByKey.php @@ -36,6 +36,16 @@ public function get($body = null, array $headers = []): ByProjectKeyProductTypes return new ByProjectKeyProductTypesKeyByKeyGet($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); } + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function head($body = null, array $headers = []): ByProjectKeyProductTypesKeyByKeyHead + { + $args = $this->getArgs(); + + return new ByProjectKeyProductTypesKeyByKeyHead($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); + } /** * @psalm-param ?ProductTypeUpdate $body * @psalm-param array $headers diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeySubscriptionsByID.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeySubscriptionsByID.php index 29d39e1e493..cc6b9df1573 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeySubscriptionsByID.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeySubscriptionsByID.php @@ -26,6 +26,15 @@ public function __construct(array $args = [], ClientInterface $client = null) parent::__construct('/{projectKey}/subscriptions/{ID}', $args, $client); } + /** + */ + public function withIdHealth(): ResourceByProjectKeySubscriptionsByIDHealth + { + $args = $this->getArgs(); + + return new ResourceByProjectKeySubscriptionsByIDHealth($args, $this->getClient()); + } + /** * @psalm-param ?object|array|string $body * @psalm-param array $headers diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeySubscriptionsByIDHealth.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeySubscriptionsByIDHealth.php new file mode 100644 index 00000000000..5e92b8d2038 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeySubscriptionsByIDHealth.php @@ -0,0 +1,38 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/subscriptions/{ID}/health', $args, $client); + } + + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function get($body = null, array $headers = []): ByProjectKeySubscriptionsByIDHealthGet + { + $args = $this->getArgs(); + + return new ByProjectKeySubscriptionsByIDHealthGet($args['projectKey'], $args['ID'], $body, $headers, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/StoreProjecting.php b/lib/commercetools-api/src/Client/Resource/StoreProjecting.php new file mode 100644 index 00000000000..7a557aeea3e --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/StoreProjecting.php @@ -0,0 +1,24 @@ + + */ +interface StoreProjecting extends ApiRequestInterface +{ + /** + * @return ApiRequestInterface + * @psalm-return T + */ + public function withStoreProjection(string $storeProjection); +} diff --git a/lib/commercetools-api/src/Models/ApiClient/ApiClient.php b/lib/commercetools-api/src/Models/ApiClient/ApiClient.php index 0989b7c1630..d0a9818ba6f 100644 --- a/lib/commercetools-api/src/Models/ApiClient/ApiClient.php +++ b/lib/commercetools-api/src/Models/ApiClient/ApiClient.php @@ -27,6 +27,7 @@ interface ApiClient extends JsonObject /** *

The OAuth2 client_id that can be used to obtain an access token.

* + * @return null|string */ public function getId(); @@ -34,6 +35,7 @@ public function getId(); /** *

Name of the APIClient.

* + * @return null|string */ public function getName(); @@ -41,6 +43,7 @@ public function getName(); /** *

Whitespace-separated list of OAuth scopes that can be used when obtaining an access token.

* + * @return null|string */ public function getScope(); @@ -49,6 +52,7 @@ public function getScope(); *

Only shown once in the response of creating the APIClient. * This is the OAuth2 client_secret that can be used to obtain an access token.

* + * @return null|string */ public function getSecret(); @@ -56,6 +60,7 @@ public function getSecret(); /** *

Date of the last day this APIClient was used to obtain an access token.

* + * @return null|DateTimeImmutable */ public function getLastUsedAt(); @@ -63,6 +68,7 @@ public function getLastUsedAt(); /** *

If set, the Client will be deleted on (or shortly after) this point in time.

* + * @return null|DateTimeImmutable */ public function getDeleteAt(); @@ -70,6 +76,7 @@ public function getDeleteAt(); /** *

Date and time (UTC) the APIClient was initially created at.

* + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -77,6 +84,7 @@ public function getCreatedAt(); /** *

Expiration time in seconds for each access token obtained by the APIClient. Only present when set with the APIClientDraft. If not present the default value applies.

* + * @return null|int */ public function getAccessTokenValiditySeconds(); @@ -84,6 +92,7 @@ public function getAccessTokenValiditySeconds(); /** *

Inactivity expiration time in seconds for each refresh token obtained by the APIClient. Only present when set with the APIClientDraft. If not present the default value applies.

* + * @return null|int */ public function getRefreshTokenValiditySeconds(); diff --git a/lib/commercetools-api/src/Models/ApiClient/ApiClientBuilder.php b/lib/commercetools-api/src/Models/ApiClient/ApiClientBuilder.php index 1659639d8e0..00eb93f41f6 100644 --- a/lib/commercetools-api/src/Models/ApiClient/ApiClientBuilder.php +++ b/lib/commercetools-api/src/Models/ApiClient/ApiClientBuilder.php @@ -22,46 +22,55 @@ final class ApiClientBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $name; /** + * @var ?string */ private $scope; /** + * @var ?string */ private $secret; /** + * @var ?DateTimeImmutable */ private $lastUsedAt; /** + * @var ?DateTimeImmutable */ private $deleteAt; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?int */ private $accessTokenValiditySeconds; /** + * @var ?int */ private $refreshTokenValiditySeconds; @@ -69,6 +78,7 @@ final class ApiClientBuilder implements Builder /** *

The OAuth2 client_id that can be used to obtain an access token.

* + * @return null|string */ public function getId() @@ -79,6 +89,7 @@ public function getId() /** *

Name of the APIClient.

* + * @return null|string */ public function getName() @@ -89,6 +100,7 @@ public function getName() /** *

Whitespace-separated list of OAuth scopes that can be used when obtaining an access token.

* + * @return null|string */ public function getScope() @@ -100,6 +112,7 @@ public function getScope() *

Only shown once in the response of creating the APIClient. * This is the OAuth2 client_secret that can be used to obtain an access token.

* + * @return null|string */ public function getSecret() @@ -110,6 +123,7 @@ public function getSecret() /** *

Date of the last day this APIClient was used to obtain an access token.

* + * @return null|DateTimeImmutable */ public function getLastUsedAt() @@ -120,6 +134,7 @@ public function getLastUsedAt() /** *

If set, the Client will be deleted on (or shortly after) this point in time.

* + * @return null|DateTimeImmutable */ public function getDeleteAt() @@ -130,6 +145,7 @@ public function getDeleteAt() /** *

Date and time (UTC) the APIClient was initially created at.

* + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -140,6 +156,7 @@ public function getCreatedAt() /** *

Expiration time in seconds for each access token obtained by the APIClient. Only present when set with the APIClientDraft. If not present the default value applies.

* + * @return null|int */ public function getAccessTokenValiditySeconds() @@ -150,6 +167,7 @@ public function getAccessTokenValiditySeconds() /** *

Inactivity expiration time in seconds for each refresh token obtained by the APIClient. Only present when set with the APIClientDraft. If not present the default value applies.

* + * @return null|int */ public function getRefreshTokenValiditySeconds() diff --git a/lib/commercetools-api/src/Models/ApiClient/ApiClientDraft.php b/lib/commercetools-api/src/Models/ApiClient/ApiClientDraft.php index 09a146f9fc1..7fad445ac88 100644 --- a/lib/commercetools-api/src/Models/ApiClient/ApiClientDraft.php +++ b/lib/commercetools-api/src/Models/ApiClient/ApiClientDraft.php @@ -22,6 +22,7 @@ interface ApiClientDraft extends JsonObject /** *

Name of the APIClient.

* + * @return null|string */ public function getName(); @@ -29,6 +30,7 @@ public function getName(); /** *

Whitespace-separated list of OAuth scopes that can be used when obtaining an access token.

* + * @return null|string */ public function getScope(); @@ -36,6 +38,7 @@ public function getScope(); /** *

If set, the Client will be deleted after the specified amount of days.

* + * @return null|int */ public function getDeleteDaysAfterCreation(); @@ -43,6 +46,7 @@ public function getDeleteDaysAfterCreation(); /** *

Expiration time in seconds for each access token obtained by the APIClient. If not set the default value applies.

* + * @return null|int */ public function getAccessTokenValiditySeconds(); @@ -50,6 +54,7 @@ public function getAccessTokenValiditySeconds(); /** *

Inactivity expiration time in seconds for each refresh token obtained by the APIClient. The expiration time for refresh tokens is restarted each time the token is used. If not set the default value applies.

* + * @return null|int */ public function getRefreshTokenValiditySeconds(); diff --git a/lib/commercetools-api/src/Models/ApiClient/ApiClientDraftBuilder.php b/lib/commercetools-api/src/Models/ApiClient/ApiClientDraftBuilder.php index 0e251cb3559..3d42544e5a8 100644 --- a/lib/commercetools-api/src/Models/ApiClient/ApiClientDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ApiClient/ApiClientDraftBuilder.php @@ -21,26 +21,31 @@ final class ApiClientDraftBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?string */ private $scope; /** + * @var ?int */ private $deleteDaysAfterCreation; /** + * @var ?int */ private $accessTokenValiditySeconds; /** + * @var ?int */ private $refreshTokenValiditySeconds; @@ -48,6 +53,7 @@ final class ApiClientDraftBuilder implements Builder /** *

Name of the APIClient.

* + * @return null|string */ public function getName() @@ -58,6 +64,7 @@ public function getName() /** *

Whitespace-separated list of OAuth scopes that can be used when obtaining an access token.

* + * @return null|string */ public function getScope() @@ -68,6 +75,7 @@ public function getScope() /** *

If set, the Client will be deleted after the specified amount of days.

* + * @return null|int */ public function getDeleteDaysAfterCreation() @@ -78,6 +86,7 @@ public function getDeleteDaysAfterCreation() /** *

Expiration time in seconds for each access token obtained by the APIClient. If not set the default value applies.

* + * @return null|int */ public function getAccessTokenValiditySeconds() @@ -88,6 +97,7 @@ public function getAccessTokenValiditySeconds() /** *

Inactivity expiration time in seconds for each refresh token obtained by the APIClient. The expiration time for refresh tokens is restarted each time the token is used. If not set the default value applies.

* + * @return null|int */ public function getRefreshTokenValiditySeconds() diff --git a/lib/commercetools-api/src/Models/ApiClient/ApiClientDraftModel.php b/lib/commercetools-api/src/Models/ApiClient/ApiClientDraftModel.php index 89b3f669728..925b96e2897 100644 --- a/lib/commercetools-api/src/Models/ApiClient/ApiClientDraftModel.php +++ b/lib/commercetools-api/src/Models/ApiClient/ApiClientDraftModel.php @@ -20,26 +20,31 @@ final class ApiClientDraftModel extends JsonObjectModel implements ApiClientDraft { /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $scope; /** + * * @var ?int */ protected $deleteDaysAfterCreation; /** + * * @var ?int */ protected $accessTokenValiditySeconds; /** + * * @var ?int */ protected $refreshTokenValiditySeconds; @@ -65,6 +70,7 @@ public function __construct( /** *

Name of the APIClient.

* + * * @return null|string */ public function getName() @@ -84,6 +90,7 @@ public function getName() /** *

Whitespace-separated list of OAuth scopes that can be used when obtaining an access token.

* + * * @return null|string */ public function getScope() @@ -103,6 +110,7 @@ public function getScope() /** *

If set, the Client will be deleted after the specified amount of days.

* + * * @return null|int */ public function getDeleteDaysAfterCreation() @@ -122,6 +130,7 @@ public function getDeleteDaysAfterCreation() /** *

Expiration time in seconds for each access token obtained by the APIClient. If not set the default value applies.

* + * * @return null|int */ public function getAccessTokenValiditySeconds() @@ -141,6 +150,7 @@ public function getAccessTokenValiditySeconds() /** *

Inactivity expiration time in seconds for each refresh token obtained by the APIClient. The expiration time for refresh tokens is restarted each time the token is used. If not set the default value applies.

* + * * @return null|int */ public function getRefreshTokenValiditySeconds() diff --git a/lib/commercetools-api/src/Models/ApiClient/ApiClientModel.php b/lib/commercetools-api/src/Models/ApiClient/ApiClientModel.php index 06137c3fc4a..a493d2be1a3 100644 --- a/lib/commercetools-api/src/Models/ApiClient/ApiClientModel.php +++ b/lib/commercetools-api/src/Models/ApiClient/ApiClientModel.php @@ -21,46 +21,55 @@ final class ApiClientModel extends JsonObjectModel implements ApiClient { /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $scope; /** + * * @var ?string */ protected $secret; /** + * * @var ?DateTimeImmutable */ protected $lastUsedAt; /** + * * @var ?DateTimeImmutable */ protected $deleteAt; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?int */ protected $accessTokenValiditySeconds; /** + * * @var ?int */ protected $refreshTokenValiditySeconds; @@ -94,6 +103,7 @@ public function __construct( /** *

The OAuth2 client_id that can be used to obtain an access token.

* + * * @return null|string */ public function getId() @@ -113,6 +123,7 @@ public function getId() /** *

Name of the APIClient.

* + * * @return null|string */ public function getName() @@ -132,6 +143,7 @@ public function getName() /** *

Whitespace-separated list of OAuth scopes that can be used when obtaining an access token.

* + * * @return null|string */ public function getScope() @@ -152,6 +164,7 @@ public function getScope() *

Only shown once in the response of creating the APIClient. * This is the OAuth2 client_secret that can be used to obtain an access token.

* + * * @return null|string */ public function getSecret() @@ -171,6 +184,7 @@ public function getSecret() /** *

Date of the last day this APIClient was used to obtain an access token.

* + * * @return null|DateTimeImmutable */ public function getLastUsedAt() @@ -194,6 +208,7 @@ public function getLastUsedAt() /** *

If set, the Client will be deleted on (or shortly after) this point in time.

* + * * @return null|DateTimeImmutable */ public function getDeleteAt() @@ -217,6 +232,7 @@ public function getDeleteAt() /** *

Date and time (UTC) the APIClient was initially created at.

* + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -240,6 +256,7 @@ public function getCreatedAt() /** *

Expiration time in seconds for each access token obtained by the APIClient. Only present when set with the APIClientDraft. If not present the default value applies.

* + * * @return null|int */ public function getAccessTokenValiditySeconds() @@ -259,6 +276,7 @@ public function getAccessTokenValiditySeconds() /** *

Inactivity expiration time in seconds for each refresh token obtained by the APIClient. Only present when set with the APIClientDraft. If not present the default value applies.

* + * * @return null|int */ public function getRefreshTokenValiditySeconds() diff --git a/lib/commercetools-api/src/Models/ApiClient/ApiClientPagedQueryResponse.php b/lib/commercetools-api/src/Models/ApiClient/ApiClientPagedQueryResponse.php index 49ab745be40..137562deb52 100644 --- a/lib/commercetools-api/src/Models/ApiClient/ApiClientPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/ApiClient/ApiClientPagedQueryResponse.php @@ -22,6 +22,7 @@ interface ApiClientPagedQueryResponse extends JsonObject /** *

Number of results requested.

* + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

Number of elements skipped.

* + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

Actual number of results returned.

* + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

* + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

APIClients matching the query.

* + * @return null|ApiClientCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/ApiClient/ApiClientPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/ApiClient/ApiClientPagedQueryResponseBuilder.php index 7cf647d4f64..6f47eea9c7a 100644 --- a/lib/commercetools-api/src/Models/ApiClient/ApiClientPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/ApiClient/ApiClientPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class ApiClientPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?ApiClientCollection */ private $results; @@ -48,6 +53,7 @@ final class ApiClientPagedQueryResponseBuilder implements Builder /** *

Number of results requested.

* + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

Number of elements skipped.

* + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

Actual number of results returned.

* + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

* + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

APIClients matching the query.

* + * @return null|ApiClientCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/ApiClient/ApiClientPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/ApiClient/ApiClientPagedQueryResponseModel.php index 7398b2db62d..6e6e75fbea1 100644 --- a/lib/commercetools-api/src/Models/ApiClient/ApiClientPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/ApiClient/ApiClientPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class ApiClientPagedQueryResponseModel extends JsonObjectModel implements ApiClientPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?ApiClientCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

Number of results requested.

* + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

Number of elements skipped.

* + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

Actual number of results returned.

* + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

* + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

APIClients matching the query.

* + * * @return null|ApiClientCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/BusinessUnit/Associate.php b/lib/commercetools-api/src/Models/BusinessUnit/Associate.php new file mode 100644 index 00000000000..52aa46667c8 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/Associate.php @@ -0,0 +1,45 @@ +Roles the Associate holds within the Business Unit.

+ * + + * @return null|array + */ + public function getRoles(); + + /** + *

The Customer that is part of the Business Unit.

+ * + + * @return null|CustomerReference + */ + public function getCustomer(); + + /** + * @param ?array $roles + */ + public function setRoles(?array $roles): void; + + /** + * @param ?CustomerReference $customer + */ + public function setCustomer(?CustomerReference $customer): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/AssociateBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/AssociateBuilder.php new file mode 100644 index 00000000000..696270c244c --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/AssociateBuilder.php @@ -0,0 +1,104 @@ + + */ +final class AssociateBuilder implements Builder +{ + /** + + * @var ?array + */ + private $roles; + + /** + + * @var null|CustomerReference|CustomerReferenceBuilder + */ + private $customer; + + /** + *

Roles the Associate holds within the Business Unit.

+ * + + * @return null|array + */ + public function getRoles() + { + return $this->roles; + } + + /** + *

The Customer that is part of the Business Unit.

+ * + + * @return null|CustomerReference + */ + public function getCustomer() + { + return $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer; + } + + /** + * @param ?array $roles + * @return $this + */ + public function withRoles(?array $roles) + { + $this->roles = $roles; + + return $this; + } + + /** + * @param ?CustomerReference $customer + * @return $this + */ + public function withCustomer(?CustomerReference $customer) + { + $this->customer = $customer; + + return $this; + } + + /** + * @deprecated use withCustomer() instead + * @return $this + */ + public function withCustomerBuilder(?CustomerReferenceBuilder $customer) + { + $this->customer = $customer; + + return $this; + } + + public function build(): Associate + { + return new AssociateModel( + $this->roles, + $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer + ); + } + + public static function of(): AssociateBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/AssociateCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/AssociateCollection.php new file mode 100644 index 00000000000..45c88fcda6a --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/AssociateCollection.php @@ -0,0 +1,56 @@ + + * @method Associate current() + * @method Associate end() + * @method Associate at($offset) + */ +class AssociateCollection extends MapperSequence +{ + /** + * @psalm-assert Associate $value + * @psalm-param Associate|stdClass $value + * @throws InvalidArgumentException + * + * @return AssociateCollection + */ + public function add($value) + { + if (!$value instanceof Associate) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?Associate + */ + protected function mapper() + { + return function (?int $index): ?Associate { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var Associate $data */ + $data = AssociateModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraft.php b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraft.php new file mode 100644 index 00000000000..a2691499dec --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraft.php @@ -0,0 +1,45 @@ +Roles the Associate should hold within the Business Unit.

+ * + + * @return null|array + */ + public function getRoles(); + + /** + *

The Customer to be part of the Business Unit.

+ * + + * @return null|CustomerResourceIdentifier + */ + public function getCustomer(); + + /** + * @param ?array $roles + */ + public function setRoles(?array $roles): void; + + /** + * @param ?CustomerResourceIdentifier $customer + */ + public function setCustomer(?CustomerResourceIdentifier $customer): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftBuilder.php new file mode 100644 index 00000000000..3a4b4a6eb60 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftBuilder.php @@ -0,0 +1,104 @@ + + */ +final class AssociateDraftBuilder implements Builder +{ + /** + + * @var ?array + */ + private $roles; + + /** + + * @var null|CustomerResourceIdentifier|CustomerResourceIdentifierBuilder + */ + private $customer; + + /** + *

Roles the Associate should hold within the Business Unit.

+ * + + * @return null|array + */ + public function getRoles() + { + return $this->roles; + } + + /** + *

The Customer to be part of the Business Unit.

+ * + + * @return null|CustomerResourceIdentifier + */ + public function getCustomer() + { + return $this->customer instanceof CustomerResourceIdentifierBuilder ? $this->customer->build() : $this->customer; + } + + /** + * @param ?array $roles + * @return $this + */ + public function withRoles(?array $roles) + { + $this->roles = $roles; + + return $this; + } + + /** + * @param ?CustomerResourceIdentifier $customer + * @return $this + */ + public function withCustomer(?CustomerResourceIdentifier $customer) + { + $this->customer = $customer; + + return $this; + } + + /** + * @deprecated use withCustomer() instead + * @return $this + */ + public function withCustomerBuilder(?CustomerResourceIdentifierBuilder $customer) + { + $this->customer = $customer; + + return $this; + } + + public function build(): AssociateDraft + { + return new AssociateDraftModel( + $this->roles, + $this->customer instanceof CustomerResourceIdentifierBuilder ? $this->customer->build() : $this->customer + ); + } + + public static function of(): AssociateDraftBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftCollection.php new file mode 100644 index 00000000000..82afa7cbc1e --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftCollection.php @@ -0,0 +1,56 @@ + + * @method AssociateDraft current() + * @method AssociateDraft end() + * @method AssociateDraft at($offset) + */ +class AssociateDraftCollection extends MapperSequence +{ + /** + * @psalm-assert AssociateDraft $value + * @psalm-param AssociateDraft|stdClass $value + * @throws InvalidArgumentException + * + * @return AssociateDraftCollection + */ + public function add($value) + { + if (!$value instanceof AssociateDraft) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?AssociateDraft + */ + protected function mapper() + { + return function (?int $index): ?AssociateDraft { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var AssociateDraft $data */ + $data = AssociateDraftModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftModel.php b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftModel.php new file mode 100644 index 00000000000..58f0f036139 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftModel.php @@ -0,0 +1,105 @@ +roles = $roles; + $this->customer = $customer; + } + + /** + *

Roles the Associate should hold within the Business Unit.

+ * + * + * @return null|array + */ + public function getRoles() + { + if (is_null($this->roles)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ROLES); + if (is_null($data)) { + return null; + } + $this->roles = $data; + } + + return $this->roles; + } + + /** + *

The Customer to be part of the Business Unit.

+ * + * + * @return null|CustomerResourceIdentifier + */ + public function getCustomer() + { + if (is_null($this->customer)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER); + if (is_null($data)) { + return null; + } + + $this->customer = CustomerResourceIdentifierModel::of($data); + } + + return $this->customer; + } + + + /** + * @param ?array $roles + */ + public function setRoles(?array $roles): void + { + $this->roles = $roles; + } + + /** + * @param ?CustomerResourceIdentifier $customer + */ + public function setCustomer(?CustomerResourceIdentifier $customer): void + { + $this->customer = $customer; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/AssociateModel.php b/lib/commercetools-api/src/Models/BusinessUnit/AssociateModel.php new file mode 100644 index 00000000000..f43c16c2fdc --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/AssociateModel.php @@ -0,0 +1,105 @@ +roles = $roles; + $this->customer = $customer; + } + + /** + *

Roles the Associate holds within the Business Unit.

+ * + * + * @return null|array + */ + public function getRoles() + { + if (is_null($this->roles)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ROLES); + if (is_null($data)) { + return null; + } + $this->roles = $data; + } + + return $this->roles; + } + + /** + *

The Customer that is part of the Business Unit.

+ * + * + * @return null|CustomerReference + */ + public function getCustomer() + { + if (is_null($this->customer)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER); + if (is_null($data)) { + return null; + } + + $this->customer = CustomerReferenceModel::of($data); + } + + return $this->customer; + } + + + /** + * @param ?array $roles + */ + public function setRoles(?array $roles): void + { + $this->roles = $roles; + } + + /** + * @param ?CustomerReference $customer + */ + public function setCustomer(?CustomerReference $customer): void + { + $this->customer = $customer; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnit.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnit.php new file mode 100644 index 00000000000..9a59941d8e6 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnit.php @@ -0,0 +1,326 @@ +Unique identifier of the Business Unit.

+ * + + * @return null|string + */ + public function getId(); + + /** + *

Current version of the Business Unit.

+ * + + * @return null|int + */ + public function getVersion(); + + /** + *

Date and time (UTC) the Business Unit was initially created.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt(); + + /** + *

Date and time (UTC) the Business Unit was last updated.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt(); + + /** + *

Present on resources updated after 1 February 2019 except for events not tracked.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy(); + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy(); + + /** + *

User-defined unique identifier of the Business Unit.

+ * + + * @return null|string + */ + public function getKey(); + + /** + *

Indicates whether the Business Unit can be edited and used in Orders.

+ * + + * @return null|string + */ + public function getStatus(); + + /** + *

References to Stores the Business Unit is associated with. + * If empty, the Business Unit can only create Carts, Orders, or Quotes that have no store value. + * If not empty, the Business Unit can only be linked to Carts and Orders of a referenced Store. + * Only present when storeMode is Explicit.

+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores(); + + /** + *

Defines whether the Stores of the Business Unit are set on the Business Unit or are inherited from a parent.

+ * + + * @return null|string + */ + public function getStoreMode(); + + /** + *

Type of the Business Unit indicating its position in a hierarchy.

+ * + + * @return null|string + */ + public function getUnitType(); + + /** + *

Name of the Business Unit.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

Email address of the Business Unit.

+ * + + * @return null|string + */ + public function getContactEmail(); + + /** + *

Custom Fields for the Business Unit.

+ * + + * @return null|CustomFields + */ + public function getCustom(); + + /** + *

Addresses used by the Business Unit.

+ * + + * @return null|AddressCollection + */ + public function getAddresses(); + + /** + *

Unique identifiers of addresses used as shipping addresses.

+ * + + * @return null|array + */ + public function getShippingAddressIds(); + + /** + *

Unique identifier of the address used as the default shipping address.

+ * + + * @return null|string + */ + public function getDefaultShipingAddressId(); + + /** + *

Unique identifiers of addresses used as billing addresses.

+ * + + * @return null|array + */ + public function getBillingAddressIds(); + + /** + *

Unique identifier of the address used as the default billing address.

+ * + + * @return null|string + */ + public function getDefaultBillingAddressId(); + + /** + *

Members that are part of the Business Unit in specific roles.

+ * + + * @return null|AssociateCollection + */ + public function getAssociates(); + + /** + *

Parent unit of the Business Unit. Only present when the unitType is Division.

+ * + + * @return null|BusinessUnitKeyReference + */ + public function getParentUnit(); + + /** + *

Top-level unit of the Business Unit. The top-level unit is of unitType Company.

+ * + + * @return null|BusinessUnitKeyReference + */ + public function getTopLevelUnit(); + + /** + * @param ?string $id + */ + public function setId(?string $id): void; + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void; + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void; + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void; + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void; + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void; + + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + + /** + * @param ?string $status + */ + public function setStatus(?string $status): void; + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void; + + /** + * @param ?string $storeMode + */ + public function setStoreMode(?string $storeMode): void; + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void; + + /** + * @param ?CustomFields $custom + */ + public function setCustom(?CustomFields $custom): void; + + /** + * @param ?AddressCollection $addresses + */ + public function setAddresses(?AddressCollection $addresses): void; + + /** + * @param ?array $shippingAddressIds + */ + public function setShippingAddressIds(?array $shippingAddressIds): void; + + /** + * @param ?string $defaultShipingAddressId + */ + public function setDefaultShipingAddressId(?string $defaultShipingAddressId): void; + + /** + * @param ?array $billingAddressIds + */ + public function setBillingAddressIds(?array $billingAddressIds): void; + + /** + * @param ?string $defaultBillingAddressId + */ + public function setDefaultBillingAddressId(?string $defaultBillingAddressId): void; + + /** + * @param ?AssociateCollection $associates + */ + public function setAssociates(?AssociateCollection $associates): void; + + /** + * @param ?BusinessUnitKeyReference $parentUnit + */ + public function setParentUnit(?BusinessUnitKeyReference $parentUnit): void; + + /** + * @param ?BusinessUnitKeyReference $topLevelUnit + */ + public function setTopLevelUnit(?BusinessUnitKeyReference $topLevelUnit): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAddressAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAddressAction.php new file mode 100644 index 00000000000..1fa6625400b --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAddressAction.php @@ -0,0 +1,31 @@ +Address to add to the addresses of the Business Unit.

+ * + + * @return null|BaseAddress + */ + public function getAddress(); + + /** + * @param ?BaseAddress $address + */ + public function setAddress(?BaseAddress $address): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAddressActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAddressActionBuilder.php new file mode 100644 index 00000000000..2218d7255e7 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAddressActionBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitAddAddressActionBuilder implements Builder +{ + /** + + * @var null|BaseAddress|BaseAddressBuilder + */ + private $address; + + /** + *

Address to add to the addresses of the Business Unit.

+ * + + * @return null|BaseAddress + */ + public function getAddress() + { + return $this->address instanceof BaseAddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?BaseAddress $address + * @return $this + */ + public function withAddress(?BaseAddress $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?BaseAddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitAddAddressAction + { + return new BusinessUnitAddAddressActionModel( + $this->address instanceof BaseAddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitAddAddressActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAddressActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAddressActionCollection.php new file mode 100644 index 00000000000..ff2f1ff0fd2 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAddressActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAddAddressAction current() + * @method BusinessUnitAddAddressAction end() + * @method BusinessUnitAddAddressAction at($offset) + */ +class BusinessUnitAddAddressActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitAddAddressAction $value + * @psalm-param BusinessUnitAddAddressAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAddAddressActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAddAddressAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAddAddressAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAddAddressAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAddAddressAction $data */ + $data = BusinessUnitAddAddressActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAddressActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAddressActionModel.php new file mode 100644 index 00000000000..9d9d21b30c9 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAddressActionModel.php @@ -0,0 +1,96 @@ +address = $address; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

Address to add to the addresses of the Business Unit.

+ * + * + * @return null|BaseAddress + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = BaseAddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?BaseAddress $address + */ + public function setAddress(?BaseAddress $address): void + { + $this->address = $address; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAssociateAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAssociateAction.php new file mode 100644 index 00000000000..23bece2c216 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAssociateAction.php @@ -0,0 +1,30 @@ +The Associate to add.

+ * + + * @return null|AssociateDraft + */ + public function getAssociate(); + + /** + * @param ?AssociateDraft $associate + */ + public function setAssociate(?AssociateDraft $associate): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAssociateActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAssociateActionBuilder.php new file mode 100644 index 00000000000..bd8d8d27e20 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAssociateActionBuilder.php @@ -0,0 +1,73 @@ + + */ +final class BusinessUnitAddAssociateActionBuilder implements Builder +{ + /** + + * @var null|AssociateDraft|AssociateDraftBuilder + */ + private $associate; + + /** + *

The Associate to add.

+ * + + * @return null|AssociateDraft + */ + public function getAssociate() + { + return $this->associate instanceof AssociateDraftBuilder ? $this->associate->build() : $this->associate; + } + + /** + * @param ?AssociateDraft $associate + * @return $this + */ + public function withAssociate(?AssociateDraft $associate) + { + $this->associate = $associate; + + return $this; + } + + /** + * @deprecated use withAssociate() instead + * @return $this + */ + public function withAssociateBuilder(?AssociateDraftBuilder $associate) + { + $this->associate = $associate; + + return $this; + } + + public function build(): BusinessUnitAddAssociateAction + { + return new BusinessUnitAddAssociateActionModel( + $this->associate instanceof AssociateDraftBuilder ? $this->associate->build() : $this->associate + ); + } + + public static function of(): BusinessUnitAddAssociateActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAssociateActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAssociateActionCollection.php new file mode 100644 index 00000000000..733359f08d5 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAssociateActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAddAssociateAction current() + * @method BusinessUnitAddAssociateAction end() + * @method BusinessUnitAddAssociateAction at($offset) + */ +class BusinessUnitAddAssociateActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitAddAssociateAction $value + * @psalm-param BusinessUnitAddAssociateAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAddAssociateActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAddAssociateAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAddAssociateAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAddAssociateAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAddAssociateAction $data */ + $data = BusinessUnitAddAssociateActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAssociateActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAssociateActionModel.php new file mode 100644 index 00000000000..cda4031e783 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddAssociateActionModel.php @@ -0,0 +1,94 @@ +associate = $associate; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

The Associate to add.

+ * + * + * @return null|AssociateDraft + */ + public function getAssociate() + { + if (is_null($this->associate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ASSOCIATE); + if (is_null($data)) { + return null; + } + + $this->associate = AssociateDraftModel::of($data); + } + + return $this->associate; + } + + + /** + * @param ?AssociateDraft $associate + */ + public function setAssociate(?AssociateDraft $associate): void + { + $this->associate = $associate; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddBillingAddressIdAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddBillingAddressIdAction.php new file mode 100644 index 00000000000..d2e3eaeccf2 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddBillingAddressIdAction.php @@ -0,0 +1,44 @@ +ID of the address to add as a billing address. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressId(); + + /** + *

Key of the address to add as a billing address. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressKey(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddBillingAddressIdActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddBillingAddressIdActionBuilder.php new file mode 100644 index 00000000000..e821cbf96db --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddBillingAddressIdActionBuilder.php @@ -0,0 +1,92 @@ + + */ +final class BusinessUnitAddBillingAddressIdActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $addressKey; + + /** + *

ID of the address to add as a billing address. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

Key of the address to add as a billing address. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressKey() + { + return $this->addressKey; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $addressKey + * @return $this + */ + public function withAddressKey(?string $addressKey) + { + $this->addressKey = $addressKey; + + return $this; + } + + + public function build(): BusinessUnitAddBillingAddressIdAction + { + return new BusinessUnitAddBillingAddressIdActionModel( + $this->addressId, + $this->addressKey + ); + } + + public static function of(): BusinessUnitAddBillingAddressIdActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddBillingAddressIdActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddBillingAddressIdActionCollection.php new file mode 100644 index 00000000000..6b057c83fb0 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddBillingAddressIdActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAddBillingAddressIdAction current() + * @method BusinessUnitAddBillingAddressIdAction end() + * @method BusinessUnitAddBillingAddressIdAction at($offset) + */ +class BusinessUnitAddBillingAddressIdActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitAddBillingAddressIdAction $value + * @psalm-param BusinessUnitAddBillingAddressIdAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAddBillingAddressIdActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAddBillingAddressIdAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAddBillingAddressIdAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAddBillingAddressIdAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAddBillingAddressIdAction $data */ + $data = BusinessUnitAddBillingAddressIdActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddBillingAddressIdActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddBillingAddressIdActionModel.php new file mode 100644 index 00000000000..ab17eae1639 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddBillingAddressIdActionModel.php @@ -0,0 +1,129 @@ +addressId = $addressId; + $this->addressKey = $addressKey; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

ID of the address to add as a billing address. Either addressId or addressKey is required.

+ * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

Key of the address to add as a billing address. Either addressId or addressKey is required.

+ * + * + * @return null|string + */ + public function getAddressKey() + { + if (is_null($this->addressKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_KEY); + if (is_null($data)) { + return null; + } + $this->addressKey = (string) $data; + } + + return $this->addressKey; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void + { + $this->addressKey = $addressKey; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddShippingAddressIdAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddShippingAddressIdAction.php new file mode 100644 index 00000000000..6184b49c71b --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddShippingAddressIdAction.php @@ -0,0 +1,44 @@ +ID of the address to add as a shipping address. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressId(); + + /** + *

Key of the address to add as a shipping address. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressKey(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddShippingAddressIdActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddShippingAddressIdActionBuilder.php new file mode 100644 index 00000000000..2dc2b2f3702 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddShippingAddressIdActionBuilder.php @@ -0,0 +1,92 @@ + + */ +final class BusinessUnitAddShippingAddressIdActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $addressKey; + + /** + *

ID of the address to add as a shipping address. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

Key of the address to add as a shipping address. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressKey() + { + return $this->addressKey; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $addressKey + * @return $this + */ + public function withAddressKey(?string $addressKey) + { + $this->addressKey = $addressKey; + + return $this; + } + + + public function build(): BusinessUnitAddShippingAddressIdAction + { + return new BusinessUnitAddShippingAddressIdActionModel( + $this->addressId, + $this->addressKey + ); + } + + public static function of(): BusinessUnitAddShippingAddressIdActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddShippingAddressIdActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddShippingAddressIdActionCollection.php new file mode 100644 index 00000000000..525051a0a9b --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddShippingAddressIdActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAddShippingAddressIdAction current() + * @method BusinessUnitAddShippingAddressIdAction end() + * @method BusinessUnitAddShippingAddressIdAction at($offset) + */ +class BusinessUnitAddShippingAddressIdActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitAddShippingAddressIdAction $value + * @psalm-param BusinessUnitAddShippingAddressIdAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAddShippingAddressIdActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAddShippingAddressIdAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAddShippingAddressIdAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAddShippingAddressIdAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAddShippingAddressIdAction $data */ + $data = BusinessUnitAddShippingAddressIdActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddShippingAddressIdActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddShippingAddressIdActionModel.php new file mode 100644 index 00000000000..c6f57ee582e --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddShippingAddressIdActionModel.php @@ -0,0 +1,129 @@ +addressId = $addressId; + $this->addressKey = $addressKey; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

ID of the address to add as a shipping address. Either addressId or addressKey is required.

+ * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

Key of the address to add as a shipping address. Either addressId or addressKey is required.

+ * + * + * @return null|string + */ + public function getAddressKey() + { + if (is_null($this->addressKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_KEY); + if (is_null($data)) { + return null; + } + $this->addressKey = (string) $data; + } + + return $this->addressKey; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void + { + $this->addressKey = $addressKey; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddStoreAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddStoreAction.php new file mode 100644 index 00000000000..3a65bd32ae0 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddStoreAction.php @@ -0,0 +1,31 @@ +Store to add.

+ * + + * @return null|StoreResourceIdentifier + */ + public function getStore(); + + /** + * @param ?StoreResourceIdentifier $store + */ + public function setStore(?StoreResourceIdentifier $store): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddStoreActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddStoreActionBuilder.php new file mode 100644 index 00000000000..ab6b46bb399 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddStoreActionBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitAddStoreActionBuilder implements Builder +{ + /** + + * @var null|StoreResourceIdentifier|StoreResourceIdentifierBuilder + */ + private $store; + + /** + *

Store to add.

+ * + + * @return null|StoreResourceIdentifier + */ + public function getStore() + { + return $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store; + } + + /** + * @param ?StoreResourceIdentifier $store + * @return $this + */ + public function withStore(?StoreResourceIdentifier $store) + { + $this->store = $store; + + return $this; + } + + /** + * @deprecated use withStore() instead + * @return $this + */ + public function withStoreBuilder(?StoreResourceIdentifierBuilder $store) + { + $this->store = $store; + + return $this; + } + + public function build(): BusinessUnitAddStoreAction + { + return new BusinessUnitAddStoreActionModel( + $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store + ); + } + + public static function of(): BusinessUnitAddStoreActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddStoreActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddStoreActionCollection.php new file mode 100644 index 00000000000..9c55ae2a1f5 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddStoreActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAddStoreAction current() + * @method BusinessUnitAddStoreAction end() + * @method BusinessUnitAddStoreAction at($offset) + */ +class BusinessUnitAddStoreActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitAddStoreAction $value + * @psalm-param BusinessUnitAddStoreAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAddStoreActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAddStoreAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAddStoreAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAddStoreAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAddStoreAction $data */ + $data = BusinessUnitAddStoreActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddStoreActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddStoreActionModel.php new file mode 100644 index 00000000000..774b81dbafe --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitAddStoreActionModel.php @@ -0,0 +1,96 @@ +store = $store; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

Store to add.

+ * + * + * @return null|StoreResourceIdentifier + */ + public function getStore() + { + if (is_null($this->store)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STORE); + if (is_null($data)) { + return null; + } + + $this->store = StoreResourceIdentifierModel::of($data); + } + + return $this->store; + } + + + /** + * @param ?StoreResourceIdentifier $store + */ + public function setStore(?StoreResourceIdentifier $store): void + { + $this->store = $store; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitBuilder.php new file mode 100644 index 00000000000..0a1c31bff39 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitBuilder.php @@ -0,0 +1,711 @@ + + */ +final class BusinessUnitBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?string + */ + private $key; + + /** + + * @var ?string + */ + private $status; + + /** + + * @var ?StoreKeyReferenceCollection + */ + private $stores; + + /** + + * @var ?string + */ + private $storeMode; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var ?string + */ + private $contactEmail; + + /** + + * @var null|CustomFields|CustomFieldsBuilder + */ + private $custom; + + /** + + * @var ?AddressCollection + */ + private $addresses; + + /** + + * @var ?array + */ + private $shippingAddressIds; + + /** + + * @var ?string + */ + private $defaultShipingAddressId; + + /** + + * @var ?array + */ + private $billingAddressIds; + + /** + + * @var ?string + */ + private $defaultBillingAddressId; + + /** + + * @var ?AssociateCollection + */ + private $associates; + + /** + + * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + */ + private $parentUnit; + + /** + + * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + */ + private $topLevelUnit; + + /** + *

Unique identifier of the Business Unit.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Current version of the Business Unit.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Business Unit was initially created.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Date and time (UTC) the Business Unit was last updated.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Present on resources updated after 1 February 2019 except for events not tracked.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

User-defined unique identifier of the Business Unit.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + *

Indicates whether the Business Unit can be edited and used in Orders.

+ * + + * @return null|string + */ + public function getStatus() + { + return $this->status; + } + + /** + *

References to Stores the Business Unit is associated with. + * If empty, the Business Unit can only create Carts, Orders, or Quotes that have no store value. + * If not empty, the Business Unit can only be linked to Carts and Orders of a referenced Store. + * Only present when storeMode is Explicit.

+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + *

Defines whether the Stores of the Business Unit are set on the Business Unit or are inherited from a parent.

+ * + + * @return null|string + */ + public function getStoreMode() + { + return $this->storeMode; + } + + /** + *

Name of the Business Unit.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

Email address of the Business Unit.

+ * + + * @return null|string + */ + public function getContactEmail() + { + return $this->contactEmail; + } + + /** + *

Custom Fields for the Business Unit.

+ * + + * @return null|CustomFields + */ + public function getCustom() + { + return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; + } + + /** + *

Addresses used by the Business Unit.

+ * + + * @return null|AddressCollection + */ + public function getAddresses() + { + return $this->addresses; + } + + /** + *

Unique identifiers of addresses used as shipping addresses.

+ * + + * @return null|array + */ + public function getShippingAddressIds() + { + return $this->shippingAddressIds; + } + + /** + *

Unique identifier of the address used as the default shipping address.

+ * + + * @return null|string + */ + public function getDefaultShipingAddressId() + { + return $this->defaultShipingAddressId; + } + + /** + *

Unique identifiers of addresses used as billing addresses.

+ * + + * @return null|array + */ + public function getBillingAddressIds() + { + return $this->billingAddressIds; + } + + /** + *

Unique identifier of the address used as the default billing address.

+ * + + * @return null|string + */ + public function getDefaultBillingAddressId() + { + return $this->defaultBillingAddressId; + } + + /** + *

Members that are part of the Business Unit in specific roles.

+ * + + * @return null|AssociateCollection + */ + public function getAssociates() + { + return $this->associates; + } + + /** + *

Parent unit of the Business Unit. Only present when the unitType is Division.

+ * + + * @return null|BusinessUnitKeyReference + */ + public function getParentUnit() + { + return $this->parentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->parentUnit->build() : $this->parentUnit; + } + + /** + *

Top-level unit of the Business Unit. The top-level unit is of unitType Company.

+ * + + * @return null|BusinessUnitKeyReference + */ + public function getTopLevelUnit() + { + return $this->topLevelUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->topLevelUnit->build() : $this->topLevelUnit; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?string $status + * @return $this + */ + public function withStatus(?string $status) + { + $this->status = $status; + + return $this; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + * @return $this + */ + public function withStores(?StoreKeyReferenceCollection $stores) + { + $this->stores = $stores; + + return $this; + } + + /** + * @param ?string $storeMode + * @return $this + */ + public function withStoreMode(?string $storeMode) + { + $this->storeMode = $storeMode; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param ?string $contactEmail + * @return $this + */ + public function withContactEmail(?string $contactEmail) + { + $this->contactEmail = $contactEmail; + + return $this; + } + + /** + * @param ?CustomFields $custom + * @return $this + */ + public function withCustom(?CustomFields $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @param ?AddressCollection $addresses + * @return $this + */ + public function withAddresses(?AddressCollection $addresses) + { + $this->addresses = $addresses; + + return $this; + } + + /** + * @param ?array $shippingAddressIds + * @return $this + */ + public function withShippingAddressIds(?array $shippingAddressIds) + { + $this->shippingAddressIds = $shippingAddressIds; + + return $this; + } + + /** + * @param ?string $defaultShipingAddressId + * @return $this + */ + public function withDefaultShipingAddressId(?string $defaultShipingAddressId) + { + $this->defaultShipingAddressId = $defaultShipingAddressId; + + return $this; + } + + /** + * @param ?array $billingAddressIds + * @return $this + */ + public function withBillingAddressIds(?array $billingAddressIds) + { + $this->billingAddressIds = $billingAddressIds; + + return $this; + } + + /** + * @param ?string $defaultBillingAddressId + * @return $this + */ + public function withDefaultBillingAddressId(?string $defaultBillingAddressId) + { + $this->defaultBillingAddressId = $defaultBillingAddressId; + + return $this; + } + + /** + * @param ?AssociateCollection $associates + * @return $this + */ + public function withAssociates(?AssociateCollection $associates) + { + $this->associates = $associates; + + return $this; + } + + /** + * @param ?BusinessUnitKeyReference $parentUnit + * @return $this + */ + public function withParentUnit(?BusinessUnitKeyReference $parentUnit) + { + $this->parentUnit = $parentUnit; + + return $this; + } + + /** + * @param ?BusinessUnitKeyReference $topLevelUnit + * @return $this + */ + public function withTopLevelUnit(?BusinessUnitKeyReference $topLevelUnit) + { + $this->topLevelUnit = $topLevelUnit; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @deprecated use withParentUnit() instead + * @return $this + */ + public function withParentUnitBuilder(?BusinessUnitKeyReferenceBuilder $parentUnit) + { + $this->parentUnit = $parentUnit; + + return $this; + } + + /** + * @deprecated use withTopLevelUnit() instead + * @return $this + */ + public function withTopLevelUnitBuilder(?BusinessUnitKeyReferenceBuilder $topLevelUnit) + { + $this->topLevelUnit = $topLevelUnit; + + return $this; + } + + public function build(): BusinessUnit + { + return new BusinessUnitModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->key, + $this->status, + $this->stores, + $this->storeMode, + $this->name, + $this->contactEmail, + $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, + $this->addresses, + $this->shippingAddressIds, + $this->defaultShipingAddressId, + $this->billingAddressIds, + $this->defaultBillingAddressId, + $this->associates, + $this->parentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->parentUnit->build() : $this->parentUnit, + $this->topLevelUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->topLevelUnit->build() : $this->topLevelUnit + ); + } + + public static function of(): BusinessUnitBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAddressAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAddressAction.php new file mode 100644 index 00000000000..93ff8978d0a --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAddressAction.php @@ -0,0 +1,59 @@ +ID of the address to change. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressId(); + + /** + *

Key of the address to change. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressKey(); + + /** + *

New address to set.

+ * + + * @return null|BaseAddress + */ + public function getAddress(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void; + + /** + * @param ?BaseAddress $address + */ + public function setAddress(?BaseAddress $address): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAddressActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAddressActionBuilder.php new file mode 100644 index 00000000000..499ea976d4d --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAddressActionBuilder.php @@ -0,0 +1,133 @@ + + */ +final class BusinessUnitChangeAddressActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $addressKey; + + /** + + * @var null|BaseAddress|BaseAddressBuilder + */ + private $address; + + /** + *

ID of the address to change. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

Key of the address to change. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressKey() + { + return $this->addressKey; + } + + /** + *

New address to set.

+ * + + * @return null|BaseAddress + */ + public function getAddress() + { + return $this->address instanceof BaseAddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $addressKey + * @return $this + */ + public function withAddressKey(?string $addressKey) + { + $this->addressKey = $addressKey; + + return $this; + } + + /** + * @param ?BaseAddress $address + * @return $this + */ + public function withAddress(?BaseAddress $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?BaseAddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitChangeAddressAction + { + return new BusinessUnitChangeAddressActionModel( + $this->addressId, + $this->addressKey, + $this->address instanceof BaseAddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitChangeAddressActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAddressActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAddressActionCollection.php new file mode 100644 index 00000000000..eb6d3da6dec --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAddressActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitChangeAddressAction current() + * @method BusinessUnitChangeAddressAction end() + * @method BusinessUnitChangeAddressAction at($offset) + */ +class BusinessUnitChangeAddressActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitChangeAddressAction $value + * @psalm-param BusinessUnitChangeAddressAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitChangeAddressActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitChangeAddressAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitChangeAddressAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitChangeAddressAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitChangeAddressAction $data */ + $data = BusinessUnitChangeAddressActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAddressActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAddressActionModel.php new file mode 100644 index 00000000000..8ce57cbfc2c --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAddressActionModel.php @@ -0,0 +1,168 @@ +addressId = $addressId; + $this->addressKey = $addressKey; + $this->address = $address; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

ID of the address to change. Either addressId or addressKey is required.

+ * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

Key of the address to change. Either addressId or addressKey is required.

+ * + * + * @return null|string + */ + public function getAddressKey() + { + if (is_null($this->addressKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_KEY); + if (is_null($data)) { + return null; + } + $this->addressKey = (string) $data; + } + + return $this->addressKey; + } + + /** + *

New address to set.

+ * + * + * @return null|BaseAddress + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = BaseAddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void + { + $this->addressKey = $addressKey; + } + + /** + * @param ?BaseAddress $address + */ + public function setAddress(?BaseAddress $address): void + { + $this->address = $address; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateAction.php new file mode 100644 index 00000000000..de28332efd1 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateAction.php @@ -0,0 +1,30 @@ +New version of an existing Associate.

+ * + + * @return null|AssociateDraft + */ + public function getAssociate(); + + /** + * @param ?AssociateDraft $associate + */ + public function setAssociate(?AssociateDraft $associate): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateActionBuilder.php new file mode 100644 index 00000000000..bf595fca849 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateActionBuilder.php @@ -0,0 +1,73 @@ + + */ +final class BusinessUnitChangeAssociateActionBuilder implements Builder +{ + /** + + * @var null|AssociateDraft|AssociateDraftBuilder + */ + private $associate; + + /** + *

New version of an existing Associate.

+ * + + * @return null|AssociateDraft + */ + public function getAssociate() + { + return $this->associate instanceof AssociateDraftBuilder ? $this->associate->build() : $this->associate; + } + + /** + * @param ?AssociateDraft $associate + * @return $this + */ + public function withAssociate(?AssociateDraft $associate) + { + $this->associate = $associate; + + return $this; + } + + /** + * @deprecated use withAssociate() instead + * @return $this + */ + public function withAssociateBuilder(?AssociateDraftBuilder $associate) + { + $this->associate = $associate; + + return $this; + } + + public function build(): BusinessUnitChangeAssociateAction + { + return new BusinessUnitChangeAssociateActionModel( + $this->associate instanceof AssociateDraftBuilder ? $this->associate->build() : $this->associate + ); + } + + public static function of(): BusinessUnitChangeAssociateActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateActionCollection.php new file mode 100644 index 00000000000..bc8b8d18d55 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitChangeAssociateAction current() + * @method BusinessUnitChangeAssociateAction end() + * @method BusinessUnitChangeAssociateAction at($offset) + */ +class BusinessUnitChangeAssociateActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitChangeAssociateAction $value + * @psalm-param BusinessUnitChangeAssociateAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitChangeAssociateActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitChangeAssociateAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitChangeAssociateAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitChangeAssociateAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitChangeAssociateAction $data */ + $data = BusinessUnitChangeAssociateActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateActionModel.php new file mode 100644 index 00000000000..2e6922d17b1 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeAssociateActionModel.php @@ -0,0 +1,94 @@ +associate = $associate; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

New version of an existing Associate.

+ * + * + * @return null|AssociateDraft + */ + public function getAssociate() + { + if (is_null($this->associate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ASSOCIATE); + if (is_null($data)) { + return null; + } + + $this->associate = AssociateDraftModel::of($data); + } + + return $this->associate; + } + + + /** + * @param ?AssociateDraft $associate + */ + public function setAssociate(?AssociateDraft $associate): void + { + $this->associate = $associate; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeNameAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeNameAction.php new file mode 100644 index 00000000000..78b9f6c31ca --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeNameAction.php @@ -0,0 +1,30 @@ +New name to set.

+ * + + * @return null|string + */ + public function getName(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeNameActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeNameActionBuilder.php new file mode 100644 index 00000000000..d70b9760770 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeNameActionBuilder.php @@ -0,0 +1,63 @@ + + */ +final class BusinessUnitChangeNameActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $name; + + /** + *

New name to set.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + + public function build(): BusinessUnitChangeNameAction + { + return new BusinessUnitChangeNameActionModel( + $this->name + ); + } + + public static function of(): BusinessUnitChangeNameActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeNameActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeNameActionCollection.php new file mode 100644 index 00000000000..2a89c063f9a --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeNameActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitChangeNameAction current() + * @method BusinessUnitChangeNameAction end() + * @method BusinessUnitChangeNameAction at($offset) + */ +class BusinessUnitChangeNameActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitChangeNameAction $value + * @psalm-param BusinessUnitChangeNameAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitChangeNameActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitChangeNameAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitChangeNameAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitChangeNameAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitChangeNameAction $data */ + $data = BusinessUnitChangeNameActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeNameActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeNameActionModel.php new file mode 100644 index 00000000000..cb79dc74c86 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeNameActionModel.php @@ -0,0 +1,93 @@ +name = $name; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

New name to set.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeParentUnitAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeParentUnitAction.php new file mode 100644 index 00000000000..0f13b942ebd --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeParentUnitAction.php @@ -0,0 +1,30 @@ +New parent unit of the Business Unit.

+ * + + * @return null|BusinessUnitResourceIdentifier + */ + public function getParentUnit(); + + /** + * @param ?BusinessUnitResourceIdentifier $parentUnit + */ + public function setParentUnit(?BusinessUnitResourceIdentifier $parentUnit): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeParentUnitActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeParentUnitActionBuilder.php new file mode 100644 index 00000000000..88823e81eb2 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeParentUnitActionBuilder.php @@ -0,0 +1,73 @@ + + */ +final class BusinessUnitChangeParentUnitActionBuilder implements Builder +{ + /** + + * @var null|BusinessUnitResourceIdentifier|BusinessUnitResourceIdentifierBuilder + */ + private $parentUnit; + + /** + *

New parent unit of the Business Unit.

+ * + + * @return null|BusinessUnitResourceIdentifier + */ + public function getParentUnit() + { + return $this->parentUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->parentUnit->build() : $this->parentUnit; + } + + /** + * @param ?BusinessUnitResourceIdentifier $parentUnit + * @return $this + */ + public function withParentUnit(?BusinessUnitResourceIdentifier $parentUnit) + { + $this->parentUnit = $parentUnit; + + return $this; + } + + /** + * @deprecated use withParentUnit() instead + * @return $this + */ + public function withParentUnitBuilder(?BusinessUnitResourceIdentifierBuilder $parentUnit) + { + $this->parentUnit = $parentUnit; + + return $this; + } + + public function build(): BusinessUnitChangeParentUnitAction + { + return new BusinessUnitChangeParentUnitActionModel( + $this->parentUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->parentUnit->build() : $this->parentUnit + ); + } + + public static function of(): BusinessUnitChangeParentUnitActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeParentUnitActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeParentUnitActionCollection.php new file mode 100644 index 00000000000..16a39b8c904 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeParentUnitActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitChangeParentUnitAction current() + * @method BusinessUnitChangeParentUnitAction end() + * @method BusinessUnitChangeParentUnitAction at($offset) + */ +class BusinessUnitChangeParentUnitActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitChangeParentUnitAction $value + * @psalm-param BusinessUnitChangeParentUnitAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitChangeParentUnitActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitChangeParentUnitAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitChangeParentUnitAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitChangeParentUnitAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitChangeParentUnitAction $data */ + $data = BusinessUnitChangeParentUnitActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeParentUnitActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeParentUnitActionModel.php new file mode 100644 index 00000000000..10913a97071 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeParentUnitActionModel.php @@ -0,0 +1,94 @@ +parentUnit = $parentUnit; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

New parent unit of the Business Unit.

+ * + * + * @return null|BusinessUnitResourceIdentifier + */ + public function getParentUnit() + { + if (is_null($this->parentUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_PARENT_UNIT); + if (is_null($data)) { + return null; + } + + $this->parentUnit = BusinessUnitResourceIdentifierModel::of($data); + } + + return $this->parentUnit; + } + + + /** + * @param ?BusinessUnitResourceIdentifier $parentUnit + */ + public function setParentUnit(?BusinessUnitResourceIdentifier $parentUnit): void + { + $this->parentUnit = $parentUnit; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeStatusAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeStatusAction.php new file mode 100644 index 00000000000..40d83c4d426 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeStatusAction.php @@ -0,0 +1,30 @@ +New status to set.

+ * + + * @return null|string + */ + public function getStatus(); + + /** + * @param ?string $status + */ + public function setStatus(?string $status): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeStatusActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeStatusActionBuilder.php new file mode 100644 index 00000000000..86f0f4c369c --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeStatusActionBuilder.php @@ -0,0 +1,63 @@ + + */ +final class BusinessUnitChangeStatusActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $status; + + /** + *

New status to set.

+ * + + * @return null|string + */ + public function getStatus() + { + return $this->status; + } + + /** + * @param ?string $status + * @return $this + */ + public function withStatus(?string $status) + { + $this->status = $status; + + return $this; + } + + + public function build(): BusinessUnitChangeStatusAction + { + return new BusinessUnitChangeStatusActionModel( + $this->status + ); + } + + public static function of(): BusinessUnitChangeStatusActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeStatusActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeStatusActionCollection.php new file mode 100644 index 00000000000..a58d021d3bf --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeStatusActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitChangeStatusAction current() + * @method BusinessUnitChangeStatusAction end() + * @method BusinessUnitChangeStatusAction at($offset) + */ +class BusinessUnitChangeStatusActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitChangeStatusAction $value + * @psalm-param BusinessUnitChangeStatusAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitChangeStatusActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitChangeStatusAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitChangeStatusAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitChangeStatusAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitChangeStatusAction $data */ + $data = BusinessUnitChangeStatusActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeStatusActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeStatusActionModel.php new file mode 100644 index 00000000000..2e283959b12 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitChangeStatusActionModel.php @@ -0,0 +1,93 @@ +status = $status; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

New status to set.

+ * + * + * @return null|string + */ + public function getStatus() + { + if (is_null($this->status)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STATUS); + if (is_null($data)) { + return null; + } + $this->status = (string) $data; + } + + return $this->status; + } + + + /** + * @param ?string $status + */ + public function setStatus(?string $status): void + { + $this->status = $status; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitCollection.php new file mode 100644 index 00000000000..fb21c322da5 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitCollection.php @@ -0,0 +1,60 @@ + + * @psalm-method T current() + * @psalm-method T end() + * @psalm-method T at($offset) + * @method BusinessUnit current() + * @method BusinessUnit end() + * @method BusinessUnit at($offset) + */ +class BusinessUnitCollection extends BaseResourceCollection +{ + /** + * @psalm-assert T $value + * @psalm-param T|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnit) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?T + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnit { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var T $data */ + $data = BusinessUnitModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitDraft.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitDraft.php new file mode 100644 index 00000000000..e3e2d1b7352 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitDraft.php @@ -0,0 +1,217 @@ +User-defined unique identifier for the Business Unit.

+ * + + * @return null|string + */ + public function getKey(); + + /** + *

Indicates whether the Business Unit can be edited and used in Orders.

+ * + + * @return null|string + */ + public function getStatus(); + + /** + *

References to Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. + * If not empty, the Business Unit can only be linked to Carts and Orders of a referenced Store. + * If empty, the Business Unit can only create Carts, Orders, or Quotes that have no store value. + * Defaults to empty for Companies and not set for Divisions.

+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores(); + + /** + *

Defines whether the Stores of the Business Unit are set on the Business Unit or are inherited from a parent. + * Defaults to Explicit for Companies and to FromParent for Divisions.

+ * + + * @return null|string + */ + public function getStoreMode(); + + /** + *

Type of the Business Unit indicating its position in a hierarchy.

+ * + + * @return null|string + */ + public function getUnitType(); + + /** + *

Name of the Business Unit.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

Email address of the Business Unit.

+ * + + * @return null|string + */ + public function getContactEmail(); + + /** + *

List of members that are part of the Business Unit in specific roles.

+ * + + * @return null|AssociateDraftCollection + */ + public function getAssociates(); + + /** + *

Addresses used by the Business Unit.

+ * + + * @return null|BaseAddressCollection + */ + public function getAddresses(); + + /** + *

Indexes of entries in addresses to set as shipping addresses. + * The shippingAddressIds of the Customer will be replaced by these addresses.

+ * + + * @return null|array + */ + public function getShippingAddresses(); + + /** + *

Index of the entry in addresses to set as the default shipping address.

+ * + + * @return null|int + */ + public function getDefaultShipingAddress(); + + /** + *

Indexes of entries in addresses to set as billing addresses. + * The billingAddressIds of the Customer will be replaced by these addresses.

+ * + + * @return null|array + */ + public function getBillingAddresses(); + + /** + *

Index of the entry in addresses to set as the default billing address.

+ * + + * @return null|int + */ + public function getDefaultBillingAddress(); + + /** + *

Custom Fields for the Business Unit.

+ * + + * @return null|CustomFieldsDraft + */ + public function getCustom(); + + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + + /** + * @param ?string $status + */ + public function setStatus(?string $status): void; + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void; + + /** + * @param ?string $storeMode + */ + public function setStoreMode(?string $storeMode): void; + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void; + + /** + * @param ?AssociateDraftCollection $associates + */ + public function setAssociates(?AssociateDraftCollection $associates): void; + + /** + * @param ?BaseAddressCollection $addresses + */ + public function setAddresses(?BaseAddressCollection $addresses): void; + + /** + * @param ?array $shippingAddresses + */ + public function setShippingAddresses(?array $shippingAddresses): void; + + /** + * @param ?int $defaultShipingAddress + */ + public function setDefaultShipingAddress(?int $defaultShipingAddress): void; + + /** + * @param ?array $billingAddresses + */ + public function setBillingAddresses(?array $billingAddresses): void; + + /** + * @param ?int $defaultBillingAddress + */ + public function setDefaultBillingAddress(?int $defaultBillingAddress): void; + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitDraftBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitDraftBuilder.php new file mode 100644 index 00000000000..6ad1135b189 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitDraftBuilder.php @@ -0,0 +1,431 @@ + + */ +final class BusinessUnitDraftBuilder implements Builder +{ + /** + + * @var ?string + */ + private $key; + + /** + + * @var ?string + */ + private $status; + + /** + + * @var ?StoreKeyReferenceCollection + */ + private $stores; + + /** + + * @var ?string + */ + private $storeMode; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var ?string + */ + private $contactEmail; + + /** + + * @var ?AssociateDraftCollection + */ + private $associates; + + /** + + * @var ?BaseAddressCollection + */ + private $addresses; + + /** + + * @var ?array + */ + private $shippingAddresses; + + /** + + * @var ?int + */ + private $defaultShipingAddress; + + /** + + * @var ?array + */ + private $billingAddresses; + + /** + + * @var ?int + */ + private $defaultBillingAddress; + + /** + + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + */ + private $custom; + + /** + *

User-defined unique identifier for the Business Unit.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + *

Indicates whether the Business Unit can be edited and used in Orders.

+ * + + * @return null|string + */ + public function getStatus() + { + return $this->status; + } + + /** + *

References to Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. + * If not empty, the Business Unit can only be linked to Carts and Orders of a referenced Store. + * If empty, the Business Unit can only create Carts, Orders, or Quotes that have no store value. + * Defaults to empty for Companies and not set for Divisions.

+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + *

Defines whether the Stores of the Business Unit are set on the Business Unit or are inherited from a parent. + * Defaults to Explicit for Companies and to FromParent for Divisions.

+ * + + * @return null|string + */ + public function getStoreMode() + { + return $this->storeMode; + } + + /** + *

Name of the Business Unit.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

Email address of the Business Unit.

+ * + + * @return null|string + */ + public function getContactEmail() + { + return $this->contactEmail; + } + + /** + *

List of members that are part of the Business Unit in specific roles.

+ * + + * @return null|AssociateDraftCollection + */ + public function getAssociates() + { + return $this->associates; + } + + /** + *

Addresses used by the Business Unit.

+ * + + * @return null|BaseAddressCollection + */ + public function getAddresses() + { + return $this->addresses; + } + + /** + *

Indexes of entries in addresses to set as shipping addresses. + * The shippingAddressIds of the Customer will be replaced by these addresses.

+ * + + * @return null|array + */ + public function getShippingAddresses() + { + return $this->shippingAddresses; + } + + /** + *

Index of the entry in addresses to set as the default shipping address.

+ * + + * @return null|int + */ + public function getDefaultShipingAddress() + { + return $this->defaultShipingAddress; + } + + /** + *

Indexes of entries in addresses to set as billing addresses. + * The billingAddressIds of the Customer will be replaced by these addresses.

+ * + + * @return null|array + */ + public function getBillingAddresses() + { + return $this->billingAddresses; + } + + /** + *

Index of the entry in addresses to set as the default billing address.

+ * + + * @return null|int + */ + public function getDefaultBillingAddress() + { + return $this->defaultBillingAddress; + } + + /** + *

Custom Fields for the Business Unit.

+ * + + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?string $status + * @return $this + */ + public function withStatus(?string $status) + { + $this->status = $status; + + return $this; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + * @return $this + */ + public function withStores(?StoreKeyReferenceCollection $stores) + { + $this->stores = $stores; + + return $this; + } + + /** + * @param ?string $storeMode + * @return $this + */ + public function withStoreMode(?string $storeMode) + { + $this->storeMode = $storeMode; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param ?string $contactEmail + * @return $this + */ + public function withContactEmail(?string $contactEmail) + { + $this->contactEmail = $contactEmail; + + return $this; + } + + /** + * @param ?AssociateDraftCollection $associates + * @return $this + */ + public function withAssociates(?AssociateDraftCollection $associates) + { + $this->associates = $associates; + + return $this; + } + + /** + * @param ?BaseAddressCollection $addresses + * @return $this + */ + public function withAddresses(?BaseAddressCollection $addresses) + { + $this->addresses = $addresses; + + return $this; + } + + /** + * @param ?array $shippingAddresses + * @return $this + */ + public function withShippingAddresses(?array $shippingAddresses) + { + $this->shippingAddresses = $shippingAddresses; + + return $this; + } + + /** + * @param ?int $defaultShipingAddress + * @return $this + */ + public function withDefaultShipingAddress(?int $defaultShipingAddress) + { + $this->defaultShipingAddress = $defaultShipingAddress; + + return $this; + } + + /** + * @param ?array $billingAddresses + * @return $this + */ + public function withBillingAddresses(?array $billingAddresses) + { + $this->billingAddresses = $billingAddresses; + + return $this; + } + + /** + * @param ?int $defaultBillingAddress + * @return $this + */ + public function withDefaultBillingAddress(?int $defaultBillingAddress) + { + $this->defaultBillingAddress = $defaultBillingAddress; + + return $this; + } + + /** + * @param ?CustomFieldsDraft $custom + * @return $this + */ + public function withCustom(?CustomFieldsDraft $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + + public function build(): BusinessUnitDraft + { + return new BusinessUnitDraftModel( + $this->key, + $this->status, + $this->stores, + $this->storeMode, + $this->name, + $this->contactEmail, + $this->associates, + $this->addresses, + $this->shippingAddresses, + $this->defaultShipingAddress, + $this->billingAddresses, + $this->defaultBillingAddress, + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom + ); + } + + public static function of(): BusinessUnitDraftBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitDraftCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitDraftCollection.php new file mode 100644 index 00000000000..e5c36d18f33 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitDraftCollection.php @@ -0,0 +1,60 @@ + + * @psalm-method T current() + * @psalm-method T end() + * @psalm-method T at($offset) + * @method BusinessUnitDraft current() + * @method BusinessUnitDraft end() + * @method BusinessUnitDraft at($offset) + */ +class BusinessUnitDraftCollection extends MapperSequence +{ + /** + * @psalm-assert T $value + * @psalm-param T|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitDraftCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitDraft) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?T + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitDraft { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var T $data */ + $data = BusinessUnitDraftModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitDraftModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitDraftModel.php new file mode 100644 index 00000000000..00df09fa075 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitDraftModel.php @@ -0,0 +1,575 @@ + > + * + */ + private static $discriminatorClasses = [ + 'Company' => CompanyDraftModel::class, + 'Division' => DivisionDraftModel::class, + ]; + + /** + * @psalm-suppress MissingParamType + */ + public function __construct( + ?string $key = null, + ?string $status = null, + ?StoreKeyReferenceCollection $stores = null, + ?string $storeMode = null, + ?string $name = null, + ?string $contactEmail = null, + ?AssociateDraftCollection $associates = null, + ?BaseAddressCollection $addresses = null, + ?array $shippingAddresses = null, + ?int $defaultShipingAddress = null, + ?array $billingAddresses = null, + ?int $defaultBillingAddress = null, + ?CustomFieldsDraft $custom = null, + ?string $unitType = null + ) { + $this->key = $key; + $this->status = $status; + $this->stores = $stores; + $this->storeMode = $storeMode; + $this->name = $name; + $this->contactEmail = $contactEmail; + $this->associates = $associates; + $this->addresses = $addresses; + $this->shippingAddresses = $shippingAddresses; + $this->defaultShipingAddress = $defaultShipingAddress; + $this->billingAddresses = $billingAddresses; + $this->defaultBillingAddress = $defaultBillingAddress; + $this->custom = $custom; + $this->unitType = $unitType; + } + + /** + *

User-defined unique identifier for the Business Unit.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + *

Indicates whether the Business Unit can be edited and used in Orders.

+ * + * + * @return null|string + */ + public function getStatus() + { + if (is_null($this->status)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STATUS); + if (is_null($data)) { + return null; + } + $this->status = (string) $data; + } + + return $this->status; + } + + /** + *

References to Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. + * If not empty, the Business Unit can only be linked to Carts and Orders of a referenced Store. + * If empty, the Business Unit can only create Carts, Orders, or Quotes that have no store value. + * Defaults to empty for Companies and not set for Divisions.

+ * + * + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STORES); + if (is_null($data)) { + return null; + } + $this->stores = StoreKeyReferenceCollection::fromArray($data); + } + + return $this->stores; + } + + /** + *

Defines whether the Stores of the Business Unit are set on the Business Unit or are inherited from a parent. + * Defaults to Explicit for Companies and to FromParent for Divisions.

+ * + * + * @return null|string + */ + public function getStoreMode() + { + if (is_null($this->storeMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STORE_MODE); + if (is_null($data)) { + return null; + } + $this->storeMode = (string) $data; + } + + return $this->storeMode; + } + + /** + *

Type of the Business Unit indicating its position in a hierarchy.

+ * + * + * @return null|string + */ + public function getUnitType() + { + if (is_null($this->unitType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_UNIT_TYPE); + if (is_null($data)) { + return null; + } + $this->unitType = (string) $data; + } + + return $this->unitType; + } + + /** + *

Name of the Business Unit.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

Email address of the Business Unit.

+ * + * + * @return null|string + */ + public function getContactEmail() + { + if (is_null($this->contactEmail)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CONTACT_EMAIL); + if (is_null($data)) { + return null; + } + $this->contactEmail = (string) $data; + } + + return $this->contactEmail; + } + + /** + *

List of members that are part of the Business Unit in specific roles.

+ * + * + * @return null|AssociateDraftCollection + */ + public function getAssociates() + { + if (is_null($this->associates)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ASSOCIATES); + if (is_null($data)) { + return null; + } + $this->associates = AssociateDraftCollection::fromArray($data); + } + + return $this->associates; + } + + /** + *

Addresses used by the Business Unit.

+ * + * + * @return null|BaseAddressCollection + */ + public function getAddresses() + { + if (is_null($this->addresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->addresses = BaseAddressCollection::fromArray($data); + } + + return $this->addresses; + } + + /** + *

Indexes of entries in addresses to set as shipping addresses. + * The shippingAddressIds of the Customer will be replaced by these addresses.

+ * + * + * @return null|array + */ + public function getShippingAddresses() + { + if (is_null($this->shippingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SHIPPING_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->shippingAddresses = $data; + } + + return $this->shippingAddresses; + } + + /** + *

Index of the entry in addresses to set as the default shipping address.

+ * + * + * @return null|int + */ + public function getDefaultShipingAddress() + { + if (is_null($this->defaultShipingAddress)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_DEFAULT_SHIPING_ADDRESS); + if (is_null($data)) { + return null; + } + $this->defaultShipingAddress = (int) $data; + } + + return $this->defaultShipingAddress; + } + + /** + *

Indexes of entries in addresses to set as billing addresses. + * The billingAddressIds of the Customer will be replaced by these addresses.

+ * + * + * @return null|array + */ + public function getBillingAddresses() + { + if (is_null($this->billingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_BILLING_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->billingAddresses = $data; + } + + return $this->billingAddresses; + } + + /** + *

Index of the entry in addresses to set as the default billing address.

+ * + * + * @return null|int + */ + public function getDefaultBillingAddress() + { + if (is_null($this->defaultBillingAddress)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_DEFAULT_BILLING_ADDRESS); + if (is_null($data)) { + return null; + } + $this->defaultBillingAddress = (int) $data; + } + + return $this->defaultBillingAddress; + } + + /** + *

Custom Fields for the Business Unit.

+ * + * + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomFieldsDraftModel::of($data); + } + + return $this->custom; + } + + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + + /** + * @param ?string $status + */ + public function setStatus(?string $status): void + { + $this->status = $status; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void + { + $this->stores = $stores; + } + + /** + * @param ?string $storeMode + */ + public function setStoreMode(?string $storeMode): void + { + $this->storeMode = $storeMode; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void + { + $this->contactEmail = $contactEmail; + } + + /** + * @param ?AssociateDraftCollection $associates + */ + public function setAssociates(?AssociateDraftCollection $associates): void + { + $this->associates = $associates; + } + + /** + * @param ?BaseAddressCollection $addresses + */ + public function setAddresses(?BaseAddressCollection $addresses): void + { + $this->addresses = $addresses; + } + + /** + * @param ?array $shippingAddresses + */ + public function setShippingAddresses(?array $shippingAddresses): void + { + $this->shippingAddresses = $shippingAddresses; + } + + /** + * @param ?int $defaultShipingAddress + */ + public function setDefaultShipingAddress(?int $defaultShipingAddress): void + { + $this->defaultShipingAddress = $defaultShipingAddress; + } + + /** + * @param ?array $billingAddresses + */ + public function setBillingAddresses(?array $billingAddresses): void + { + $this->billingAddresses = $billingAddresses; + } + + /** + * @param ?int $defaultBillingAddress + */ + public function setDefaultBillingAddress(?int $defaultBillingAddress): void + { + $this->defaultBillingAddress = $defaultBillingAddress; + } + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void + { + $this->custom = $custom; + } + + + + /** + * @psalm-param stdClass|array $value + * @psalm-return class-string + */ + public static function resolveDiscriminatorClass($value): string + { + $fieldName = BusinessUnitDraft::DISCRIMINATOR_FIELD; + if (is_object($value) && isset($value->$fieldName)) { + /** @psalm-var string $discriminatorValue */ + $discriminatorValue = $value->$fieldName; + if (isset(self::$discriminatorClasses[$discriminatorValue])) { + return self::$discriminatorClasses[$discriminatorValue]; + } + } + if (is_array($value) && isset($value[$fieldName])) { + /** @psalm-var string $discriminatorValue */ + $discriminatorValue = $value[$fieldName]; + if (isset(self::$discriminatorClasses[$discriminatorValue])) { + return self::$discriminatorClasses[$discriminatorValue]; + } + } + + /** @psalm-var class-string */ + $type = BusinessUnitDraftModel::class; + return $type; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitKeyReference.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitKeyReference.php new file mode 100644 index 00000000000..785a49ce3d1 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitKeyReference.php @@ -0,0 +1,29 @@ +Unique and immutable key of the referenced BusinessUnit.

+ * + + * @return null|string + */ + public function getKey(); + + /** + * @param ?string $key + */ + public function setKey(?string $key): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitKeyReferenceBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitKeyReferenceBuilder.php new file mode 100644 index 00000000000..0ad6bc69b05 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitKeyReferenceBuilder.php @@ -0,0 +1,65 @@ + + */ +final class BusinessUnitKeyReferenceBuilder implements Builder +{ + /** + + * @var ?string + */ + private $key; + + /** + *

Unique and immutable key of the referenced BusinessUnit.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + + public function build(): BusinessUnitKeyReference + { + return new BusinessUnitKeyReferenceModel( + $this->key + ); + } + + public static function of(): BusinessUnitKeyReferenceBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitKeyReferenceCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitKeyReferenceCollection.php new file mode 100644 index 00000000000..cd166d61766 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitKeyReferenceCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitKeyReference current() + * @method BusinessUnitKeyReference end() + * @method BusinessUnitKeyReference at($offset) + */ +class BusinessUnitKeyReferenceCollection extends KeyReferenceCollection +{ + /** + * @psalm-assert BusinessUnitKeyReference $value + * @psalm-param BusinessUnitKeyReference|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitKeyReferenceCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitKeyReference) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitKeyReference + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitKeyReference { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitKeyReference $data */ + $data = BusinessUnitKeyReferenceModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitKeyReferenceModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitKeyReferenceModel.php new file mode 100644 index 00000000000..ed29a63ad35 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitKeyReferenceModel.php @@ -0,0 +1,97 @@ +key = $key; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Type of referenced resource.

+ * + * + * @return null|string + */ + public function getTypeId() + { + if (is_null($this->typeId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE_ID); + if (is_null($data)) { + return null; + } + $this->typeId = (string) $data; + } + + return $this->typeId; + } + + /** + *

Unique and immutable key of the referenced BusinessUnit.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitModel.php new file mode 100644 index 00000000000..37cade7187d --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitModel.php @@ -0,0 +1,892 @@ + > + * + */ + private static $discriminatorClasses = [ + 'Company' => CompanyModel::class, + 'Division' => DivisionModel::class, + ]; + + /** + * @psalm-suppress MissingParamType + */ + public function __construct( + ?string $id = null, + ?int $version = null, + ?DateTimeImmutable $createdAt = null, + ?DateTimeImmutable $lastModifiedAt = null, + ?LastModifiedBy $lastModifiedBy = null, + ?CreatedBy $createdBy = null, + ?string $key = null, + ?string $status = null, + ?StoreKeyReferenceCollection $stores = null, + ?string $storeMode = null, + ?string $name = null, + ?string $contactEmail = null, + ?CustomFields $custom = null, + ?AddressCollection $addresses = null, + ?array $shippingAddressIds = null, + ?string $defaultShipingAddressId = null, + ?array $billingAddressIds = null, + ?string $defaultBillingAddressId = null, + ?AssociateCollection $associates = null, + ?BusinessUnitKeyReference $parentUnit = null, + ?BusinessUnitKeyReference $topLevelUnit = null, + ?string $unitType = null + ) { + $this->id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->key = $key; + $this->status = $status; + $this->stores = $stores; + $this->storeMode = $storeMode; + $this->name = $name; + $this->contactEmail = $contactEmail; + $this->custom = $custom; + $this->addresses = $addresses; + $this->shippingAddressIds = $shippingAddressIds; + $this->defaultShipingAddressId = $defaultShipingAddressId; + $this->billingAddressIds = $billingAddressIds; + $this->defaultBillingAddressId = $defaultBillingAddressId; + $this->associates = $associates; + $this->parentUnit = $parentUnit; + $this->topLevelUnit = $topLevelUnit; + $this->unitType = $unitType; + } + + /** + *

Unique identifier of the Business Unit.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Current version of the Business Unit.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Business Unit was initially created.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Date and time (UTC) the Business Unit was last updated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Present on resources updated after 1 February 2019 except for events not tracked.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

User-defined unique identifier of the Business Unit.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + *

Indicates whether the Business Unit can be edited and used in Orders.

+ * + * + * @return null|string + */ + public function getStatus() + { + if (is_null($this->status)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STATUS); + if (is_null($data)) { + return null; + } + $this->status = (string) $data; + } + + return $this->status; + } + + /** + *

References to Stores the Business Unit is associated with. + * If empty, the Business Unit can only create Carts, Orders, or Quotes that have no store value. + * If not empty, the Business Unit can only be linked to Carts and Orders of a referenced Store. + * Only present when storeMode is Explicit.

+ * + * + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STORES); + if (is_null($data)) { + return null; + } + $this->stores = StoreKeyReferenceCollection::fromArray($data); + } + + return $this->stores; + } + + /** + *

Defines whether the Stores of the Business Unit are set on the Business Unit or are inherited from a parent.

+ * + * + * @return null|string + */ + public function getStoreMode() + { + if (is_null($this->storeMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STORE_MODE); + if (is_null($data)) { + return null; + } + $this->storeMode = (string) $data; + } + + return $this->storeMode; + } + + /** + *

Type of the Business Unit indicating its position in a hierarchy.

+ * + * + * @return null|string + */ + public function getUnitType() + { + if (is_null($this->unitType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_UNIT_TYPE); + if (is_null($data)) { + return null; + } + $this->unitType = (string) $data; + } + + return $this->unitType; + } + + /** + *

Name of the Business Unit.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

Email address of the Business Unit.

+ * + * + * @return null|string + */ + public function getContactEmail() + { + if (is_null($this->contactEmail)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CONTACT_EMAIL); + if (is_null($data)) { + return null; + } + $this->contactEmail = (string) $data; + } + + return $this->contactEmail; + } + + /** + *

Custom Fields for the Business Unit.

+ * + * + * @return null|CustomFields + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomFieldsModel::of($data); + } + + return $this->custom; + } + + /** + *

Addresses used by the Business Unit.

+ * + * + * @return null|AddressCollection + */ + public function getAddresses() + { + if (is_null($this->addresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->addresses = AddressCollection::fromArray($data); + } + + return $this->addresses; + } + + /** + *

Unique identifiers of addresses used as shipping addresses.

+ * + * + * @return null|array + */ + public function getShippingAddressIds() + { + if (is_null($this->shippingAddressIds)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SHIPPING_ADDRESS_IDS); + if (is_null($data)) { + return null; + } + $this->shippingAddressIds = $data; + } + + return $this->shippingAddressIds; + } + + /** + *

Unique identifier of the address used as the default shipping address.

+ * + * + * @return null|string + */ + public function getDefaultShipingAddressId() + { + if (is_null($this->defaultShipingAddressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_DEFAULT_SHIPING_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->defaultShipingAddressId = (string) $data; + } + + return $this->defaultShipingAddressId; + } + + /** + *

Unique identifiers of addresses used as billing addresses.

+ * + * + * @return null|array + */ + public function getBillingAddressIds() + { + if (is_null($this->billingAddressIds)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_BILLING_ADDRESS_IDS); + if (is_null($data)) { + return null; + } + $this->billingAddressIds = $data; + } + + return $this->billingAddressIds; + } + + /** + *

Unique identifier of the address used as the default billing address.

+ * + * + * @return null|string + */ + public function getDefaultBillingAddressId() + { + if (is_null($this->defaultBillingAddressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_DEFAULT_BILLING_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->defaultBillingAddressId = (string) $data; + } + + return $this->defaultBillingAddressId; + } + + /** + *

Members that are part of the Business Unit in specific roles.

+ * + * + * @return null|AssociateCollection + */ + public function getAssociates() + { + if (is_null($this->associates)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ASSOCIATES); + if (is_null($data)) { + return null; + } + $this->associates = AssociateCollection::fromArray($data); + } + + return $this->associates; + } + + /** + *

Parent unit of the Business Unit. Only present when the unitType is Division.

+ * + * + * @return null|BusinessUnitKeyReference + */ + public function getParentUnit() + { + if (is_null($this->parentUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_PARENT_UNIT); + if (is_null($data)) { + return null; + } + + $this->parentUnit = BusinessUnitKeyReferenceModel::of($data); + } + + return $this->parentUnit; + } + + /** + *

Top-level unit of the Business Unit. The top-level unit is of unitType Company.

+ * + * + * @return null|BusinessUnitKeyReference + */ + public function getTopLevelUnit() + { + if (is_null($this->topLevelUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TOP_LEVEL_UNIT); + if (is_null($data)) { + return null; + } + + $this->topLevelUnit = BusinessUnitKeyReferenceModel::of($data); + } + + return $this->topLevelUnit; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + + /** + * @param ?string $status + */ + public function setStatus(?string $status): void + { + $this->status = $status; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void + { + $this->stores = $stores; + } + + /** + * @param ?string $storeMode + */ + public function setStoreMode(?string $storeMode): void + { + $this->storeMode = $storeMode; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void + { + $this->contactEmail = $contactEmail; + } + + /** + * @param ?CustomFields $custom + */ + public function setCustom(?CustomFields $custom): void + { + $this->custom = $custom; + } + + /** + * @param ?AddressCollection $addresses + */ + public function setAddresses(?AddressCollection $addresses): void + { + $this->addresses = $addresses; + } + + /** + * @param ?array $shippingAddressIds + */ + public function setShippingAddressIds(?array $shippingAddressIds): void + { + $this->shippingAddressIds = $shippingAddressIds; + } + + /** + * @param ?string $defaultShipingAddressId + */ + public function setDefaultShipingAddressId(?string $defaultShipingAddressId): void + { + $this->defaultShipingAddressId = $defaultShipingAddressId; + } + + /** + * @param ?array $billingAddressIds + */ + public function setBillingAddressIds(?array $billingAddressIds): void + { + $this->billingAddressIds = $billingAddressIds; + } + + /** + * @param ?string $defaultBillingAddressId + */ + public function setDefaultBillingAddressId(?string $defaultBillingAddressId): void + { + $this->defaultBillingAddressId = $defaultBillingAddressId; + } + + /** + * @param ?AssociateCollection $associates + */ + public function setAssociates(?AssociateCollection $associates): void + { + $this->associates = $associates; + } + + /** + * @param ?BusinessUnitKeyReference $parentUnit + */ + public function setParentUnit(?BusinessUnitKeyReference $parentUnit): void + { + $this->parentUnit = $parentUnit; + } + + /** + * @param ?BusinessUnitKeyReference $topLevelUnit + */ + public function setTopLevelUnit(?BusinessUnitKeyReference $topLevelUnit): void + { + $this->topLevelUnit = $topLevelUnit; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[BusinessUnit::FIELD_CREATED_AT]) && $data[BusinessUnit::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[BusinessUnit::FIELD_CREATED_AT] = $data[BusinessUnit::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[BusinessUnit::FIELD_LAST_MODIFIED_AT]) && $data[BusinessUnit::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[BusinessUnit::FIELD_LAST_MODIFIED_AT] = $data[BusinessUnit::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } + + /** + * @psalm-param stdClass|array $value + * @psalm-return class-string + */ + public static function resolveDiscriminatorClass($value): string + { + $fieldName = BusinessUnit::DISCRIMINATOR_FIELD; + if (is_object($value) && isset($value->$fieldName)) { + /** @psalm-var string $discriminatorValue */ + $discriminatorValue = $value->$fieldName; + if (isset(self::$discriminatorClasses[$discriminatorValue])) { + return self::$discriminatorClasses[$discriminatorValue]; + } + } + if (is_array($value) && isset($value[$fieldName])) { + /** @psalm-var string $discriminatorValue */ + $discriminatorValue = $value[$fieldName]; + if (isset(self::$discriminatorClasses[$discriminatorValue])) { + return self::$discriminatorClasses[$discriminatorValue]; + } + } + + /** @psalm-var class-string */ + $type = BusinessUnitModel::class; + return $type; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitPagedQueryResponse.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitPagedQueryResponse.php new file mode 100644 index 00000000000..46a8653ce85 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitPagedQueryResponse.php @@ -0,0 +1,90 @@ +Number of requested results.

+ * + + * @return null|int + */ + public function getLimit(); + + /** + *

Number of elements skipped.

+ * + + * @return null|int + */ + public function getOffset(); + + /** + *

Actual number of results returned.

+ * + + * @return null|int + */ + public function getCount(); + + /** + *

Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

+ * + + * @return null|int + */ + public function getTotal(); + + /** + *

BusinessUnits matching the query.

+ * + + * @return null|BusinessUnitCollection + */ + public function getResults(); + + /** + * @param ?int $limit + */ + public function setLimit(?int $limit): void; + + /** + * @param ?int $offset + */ + public function setOffset(?int $offset): void; + + /** + * @param ?int $count + */ + public function setCount(?int $count): void; + + /** + * @param ?int $total + */ + public function setTotal(?int $total): void; + + /** + * @param ?BusinessUnitCollection $results + */ + public function setResults(?BusinessUnitCollection $results): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitPagedQueryResponseBuilder.php new file mode 100644 index 00000000000..0d88564b601 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitPagedQueryResponseBuilder.php @@ -0,0 +1,183 @@ + + */ +final class BusinessUnitPagedQueryResponseBuilder implements Builder +{ + /** + + * @var ?int + */ + private $limit; + + /** + + * @var ?int + */ + private $offset; + + /** + + * @var ?int + */ + private $count; + + /** + + * @var ?int + */ + private $total; + + /** + + * @var ?BusinessUnitCollection + */ + private $results; + + /** + *

Number of requested results.

+ * + + * @return null|int + */ + public function getLimit() + { + return $this->limit; + } + + /** + *

Number of elements skipped.

+ * + + * @return null|int + */ + public function getOffset() + { + return $this->offset; + } + + /** + *

Actual number of results returned.

+ * + + * @return null|int + */ + public function getCount() + { + return $this->count; + } + + /** + *

Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

+ * + + * @return null|int + */ + public function getTotal() + { + return $this->total; + } + + /** + *

BusinessUnits matching the query.

+ * + + * @return null|BusinessUnitCollection + */ + public function getResults() + { + return $this->results; + } + + /** + * @param ?int $limit + * @return $this + */ + public function withLimit(?int $limit) + { + $this->limit = $limit; + + return $this; + } + + /** + * @param ?int $offset + * @return $this + */ + public function withOffset(?int $offset) + { + $this->offset = $offset; + + return $this; + } + + /** + * @param ?int $count + * @return $this + */ + public function withCount(?int $count) + { + $this->count = $count; + + return $this; + } + + /** + * @param ?int $total + * @return $this + */ + public function withTotal(?int $total) + { + $this->total = $total; + + return $this; + } + + /** + * @param ?BusinessUnitCollection $results + * @return $this + */ + public function withResults(?BusinessUnitCollection $results) + { + $this->results = $results; + + return $this; + } + + + public function build(): BusinessUnitPagedQueryResponse + { + return new BusinessUnitPagedQueryResponseModel( + $this->limit, + $this->offset, + $this->count, + $this->total, + $this->results + ); + } + + public static function of(): BusinessUnitPagedQueryResponseBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitPagedQueryResponseCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitPagedQueryResponseCollection.php new file mode 100644 index 00000000000..807ee5d3782 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitPagedQueryResponseCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitPagedQueryResponse current() + * @method BusinessUnitPagedQueryResponse end() + * @method BusinessUnitPagedQueryResponse at($offset) + */ +class BusinessUnitPagedQueryResponseCollection extends MapperSequence +{ + /** + * @psalm-assert BusinessUnitPagedQueryResponse $value + * @psalm-param BusinessUnitPagedQueryResponse|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitPagedQueryResponseCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitPagedQueryResponse) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitPagedQueryResponse + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitPagedQueryResponse { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitPagedQueryResponse $data */ + $data = BusinessUnitPagedQueryResponseModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitPagedQueryResponseModel.php new file mode 100644 index 00000000000..975efe9be7d --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitPagedQueryResponseModel.php @@ -0,0 +1,214 @@ +limit = $limit; + $this->offset = $offset; + $this->count = $count; + $this->total = $total; + $this->results = $results; + } + + /** + *

Number of requested results.

+ * + * + * @return null|int + */ + public function getLimit() + { + if (is_null($this->limit)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_LIMIT); + if (is_null($data)) { + return null; + } + $this->limit = (int) $data; + } + + return $this->limit; + } + + /** + *

Number of elements skipped.

+ * + * + * @return null|int + */ + public function getOffset() + { + if (is_null($this->offset)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_OFFSET); + if (is_null($data)) { + return null; + } + $this->offset = (int) $data; + } + + return $this->offset; + } + + /** + *

Actual number of results returned.

+ * + * + * @return null|int + */ + public function getCount() + { + if (is_null($this->count)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_COUNT); + if (is_null($data)) { + return null; + } + $this->count = (int) $data; + } + + return $this->count; + } + + /** + *

Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

+ * + * + * @return null|int + */ + public function getTotal() + { + if (is_null($this->total)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_TOTAL); + if (is_null($data)) { + return null; + } + $this->total = (int) $data; + } + + return $this->total; + } + + /** + *

BusinessUnits matching the query.

+ * + * + * @return null|BusinessUnitCollection + */ + public function getResults() + { + if (is_null($this->results)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_RESULTS); + if (is_null($data)) { + return null; + } + $this->results = BusinessUnitCollection::fromArray($data); + } + + return $this->results; + } + + + /** + * @param ?int $limit + */ + public function setLimit(?int $limit): void + { + $this->limit = $limit; + } + + /** + * @param ?int $offset + */ + public function setOffset(?int $offset): void + { + $this->offset = $offset; + } + + /** + * @param ?int $count + */ + public function setCount(?int $count): void + { + $this->count = $count; + } + + /** + * @param ?int $total + */ + public function setTotal(?int $total): void + { + $this->total = $total; + } + + /** + * @param ?BusinessUnitCollection $results + */ + public function setResults(?BusinessUnitCollection $results): void + { + $this->results = $results; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitReference.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitReference.php new file mode 100644 index 00000000000..a96d1e76248 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitReference.php @@ -0,0 +1,44 @@ +Contains the representation of the expanded BusinessUnit. Only present in responses to requests with Reference Expansion for BusinessUnit.

+ * + + * @return null|BusinessUnit + */ + public function getObj(); + + /** + *

Unique identifier of the referenced BusinessUnit.

+ * + + * @return null|string + */ + public function getId(); + + /** + * @param ?BusinessUnit $obj + */ + public function setObj(?BusinessUnit $obj): void; + + /** + * @param ?string $id + */ + public function setId(?string $id): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitReferenceBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitReferenceBuilder.php new file mode 100644 index 00000000000..684c7ddd544 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitReferenceBuilder.php @@ -0,0 +1,104 @@ + + */ +final class BusinessUnitReferenceBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var null|BusinessUnit|BusinessUnitBuilder + */ + private $obj; + + /** + *

Unique identifier of the referenced BusinessUnit.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Contains the representation of the expanded BusinessUnit. Only present in responses to requests with Reference Expansion for BusinessUnit.

+ * + + * @return null|BusinessUnit + */ + public function getObj() + { + return $this->obj instanceof BusinessUnitBuilder ? $this->obj->build() : $this->obj; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?BusinessUnit $obj + * @return $this + */ + public function withObj(?BusinessUnit $obj) + { + $this->obj = $obj; + + return $this; + } + + /** + * @deprecated use withObj() instead + * @return $this + */ + public function withObjBuilder(?BusinessUnitBuilder $obj) + { + $this->obj = $obj; + + return $this; + } + + public function build(): BusinessUnitReference + { + return new BusinessUnitReferenceModel( + $this->id, + $this->obj instanceof BusinessUnitBuilder ? $this->obj->build() : $this->obj + ); + } + + public static function of(): BusinessUnitReferenceBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitReferenceCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitReferenceCollection.php new file mode 100644 index 00000000000..dcb4c6ef5aa --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitReferenceCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitReference current() + * @method BusinessUnitReference end() + * @method BusinessUnitReference at($offset) + */ +class BusinessUnitReferenceCollection extends ReferenceCollection +{ + /** + * @psalm-assert BusinessUnitReference $value + * @psalm-param BusinessUnitReference|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitReferenceCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitReference) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitReference + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitReference { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitReference $data */ + $data = BusinessUnitReferenceModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitReferenceModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitReferenceModel.php new file mode 100644 index 00000000000..3f00e01fb84 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitReferenceModel.php @@ -0,0 +1,134 @@ +id = $id; + $this->obj = $obj; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Type of referenced resource.

+ * + * + * @return null|string + */ + public function getTypeId() + { + if (is_null($this->typeId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE_ID); + if (is_null($data)) { + return null; + } + $this->typeId = (string) $data; + } + + return $this->typeId; + } + + /** + *

Unique identifier of the referenced BusinessUnit.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Contains the representation of the expanded BusinessUnit. Only present in responses to requests with Reference Expansion for BusinessUnit.

+ * + * + * @return null|BusinessUnit + */ + public function getObj() + { + if (is_null($this->obj)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_OBJ); + if (is_null($data)) { + return null; + } + $className = BusinessUnitModel::resolveDiscriminatorClass($data); + $this->obj = $className::of($data); + } + + return $this->obj; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?BusinessUnit $obj + */ + public function setObj(?BusinessUnit $obj): void + { + $this->obj = $obj; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAddressAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAddressAction.php new file mode 100644 index 00000000000..b989d7198b7 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAddressAction.php @@ -0,0 +1,44 @@ +ID of the address to be removed. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressId(); + + /** + *

Key of the address to be removed. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressKey(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAddressActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAddressActionBuilder.php new file mode 100644 index 00000000000..99eb4a24921 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAddressActionBuilder.php @@ -0,0 +1,92 @@ + + */ +final class BusinessUnitRemoveAddressActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $addressKey; + + /** + *

ID of the address to be removed. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

Key of the address to be removed. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressKey() + { + return $this->addressKey; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $addressKey + * @return $this + */ + public function withAddressKey(?string $addressKey) + { + $this->addressKey = $addressKey; + + return $this; + } + + + public function build(): BusinessUnitRemoveAddressAction + { + return new BusinessUnitRemoveAddressActionModel( + $this->addressId, + $this->addressKey + ); + } + + public static function of(): BusinessUnitRemoveAddressActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAddressActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAddressActionCollection.php new file mode 100644 index 00000000000..89fdb7275e2 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAddressActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitRemoveAddressAction current() + * @method BusinessUnitRemoveAddressAction end() + * @method BusinessUnitRemoveAddressAction at($offset) + */ +class BusinessUnitRemoveAddressActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitRemoveAddressAction $value + * @psalm-param BusinessUnitRemoveAddressAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitRemoveAddressActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitRemoveAddressAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitRemoveAddressAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitRemoveAddressAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitRemoveAddressAction $data */ + $data = BusinessUnitRemoveAddressActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAddressActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAddressActionModel.php new file mode 100644 index 00000000000..588c65808e9 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAddressActionModel.php @@ -0,0 +1,129 @@ +addressId = $addressId; + $this->addressKey = $addressKey; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

ID of the address to be removed. Either addressId or addressKey is required.

+ * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

Key of the address to be removed. Either addressId or addressKey is required.

+ * + * + * @return null|string + */ + public function getAddressKey() + { + if (is_null($this->addressKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_KEY); + if (is_null($data)) { + return null; + } + $this->addressKey = (string) $data; + } + + return $this->addressKey; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void + { + $this->addressKey = $addressKey; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAssociateAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAssociateAction.php new file mode 100644 index 00000000000..a3315a66ada --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAssociateAction.php @@ -0,0 +1,31 @@ +Associate to remove.

+ * + + * @return null|CustomerResourceIdentifier + */ + public function getCustomer(); + + /** + * @param ?CustomerResourceIdentifier $customer + */ + public function setCustomer(?CustomerResourceIdentifier $customer): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAssociateActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAssociateActionBuilder.php new file mode 100644 index 00000000000..91b6a3c0aa2 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAssociateActionBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitRemoveAssociateActionBuilder implements Builder +{ + /** + + * @var null|CustomerResourceIdentifier|CustomerResourceIdentifierBuilder + */ + private $customer; + + /** + *

Associate to remove.

+ * + + * @return null|CustomerResourceIdentifier + */ + public function getCustomer() + { + return $this->customer instanceof CustomerResourceIdentifierBuilder ? $this->customer->build() : $this->customer; + } + + /** + * @param ?CustomerResourceIdentifier $customer + * @return $this + */ + public function withCustomer(?CustomerResourceIdentifier $customer) + { + $this->customer = $customer; + + return $this; + } + + /** + * @deprecated use withCustomer() instead + * @return $this + */ + public function withCustomerBuilder(?CustomerResourceIdentifierBuilder $customer) + { + $this->customer = $customer; + + return $this; + } + + public function build(): BusinessUnitRemoveAssociateAction + { + return new BusinessUnitRemoveAssociateActionModel( + $this->customer instanceof CustomerResourceIdentifierBuilder ? $this->customer->build() : $this->customer + ); + } + + public static function of(): BusinessUnitRemoveAssociateActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAssociateActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAssociateActionCollection.php new file mode 100644 index 00000000000..d67853127f4 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAssociateActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitRemoveAssociateAction current() + * @method BusinessUnitRemoveAssociateAction end() + * @method BusinessUnitRemoveAssociateAction at($offset) + */ +class BusinessUnitRemoveAssociateActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitRemoveAssociateAction $value + * @psalm-param BusinessUnitRemoveAssociateAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitRemoveAssociateActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitRemoveAssociateAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitRemoveAssociateAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitRemoveAssociateAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitRemoveAssociateAction $data */ + $data = BusinessUnitRemoveAssociateActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAssociateActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAssociateActionModel.php new file mode 100644 index 00000000000..1f4f8836ecb --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveAssociateActionModel.php @@ -0,0 +1,96 @@ +customer = $customer; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

Associate to remove.

+ * + * + * @return null|CustomerResourceIdentifier + */ + public function getCustomer() + { + if (is_null($this->customer)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER); + if (is_null($data)) { + return null; + } + + $this->customer = CustomerResourceIdentifierModel::of($data); + } + + return $this->customer; + } + + + /** + * @param ?CustomerResourceIdentifier $customer + */ + public function setCustomer(?CustomerResourceIdentifier $customer): void + { + $this->customer = $customer; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveBillingAddressIdAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveBillingAddressIdAction.php new file mode 100644 index 00000000000..13a0c55293d --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveBillingAddressIdAction.php @@ -0,0 +1,44 @@ +ID of the address to be removed from billingAddressIds. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressId(); + + /** + *

Key of the address to be removed from billingAddressIds. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressKey(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveBillingAddressIdActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveBillingAddressIdActionBuilder.php new file mode 100644 index 00000000000..73d6d99d6a7 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveBillingAddressIdActionBuilder.php @@ -0,0 +1,92 @@ + + */ +final class BusinessUnitRemoveBillingAddressIdActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $addressKey; + + /** + *

ID of the address to be removed from billingAddressIds. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

Key of the address to be removed from billingAddressIds. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressKey() + { + return $this->addressKey; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $addressKey + * @return $this + */ + public function withAddressKey(?string $addressKey) + { + $this->addressKey = $addressKey; + + return $this; + } + + + public function build(): BusinessUnitRemoveBillingAddressIdAction + { + return new BusinessUnitRemoveBillingAddressIdActionModel( + $this->addressId, + $this->addressKey + ); + } + + public static function of(): BusinessUnitRemoveBillingAddressIdActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveBillingAddressIdActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveBillingAddressIdActionCollection.php new file mode 100644 index 00000000000..9b8dbb88d73 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveBillingAddressIdActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitRemoveBillingAddressIdAction current() + * @method BusinessUnitRemoveBillingAddressIdAction end() + * @method BusinessUnitRemoveBillingAddressIdAction at($offset) + */ +class BusinessUnitRemoveBillingAddressIdActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitRemoveBillingAddressIdAction $value + * @psalm-param BusinessUnitRemoveBillingAddressIdAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitRemoveBillingAddressIdActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitRemoveBillingAddressIdAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitRemoveBillingAddressIdAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitRemoveBillingAddressIdAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitRemoveBillingAddressIdAction $data */ + $data = BusinessUnitRemoveBillingAddressIdActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveBillingAddressIdActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveBillingAddressIdActionModel.php new file mode 100644 index 00000000000..a0ba4171adf --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveBillingAddressIdActionModel.php @@ -0,0 +1,129 @@ +addressId = $addressId; + $this->addressKey = $addressKey; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

ID of the address to be removed from billingAddressIds. Either addressId or addressKey is required.

+ * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

Key of the address to be removed from billingAddressIds. Either addressId or addressKey is required.

+ * + * + * @return null|string + */ + public function getAddressKey() + { + if (is_null($this->addressKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_KEY); + if (is_null($data)) { + return null; + } + $this->addressKey = (string) $data; + } + + return $this->addressKey; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void + { + $this->addressKey = $addressKey; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveShippingAddressIdAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveShippingAddressIdAction.php new file mode 100644 index 00000000000..651848a02a4 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveShippingAddressIdAction.php @@ -0,0 +1,44 @@ +ID of the address to be removed from shippingAddressIds. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressId(); + + /** + *

Key of the address to be removed from shippingAddressIds. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressKey(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveShippingAddressIdActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveShippingAddressIdActionBuilder.php new file mode 100644 index 00000000000..ac41d597650 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveShippingAddressIdActionBuilder.php @@ -0,0 +1,92 @@ + + */ +final class BusinessUnitRemoveShippingAddressIdActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $addressKey; + + /** + *

ID of the address to be removed from shippingAddressIds. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

Key of the address to be removed from shippingAddressIds. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressKey() + { + return $this->addressKey; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $addressKey + * @return $this + */ + public function withAddressKey(?string $addressKey) + { + $this->addressKey = $addressKey; + + return $this; + } + + + public function build(): BusinessUnitRemoveShippingAddressIdAction + { + return new BusinessUnitRemoveShippingAddressIdActionModel( + $this->addressId, + $this->addressKey + ); + } + + public static function of(): BusinessUnitRemoveShippingAddressIdActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveShippingAddressIdActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveShippingAddressIdActionCollection.php new file mode 100644 index 00000000000..e8ed4e72f14 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveShippingAddressIdActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitRemoveShippingAddressIdAction current() + * @method BusinessUnitRemoveShippingAddressIdAction end() + * @method BusinessUnitRemoveShippingAddressIdAction at($offset) + */ +class BusinessUnitRemoveShippingAddressIdActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitRemoveShippingAddressIdAction $value + * @psalm-param BusinessUnitRemoveShippingAddressIdAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitRemoveShippingAddressIdActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitRemoveShippingAddressIdAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitRemoveShippingAddressIdAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitRemoveShippingAddressIdAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitRemoveShippingAddressIdAction $data */ + $data = BusinessUnitRemoveShippingAddressIdActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveShippingAddressIdActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveShippingAddressIdActionModel.php new file mode 100644 index 00000000000..52302c73f25 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveShippingAddressIdActionModel.php @@ -0,0 +1,129 @@ +addressId = $addressId; + $this->addressKey = $addressKey; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

ID of the address to be removed from shippingAddressIds. Either addressId or addressKey is required.

+ * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

Key of the address to be removed from shippingAddressIds. Either addressId or addressKey is required.

+ * + * + * @return null|string + */ + public function getAddressKey() + { + if (is_null($this->addressKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_KEY); + if (is_null($data)) { + return null; + } + $this->addressKey = (string) $data; + } + + return $this->addressKey; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void + { + $this->addressKey = $addressKey; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveStoreAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveStoreAction.php new file mode 100644 index 00000000000..bf97bbdc1f6 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveStoreAction.php @@ -0,0 +1,31 @@ +Store to remove.

+ * + + * @return null|StoreResourceIdentifier + */ + public function getStore(); + + /** + * @param ?StoreResourceIdentifier $store + */ + public function setStore(?StoreResourceIdentifier $store): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveStoreActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveStoreActionBuilder.php new file mode 100644 index 00000000000..f8a058d75aa --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveStoreActionBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitRemoveStoreActionBuilder implements Builder +{ + /** + + * @var null|StoreResourceIdentifier|StoreResourceIdentifierBuilder + */ + private $store; + + /** + *

Store to remove.

+ * + + * @return null|StoreResourceIdentifier + */ + public function getStore() + { + return $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store; + } + + /** + * @param ?StoreResourceIdentifier $store + * @return $this + */ + public function withStore(?StoreResourceIdentifier $store) + { + $this->store = $store; + + return $this; + } + + /** + * @deprecated use withStore() instead + * @return $this + */ + public function withStoreBuilder(?StoreResourceIdentifierBuilder $store) + { + $this->store = $store; + + return $this; + } + + public function build(): BusinessUnitRemoveStoreAction + { + return new BusinessUnitRemoveStoreActionModel( + $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store + ); + } + + public static function of(): BusinessUnitRemoveStoreActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveStoreActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveStoreActionCollection.php new file mode 100644 index 00000000000..7bac17b463f --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveStoreActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitRemoveStoreAction current() + * @method BusinessUnitRemoveStoreAction end() + * @method BusinessUnitRemoveStoreAction at($offset) + */ +class BusinessUnitRemoveStoreActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitRemoveStoreAction $value + * @psalm-param BusinessUnitRemoveStoreAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitRemoveStoreActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitRemoveStoreAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitRemoveStoreAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitRemoveStoreAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitRemoveStoreAction $data */ + $data = BusinessUnitRemoveStoreActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveStoreActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveStoreActionModel.php new file mode 100644 index 00000000000..768cfde834b --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitRemoveStoreActionModel.php @@ -0,0 +1,96 @@ +store = $store; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

Store to remove.

+ * + * + * @return null|StoreResourceIdentifier + */ + public function getStore() + { + if (is_null($this->store)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STORE); + if (is_null($data)) { + return null; + } + + $this->store = StoreResourceIdentifierModel::of($data); + } + + return $this->store; + } + + + /** + * @param ?StoreResourceIdentifier $store + */ + public function setStore(?StoreResourceIdentifier $store): void + { + $this->store = $store; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitResourceIdentifier.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitResourceIdentifier.php new file mode 100644 index 00000000000..ac106359249 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitResourceIdentifier.php @@ -0,0 +1,42 @@ +Unique identifier of the referenced BusinessUnit. Either id or key is required.

+ * + + * @return null|string + */ + public function getId(); + + /** + *

Unique key of the referenced BusinessUnit. Either id or key is required.

+ * + + * @return null|string + */ + public function getKey(); + + /** + * @param ?string $id + */ + public function setId(?string $id): void; + + /** + * @param ?string $key + */ + public function setKey(?string $key): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitResourceIdentifierBuilder.php new file mode 100644 index 00000000000..ba5fda528b9 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitResourceIdentifierBuilder.php @@ -0,0 +1,94 @@ + + */ +final class BusinessUnitResourceIdentifierBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?string + */ + private $key; + + /** + *

Unique identifier of the referenced BusinessUnit. Either id or key is required.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Unique key of the referenced BusinessUnit. Either id or key is required.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + + public function build(): BusinessUnitResourceIdentifier + { + return new BusinessUnitResourceIdentifierModel( + $this->id, + $this->key + ); + } + + public static function of(): BusinessUnitResourceIdentifierBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitResourceIdentifierCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitResourceIdentifierCollection.php new file mode 100644 index 00000000000..e45e9039c9f --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitResourceIdentifierCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitResourceIdentifier current() + * @method BusinessUnitResourceIdentifier end() + * @method BusinessUnitResourceIdentifier at($offset) + */ +class BusinessUnitResourceIdentifierCollection extends ResourceIdentifierCollection +{ + /** + * @psalm-assert BusinessUnitResourceIdentifier $value + * @psalm-param BusinessUnitResourceIdentifier|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitResourceIdentifierCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitResourceIdentifier) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitResourceIdentifier + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitResourceIdentifier { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitResourceIdentifier $data */ + $data = BusinessUnitResourceIdentifierModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitResourceIdentifierModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitResourceIdentifierModel.php new file mode 100644 index 00000000000..9ab1a729d6d --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitResourceIdentifierModel.php @@ -0,0 +1,133 @@ +id = $id; + $this->key = $key; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

+ * + * + * @return null|string + */ + public function getTypeId() + { + if (is_null($this->typeId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE_ID); + if (is_null($data)) { + return null; + } + $this->typeId = (string) $data; + } + + return $this->typeId; + } + + /** + *

Unique identifier of the referenced BusinessUnit. Either id or key is required.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Unique key of the referenced BusinessUnit. Either id or key is required.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomFieldAction.php new file mode 100644 index 00000000000..e1f36daa68f --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomFieldAction.php @@ -0,0 +1,60 @@ +ID of the address to be extended.

+ * + + * @return null|string + */ + public function getAddressId(); + + /** + *

Name of the Custom Field.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

If value is absent or null, this field will be removed if it exists. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * If value is provided, it is set for the field defined by name.

+ * + + * @return null|mixed + */ + public function getValue(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param mixed $value + */ + public function setValue($value): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomFieldActionBuilder.php new file mode 100644 index 00000000000..c0c12e67297 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomFieldActionBuilder.php @@ -0,0 +1,123 @@ + + */ +final class BusinessUnitSetAddressCustomFieldActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + *

ID of the address to be extended.

+ * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

Name of the Custom Field.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

If value is absent or null, this field will be removed if it exists. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * If value is provided, it is set for the field defined by name.

+ * + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + + public function build(): BusinessUnitSetAddressCustomFieldAction + { + return new BusinessUnitSetAddressCustomFieldActionModel( + $this->addressId, + $this->name, + $this->value + ); + } + + public static function of(): BusinessUnitSetAddressCustomFieldActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomFieldActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomFieldActionCollection.php new file mode 100644 index 00000000000..c3e9db9a18b --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomFieldActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitSetAddressCustomFieldAction current() + * @method BusinessUnitSetAddressCustomFieldAction end() + * @method BusinessUnitSetAddressCustomFieldAction at($offset) + */ +class BusinessUnitSetAddressCustomFieldActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitSetAddressCustomFieldAction $value + * @psalm-param BusinessUnitSetAddressCustomFieldAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitSetAddressCustomFieldActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitSetAddressCustomFieldAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitSetAddressCustomFieldAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitSetAddressCustomFieldAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitSetAddressCustomFieldAction $data */ + $data = BusinessUnitSetAddressCustomFieldActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomFieldActionModel.php new file mode 100644 index 00000000000..868b9f6922a --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomFieldActionModel.php @@ -0,0 +1,167 @@ +addressId = $addressId; + $this->name = $name; + $this->value = $value; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

ID of the address to be extended.

+ * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

Name of the Custom Field.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

If value is absent or null, this field will be removed if it exists. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * If value is provided, it is set for the field defined by name.

+ * + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomTypeAction.php new file mode 100644 index 00000000000..f0307c8110d --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomTypeAction.php @@ -0,0 +1,61 @@ +Defines the Type that extends the address with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the address.

+ * + + * @return null|TypeResourceIdentifier + */ + public function getType(); + + /** + *

Sets the Custom Fields for the address.

+ * + + * @return null|FieldContainer + */ + public function getFields(); + + /** + *

ID of the address to be extended.

+ * + + * @return null|string + */ + public function getAddressId(); + + /** + * @param ?TypeResourceIdentifier $type + */ + public function setType(?TypeResourceIdentifier $type): void; + + /** + * @param ?FieldContainer $fields + */ + public function setFields(?FieldContainer $fields): void; + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomTypeActionBuilder.php new file mode 100644 index 00000000000..f7dcec1752c --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomTypeActionBuilder.php @@ -0,0 +1,147 @@ + + */ +final class BusinessUnitSetAddressCustomTypeActionBuilder implements Builder +{ + /** + + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder + */ + private $type; + + /** + + * @var null|FieldContainer|FieldContainerBuilder + */ + private $fields; + + /** + + * @var ?string + */ + private $addressId; + + /** + *

Defines the Type that extends the address with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the address.

+ * + + * @return null|TypeResourceIdentifier + */ + public function getType() + { + return $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type; + } + + /** + *

Sets the Custom Fields for the address.

+ * + + * @return null|FieldContainer + */ + public function getFields() + { + return $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields; + } + + /** + *

ID of the address to be extended.

+ * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + * @param ?TypeResourceIdentifier $type + * @return $this + */ + public function withType(?TypeResourceIdentifier $type) + { + $this->type = $type; + + return $this; + } + + /** + * @param ?FieldContainer $fields + * @return $this + */ + public function withFields(?FieldContainer $fields) + { + $this->fields = $fields; + + return $this; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @deprecated use withType() instead + * @return $this + */ + public function withTypeBuilder(?TypeResourceIdentifierBuilder $type) + { + $this->type = $type; + + return $this; + } + + /** + * @deprecated use withFields() instead + * @return $this + */ + public function withFieldsBuilder(?FieldContainerBuilder $fields) + { + $this->fields = $fields; + + return $this; + } + + public function build(): BusinessUnitSetAddressCustomTypeAction + { + return new BusinessUnitSetAddressCustomTypeActionModel( + $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type, + $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields, + $this->addressId + ); + } + + public static function of(): BusinessUnitSetAddressCustomTypeActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomTypeActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomTypeActionCollection.php new file mode 100644 index 00000000000..8747177b829 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomTypeActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitSetAddressCustomTypeAction current() + * @method BusinessUnitSetAddressCustomTypeAction end() + * @method BusinessUnitSetAddressCustomTypeAction at($offset) + */ +class BusinessUnitSetAddressCustomTypeActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitSetAddressCustomTypeAction $value + * @psalm-param BusinessUnitSetAddressCustomTypeAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitSetAddressCustomTypeActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitSetAddressCustomTypeAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitSetAddressCustomTypeAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitSetAddressCustomTypeAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitSetAddressCustomTypeAction $data */ + $data = BusinessUnitSetAddressCustomTypeActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomTypeActionModel.php new file mode 100644 index 00000000000..de3c208e217 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAddressCustomTypeActionModel.php @@ -0,0 +1,172 @@ +type = $type; + $this->fields = $fields; + $this->addressId = $addressId; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

Defines the Type that extends the address with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the address.

+ * + * + * @return null|TypeResourceIdentifier + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + + $this->type = TypeResourceIdentifierModel::of($data); + } + + return $this->type; + } + + /** + *

Sets the Custom Fields for the address.

+ * + * + * @return null|FieldContainer + */ + public function getFields() + { + if (is_null($this->fields)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_FIELDS); + if (is_null($data)) { + return null; + } + + $this->fields = FieldContainerModel::of($data); + } + + return $this->fields; + } + + /** + *

ID of the address to be extended.

+ * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + + /** + * @param ?TypeResourceIdentifier $type + */ + public function setType(?TypeResourceIdentifier $type): void + { + $this->type = $type; + } + + /** + * @param ?FieldContainer $fields + */ + public function setFields(?FieldContainer $fields): void + { + $this->fields = $fields; + } + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAssociatesAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAssociatesAction.php new file mode 100644 index 00000000000..f2c93deec79 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAssociatesAction.php @@ -0,0 +1,30 @@ +The new list of Associates. If not provided, any existing list is removed.

+ * + + * @return null|AssociateDraftCollection + */ + public function getAssociates(); + + /** + * @param ?AssociateDraftCollection $associates + */ + public function setAssociates(?AssociateDraftCollection $associates): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAssociatesActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAssociatesActionBuilder.php new file mode 100644 index 00000000000..493f2a9e7a9 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAssociatesActionBuilder.php @@ -0,0 +1,63 @@ + + */ +final class BusinessUnitSetAssociatesActionBuilder implements Builder +{ + /** + + * @var ?AssociateDraftCollection + */ + private $associates; + + /** + *

The new list of Associates. If not provided, any existing list is removed.

+ * + + * @return null|AssociateDraftCollection + */ + public function getAssociates() + { + return $this->associates; + } + + /** + * @param ?AssociateDraftCollection $associates + * @return $this + */ + public function withAssociates(?AssociateDraftCollection $associates) + { + $this->associates = $associates; + + return $this; + } + + + public function build(): BusinessUnitSetAssociatesAction + { + return new BusinessUnitSetAssociatesActionModel( + $this->associates + ); + } + + public static function of(): BusinessUnitSetAssociatesActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAssociatesActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAssociatesActionCollection.php new file mode 100644 index 00000000000..4575f430de1 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAssociatesActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitSetAssociatesAction current() + * @method BusinessUnitSetAssociatesAction end() + * @method BusinessUnitSetAssociatesAction at($offset) + */ +class BusinessUnitSetAssociatesActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitSetAssociatesAction $value + * @psalm-param BusinessUnitSetAssociatesAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitSetAssociatesActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitSetAssociatesAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitSetAssociatesAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitSetAssociatesAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitSetAssociatesAction $data */ + $data = BusinessUnitSetAssociatesActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAssociatesActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAssociatesActionModel.php new file mode 100644 index 00000000000..75096a7945f --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetAssociatesActionModel.php @@ -0,0 +1,93 @@ +associates = $associates; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

The new list of Associates. If not provided, any existing list is removed.

+ * + * + * @return null|AssociateDraftCollection + */ + public function getAssociates() + { + if (is_null($this->associates)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ASSOCIATES); + if (is_null($data)) { + return null; + } + $this->associates = AssociateDraftCollection::fromArray($data); + } + + return $this->associates; + } + + + /** + * @param ?AssociateDraftCollection $associates + */ + public function setAssociates(?AssociateDraftCollection $associates): void + { + $this->associates = $associates; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetContactEmailAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetContactEmailAction.php new file mode 100644 index 00000000000..471a2eac89f --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetContactEmailAction.php @@ -0,0 +1,31 @@ +Email to set. + * If contactEmail is absent or null, the existing contact email, if any, will be removed.

+ * + + * @return null|string + */ + public function getContactEmail(); + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetContactEmailActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetContactEmailActionBuilder.php new file mode 100644 index 00000000000..aef76c10a8a --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetContactEmailActionBuilder.php @@ -0,0 +1,64 @@ + + */ +final class BusinessUnitSetContactEmailActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $contactEmail; + + /** + *

Email to set. + * If contactEmail is absent or null, the existing contact email, if any, will be removed.

+ * + + * @return null|string + */ + public function getContactEmail() + { + return $this->contactEmail; + } + + /** + * @param ?string $contactEmail + * @return $this + */ + public function withContactEmail(?string $contactEmail) + { + $this->contactEmail = $contactEmail; + + return $this; + } + + + public function build(): BusinessUnitSetContactEmailAction + { + return new BusinessUnitSetContactEmailActionModel( + $this->contactEmail + ); + } + + public static function of(): BusinessUnitSetContactEmailActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetContactEmailActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetContactEmailActionCollection.php new file mode 100644 index 00000000000..d6cd176e5d7 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetContactEmailActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitSetContactEmailAction current() + * @method BusinessUnitSetContactEmailAction end() + * @method BusinessUnitSetContactEmailAction at($offset) + */ +class BusinessUnitSetContactEmailActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitSetContactEmailAction $value + * @psalm-param BusinessUnitSetContactEmailAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitSetContactEmailActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitSetContactEmailAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitSetContactEmailAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitSetContactEmailAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitSetContactEmailAction $data */ + $data = BusinessUnitSetContactEmailActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetContactEmailActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetContactEmailActionModel.php new file mode 100644 index 00000000000..61432831f0f --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetContactEmailActionModel.php @@ -0,0 +1,94 @@ +contactEmail = $contactEmail; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

Email to set. + * If contactEmail is absent or null, the existing contact email, if any, will be removed.

+ * + * + * @return null|string + */ + public function getContactEmail() + { + if (is_null($this->contactEmail)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CONTACT_EMAIL); + if (is_null($data)) { + return null; + } + $this->contactEmail = (string) $data; + } + + return $this->contactEmail; + } + + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void + { + $this->contactEmail = $contactEmail; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomFieldAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomFieldAction.php new file mode 100644 index 00000000000..f4e5b554135 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomFieldAction.php @@ -0,0 +1,46 @@ +Name of the Custom Field.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

If value is absent or null, this field will be removed if it exists. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * If value is provided, it is set for the field defined by name.

+ * + + * @return null|mixed + */ + public function getValue(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param mixed $value + */ + public function setValue($value): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomFieldActionBuilder.php new file mode 100644 index 00000000000..0f3bbd512f3 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomFieldActionBuilder.php @@ -0,0 +1,94 @@ + + */ +final class BusinessUnitSetCustomFieldActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + *

Name of the Custom Field.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

If value is absent or null, this field will be removed if it exists. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * If value is provided, it is set for the field defined by name.

+ * + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + + public function build(): BusinessUnitSetCustomFieldAction + { + return new BusinessUnitSetCustomFieldActionModel( + $this->name, + $this->value + ); + } + + public static function of(): BusinessUnitSetCustomFieldActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomFieldActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomFieldActionCollection.php new file mode 100644 index 00000000000..46b24eef55e --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomFieldActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitSetCustomFieldAction current() + * @method BusinessUnitSetCustomFieldAction end() + * @method BusinessUnitSetCustomFieldAction at($offset) + */ +class BusinessUnitSetCustomFieldActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitSetCustomFieldAction $value + * @psalm-param BusinessUnitSetCustomFieldAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitSetCustomFieldActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitSetCustomFieldAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitSetCustomFieldAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitSetCustomFieldAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitSetCustomFieldAction $data */ + $data = BusinessUnitSetCustomFieldActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomFieldActionModel.php new file mode 100644 index 00000000000..01a6b966922 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomFieldActionModel.php @@ -0,0 +1,131 @@ +name = $name; + $this->value = $value; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

Name of the Custom Field.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

If value is absent or null, this field will be removed if it exists. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * If value is provided, it is set for the field defined by name.

+ * + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomTypeAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomTypeAction.php new file mode 100644 index 00000000000..62b9797ebf6 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomTypeAction.php @@ -0,0 +1,47 @@ +Defines the Type that extends the BusinessUnit with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the BusinessUnit.

+ * + + * @return null|TypeResourceIdentifier + */ + public function getType(); + + /** + *

Sets the Custom Fields for the BusinessUnit.

+ * + + * @return null|FieldContainer + */ + public function getFields(); + + /** + * @param ?TypeResourceIdentifier $type + */ + public function setType(?TypeResourceIdentifier $type): void; + + /** + * @param ?FieldContainer $fields + */ + public function setFields(?FieldContainer $fields): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomTypeActionBuilder.php new file mode 100644 index 00000000000..2c7e31b0e98 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomTypeActionBuilder.php @@ -0,0 +1,118 @@ + + */ +final class BusinessUnitSetCustomTypeActionBuilder implements Builder +{ + /** + + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder + */ + private $type; + + /** + + * @var null|FieldContainer|FieldContainerBuilder + */ + private $fields; + + /** + *

Defines the Type that extends the BusinessUnit with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the BusinessUnit.

+ * + + * @return null|TypeResourceIdentifier + */ + public function getType() + { + return $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type; + } + + /** + *

Sets the Custom Fields for the BusinessUnit.

+ * + + * @return null|FieldContainer + */ + public function getFields() + { + return $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields; + } + + /** + * @param ?TypeResourceIdentifier $type + * @return $this + */ + public function withType(?TypeResourceIdentifier $type) + { + $this->type = $type; + + return $this; + } + + /** + * @param ?FieldContainer $fields + * @return $this + */ + public function withFields(?FieldContainer $fields) + { + $this->fields = $fields; + + return $this; + } + + /** + * @deprecated use withType() instead + * @return $this + */ + public function withTypeBuilder(?TypeResourceIdentifierBuilder $type) + { + $this->type = $type; + + return $this; + } + + /** + * @deprecated use withFields() instead + * @return $this + */ + public function withFieldsBuilder(?FieldContainerBuilder $fields) + { + $this->fields = $fields; + + return $this; + } + + public function build(): BusinessUnitSetCustomTypeAction + { + return new BusinessUnitSetCustomTypeActionModel( + $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type, + $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields + ); + } + + public static function of(): BusinessUnitSetCustomTypeActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomTypeActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomTypeActionCollection.php new file mode 100644 index 00000000000..63647ba321a --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomTypeActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitSetCustomTypeAction current() + * @method BusinessUnitSetCustomTypeAction end() + * @method BusinessUnitSetCustomTypeAction at($offset) + */ +class BusinessUnitSetCustomTypeActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitSetCustomTypeAction $value + * @psalm-param BusinessUnitSetCustomTypeAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitSetCustomTypeActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitSetCustomTypeAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitSetCustomTypeAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitSetCustomTypeAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitSetCustomTypeAction $data */ + $data = BusinessUnitSetCustomTypeActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomTypeActionModel.php new file mode 100644 index 00000000000..f467bc99b3e --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetCustomTypeActionModel.php @@ -0,0 +1,136 @@ +type = $type; + $this->fields = $fields; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

Defines the Type that extends the BusinessUnit with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the BusinessUnit.

+ * + * + * @return null|TypeResourceIdentifier + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + + $this->type = TypeResourceIdentifierModel::of($data); + } + + return $this->type; + } + + /** + *

Sets the Custom Fields for the BusinessUnit.

+ * + * + * @return null|FieldContainer + */ + public function getFields() + { + if (is_null($this->fields)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_FIELDS); + if (is_null($data)) { + return null; + } + + $this->fields = FieldContainerModel::of($data); + } + + return $this->fields; + } + + + /** + * @param ?TypeResourceIdentifier $type + */ + public function setType(?TypeResourceIdentifier $type): void + { + $this->type = $type; + } + + /** + * @param ?FieldContainer $fields + */ + public function setFields(?FieldContainer $fields): void + { + $this->fields = $fields; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultBillingAddressAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultBillingAddressAction.php new file mode 100644 index 00000000000..1212333e2c9 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultBillingAddressAction.php @@ -0,0 +1,44 @@ +ID of the address to add as a billing address. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressId(); + + /** + *

Key of the address to add as a billing address. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressKey(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultBillingAddressActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultBillingAddressActionBuilder.php new file mode 100644 index 00000000000..b26d097438f --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultBillingAddressActionBuilder.php @@ -0,0 +1,92 @@ + + */ +final class BusinessUnitSetDefaultBillingAddressActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $addressKey; + + /** + *

ID of the address to add as a billing address. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

Key of the address to add as a billing address. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressKey() + { + return $this->addressKey; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $addressKey + * @return $this + */ + public function withAddressKey(?string $addressKey) + { + $this->addressKey = $addressKey; + + return $this; + } + + + public function build(): BusinessUnitSetDefaultBillingAddressAction + { + return new BusinessUnitSetDefaultBillingAddressActionModel( + $this->addressId, + $this->addressKey + ); + } + + public static function of(): BusinessUnitSetDefaultBillingAddressActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultBillingAddressActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultBillingAddressActionCollection.php new file mode 100644 index 00000000000..806f7683d1f --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultBillingAddressActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitSetDefaultBillingAddressAction current() + * @method BusinessUnitSetDefaultBillingAddressAction end() + * @method BusinessUnitSetDefaultBillingAddressAction at($offset) + */ +class BusinessUnitSetDefaultBillingAddressActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitSetDefaultBillingAddressAction $value + * @psalm-param BusinessUnitSetDefaultBillingAddressAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitSetDefaultBillingAddressActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitSetDefaultBillingAddressAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitSetDefaultBillingAddressAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitSetDefaultBillingAddressAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitSetDefaultBillingAddressAction $data */ + $data = BusinessUnitSetDefaultBillingAddressActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultBillingAddressActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultBillingAddressActionModel.php new file mode 100644 index 00000000000..18cef4d315b --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultBillingAddressActionModel.php @@ -0,0 +1,129 @@ +addressId = $addressId; + $this->addressKey = $addressKey; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

ID of the address to add as a billing address. Either addressId or addressKey is required.

+ * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

Key of the address to add as a billing address. Either addressId or addressKey is required.

+ * + * + * @return null|string + */ + public function getAddressKey() + { + if (is_null($this->addressKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_KEY); + if (is_null($data)) { + return null; + } + $this->addressKey = (string) $data; + } + + return $this->addressKey; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void + { + $this->addressKey = $addressKey; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultShippingAddressAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultShippingAddressAction.php new file mode 100644 index 00000000000..b31f034749e --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultShippingAddressAction.php @@ -0,0 +1,44 @@ +ID of the address to add as a shipping address. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressId(); + + /** + *

Key of the address to add as a shipping address. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressKey(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultShippingAddressActionBuilder.php new file mode 100644 index 00000000000..f08bd2a78a7 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultShippingAddressActionBuilder.php @@ -0,0 +1,92 @@ + + */ +final class BusinessUnitSetDefaultShippingAddressActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $addressKey; + + /** + *

ID of the address to add as a shipping address. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

Key of the address to add as a shipping address. Either addressId or addressKey is required.

+ * + + * @return null|string + */ + public function getAddressKey() + { + return $this->addressKey; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $addressKey + * @return $this + */ + public function withAddressKey(?string $addressKey) + { + $this->addressKey = $addressKey; + + return $this; + } + + + public function build(): BusinessUnitSetDefaultShippingAddressAction + { + return new BusinessUnitSetDefaultShippingAddressActionModel( + $this->addressId, + $this->addressKey + ); + } + + public static function of(): BusinessUnitSetDefaultShippingAddressActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultShippingAddressActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultShippingAddressActionCollection.php new file mode 100644 index 00000000000..7d483b507cc --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultShippingAddressActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitSetDefaultShippingAddressAction current() + * @method BusinessUnitSetDefaultShippingAddressAction end() + * @method BusinessUnitSetDefaultShippingAddressAction at($offset) + */ +class BusinessUnitSetDefaultShippingAddressActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitSetDefaultShippingAddressAction $value + * @psalm-param BusinessUnitSetDefaultShippingAddressAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitSetDefaultShippingAddressActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitSetDefaultShippingAddressAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitSetDefaultShippingAddressAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitSetDefaultShippingAddressAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitSetDefaultShippingAddressAction $data */ + $data = BusinessUnitSetDefaultShippingAddressActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultShippingAddressActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultShippingAddressActionModel.php new file mode 100644 index 00000000000..ffb2360bd6c --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetDefaultShippingAddressActionModel.php @@ -0,0 +1,129 @@ +addressId = $addressId; + $this->addressKey = $addressKey; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

ID of the address to add as a shipping address. Either addressId or addressKey is required.

+ * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

Key of the address to add as a shipping address. Either addressId or addressKey is required.

+ * + * + * @return null|string + */ + public function getAddressKey() + { + if (is_null($this->addressKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_KEY); + if (is_null($data)) { + return null; + } + $this->addressKey = (string) $data; + } + + return $this->addressKey; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void + { + $this->addressKey = $addressKey; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoreModeAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoreModeAction.php new file mode 100644 index 00000000000..3ff705c9d7d --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoreModeAction.php @@ -0,0 +1,45 @@ +Set to Explicit to specify Stores for the Business Unit. Set to FromParent to inherit Stores from a parent.

+ * + + * @return null|string + */ + public function getStoreMode(); + + /** + *

Set the Stores the Business Unit is associated with. Can only be set if storeMode is Explicit.

+ * + + * @return null|StoreResourceIdentifierCollection + */ + public function getStores(); + + /** + * @param ?string $storeMode + */ + public function setStoreMode(?string $storeMode): void; + + /** + * @param ?StoreResourceIdentifierCollection $stores + */ + public function setStores(?StoreResourceIdentifierCollection $stores): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoreModeActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoreModeActionBuilder.php new file mode 100644 index 00000000000..87eb14571ce --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoreModeActionBuilder.php @@ -0,0 +1,93 @@ + + */ +final class BusinessUnitSetStoreModeActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $storeMode; + + /** + + * @var ?StoreResourceIdentifierCollection + */ + private $stores; + + /** + *

Set to Explicit to specify Stores for the Business Unit. Set to FromParent to inherit Stores from a parent.

+ * + + * @return null|string + */ + public function getStoreMode() + { + return $this->storeMode; + } + + /** + *

Set the Stores the Business Unit is associated with. Can only be set if storeMode is Explicit.

+ * + + * @return null|StoreResourceIdentifierCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + * @param ?string $storeMode + * @return $this + */ + public function withStoreMode(?string $storeMode) + { + $this->storeMode = $storeMode; + + return $this; + } + + /** + * @param ?StoreResourceIdentifierCollection $stores + * @return $this + */ + public function withStores(?StoreResourceIdentifierCollection $stores) + { + $this->stores = $stores; + + return $this; + } + + + public function build(): BusinessUnitSetStoreModeAction + { + return new BusinessUnitSetStoreModeActionModel( + $this->storeMode, + $this->stores + ); + } + + public static function of(): BusinessUnitSetStoreModeActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoreModeActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoreModeActionCollection.php new file mode 100644 index 00000000000..9fa1145b7c7 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoreModeActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitSetStoreModeAction current() + * @method BusinessUnitSetStoreModeAction end() + * @method BusinessUnitSetStoreModeAction at($offset) + */ +class BusinessUnitSetStoreModeActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitSetStoreModeAction $value + * @psalm-param BusinessUnitSetStoreModeAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitSetStoreModeActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitSetStoreModeAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitSetStoreModeAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitSetStoreModeAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitSetStoreModeAction $data */ + $data = BusinessUnitSetStoreModeActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoreModeActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoreModeActionModel.php new file mode 100644 index 00000000000..9ade3ae1f41 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoreModeActionModel.php @@ -0,0 +1,130 @@ +storeMode = $storeMode; + $this->stores = $stores; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

Set to Explicit to specify Stores for the Business Unit. Set to FromParent to inherit Stores from a parent.

+ * + * + * @return null|string + */ + public function getStoreMode() + { + if (is_null($this->storeMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STORE_MODE); + if (is_null($data)) { + return null; + } + $this->storeMode = (string) $data; + } + + return $this->storeMode; + } + + /** + *

Set the Stores the Business Unit is associated with. Can only be set if storeMode is Explicit.

+ * + * + * @return null|StoreResourceIdentifierCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STORES); + if (is_null($data)) { + return null; + } + $this->stores = StoreResourceIdentifierCollection::fromArray($data); + } + + return $this->stores; + } + + + /** + * @param ?string $storeMode + */ + public function setStoreMode(?string $storeMode): void + { + $this->storeMode = $storeMode; + } + + /** + * @param ?StoreResourceIdentifierCollection $stores + */ + public function setStores(?StoreResourceIdentifierCollection $stores): void + { + $this->stores = $stores; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoresAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoresAction.php new file mode 100644 index 00000000000..101c37feb12 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoresAction.php @@ -0,0 +1,31 @@ +Stores to set. Overrides the current list of Stores.

+ * + + * @return null|StoreResourceIdentifierCollection + */ + public function getStores(); + + /** + * @param ?StoreResourceIdentifierCollection $stores + */ + public function setStores(?StoreResourceIdentifierCollection $stores): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoresActionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoresActionBuilder.php new file mode 100644 index 00000000000..64ec1771e2d --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoresActionBuilder.php @@ -0,0 +1,64 @@ + + */ +final class BusinessUnitSetStoresActionBuilder implements Builder +{ + /** + + * @var ?StoreResourceIdentifierCollection + */ + private $stores; + + /** + *

Stores to set. Overrides the current list of Stores.

+ * + + * @return null|StoreResourceIdentifierCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + * @param ?StoreResourceIdentifierCollection $stores + * @return $this + */ + public function withStores(?StoreResourceIdentifierCollection $stores) + { + $this->stores = $stores; + + return $this; + } + + + public function build(): BusinessUnitSetStoresAction + { + return new BusinessUnitSetStoresActionModel( + $this->stores + ); + } + + public static function of(): BusinessUnitSetStoresActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoresActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoresActionCollection.php new file mode 100644 index 00000000000..d770c777525 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoresActionCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitSetStoresAction current() + * @method BusinessUnitSetStoresAction end() + * @method BusinessUnitSetStoresAction at($offset) + */ +class BusinessUnitSetStoresActionCollection extends BusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert BusinessUnitSetStoresAction $value + * @psalm-param BusinessUnitSetStoresAction|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitSetStoresActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitSetStoresAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitSetStoresAction + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitSetStoresAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitSetStoresAction $data */ + $data = BusinessUnitSetStoresActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoresActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoresActionModel.php new file mode 100644 index 00000000000..64a9d78318f --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitSetStoresActionModel.php @@ -0,0 +1,94 @@ +stores = $stores; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

Stores to set. Overrides the current list of Stores.

+ * + * + * @return null|StoreResourceIdentifierCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STORES); + if (is_null($data)) { + return null; + } + $this->stores = StoreResourceIdentifierCollection::fromArray($data); + } + + return $this->stores; + } + + + /** + * @param ?StoreResourceIdentifierCollection $stores + */ + public function setStores(?StoreResourceIdentifierCollection $stores): void + { + $this->stores = $stores; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdate.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdate.php new file mode 100644 index 00000000000..947b6acf56c --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdate.php @@ -0,0 +1,45 @@ +Expected version of the BusinessUnit on which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

+ * + + * @return null|int + */ + public function getVersion(); + + /** + *

Update actions to be performed on the BusinessUnit.

+ * + + * @return null|BusinessUnitUpdateActionCollection + */ + public function getActions(); + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void; + + /** + * @param ?BusinessUnitUpdateActionCollection $actions + */ + public function setActions(?BusinessUnitUpdateActionCollection $actions): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateAction.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateAction.php new file mode 100644 index 00000000000..ce5a2b10582 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateAction.php @@ -0,0 +1,24 @@ + + */ +final class BusinessUnitUpdateActionBuilder implements Builder +{ + public function build(): BusinessUnitUpdateAction + { + return new BusinessUnitUpdateActionModel( + ); + } + + public static function of(): BusinessUnitUpdateActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateActionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateActionCollection.php new file mode 100644 index 00000000000..c85152b0f7c --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateActionCollection.php @@ -0,0 +1,60 @@ + + * @psalm-method T current() + * @psalm-method T end() + * @psalm-method T at($offset) + * @method BusinessUnitUpdateAction current() + * @method BusinessUnitUpdateAction end() + * @method BusinessUnitUpdateAction at($offset) + */ +class BusinessUnitUpdateActionCollection extends MapperSequence +{ + /** + * @psalm-assert T $value + * @psalm-param T|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitUpdateActionCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitUpdateAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?T + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitUpdateAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var T $data */ + $data = BusinessUnitUpdateActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateActionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateActionModel.php new file mode 100644 index 00000000000..4d1253f1caf --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateActionModel.php @@ -0,0 +1,118 @@ + > + * + */ + private static $discriminatorClasses = [ + 'addAddress' => BusinessUnitAddAddressActionModel::class, + 'addAssociate' => BusinessUnitAddAssociateActionModel::class, + 'addBillingAddressId' => BusinessUnitAddBillingAddressIdActionModel::class, + 'addShippingAddressId' => BusinessUnitAddShippingAddressIdActionModel::class, + 'addStore' => BusinessUnitAddStoreActionModel::class, + 'changeAddress' => BusinessUnitChangeAddressActionModel::class, + 'changeAssociate' => BusinessUnitChangeAssociateActionModel::class, + 'changeName' => BusinessUnitChangeNameActionModel::class, + 'changeParentUnit' => BusinessUnitChangeParentUnitActionModel::class, + 'changeStatus' => BusinessUnitChangeStatusActionModel::class, + 'removeAddress' => BusinessUnitRemoveAddressActionModel::class, + 'removeAssociate' => BusinessUnitRemoveAssociateActionModel::class, + 'removeBillingAddressId' => BusinessUnitRemoveBillingAddressIdActionModel::class, + 'removeShippingAddressId' => BusinessUnitRemoveShippingAddressIdActionModel::class, + 'removeStore' => BusinessUnitRemoveStoreActionModel::class, + 'setAddressCustomField' => BusinessUnitSetAddressCustomFieldActionModel::class, + 'setAddressCustomType' => BusinessUnitSetAddressCustomTypeActionModel::class, + 'setAssociates' => BusinessUnitSetAssociatesActionModel::class, + 'setContactEmail' => BusinessUnitSetContactEmailActionModel::class, + 'setCustomField' => BusinessUnitSetCustomFieldActionModel::class, + 'setCustomType' => BusinessUnitSetCustomTypeActionModel::class, + 'setDefaultBillingAddress' => BusinessUnitSetDefaultBillingAddressActionModel::class, + 'setDefaultShippingAddress' => BusinessUnitSetDefaultShippingAddressActionModel::class, + 'setStoreMode' => BusinessUnitSetStoreModeActionModel::class, + 'setStores' => BusinessUnitSetStoresActionModel::class, + ]; + + /** + * @psalm-suppress MissingParamType + */ + public function __construct( + ?string $action = null + ) { + $this->action = $action; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + + + + + /** + * @psalm-param stdClass|array $value + * @psalm-return class-string + */ + public static function resolveDiscriminatorClass($value): string + { + $fieldName = BusinessUnitUpdateAction::DISCRIMINATOR_FIELD; + if (is_object($value) && isset($value->$fieldName)) { + /** @psalm-var string $discriminatorValue */ + $discriminatorValue = $value->$fieldName; + if (isset(self::$discriminatorClasses[$discriminatorValue])) { + return self::$discriminatorClasses[$discriminatorValue]; + } + } + if (is_array($value) && isset($value[$fieldName])) { + /** @psalm-var string $discriminatorValue */ + $discriminatorValue = $value[$fieldName]; + if (isset(self::$discriminatorClasses[$discriminatorValue])) { + return self::$discriminatorClasses[$discriminatorValue]; + } + } + + /** @psalm-var class-string */ + $type = BusinessUnitUpdateActionModel::class; + return $type; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateBuilder.php new file mode 100644 index 00000000000..19f5b86ce37 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateBuilder.php @@ -0,0 +1,93 @@ + + */ +final class BusinessUnitUpdateBuilder implements Builder +{ + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?BusinessUnitUpdateActionCollection + */ + private $actions; + + /** + *

Expected version of the BusinessUnit on which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Update actions to be performed on the BusinessUnit.

+ * + + * @return null|BusinessUnitUpdateActionCollection + */ + public function getActions() + { + return $this->actions; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?BusinessUnitUpdateActionCollection $actions + * @return $this + */ + public function withActions(?BusinessUnitUpdateActionCollection $actions) + { + $this->actions = $actions; + + return $this; + } + + + public function build(): BusinessUnitUpdate + { + return new BusinessUnitUpdateModel( + $this->version, + $this->actions + ); + } + + public static function of(): BusinessUnitUpdateBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateCollection.php new file mode 100644 index 00000000000..19d3348eb44 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitUpdate current() + * @method BusinessUnitUpdate end() + * @method BusinessUnitUpdate at($offset) + */ +class BusinessUnitUpdateCollection extends MapperSequence +{ + /** + * @psalm-assert BusinessUnitUpdate $value + * @psalm-param BusinessUnitUpdate|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitUpdateCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitUpdate) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitUpdate + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitUpdate { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitUpdate $data */ + $data = BusinessUnitUpdateModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateModel.php b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateModel.php new file mode 100644 index 00000000000..177dd465cf3 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/BusinessUnitUpdateModel.php @@ -0,0 +1,103 @@ +version = $version; + $this->actions = $actions; + } + + /** + *

Expected version of the BusinessUnit on which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Update actions to be performed on the BusinessUnit.

+ * + * + * @return null|BusinessUnitUpdateActionCollection + */ + public function getActions() + { + if (is_null($this->actions)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ACTIONS); + if (is_null($data)) { + return null; + } + $this->actions = BusinessUnitUpdateActionCollection::fromArray($data); + } + + return $this->actions; + } + + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?BusinessUnitUpdateActionCollection $actions + */ + public function setActions(?BusinessUnitUpdateActionCollection $actions): void + { + $this->actions = $actions; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/Company.php b/lib/commercetools-api/src/Models/BusinessUnit/Company.php new file mode 100644 index 00000000000..dedf3a50d28 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/Company.php @@ -0,0 +1,28 @@ +Is always Explicit since a Company does not have a parent Business Unit the Stores can be inherited from.

+ * + + * @return null|string + */ + public function getStoreMode(); + + /** + * @param ?string $storeMode + */ + public function setStoreMode(?string $storeMode): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/CompanyBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/CompanyBuilder.php new file mode 100644 index 00000000000..53f39a86f14 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/CompanyBuilder.php @@ -0,0 +1,709 @@ + + */ +final class CompanyBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?string + */ + private $key; + + /** + + * @var ?string + */ + private $status; + + /** + + * @var ?StoreKeyReferenceCollection + */ + private $stores; + + /** + + * @var ?string + */ + private $storeMode; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var ?string + */ + private $contactEmail; + + /** + + * @var null|CustomFields|CustomFieldsBuilder + */ + private $custom; + + /** + + * @var ?AddressCollection + */ + private $addresses; + + /** + + * @var ?array + */ + private $shippingAddressIds; + + /** + + * @var ?string + */ + private $defaultShipingAddressId; + + /** + + * @var ?array + */ + private $billingAddressIds; + + /** + + * @var ?string + */ + private $defaultBillingAddressId; + + /** + + * @var ?AssociateCollection + */ + private $associates; + + /** + + * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + */ + private $parentUnit; + + /** + + * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + */ + private $topLevelUnit; + + /** + *

Unique identifier of the Business Unit.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Current version of the Business Unit.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Business Unit was initially created.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Date and time (UTC) the Business Unit was last updated.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Present on resources updated after 1 February 2019 except for events not tracked.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

User-defined unique identifier of the Business Unit.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + *

Indicates whether the Business Unit can be edited and used in Orders.

+ * + + * @return null|string + */ + public function getStatus() + { + return $this->status; + } + + /** + *

References to Stores the Business Unit is associated with. + * If empty, the Business Unit can only create Carts, Orders, or Quotes that have no store value. + * If not empty, the Business Unit can only be linked to Carts and Orders of a referenced Store. + * Only present when storeMode is Explicit.

+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + *

Is always Explicit since a Company does not have a parent Business Unit the Stores can be inherited from.

+ * + + * @return null|string + */ + public function getStoreMode() + { + return $this->storeMode; + } + + /** + *

Name of the Business Unit.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

Email address of the Business Unit.

+ * + + * @return null|string + */ + public function getContactEmail() + { + return $this->contactEmail; + } + + /** + *

Custom Fields for the Business Unit.

+ * + + * @return null|CustomFields + */ + public function getCustom() + { + return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; + } + + /** + *

Addresses used by the Business Unit.

+ * + + * @return null|AddressCollection + */ + public function getAddresses() + { + return $this->addresses; + } + + /** + *

Unique identifiers of addresses used as shipping addresses.

+ * + + * @return null|array + */ + public function getShippingAddressIds() + { + return $this->shippingAddressIds; + } + + /** + *

Unique identifier of the address used as the default shipping address.

+ * + + * @return null|string + */ + public function getDefaultShipingAddressId() + { + return $this->defaultShipingAddressId; + } + + /** + *

Unique identifiers of addresses used as billing addresses.

+ * + + * @return null|array + */ + public function getBillingAddressIds() + { + return $this->billingAddressIds; + } + + /** + *

Unique identifier of the address used as the default billing address.

+ * + + * @return null|string + */ + public function getDefaultBillingAddressId() + { + return $this->defaultBillingAddressId; + } + + /** + *

Members that are part of the Business Unit in specific roles.

+ * + + * @return null|AssociateCollection + */ + public function getAssociates() + { + return $this->associates; + } + + /** + *

Parent unit of the Business Unit. Only present when the unitType is Division.

+ * + + * @return null|BusinessUnitKeyReference + */ + public function getParentUnit() + { + return $this->parentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->parentUnit->build() : $this->parentUnit; + } + + /** + *

Top-level unit of the Business Unit. The top-level unit is of unitType Company.

+ * + + * @return null|BusinessUnitKeyReference + */ + public function getTopLevelUnit() + { + return $this->topLevelUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->topLevelUnit->build() : $this->topLevelUnit; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?string $status + * @return $this + */ + public function withStatus(?string $status) + { + $this->status = $status; + + return $this; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + * @return $this + */ + public function withStores(?StoreKeyReferenceCollection $stores) + { + $this->stores = $stores; + + return $this; + } + + /** + * @param ?string $storeMode + * @return $this + */ + public function withStoreMode(?string $storeMode) + { + $this->storeMode = $storeMode; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param ?string $contactEmail + * @return $this + */ + public function withContactEmail(?string $contactEmail) + { + $this->contactEmail = $contactEmail; + + return $this; + } + + /** + * @param ?CustomFields $custom + * @return $this + */ + public function withCustom(?CustomFields $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @param ?AddressCollection $addresses + * @return $this + */ + public function withAddresses(?AddressCollection $addresses) + { + $this->addresses = $addresses; + + return $this; + } + + /** + * @param ?array $shippingAddressIds + * @return $this + */ + public function withShippingAddressIds(?array $shippingAddressIds) + { + $this->shippingAddressIds = $shippingAddressIds; + + return $this; + } + + /** + * @param ?string $defaultShipingAddressId + * @return $this + */ + public function withDefaultShipingAddressId(?string $defaultShipingAddressId) + { + $this->defaultShipingAddressId = $defaultShipingAddressId; + + return $this; + } + + /** + * @param ?array $billingAddressIds + * @return $this + */ + public function withBillingAddressIds(?array $billingAddressIds) + { + $this->billingAddressIds = $billingAddressIds; + + return $this; + } + + /** + * @param ?string $defaultBillingAddressId + * @return $this + */ + public function withDefaultBillingAddressId(?string $defaultBillingAddressId) + { + $this->defaultBillingAddressId = $defaultBillingAddressId; + + return $this; + } + + /** + * @param ?AssociateCollection $associates + * @return $this + */ + public function withAssociates(?AssociateCollection $associates) + { + $this->associates = $associates; + + return $this; + } + + /** + * @param ?BusinessUnitKeyReference $parentUnit + * @return $this + */ + public function withParentUnit(?BusinessUnitKeyReference $parentUnit) + { + $this->parentUnit = $parentUnit; + + return $this; + } + + /** + * @param ?BusinessUnitKeyReference $topLevelUnit + * @return $this + */ + public function withTopLevelUnit(?BusinessUnitKeyReference $topLevelUnit) + { + $this->topLevelUnit = $topLevelUnit; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @deprecated use withParentUnit() instead + * @return $this + */ + public function withParentUnitBuilder(?BusinessUnitKeyReferenceBuilder $parentUnit) + { + $this->parentUnit = $parentUnit; + + return $this; + } + + /** + * @deprecated use withTopLevelUnit() instead + * @return $this + */ + public function withTopLevelUnitBuilder(?BusinessUnitKeyReferenceBuilder $topLevelUnit) + { + $this->topLevelUnit = $topLevelUnit; + + return $this; + } + + public function build(): Company + { + return new CompanyModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->key, + $this->status, + $this->stores, + $this->storeMode, + $this->name, + $this->contactEmail, + $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, + $this->addresses, + $this->shippingAddressIds, + $this->defaultShipingAddressId, + $this->billingAddressIds, + $this->defaultBillingAddressId, + $this->associates, + $this->parentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->parentUnit->build() : $this->parentUnit, + $this->topLevelUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->topLevelUnit->build() : $this->topLevelUnit + ); + } + + public static function of(): CompanyBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/CompanyCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/CompanyCollection.php new file mode 100644 index 00000000000..7c91bb8e466 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/CompanyCollection.php @@ -0,0 +1,56 @@ + + * @method Company current() + * @method Company end() + * @method Company at($offset) + */ +class CompanyCollection extends BusinessUnitCollection +{ + /** + * @psalm-assert Company $value + * @psalm-param Company|stdClass $value + * @throws InvalidArgumentException + * + * @return CompanyCollection + */ + public function add($value) + { + if (!$value instanceof Company) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?Company + */ + protected function mapper() + { + return function (?int $index): ?Company { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var Company $data */ + $data = CompanyModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/CompanyDraft.php b/lib/commercetools-api/src/Models/BusinessUnit/CompanyDraft.php new file mode 100644 index 00000000000..8828cc6b8a2 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/CompanyDraft.php @@ -0,0 +1,16 @@ + + */ +final class CompanyDraftBuilder implements Builder +{ + /** + + * @var ?string + */ + private $key; + + /** + + * @var ?string + */ + private $status; + + /** + + * @var ?StoreKeyReferenceCollection + */ + private $stores; + + /** + + * @var ?string + */ + private $storeMode; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var ?string + */ + private $contactEmail; + + /** + + * @var ?AssociateDraftCollection + */ + private $associates; + + /** + + * @var ?BaseAddressCollection + */ + private $addresses; + + /** + + * @var ?array + */ + private $shippingAddresses; + + /** + + * @var ?int + */ + private $defaultShipingAddress; + + /** + + * @var ?array + */ + private $billingAddresses; + + /** + + * @var ?int + */ + private $defaultBillingAddress; + + /** + + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + */ + private $custom; + + /** + *

User-defined unique identifier for the Business Unit.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + *

Indicates whether the Business Unit can be edited and used in Orders.

+ * + + * @return null|string + */ + public function getStatus() + { + return $this->status; + } + + /** + *

References to Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. + * If not empty, the Business Unit can only be linked to Carts and Orders of a referenced Store. + * If empty, the Business Unit can only create Carts, Orders, or Quotes that have no store value. + * Defaults to empty for Companies and not set for Divisions.

+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + *

Defines whether the Stores of the Business Unit are set on the Business Unit or are inherited from a parent. + * Defaults to Explicit for Companies and to FromParent for Divisions.

+ * + + * @return null|string + */ + public function getStoreMode() + { + return $this->storeMode; + } + + /** + *

Name of the Business Unit.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

Email address of the Business Unit.

+ * + + * @return null|string + */ + public function getContactEmail() + { + return $this->contactEmail; + } + + /** + *

List of members that are part of the Business Unit in specific roles.

+ * + + * @return null|AssociateDraftCollection + */ + public function getAssociates() + { + return $this->associates; + } + + /** + *

Addresses used by the Business Unit.

+ * + + * @return null|BaseAddressCollection + */ + public function getAddresses() + { + return $this->addresses; + } + + /** + *

Indexes of entries in addresses to set as shipping addresses. + * The shippingAddressIds of the Customer will be replaced by these addresses.

+ * + + * @return null|array + */ + public function getShippingAddresses() + { + return $this->shippingAddresses; + } + + /** + *

Index of the entry in addresses to set as the default shipping address.

+ * + + * @return null|int + */ + public function getDefaultShipingAddress() + { + return $this->defaultShipingAddress; + } + + /** + *

Indexes of entries in addresses to set as billing addresses. + * The billingAddressIds of the Customer will be replaced by these addresses.

+ * + + * @return null|array + */ + public function getBillingAddresses() + { + return $this->billingAddresses; + } + + /** + *

Index of the entry in addresses to set as the default billing address.

+ * + + * @return null|int + */ + public function getDefaultBillingAddress() + { + return $this->defaultBillingAddress; + } + + /** + *

Custom Fields for the Business Unit.

+ * + + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?string $status + * @return $this + */ + public function withStatus(?string $status) + { + $this->status = $status; + + return $this; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + * @return $this + */ + public function withStores(?StoreKeyReferenceCollection $stores) + { + $this->stores = $stores; + + return $this; + } + + /** + * @param ?string $storeMode + * @return $this + */ + public function withStoreMode(?string $storeMode) + { + $this->storeMode = $storeMode; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param ?string $contactEmail + * @return $this + */ + public function withContactEmail(?string $contactEmail) + { + $this->contactEmail = $contactEmail; + + return $this; + } + + /** + * @param ?AssociateDraftCollection $associates + * @return $this + */ + public function withAssociates(?AssociateDraftCollection $associates) + { + $this->associates = $associates; + + return $this; + } + + /** + * @param ?BaseAddressCollection $addresses + * @return $this + */ + public function withAddresses(?BaseAddressCollection $addresses) + { + $this->addresses = $addresses; + + return $this; + } + + /** + * @param ?array $shippingAddresses + * @return $this + */ + public function withShippingAddresses(?array $shippingAddresses) + { + $this->shippingAddresses = $shippingAddresses; + + return $this; + } + + /** + * @param ?int $defaultShipingAddress + * @return $this + */ + public function withDefaultShipingAddress(?int $defaultShipingAddress) + { + $this->defaultShipingAddress = $defaultShipingAddress; + + return $this; + } + + /** + * @param ?array $billingAddresses + * @return $this + */ + public function withBillingAddresses(?array $billingAddresses) + { + $this->billingAddresses = $billingAddresses; + + return $this; + } + + /** + * @param ?int $defaultBillingAddress + * @return $this + */ + public function withDefaultBillingAddress(?int $defaultBillingAddress) + { + $this->defaultBillingAddress = $defaultBillingAddress; + + return $this; + } + + /** + * @param ?CustomFieldsDraft $custom + * @return $this + */ + public function withCustom(?CustomFieldsDraft $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + + public function build(): CompanyDraft + { + return new CompanyDraftModel( + $this->key, + $this->status, + $this->stores, + $this->storeMode, + $this->name, + $this->contactEmail, + $this->associates, + $this->addresses, + $this->shippingAddresses, + $this->defaultShipingAddress, + $this->billingAddresses, + $this->defaultBillingAddress, + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom + ); + } + + public static function of(): CompanyDraftBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/CompanyDraftCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/CompanyDraftCollection.php new file mode 100644 index 00000000000..98766a8439d --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/CompanyDraftCollection.php @@ -0,0 +1,56 @@ + + * @method CompanyDraft current() + * @method CompanyDraft end() + * @method CompanyDraft at($offset) + */ +class CompanyDraftCollection extends BusinessUnitDraftCollection +{ + /** + * @psalm-assert CompanyDraft $value + * @psalm-param CompanyDraft|stdClass $value + * @throws InvalidArgumentException + * + * @return CompanyDraftCollection + */ + public function add($value) + { + if (!$value instanceof CompanyDraft) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CompanyDraft + */ + protected function mapper() + { + return function (?int $index): ?CompanyDraft { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CompanyDraft $data */ + $data = CompanyDraftModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/CompanyDraftModel.php b/lib/commercetools-api/src/Models/BusinessUnit/CompanyDraftModel.php new file mode 100644 index 00000000000..bc7c7ea6023 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/CompanyDraftModel.php @@ -0,0 +1,538 @@ +key = $key; + $this->status = $status; + $this->stores = $stores; + $this->storeMode = $storeMode; + $this->name = $name; + $this->contactEmail = $contactEmail; + $this->associates = $associates; + $this->addresses = $addresses; + $this->shippingAddresses = $shippingAddresses; + $this->defaultShipingAddress = $defaultShipingAddress; + $this->billingAddresses = $billingAddresses; + $this->defaultBillingAddress = $defaultBillingAddress; + $this->custom = $custom; + $this->unitType = $unitType ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

User-defined unique identifier for the Business Unit.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + *

Indicates whether the Business Unit can be edited and used in Orders.

+ * + * + * @return null|string + */ + public function getStatus() + { + if (is_null($this->status)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STATUS); + if (is_null($data)) { + return null; + } + $this->status = (string) $data; + } + + return $this->status; + } + + /** + *

References to Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. + * If not empty, the Business Unit can only be linked to Carts and Orders of a referenced Store. + * If empty, the Business Unit can only create Carts, Orders, or Quotes that have no store value. + * Defaults to empty for Companies and not set for Divisions.

+ * + * + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STORES); + if (is_null($data)) { + return null; + } + $this->stores = StoreKeyReferenceCollection::fromArray($data); + } + + return $this->stores; + } + + /** + *

Defines whether the Stores of the Business Unit are set on the Business Unit or are inherited from a parent. + * Defaults to Explicit for Companies and to FromParent for Divisions.

+ * + * + * @return null|string + */ + public function getStoreMode() + { + if (is_null($this->storeMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STORE_MODE); + if (is_null($data)) { + return null; + } + $this->storeMode = (string) $data; + } + + return $this->storeMode; + } + + /** + *

Type of the Business Unit indicating its position in a hierarchy.

+ * + * + * @return null|string + */ + public function getUnitType() + { + if (is_null($this->unitType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_UNIT_TYPE); + if (is_null($data)) { + return null; + } + $this->unitType = (string) $data; + } + + return $this->unitType; + } + + /** + *

Name of the Business Unit.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

Email address of the Business Unit.

+ * + * + * @return null|string + */ + public function getContactEmail() + { + if (is_null($this->contactEmail)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CONTACT_EMAIL); + if (is_null($data)) { + return null; + } + $this->contactEmail = (string) $data; + } + + return $this->contactEmail; + } + + /** + *

List of members that are part of the Business Unit in specific roles.

+ * + * + * @return null|AssociateDraftCollection + */ + public function getAssociates() + { + if (is_null($this->associates)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ASSOCIATES); + if (is_null($data)) { + return null; + } + $this->associates = AssociateDraftCollection::fromArray($data); + } + + return $this->associates; + } + + /** + *

Addresses used by the Business Unit.

+ * + * + * @return null|BaseAddressCollection + */ + public function getAddresses() + { + if (is_null($this->addresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->addresses = BaseAddressCollection::fromArray($data); + } + + return $this->addresses; + } + + /** + *

Indexes of entries in addresses to set as shipping addresses. + * The shippingAddressIds of the Customer will be replaced by these addresses.

+ * + * + * @return null|array + */ + public function getShippingAddresses() + { + if (is_null($this->shippingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SHIPPING_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->shippingAddresses = $data; + } + + return $this->shippingAddresses; + } + + /** + *

Index of the entry in addresses to set as the default shipping address.

+ * + * + * @return null|int + */ + public function getDefaultShipingAddress() + { + if (is_null($this->defaultShipingAddress)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_DEFAULT_SHIPING_ADDRESS); + if (is_null($data)) { + return null; + } + $this->defaultShipingAddress = (int) $data; + } + + return $this->defaultShipingAddress; + } + + /** + *

Indexes of entries in addresses to set as billing addresses. + * The billingAddressIds of the Customer will be replaced by these addresses.

+ * + * + * @return null|array + */ + public function getBillingAddresses() + { + if (is_null($this->billingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_BILLING_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->billingAddresses = $data; + } + + return $this->billingAddresses; + } + + /** + *

Index of the entry in addresses to set as the default billing address.

+ * + * + * @return null|int + */ + public function getDefaultBillingAddress() + { + if (is_null($this->defaultBillingAddress)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_DEFAULT_BILLING_ADDRESS); + if (is_null($data)) { + return null; + } + $this->defaultBillingAddress = (int) $data; + } + + return $this->defaultBillingAddress; + } + + /** + *

Custom Fields for the Business Unit.

+ * + * + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomFieldsDraftModel::of($data); + } + + return $this->custom; + } + + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + + /** + * @param ?string $status + */ + public function setStatus(?string $status): void + { + $this->status = $status; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void + { + $this->stores = $stores; + } + + /** + * @param ?string $storeMode + */ + public function setStoreMode(?string $storeMode): void + { + $this->storeMode = $storeMode; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void + { + $this->contactEmail = $contactEmail; + } + + /** + * @param ?AssociateDraftCollection $associates + */ + public function setAssociates(?AssociateDraftCollection $associates): void + { + $this->associates = $associates; + } + + /** + * @param ?BaseAddressCollection $addresses + */ + public function setAddresses(?BaseAddressCollection $addresses): void + { + $this->addresses = $addresses; + } + + /** + * @param ?array $shippingAddresses + */ + public function setShippingAddresses(?array $shippingAddresses): void + { + $this->shippingAddresses = $shippingAddresses; + } + + /** + * @param ?int $defaultShipingAddress + */ + public function setDefaultShipingAddress(?int $defaultShipingAddress): void + { + $this->defaultShipingAddress = $defaultShipingAddress; + } + + /** + * @param ?array $billingAddresses + */ + public function setBillingAddresses(?array $billingAddresses): void + { + $this->billingAddresses = $billingAddresses; + } + + /** + * @param ?int $defaultBillingAddress + */ + public function setDefaultBillingAddress(?int $defaultBillingAddress): void + { + $this->defaultBillingAddress = $defaultBillingAddress; + } + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void + { + $this->custom = $custom; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/CompanyModel.php b/lib/commercetools-api/src/Models/BusinessUnit/CompanyModel.php new file mode 100644 index 00000000000..aade34d3e53 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/CompanyModel.php @@ -0,0 +1,855 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->key = $key; + $this->status = $status; + $this->stores = $stores; + $this->storeMode = $storeMode; + $this->name = $name; + $this->contactEmail = $contactEmail; + $this->custom = $custom; + $this->addresses = $addresses; + $this->shippingAddressIds = $shippingAddressIds; + $this->defaultShipingAddressId = $defaultShipingAddressId; + $this->billingAddressIds = $billingAddressIds; + $this->defaultBillingAddressId = $defaultBillingAddressId; + $this->associates = $associates; + $this->parentUnit = $parentUnit; + $this->topLevelUnit = $topLevelUnit; + $this->unitType = $unitType ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Business Unit.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Current version of the Business Unit.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Business Unit was initially created.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Date and time (UTC) the Business Unit was last updated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Present on resources updated after 1 February 2019 except for events not tracked.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

User-defined unique identifier of the Business Unit.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + *

Indicates whether the Business Unit can be edited and used in Orders.

+ * + * + * @return null|string + */ + public function getStatus() + { + if (is_null($this->status)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STATUS); + if (is_null($data)) { + return null; + } + $this->status = (string) $data; + } + + return $this->status; + } + + /** + *

References to Stores the Business Unit is associated with. + * If empty, the Business Unit can only create Carts, Orders, or Quotes that have no store value. + * If not empty, the Business Unit can only be linked to Carts and Orders of a referenced Store. + * Only present when storeMode is Explicit.

+ * + * + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STORES); + if (is_null($data)) { + return null; + } + $this->stores = StoreKeyReferenceCollection::fromArray($data); + } + + return $this->stores; + } + + /** + *

Is always Explicit since a Company does not have a parent Business Unit the Stores can be inherited from.

+ * + * + * @return null|string + */ + public function getStoreMode() + { + if (is_null($this->storeMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STORE_MODE); + if (is_null($data)) { + return null; + } + $this->storeMode = (string) $data; + } + + return $this->storeMode; + } + + /** + *

Type of the Business Unit indicating its position in a hierarchy.

+ * + * + * @return null|string + */ + public function getUnitType() + { + if (is_null($this->unitType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_UNIT_TYPE); + if (is_null($data)) { + return null; + } + $this->unitType = (string) $data; + } + + return $this->unitType; + } + + /** + *

Name of the Business Unit.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

Email address of the Business Unit.

+ * + * + * @return null|string + */ + public function getContactEmail() + { + if (is_null($this->contactEmail)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CONTACT_EMAIL); + if (is_null($data)) { + return null; + } + $this->contactEmail = (string) $data; + } + + return $this->contactEmail; + } + + /** + *

Custom Fields for the Business Unit.

+ * + * + * @return null|CustomFields + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomFieldsModel::of($data); + } + + return $this->custom; + } + + /** + *

Addresses used by the Business Unit.

+ * + * + * @return null|AddressCollection + */ + public function getAddresses() + { + if (is_null($this->addresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->addresses = AddressCollection::fromArray($data); + } + + return $this->addresses; + } + + /** + *

Unique identifiers of addresses used as shipping addresses.

+ * + * + * @return null|array + */ + public function getShippingAddressIds() + { + if (is_null($this->shippingAddressIds)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SHIPPING_ADDRESS_IDS); + if (is_null($data)) { + return null; + } + $this->shippingAddressIds = $data; + } + + return $this->shippingAddressIds; + } + + /** + *

Unique identifier of the address used as the default shipping address.

+ * + * + * @return null|string + */ + public function getDefaultShipingAddressId() + { + if (is_null($this->defaultShipingAddressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_DEFAULT_SHIPING_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->defaultShipingAddressId = (string) $data; + } + + return $this->defaultShipingAddressId; + } + + /** + *

Unique identifiers of addresses used as billing addresses.

+ * + * + * @return null|array + */ + public function getBillingAddressIds() + { + if (is_null($this->billingAddressIds)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_BILLING_ADDRESS_IDS); + if (is_null($data)) { + return null; + } + $this->billingAddressIds = $data; + } + + return $this->billingAddressIds; + } + + /** + *

Unique identifier of the address used as the default billing address.

+ * + * + * @return null|string + */ + public function getDefaultBillingAddressId() + { + if (is_null($this->defaultBillingAddressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_DEFAULT_BILLING_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->defaultBillingAddressId = (string) $data; + } + + return $this->defaultBillingAddressId; + } + + /** + *

Members that are part of the Business Unit in specific roles.

+ * + * + * @return null|AssociateCollection + */ + public function getAssociates() + { + if (is_null($this->associates)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ASSOCIATES); + if (is_null($data)) { + return null; + } + $this->associates = AssociateCollection::fromArray($data); + } + + return $this->associates; + } + + /** + *

Parent unit of the Business Unit. Only present when the unitType is Division.

+ * + * + * @return null|BusinessUnitKeyReference + */ + public function getParentUnit() + { + if (is_null($this->parentUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_PARENT_UNIT); + if (is_null($data)) { + return null; + } + + $this->parentUnit = BusinessUnitKeyReferenceModel::of($data); + } + + return $this->parentUnit; + } + + /** + *

Top-level unit of the Business Unit. The top-level unit is of unitType Company.

+ * + * + * @return null|BusinessUnitKeyReference + */ + public function getTopLevelUnit() + { + if (is_null($this->topLevelUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TOP_LEVEL_UNIT); + if (is_null($data)) { + return null; + } + + $this->topLevelUnit = BusinessUnitKeyReferenceModel::of($data); + } + + return $this->topLevelUnit; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + + /** + * @param ?string $status + */ + public function setStatus(?string $status): void + { + $this->status = $status; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void + { + $this->stores = $stores; + } + + /** + * @param ?string $storeMode + */ + public function setStoreMode(?string $storeMode): void + { + $this->storeMode = $storeMode; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void + { + $this->contactEmail = $contactEmail; + } + + /** + * @param ?CustomFields $custom + */ + public function setCustom(?CustomFields $custom): void + { + $this->custom = $custom; + } + + /** + * @param ?AddressCollection $addresses + */ + public function setAddresses(?AddressCollection $addresses): void + { + $this->addresses = $addresses; + } + + /** + * @param ?array $shippingAddressIds + */ + public function setShippingAddressIds(?array $shippingAddressIds): void + { + $this->shippingAddressIds = $shippingAddressIds; + } + + /** + * @param ?string $defaultShipingAddressId + */ + public function setDefaultShipingAddressId(?string $defaultShipingAddressId): void + { + $this->defaultShipingAddressId = $defaultShipingAddressId; + } + + /** + * @param ?array $billingAddressIds + */ + public function setBillingAddressIds(?array $billingAddressIds): void + { + $this->billingAddressIds = $billingAddressIds; + } + + /** + * @param ?string $defaultBillingAddressId + */ + public function setDefaultBillingAddressId(?string $defaultBillingAddressId): void + { + $this->defaultBillingAddressId = $defaultBillingAddressId; + } + + /** + * @param ?AssociateCollection $associates + */ + public function setAssociates(?AssociateCollection $associates): void + { + $this->associates = $associates; + } + + /** + * @param ?BusinessUnitKeyReference $parentUnit + */ + public function setParentUnit(?BusinessUnitKeyReference $parentUnit): void + { + $this->parentUnit = $parentUnit; + } + + /** + * @param ?BusinessUnitKeyReference $topLevelUnit + */ + public function setTopLevelUnit(?BusinessUnitKeyReference $topLevelUnit): void + { + $this->topLevelUnit = $topLevelUnit; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[BusinessUnit::FIELD_CREATED_AT]) && $data[BusinessUnit::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[BusinessUnit::FIELD_CREATED_AT] = $data[BusinessUnit::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[BusinessUnit::FIELD_LAST_MODIFIED_AT]) && $data[BusinessUnit::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[BusinessUnit::FIELD_LAST_MODIFIED_AT] = $data[BusinessUnit::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/Division.php b/lib/commercetools-api/src/Models/BusinessUnit/Division.php new file mode 100644 index 00000000000..dfaa34d429c --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/Division.php @@ -0,0 +1,41 @@ +Parent unit of the Division.

+ * + + * @return null|BusinessUnitKeyReference + */ + public function getParentUnit(); + + /** + *

Defines whether the Stores of the Division are set explicitly or inherited from a parent Business Unit.

+ * + + * @return null|string + */ + public function getStoreMode(); + + /** + * @param ?BusinessUnitKeyReference $parentUnit + */ + public function setParentUnit(?BusinessUnitKeyReference $parentUnit): void; + + /** + * @param ?string $storeMode + */ + public function setStoreMode(?string $storeMode): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/DivisionBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/DivisionBuilder.php new file mode 100644 index 00000000000..d77ead0e338 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/DivisionBuilder.php @@ -0,0 +1,709 @@ + + */ +final class DivisionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?string + */ + private $key; + + /** + + * @var ?string + */ + private $status; + + /** + + * @var ?StoreKeyReferenceCollection + */ + private $stores; + + /** + + * @var ?string + */ + private $storeMode; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var ?string + */ + private $contactEmail; + + /** + + * @var null|CustomFields|CustomFieldsBuilder + */ + private $custom; + + /** + + * @var ?AddressCollection + */ + private $addresses; + + /** + + * @var ?array + */ + private $shippingAddressIds; + + /** + + * @var ?string + */ + private $defaultShipingAddressId; + + /** + + * @var ?array + */ + private $billingAddressIds; + + /** + + * @var ?string + */ + private $defaultBillingAddressId; + + /** + + * @var ?AssociateCollection + */ + private $associates; + + /** + + * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + */ + private $parentUnit; + + /** + + * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + */ + private $topLevelUnit; + + /** + *

Unique identifier of the Business Unit.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Current version of the Business Unit.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Business Unit was initially created.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Date and time (UTC) the Business Unit was last updated.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Present on resources updated after 1 February 2019 except for events not tracked.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

User-defined unique identifier of the Business Unit.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + *

Indicates whether the Business Unit can be edited and used in Orders.

+ * + + * @return null|string + */ + public function getStatus() + { + return $this->status; + } + + /** + *

References to Stores the Business Unit is associated with. + * If empty, the Business Unit can only create Carts, Orders, or Quotes that have no store value. + * If not empty, the Business Unit can only be linked to Carts and Orders of a referenced Store. + * Only present when storeMode is Explicit.

+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + *

Defines whether the Stores of the Division are set explicitly or inherited from a parent Business Unit.

+ * + + * @return null|string + */ + public function getStoreMode() + { + return $this->storeMode; + } + + /** + *

Name of the Business Unit.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

Email address of the Business Unit.

+ * + + * @return null|string + */ + public function getContactEmail() + { + return $this->contactEmail; + } + + /** + *

Custom Fields for the Business Unit.

+ * + + * @return null|CustomFields + */ + public function getCustom() + { + return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; + } + + /** + *

Addresses used by the Business Unit.

+ * + + * @return null|AddressCollection + */ + public function getAddresses() + { + return $this->addresses; + } + + /** + *

Unique identifiers of addresses used as shipping addresses.

+ * + + * @return null|array + */ + public function getShippingAddressIds() + { + return $this->shippingAddressIds; + } + + /** + *

Unique identifier of the address used as the default shipping address.

+ * + + * @return null|string + */ + public function getDefaultShipingAddressId() + { + return $this->defaultShipingAddressId; + } + + /** + *

Unique identifiers of addresses used as billing addresses.

+ * + + * @return null|array + */ + public function getBillingAddressIds() + { + return $this->billingAddressIds; + } + + /** + *

Unique identifier of the address used as the default billing address.

+ * + + * @return null|string + */ + public function getDefaultBillingAddressId() + { + return $this->defaultBillingAddressId; + } + + /** + *

Members that are part of the Business Unit in specific roles.

+ * + + * @return null|AssociateCollection + */ + public function getAssociates() + { + return $this->associates; + } + + /** + *

Parent unit of the Division.

+ * + + * @return null|BusinessUnitKeyReference + */ + public function getParentUnit() + { + return $this->parentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->parentUnit->build() : $this->parentUnit; + } + + /** + *

Top-level unit of the Business Unit. The top-level unit is of unitType Company.

+ * + + * @return null|BusinessUnitKeyReference + */ + public function getTopLevelUnit() + { + return $this->topLevelUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->topLevelUnit->build() : $this->topLevelUnit; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?string $status + * @return $this + */ + public function withStatus(?string $status) + { + $this->status = $status; + + return $this; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + * @return $this + */ + public function withStores(?StoreKeyReferenceCollection $stores) + { + $this->stores = $stores; + + return $this; + } + + /** + * @param ?string $storeMode + * @return $this + */ + public function withStoreMode(?string $storeMode) + { + $this->storeMode = $storeMode; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param ?string $contactEmail + * @return $this + */ + public function withContactEmail(?string $contactEmail) + { + $this->contactEmail = $contactEmail; + + return $this; + } + + /** + * @param ?CustomFields $custom + * @return $this + */ + public function withCustom(?CustomFields $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @param ?AddressCollection $addresses + * @return $this + */ + public function withAddresses(?AddressCollection $addresses) + { + $this->addresses = $addresses; + + return $this; + } + + /** + * @param ?array $shippingAddressIds + * @return $this + */ + public function withShippingAddressIds(?array $shippingAddressIds) + { + $this->shippingAddressIds = $shippingAddressIds; + + return $this; + } + + /** + * @param ?string $defaultShipingAddressId + * @return $this + */ + public function withDefaultShipingAddressId(?string $defaultShipingAddressId) + { + $this->defaultShipingAddressId = $defaultShipingAddressId; + + return $this; + } + + /** + * @param ?array $billingAddressIds + * @return $this + */ + public function withBillingAddressIds(?array $billingAddressIds) + { + $this->billingAddressIds = $billingAddressIds; + + return $this; + } + + /** + * @param ?string $defaultBillingAddressId + * @return $this + */ + public function withDefaultBillingAddressId(?string $defaultBillingAddressId) + { + $this->defaultBillingAddressId = $defaultBillingAddressId; + + return $this; + } + + /** + * @param ?AssociateCollection $associates + * @return $this + */ + public function withAssociates(?AssociateCollection $associates) + { + $this->associates = $associates; + + return $this; + } + + /** + * @param ?BusinessUnitKeyReference $parentUnit + * @return $this + */ + public function withParentUnit(?BusinessUnitKeyReference $parentUnit) + { + $this->parentUnit = $parentUnit; + + return $this; + } + + /** + * @param ?BusinessUnitKeyReference $topLevelUnit + * @return $this + */ + public function withTopLevelUnit(?BusinessUnitKeyReference $topLevelUnit) + { + $this->topLevelUnit = $topLevelUnit; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @deprecated use withParentUnit() instead + * @return $this + */ + public function withParentUnitBuilder(?BusinessUnitKeyReferenceBuilder $parentUnit) + { + $this->parentUnit = $parentUnit; + + return $this; + } + + /** + * @deprecated use withTopLevelUnit() instead + * @return $this + */ + public function withTopLevelUnitBuilder(?BusinessUnitKeyReferenceBuilder $topLevelUnit) + { + $this->topLevelUnit = $topLevelUnit; + + return $this; + } + + public function build(): Division + { + return new DivisionModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->key, + $this->status, + $this->stores, + $this->storeMode, + $this->name, + $this->contactEmail, + $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, + $this->addresses, + $this->shippingAddressIds, + $this->defaultShipingAddressId, + $this->billingAddressIds, + $this->defaultBillingAddressId, + $this->associates, + $this->parentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->parentUnit->build() : $this->parentUnit, + $this->topLevelUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->topLevelUnit->build() : $this->topLevelUnit + ); + } + + public static function of(): DivisionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/DivisionCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/DivisionCollection.php new file mode 100644 index 00000000000..07ea6bc0bf2 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/DivisionCollection.php @@ -0,0 +1,56 @@ + + * @method Division current() + * @method Division end() + * @method Division at($offset) + */ +class DivisionCollection extends BusinessUnitCollection +{ + /** + * @psalm-assert Division $value + * @psalm-param Division|stdClass $value + * @throws InvalidArgumentException + * + * @return DivisionCollection + */ + public function add($value) + { + if (!$value instanceof Division) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?Division + */ + protected function mapper() + { + return function (?int $index): ?Division { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var Division $data */ + $data = DivisionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/DivisionDraft.php b/lib/commercetools-api/src/Models/BusinessUnit/DivisionDraft.php new file mode 100644 index 00000000000..8201e339d7a --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/DivisionDraft.php @@ -0,0 +1,44 @@ +The parent unit of this Division. Can be a Company or a Division.

+ * + + * @return null|BusinessUnitResourceIdentifier + */ + public function getParentUnit(); + + /** + *

If not set, the Division inherits the Stores from its parentUnit. + * Set this to Explicit if you want to set the Stores explicitly in the stores field instead.

+ * + + * @return null|string + */ + public function getStoreMode(); + + /** + * @param ?BusinessUnitResourceIdentifier $parentUnit + */ + public function setParentUnit(?BusinessUnitResourceIdentifier $parentUnit): void; + + /** + * @param ?string $storeMode + */ + public function setStoreMode(?string $storeMode): void; +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/DivisionDraftBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/DivisionDraftBuilder.php new file mode 100644 index 00000000000..0088445c2f1 --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/DivisionDraftBuilder.php @@ -0,0 +1,471 @@ + + */ +final class DivisionDraftBuilder implements Builder +{ + /** + + * @var ?string + */ + private $key; + + /** + + * @var ?string + */ + private $status; + + /** + + * @var ?StoreKeyReferenceCollection + */ + private $stores; + + /** + + * @var ?string + */ + private $storeMode; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var ?string + */ + private $contactEmail; + + /** + + * @var ?AssociateDraftCollection + */ + private $associates; + + /** + + * @var ?BaseAddressCollection + */ + private $addresses; + + /** + + * @var ?array + */ + private $shippingAddresses; + + /** + + * @var ?int + */ + private $defaultShipingAddress; + + /** + + * @var ?array + */ + private $billingAddresses; + + /** + + * @var ?int + */ + private $defaultBillingAddress; + + /** + + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + */ + private $custom; + + /** + + * @var null|BusinessUnitResourceIdentifier|BusinessUnitResourceIdentifierBuilder + */ + private $parentUnit; + + /** + *

User-defined unique identifier for the Business Unit.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + *

Indicates whether the Business Unit can be edited and used in Orders.

+ * + + * @return null|string + */ + public function getStatus() + { + return $this->status; + } + + /** + *

References to Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. + * If not empty, the Business Unit can only be linked to Carts and Orders of a referenced Store. + * If empty, the Business Unit can only create Carts, Orders, or Quotes that have no store value. + * Defaults to empty for Companies and not set for Divisions.

+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + *

If not set, the Division inherits the Stores from its parentUnit. + * Set this to Explicit if you want to set the Stores explicitly in the stores field instead.

+ * + + * @return null|string + */ + public function getStoreMode() + { + return $this->storeMode; + } + + /** + *

Name of the Business Unit.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

Email address of the Business Unit.

+ * + + * @return null|string + */ + public function getContactEmail() + { + return $this->contactEmail; + } + + /** + *

List of members that are part of the Business Unit in specific roles.

+ * + + * @return null|AssociateDraftCollection + */ + public function getAssociates() + { + return $this->associates; + } + + /** + *

Addresses used by the Business Unit.

+ * + + * @return null|BaseAddressCollection + */ + public function getAddresses() + { + return $this->addresses; + } + + /** + *

Indexes of entries in addresses to set as shipping addresses. + * The shippingAddressIds of the Customer will be replaced by these addresses.

+ * + + * @return null|array + */ + public function getShippingAddresses() + { + return $this->shippingAddresses; + } + + /** + *

Index of the entry in addresses to set as the default shipping address.

+ * + + * @return null|int + */ + public function getDefaultShipingAddress() + { + return $this->defaultShipingAddress; + } + + /** + *

Indexes of entries in addresses to set as billing addresses. + * The billingAddressIds of the Customer will be replaced by these addresses.

+ * + + * @return null|array + */ + public function getBillingAddresses() + { + return $this->billingAddresses; + } + + /** + *

Index of the entry in addresses to set as the default billing address.

+ * + + * @return null|int + */ + public function getDefaultBillingAddress() + { + return $this->defaultBillingAddress; + } + + /** + *

Custom Fields for the Business Unit.

+ * + + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; + } + + /** + *

The parent unit of this Division. Can be a Company or a Division.

+ * + + * @return null|BusinessUnitResourceIdentifier + */ + public function getParentUnit() + { + return $this->parentUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->parentUnit->build() : $this->parentUnit; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?string $status + * @return $this + */ + public function withStatus(?string $status) + { + $this->status = $status; + + return $this; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + * @return $this + */ + public function withStores(?StoreKeyReferenceCollection $stores) + { + $this->stores = $stores; + + return $this; + } + + /** + * @param ?string $storeMode + * @return $this + */ + public function withStoreMode(?string $storeMode) + { + $this->storeMode = $storeMode; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param ?string $contactEmail + * @return $this + */ + public function withContactEmail(?string $contactEmail) + { + $this->contactEmail = $contactEmail; + + return $this; + } + + /** + * @param ?AssociateDraftCollection $associates + * @return $this + */ + public function withAssociates(?AssociateDraftCollection $associates) + { + $this->associates = $associates; + + return $this; + } + + /** + * @param ?BaseAddressCollection $addresses + * @return $this + */ + public function withAddresses(?BaseAddressCollection $addresses) + { + $this->addresses = $addresses; + + return $this; + } + + /** + * @param ?array $shippingAddresses + * @return $this + */ + public function withShippingAddresses(?array $shippingAddresses) + { + $this->shippingAddresses = $shippingAddresses; + + return $this; + } + + /** + * @param ?int $defaultShipingAddress + * @return $this + */ + public function withDefaultShipingAddress(?int $defaultShipingAddress) + { + $this->defaultShipingAddress = $defaultShipingAddress; + + return $this; + } + + /** + * @param ?array $billingAddresses + * @return $this + */ + public function withBillingAddresses(?array $billingAddresses) + { + $this->billingAddresses = $billingAddresses; + + return $this; + } + + /** + * @param ?int $defaultBillingAddress + * @return $this + */ + public function withDefaultBillingAddress(?int $defaultBillingAddress) + { + $this->defaultBillingAddress = $defaultBillingAddress; + + return $this; + } + + /** + * @param ?CustomFieldsDraft $custom + * @return $this + */ + public function withCustom(?CustomFieldsDraft $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @param ?BusinessUnitResourceIdentifier $parentUnit + * @return $this + */ + public function withParentUnit(?BusinessUnitResourceIdentifier $parentUnit) + { + $this->parentUnit = $parentUnit; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @deprecated use withParentUnit() instead + * @return $this + */ + public function withParentUnitBuilder(?BusinessUnitResourceIdentifierBuilder $parentUnit) + { + $this->parentUnit = $parentUnit; + + return $this; + } + + public function build(): DivisionDraft + { + return new DivisionDraftModel( + $this->key, + $this->status, + $this->stores, + $this->storeMode, + $this->name, + $this->contactEmail, + $this->associates, + $this->addresses, + $this->shippingAddresses, + $this->defaultShipingAddress, + $this->billingAddresses, + $this->defaultBillingAddress, + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, + $this->parentUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->parentUnit->build() : $this->parentUnit + ); + } + + public static function of(): DivisionDraftBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/DivisionDraftCollection.php b/lib/commercetools-api/src/Models/BusinessUnit/DivisionDraftCollection.php new file mode 100644 index 00000000000..56b03a49e8d --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/DivisionDraftCollection.php @@ -0,0 +1,56 @@ + + * @method DivisionDraft current() + * @method DivisionDraft end() + * @method DivisionDraft at($offset) + */ +class DivisionDraftCollection extends BusinessUnitDraftCollection +{ + /** + * @psalm-assert DivisionDraft $value + * @psalm-param DivisionDraft|stdClass $value + * @throws InvalidArgumentException + * + * @return DivisionDraftCollection + */ + public function add($value) + { + if (!$value instanceof DivisionDraft) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?DivisionDraft + */ + protected function mapper() + { + return function (?int $index): ?DivisionDraft { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var DivisionDraft $data */ + $data = DivisionDraftModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/DivisionDraftModel.php b/lib/commercetools-api/src/Models/BusinessUnit/DivisionDraftModel.php new file mode 100644 index 00000000000..a443123ef7a --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/DivisionDraftModel.php @@ -0,0 +1,575 @@ +key = $key; + $this->status = $status; + $this->stores = $stores; + $this->storeMode = $storeMode; + $this->name = $name; + $this->contactEmail = $contactEmail; + $this->associates = $associates; + $this->addresses = $addresses; + $this->shippingAddresses = $shippingAddresses; + $this->defaultShipingAddress = $defaultShipingAddress; + $this->billingAddresses = $billingAddresses; + $this->defaultBillingAddress = $defaultBillingAddress; + $this->custom = $custom; + $this->parentUnit = $parentUnit; + $this->unitType = $unitType ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

User-defined unique identifier for the Business Unit.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + *

Indicates whether the Business Unit can be edited and used in Orders.

+ * + * + * @return null|string + */ + public function getStatus() + { + if (is_null($this->status)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STATUS); + if (is_null($data)) { + return null; + } + $this->status = (string) $data; + } + + return $this->status; + } + + /** + *

References to Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. + * If not empty, the Business Unit can only be linked to Carts and Orders of a referenced Store. + * If empty, the Business Unit can only create Carts, Orders, or Quotes that have no store value. + * Defaults to empty for Companies and not set for Divisions.

+ * + * + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STORES); + if (is_null($data)) { + return null; + } + $this->stores = StoreKeyReferenceCollection::fromArray($data); + } + + return $this->stores; + } + + /** + *

If not set, the Division inherits the Stores from its parentUnit. + * Set this to Explicit if you want to set the Stores explicitly in the stores field instead.

+ * + * + * @return null|string + */ + public function getStoreMode() + { + if (is_null($this->storeMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STORE_MODE); + if (is_null($data)) { + return null; + } + $this->storeMode = (string) $data; + } + + return $this->storeMode; + } + + /** + *

Type of the Business Unit indicating its position in a hierarchy.

+ * + * + * @return null|string + */ + public function getUnitType() + { + if (is_null($this->unitType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_UNIT_TYPE); + if (is_null($data)) { + return null; + } + $this->unitType = (string) $data; + } + + return $this->unitType; + } + + /** + *

Name of the Business Unit.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

Email address of the Business Unit.

+ * + * + * @return null|string + */ + public function getContactEmail() + { + if (is_null($this->contactEmail)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CONTACT_EMAIL); + if (is_null($data)) { + return null; + } + $this->contactEmail = (string) $data; + } + + return $this->contactEmail; + } + + /** + *

List of members that are part of the Business Unit in specific roles.

+ * + * + * @return null|AssociateDraftCollection + */ + public function getAssociates() + { + if (is_null($this->associates)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ASSOCIATES); + if (is_null($data)) { + return null; + } + $this->associates = AssociateDraftCollection::fromArray($data); + } + + return $this->associates; + } + + /** + *

Addresses used by the Business Unit.

+ * + * + * @return null|BaseAddressCollection + */ + public function getAddresses() + { + if (is_null($this->addresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->addresses = BaseAddressCollection::fromArray($data); + } + + return $this->addresses; + } + + /** + *

Indexes of entries in addresses to set as shipping addresses. + * The shippingAddressIds of the Customer will be replaced by these addresses.

+ * + * + * @return null|array + */ + public function getShippingAddresses() + { + if (is_null($this->shippingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SHIPPING_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->shippingAddresses = $data; + } + + return $this->shippingAddresses; + } + + /** + *

Index of the entry in addresses to set as the default shipping address.

+ * + * + * @return null|int + */ + public function getDefaultShipingAddress() + { + if (is_null($this->defaultShipingAddress)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_DEFAULT_SHIPING_ADDRESS); + if (is_null($data)) { + return null; + } + $this->defaultShipingAddress = (int) $data; + } + + return $this->defaultShipingAddress; + } + + /** + *

Indexes of entries in addresses to set as billing addresses. + * The billingAddressIds of the Customer will be replaced by these addresses.

+ * + * + * @return null|array + */ + public function getBillingAddresses() + { + if (is_null($this->billingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_BILLING_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->billingAddresses = $data; + } + + return $this->billingAddresses; + } + + /** + *

Index of the entry in addresses to set as the default billing address.

+ * + * + * @return null|int + */ + public function getDefaultBillingAddress() + { + if (is_null($this->defaultBillingAddress)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_DEFAULT_BILLING_ADDRESS); + if (is_null($data)) { + return null; + } + $this->defaultBillingAddress = (int) $data; + } + + return $this->defaultBillingAddress; + } + + /** + *

Custom Fields for the Business Unit.

+ * + * + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomFieldsDraftModel::of($data); + } + + return $this->custom; + } + + /** + *

The parent unit of this Division. Can be a Company or a Division.

+ * + * + * @return null|BusinessUnitResourceIdentifier + */ + public function getParentUnit() + { + if (is_null($this->parentUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_PARENT_UNIT); + if (is_null($data)) { + return null; + } + + $this->parentUnit = BusinessUnitResourceIdentifierModel::of($data); + } + + return $this->parentUnit; + } + + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + + /** + * @param ?string $status + */ + public function setStatus(?string $status): void + { + $this->status = $status; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void + { + $this->stores = $stores; + } + + /** + * @param ?string $storeMode + */ + public function setStoreMode(?string $storeMode): void + { + $this->storeMode = $storeMode; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void + { + $this->contactEmail = $contactEmail; + } + + /** + * @param ?AssociateDraftCollection $associates + */ + public function setAssociates(?AssociateDraftCollection $associates): void + { + $this->associates = $associates; + } + + /** + * @param ?BaseAddressCollection $addresses + */ + public function setAddresses(?BaseAddressCollection $addresses): void + { + $this->addresses = $addresses; + } + + /** + * @param ?array $shippingAddresses + */ + public function setShippingAddresses(?array $shippingAddresses): void + { + $this->shippingAddresses = $shippingAddresses; + } + + /** + * @param ?int $defaultShipingAddress + */ + public function setDefaultShipingAddress(?int $defaultShipingAddress): void + { + $this->defaultShipingAddress = $defaultShipingAddress; + } + + /** + * @param ?array $billingAddresses + */ + public function setBillingAddresses(?array $billingAddresses): void + { + $this->billingAddresses = $billingAddresses; + } + + /** + * @param ?int $defaultBillingAddress + */ + public function setDefaultBillingAddress(?int $defaultBillingAddress): void + { + $this->defaultBillingAddress = $defaultBillingAddress; + } + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void + { + $this->custom = $custom; + } + + /** + * @param ?BusinessUnitResourceIdentifier $parentUnit + */ + public function setParentUnit(?BusinessUnitResourceIdentifier $parentUnit): void + { + $this->parentUnit = $parentUnit; + } +} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/DivisionModel.php b/lib/commercetools-api/src/Models/BusinessUnit/DivisionModel.php new file mode 100644 index 00000000000..006e390e1cd --- /dev/null +++ b/lib/commercetools-api/src/Models/BusinessUnit/DivisionModel.php @@ -0,0 +1,855 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->key = $key; + $this->status = $status; + $this->stores = $stores; + $this->storeMode = $storeMode; + $this->name = $name; + $this->contactEmail = $contactEmail; + $this->custom = $custom; + $this->addresses = $addresses; + $this->shippingAddressIds = $shippingAddressIds; + $this->defaultShipingAddressId = $defaultShipingAddressId; + $this->billingAddressIds = $billingAddressIds; + $this->defaultBillingAddressId = $defaultBillingAddressId; + $this->associates = $associates; + $this->parentUnit = $parentUnit; + $this->topLevelUnit = $topLevelUnit; + $this->unitType = $unitType ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Business Unit.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Current version of the Business Unit.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Business Unit was initially created.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Date and time (UTC) the Business Unit was last updated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Present on resources updated after 1 February 2019 except for events not tracked.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

User-defined unique identifier of the Business Unit.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + *

Indicates whether the Business Unit can be edited and used in Orders.

+ * + * + * @return null|string + */ + public function getStatus() + { + if (is_null($this->status)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STATUS); + if (is_null($data)) { + return null; + } + $this->status = (string) $data; + } + + return $this->status; + } + + /** + *

References to Stores the Business Unit is associated with. + * If empty, the Business Unit can only create Carts, Orders, or Quotes that have no store value. + * If not empty, the Business Unit can only be linked to Carts and Orders of a referenced Store. + * Only present when storeMode is Explicit.

+ * + * + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STORES); + if (is_null($data)) { + return null; + } + $this->stores = StoreKeyReferenceCollection::fromArray($data); + } + + return $this->stores; + } + + /** + *

Defines whether the Stores of the Division are set explicitly or inherited from a parent Business Unit.

+ * + * + * @return null|string + */ + public function getStoreMode() + { + if (is_null($this->storeMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STORE_MODE); + if (is_null($data)) { + return null; + } + $this->storeMode = (string) $data; + } + + return $this->storeMode; + } + + /** + *

Type of the Business Unit indicating its position in a hierarchy.

+ * + * + * @return null|string + */ + public function getUnitType() + { + if (is_null($this->unitType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_UNIT_TYPE); + if (is_null($data)) { + return null; + } + $this->unitType = (string) $data; + } + + return $this->unitType; + } + + /** + *

Name of the Business Unit.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

Email address of the Business Unit.

+ * + * + * @return null|string + */ + public function getContactEmail() + { + if (is_null($this->contactEmail)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CONTACT_EMAIL); + if (is_null($data)) { + return null; + } + $this->contactEmail = (string) $data; + } + + return $this->contactEmail; + } + + /** + *

Custom Fields for the Business Unit.

+ * + * + * @return null|CustomFields + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomFieldsModel::of($data); + } + + return $this->custom; + } + + /** + *

Addresses used by the Business Unit.

+ * + * + * @return null|AddressCollection + */ + public function getAddresses() + { + if (is_null($this->addresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->addresses = AddressCollection::fromArray($data); + } + + return $this->addresses; + } + + /** + *

Unique identifiers of addresses used as shipping addresses.

+ * + * + * @return null|array + */ + public function getShippingAddressIds() + { + if (is_null($this->shippingAddressIds)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SHIPPING_ADDRESS_IDS); + if (is_null($data)) { + return null; + } + $this->shippingAddressIds = $data; + } + + return $this->shippingAddressIds; + } + + /** + *

Unique identifier of the address used as the default shipping address.

+ * + * + * @return null|string + */ + public function getDefaultShipingAddressId() + { + if (is_null($this->defaultShipingAddressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_DEFAULT_SHIPING_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->defaultShipingAddressId = (string) $data; + } + + return $this->defaultShipingAddressId; + } + + /** + *

Unique identifiers of addresses used as billing addresses.

+ * + * + * @return null|array + */ + public function getBillingAddressIds() + { + if (is_null($this->billingAddressIds)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_BILLING_ADDRESS_IDS); + if (is_null($data)) { + return null; + } + $this->billingAddressIds = $data; + } + + return $this->billingAddressIds; + } + + /** + *

Unique identifier of the address used as the default billing address.

+ * + * + * @return null|string + */ + public function getDefaultBillingAddressId() + { + if (is_null($this->defaultBillingAddressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_DEFAULT_BILLING_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->defaultBillingAddressId = (string) $data; + } + + return $this->defaultBillingAddressId; + } + + /** + *

Members that are part of the Business Unit in specific roles.

+ * + * + * @return null|AssociateCollection + */ + public function getAssociates() + { + if (is_null($this->associates)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ASSOCIATES); + if (is_null($data)) { + return null; + } + $this->associates = AssociateCollection::fromArray($data); + } + + return $this->associates; + } + + /** + *

Parent unit of the Division.

+ * + * + * @return null|BusinessUnitKeyReference + */ + public function getParentUnit() + { + if (is_null($this->parentUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_PARENT_UNIT); + if (is_null($data)) { + return null; + } + + $this->parentUnit = BusinessUnitKeyReferenceModel::of($data); + } + + return $this->parentUnit; + } + + /** + *

Top-level unit of the Business Unit. The top-level unit is of unitType Company.

+ * + * + * @return null|BusinessUnitKeyReference + */ + public function getTopLevelUnit() + { + if (is_null($this->topLevelUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TOP_LEVEL_UNIT); + if (is_null($data)) { + return null; + } + + $this->topLevelUnit = BusinessUnitKeyReferenceModel::of($data); + } + + return $this->topLevelUnit; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + + /** + * @param ?string $status + */ + public function setStatus(?string $status): void + { + $this->status = $status; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void + { + $this->stores = $stores; + } + + /** + * @param ?string $storeMode + */ + public function setStoreMode(?string $storeMode): void + { + $this->storeMode = $storeMode; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void + { + $this->contactEmail = $contactEmail; + } + + /** + * @param ?CustomFields $custom + */ + public function setCustom(?CustomFields $custom): void + { + $this->custom = $custom; + } + + /** + * @param ?AddressCollection $addresses + */ + public function setAddresses(?AddressCollection $addresses): void + { + $this->addresses = $addresses; + } + + /** + * @param ?array $shippingAddressIds + */ + public function setShippingAddressIds(?array $shippingAddressIds): void + { + $this->shippingAddressIds = $shippingAddressIds; + } + + /** + * @param ?string $defaultShipingAddressId + */ + public function setDefaultShipingAddressId(?string $defaultShipingAddressId): void + { + $this->defaultShipingAddressId = $defaultShipingAddressId; + } + + /** + * @param ?array $billingAddressIds + */ + public function setBillingAddressIds(?array $billingAddressIds): void + { + $this->billingAddressIds = $billingAddressIds; + } + + /** + * @param ?string $defaultBillingAddressId + */ + public function setDefaultBillingAddressId(?string $defaultBillingAddressId): void + { + $this->defaultBillingAddressId = $defaultBillingAddressId; + } + + /** + * @param ?AssociateCollection $associates + */ + public function setAssociates(?AssociateCollection $associates): void + { + $this->associates = $associates; + } + + /** + * @param ?BusinessUnitKeyReference $parentUnit + */ + public function setParentUnit(?BusinessUnitKeyReference $parentUnit): void + { + $this->parentUnit = $parentUnit; + } + + /** + * @param ?BusinessUnitKeyReference $topLevelUnit + */ + public function setTopLevelUnit(?BusinessUnitKeyReference $topLevelUnit): void + { + $this->topLevelUnit = $topLevelUnit; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[BusinessUnit::FIELD_CREATED_AT]) && $data[BusinessUnit::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[BusinessUnit::FIELD_CREATED_AT] = $data[BusinessUnit::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[BusinessUnit::FIELD_LAST_MODIFIED_AT]) && $data[BusinessUnit::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[BusinessUnit::FIELD_LAST_MODIFIED_AT] = $data[BusinessUnit::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/Cart.php b/lib/commercetools-api/src/Models/Cart/Cart.php index c07ef577703..9f95abd4e32 100644 --- a/lib/commercetools-api/src/Models/Cart/Cart.php +++ b/lib/commercetools-api/src/Models/Cart/Cart.php @@ -8,6 +8,7 @@ namespace Commercetools\Api\Models\Cart; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; use Commercetools\Api\Models\CartDiscount\CartDiscountReferenceCollection; use Commercetools\Api\Models\Common\Address; use Commercetools\Api\Models\Common\AddressCollection; @@ -31,14 +32,18 @@ interface Cart extends BaseResource public const FIELD_CUSTOMER_ID = 'customerId'; public const FIELD_CUSTOMER_EMAIL = 'customerEmail'; public const FIELD_ANONYMOUS_ID = 'anonymousId'; + public const FIELD_BUSINESS_UNIT = 'businessUnit'; public const FIELD_STORE = 'store'; public const FIELD_LINE_ITEMS = 'lineItems'; public const FIELD_CUSTOM_LINE_ITEMS = 'customLineItems'; public const FIELD_TOTAL_PRICE = 'totalPrice'; public const FIELD_TAXED_PRICE = 'taxedPrice'; + public const FIELD_TAXED_SHIPPING_PRICE = 'taxedShippingPrice'; public const FIELD_CART_STATE = 'cartState'; public const FIELD_SHIPPING_ADDRESS = 'shippingAddress'; public const FIELD_BILLING_ADDRESS = 'billingAddress'; + public const FIELD_SHIPPING_MODE = 'shippingMode'; + public const FIELD_SHIPPING = 'shipping'; public const FIELD_INVENTORY_MODE = 'inventoryMode'; public const FIELD_TAX_MODE = 'taxMode'; public const FIELD_TAX_ROUNDING_MODE = 'taxRoundingMode'; @@ -61,6 +66,7 @@ interface Cart extends BaseResource /** *

Unique identifier of the Cart.

* + * @return null|string */ public function getId(); @@ -68,6 +74,7 @@ public function getId(); /** *

User-defined unique identifier of the Cart.

* + * @return null|string */ public function getKey(); @@ -75,16 +82,19 @@ public function getKey(); /** *

The current version of the cart.

* + * @return null|int */ public function getVersion(); /** + * @return null|DateTimeImmutable */ public function getCreatedAt(); /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -92,6 +102,7 @@ public function getLastModifiedAt(); /** *

Present on resources updated after 1 February 2019 except for events not tracked.

* + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -99,16 +110,19 @@ public function getLastModifiedBy(); /** *

Present on resources created after 1 February 2019 except for events not tracked.

* + * @return null|CreatedBy */ public function getCreatedBy(); /** + * @return null|string */ public function getCustomerId(); /** + * @return null|string */ public function getCustomerEmail(); @@ -116,21 +130,33 @@ public function getCustomerEmail(); /** *

Identifies carts and orders belonging to an anonymous session (the customer has not signed up/in yet).

* + * @return null|string */ public function getAnonymousId(); /** + *

The Business Unit the Cart belongs to.

+ * + + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit(); + + /** + * @return null|StoreKeyReference */ public function getStore(); /** + * @return null|LineItemCollection */ public function getLineItems(); /** + * @return null|CustomLineItemCollection */ public function getCustomLineItems(); @@ -139,6 +165,7 @@ public function getCustomLineItems(); *

The sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property of each price.

* + * @return null|TypedMoney */ public function getTotalPrice(); @@ -148,11 +175,22 @@ public function getTotalPrice(); * Will be set automatically in the Platform TaxMode. * For the External tax mode it will be set as soon as the external tax rates for all line items, custom line items, and shipping in the cart are set.

* + * @return null|TaxedPrice */ public function getTaxedPrice(); /** + *

Sum of taxedPrice of ShippingInfo across all Shipping Methods. + * For Platform TaxMode, it is set automatically only if shipping address is set or Shipping Method is added to the Cart.

+ * + + * @return null|TaxedPrice + */ + public function getTaxedShippingPrice(); + + /** + * @return null|string */ public function getCartState(); @@ -160,21 +198,42 @@ public function getCartState(); /** *

The shipping address is used to determine the eligible shipping methods and rates as well as the tax rate of the line items.

* + * @return null|Address */ public function getShippingAddress(); /** + * @return null|Address */ public function getBillingAddress(); /** + *

Indicates whether one or multiple Shipping Methods are added to the Cart.

+ * + + * @return null|string + */ + public function getShippingMode(); + + /** + *

Holds all shipping-related information per Shipping Method of a Cart with Multiple ShippingMode.

+ *

It is automatically updated after the Shipping Method is added.

+ * + + * @return null|ShippingCollection + */ + public function getShipping(); + + /** + * @return null|string */ public function getInventoryMode(); /** + * @return null|string */ public function getTaxMode(); @@ -182,6 +241,7 @@ public function getTaxMode(); /** *

When calculating taxes for taxedPrice, the selected mode is used for rounding.

* + * @return null|string */ public function getTaxRoundingMode(); @@ -189,6 +249,7 @@ public function getTaxRoundingMode(); /** *

When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

* + * @return null|string */ public function getTaxCalculationMode(); @@ -198,6 +259,7 @@ public function getTaxCalculationMode(); * Used for product variant * price selection.

* + * @return null|CustomerGroupReference */ public function getCustomerGroup(); @@ -206,38 +268,46 @@ public function getCustomerGroup(); *

A two-digit country code as per ISO 3166-1 alpha-2. * Used for product variant price selection.

* + * @return null|string */ public function getCountry(); /** - *

Set automatically once the ShippingMethod is set.

+ *

Shipping-related information of a Cart with Single ShippingMode. + * Set automatically once the ShippingMethod is set.

* + * @return null|ShippingInfo */ public function getShippingInfo(); /** + * @return null|DiscountCodeInfoCollection */ public function getDiscountCodes(); /** + * @return null|DirectDiscountCollection */ public function getDirectDiscounts(); /** + * @return null|CustomFields */ public function getCustom(); /** + * @return null|PaymentInfo */ public function getPaymentInfo(); /** + * @return null|string */ public function getLocale(); @@ -245,6 +315,7 @@ public function getLocale(); /** *

The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState.

* + * @return null|int */ public function getDeleteDaysAfterLastModification(); @@ -252,6 +323,7 @@ public function getDeleteDaysAfterLastModification(); /** *

Automatically filled when a line item with LineItemMode GiftLineItem is removed from the cart.

* + * @return null|CartDiscountReferenceCollection */ public function getRefusedGifts(); @@ -260,6 +332,7 @@ public function getRefusedGifts(); *

The origin field indicates how this cart was created. * The value Customer indicates, that the cart was created by the customer.

* + * @return null|string */ public function getOrigin(); @@ -267,6 +340,7 @@ public function getOrigin(); /** *

The shippingRateInput is used as an input to select a ShippingRatePriceTier.

* + * @return null|ShippingRateInput */ public function getShippingRateInput(); @@ -277,6 +351,7 @@ public function getShippingRateInput(); * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. * Only the cart's shippingAddress is used for this.

* + * @return null|AddressCollection */ public function getItemShippingAddresses(); @@ -284,6 +359,7 @@ public function getItemShippingAddresses(); /** *

The sum off all the Line Items quantities. Does not take Custom Line Items into consideration.

* + * @return null|int */ public function getTotalLineItemQuantity(); @@ -338,6 +414,11 @@ public function setCustomerEmail(?string $customerEmail): void; */ public function setAnonymousId(?string $anonymousId): void; + /** + * @param ?BusinessUnitKeyReference $businessUnit + */ + public function setBusinessUnit(?BusinessUnitKeyReference $businessUnit): void; + /** * @param ?StoreKeyReference $store */ @@ -363,6 +444,11 @@ public function setTotalPrice(?TypedMoney $totalPrice): void; */ public function setTaxedPrice(?TaxedPrice $taxedPrice): void; + /** + * @param ?TaxedPrice $taxedShippingPrice + */ + public function setTaxedShippingPrice(?TaxedPrice $taxedShippingPrice): void; + /** * @param ?string $cartState */ @@ -378,6 +464,16 @@ public function setShippingAddress(?Address $shippingAddress): void; */ public function setBillingAddress(?Address $billingAddress): void; + /** + * @param ?string $shippingMode + */ + public function setShippingMode(?string $shippingMode): void; + + /** + * @param ?ShippingCollection $shipping + */ + public function setShipping(?ShippingCollection $shipping): void; + /** * @param ?string $inventoryMode */ diff --git a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemAction.php b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemAction.php index f7d1bca3e4e..b9202e287f5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemAction.php @@ -24,11 +24,13 @@ interface CartAddCustomLineItemAction extends CartUpdateAction public const FIELD_TAX_CATEGORY = 'taxCategory'; public const FIELD_CUSTOM = 'custom'; public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; + public const FIELD_PRICE_MODE = 'priceMode'; /** *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getMoney(); @@ -36,16 +38,19 @@ public function getMoney(); /** *

JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

* + * @return null|LocalizedString */ public function getName(); /** + * @return null|int */ public function getQuantity(); /** + * @return null|string */ public function getSlug(); @@ -53,6 +58,7 @@ public function getSlug(); /** *

ResourceIdentifier to a TaxCategory.

* + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory(); @@ -60,15 +66,29 @@ public function getTaxCategory(); /** *

The representation used when creating or updating a customizable data type with Custom Fields.

* + * @return null|CustomFieldsDraft */ public function getCustom(); /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); + /** + *
    + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.
  • + *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • + *
+ * + + * @return null|string + */ + public function getPriceMode(); + /** * @param ?Money $money */ @@ -103,4 +123,9 @@ public function setCustom(?CustomFieldsDraft $custom): void; * @param ?ExternalTaxRateDraft $externalTaxRate */ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + + /** + * @param ?string $priceMode + */ + public function setPriceMode(?string $priceMode): void; } diff --git a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionBuilder.php index 5ba7ef7b6de..4238203a842 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionBuilder.php @@ -29,44 +29,58 @@ final class CartAddCustomLineItemActionBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $money; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?int */ private $quantity; /** + * @var ?string */ private $slug; /** + * @var null|TaxCategoryResourceIdentifier|TaxCategoryResourceIdentifierBuilder */ private $taxCategory; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; + /** + + * @var ?string + */ + private $priceMode; + /** *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getMoney() @@ -77,6 +91,7 @@ public function getMoney() /** *

JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

* + * @return null|LocalizedString */ public function getName() @@ -85,6 +100,7 @@ public function getName() } /** + * @return null|int */ public function getQuantity() @@ -93,6 +109,7 @@ public function getQuantity() } /** + * @return null|string */ public function getSlug() @@ -103,6 +120,7 @@ public function getSlug() /** *

ResourceIdentifier to a TaxCategory.

* + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -113,6 +131,7 @@ public function getTaxCategory() /** *

The representation used when creating or updating a customizable data type with Custom Fields.

* + * @return null|CustomFieldsDraft */ public function getCustom() @@ -121,6 +140,7 @@ public function getCustom() } /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() @@ -128,6 +148,21 @@ public function getExternalTaxRate() return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; } + /** + *
    + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.
  • + *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • + *
+ * + + * @return null|string + */ + public function getPriceMode() + { + return $this->priceMode; + } + /** * @param ?Money $money * @return $this @@ -205,6 +240,17 @@ public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) return $this; } + /** + * @param ?string $priceMode + * @return $this + */ + public function withPriceMode(?string $priceMode) + { + $this->priceMode = $priceMode; + + return $this; + } + /** * @deprecated use withMoney() instead * @return $this @@ -269,7 +315,8 @@ public function build(): CartAddCustomLineItemAction $this->slug, $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory, $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, - $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate + $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, + $this->priceMode ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionModel.php index 1cd28540038..33dc3769be7 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionModel.php @@ -29,45 +29,59 @@ final class CartAddCustomLineItemActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'addCustomLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?Money */ protected $money; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?int */ protected $quantity; /** + * * @var ?string */ protected $slug; /** + * * @var ?TaxCategoryResourceIdentifier */ protected $taxCategory; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; + /** + * + * @var ?string + */ + protected $priceMode; + /** * @psalm-suppress MissingParamType @@ -79,7 +93,9 @@ public function __construct( ?string $slug = null, ?TaxCategoryResourceIdentifier $taxCategory = null, ?CustomFieldsDraft $custom = null, - ?ExternalTaxRateDraft $externalTaxRate = null + ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $priceMode = null, + ?string $action = null ) { $this->money = $money; $this->name = $name; @@ -88,10 +104,12 @@ public function __construct( $this->taxCategory = $taxCategory; $this->custom = $custom; $this->externalTaxRate = $externalTaxRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->priceMode = $priceMode; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -112,6 +130,7 @@ public function getAction() *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * * @return null|Money */ public function getMoney() @@ -132,6 +151,7 @@ public function getMoney() /** *

JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

* + * * @return null|LocalizedString */ public function getName() @@ -150,6 +170,7 @@ public function getName() } /** + * * @return null|int */ public function getQuantity() @@ -167,6 +188,7 @@ public function getQuantity() } /** + * * @return null|string */ public function getSlug() @@ -186,6 +208,7 @@ public function getSlug() /** *

ResourceIdentifier to a TaxCategory.

* + * * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -206,6 +229,7 @@ public function getTaxCategory() /** *

The representation used when creating or updating a customizable data type with Custom Fields.

* + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -224,6 +248,7 @@ public function getCustom() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() @@ -241,6 +266,30 @@ public function getExternalTaxRate() return $this->externalTaxRate; } + /** + *
    + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.
  • + *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • + *
+ * + * + * @return null|string + */ + public function getPriceMode() + { + if (is_null($this->priceMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PRICE_MODE); + if (is_null($data)) { + return null; + } + $this->priceMode = (string) $data; + } + + return $this->priceMode; + } + /** * @param ?Money $money @@ -297,4 +346,12 @@ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void { $this->externalTaxRate = $externalTaxRate; } + + /** + * @param ?string $priceMode + */ + public function setPriceMode(?string $priceMode): void + { + $this->priceMode = $priceMode; + } } diff --git a/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodAction.php b/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodAction.php new file mode 100644 index 00000000000..4f879f1a049 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodAction.php @@ -0,0 +1,152 @@ +User-defined unique identifier of the custom Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey(); + + /** + *

Name of the custom Shipping Method.

+ * + + * @return null|string + */ + public function getShippingMethodName(); + + /** + *

Determines the shipping rate and Tax Rate of the associated Line Items.

+ * + + * @return null|BaseAddress + */ + public function getShippingAddress(); + + /** + *

Determines the shipping price.

+ * + + * @return null|ShippingRateDraft + */ + public function getShippingRate(); + + /** + *

Used as an input to select a ShippingRatePriceTier.

+ * + *

The shippingRateInput cannot be set on the Cart if CartValueType is defined.

+ * + + * @return null|ShippingRateInputDraft + */ + public function getShippingRateInput(); + + /** + *

Tax Category used to determine a shipping Tax Rate if a Cart has the Platform TaxMode.

+ * + + * @return null|TaxCategoryResourceIdentifier + */ + public function getTaxCategory(); + + /** + *

Tax Rate used to tax a shipping expense if the Cart has the External TaxMode.

+ * + + * @return null|string + */ + public function getExternalTaxRate(); + + /** + *

Deliveries tied to a Shipping Method in a multi-shipping method Cart. + * It holds information on how items are delivered to customers.

+ * + + * @return null|DeliveryCollection + */ + public function getDeliveries(); + + /** + *

Custom Fields for the custom Shipping Method.

+ * + + * @return null|string + */ + public function getCustom(); + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; + + /** + * @param ?string $shippingMethodName + */ + public function setShippingMethodName(?string $shippingMethodName): void; + + /** + * @param ?BaseAddress $shippingAddress + */ + public function setShippingAddress(?BaseAddress $shippingAddress): void; + + /** + * @param ?ShippingRateDraft $shippingRate + */ + public function setShippingRate(?ShippingRateDraft $shippingRate): void; + + /** + * @param ?ShippingRateInputDraft $shippingRateInput + */ + public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput): void; + + /** + * @param ?TaxCategoryResourceIdentifier $taxCategory + */ + public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): void; + + /** + * @param ?string $externalTaxRate + */ + public function setExternalTaxRate(?string $externalTaxRate): void; + + /** + * @param ?DeliveryCollection $deliveries + */ + public function setDeliveries(?DeliveryCollection $deliveries): void; + + /** + * @param ?string $custom + */ + public function setCustom(?string $custom): void; +} diff --git a/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodActionBuilder.php new file mode 100644 index 00000000000..8e8103d9760 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodActionBuilder.php @@ -0,0 +1,351 @@ + + */ +final class CartAddCustomShippingMethodActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $shippingKey; + + /** + + * @var ?string + */ + private $shippingMethodName; + + /** + + * @var null|BaseAddress|BaseAddressBuilder + */ + private $shippingAddress; + + /** + + * @var null|ShippingRateDraft|ShippingRateDraftBuilder + */ + private $shippingRate; + + /** + + * @var null|ShippingRateInputDraft|ShippingRateInputDraftBuilder + */ + private $shippingRateInput; + + /** + + * @var null|TaxCategoryResourceIdentifier|TaxCategoryResourceIdentifierBuilder + */ + private $taxCategory; + + /** + + * @var ?string + */ + private $externalTaxRate; + + /** + + * @var ?DeliveryCollection + */ + private $deliveries; + + /** + + * @var ?string + */ + private $custom; + + /** + *

User-defined unique identifier of the custom Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + + /** + *

Name of the custom Shipping Method.

+ * + + * @return null|string + */ + public function getShippingMethodName() + { + return $this->shippingMethodName; + } + + /** + *

Determines the shipping rate and Tax Rate of the associated Line Items.

+ * + + * @return null|BaseAddress + */ + public function getShippingAddress() + { + return $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress; + } + + /** + *

Determines the shipping price.

+ * + + * @return null|ShippingRateDraft + */ + public function getShippingRate() + { + return $this->shippingRate instanceof ShippingRateDraftBuilder ? $this->shippingRate->build() : $this->shippingRate; + } + + /** + *

Used as an input to select a ShippingRatePriceTier.

+ * + *

The shippingRateInput cannot be set on the Cart if CartValueType is defined.

+ * + + * @return null|ShippingRateInputDraft + */ + public function getShippingRateInput() + { + return $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput; + } + + /** + *

Tax Category used to determine a shipping Tax Rate if a Cart has the Platform TaxMode.

+ * + + * @return null|TaxCategoryResourceIdentifier + */ + public function getTaxCategory() + { + return $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory; + } + + /** + *

Tax Rate used to tax a shipping expense if the Cart has the External TaxMode.

+ * + + * @return null|string + */ + public function getExternalTaxRate() + { + return $this->externalTaxRate; + } + + /** + *

Deliveries tied to a Shipping Method in a multi-shipping method Cart. + * It holds information on how items are delivered to customers.

+ * + + * @return null|DeliveryCollection + */ + public function getDeliveries() + { + return $this->deliveries; + } + + /** + *

Custom Fields for the custom Shipping Method.

+ * + + * @return null|string + */ + public function getCustom() + { + return $this->custom; + } + + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + + /** + * @param ?string $shippingMethodName + * @return $this + */ + public function withShippingMethodName(?string $shippingMethodName) + { + $this->shippingMethodName = $shippingMethodName; + + return $this; + } + + /** + * @param ?BaseAddress $shippingAddress + * @return $this + */ + public function withShippingAddress(?BaseAddress $shippingAddress) + { + $this->shippingAddress = $shippingAddress; + + return $this; + } + + /** + * @param ?ShippingRateDraft $shippingRate + * @return $this + */ + public function withShippingRate(?ShippingRateDraft $shippingRate) + { + $this->shippingRate = $shippingRate; + + return $this; + } + + /** + * @param ?ShippingRateInputDraft $shippingRateInput + * @return $this + */ + public function withShippingRateInput(?ShippingRateInputDraft $shippingRateInput) + { + $this->shippingRateInput = $shippingRateInput; + + return $this; + } + + /** + * @param ?TaxCategoryResourceIdentifier $taxCategory + * @return $this + */ + public function withTaxCategory(?TaxCategoryResourceIdentifier $taxCategory) + { + $this->taxCategory = $taxCategory; + + return $this; + } + + /** + * @param ?string $externalTaxRate + * @return $this + */ + public function withExternalTaxRate(?string $externalTaxRate) + { + $this->externalTaxRate = $externalTaxRate; + + return $this; + } + + /** + * @param ?DeliveryCollection $deliveries + * @return $this + */ + public function withDeliveries(?DeliveryCollection $deliveries) + { + $this->deliveries = $deliveries; + + return $this; + } + + /** + * @param ?string $custom + * @return $this + */ + public function withCustom(?string $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @deprecated use withShippingAddress() instead + * @return $this + */ + public function withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress) + { + $this->shippingAddress = $shippingAddress; + + return $this; + } + + /** + * @deprecated use withShippingRate() instead + * @return $this + */ + public function withShippingRateBuilder(?ShippingRateDraftBuilder $shippingRate) + { + $this->shippingRate = $shippingRate; + + return $this; + } + + /** + * @deprecated use withShippingRateInput() instead + * @return $this + */ + public function withShippingRateInputBuilder(?ShippingRateInputDraftBuilder $shippingRateInput) + { + $this->shippingRateInput = $shippingRateInput; + + return $this; + } + + /** + * @deprecated use withTaxCategory() instead + * @return $this + */ + public function withTaxCategoryBuilder(?TaxCategoryResourceIdentifierBuilder $taxCategory) + { + $this->taxCategory = $taxCategory; + + return $this; + } + + public function build(): CartAddCustomShippingMethodAction + { + return new CartAddCustomShippingMethodActionModel( + $this->shippingKey, + $this->shippingMethodName, + $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, + $this->shippingRate instanceof ShippingRateDraftBuilder ? $this->shippingRate->build() : $this->shippingRate, + $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, + $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory, + $this->externalTaxRate, + $this->deliveries, + $this->custom + ); + } + + public static function of(): CartAddCustomShippingMethodActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodActionCollection.php b/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodActionCollection.php new file mode 100644 index 00000000000..bc832247620 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodActionCollection.php @@ -0,0 +1,56 @@ + + * @method CartAddCustomShippingMethodAction current() + * @method CartAddCustomShippingMethodAction end() + * @method CartAddCustomShippingMethodAction at($offset) + */ +class CartAddCustomShippingMethodActionCollection extends CartUpdateActionCollection +{ + /** + * @psalm-assert CartAddCustomShippingMethodAction $value + * @psalm-param CartAddCustomShippingMethodAction|stdClass $value + * @throws InvalidArgumentException + * + * @return CartAddCustomShippingMethodActionCollection + */ + public function add($value) + { + if (!$value instanceof CartAddCustomShippingMethodAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CartAddCustomShippingMethodAction + */ + protected function mapper() + { + return function (?int $index): ?CartAddCustomShippingMethodAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CartAddCustomShippingMethodAction $data */ + $data = CartAddCustomShippingMethodActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodActionModel.php new file mode 100644 index 00000000000..c7f2ae3a16b --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartAddCustomShippingMethodActionModel.php @@ -0,0 +1,398 @@ +shippingKey = $shippingKey; + $this->shippingMethodName = $shippingMethodName; + $this->shippingAddress = $shippingAddress; + $this->shippingRate = $shippingRate; + $this->shippingRateInput = $shippingRateInput; + $this->taxCategory = $taxCategory; + $this->externalTaxRate = $externalTaxRate; + $this->deliveries = $deliveries; + $this->custom = $custom; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

User-defined unique identifier of the custom Shipping Method in a Cart with Multiple ShippingMode.

+ * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + + /** + *

Name of the custom Shipping Method.

+ * + * + * @return null|string + */ + public function getShippingMethodName() + { + if (is_null($this->shippingMethodName)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_METHOD_NAME); + if (is_null($data)) { + return null; + } + $this->shippingMethodName = (string) $data; + } + + return $this->shippingMethodName; + } + + /** + *

Determines the shipping rate and Tax Rate of the associated Line Items.

+ * + * + * @return null|BaseAddress + */ + public function getShippingAddress() + { + if (is_null($this->shippingAddress)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->shippingAddress = BaseAddressModel::of($data); + } + + return $this->shippingAddress; + } + + /** + *

Determines the shipping price.

+ * + * + * @return null|ShippingRateDraft + */ + public function getShippingRate() + { + if (is_null($this->shippingRate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_RATE); + if (is_null($data)) { + return null; + } + + $this->shippingRate = ShippingRateDraftModel::of($data); + } + + return $this->shippingRate; + } + + /** + *

Used as an input to select a ShippingRatePriceTier.

+ * + *

The shippingRateInput cannot be set on the Cart if CartValueType is defined.

+ * + * + * @return null|ShippingRateInputDraft + */ + public function getShippingRateInput() + { + if (is_null($this->shippingRateInput)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_RATE_INPUT); + if (is_null($data)) { + return null; + } + $className = ShippingRateInputDraftModel::resolveDiscriminatorClass($data); + $this->shippingRateInput = $className::of($data); + } + + return $this->shippingRateInput; + } + + /** + *

Tax Category used to determine a shipping Tax Rate if a Cart has the Platform TaxMode.

+ * + * + * @return null|TaxCategoryResourceIdentifier + */ + public function getTaxCategory() + { + if (is_null($this->taxCategory)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TAX_CATEGORY); + if (is_null($data)) { + return null; + } + + $this->taxCategory = TaxCategoryResourceIdentifierModel::of($data); + } + + return $this->taxCategory; + } + + /** + *

Tax Rate used to tax a shipping expense if the Cart has the External TaxMode.

+ * + * + * @return null|string + */ + public function getExternalTaxRate() + { + if (is_null($this->externalTaxRate)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); + if (is_null($data)) { + return null; + } + $this->externalTaxRate = (string) $data; + } + + return $this->externalTaxRate; + } + + /** + *

Deliveries tied to a Shipping Method in a multi-shipping method Cart. + * It holds information on how items are delivered to customers.

+ * + * + * @return null|DeliveryCollection + */ + public function getDeliveries() + { + if (is_null($this->deliveries)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_DELIVERIES); + if (is_null($data)) { + return null; + } + $this->deliveries = DeliveryCollection::fromArray($data); + } + + return $this->deliveries; + } + + /** + *

Custom Fields for the custom Shipping Method.

+ * + * + * @return null|string + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + $this->custom = (string) $data; + } + + return $this->custom; + } + + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } + + /** + * @param ?string $shippingMethodName + */ + public function setShippingMethodName(?string $shippingMethodName): void + { + $this->shippingMethodName = $shippingMethodName; + } + + /** + * @param ?BaseAddress $shippingAddress + */ + public function setShippingAddress(?BaseAddress $shippingAddress): void + { + $this->shippingAddress = $shippingAddress; + } + + /** + * @param ?ShippingRateDraft $shippingRate + */ + public function setShippingRate(?ShippingRateDraft $shippingRate): void + { + $this->shippingRate = $shippingRate; + } + + /** + * @param ?ShippingRateInputDraft $shippingRateInput + */ + public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput): void + { + $this->shippingRateInput = $shippingRateInput; + } + + /** + * @param ?TaxCategoryResourceIdentifier $taxCategory + */ + public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): void + { + $this->taxCategory = $taxCategory; + } + + /** + * @param ?string $externalTaxRate + */ + public function setExternalTaxRate(?string $externalTaxRate): void + { + $this->externalTaxRate = $externalTaxRate; + } + + /** + * @param ?DeliveryCollection $deliveries + */ + public function setDeliveries(?DeliveryCollection $deliveries): void + { + $this->deliveries = $deliveries; + } + + /** + * @param ?string $custom + */ + public function setCustom(?string $custom): void + { + $this->custom = $custom; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeAction.php b/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeAction.php index 555ab8aa983..0fb1f2ea446 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeAction.php @@ -16,6 +16,7 @@ interface CartAddDiscountCodeAction extends CartUpdateAction public const FIELD_CODE = 'code'; /** + * @return null|string */ public function getCode(); diff --git a/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeActionBuilder.php index 9c667f3ca90..e3976fdcf61 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeActionBuilder.php @@ -21,11 +21,13 @@ final class CartAddDiscountCodeActionBuilder implements Builder { /** + * @var ?string */ private $code; /** + * @return null|string */ public function getCode() diff --git a/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeActionModel.php index a447fbc7f3f..c199d1c6d64 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddDiscountCodeActionModel.php @@ -21,11 +21,13 @@ final class CartAddDiscountCodeActionModel extends JsonObjectModel implements Ca { public const DISCRIMINATOR_VALUE = 'addDiscountCode'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $code; @@ -35,13 +37,15 @@ final class CartAddDiscountCodeActionModel extends JsonObjectModel implements Ca * @psalm-suppress MissingParamType */ public function __construct( - ?string $code = null + ?string $code = null, + ?string $action = null ) { $this->code = $code; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getCode() diff --git a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressAction.php index 94551a48895..f24fdaea316 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressAction.php @@ -17,6 +17,7 @@ interface CartAddItemShippingAddressAction extends CartUpdateAction public const FIELD_ADDRESS = 'address'; /** + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionBuilder.php index c858b3c8891..3cd5db82e77 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionBuilder.php @@ -23,11 +23,13 @@ final class CartAddItemShippingAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionModel.php index 6a698123300..d8710d64573 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionModel.php @@ -23,11 +23,13 @@ final class CartAddItemShippingAddressActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'addItemShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -37,13 +39,15 @@ final class CartAddItemShippingAddressActionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Cart/CartAddLineItemAction.php b/lib/commercetools-api/src/Models/Cart/CartAddLineItemAction.php index 0d88de8a346..04f9ba32876 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddLineItemAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddLineItemAction.php @@ -31,6 +31,7 @@ interface CartAddLineItemAction extends CartUpdateAction /** *

The representation used when creating or updating a customizable data type with Custom Fields.

* + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -38,31 +39,37 @@ public function getCustom(); /** *

ResourceIdentifier to a Channel.

* + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel(); /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); /** + * @return null|string */ public function getProductId(); /** + * @return null|int */ public function getVariantId(); /** + * @return null|string */ public function getSku(); /** + * @return null|int */ public function getQuantity(); @@ -70,6 +77,7 @@ public function getQuantity(); /** *

ResourceIdentifier to a Channel.

* + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel(); @@ -78,16 +86,19 @@ public function getSupplyChannel(); *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getExternalPrice(); /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); diff --git a/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionBuilder.php index 7700da3f260..fe51e76ce6a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionBuilder.php @@ -27,56 +27,67 @@ final class CartAddLineItemActionBuilder implements Builder { /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $distributionChannel; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** + * @var ?string */ private $productId; /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?int */ private $quantity; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $supplyChannel; /** + * @var null|Money|MoneyBuilder */ private $externalPrice; /** + * @var null|ExternalLineItemTotalPrice|ExternalLineItemTotalPriceBuilder */ private $externalTotalPrice; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetails; @@ -84,6 +95,7 @@ final class CartAddLineItemActionBuilder implements Builder /** *

The representation used when creating or updating a customizable data type with Custom Fields.

* + * @return null|CustomFieldsDraft */ public function getCustom() @@ -94,6 +106,7 @@ public function getCustom() /** *

ResourceIdentifier to a Channel.

* + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() @@ -102,6 +115,7 @@ public function getDistributionChannel() } /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() @@ -110,6 +124,7 @@ public function getExternalTaxRate() } /** + * @return null|string */ public function getProductId() @@ -118,6 +133,7 @@ public function getProductId() } /** + * @return null|int */ public function getVariantId() @@ -126,6 +142,7 @@ public function getVariantId() } /** + * @return null|string */ public function getSku() @@ -134,6 +151,7 @@ public function getSku() } /** + * @return null|int */ public function getQuantity() @@ -144,6 +162,7 @@ public function getQuantity() /** *

ResourceIdentifier to a Channel.

* + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -155,6 +174,7 @@ public function getSupplyChannel() *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getExternalPrice() @@ -163,6 +183,7 @@ public function getExternalPrice() } /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() @@ -171,6 +192,7 @@ public function getExternalTotalPrice() } /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionModel.php index 6bd8b80f881..33fe66b2bc1 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddLineItemActionModel.php @@ -27,61 +27,73 @@ final class CartAddLineItemActionModel extends JsonObjectModel implements CartAd { public const DISCRIMINATOR_VALUE = 'addLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?ChannelResourceIdentifier */ protected $distributionChannel; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; /** + * * @var ?string */ protected $productId; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?int */ protected $quantity; /** + * * @var ?ChannelResourceIdentifier */ protected $supplyChannel; /** + * * @var ?Money */ protected $externalPrice; /** + * * @var ?ExternalLineItemTotalPrice */ protected $externalTotalPrice; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; @@ -101,7 +113,8 @@ public function __construct( ?ChannelResourceIdentifier $supplyChannel = null, ?Money $externalPrice = null, ?ExternalLineItemTotalPrice $externalTotalPrice = null, - ?ItemShippingDetailsDraft $shippingDetails = null + ?ItemShippingDetailsDraft $shippingDetails = null, + ?string $action = null ) { $this->custom = $custom; $this->distributionChannel = $distributionChannel; @@ -114,10 +127,11 @@ public function __construct( $this->externalPrice = $externalPrice; $this->externalTotalPrice = $externalTotalPrice; $this->shippingDetails = $shippingDetails; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -137,6 +151,7 @@ public function getAction() /** *

The representation used when creating or updating a customizable data type with Custom Fields.

* + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -157,6 +172,7 @@ public function getCustom() /** *

ResourceIdentifier to a Channel.

* + * * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() @@ -175,6 +191,7 @@ public function getDistributionChannel() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() @@ -193,6 +210,7 @@ public function getExternalTaxRate() } /** + * * @return null|string */ public function getProductId() @@ -210,6 +228,7 @@ public function getProductId() } /** + * * @return null|int */ public function getVariantId() @@ -227,6 +246,7 @@ public function getVariantId() } /** + * * @return null|string */ public function getSku() @@ -244,6 +264,7 @@ public function getSku() } /** + * * @return null|int */ public function getQuantity() @@ -263,6 +284,7 @@ public function getQuantity() /** *

ResourceIdentifier to a Channel.

* + * * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -284,6 +306,7 @@ public function getSupplyChannel() *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * * @return null|Money */ public function getExternalPrice() @@ -302,6 +325,7 @@ public function getExternalPrice() } /** + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() @@ -320,6 +344,7 @@ public function getExternalTotalPrice() } /** + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/Cart/CartAddPaymentAction.php b/lib/commercetools-api/src/Models/Cart/CartAddPaymentAction.php index 93fb9471bd1..38a0ef030fc 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddPaymentAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddPaymentAction.php @@ -17,6 +17,7 @@ interface CartAddPaymentAction extends CartUpdateAction public const FIELD_PAYMENT = 'payment'; /** + * @return null|PaymentResourceIdentifier */ public function getPayment(); diff --git a/lib/commercetools-api/src/Models/Cart/CartAddPaymentActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddPaymentActionBuilder.php index d1f4e2035db..538454ac1a4 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddPaymentActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddPaymentActionBuilder.php @@ -23,11 +23,13 @@ final class CartAddPaymentActionBuilder implements Builder { /** + * @var null|PaymentResourceIdentifier|PaymentResourceIdentifierBuilder */ private $payment; /** + * @return null|PaymentResourceIdentifier */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Cart/CartAddPaymentActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddPaymentActionModel.php index cf0e1d08284..5c9ba435dde 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddPaymentActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddPaymentActionModel.php @@ -23,11 +23,13 @@ final class CartAddPaymentActionModel extends JsonObjectModel implements CartAdd { public const DISCRIMINATOR_VALUE = 'addPayment'; /** + * * @var ?string */ protected $action; /** + * * @var ?PaymentResourceIdentifier */ protected $payment; @@ -37,13 +39,15 @@ final class CartAddPaymentActionModel extends JsonObjectModel implements CartAdd * @psalm-suppress MissingParamType */ public function __construct( - ?PaymentResourceIdentifier $payment = null + ?PaymentResourceIdentifier $payment = null, + ?string $action = null ) { $this->payment = $payment; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|PaymentResourceIdentifier */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodAction.php b/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodAction.php new file mode 100644 index 00000000000..987bf8f7970 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodAction.php @@ -0,0 +1,124 @@ +User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey(); + + /** + *

Value to set. + * If empty, any existing value is removed.

+ * + + * @return null|ShippingMethodReference + */ + public function getShippingMethod(); + + /** + *

Determines the shipping rate and Tax Rate of the Line Items.

+ * + + * @return null|BaseAddress + */ + public function getShippingAddress(); + + /** + *

Used as an input to select a ShippingRatePriceTier.

+ * + *

The shippingRateInput cannot be set on the Cart if CartValueType is defined.

+ * + + * @return null|ShippingRateInputDraft + */ + public function getShippingRateInput(); + + /** + *

Tax Rate used to tax a shipping expense if a Cart has the External TaxMode.

+ * + + * @return null|string + */ + public function getExternalTaxRate(); + + /** + *

Deliveries tied to a Shipping Method in a multi-shipping method Cart. + * It holds information on how items are delivered to customers.

+ * + + * @return null|DeliveryCollection + */ + public function getDeliveries(); + + /** + *

Custom Fields for the Shipping Method.

+ * + + * @return null|string + */ + public function getCustom(); + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; + + /** + * @param ?ShippingMethodReference $shippingMethod + */ + public function setShippingMethod(?ShippingMethodReference $shippingMethod): void; + + /** + * @param ?BaseAddress $shippingAddress + */ + public function setShippingAddress(?BaseAddress $shippingAddress): void; + + /** + * @param ?ShippingRateInputDraft $shippingRateInput + */ + public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput): void; + + /** + * @param ?string $externalTaxRate + */ + public function setExternalTaxRate(?string $externalTaxRate): void; + + /** + * @param ?DeliveryCollection $deliveries + */ + public function setDeliveries(?DeliveryCollection $deliveries): void; + + /** + * @param ?string $custom + */ + public function setCustom(?string $custom): void; +} diff --git a/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodActionBuilder.php new file mode 100644 index 00000000000..a9cdb9898a2 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodActionBuilder.php @@ -0,0 +1,281 @@ + + */ +final class CartAddShippingMethodActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $shippingKey; + + /** + + * @var null|ShippingMethodReference|ShippingMethodReferenceBuilder + */ + private $shippingMethod; + + /** + + * @var null|BaseAddress|BaseAddressBuilder + */ + private $shippingAddress; + + /** + + * @var null|ShippingRateInputDraft|ShippingRateInputDraftBuilder + */ + private $shippingRateInput; + + /** + + * @var ?string + */ + private $externalTaxRate; + + /** + + * @var ?DeliveryCollection + */ + private $deliveries; + + /** + + * @var ?string + */ + private $custom; + + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + + /** + *

Value to set. + * If empty, any existing value is removed.

+ * + + * @return null|ShippingMethodReference + */ + public function getShippingMethod() + { + return $this->shippingMethod instanceof ShippingMethodReferenceBuilder ? $this->shippingMethod->build() : $this->shippingMethod; + } + + /** + *

Determines the shipping rate and Tax Rate of the Line Items.

+ * + + * @return null|BaseAddress + */ + public function getShippingAddress() + { + return $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress; + } + + /** + *

Used as an input to select a ShippingRatePriceTier.

+ * + *

The shippingRateInput cannot be set on the Cart if CartValueType is defined.

+ * + + * @return null|ShippingRateInputDraft + */ + public function getShippingRateInput() + { + return $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput; + } + + /** + *

Tax Rate used to tax a shipping expense if a Cart has the External TaxMode.

+ * + + * @return null|string + */ + public function getExternalTaxRate() + { + return $this->externalTaxRate; + } + + /** + *

Deliveries tied to a Shipping Method in a multi-shipping method Cart. + * It holds information on how items are delivered to customers.

+ * + + * @return null|DeliveryCollection + */ + public function getDeliveries() + { + return $this->deliveries; + } + + /** + *

Custom Fields for the Shipping Method.

+ * + + * @return null|string + */ + public function getCustom() + { + return $this->custom; + } + + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + + /** + * @param ?ShippingMethodReference $shippingMethod + * @return $this + */ + public function withShippingMethod(?ShippingMethodReference $shippingMethod) + { + $this->shippingMethod = $shippingMethod; + + return $this; + } + + /** + * @param ?BaseAddress $shippingAddress + * @return $this + */ + public function withShippingAddress(?BaseAddress $shippingAddress) + { + $this->shippingAddress = $shippingAddress; + + return $this; + } + + /** + * @param ?ShippingRateInputDraft $shippingRateInput + * @return $this + */ + public function withShippingRateInput(?ShippingRateInputDraft $shippingRateInput) + { + $this->shippingRateInput = $shippingRateInput; + + return $this; + } + + /** + * @param ?string $externalTaxRate + * @return $this + */ + public function withExternalTaxRate(?string $externalTaxRate) + { + $this->externalTaxRate = $externalTaxRate; + + return $this; + } + + /** + * @param ?DeliveryCollection $deliveries + * @return $this + */ + public function withDeliveries(?DeliveryCollection $deliveries) + { + $this->deliveries = $deliveries; + + return $this; + } + + /** + * @param ?string $custom + * @return $this + */ + public function withCustom(?string $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @deprecated use withShippingMethod() instead + * @return $this + */ + public function withShippingMethodBuilder(?ShippingMethodReferenceBuilder $shippingMethod) + { + $this->shippingMethod = $shippingMethod; + + return $this; + } + + /** + * @deprecated use withShippingAddress() instead + * @return $this + */ + public function withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress) + { + $this->shippingAddress = $shippingAddress; + + return $this; + } + + /** + * @deprecated use withShippingRateInput() instead + * @return $this + */ + public function withShippingRateInputBuilder(?ShippingRateInputDraftBuilder $shippingRateInput) + { + $this->shippingRateInput = $shippingRateInput; + + return $this; + } + + public function build(): CartAddShippingMethodAction + { + return new CartAddShippingMethodActionModel( + $this->shippingKey, + $this->shippingMethod instanceof ShippingMethodReferenceBuilder ? $this->shippingMethod->build() : $this->shippingMethod, + $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, + $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, + $this->externalTaxRate, + $this->deliveries, + $this->custom + ); + } + + public static function of(): CartAddShippingMethodActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodActionCollection.php b/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodActionCollection.php new file mode 100644 index 00000000000..42b71e3cece --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodActionCollection.php @@ -0,0 +1,56 @@ + + * @method CartAddShippingMethodAction current() + * @method CartAddShippingMethodAction end() + * @method CartAddShippingMethodAction at($offset) + */ +class CartAddShippingMethodActionCollection extends CartUpdateActionCollection +{ + /** + * @psalm-assert CartAddShippingMethodAction $value + * @psalm-param CartAddShippingMethodAction|stdClass $value + * @throws InvalidArgumentException + * + * @return CartAddShippingMethodActionCollection + */ + public function add($value) + { + if (!$value instanceof CartAddShippingMethodAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CartAddShippingMethodAction + */ + protected function mapper() + { + return function (?int $index): ?CartAddShippingMethodAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CartAddShippingMethodAction $data */ + $data = CartAddShippingMethodActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodActionModel.php new file mode 100644 index 00000000000..82d1a611430 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartAddShippingMethodActionModel.php @@ -0,0 +1,324 @@ +shippingKey = $shippingKey; + $this->shippingMethod = $shippingMethod; + $this->shippingAddress = $shippingAddress; + $this->shippingRateInput = $shippingRateInput; + $this->externalTaxRate = $externalTaxRate; + $this->deliveries = $deliveries; + $this->custom = $custom; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + + /** + *

Value to set. + * If empty, any existing value is removed.

+ * + * + * @return null|ShippingMethodReference + */ + public function getShippingMethod() + { + if (is_null($this->shippingMethod)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_METHOD); + if (is_null($data)) { + return null; + } + + $this->shippingMethod = ShippingMethodReferenceModel::of($data); + } + + return $this->shippingMethod; + } + + /** + *

Determines the shipping rate and Tax Rate of the Line Items.

+ * + * + * @return null|BaseAddress + */ + public function getShippingAddress() + { + if (is_null($this->shippingAddress)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->shippingAddress = BaseAddressModel::of($data); + } + + return $this->shippingAddress; + } + + /** + *

Used as an input to select a ShippingRatePriceTier.

+ * + *

The shippingRateInput cannot be set on the Cart if CartValueType is defined.

+ * + * + * @return null|ShippingRateInputDraft + */ + public function getShippingRateInput() + { + if (is_null($this->shippingRateInput)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_RATE_INPUT); + if (is_null($data)) { + return null; + } + $className = ShippingRateInputDraftModel::resolveDiscriminatorClass($data); + $this->shippingRateInput = $className::of($data); + } + + return $this->shippingRateInput; + } + + /** + *

Tax Rate used to tax a shipping expense if a Cart has the External TaxMode.

+ * + * + * @return null|string + */ + public function getExternalTaxRate() + { + if (is_null($this->externalTaxRate)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); + if (is_null($data)) { + return null; + } + $this->externalTaxRate = (string) $data; + } + + return $this->externalTaxRate; + } + + /** + *

Deliveries tied to a Shipping Method in a multi-shipping method Cart. + * It holds information on how items are delivered to customers.

+ * + * + * @return null|DeliveryCollection + */ + public function getDeliveries() + { + if (is_null($this->deliveries)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_DELIVERIES); + if (is_null($data)) { + return null; + } + $this->deliveries = DeliveryCollection::fromArray($data); + } + + return $this->deliveries; + } + + /** + *

Custom Fields for the Shipping Method.

+ * + * + * @return null|string + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + $this->custom = (string) $data; + } + + return $this->custom; + } + + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } + + /** + * @param ?ShippingMethodReference $shippingMethod + */ + public function setShippingMethod(?ShippingMethodReference $shippingMethod): void + { + $this->shippingMethod = $shippingMethod; + } + + /** + * @param ?BaseAddress $shippingAddress + */ + public function setShippingAddress(?BaseAddress $shippingAddress): void + { + $this->shippingAddress = $shippingAddress; + } + + /** + * @param ?ShippingRateInputDraft $shippingRateInput + */ + public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput): void + { + $this->shippingRateInput = $shippingRateInput; + } + + /** + * @param ?string $externalTaxRate + */ + public function setExternalTaxRate(?string $externalTaxRate): void + { + $this->externalTaxRate = $externalTaxRate; + } + + /** + * @param ?DeliveryCollection $deliveries + */ + public function setDeliveries(?DeliveryCollection $deliveries): void + { + $this->deliveries = $deliveries; + } + + /** + * @param ?string $custom + */ + public function setCustom(?string $custom): void + { + $this->custom = $custom; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartAddShoppingListAction.php b/lib/commercetools-api/src/Models/Cart/CartAddShoppingListAction.php index 4bb77bce3fb..a22820ac0e6 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddShoppingListAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddShoppingListAction.php @@ -22,6 +22,7 @@ interface CartAddShoppingListAction extends CartUpdateAction /** *

ResourceIdentifier to a ShoppingList.

* + * @return null|ShoppingListResourceIdentifier */ public function getShoppingList(); @@ -29,6 +30,7 @@ public function getShoppingList(); /** *

ResourceIdentifier to a Channel.

* + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel(); @@ -36,6 +38,7 @@ public function getSupplyChannel(); /** *

ResourceIdentifier to a Channel.

* + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel(); diff --git a/lib/commercetools-api/src/Models/Cart/CartAddShoppingListActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddShoppingListActionBuilder.php index c7ff480e555..823c4f6db11 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddShoppingListActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddShoppingListActionBuilder.php @@ -25,16 +25,19 @@ final class CartAddShoppingListActionBuilder implements Builder { /** + * @var null|ShoppingListResourceIdentifier|ShoppingListResourceIdentifierBuilder */ private $shoppingList; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $supplyChannel; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $distributionChannel; @@ -42,6 +45,7 @@ final class CartAddShoppingListActionBuilder implements Builder /** *

ResourceIdentifier to a ShoppingList.

* + * @return null|ShoppingListResourceIdentifier */ public function getShoppingList() @@ -52,6 +56,7 @@ public function getShoppingList() /** *

ResourceIdentifier to a Channel.

* + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -62,6 +67,7 @@ public function getSupplyChannel() /** *

ResourceIdentifier to a Channel.

* + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/Cart/CartAddShoppingListActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddShoppingListActionModel.php index f6b96a9f05d..21a3c4185b9 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddShoppingListActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddShoppingListActionModel.php @@ -25,21 +25,25 @@ final class CartAddShoppingListActionModel extends JsonObjectModel implements Ca { public const DISCRIMINATOR_VALUE = 'addShoppingList'; /** + * * @var ?string */ protected $action; /** + * * @var ?ShoppingListResourceIdentifier */ protected $shoppingList; /** + * * @var ?ChannelResourceIdentifier */ protected $supplyChannel; /** + * * @var ?ChannelResourceIdentifier */ protected $distributionChannel; @@ -51,15 +55,17 @@ final class CartAddShoppingListActionModel extends JsonObjectModel implements Ca public function __construct( ?ShoppingListResourceIdentifier $shoppingList = null, ?ChannelResourceIdentifier $supplyChannel = null, - ?ChannelResourceIdentifier $distributionChannel = null + ?ChannelResourceIdentifier $distributionChannel = null, + ?string $action = null ) { $this->shoppingList = $shoppingList; $this->supplyChannel = $supplyChannel; $this->distributionChannel = $distributionChannel; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -79,6 +85,7 @@ public function getAction() /** *

ResourceIdentifier to a ShoppingList.

* + * * @return null|ShoppingListResourceIdentifier */ public function getShoppingList() @@ -99,6 +106,7 @@ public function getShoppingList() /** *

ResourceIdentifier to a Channel.

* + * * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -119,6 +127,7 @@ public function getSupplyChannel() /** *

ResourceIdentifier to a Channel.

* + * * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction.php b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction.php index a2681e8db1c..6ae65ddee5b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction.php @@ -17,11 +17,13 @@ interface CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction extends Car public const FIELD_TARGETS_DELTA = 'targetsDelta'; /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|ItemShippingTargetCollection */ public function getTargetsDelta(); diff --git a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionBuilder.php index 174546c5f7b..c50c07c2548 100644 --- a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionBuilder.php @@ -21,16 +21,19 @@ final class CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var ?ItemShippingTargetCollection */ private $targetsDelta; /** + * @return null|string */ public function getCustomLineItemId() @@ -39,6 +42,7 @@ public function getCustomLineItemId() } /** + * @return null|ItemShippingTargetCollection */ public function getTargetsDelta() diff --git a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel.php b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel.php index ed431268073..fc1497ac6eb 100644 --- a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel.php @@ -21,16 +21,19 @@ final class CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel exte { public const DISCRIMINATOR_VALUE = 'applyDeltaToCustomLineItemShippingDetailsTargets'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?ItemShippingTargetCollection */ protected $targetsDelta; @@ -41,14 +44,16 @@ final class CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel exte */ public function __construct( ?string $customLineItemId = null, - ?ItemShippingTargetCollection $targetsDelta = null + ?ItemShippingTargetCollection $targetsDelta = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->targetsDelta = $targetsDelta; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -83,6 +89,7 @@ public function getCustomLineItemId() } /** + * * @return null|ItemShippingTargetCollection */ public function getTargetsDelta() diff --git a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsAction.php b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsAction.php index bfa486f0fbf..006b341c17e 100644 --- a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsAction.php @@ -17,11 +17,13 @@ interface CartApplyDeltaToLineItemShippingDetailsTargetsAction extends CartUpdat public const FIELD_TARGETS_DELTA = 'targetsDelta'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|ItemShippingTargetCollection */ public function getTargetsDelta(); diff --git a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder.php index b05dd460c2e..b392e7fc3c2 100644 --- a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder.php @@ -21,16 +21,19 @@ final class CartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?ItemShippingTargetCollection */ private $targetsDelta; /** + * @return null|string */ public function getLineItemId() @@ -39,6 +42,7 @@ public function getLineItemId() } /** + * @return null|ItemShippingTargetCollection */ public function getTargetsDelta() diff --git a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsActionModel.php b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsActionModel.php index de3105653c6..7f3b8e1afb0 100644 --- a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToLineItemShippingDetailsTargetsActionModel.php @@ -21,16 +21,19 @@ final class CartApplyDeltaToLineItemShippingDetailsTargetsActionModel extends Js { public const DISCRIMINATOR_VALUE = 'applyDeltaToLineItemShippingDetailsTargets'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ItemShippingTargetCollection */ protected $targetsDelta; @@ -41,14 +44,16 @@ final class CartApplyDeltaToLineItemShippingDetailsTargetsActionModel extends Js */ public function __construct( ?string $lineItemId = null, - ?ItemShippingTargetCollection $targetsDelta = null + ?ItemShippingTargetCollection $targetsDelta = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->targetsDelta = $targetsDelta; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -83,6 +89,7 @@ public function getLineItemId() } /** + * * @return null|ItemShippingTargetCollection */ public function getTargetsDelta() diff --git a/lib/commercetools-api/src/Models/Cart/CartBuilder.php b/lib/commercetools-api/src/Models/Cart/CartBuilder.php index 6f638e9ea7e..3c27052ee4e 100644 --- a/lib/commercetools-api/src/Models/Cart/CartBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartBuilder.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Cart; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceBuilder; use Commercetools\Api\Models\CartDiscount\CartDiscountReferenceCollection; use Commercetools\Api\Models\Common\Address; use Commercetools\Api\Models\Common\AddressBuilder; @@ -42,181 +44,241 @@ final class CartBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var ?string */ private $key; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $customerId; /** + * @var ?string */ private $customerEmail; /** + * @var ?string */ private $anonymousId; /** + + * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + */ + private $businessUnit; + + /** + * @var null|StoreKeyReference|StoreKeyReferenceBuilder */ private $store; /** + * @var ?LineItemCollection */ private $lineItems; /** + * @var ?CustomLineItemCollection */ private $customLineItems; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalPrice; /** + * @var null|TaxedPrice|TaxedPriceBuilder */ private $taxedPrice; /** + + * @var null|TaxedPrice|TaxedPriceBuilder + */ + private $taxedShippingPrice; + + /** + * @var ?string */ private $cartState; /** + * @var null|Address|AddressBuilder */ private $shippingAddress; /** + * @var null|Address|AddressBuilder */ private $billingAddress; /** + + * @var ?string + */ + private $shippingMode; + + /** + + * @var ?ShippingCollection + */ + private $shipping; + + /** + * @var ?string */ private $inventoryMode; /** + * @var ?string */ private $taxMode; /** + * @var ?string */ private $taxRoundingMode; /** + * @var ?string */ private $taxCalculationMode; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $customerGroup; /** + * @var ?string */ private $country; /** + * @var null|ShippingInfo|ShippingInfoBuilder */ private $shippingInfo; /** + * @var ?DiscountCodeInfoCollection */ private $discountCodes; /** + * @var ?DirectDiscountCollection */ private $directDiscounts; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var null|PaymentInfo|PaymentInfoBuilder */ private $paymentInfo; /** + * @var ?string */ private $locale; /** + * @var ?int */ private $deleteDaysAfterLastModification; /** + * @var ?CartDiscountReferenceCollection */ private $refusedGifts; /** + * @var ?string */ private $origin; /** + * @var null|ShippingRateInput|ShippingRateInputBuilder */ private $shippingRateInput; /** + * @var ?AddressCollection */ private $itemShippingAddresses; /** + * @var ?int */ private $totalLineItemQuantity; @@ -224,6 +286,7 @@ final class CartBuilder implements Builder /** *

Unique identifier of the Cart.

* + * @return null|string */ public function getId() @@ -234,6 +297,7 @@ public function getId() /** *

The current version of the cart.

* + * @return null|int */ public function getVersion() @@ -242,6 +306,7 @@ public function getVersion() } /** + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -250,6 +315,7 @@ public function getCreatedAt() } /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -260,6 +326,7 @@ public function getLastModifiedAt() /** *

User-defined unique identifier of the Cart.

* + * @return null|string */ public function getKey() @@ -270,6 +337,7 @@ public function getKey() /** *

Present on resources updated after 1 February 2019 except for events not tracked.

* + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -280,6 +348,7 @@ public function getLastModifiedBy() /** *

Present on resources created after 1 February 2019 except for events not tracked.

* + * @return null|CreatedBy */ public function getCreatedBy() @@ -288,6 +357,7 @@ public function getCreatedBy() } /** + * @return null|string */ public function getCustomerId() @@ -296,6 +366,7 @@ public function getCustomerId() } /** + * @return null|string */ public function getCustomerEmail() @@ -306,6 +377,7 @@ public function getCustomerEmail() /** *

Identifies carts and orders belonging to an anonymous session (the customer has not signed up/in yet).

* + * @return null|string */ public function getAnonymousId() @@ -314,6 +386,18 @@ public function getAnonymousId() } /** + *

The Business Unit the Cart belongs to.

+ * + + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit() + { + return $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit; + } + + /** + * @return null|StoreKeyReference */ public function getStore() @@ -322,6 +406,7 @@ public function getStore() } /** + * @return null|LineItemCollection */ public function getLineItems() @@ -330,6 +415,7 @@ public function getLineItems() } /** + * @return null|CustomLineItemCollection */ public function getCustomLineItems() @@ -341,6 +427,7 @@ public function getCustomLineItems() *

The sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property of each price.

* + * @return null|TypedMoney */ public function getTotalPrice() @@ -353,6 +440,7 @@ public function getTotalPrice() * Will be set automatically in the Platform TaxMode. * For the External tax mode it will be set as soon as the external tax rates for all line items, custom line items, and shipping in the cart are set.

* + * @return null|TaxedPrice */ public function getTaxedPrice() @@ -361,6 +449,19 @@ public function getTaxedPrice() } /** + *

Sum of taxedPrice of ShippingInfo across all Shipping Methods. + * For Platform TaxMode, it is set automatically only if shipping address is set or Shipping Method is added to the Cart.

+ * + + * @return null|TaxedPrice + */ + public function getTaxedShippingPrice() + { + return $this->taxedShippingPrice instanceof TaxedPriceBuilder ? $this->taxedShippingPrice->build() : $this->taxedShippingPrice; + } + + /** + * @return null|string */ public function getCartState() @@ -371,6 +472,7 @@ public function getCartState() /** *

The shipping address is used to determine the eligible shipping methods and rates as well as the tax rate of the line items.

* + * @return null|Address */ public function getShippingAddress() @@ -379,6 +481,7 @@ public function getShippingAddress() } /** + * @return null|Address */ public function getBillingAddress() @@ -387,6 +490,30 @@ public function getBillingAddress() } /** + *

Indicates whether one or multiple Shipping Methods are added to the Cart.

+ * + + * @return null|string + */ + public function getShippingMode() + { + return $this->shippingMode; + } + + /** + *

Holds all shipping-related information per Shipping Method of a Cart with Multiple ShippingMode.

+ *

It is automatically updated after the Shipping Method is added.

+ * + + * @return null|ShippingCollection + */ + public function getShipping() + { + return $this->shipping; + } + + /** + * @return null|string */ public function getInventoryMode() @@ -395,6 +522,7 @@ public function getInventoryMode() } /** + * @return null|string */ public function getTaxMode() @@ -405,6 +533,7 @@ public function getTaxMode() /** *

When calculating taxes for taxedPrice, the selected mode is used for rounding.

* + * @return null|string */ public function getTaxRoundingMode() @@ -415,6 +544,7 @@ public function getTaxRoundingMode() /** *

When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

* + * @return null|string */ public function getTaxCalculationMode() @@ -427,6 +557,7 @@ public function getTaxCalculationMode() * Used for product variant * price selection.

* + * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -438,6 +569,7 @@ public function getCustomerGroup() *

A two-digit country code as per ISO 3166-1 alpha-2. * Used for product variant price selection.

* + * @return null|string */ public function getCountry() @@ -446,8 +578,10 @@ public function getCountry() } /** - *

Set automatically once the ShippingMethod is set.

+ *

Shipping-related information of a Cart with Single ShippingMode. + * Set automatically once the ShippingMethod is set.

* + * @return null|ShippingInfo */ public function getShippingInfo() @@ -456,6 +590,7 @@ public function getShippingInfo() } /** + * @return null|DiscountCodeInfoCollection */ public function getDiscountCodes() @@ -464,6 +599,7 @@ public function getDiscountCodes() } /** + * @return null|DirectDiscountCollection */ public function getDirectDiscounts() @@ -472,6 +608,7 @@ public function getDirectDiscounts() } /** + * @return null|CustomFields */ public function getCustom() @@ -480,6 +617,7 @@ public function getCustom() } /** + * @return null|PaymentInfo */ public function getPaymentInfo() @@ -488,6 +626,7 @@ public function getPaymentInfo() } /** + * @return null|string */ public function getLocale() @@ -498,6 +637,7 @@ public function getLocale() /** *

The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState.

* + * @return null|int */ public function getDeleteDaysAfterLastModification() @@ -508,6 +648,7 @@ public function getDeleteDaysAfterLastModification() /** *

Automatically filled when a line item with LineItemMode GiftLineItem is removed from the cart.

* + * @return null|CartDiscountReferenceCollection */ public function getRefusedGifts() @@ -519,6 +660,7 @@ public function getRefusedGifts() *

The origin field indicates how this cart was created. * The value Customer indicates, that the cart was created by the customer.

* + * @return null|string */ public function getOrigin() @@ -529,6 +671,7 @@ public function getOrigin() /** *

The shippingRateInput is used as an input to select a ShippingRatePriceTier.

* + * @return null|ShippingRateInput */ public function getShippingRateInput() @@ -542,6 +685,7 @@ public function getShippingRateInput() * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. * Only the cart's shippingAddress is used for this.

* + * @return null|AddressCollection */ public function getItemShippingAddresses() @@ -552,6 +696,7 @@ public function getItemShippingAddresses() /** *

The sum off all the Line Items quantities. Does not take Custom Line Items into consideration.

* + * @return null|int */ public function getTotalLineItemQuantity() @@ -669,6 +814,17 @@ public function withAnonymousId(?string $anonymousId) return $this; } + /** + * @param ?BusinessUnitKeyReference $businessUnit + * @return $this + */ + public function withBusinessUnit(?BusinessUnitKeyReference $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + /** * @param ?StoreKeyReference $store * @return $this @@ -724,6 +880,17 @@ public function withTaxedPrice(?TaxedPrice $taxedPrice) return $this; } + /** + * @param ?TaxedPrice $taxedShippingPrice + * @return $this + */ + public function withTaxedShippingPrice(?TaxedPrice $taxedShippingPrice) + { + $this->taxedShippingPrice = $taxedShippingPrice; + + return $this; + } + /** * @param ?string $cartState * @return $this @@ -757,6 +924,28 @@ public function withBillingAddress(?Address $billingAddress) return $this; } + /** + * @param ?string $shippingMode + * @return $this + */ + public function withShippingMode(?string $shippingMode) + { + $this->shippingMode = $shippingMode; + + return $this; + } + + /** + * @param ?ShippingCollection $shipping + * @return $this + */ + public function withShipping(?ShippingCollection $shipping) + { + $this->shipping = $shipping; + + return $this; + } + /** * @param ?string $inventoryMode * @return $this @@ -977,6 +1166,17 @@ public function withCreatedByBuilder(?CreatedByBuilder $createdBy) return $this; } + /** + * @deprecated use withBusinessUnit() instead + * @return $this + */ + public function withBusinessUnitBuilder(?BusinessUnitKeyReferenceBuilder $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + /** * @deprecated use withStore() instead * @return $this @@ -1010,6 +1210,17 @@ public function withTaxedPriceBuilder(?TaxedPriceBuilder $taxedPrice) return $this; } + /** + * @deprecated use withTaxedShippingPrice() instead + * @return $this + */ + public function withTaxedShippingPriceBuilder(?TaxedPriceBuilder $taxedShippingPrice) + { + $this->taxedShippingPrice = $taxedShippingPrice; + + return $this; + } + /** * @deprecated use withShippingAddress() instead * @return $this @@ -1100,14 +1311,18 @@ public function build(): Cart $this->customerId, $this->customerEmail, $this->anonymousId, + $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit, $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store, $this->lineItems, $this->customLineItems, $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, $this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice, + $this->taxedShippingPrice instanceof TaxedPriceBuilder ? $this->taxedShippingPrice->build() : $this->taxedShippingPrice, $this->cartState, $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress, + $this->shippingMode, + $this->shipping, $this->inventoryMode, $this->taxMode, $this->taxRoundingMode, diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyAction.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyAction.php index 13b653e237c..c4ecefe3874 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyAction.php @@ -18,6 +18,7 @@ interface CartChangeCustomLineItemMoneyAction extends CartUpdateAction public const FIELD_MONEY = 'money'; /** + * @return null|string */ public function getCustomLineItemId(); @@ -26,6 +27,7 @@ public function getCustomLineItemId(); *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getMoney(); diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionBuilder.php index a37baa0048e..1d09a9fdf15 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionBuilder.php @@ -23,16 +23,19 @@ final class CartChangeCustomLineItemMoneyActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var null|Money|MoneyBuilder */ private $money; /** + * @return null|string */ public function getCustomLineItemId() @@ -44,6 +47,7 @@ public function getCustomLineItemId() *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getMoney() diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionModel.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionModel.php index 7680ac38131..54da0b96382 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionModel.php @@ -23,16 +23,19 @@ final class CartChangeCustomLineItemMoneyActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'changeCustomLineItemMoney'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?Money */ protected $money; @@ -43,14 +46,16 @@ final class CartChangeCustomLineItemMoneyActionModel extends JsonObjectModel imp */ public function __construct( ?string $customLineItemId = null, - ?Money $money = null + ?Money $money = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->money = $money; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -88,6 +94,7 @@ public function getCustomLineItemId() *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * * @return null|Money */ public function getMoney() diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeAction.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeAction.php new file mode 100644 index 00000000000..28c76422306 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeAction.php @@ -0,0 +1,44 @@ +ID of the Custom Line Item to be updated.

+ * + + * @return null|string + */ + public function getCustomLineItemId(); + + /** + *

New value to set.

+ * + + * @return null|string + */ + public function getMode(); + + /** + * @param ?string $customLineItemId + */ + public function setCustomLineItemId(?string $customLineItemId): void; + + /** + * @param ?string $mode + */ + public function setMode(?string $mode): void; +} diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionBuilder.php new file mode 100644 index 00000000000..b88ff87999b --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionBuilder.php @@ -0,0 +1,92 @@ + + */ +final class CartChangeCustomLineItemPriceModeActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $customLineItemId; + + /** + + * @var ?string + */ + private $mode; + + /** + *

ID of the Custom Line Item to be updated.

+ * + + * @return null|string + */ + public function getCustomLineItemId() + { + return $this->customLineItemId; + } + + /** + *

New value to set.

+ * + + * @return null|string + */ + public function getMode() + { + return $this->mode; + } + + /** + * @param ?string $customLineItemId + * @return $this + */ + public function withCustomLineItemId(?string $customLineItemId) + { + $this->customLineItemId = $customLineItemId; + + return $this; + } + + /** + * @param ?string $mode + * @return $this + */ + public function withMode(?string $mode) + { + $this->mode = $mode; + + return $this; + } + + + public function build(): CartChangeCustomLineItemPriceModeAction + { + return new CartChangeCustomLineItemPriceModeActionModel( + $this->customLineItemId, + $this->mode + ); + } + + public static function of(): CartChangeCustomLineItemPriceModeActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionCollection.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionCollection.php new file mode 100644 index 00000000000..7310d13edff --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionCollection.php @@ -0,0 +1,56 @@ + + * @method CartChangeCustomLineItemPriceModeAction current() + * @method CartChangeCustomLineItemPriceModeAction end() + * @method CartChangeCustomLineItemPriceModeAction at($offset) + */ +class CartChangeCustomLineItemPriceModeActionCollection extends CartUpdateActionCollection +{ + /** + * @psalm-assert CartChangeCustomLineItemPriceModeAction $value + * @psalm-param CartChangeCustomLineItemPriceModeAction|stdClass $value + * @throws InvalidArgumentException + * + * @return CartChangeCustomLineItemPriceModeActionCollection + */ + public function add($value) + { + if (!$value instanceof CartChangeCustomLineItemPriceModeAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CartChangeCustomLineItemPriceModeAction + */ + protected function mapper() + { + return function (?int $index): ?CartChangeCustomLineItemPriceModeAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CartChangeCustomLineItemPriceModeAction $data */ + $data = CartChangeCustomLineItemPriceModeActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionModel.php new file mode 100644 index 00000000000..ddc4214c596 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionModel.php @@ -0,0 +1,129 @@ +customLineItemId = $customLineItemId; + $this->mode = $mode; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

ID of the Custom Line Item to be updated.

+ * + * + * @return null|string + */ + public function getCustomLineItemId() + { + if (is_null($this->customLineItemId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_ID); + if (is_null($data)) { + return null; + } + $this->customLineItemId = (string) $data; + } + + return $this->customLineItemId; + } + + /** + *

New value to set.

+ * + * + * @return null|string + */ + public function getMode() + { + if (is_null($this->mode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_MODE); + if (is_null($data)) { + return null; + } + $this->mode = (string) $data; + } + + return $this->mode; + } + + + /** + * @param ?string $customLineItemId + */ + public function setCustomLineItemId(?string $customLineItemId): void + { + $this->customLineItemId = $customLineItemId; + } + + /** + * @param ?string $mode + */ + public function setMode(?string $mode): void + { + $this->mode = $mode; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityAction.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityAction.php index 369bc0e4236..0ca4640abd1 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityAction.php @@ -17,11 +17,13 @@ interface CartChangeCustomLineItemQuantityAction extends CartUpdateAction public const FIELD_QUANTITY = 'quantity'; /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionBuilder.php index 7233260afa7..b9ffbe2451a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionBuilder.php @@ -21,16 +21,19 @@ final class CartChangeCustomLineItemQuantityActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var ?int */ private $quantity; /** + * @return null|string */ public function getCustomLineItemId() @@ -39,6 +42,7 @@ public function getCustomLineItemId() } /** + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionModel.php index 69d1b5a3e6d..65ed645a5fe 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionModel.php @@ -21,16 +21,19 @@ final class CartChangeCustomLineItemQuantityActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'changeCustomLineItemQuantity'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?int */ protected $quantity; @@ -41,14 +44,16 @@ final class CartChangeCustomLineItemQuantityActionModel extends JsonObjectModel */ public function __construct( ?string $customLineItemId = null, - ?int $quantity = null + ?int $quantity = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->quantity = $quantity; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -83,6 +89,7 @@ public function getCustomLineItemId() } /** + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityAction.php b/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityAction.php index a8e04b1d61e..6e2109d8fd0 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityAction.php @@ -20,11 +20,13 @@ interface CartChangeLineItemQuantityAction extends CartUpdateAction public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|int */ public function getQuantity(); @@ -33,11 +35,13 @@ public function getQuantity(); *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getExternalPrice(); /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityActionBuilder.php index d0138f5d017..f1481401427 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityActionBuilder.php @@ -23,26 +23,31 @@ final class CartChangeLineItemQuantityActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?int */ private $quantity; /** + * @var null|Money|MoneyBuilder */ private $externalPrice; /** + * @var null|ExternalLineItemTotalPrice|ExternalLineItemTotalPriceBuilder */ private $externalTotalPrice; /** + * @return null|string */ public function getLineItemId() @@ -51,6 +56,7 @@ public function getLineItemId() } /** + * @return null|int */ public function getQuantity() @@ -62,6 +68,7 @@ public function getQuantity() *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getExternalPrice() @@ -70,6 +77,7 @@ public function getExternalPrice() } /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityActionModel.php index 94b2bcbd4cd..d002e5b9c30 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeLineItemQuantityActionModel.php @@ -23,26 +23,31 @@ final class CartChangeLineItemQuantityActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'changeLineItemQuantity'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?int */ protected $quantity; /** + * * @var ?Money */ protected $externalPrice; /** + * * @var ?ExternalLineItemTotalPrice */ protected $externalTotalPrice; @@ -55,16 +60,18 @@ public function __construct( ?string $lineItemId = null, ?int $quantity = null, ?Money $externalPrice = null, - ?ExternalLineItemTotalPrice $externalTotalPrice = null + ?ExternalLineItemTotalPrice $externalTotalPrice = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->quantity = $quantity; $this->externalPrice = $externalPrice; $this->externalTotalPrice = $externalTotalPrice; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -82,6 +89,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -99,6 +107,7 @@ public function getLineItemId() } /** + * * @return null|int */ public function getQuantity() @@ -119,6 +128,7 @@ public function getQuantity() *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * * @return null|Money */ public function getExternalPrice() @@ -137,6 +147,7 @@ public function getExternalPrice() } /** + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeAction.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeAction.php index ad64ab1f87a..7ffd4fd76d7 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeAction.php @@ -16,6 +16,7 @@ interface CartChangeTaxCalculationModeAction extends CartUpdateAction public const FIELD_TAX_CALCULATION_MODE = 'taxCalculationMode'; /** + * @return null|string */ public function getTaxCalculationMode(); diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeActionBuilder.php index 55513ea2deb..7a51bf65c4e 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeActionBuilder.php @@ -21,11 +21,13 @@ final class CartChangeTaxCalculationModeActionBuilder implements Builder { /** + * @var ?string */ private $taxCalculationMode; /** + * @return null|string */ public function getTaxCalculationMode() diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeActionModel.php index af04bcf551a..744d37ee86b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxCalculationModeActionModel.php @@ -21,11 +21,13 @@ final class CartChangeTaxCalculationModeActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'changeTaxCalculationMode'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $taxCalculationMode; @@ -35,13 +37,15 @@ final class CartChangeTaxCalculationModeActionModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?string $taxCalculationMode = null + ?string $taxCalculationMode = null, + ?string $action = null ) { $this->taxCalculationMode = $taxCalculationMode; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getTaxCalculationMode() diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeAction.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeAction.php index d9310bca0a1..64df642c6c4 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeAction.php @@ -16,6 +16,7 @@ interface CartChangeTaxModeAction extends CartUpdateAction public const FIELD_TAX_MODE = 'taxMode'; /** + * @return null|string */ public function getTaxMode(); diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeActionBuilder.php index 82d53c5840f..c418a48dd8c 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeActionBuilder.php @@ -21,11 +21,13 @@ final class CartChangeTaxModeActionBuilder implements Builder { /** + * @var ?string */ private $taxMode; /** + * @return null|string */ public function getTaxMode() diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeActionModel.php index da945e33d51..22259da9823 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxModeActionModel.php @@ -21,11 +21,13 @@ final class CartChangeTaxModeActionModel extends JsonObjectModel implements Cart { public const DISCRIMINATOR_VALUE = 'changeTaxMode'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $taxMode; @@ -35,13 +37,15 @@ final class CartChangeTaxModeActionModel extends JsonObjectModel implements Cart * @psalm-suppress MissingParamType */ public function __construct( - ?string $taxMode = null + ?string $taxMode = null, + ?string $action = null ) { $this->taxMode = $taxMode; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getTaxMode() diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeAction.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeAction.php index 5b5d479d408..c11d5cb597e 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeAction.php @@ -16,6 +16,7 @@ interface CartChangeTaxRoundingModeAction extends CartUpdateAction public const FIELD_TAX_ROUNDING_MODE = 'taxRoundingMode'; /** + * @return null|string */ public function getTaxRoundingMode(); diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeActionBuilder.php index 57e6d132693..d1b50302e02 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeActionBuilder.php @@ -21,11 +21,13 @@ final class CartChangeTaxRoundingModeActionBuilder implements Builder { /** + * @var ?string */ private $taxRoundingMode; /** + * @return null|string */ public function getTaxRoundingMode() diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeActionModel.php index 5c445520e9f..4d17d529f51 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeTaxRoundingModeActionModel.php @@ -21,11 +21,13 @@ final class CartChangeTaxRoundingModeActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'changeTaxRoundingMode'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $taxRoundingMode; @@ -35,13 +37,15 @@ final class CartChangeTaxRoundingModeActionModel extends JsonObjectModel impleme * @psalm-suppress MissingParamType */ public function __construct( - ?string $taxRoundingMode = null + ?string $taxRoundingMode = null, + ?string $action = null ) { $this->taxRoundingMode = $taxRoundingMode; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getTaxRoundingMode() diff --git a/lib/commercetools-api/src/Models/Cart/CartDraft.php b/lib/commercetools-api/src/Models/Cart/CartDraft.php index 7d97ec2a372..e5a30d675fb 100644 --- a/lib/commercetools-api/src/Models/Cart/CartDraft.php +++ b/lib/commercetools-api/src/Models/Cart/CartDraft.php @@ -8,6 +8,7 @@ namespace Commercetools\Api\Models\Cart; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifier; use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressCollection; use Commercetools\Api\Models\CustomerGroup\CustomerGroupResourceIdentifier; @@ -25,6 +26,7 @@ interface CartDraft extends JsonObject public const FIELD_CUSTOMER_EMAIL = 'customerEmail'; public const FIELD_CUSTOMER_GROUP = 'customerGroup'; public const FIELD_ANONYMOUS_ID = 'anonymousId'; + public const FIELD_BUSINESS_UNIT = 'businessUnit'; public const FIELD_STORE = 'store'; public const FIELD_COUNTRY = 'country'; public const FIELD_INVENTORY_MODE = 'inventoryMode'; @@ -41,6 +43,9 @@ interface CartDraft extends JsonObject public const FIELD_LOCALE = 'locale'; public const FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION = 'deleteDaysAfterLastModification'; public const FIELD_ORIGIN = 'origin'; + public const FIELD_SHIPPING_MODE = 'shippingMode'; + public const FIELD_CUSTOM_SHIPPING = 'customShipping'; + public const FIELD_SHIPPING = 'shipping'; public const FIELD_SHIPPING_RATE_INPUT = 'shippingRateInput'; public const FIELD_ITEM_SHIPPING_ADDRESSES = 'itemShippingAddresses'; public const FIELD_DISCOUNT_CODES = 'discountCodes'; @@ -48,6 +53,7 @@ interface CartDraft extends JsonObject /** *

A three-digit currency code as per ISO 4217.

* + * @return null|string */ public function getCurrency(); @@ -55,6 +61,7 @@ public function getCurrency(); /** *

User-defined unique identifier for the Cart.

* + * @return null|string */ public function getKey(); @@ -62,11 +69,13 @@ public function getKey(); /** *

Id of an existing Customer.

* + * @return null|string */ public function getCustomerId(); /** + * @return null|string */ public function getCustomerEmail(); @@ -75,6 +84,7 @@ public function getCustomerEmail(); *

Will be set automatically when the customerId is set and the customer is a member of a customer group. * Can be set explicitly when no customerId is present.

* + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup(); @@ -82,14 +92,24 @@ public function getCustomerGroup(); /** *

Assigns the new cart to an anonymous session (the customer has not signed up/in yet).

* + * @return null|string */ public function getAnonymousId(); + /** + *

The Business Unit the Cart belongs to.

+ * + + * @return null|BusinessUnitResourceIdentifier + */ + public function getBusinessUnit(); + /** *

Assigns the new cart to the store. * The store assignment can not be modified.

* + * @return null|StoreResourceIdentifier */ public function getStore(); @@ -97,6 +117,7 @@ public function getStore(); /** *

A two-digit country code as per ISO 3166-1 alpha-2.

* + * @return null|string */ public function getCountry(); @@ -104,6 +125,7 @@ public function getCountry(); /** *

Default inventory mode is None.

* + * @return null|string */ public function getInventoryMode(); @@ -111,6 +133,7 @@ public function getInventoryMode(); /** *

The default tax mode is Platform.

* + * @return null|string */ public function getTaxMode(); @@ -118,6 +141,7 @@ public function getTaxMode(); /** *

The default tax rounding mode is HalfEven.

* + * @return null|string */ public function getTaxRoundingMode(); @@ -125,16 +149,19 @@ public function getTaxRoundingMode(); /** *

The default tax calculation mode is LineItemLevel.

* + * @return null|string */ public function getTaxCalculationMode(); /** + * @return null|LineItemDraftCollection */ public function getLineItems(); /** + * @return null|CustomLineItemDraftCollection */ public function getCustomLineItems(); @@ -142,16 +169,19 @@ public function getCustomLineItems(); /** *

The shipping address is used to determine the eligible shipping methods and rates as well as the tax rate of the line items.

* + * @return null|BaseAddress */ public function getShippingAddress(); /** + * @return null|BaseAddress */ public function getBillingAddress(); /** + * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod(); @@ -159,6 +189,7 @@ public function getShippingMethod(); /** *

An external tax rate can be set for the shippingMethod if the cart has the External TaxMode.

* + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRateForShippingMethod(); @@ -166,6 +197,7 @@ public function getExternalTaxRateForShippingMethod(); /** *

The custom fields.

* + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -173,6 +205,7 @@ public function getCustom(); /** *

Must be one of the languages supported for this project

* + * @return null|string */ public function getLocale(); @@ -181,6 +214,7 @@ public function getLocale(); *

The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState. * If a ChangeSubscription for carts exists, a ResourceDeleted notification will be sent.

* + * @return null|int */ public function getDeleteDaysAfterLastModification(); @@ -188,10 +222,38 @@ public function getDeleteDaysAfterLastModification(); /** *

The default origin is Customer.

* + * @return null|string */ public function getOrigin(); + /** + *
    + *
  • If Single, only a single Shipping Method can be added to the Cart.
  • + *
  • If Multiple, multiple Shipping Methods can be added to the Cart.
  • + *
+ * + + * @return null|string + */ + public function getShippingMode(); + + /** + *

Custom Shipping Methods for a Cart with Multiple ShippingMode.

+ * + + * @return null|CustomShippingDraftCollection + */ + public function getCustomShipping(); + + /** + *

Shipping Methods for a Cart with Multiple ShippingMode.

+ * + + * @return null|ShippingDraftCollection + */ + public function getShipping(); + /** *

The shippingRateInput is used as an input to select a ShippingRatePriceTier. * Based on the definition of ShippingRateInputType. @@ -199,6 +261,7 @@ public function getOrigin(); * If CartScore is defined, it must be ScoreShippingRateInput. * Otherwise it can not bet set.

* + * @return null|ShippingRateInputDraft */ public function getShippingRateInput(); @@ -210,6 +273,7 @@ public function getShippingRateInput(); * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. * Only the cart's shippingAddress is used for this.

* + * @return null|BaseAddressCollection */ public function getItemShippingAddresses(); @@ -217,6 +281,7 @@ public function getItemShippingAddresses(); /** *

The code of existing DiscountCodes.

* + * @return null|array */ public function getDiscountCodes(); @@ -251,6 +316,11 @@ public function setCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup */ public function setAnonymousId(?string $anonymousId): void; + /** + * @param ?BusinessUnitResourceIdentifier $businessUnit + */ + public function setBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit): void; + /** * @param ?StoreResourceIdentifier $store */ @@ -331,6 +401,21 @@ public function setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModi */ public function setOrigin(?string $origin): void; + /** + * @param ?string $shippingMode + */ + public function setShippingMode(?string $shippingMode): void; + + /** + * @param ?CustomShippingDraftCollection $customShipping + */ + public function setCustomShipping(?CustomShippingDraftCollection $customShipping): void; + + /** + * @param ?ShippingDraftCollection $shipping + */ + public function setShipping(?ShippingDraftCollection $shipping): void; + /** * @param ?ShippingRateInputDraft $shippingRateInput */ diff --git a/lib/commercetools-api/src/Models/Cart/CartDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/CartDraftBuilder.php index 23760ebe799..cd5087468ff 100644 --- a/lib/commercetools-api/src/Models/Cart/CartDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartDraftBuilder.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Cart; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifier; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifierBuilder; use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressBuilder; use Commercetools\Api\Models\Common\BaseAddressCollection; @@ -32,126 +34,175 @@ final class CartDraftBuilder implements Builder { /** + * @var ?string */ private $currency; /** + * @var ?string */ private $key; /** + * @var ?string */ private $customerId; /** + * @var ?string */ private $customerEmail; /** + * @var null|CustomerGroupResourceIdentifier|CustomerGroupResourceIdentifierBuilder */ private $customerGroup; /** + * @var ?string */ private $anonymousId; /** + + * @var null|BusinessUnitResourceIdentifier|BusinessUnitResourceIdentifierBuilder + */ + private $businessUnit; + + /** + * @var null|StoreResourceIdentifier|StoreResourceIdentifierBuilder */ private $store; /** + * @var ?string */ private $country; /** + * @var ?string */ private $inventoryMode; /** + * @var ?string */ private $taxMode; /** + * @var ?string */ private $taxRoundingMode; /** + * @var ?string */ private $taxCalculationMode; /** + * @var ?LineItemDraftCollection */ private $lineItems; /** + * @var ?CustomLineItemDraftCollection */ private $customLineItems; /** + * @var null|BaseAddress|BaseAddressBuilder */ private $shippingAddress; /** + * @var null|BaseAddress|BaseAddressBuilder */ private $billingAddress; /** + * @var null|ShippingMethodResourceIdentifier|ShippingMethodResourceIdentifierBuilder */ private $shippingMethod; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRateForShippingMethod; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var ?string */ private $locale; /** + * @var ?int */ private $deleteDaysAfterLastModification; /** + * @var ?string */ private $origin; /** + + * @var ?string + */ + private $shippingMode; + + /** + + * @var ?CustomShippingDraftCollection + */ + private $customShipping; + + /** + + * @var ?ShippingDraftCollection + */ + private $shipping; + + /** + * @var null|ShippingRateInputDraft|ShippingRateInputDraftBuilder */ private $shippingRateInput; /** + * @var ?BaseAddressCollection */ private $itemShippingAddresses; /** + * @var ?array */ private $discountCodes; @@ -159,6 +210,7 @@ final class CartDraftBuilder implements Builder /** *

A three-digit currency code as per ISO 4217.

* + * @return null|string */ public function getCurrency() @@ -169,6 +221,7 @@ public function getCurrency() /** *

User-defined unique identifier for the Cart.

* + * @return null|string */ public function getKey() @@ -179,6 +232,7 @@ public function getKey() /** *

Id of an existing Customer.

* + * @return null|string */ public function getCustomerId() @@ -187,6 +241,7 @@ public function getCustomerId() } /** + * @return null|string */ public function getCustomerEmail() @@ -198,6 +253,7 @@ public function getCustomerEmail() *

Will be set automatically when the customerId is set and the customer is a member of a customer group. * Can be set explicitly when no customerId is present.

* + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() @@ -208,6 +264,7 @@ public function getCustomerGroup() /** *

Assigns the new cart to an anonymous session (the customer has not signed up/in yet).

* + * @return null|string */ public function getAnonymousId() @@ -215,10 +272,22 @@ public function getAnonymousId() return $this->anonymousId; } + /** + *

The Business Unit the Cart belongs to.

+ * + + * @return null|BusinessUnitResourceIdentifier + */ + public function getBusinessUnit() + { + return $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit; + } + /** *

Assigns the new cart to the store. * The store assignment can not be modified.

* + * @return null|StoreResourceIdentifier */ public function getStore() @@ -229,6 +298,7 @@ public function getStore() /** *

A two-digit country code as per ISO 3166-1 alpha-2.

* + * @return null|string */ public function getCountry() @@ -239,6 +309,7 @@ public function getCountry() /** *

Default inventory mode is None.

* + * @return null|string */ public function getInventoryMode() @@ -249,6 +320,7 @@ public function getInventoryMode() /** *

The default tax mode is Platform.

* + * @return null|string */ public function getTaxMode() @@ -259,6 +331,7 @@ public function getTaxMode() /** *

The default tax rounding mode is HalfEven.

* + * @return null|string */ public function getTaxRoundingMode() @@ -269,6 +342,7 @@ public function getTaxRoundingMode() /** *

The default tax calculation mode is LineItemLevel.

* + * @return null|string */ public function getTaxCalculationMode() @@ -277,6 +351,7 @@ public function getTaxCalculationMode() } /** + * @return null|LineItemDraftCollection */ public function getLineItems() @@ -285,6 +360,7 @@ public function getLineItems() } /** + * @return null|CustomLineItemDraftCollection */ public function getCustomLineItems() @@ -295,6 +371,7 @@ public function getCustomLineItems() /** *

The shipping address is used to determine the eligible shipping methods and rates as well as the tax rate of the line items.

* + * @return null|BaseAddress */ public function getShippingAddress() @@ -303,6 +380,7 @@ public function getShippingAddress() } /** + * @return null|BaseAddress */ public function getBillingAddress() @@ -311,6 +389,7 @@ public function getBillingAddress() } /** + * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod() @@ -321,6 +400,7 @@ public function getShippingMethod() /** *

An external tax rate can be set for the shippingMethod if the cart has the External TaxMode.

* + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRateForShippingMethod() @@ -331,6 +411,7 @@ public function getExternalTaxRateForShippingMethod() /** *

The custom fields.

* + * @return null|CustomFieldsDraft */ public function getCustom() @@ -341,6 +422,7 @@ public function getCustom() /** *

Must be one of the languages supported for this project

* + * @return null|string */ public function getLocale() @@ -352,6 +434,7 @@ public function getLocale() *

The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState. * If a ChangeSubscription for carts exists, a ResourceDeleted notification will be sent.

* + * @return null|int */ public function getDeleteDaysAfterLastModification() @@ -362,6 +445,7 @@ public function getDeleteDaysAfterLastModification() /** *

The default origin is Customer.

* + * @return null|string */ public function getOrigin() @@ -369,6 +453,42 @@ public function getOrigin() return $this->origin; } + /** + *
    + *
  • If Single, only a single Shipping Method can be added to the Cart.
  • + *
  • If Multiple, multiple Shipping Methods can be added to the Cart.
  • + *
+ * + + * @return null|string + */ + public function getShippingMode() + { + return $this->shippingMode; + } + + /** + *

Custom Shipping Methods for a Cart with Multiple ShippingMode.

+ * + + * @return null|CustomShippingDraftCollection + */ + public function getCustomShipping() + { + return $this->customShipping; + } + + /** + *

Shipping Methods for a Cart with Multiple ShippingMode.

+ * + + * @return null|ShippingDraftCollection + */ + public function getShipping() + { + return $this->shipping; + } + /** *

The shippingRateInput is used as an input to select a ShippingRatePriceTier. * Based on the definition of ShippingRateInputType. @@ -376,6 +496,7 @@ public function getOrigin() * If CartScore is defined, it must be ScoreShippingRateInput. * Otherwise it can not bet set.

* + * @return null|ShippingRateInputDraft */ public function getShippingRateInput() @@ -390,6 +511,7 @@ public function getShippingRateInput() * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. * Only the cart's shippingAddress is used for this.

* + * @return null|BaseAddressCollection */ public function getItemShippingAddresses() @@ -400,6 +522,7 @@ public function getItemShippingAddresses() /** *

The code of existing DiscountCodes.

* + * @return null|array */ public function getDiscountCodes() @@ -473,6 +596,17 @@ public function withAnonymousId(?string $anonymousId) return $this; } + /** + * @param ?BusinessUnitResourceIdentifier $businessUnit + * @return $this + */ + public function withBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + /** * @param ?StoreResourceIdentifier $store * @return $this @@ -649,6 +783,39 @@ public function withOrigin(?string $origin) return $this; } + /** + * @param ?string $shippingMode + * @return $this + */ + public function withShippingMode(?string $shippingMode) + { + $this->shippingMode = $shippingMode; + + return $this; + } + + /** + * @param ?CustomShippingDraftCollection $customShipping + * @return $this + */ + public function withCustomShipping(?CustomShippingDraftCollection $customShipping) + { + $this->customShipping = $customShipping; + + return $this; + } + + /** + * @param ?ShippingDraftCollection $shipping + * @return $this + */ + public function withShipping(?ShippingDraftCollection $shipping) + { + $this->shipping = $shipping; + + return $this; + } + /** * @param ?ShippingRateInputDraft $shippingRateInput * @return $this @@ -693,6 +860,17 @@ public function withCustomerGroupBuilder(?CustomerGroupResourceIdentifierBuilder return $this; } + /** + * @deprecated use withBusinessUnit() instead + * @return $this + */ + public function withBusinessUnitBuilder(?BusinessUnitResourceIdentifierBuilder $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + /** * @deprecated use withStore() instead * @return $this @@ -779,6 +957,7 @@ public function build(): CartDraft $this->customerEmail, $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup, $this->anonymousId, + $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit, $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store, $this->country, $this->inventoryMode, @@ -795,6 +974,9 @@ public function build(): CartDraft $this->locale, $this->deleteDaysAfterLastModification, $this->origin, + $this->shippingMode, + $this->customShipping, + $this->shipping, $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, $this->itemShippingAddresses, $this->discountCodes diff --git a/lib/commercetools-api/src/Models/Cart/CartDraftModel.php b/lib/commercetools-api/src/Models/Cart/CartDraftModel.php index 578c7961fd0..d2f598f7b73 100644 --- a/lib/commercetools-api/src/Models/Cart/CartDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartDraftModel.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Cart; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifier; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifierModel; use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressCollection; use Commercetools\Api\Models\Common\BaseAddressModel; @@ -31,126 +33,175 @@ final class CartDraftModel extends JsonObjectModel implements CartDraft { /** + * * @var ?string */ protected $currency; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $customerId; /** + * * @var ?string */ protected $customerEmail; /** + * * @var ?CustomerGroupResourceIdentifier */ protected $customerGroup; /** + * * @var ?string */ protected $anonymousId; /** + * + * @var ?BusinessUnitResourceIdentifier + */ + protected $businessUnit; + + /** + * * @var ?StoreResourceIdentifier */ protected $store; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $inventoryMode; /** + * * @var ?string */ protected $taxMode; /** + * * @var ?string */ protected $taxRoundingMode; /** + * * @var ?string */ protected $taxCalculationMode; /** + * * @var ?LineItemDraftCollection */ protected $lineItems; /** + * * @var ?CustomLineItemDraftCollection */ protected $customLineItems; /** + * * @var ?BaseAddress */ protected $shippingAddress; /** + * * @var ?BaseAddress */ protected $billingAddress; /** + * * @var ?ShippingMethodResourceIdentifier */ protected $shippingMethod; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRateForShippingMethod; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?string */ protected $locale; /** + * * @var ?int */ protected $deleteDaysAfterLastModification; /** + * * @var ?string */ protected $origin; /** + * + * @var ?string + */ + protected $shippingMode; + + /** + * + * @var ?CustomShippingDraftCollection + */ + protected $customShipping; + + /** + * + * @var ?ShippingDraftCollection + */ + protected $shipping; + + /** + * * @var ?ShippingRateInputDraft */ protected $shippingRateInput; /** + * * @var ?BaseAddressCollection */ protected $itemShippingAddresses; /** + * * @var ?array */ protected $discountCodes; @@ -166,6 +217,7 @@ public function __construct( ?string $customerEmail = null, ?CustomerGroupResourceIdentifier $customerGroup = null, ?string $anonymousId = null, + ?BusinessUnitResourceIdentifier $businessUnit = null, ?StoreResourceIdentifier $store = null, ?string $country = null, ?string $inventoryMode = null, @@ -182,6 +234,9 @@ public function __construct( ?string $locale = null, ?int $deleteDaysAfterLastModification = null, ?string $origin = null, + ?string $shippingMode = null, + ?CustomShippingDraftCollection $customShipping = null, + ?ShippingDraftCollection $shipping = null, ?ShippingRateInputDraft $shippingRateInput = null, ?BaseAddressCollection $itemShippingAddresses = null, ?array $discountCodes = null @@ -192,6 +247,7 @@ public function __construct( $this->customerEmail = $customerEmail; $this->customerGroup = $customerGroup; $this->anonymousId = $anonymousId; + $this->businessUnit = $businessUnit; $this->store = $store; $this->country = $country; $this->inventoryMode = $inventoryMode; @@ -208,6 +264,9 @@ public function __construct( $this->locale = $locale; $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; $this->origin = $origin; + $this->shippingMode = $shippingMode; + $this->customShipping = $customShipping; + $this->shipping = $shipping; $this->shippingRateInput = $shippingRateInput; $this->itemShippingAddresses = $itemShippingAddresses; $this->discountCodes = $discountCodes; @@ -216,6 +275,7 @@ public function __construct( /** *

A three-digit currency code as per ISO 4217.

* + * * @return null|string */ public function getCurrency() @@ -235,6 +295,7 @@ public function getCurrency() /** *

User-defined unique identifier for the Cart.

* + * * @return null|string */ public function getKey() @@ -254,6 +315,7 @@ public function getKey() /** *

Id of an existing Customer.

* + * * @return null|string */ public function getCustomerId() @@ -271,6 +333,7 @@ public function getCustomerId() } /** + * * @return null|string */ public function getCustomerEmail() @@ -291,6 +354,7 @@ public function getCustomerEmail() *

Will be set automatically when the customerId is set and the customer is a member of a customer group. * Can be set explicitly when no customerId is present.

* + * * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() @@ -311,6 +375,7 @@ public function getCustomerGroup() /** *

Assigns the new cart to an anonymous session (the customer has not signed up/in yet).

* + * * @return null|string */ public function getAnonymousId() @@ -327,10 +392,32 @@ public function getAnonymousId() return $this->anonymousId; } + /** + *

The Business Unit the Cart belongs to.

+ * + * + * @return null|BusinessUnitResourceIdentifier + */ + public function getBusinessUnit() + { + if (is_null($this->businessUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BUSINESS_UNIT); + if (is_null($data)) { + return null; + } + + $this->businessUnit = BusinessUnitResourceIdentifierModel::of($data); + } + + return $this->businessUnit; + } + /** *

Assigns the new cart to the store. * The store assignment can not be modified.

* + * * @return null|StoreResourceIdentifier */ public function getStore() @@ -351,6 +438,7 @@ public function getStore() /** *

A two-digit country code as per ISO 3166-1 alpha-2.

* + * * @return null|string */ public function getCountry() @@ -370,6 +458,7 @@ public function getCountry() /** *

Default inventory mode is None.

* + * * @return null|string */ public function getInventoryMode() @@ -389,6 +478,7 @@ public function getInventoryMode() /** *

The default tax mode is Platform.

* + * * @return null|string */ public function getTaxMode() @@ -408,6 +498,7 @@ public function getTaxMode() /** *

The default tax rounding mode is HalfEven.

* + * * @return null|string */ public function getTaxRoundingMode() @@ -427,6 +518,7 @@ public function getTaxRoundingMode() /** *

The default tax calculation mode is LineItemLevel.

* + * * @return null|string */ public function getTaxCalculationMode() @@ -444,6 +536,7 @@ public function getTaxCalculationMode() } /** + * * @return null|LineItemDraftCollection */ public function getLineItems() @@ -461,6 +554,7 @@ public function getLineItems() } /** + * * @return null|CustomLineItemDraftCollection */ public function getCustomLineItems() @@ -480,6 +574,7 @@ public function getCustomLineItems() /** *

The shipping address is used to determine the eligible shipping methods and rates as well as the tax rate of the line items.

* + * * @return null|BaseAddress */ public function getShippingAddress() @@ -498,6 +593,7 @@ public function getShippingAddress() } /** + * * @return null|BaseAddress */ public function getBillingAddress() @@ -516,6 +612,7 @@ public function getBillingAddress() } /** + * * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod() @@ -536,6 +633,7 @@ public function getShippingMethod() /** *

An external tax rate can be set for the shippingMethod if the cart has the External TaxMode.

* + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRateForShippingMethod() @@ -556,6 +654,7 @@ public function getExternalTaxRateForShippingMethod() /** *

The custom fields.

* + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -576,6 +675,7 @@ public function getCustom() /** *

Must be one of the languages supported for this project

* + * * @return null|string */ public function getLocale() @@ -596,6 +696,7 @@ public function getLocale() *

The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState. * If a ChangeSubscription for carts exists, a ResourceDeleted notification will be sent.

* + * * @return null|int */ public function getDeleteDaysAfterLastModification() @@ -615,6 +716,7 @@ public function getDeleteDaysAfterLastModification() /** *

The default origin is Customer.

* + * * @return null|string */ public function getOrigin() @@ -631,6 +733,69 @@ public function getOrigin() return $this->origin; } + /** + *
    + *
  • If Single, only a single Shipping Method can be added to the Cart.
  • + *
  • If Multiple, multiple Shipping Methods can be added to the Cart.
  • + *
+ * + * + * @return null|string + */ + public function getShippingMode() + { + if (is_null($this->shippingMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_MODE); + if (is_null($data)) { + return null; + } + $this->shippingMode = (string) $data; + } + + return $this->shippingMode; + } + + /** + *

Custom Shipping Methods for a Cart with Multiple ShippingMode.

+ * + * + * @return null|CustomShippingDraftCollection + */ + public function getCustomShipping() + { + if (is_null($this->customShipping)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_CUSTOM_SHIPPING); + if (is_null($data)) { + return null; + } + $this->customShipping = CustomShippingDraftCollection::fromArray($data); + } + + return $this->customShipping; + } + + /** + *

Shipping Methods for a Cart with Multiple ShippingMode.

+ * + * + * @return null|ShippingDraftCollection + */ + public function getShipping() + { + if (is_null($this->shipping)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SHIPPING); + if (is_null($data)) { + return null; + } + $this->shipping = ShippingDraftCollection::fromArray($data); + } + + return $this->shipping; + } + /** *

The shippingRateInput is used as an input to select a ShippingRatePriceTier. * Based on the definition of ShippingRateInputType. @@ -638,6 +803,7 @@ public function getOrigin() * If CartScore is defined, it must be ScoreShippingRateInput. * Otherwise it can not bet set.

* + * * @return null|ShippingRateInputDraft */ public function getShippingRateInput() @@ -662,6 +828,7 @@ public function getShippingRateInput() * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. * Only the cart's shippingAddress is used for this.

* + * * @return null|BaseAddressCollection */ public function getItemShippingAddresses() @@ -681,6 +848,7 @@ public function getItemShippingAddresses() /** *

The code of existing DiscountCodes.

* + * * @return null|array */ public function getDiscountCodes() @@ -746,6 +914,14 @@ public function setAnonymousId(?string $anonymousId): void $this->anonymousId = $anonymousId; } + /** + * @param ?BusinessUnitResourceIdentifier $businessUnit + */ + public function setBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit): void + { + $this->businessUnit = $businessUnit; + } + /** * @param ?StoreResourceIdentifier $store */ @@ -874,6 +1050,30 @@ public function setOrigin(?string $origin): void $this->origin = $origin; } + /** + * @param ?string $shippingMode + */ + public function setShippingMode(?string $shippingMode): void + { + $this->shippingMode = $shippingMode; + } + + /** + * @param ?CustomShippingDraftCollection $customShipping + */ + public function setCustomShipping(?CustomShippingDraftCollection $customShipping): void + { + $this->customShipping = $customShipping; + } + + /** + * @param ?ShippingDraftCollection $shipping + */ + public function setShipping(?ShippingDraftCollection $shipping): void + { + $this->shipping = $shipping; + } + /** * @param ?ShippingRateInputDraft $shippingRateInput */ diff --git a/lib/commercetools-api/src/Models/Cart/CartModel.php b/lib/commercetools-api/src/Models/Cart/CartModel.php index 12de57338f7..39fb6242174 100644 --- a/lib/commercetools-api/src/Models/Cart/CartModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartModel.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Cart; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceModel; use Commercetools\Api\Models\CartDiscount\CartDiscountReferenceCollection; use Commercetools\Api\Models\Common\Address; use Commercetools\Api\Models\Common\AddressCollection; @@ -41,181 +43,241 @@ final class CartModel extends JsonObjectModel implements Cart { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?string */ protected $key; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $customerId; /** + * * @var ?string */ protected $customerEmail; /** + * * @var ?string */ protected $anonymousId; /** + * + * @var ?BusinessUnitKeyReference + */ + protected $businessUnit; + + /** + * * @var ?StoreKeyReference */ protected $store; /** + * * @var ?LineItemCollection */ protected $lineItems; /** + * * @var ?CustomLineItemCollection */ protected $customLineItems; /** + * * @var ?TypedMoney */ protected $totalPrice; /** + * * @var ?TaxedPrice */ protected $taxedPrice; /** + * + * @var ?TaxedPrice + */ + protected $taxedShippingPrice; + + /** + * * @var ?string */ protected $cartState; /** + * * @var ?Address */ protected $shippingAddress; /** + * * @var ?Address */ protected $billingAddress; /** + * + * @var ?string + */ + protected $shippingMode; + + /** + * + * @var ?ShippingCollection + */ + protected $shipping; + + /** + * * @var ?string */ protected $inventoryMode; /** + * * @var ?string */ protected $taxMode; /** + * * @var ?string */ protected $taxRoundingMode; /** + * * @var ?string */ protected $taxCalculationMode; /** + * * @var ?CustomerGroupReference */ protected $customerGroup; /** + * * @var ?string */ protected $country; /** + * * @var ?ShippingInfo */ protected $shippingInfo; /** + * * @var ?DiscountCodeInfoCollection */ protected $discountCodes; /** + * * @var ?DirectDiscountCollection */ protected $directDiscounts; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?PaymentInfo */ protected $paymentInfo; /** + * * @var ?string */ protected $locale; /** + * * @var ?int */ protected $deleteDaysAfterLastModification; /** + * * @var ?CartDiscountReferenceCollection */ protected $refusedGifts; /** + * * @var ?string */ protected $origin; /** + * * @var ?ShippingRateInput */ protected $shippingRateInput; /** + * * @var ?AddressCollection */ protected $itemShippingAddresses; /** + * * @var ?int */ protected $totalLineItemQuantity; @@ -235,14 +297,18 @@ public function __construct( ?string $customerId = null, ?string $customerEmail = null, ?string $anonymousId = null, + ?BusinessUnitKeyReference $businessUnit = null, ?StoreKeyReference $store = null, ?LineItemCollection $lineItems = null, ?CustomLineItemCollection $customLineItems = null, ?TypedMoney $totalPrice = null, ?TaxedPrice $taxedPrice = null, + ?TaxedPrice $taxedShippingPrice = null, ?string $cartState = null, ?Address $shippingAddress = null, ?Address $billingAddress = null, + ?string $shippingMode = null, + ?ShippingCollection $shipping = null, ?string $inventoryMode = null, ?string $taxMode = null, ?string $taxRoundingMode = null, @@ -272,14 +338,18 @@ public function __construct( $this->customerId = $customerId; $this->customerEmail = $customerEmail; $this->anonymousId = $anonymousId; + $this->businessUnit = $businessUnit; $this->store = $store; $this->lineItems = $lineItems; $this->customLineItems = $customLineItems; $this->totalPrice = $totalPrice; $this->taxedPrice = $taxedPrice; + $this->taxedShippingPrice = $taxedShippingPrice; $this->cartState = $cartState; $this->shippingAddress = $shippingAddress; $this->billingAddress = $billingAddress; + $this->shippingMode = $shippingMode; + $this->shipping = $shipping; $this->inventoryMode = $inventoryMode; $this->taxMode = $taxMode; $this->taxRoundingMode = $taxRoundingMode; @@ -303,6 +373,7 @@ public function __construct( /** *

Unique identifier of the Cart.

* + * * @return null|string */ public function getId() @@ -322,6 +393,7 @@ public function getId() /** *

The current version of the cart.

* + * * @return null|int */ public function getVersion() @@ -339,6 +411,7 @@ public function getVersion() } /** + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -360,6 +433,7 @@ public function getCreatedAt() } /** + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -383,6 +457,7 @@ public function getLastModifiedAt() /** *

User-defined unique identifier of the Cart.

* + * * @return null|string */ public function getKey() @@ -402,6 +477,7 @@ public function getKey() /** *

Present on resources updated after 1 February 2019 except for events not tracked.

* + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -422,6 +498,7 @@ public function getLastModifiedBy() /** *

Present on resources created after 1 February 2019 except for events not tracked.

* + * * @return null|CreatedBy */ public function getCreatedBy() @@ -440,6 +517,7 @@ public function getCreatedBy() } /** + * * @return null|string */ public function getCustomerId() @@ -457,6 +535,7 @@ public function getCustomerId() } /** + * * @return null|string */ public function getCustomerEmail() @@ -476,6 +555,7 @@ public function getCustomerEmail() /** *

Identifies carts and orders belonging to an anonymous session (the customer has not signed up/in yet).

* + * * @return null|string */ public function getAnonymousId() @@ -493,6 +573,28 @@ public function getAnonymousId() } /** + *

The Business Unit the Cart belongs to.

+ * + * + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit() + { + if (is_null($this->businessUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BUSINESS_UNIT); + if (is_null($data)) { + return null; + } + + $this->businessUnit = BusinessUnitKeyReferenceModel::of($data); + } + + return $this->businessUnit; + } + + /** + * * @return null|StoreKeyReference */ public function getStore() @@ -511,6 +613,7 @@ public function getStore() } /** + * * @return null|LineItemCollection */ public function getLineItems() @@ -528,6 +631,7 @@ public function getLineItems() } /** + * * @return null|CustomLineItemCollection */ public function getCustomLineItems() @@ -548,6 +652,7 @@ public function getCustomLineItems() *

The sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property of each price.

* + * * @return null|TypedMoney */ public function getTotalPrice() @@ -570,6 +675,7 @@ public function getTotalPrice() * Will be set automatically in the Platform TaxMode. * For the External tax mode it will be set as soon as the external tax rates for all line items, custom line items, and shipping in the cart are set.

* + * * @return null|TaxedPrice */ public function getTaxedPrice() @@ -588,6 +694,29 @@ public function getTaxedPrice() } /** + *

Sum of taxedPrice of ShippingInfo across all Shipping Methods. + * For Platform TaxMode, it is set automatically only if shipping address is set or Shipping Method is added to the Cart.

+ * + * + * @return null|TaxedPrice + */ + public function getTaxedShippingPrice() + { + if (is_null($this->taxedShippingPrice)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TAXED_SHIPPING_PRICE); + if (is_null($data)) { + return null; + } + + $this->taxedShippingPrice = TaxedPriceModel::of($data); + } + + return $this->taxedShippingPrice; + } + + /** + * * @return null|string */ public function getCartState() @@ -607,6 +736,7 @@ public function getCartState() /** *

The shipping address is used to determine the eligible shipping methods and rates as well as the tax rate of the line items.

* + * * @return null|Address */ public function getShippingAddress() @@ -625,6 +755,7 @@ public function getShippingAddress() } /** + * * @return null|Address */ public function getBillingAddress() @@ -643,6 +774,48 @@ public function getBillingAddress() } /** + *

Indicates whether one or multiple Shipping Methods are added to the Cart.

+ * + * + * @return null|string + */ + public function getShippingMode() + { + if (is_null($this->shippingMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_MODE); + if (is_null($data)) { + return null; + } + $this->shippingMode = (string) $data; + } + + return $this->shippingMode; + } + + /** + *

Holds all shipping-related information per Shipping Method of a Cart with Multiple ShippingMode.

+ *

It is automatically updated after the Shipping Method is added.

+ * + * + * @return null|ShippingCollection + */ + public function getShipping() + { + if (is_null($this->shipping)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SHIPPING); + if (is_null($data)) { + return null; + } + $this->shipping = ShippingCollection::fromArray($data); + } + + return $this->shipping; + } + + /** + * * @return null|string */ public function getInventoryMode() @@ -660,6 +833,7 @@ public function getInventoryMode() } /** + * * @return null|string */ public function getTaxMode() @@ -679,6 +853,7 @@ public function getTaxMode() /** *

When calculating taxes for taxedPrice, the selected mode is used for rounding.

* + * * @return null|string */ public function getTaxRoundingMode() @@ -698,6 +873,7 @@ public function getTaxRoundingMode() /** *

When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

* + * * @return null|string */ public function getTaxCalculationMode() @@ -719,6 +895,7 @@ public function getTaxCalculationMode() * Used for product variant * price selection.

* + * * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -740,6 +917,7 @@ public function getCustomerGroup() *

A two-digit country code as per ISO 3166-1 alpha-2. * Used for product variant price selection.

* + * * @return null|string */ public function getCountry() @@ -757,7 +935,9 @@ public function getCountry() } /** - *

Set automatically once the ShippingMethod is set.

+ *

Shipping-related information of a Cart with Single ShippingMode. + * Set automatically once the ShippingMethod is set.

+ * * * @return null|ShippingInfo */ @@ -777,6 +957,7 @@ public function getShippingInfo() } /** + * * @return null|DiscountCodeInfoCollection */ public function getDiscountCodes() @@ -794,6 +975,7 @@ public function getDiscountCodes() } /** + * * @return null|DirectDiscountCollection */ public function getDirectDiscounts() @@ -811,6 +993,7 @@ public function getDirectDiscounts() } /** + * * @return null|CustomFields */ public function getCustom() @@ -829,6 +1012,7 @@ public function getCustom() } /** + * * @return null|PaymentInfo */ public function getPaymentInfo() @@ -847,6 +1031,7 @@ public function getPaymentInfo() } /** + * * @return null|string */ public function getLocale() @@ -866,6 +1051,7 @@ public function getLocale() /** *

The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState.

* + * * @return null|int */ public function getDeleteDaysAfterLastModification() @@ -885,6 +1071,7 @@ public function getDeleteDaysAfterLastModification() /** *

Automatically filled when a line item with LineItemMode GiftLineItem is removed from the cart.

* + * * @return null|CartDiscountReferenceCollection */ public function getRefusedGifts() @@ -905,6 +1092,7 @@ public function getRefusedGifts() *

The origin field indicates how this cart was created. * The value Customer indicates, that the cart was created by the customer.

* + * * @return null|string */ public function getOrigin() @@ -924,6 +1112,7 @@ public function getOrigin() /** *

The shippingRateInput is used as an input to select a ShippingRatePriceTier.

* + * * @return null|ShippingRateInput */ public function getShippingRateInput() @@ -947,6 +1136,7 @@ public function getShippingRateInput() * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. * Only the cart's shippingAddress is used for this.

* + * * @return null|AddressCollection */ public function getItemShippingAddresses() @@ -966,6 +1156,7 @@ public function getItemShippingAddresses() /** *

The sum off all the Line Items quantities. Does not take Custom Line Items into consideration.

* + * * @return null|int */ public function getTotalLineItemQuantity() @@ -1063,6 +1254,14 @@ public function setAnonymousId(?string $anonymousId): void $this->anonymousId = $anonymousId; } + /** + * @param ?BusinessUnitKeyReference $businessUnit + */ + public function setBusinessUnit(?BusinessUnitKeyReference $businessUnit): void + { + $this->businessUnit = $businessUnit; + } + /** * @param ?StoreKeyReference $store */ @@ -1103,6 +1302,14 @@ public function setTaxedPrice(?TaxedPrice $taxedPrice): void $this->taxedPrice = $taxedPrice; } + /** + * @param ?TaxedPrice $taxedShippingPrice + */ + public function setTaxedShippingPrice(?TaxedPrice $taxedShippingPrice): void + { + $this->taxedShippingPrice = $taxedShippingPrice; + } + /** * @param ?string $cartState */ @@ -1127,6 +1334,22 @@ public function setBillingAddress(?Address $billingAddress): void $this->billingAddress = $billingAddress; } + /** + * @param ?string $shippingMode + */ + public function setShippingMode(?string $shippingMode): void + { + $this->shippingMode = $shippingMode; + } + + /** + * @param ?ShippingCollection $shipping + */ + public function setShipping(?ShippingCollection $shipping): void + { + $this->shipping = $shipping; + } + /** * @param ?string $inventoryMode */ diff --git a/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponse.php b/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponse.php index 334d00e3720..d42e8f2e68c 100644 --- a/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponse.php @@ -22,16 +22,19 @@ interface CartPagedQueryResponse extends JsonObject /** *

Number of results requested.

* + * @return null|int */ public function getLimit(); /** + * @return null|int */ public function getCount(); /** + * @return null|int */ public function getTotal(); @@ -39,11 +42,13 @@ public function getTotal(); /** *

Number of elements skipped.

* + * @return null|int */ public function getOffset(); /** + * @return null|CartCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponseBuilder.php index 5dedffc5577..f829e499867 100644 --- a/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class CartPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?CartCollection */ private $results; @@ -48,6 +53,7 @@ final class CartPagedQueryResponseBuilder implements Builder /** *

Number of results requested.

* + * @return null|int */ public function getLimit() @@ -56,6 +62,7 @@ public function getLimit() } /** + * @return null|int */ public function getCount() @@ -64,6 +71,7 @@ public function getCount() } /** + * @return null|int */ public function getTotal() @@ -74,6 +82,7 @@ public function getTotal() /** *

Number of elements skipped.

* + * @return null|int */ public function getOffset() @@ -82,6 +91,7 @@ public function getOffset() } /** + * @return null|CartCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponseModel.php index 9e7a75bf923..246b766281a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class CartPagedQueryResponseModel extends JsonObjectModel implements CartPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?CartCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

Number of results requested.

* + * * @return null|int */ public function getLimit() @@ -82,6 +88,7 @@ public function getLimit() } /** + * * @return null|int */ public function getCount() @@ -99,6 +106,7 @@ public function getCount() } /** + * * @return null|int */ public function getTotal() @@ -118,6 +126,7 @@ public function getTotal() /** *

Number of elements skipped.

* + * * @return null|int */ public function getOffset() @@ -135,6 +144,7 @@ public function getOffset() } /** + * * @return null|CartCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Cart/CartRecalculateAction.php b/lib/commercetools-api/src/Models/Cart/CartRecalculateAction.php index 473fc704737..f3a98397420 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRecalculateAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartRecalculateAction.php @@ -20,6 +20,7 @@ interface CartRecalculateAction extends CartUpdateAction * If set to false, only the prices and tax rates of the line item will be updated. * Notice that if the Product's priceMode value is Embedded ProductPriceMode, the updated price of a line item may not correspond to a price in variant.prices anymore.

* + * @return null|bool */ public function getUpdateProductData(); diff --git a/lib/commercetools-api/src/Models/Cart/CartRecalculateActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartRecalculateActionBuilder.php index 57f9b43e051..57e0e670f40 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRecalculateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartRecalculateActionBuilder.php @@ -21,6 +21,7 @@ final class CartRecalculateActionBuilder implements Builder { /** + * @var ?bool */ private $updateProductData; @@ -30,6 +31,7 @@ final class CartRecalculateActionBuilder implements Builder * If set to false, only the prices and tax rates of the line item will be updated. * Notice that if the Product's priceMode value is Embedded ProductPriceMode, the updated price of a line item may not correspond to a price in variant.prices anymore.

* + * @return null|bool */ public function getUpdateProductData() diff --git a/lib/commercetools-api/src/Models/Cart/CartRecalculateActionModel.php b/lib/commercetools-api/src/Models/Cart/CartRecalculateActionModel.php index 02cb75f3e29..003d836b97b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRecalculateActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartRecalculateActionModel.php @@ -21,11 +21,13 @@ final class CartRecalculateActionModel extends JsonObjectModel implements CartRe { public const DISCRIMINATOR_VALUE = 'recalculate'; /** + * * @var ?string */ protected $action; /** + * * @var ?bool */ protected $updateProductData; @@ -35,13 +37,15 @@ final class CartRecalculateActionModel extends JsonObjectModel implements CartRe * @psalm-suppress MissingParamType */ public function __construct( - ?bool $updateProductData = null + ?bool $updateProductData = null, + ?string $action = null ) { $this->updateProductData = $updateProductData; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() * If set to false, only the prices and tax rates of the line item will be updated. * Notice that if the Product's priceMode value is Embedded ProductPriceMode, the updated price of a line item may not correspond to a price in variant.prices anymore.

* + * * @return null|bool */ public function getUpdateProductData() diff --git a/lib/commercetools-api/src/Models/Cart/CartReference.php b/lib/commercetools-api/src/Models/Cart/CartReference.php index 178f708cd8a..7649b0cc957 100644 --- a/lib/commercetools-api/src/Models/Cart/CartReference.php +++ b/lib/commercetools-api/src/Models/Cart/CartReference.php @@ -19,6 +19,7 @@ interface CartReference extends Reference /** *

Contains the representation of the expanded Cart. Only present in responses to requests with Reference Expansion for Carts.

* + * @return null|Cart */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

Unique identifier of the referenced Cart.

* + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/Cart/CartReferenceBuilder.php b/lib/commercetools-api/src/Models/Cart/CartReferenceBuilder.php index 398dab4ac13..d872412eb68 100644 --- a/lib/commercetools-api/src/Models/Cart/CartReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartReferenceBuilder.php @@ -23,11 +23,13 @@ final class CartReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|Cart|CartBuilder */ private $obj; @@ -35,6 +37,7 @@ final class CartReferenceBuilder implements Builder /** *

Unique identifier of the referenced Cart.

* + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

Contains the representation of the expanded Cart. Only present in responses to requests with Reference Expansion for Carts.

* + * @return null|Cart */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Cart/CartReferenceModel.php b/lib/commercetools-api/src/Models/Cart/CartReferenceModel.php index 51724dc6d8e..3d6797ad8b5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartReferenceModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartReferenceModel.php @@ -23,16 +23,19 @@ final class CartReferenceModel extends JsonObjectModel implements CartReference { public const DISCRIMINATOR_VALUE = 'cart'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?Cart */ protected $obj; @@ -43,16 +46,18 @@ final class CartReferenceModel extends JsonObjectModel implements CartReference */ public function __construct( ?string $id = null, - ?Cart $obj = null + ?Cart $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

Type of referenced resource.

* + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

Unique identifier of the referenced Cart.

* + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

Contains the representation of the expanded Cart. Only present in responses to requests with Reference Expansion for Carts.

* + * * @return null|Cart */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemAction.php b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemAction.php index b4ce90afafd..2940a81f4fa 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemAction.php @@ -16,6 +16,7 @@ interface CartRemoveCustomLineItemAction extends CartUpdateAction public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; /** + * @return null|string */ public function getCustomLineItemId(); diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionBuilder.php index dfd316c68b6..f2780568d89 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionBuilder.php @@ -21,11 +21,13 @@ final class CartRemoveCustomLineItemActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @return null|string */ public function getCustomLineItemId() diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionModel.php b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionModel.php index 5750cae83c2..a8ee1baf3f7 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionModel.php @@ -21,11 +21,13 @@ final class CartRemoveCustomLineItemActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'removeCustomLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; @@ -35,13 +37,15 @@ final class CartRemoveCustomLineItemActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?string $customLineItemId = null + ?string $customLineItemId = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeAction.php b/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeAction.php index b7306a1e51e..c9e541f02c4 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeAction.php @@ -19,6 +19,7 @@ interface CartRemoveDiscountCodeAction extends CartUpdateAction /** *

Reference to a DiscountCode.

* + * @return null|DiscountCodeReference */ public function getDiscountCode(); diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeActionBuilder.php index 44ae2150981..797ed4ad4bd 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeActionBuilder.php @@ -23,6 +23,7 @@ final class CartRemoveDiscountCodeActionBuilder implements Builder { /** + * @var null|DiscountCodeReference|DiscountCodeReferenceBuilder */ private $discountCode; @@ -30,6 +31,7 @@ final class CartRemoveDiscountCodeActionBuilder implements Builder /** *

Reference to a DiscountCode.

* + * @return null|DiscountCodeReference */ public function getDiscountCode() diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeActionModel.php index c407f230737..6495735039e 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveDiscountCodeActionModel.php @@ -23,11 +23,13 @@ final class CartRemoveDiscountCodeActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'removeDiscountCode'; /** + * * @var ?string */ protected $action; /** + * * @var ?DiscountCodeReference */ protected $discountCode; @@ -37,13 +39,15 @@ final class CartRemoveDiscountCodeActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?DiscountCodeReference $discountCode = null + ?DiscountCodeReference $discountCode = null, + ?string $action = null ) { $this->discountCode = $discountCode; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

Reference to a DiscountCode.

* + * * @return null|DiscountCodeReference */ public function getDiscountCode() diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressAction.php index 0f8464c8bc9..c7344a371bb 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressAction.php @@ -16,6 +16,7 @@ interface CartRemoveItemShippingAddressAction extends CartUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressActionBuilder.php index fe4c144e866..ded2db3caf4 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressActionBuilder.php @@ -21,11 +21,13 @@ final class CartRemoveItemShippingAddressActionBuilder implements Builder { /** + * @var ?string */ private $addressKey; /** + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressActionModel.php index 30b0b086822..84fa14e8c35 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveItemShippingAddressActionModel.php @@ -21,11 +21,13 @@ final class CartRemoveItemShippingAddressActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'removeItemShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressKey; @@ -35,13 +37,15 @@ final class CartRemoveItemShippingAddressActionModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemAction.php b/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemAction.php index afd669a4098..85136b4e228 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemAction.php @@ -21,11 +21,13 @@ interface CartRemoveLineItemAction extends CartUpdateAction public const FIELD_SHIPPING_DETAILS_TO_REMOVE = 'shippingDetailsToRemove'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|int */ public function getQuantity(); @@ -34,16 +36,19 @@ public function getQuantity(); *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getExternalPrice(); /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetailsToRemove(); diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemActionBuilder.php index b6d8beee35f..6992a12efbf 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemActionBuilder.php @@ -23,31 +23,37 @@ final class CartRemoveLineItemActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?int */ private $quantity; /** + * @var null|Money|MoneyBuilder */ private $externalPrice; /** + * @var null|ExternalLineItemTotalPrice|ExternalLineItemTotalPriceBuilder */ private $externalTotalPrice; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetailsToRemove; /** + * @return null|string */ public function getLineItemId() @@ -56,6 +62,7 @@ public function getLineItemId() } /** + * @return null|int */ public function getQuantity() @@ -67,6 +74,7 @@ public function getQuantity() *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getExternalPrice() @@ -75,6 +83,7 @@ public function getExternalPrice() } /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() @@ -83,6 +92,7 @@ public function getExternalTotalPrice() } /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetailsToRemove() diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemActionModel.php b/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemActionModel.php index 05b8ad143b6..9d1fefc2e6a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveLineItemActionModel.php @@ -23,31 +23,37 @@ final class CartRemoveLineItemActionModel extends JsonObjectModel implements Car { public const DISCRIMINATOR_VALUE = 'removeLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?int */ protected $quantity; /** + * * @var ?Money */ protected $externalPrice; /** + * * @var ?ExternalLineItemTotalPrice */ protected $externalTotalPrice; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetailsToRemove; @@ -61,17 +67,19 @@ public function __construct( ?int $quantity = null, ?Money $externalPrice = null, ?ExternalLineItemTotalPrice $externalTotalPrice = null, - ?ItemShippingDetailsDraft $shippingDetailsToRemove = null + ?ItemShippingDetailsDraft $shippingDetailsToRemove = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->quantity = $quantity; $this->externalPrice = $externalPrice; $this->externalTotalPrice = $externalTotalPrice; $this->shippingDetailsToRemove = $shippingDetailsToRemove; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -89,6 +97,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -106,6 +115,7 @@ public function getLineItemId() } /** + * * @return null|int */ public function getQuantity() @@ -126,6 +136,7 @@ public function getQuantity() *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * * @return null|Money */ public function getExternalPrice() @@ -144,6 +155,7 @@ public function getExternalPrice() } /** + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() @@ -162,6 +174,7 @@ public function getExternalTotalPrice() } /** + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetailsToRemove() diff --git a/lib/commercetools-api/src/Models/Cart/CartRemovePaymentAction.php b/lib/commercetools-api/src/Models/Cart/CartRemovePaymentAction.php index 193a7b51ddb..b98badde8c4 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemovePaymentAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemovePaymentAction.php @@ -17,6 +17,7 @@ interface CartRemovePaymentAction extends CartUpdateAction public const FIELD_PAYMENT = 'payment'; /** + * @return null|PaymentResourceIdentifier */ public function getPayment(); diff --git a/lib/commercetools-api/src/Models/Cart/CartRemovePaymentActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartRemovePaymentActionBuilder.php index ba429c76d86..9cec9ea55a6 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemovePaymentActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemovePaymentActionBuilder.php @@ -23,11 +23,13 @@ final class CartRemovePaymentActionBuilder implements Builder { /** + * @var null|PaymentResourceIdentifier|PaymentResourceIdentifierBuilder */ private $payment; /** + * @return null|PaymentResourceIdentifier */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Cart/CartRemovePaymentActionModel.php b/lib/commercetools-api/src/Models/Cart/CartRemovePaymentActionModel.php index d2d86b6e5de..7a72f6c176f 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemovePaymentActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemovePaymentActionModel.php @@ -23,11 +23,13 @@ final class CartRemovePaymentActionModel extends JsonObjectModel implements Cart { public const DISCRIMINATOR_VALUE = 'removePayment'; /** + * * @var ?string */ protected $action; /** + * * @var ?PaymentResourceIdentifier */ protected $payment; @@ -37,13 +39,15 @@ final class CartRemovePaymentActionModel extends JsonObjectModel implements Cart * @psalm-suppress MissingParamType */ public function __construct( - ?PaymentResourceIdentifier $payment = null + ?PaymentResourceIdentifier $payment = null, + ?string $action = null ) { $this->payment = $payment; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|PaymentResourceIdentifier */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodAction.php b/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodAction.php new file mode 100644 index 00000000000..db843af3edd --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodAction.php @@ -0,0 +1,30 @@ +User-defined unique identifier of the Shipping Method to remove in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey(); + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; +} diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodActionBuilder.php new file mode 100644 index 00000000000..b689311a3e1 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodActionBuilder.php @@ -0,0 +1,63 @@ + + */ +final class CartRemoveShippingMethodActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $shippingKey; + + /** + *

User-defined unique identifier of the Shipping Method to remove in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + + + public function build(): CartRemoveShippingMethodAction + { + return new CartRemoveShippingMethodActionModel( + $this->shippingKey + ); + } + + public static function of(): CartRemoveShippingMethodActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodActionCollection.php b/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodActionCollection.php new file mode 100644 index 00000000000..77023fe9a8a --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodActionCollection.php @@ -0,0 +1,56 @@ + + * @method CartRemoveShippingMethodAction current() + * @method CartRemoveShippingMethodAction end() + * @method CartRemoveShippingMethodAction at($offset) + */ +class CartRemoveShippingMethodActionCollection extends CartUpdateActionCollection +{ + /** + * @psalm-assert CartRemoveShippingMethodAction $value + * @psalm-param CartRemoveShippingMethodAction|stdClass $value + * @throws InvalidArgumentException + * + * @return CartRemoveShippingMethodActionCollection + */ + public function add($value) + { + if (!$value instanceof CartRemoveShippingMethodAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CartRemoveShippingMethodAction + */ + protected function mapper() + { + return function (?int $index): ?CartRemoveShippingMethodAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CartRemoveShippingMethodAction $data */ + $data = CartRemoveShippingMethodActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodActionModel.php b/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodActionModel.php new file mode 100644 index 00000000000..e78a76b4ec9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveShippingMethodActionModel.php @@ -0,0 +1,93 @@ +shippingKey = $shippingKey; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

User-defined unique identifier of the Shipping Method to remove in a Cart with Multiple ShippingMode.

+ * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartResourceIdentifier.php b/lib/commercetools-api/src/Models/Cart/CartResourceIdentifier.php index 6bac09460a2..260229d903b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/Cart/CartResourceIdentifier.php @@ -17,6 +17,7 @@ interface CartResourceIdentifier extends ResourceIdentifier /** *

Unique identifier of the referenced Cart. Either id or key is required.

* + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

User-defined unique identifier of the referenced Cart. Either id or key is required.

* + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Cart/CartResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/Cart/CartResourceIdentifierBuilder.php index c90e6c95b2d..34beee94443 100644 --- a/lib/commercetools-api/src/Models/Cart/CartResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class CartResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class CartResourceIdentifierBuilder implements Builder /** *

Unique identifier of the referenced Cart. Either id or key is required.

* + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

User-defined unique identifier of the referenced Cart. Either id or key is required.

* + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Cart/CartResourceIdentifierModel.php b/lib/commercetools-api/src/Models/Cart/CartResourceIdentifierModel.php index b7eb32e1b3c..7817d7f0ffb 100644 --- a/lib/commercetools-api/src/Models/Cart/CartResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class CartResourceIdentifierModel extends JsonObjectModel implements CartR { public const DISCRIMINATOR_VALUE = 'cart'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class CartResourceIdentifierModel extends JsonObjectModel implements CartR */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

* + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

Unique identifier of the referenced Cart. Either id or key is required.

* + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

User-defined unique identifier of the referenced Cart. Either id or key is required.

* + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdAction.php b/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdAction.php index 6e0fea1df96..f5acd745c2b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdAction.php @@ -18,6 +18,7 @@ interface CartSetAnonymousIdAction extends CartUpdateAction /** *

If not set, any existing anonymous ID will be removed.

* + * @return null|string */ public function getAnonymousId(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdActionBuilder.php index 905970b40df..560e59fe2a7 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdActionBuilder.php @@ -21,6 +21,7 @@ final class CartSetAnonymousIdActionBuilder implements Builder { /** + * @var ?string */ private $anonymousId; @@ -28,6 +29,7 @@ final class CartSetAnonymousIdActionBuilder implements Builder /** *

If not set, any existing anonymous ID will be removed.

* + * @return null|string */ public function getAnonymousId() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdActionModel.php index f712245f306..c22b12ca59f 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetAnonymousIdActionModel.php @@ -21,11 +21,13 @@ final class CartSetAnonymousIdActionModel extends JsonObjectModel implements Car { public const DISCRIMINATOR_VALUE = 'setAnonymousId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $anonymousId; @@ -35,13 +37,15 @@ final class CartSetAnonymousIdActionModel extends JsonObjectModel implements Car * @psalm-suppress MissingParamType */ public function __construct( - ?string $anonymousId = null + ?string $anonymousId = null, + ?string $action = null ) { $this->anonymousId = $anonymousId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

If not set, any existing anonymous ID will be removed.

* + * * @return null|string */ public function getAnonymousId() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressAction.php b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressAction.php index 03f847f7b94..cb4581bd77f 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressAction.php @@ -17,6 +17,7 @@ interface CartSetBillingAddressAction extends CartUpdateAction public const FIELD_ADDRESS = 'address'; /** + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressActionBuilder.php index 7fc886fab41..3cca6ab90d3 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressActionBuilder.php @@ -23,11 +23,13 @@ final class CartSetBillingAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressActionModel.php index bfadcfd8e64..3aad9b182f5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressActionModel.php @@ -23,11 +23,13 @@ final class CartSetBillingAddressActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setBillingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -37,13 +39,15 @@ final class CartSetBillingAddressActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomFieldAction.php index 7513454d2b0..b66223680f6 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomFieldAction.php @@ -19,6 +19,7 @@ interface CartSetBillingAddressCustomFieldAction extends CartUpdateAction /** *

Name of the Custom Field.

* + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomFieldActionBuilder.php index b894b56aec5..d783e4a627a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class CartSetBillingAddressCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class CartSetBillingAddressCustomFieldActionBuilder implements Builder /** *

Name of the Custom Field.

* + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomFieldActionModel.php index de69834f73d..acacd801c4c 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class CartSetBillingAddressCustomFieldActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setBillingAddressCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class CartSetBillingAddressCustomFieldActionModel extends JsonObjectModel */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

Name of the Custom Field.

* + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomTypeAction.php index 539ebddeb1b..9b52be6667d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomTypeAction.php @@ -22,6 +22,7 @@ interface CartSetBillingAddressCustomTypeAction extends CartUpdateAction *

Defines the Type that extends the billingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the billingAddress.

* + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

Sets the Custom Fields fields for the billingAddress.

* + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomTypeActionBuilder.php index e48c41c1a6d..5e04c569934 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class CartSetBillingAddressCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class CartSetBillingAddressCustomTypeActionBuilder implements Builder *

Defines the Type that extends the billingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the billingAddress.

* + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

Sets the Custom Fields fields for the billingAddress.

* + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomTypeActionModel.php index 155fdde1267..dc5777488c8 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetBillingAddressCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class CartSetBillingAddressCustomTypeActionModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'setBillingAddressCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class CartSetBillingAddressCustomTypeActionModel extends JsonObjectModel i */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

Defines the Type that extends the billingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the billingAddress.

* + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

Sets the Custom Fields fields for the billingAddress.

* + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxAction.php index 7fcaa41419d..e1caa0a794d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxAction.php @@ -20,11 +20,13 @@ interface CartSetCartTotalTaxAction extends CartUpdateAction /** *

The total gross amount of the cart (totalNet + taxes).

* + * @return null|Money */ public function getExternalTotalGross(); /** + * @return null|TaxPortionDraftCollection */ public function getExternalTaxPortions(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxActionBuilder.php index 8f98685abeb..2666912d354 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxActionBuilder.php @@ -23,11 +23,13 @@ final class CartSetCartTotalTaxActionBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $externalTotalGross; /** + * @var ?TaxPortionDraftCollection */ private $externalTaxPortions; @@ -35,6 +37,7 @@ final class CartSetCartTotalTaxActionBuilder implements Builder /** *

The total gross amount of the cart (totalNet + taxes).

* + * @return null|Money */ public function getExternalTotalGross() @@ -43,6 +46,7 @@ public function getExternalTotalGross() } /** + * @return null|TaxPortionDraftCollection */ public function getExternalTaxPortions() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxActionModel.php index 704bf30f8bf..8e73054e544 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCartTotalTaxActionModel.php @@ -23,16 +23,19 @@ final class CartSetCartTotalTaxActionModel extends JsonObjectModel implements Ca { public const DISCRIMINATOR_VALUE = 'setCartTotalTax'; /** + * * @var ?string */ protected $action; /** + * * @var ?Money */ protected $externalTotalGross; /** + * * @var ?TaxPortionDraftCollection */ protected $externalTaxPortions; @@ -43,14 +46,16 @@ final class CartSetCartTotalTaxActionModel extends JsonObjectModel implements Ca */ public function __construct( ?Money $externalTotalGross = null, - ?TaxPortionDraftCollection $externalTaxPortions = null + ?TaxPortionDraftCollection $externalTaxPortions = null, + ?string $action = null ) { $this->externalTotalGross = $externalTotalGross; $this->externalTaxPortions = $externalTaxPortions; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() /** *

The total gross amount of the cart (totalNet + taxes).

* + * * @return null|Money */ public function getExternalTotalGross() @@ -88,6 +94,7 @@ public function getExternalTotalGross() } /** + * * @return null|TaxPortionDraftCollection */ public function getExternalTaxPortions() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCountryAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCountryAction.php index 651d14165c5..301678b539f 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCountryAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCountryAction.php @@ -18,6 +18,7 @@ interface CartSetCountryAction extends CartUpdateAction /** *

Two-digit country code as per ISO 3166-1 alpha-2.

* + * @return null|string */ public function getCountry(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCountryActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCountryActionBuilder.php index 1cb202c479c..da6cf790f67 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCountryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCountryActionBuilder.php @@ -21,6 +21,7 @@ final class CartSetCountryActionBuilder implements Builder { /** + * @var ?string */ private $country; @@ -28,6 +29,7 @@ final class CartSetCountryActionBuilder implements Builder /** *

Two-digit country code as per ISO 3166-1 alpha-2.

* + * @return null|string */ public function getCountry() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCountryActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCountryActionModel.php index 652c8eee5c4..0905507420d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCountryActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCountryActionModel.php @@ -21,11 +21,13 @@ final class CartSetCountryActionModel extends JsonObjectModel implements CartSet { public const DISCRIMINATOR_VALUE = 'setCountry'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $country; @@ -35,13 +37,15 @@ final class CartSetCountryActionModel extends JsonObjectModel implements CartSet * @psalm-suppress MissingParamType */ public function __construct( - ?string $country = null + ?string $country = null, + ?string $action = null ) { $this->country = $country; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

Two-digit country code as per ISO 3166-1 alpha-2.

* + * * @return null|string */ public function getCountry() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomFieldAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomFieldAction.php index d52337a125b..71277093b25 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface CartSetCustomFieldAction extends CartUpdateAction /** *

Name of the Custom Field.

* + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomFieldActionBuilder.php index 28b656ac7f0..c088f371965 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class CartSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class CartSetCustomFieldActionBuilder implements Builder /** *

Name of the Custom Field.

* + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomFieldActionModel.php index 4177b7a8b65..329a3b34dfa 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class CartSetCustomFieldActionModel extends JsonObjectModel implements Car { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class CartSetCustomFieldActionModel extends JsonObjectModel implements Car */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

Name of the Custom Field.

* + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldAction.php index c7416a5918a..3fef76ca0a7 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldAction.php @@ -18,6 +18,7 @@ interface CartSetCustomLineItemCustomFieldAction extends CartUpdateAction public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getCustomLineItemId(); @@ -25,6 +26,7 @@ public function getCustomLineItemId(); /** *

Name of the Custom Field.

* + * @return null|string */ public function getName(); @@ -34,6 +36,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionBuilder.php index 75451f7ffa4..04d23eea4f6 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class CartSetCustomLineItemCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getCustomLineItemId() @@ -46,6 +50,7 @@ public function getCustomLineItemId() /** *

Name of the Custom Field.

* + * @return null|string */ public function getName() @@ -58,6 +63,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionModel.php index fdd1ef64e73..8d79db44e8f 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class CartSetCustomLineItemCustomFieldActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setCustomLineItemCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class CartSetCustomLineItemCustomFieldActionModel extends JsonObjectModel public function __construct( ?string $customLineItemId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -92,6 +99,7 @@ public function getCustomLineItemId() /** *

Name of the Custom Field.

* + * * @return null|string */ public function getName() @@ -113,6 +121,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeAction.php index e5e8cf82091..0c64383c6d0 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeAction.php @@ -20,6 +20,7 @@ interface CartSetCustomLineItemCustomTypeAction extends CartUpdateAction public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getCustomLineItemId(); @@ -28,6 +29,7 @@ public function getCustomLineItemId(); *

Defines the Type that extends the CustomLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

* + * @return null|TypeResourceIdentifier */ public function getType(); @@ -35,6 +37,7 @@ public function getType(); /** *

Sets the Custom Fields fields for the CustomLineItem.

* + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionBuilder.php index 997900574a0..b5a5da7797f 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class CartSetCustomLineItemCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getCustomLineItemId() @@ -51,6 +55,7 @@ public function getCustomLineItemId() *

Defines the Type that extends the CustomLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

* + * @return null|TypeResourceIdentifier */ public function getType() @@ -61,6 +66,7 @@ public function getType() /** *

Sets the Custom Fields fields for the CustomLineItem.

* + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionModel.php index 1adc3af43dd..74d85847d37 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionModel.php @@ -25,21 +25,25 @@ final class CartSetCustomLineItemCustomTypeActionModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'setCustomLineItemCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -51,15 +55,17 @@ final class CartSetCustomLineItemCustomTypeActionModel extends JsonObjectModel i public function __construct( ?string $customLineItemId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -97,6 +104,7 @@ public function getCustomLineItemId() *

Defines the Type that extends the CustomLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

* + * * @return null|TypeResourceIdentifier */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

Sets the Custom Fields fields for the CustomLineItem.

* + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsAction.php index 36cb1db1a7a..71d3888c802 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsAction.php @@ -17,11 +17,13 @@ interface CartSetCustomLineItemShippingDetailsAction extends CartUpdateAction public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionBuilder.php index cdeda271139..7d4096aaa06 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionBuilder.php @@ -21,16 +21,19 @@ final class CartSetCustomLineItemShippingDetailsActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetails; /** + * @return null|string */ public function getCustomLineItemId() @@ -39,6 +42,7 @@ public function getCustomLineItemId() } /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionModel.php index f3d5d9d59b4..13fdf0f5ec7 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionModel.php @@ -21,16 +21,19 @@ final class CartSetCustomLineItemShippingDetailsActionModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'setCustomLineItemShippingDetails'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; @@ -41,14 +44,16 @@ final class CartSetCustomLineItemShippingDetailsActionModel extends JsonObjectMo */ public function __construct( ?string $customLineItemId = null, - ?ItemShippingDetailsDraft $shippingDetails = null + ?ItemShippingDetailsDraft $shippingDetails = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->shippingDetails = $shippingDetails; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -83,6 +89,7 @@ public function getCustomLineItemId() } /** + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountAction.php index 1d488b8de6b..6599c44e066 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountAction.php @@ -17,11 +17,13 @@ interface CartSetCustomLineItemTaxAmountAction extends CartUpdateAction public const FIELD_EXTERNAL_TAX_AMOUNT = 'externalTaxAmount'; /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionBuilder.php index 50a6fc85e66..f683816f848 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionBuilder.php @@ -21,16 +21,19 @@ final class CartSetCustomLineItemTaxAmountActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var null|ExternalTaxAmountDraft|ExternalTaxAmountDraftBuilder */ private $externalTaxAmount; /** + * @return null|string */ public function getCustomLineItemId() @@ -39,6 +42,7 @@ public function getCustomLineItemId() } /** + * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionModel.php index f5e0ae29058..f09ac38acf3 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionModel.php @@ -21,16 +21,19 @@ final class CartSetCustomLineItemTaxAmountActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'setCustomLineItemTaxAmount'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?ExternalTaxAmountDraft */ protected $externalTaxAmount; @@ -41,14 +44,16 @@ final class CartSetCustomLineItemTaxAmountActionModel extends JsonObjectModel im */ public function __construct( ?string $customLineItemId = null, - ?ExternalTaxAmountDraft $externalTaxAmount = null + ?ExternalTaxAmountDraft $externalTaxAmount = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->externalTaxAmount = $externalTaxAmount; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -83,6 +89,7 @@ public function getCustomLineItemId() } /** + * * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateAction.php index 0ded07f3aff..187f42a03ab 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateAction.php @@ -17,11 +17,13 @@ interface CartSetCustomLineItemTaxRateAction extends CartUpdateAction public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionBuilder.php index c839bf0f039..a94cc96c36c 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionBuilder.php @@ -21,16 +21,19 @@ final class CartSetCustomLineItemTaxRateActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** + * @return null|string */ public function getCustomLineItemId() @@ -39,6 +42,7 @@ public function getCustomLineItemId() } /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionModel.php index e14df60b11a..f8171ecdabe 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionModel.php @@ -21,16 +21,19 @@ final class CartSetCustomLineItemTaxRateActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setCustomLineItemTaxRate'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; @@ -41,14 +44,16 @@ final class CartSetCustomLineItemTaxRateActionModel extends JsonObjectModel impl */ public function __construct( ?string $customLineItemId = null, - ?ExternalTaxRateDraft $externalTaxRate = null + ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->externalTaxRate = $externalTaxRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -83,6 +89,7 @@ public function getCustomLineItemId() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodAction.php index 5f36548c0b8..8560809c5f1 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodAction.php @@ -21,11 +21,13 @@ interface CartSetCustomShippingMethodAction extends CartUpdateAction public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + * @return null|string */ public function getShippingMethodName(); /** + * @return null|ShippingRateDraft */ public function getShippingRate(); @@ -33,11 +35,13 @@ public function getShippingRate(); /** *

ResourceIdentifier to a TaxCategory.

* + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory(); /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionBuilder.php index b2a141344dc..b188f2dd087 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionBuilder.php @@ -25,26 +25,31 @@ final class CartSetCustomShippingMethodActionBuilder implements Builder { /** + * @var ?string */ private $shippingMethodName; /** + * @var null|ShippingRateDraft|ShippingRateDraftBuilder */ private $shippingRate; /** + * @var null|TaxCategoryResourceIdentifier|TaxCategoryResourceIdentifierBuilder */ private $taxCategory; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** + * @return null|string */ public function getShippingMethodName() @@ -53,6 +58,7 @@ public function getShippingMethodName() } /** + * @return null|ShippingRateDraft */ public function getShippingRate() @@ -63,6 +69,7 @@ public function getShippingRate() /** *

ResourceIdentifier to a TaxCategory.

* + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -71,6 +78,7 @@ public function getTaxCategory() } /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionModel.php index 11282f73baa..91460c9cd61 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionModel.php @@ -25,26 +25,31 @@ final class CartSetCustomShippingMethodActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setCustomShippingMethod'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $shippingMethodName; /** + * * @var ?ShippingRateDraft */ protected $shippingRate; /** + * * @var ?TaxCategoryResourceIdentifier */ protected $taxCategory; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; @@ -57,16 +62,18 @@ public function __construct( ?string $shippingMethodName = null, ?ShippingRateDraft $shippingRate = null, ?TaxCategoryResourceIdentifier $taxCategory = null, - ?ExternalTaxRateDraft $externalTaxRate = null + ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $action = null ) { $this->shippingMethodName = $shippingMethodName; $this->shippingRate = $shippingRate; $this->taxCategory = $taxCategory; $this->externalTaxRate = $externalTaxRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -84,6 +91,7 @@ public function getAction() } /** + * * @return null|string */ public function getShippingMethodName() @@ -101,6 +109,7 @@ public function getShippingMethodName() } /** + * * @return null|ShippingRateDraft */ public function getShippingRate() @@ -121,6 +130,7 @@ public function getShippingRate() /** *

ResourceIdentifier to a TaxCategory.

* + * * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -139,6 +149,7 @@ public function getTaxCategory() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomTypeAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomTypeAction.php index 951e0a0bc6f..b423afdbcb9 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface CartSetCustomTypeAction extends CartUpdateAction *

Defines the Type that extends the Cart with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Cart.

* + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

Sets the Custom Fields fields for the Cart.

* + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomTypeActionBuilder.php index 6c5136939d8..3c16aa8131a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class CartSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class CartSetCustomTypeActionBuilder implements Builder *

Defines the Type that extends the Cart with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Cart.

* + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

Sets the Custom Fields fields for the Cart.

* + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomTypeActionModel.php index bda56814bff..9259f592dee 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class CartSetCustomTypeActionModel extends JsonObjectModel implements Cart { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class CartSetCustomTypeActionModel extends JsonObjectModel implements Cart */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

Defines the Type that extends the Cart with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Cart.

* + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

Sets the Custom Fields fields for the Cart.

* + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailAction.php index 1c4bbd6ecf4..d262f2d4f2d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailAction.php @@ -16,6 +16,7 @@ interface CartSetCustomerEmailAction extends CartUpdateAction public const FIELD_EMAIL = 'email'; /** + * @return null|string */ public function getEmail(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailActionBuilder.php index a2b3d526955..33a8abcaa17 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailActionBuilder.php @@ -21,11 +21,13 @@ final class CartSetCustomerEmailActionBuilder implements Builder { /** + * @var ?string */ private $email; /** + * @return null|string */ public function getEmail() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailActionModel.php index c72dfdd5bb3..7d82ca257fa 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerEmailActionModel.php @@ -21,11 +21,13 @@ final class CartSetCustomerEmailActionModel extends JsonObjectModel implements C { public const DISCRIMINATOR_VALUE = 'setCustomerEmail'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $email; @@ -35,13 +37,15 @@ final class CartSetCustomerEmailActionModel extends JsonObjectModel implements C * @psalm-suppress MissingParamType */ public function __construct( - ?string $email = null + ?string $email = null, + ?string $action = null ) { $this->email = $email; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getEmail() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupAction.php index ee8620eca30..abe906f075a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupAction.php @@ -19,6 +19,7 @@ interface CartSetCustomerGroupAction extends CartUpdateAction /** *

ResourceIdentifier to a CustomerGroup.

* + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupActionBuilder.php index 515d87c8a41..ed7ff721ff8 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupActionBuilder.php @@ -23,6 +23,7 @@ final class CartSetCustomerGroupActionBuilder implements Builder { /** + * @var null|CustomerGroupResourceIdentifier|CustomerGroupResourceIdentifierBuilder */ private $customerGroup; @@ -30,6 +31,7 @@ final class CartSetCustomerGroupActionBuilder implements Builder /** *

ResourceIdentifier to a CustomerGroup.

* + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupActionModel.php index 035b9cf449c..5539dd93edd 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerGroupActionModel.php @@ -23,11 +23,13 @@ final class CartSetCustomerGroupActionModel extends JsonObjectModel implements C { public const DISCRIMINATOR_VALUE = 'setCustomerGroup'; /** + * * @var ?string */ protected $action; /** + * * @var ?CustomerGroupResourceIdentifier */ protected $customerGroup; @@ -37,13 +39,15 @@ final class CartSetCustomerGroupActionModel extends JsonObjectModel implements C * @psalm-suppress MissingParamType */ public function __construct( - ?CustomerGroupResourceIdentifier $customerGroup = null + ?CustomerGroupResourceIdentifier $customerGroup = null, + ?string $action = null ) { $this->customerGroup = $customerGroup; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

ResourceIdentifier to a CustomerGroup.

* + * * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdAction.php index 54aa53ed5ad..f05a624ccd3 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdAction.php @@ -18,6 +18,7 @@ interface CartSetCustomerIdAction extends CartUpdateAction /** *

If set, a customer with the given ID must exist in the project.

* + * @return null|string */ public function getCustomerId(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdActionBuilder.php index 5782910ed9a..74d7bfa7877 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdActionBuilder.php @@ -21,6 +21,7 @@ final class CartSetCustomerIdActionBuilder implements Builder { /** + * @var ?string */ private $customerId; @@ -28,6 +29,7 @@ final class CartSetCustomerIdActionBuilder implements Builder /** *

If set, a customer with the given ID must exist in the project.

* + * @return null|string */ public function getCustomerId() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdActionModel.php index bb45c64ab75..5a9b72d2aa2 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomerIdActionModel.php @@ -21,11 +21,13 @@ final class CartSetCustomerIdActionModel extends JsonObjectModel implements Cart { public const DISCRIMINATOR_VALUE = 'setCustomerId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customerId; @@ -35,13 +37,15 @@ final class CartSetCustomerIdActionModel extends JsonObjectModel implements Cart * @psalm-suppress MissingParamType */ public function __construct( - ?string $customerId = null + ?string $customerId = null, + ?string $action = null ) { $this->customerId = $customerId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

If set, a customer with the given ID must exist in the project.

* + * * @return null|string */ public function getCustomerId() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationAction.php b/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationAction.php index 2ca431dba3f..7d7e9e8ed9d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationAction.php @@ -16,6 +16,7 @@ interface CartSetDeleteDaysAfterLastModificationAction extends CartUpdateAction public const FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION = 'deleteDaysAfterLastModification'; /** + * @return null|int */ public function getDeleteDaysAfterLastModification(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationActionBuilder.php index 1e024a57c2c..b168fb13fdb 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationActionBuilder.php @@ -21,11 +21,13 @@ final class CartSetDeleteDaysAfterLastModificationActionBuilder implements Builder { /** + * @var ?int */ private $deleteDaysAfterLastModification; /** + * @return null|int */ public function getDeleteDaysAfterLastModification() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationActionModel.php index f23c7a73d56..9627b65df74 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeleteDaysAfterLastModificationActionModel.php @@ -21,11 +21,13 @@ final class CartSetDeleteDaysAfterLastModificationActionModel extends JsonObject { public const DISCRIMINATOR_VALUE = 'setDeleteDaysAfterLastModification'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $deleteDaysAfterLastModification; @@ -35,13 +37,15 @@ final class CartSetDeleteDaysAfterLastModificationActionModel extends JsonObject * @psalm-suppress MissingParamType */ public function __construct( - ?int $deleteDaysAfterLastModification = null + ?int $deleteDaysAfterLastModification = null, + ?string $action = null ) { $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|int */ public function getDeleteDaysAfterLastModification() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldAction.php index 78a33bf2437..ae59e404910 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldAction.php @@ -18,6 +18,7 @@ interface CartSetDeliveryAddressCustomFieldAction extends CartUpdateAction public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getDeliveryId(); @@ -25,6 +26,7 @@ public function getDeliveryId(); /** *

Name of the Custom Field.

* + * @return null|string */ public function getName(); @@ -34,6 +36,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionBuilder.php index 5a06b944891..63299eb1f8b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class CartSetDeliveryAddressCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getDeliveryId() @@ -46,6 +50,7 @@ public function getDeliveryId() /** *

Name of the Custom Field.

* + * @return null|string */ public function getName() @@ -58,6 +63,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionModel.php index 753b74b8b3b..5e0eff890eb 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class CartSetDeliveryAddressCustomFieldActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setDeliveryAddressCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class CartSetDeliveryAddressCustomFieldActionModel extends JsonObjectModel public function __construct( ?string $deliveryId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() @@ -92,6 +99,7 @@ public function getDeliveryId() /** *

Name of the Custom Field.

* + * * @return null|string */ public function getName() @@ -113,6 +121,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeAction.php index 193e44ab3a6..51c05592dce 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeAction.php @@ -20,6 +20,7 @@ interface CartSetDeliveryAddressCustomTypeAction extends CartUpdateAction public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getDeliveryId(); @@ -28,6 +29,7 @@ public function getDeliveryId(); *

Defines the Type that extends the address in a Delivery with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

* + * @return null|TypeResourceIdentifier */ public function getType(); @@ -35,6 +37,7 @@ public function getType(); /** *

Sets the Custom Fields fields for the address in a Delivery.

* + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionBuilder.php index c3517f5ed96..aa34ad8e526 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class CartSetDeliveryAddressCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getDeliveryId() @@ -51,6 +55,7 @@ public function getDeliveryId() *

Defines the Type that extends the address in a Delivery with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

* + * @return null|TypeResourceIdentifier */ public function getType() @@ -61,6 +66,7 @@ public function getType() /** *

Sets the Custom Fields fields for the address in a Delivery.

* + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionModel.php index b9d17d82626..118344008ef 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionModel.php @@ -25,21 +25,25 @@ final class CartSetDeliveryAddressCustomTypeActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setDeliveryAddressCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -51,15 +55,17 @@ final class CartSetDeliveryAddressCustomTypeActionModel extends JsonObjectModel public function __construct( ?string $deliveryId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() @@ -97,6 +104,7 @@ public function getDeliveryId() *

Defines the Type that extends the address in a Delivery with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

* + * * @return null|TypeResourceIdentifier */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

Sets the Custom Fields fields for the address in a Delivery.

* + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsAction.php b/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsAction.php index 2b6d9e91393..941557c9f1e 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsAction.php @@ -16,6 +16,7 @@ interface CartSetDirectDiscountsAction extends CartUpdateAction public const FIELD_DISCOUNTS = 'discounts'; /** + * @return null|DirectDiscountDraftCollection */ public function getDiscounts(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsActionBuilder.php index 64f22ebd903..58b6a55bea6 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsActionBuilder.php @@ -21,11 +21,13 @@ final class CartSetDirectDiscountsActionBuilder implements Builder { /** + * @var ?DirectDiscountDraftCollection */ private $discounts; /** + * @return null|DirectDiscountDraftCollection */ public function getDiscounts() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsActionModel.php index 6505cc30be2..df96cd5afef 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetDirectDiscountsActionModel.php @@ -21,11 +21,13 @@ final class CartSetDirectDiscountsActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setDirectDiscounts'; /** + * * @var ?string */ protected $action; /** + * * @var ?DirectDiscountDraftCollection */ protected $discounts; @@ -35,13 +37,15 @@ final class CartSetDirectDiscountsActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?DirectDiscountDraftCollection $discounts = null + ?DirectDiscountDraftCollection $discounts = null, + ?string $action = null ) { $this->discounts = $discounts; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|DirectDiscountDraftCollection */ public function getDiscounts() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldAction.php index 5deeea7c483..c49a4c5d959 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldAction.php @@ -18,6 +18,7 @@ interface CartSetItemShippingAddressCustomFieldAction extends CartUpdateAction public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getAddressKey(); @@ -25,6 +26,7 @@ public function getAddressKey(); /** *

Name of the Custom Field.

* + * @return null|string */ public function getName(); @@ -34,6 +36,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldActionBuilder.php index e1c6a9f46ad..47f6736f4d4 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class CartSetItemShippingAddressCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $addressKey; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getAddressKey() @@ -46,6 +50,7 @@ public function getAddressKey() /** *

Name of the Custom Field.

* + * @return null|string */ public function getName() @@ -58,6 +63,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldActionModel.php index 7cbe4271576..4795c83aef5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class CartSetItemShippingAddressCustomFieldActionModel extends JsonObjectM { public const DISCRIMINATOR_VALUE = 'setItemShippingAddressCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressKey; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class CartSetItemShippingAddressCustomFieldActionModel extends JsonObjectM public function __construct( ?string $addressKey = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->addressKey = $addressKey; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,7 @@ public function getAction() } /** + * * @return null|string */ public function getAddressKey() @@ -92,6 +99,7 @@ public function getAddressKey() /** *

Name of the Custom Field.

* + * * @return null|string */ public function getName() @@ -113,6 +121,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeAction.php index 950aae25c71..75f3f8d4e0e 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeAction.php @@ -20,6 +20,7 @@ interface CartSetItemShippingAddressCustomTypeAction extends CartUpdateAction public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getAddressKey(); @@ -28,6 +29,7 @@ public function getAddressKey(); *

Defines the Type that extends the itemShippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the itemShippingAddress.

* + * @return null|TypeResourceIdentifier */ public function getType(); @@ -35,6 +37,7 @@ public function getType(); /** *

Sets the Custom Fields fields for the itemShippingAddress.

* + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeActionBuilder.php index c27a17c1d0d..f09ee96cab6 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class CartSetItemShippingAddressCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $addressKey; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getAddressKey() @@ -51,6 +55,7 @@ public function getAddressKey() *

Defines the Type that extends the itemShippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the itemShippingAddress.

* + * @return null|TypeResourceIdentifier */ public function getType() @@ -61,6 +66,7 @@ public function getType() /** *

Sets the Custom Fields fields for the itemShippingAddress.

* + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeActionModel.php index deaae1a375f..0a50a2334c6 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetItemShippingAddressCustomTypeActionModel.php @@ -25,21 +25,25 @@ final class CartSetItemShippingAddressCustomTypeActionModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'setItemShippingAddressCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressKey; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -51,15 +55,17 @@ final class CartSetItemShippingAddressCustomTypeActionModel extends JsonObjectMo public function __construct( ?string $addressKey = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->addressKey = $addressKey; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getAddressKey() @@ -97,6 +104,7 @@ public function getAddressKey() *

Defines the Type that extends the itemShippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the itemShippingAddress.

* + * * @return null|TypeResourceIdentifier */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

Sets the Custom Fields fields for the itemShippingAddress.

* + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetKeyAction.php b/lib/commercetools-api/src/Models/Cart/CartSetKeyAction.php index 9caf03060de..8756f34db55 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetKeyAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetKeyAction.php @@ -16,6 +16,7 @@ interface CartSetKeyAction extends CartUpdateAction public const FIELD_KEY = 'key'; /** + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetKeyActionBuilder.php index 24f8d38fb4a..e34150d35ff 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetKeyActionBuilder.php @@ -21,11 +21,13 @@ final class CartSetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetKeyActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetKeyActionModel.php index 51095804b54..988dac79739 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetKeyActionModel.php @@ -21,11 +21,13 @@ final class CartSetKeyActionModel extends JsonObjectModel implements CartSetKeyA { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class CartSetKeyActionModel extends JsonObjectModel implements CartSetKeyA * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldAction.php index a461668329b..eb4be5b9c3d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldAction.php @@ -18,6 +18,7 @@ interface CartSetLineItemCustomFieldAction extends CartUpdateAction public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getLineItemId(); @@ -25,6 +26,7 @@ public function getLineItemId(); /** *

Name of the Custom Field.

* + * @return null|string */ public function getName(); @@ -34,6 +36,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldActionBuilder.php index 0e0a4d9de3b..b3bc5af68ea 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class CartSetLineItemCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getLineItemId() @@ -46,6 +50,7 @@ public function getLineItemId() /** *

Name of the Custom Field.

* + * @return null|string */ public function getName() @@ -58,6 +63,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldActionModel.php index 89f2432f0fe..d55e2ca8c99 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class CartSetLineItemCustomFieldActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setLineItemCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class CartSetLineItemCustomFieldActionModel extends JsonObjectModel implem public function __construct( ?string $lineItemId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -92,6 +99,7 @@ public function getLineItemId() /** *

Name of the Custom Field.

* + * * @return null|string */ public function getName() @@ -113,6 +121,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeAction.php index 1f749707987..61dfe887071 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeAction.php @@ -20,6 +20,7 @@ interface CartSetLineItemCustomTypeAction extends CartUpdateAction public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getLineItemId(); @@ -28,6 +29,7 @@ public function getLineItemId(); *

Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

* + * @return null|TypeResourceIdentifier */ public function getType(); @@ -35,6 +37,7 @@ public function getType(); /** *

Sets the Custom Fields fields for the LineItem.

* + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeActionBuilder.php index 0730fa81c2e..049e14bbe92 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class CartSetLineItemCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getLineItemId() @@ -51,6 +55,7 @@ public function getLineItemId() *

Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

* + * @return null|TypeResourceIdentifier */ public function getType() @@ -61,6 +66,7 @@ public function getType() /** *

Sets the Custom Fields fields for the LineItem.

* + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeActionModel.php index 8f00fd8de26..161ed30dc70 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemCustomTypeActionModel.php @@ -25,21 +25,25 @@ final class CartSetLineItemCustomTypeActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setLineItemCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -51,15 +55,17 @@ final class CartSetLineItemCustomTypeActionModel extends JsonObjectModel impleme public function __construct( ?string $lineItemId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -97,6 +104,7 @@ public function getLineItemId() *

Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

* + * * @return null|TypeResourceIdentifier */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

Sets the Custom Fields fields for the LineItem.

* + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelAction.php index 4a711cbebc2..c49c69e4c7e 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelAction.php @@ -18,6 +18,7 @@ interface CartSetLineItemDistributionChannelAction extends CartUpdateAction public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; /** + * @return null|string */ public function getLineItemId(); @@ -25,6 +26,7 @@ public function getLineItemId(); /** *

ResourceIdentifier to a Channel.

* + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelActionBuilder.php index ba58031297d..601e908dc2b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelActionBuilder.php @@ -23,16 +23,19 @@ final class CartSetLineItemDistributionChannelActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $distributionChannel; /** + * @return null|string */ public function getLineItemId() @@ -43,6 +46,7 @@ public function getLineItemId() /** *

ResourceIdentifier to a Channel.

* + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelActionModel.php index 4ac300dbd7d..add8d96be0b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemDistributionChannelActionModel.php @@ -23,16 +23,19 @@ final class CartSetLineItemDistributionChannelActionModel extends JsonObjectMode { public const DISCRIMINATOR_VALUE = 'setLineItemDistributionChannel'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ChannelResourceIdentifier */ protected $distributionChannel; @@ -43,14 +46,16 @@ final class CartSetLineItemDistributionChannelActionModel extends JsonObjectMode */ public function __construct( ?string $lineItemId = null, - ?ChannelResourceIdentifier $distributionChannel = null + ?ChannelResourceIdentifier $distributionChannel = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->distributionChannel = $distributionChannel; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -87,6 +93,7 @@ public function getLineItemId() /** *

ResourceIdentifier to a Channel.

* + * * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceAction.php index 7dbdb87dd18..070a51b9b13 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceAction.php @@ -18,6 +18,7 @@ interface CartSetLineItemPriceAction extends CartUpdateAction public const FIELD_EXTERNAL_PRICE = 'externalPrice'; /** + * @return null|string */ public function getLineItemId(); @@ -26,6 +27,7 @@ public function getLineItemId(); *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getExternalPrice(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceActionBuilder.php index 67f28e4177d..f58d8a84531 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceActionBuilder.php @@ -23,16 +23,19 @@ final class CartSetLineItemPriceActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|Money|MoneyBuilder */ private $externalPrice; /** + * @return null|string */ public function getLineItemId() @@ -44,6 +47,7 @@ public function getLineItemId() *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getExternalPrice() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceActionModel.php index bcb5a2ce6d2..d91f7ac87e1 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemPriceActionModel.php @@ -23,16 +23,19 @@ final class CartSetLineItemPriceActionModel extends JsonObjectModel implements C { public const DISCRIMINATOR_VALUE = 'setLineItemPrice'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?Money */ protected $externalPrice; @@ -43,14 +46,16 @@ final class CartSetLineItemPriceActionModel extends JsonObjectModel implements C */ public function __construct( ?string $lineItemId = null, - ?Money $externalPrice = null + ?Money $externalPrice = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->externalPrice = $externalPrice; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -88,6 +94,7 @@ public function getLineItemId() *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * * @return null|Money */ public function getExternalPrice() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsAction.php index 1e608f044bd..2907d5dcd3b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsAction.php @@ -17,11 +17,13 @@ interface CartSetLineItemShippingDetailsAction extends CartUpdateAction public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsActionBuilder.php index 0ed6c4c42a0..36e1d49028d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsActionBuilder.php @@ -21,16 +21,19 @@ final class CartSetLineItemShippingDetailsActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetails; /** + * @return null|string */ public function getLineItemId() @@ -39,6 +42,7 @@ public function getLineItemId() } /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsActionModel.php index 5f16eac6512..44ba2db166b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemShippingDetailsActionModel.php @@ -21,16 +21,19 @@ final class CartSetLineItemShippingDetailsActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'setLineItemShippingDetails'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; @@ -41,14 +44,16 @@ final class CartSetLineItemShippingDetailsActionModel extends JsonObjectModel im */ public function __construct( ?string $lineItemId = null, - ?ItemShippingDetailsDraft $shippingDetails = null + ?ItemShippingDetailsDraft $shippingDetails = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->shippingDetails = $shippingDetails; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -83,6 +89,7 @@ public function getLineItemId() } /** + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelAction.php index c74d51319eb..7c29e078cfb 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelAction.php @@ -18,6 +18,7 @@ interface CartSetLineItemSupplyChannelAction extends CartUpdateAction public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; /** + * @return null|string */ public function getLineItemId(); @@ -25,6 +26,7 @@ public function getLineItemId(); /** *

ResourceIdentifier to a Channel.

* + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelActionBuilder.php index 546eb9e9633..fadbb6d2c08 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelActionBuilder.php @@ -23,16 +23,19 @@ final class CartSetLineItemSupplyChannelActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $supplyChannel; /** + * @return null|string */ public function getLineItemId() @@ -43,6 +46,7 @@ public function getLineItemId() /** *

ResourceIdentifier to a Channel.

* + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelActionModel.php index 35cd6ec0134..8fa49b27ce5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemSupplyChannelActionModel.php @@ -23,16 +23,19 @@ final class CartSetLineItemSupplyChannelActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setLineItemSupplyChannel'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ChannelResourceIdentifier */ protected $supplyChannel; @@ -43,14 +46,16 @@ final class CartSetLineItemSupplyChannelActionModel extends JsonObjectModel impl */ public function __construct( ?string $lineItemId = null, - ?ChannelResourceIdentifier $supplyChannel = null + ?ChannelResourceIdentifier $supplyChannel = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->supplyChannel = $supplyChannel; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -87,6 +93,7 @@ public function getLineItemId() /** *

ResourceIdentifier to a Channel.

* + * * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountAction.php index 103896f95da..4961712d677 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountAction.php @@ -17,11 +17,13 @@ interface CartSetLineItemTaxAmountAction extends CartUpdateAction public const FIELD_EXTERNAL_TAX_AMOUNT = 'externalTaxAmount'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountActionBuilder.php index 4c4ce9eb584..1dd3719513e 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountActionBuilder.php @@ -21,16 +21,19 @@ final class CartSetLineItemTaxAmountActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|ExternalTaxAmountDraft|ExternalTaxAmountDraftBuilder */ private $externalTaxAmount; /** + * @return null|string */ public function getLineItemId() @@ -39,6 +42,7 @@ public function getLineItemId() } /** + * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountActionModel.php index 5a6e68f2248..ac46bc3197e 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxAmountActionModel.php @@ -21,16 +21,19 @@ final class CartSetLineItemTaxAmountActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'setLineItemTaxAmount'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ExternalTaxAmountDraft */ protected $externalTaxAmount; @@ -41,14 +44,16 @@ final class CartSetLineItemTaxAmountActionModel extends JsonObjectModel implemen */ public function __construct( ?string $lineItemId = null, - ?ExternalTaxAmountDraft $externalTaxAmount = null + ?ExternalTaxAmountDraft $externalTaxAmount = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->externalTaxAmount = $externalTaxAmount; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -83,6 +89,7 @@ public function getLineItemId() } /** + * * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateAction.php index c4ad6d77541..14eb0044653 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateAction.php @@ -17,11 +17,13 @@ interface CartSetLineItemTaxRateAction extends CartUpdateAction public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateActionBuilder.php index a2a7ed63de2..dc0cb2c566d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateActionBuilder.php @@ -21,16 +21,19 @@ final class CartSetLineItemTaxRateActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** + * @return null|string */ public function getLineItemId() @@ -39,6 +42,7 @@ public function getLineItemId() } /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateActionModel.php index 3fb7073c8f3..293446b732d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTaxRateActionModel.php @@ -21,16 +21,19 @@ final class CartSetLineItemTaxRateActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setLineItemTaxRate'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; @@ -41,14 +44,16 @@ final class CartSetLineItemTaxRateActionModel extends JsonObjectModel implements */ public function __construct( ?string $lineItemId = null, - ?ExternalTaxRateDraft $externalTaxRate = null + ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->externalTaxRate = $externalTaxRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -83,6 +89,7 @@ public function getLineItemId() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceAction.php index 7a83f4afcf7..c186b4509e0 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceAction.php @@ -17,11 +17,13 @@ interface CartSetLineItemTotalPriceAction extends CartUpdateAction public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceActionBuilder.php index aa13343b84d..411b4cede84 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceActionBuilder.php @@ -21,16 +21,19 @@ final class CartSetLineItemTotalPriceActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|ExternalLineItemTotalPrice|ExternalLineItemTotalPriceBuilder */ private $externalTotalPrice; /** + * @return null|string */ public function getLineItemId() @@ -39,6 +42,7 @@ public function getLineItemId() } /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceActionModel.php index 9c162d27b6d..9be61470c91 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLineItemTotalPriceActionModel.php @@ -21,16 +21,19 @@ final class CartSetLineItemTotalPriceActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setLineItemTotalPrice'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ExternalLineItemTotalPrice */ protected $externalTotalPrice; @@ -41,14 +44,16 @@ final class CartSetLineItemTotalPriceActionModel extends JsonObjectModel impleme */ public function __construct( ?string $lineItemId = null, - ?ExternalLineItemTotalPrice $externalTotalPrice = null + ?ExternalLineItemTotalPrice $externalTotalPrice = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->externalTotalPrice = $externalTotalPrice; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -83,6 +89,7 @@ public function getLineItemId() } /** + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLocaleAction.php b/lib/commercetools-api/src/Models/Cart/CartSetLocaleAction.php index 566c6e9bad9..6623c89cb41 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLocaleAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLocaleAction.php @@ -16,6 +16,7 @@ interface CartSetLocaleAction extends CartUpdateAction public const FIELD_LOCALE = 'locale'; /** + * @return null|string */ public function getLocale(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLocaleActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetLocaleActionBuilder.php index 6a9c512a3d2..7fe9a541e18 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLocaleActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLocaleActionBuilder.php @@ -21,11 +21,13 @@ final class CartSetLocaleActionBuilder implements Builder { /** + * @var ?string */ private $locale; /** + * @return null|string */ public function getLocale() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetLocaleActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetLocaleActionModel.php index f3572d979fc..6c29cf3ff37 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetLocaleActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetLocaleActionModel.php @@ -21,11 +21,13 @@ final class CartSetLocaleActionModel extends JsonObjectModel implements CartSetL { public const DISCRIMINATOR_VALUE = 'setLocale'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $locale; @@ -35,13 +37,15 @@ final class CartSetLocaleActionModel extends JsonObjectModel implements CartSetL * @psalm-suppress MissingParamType */ public function __construct( - ?string $locale = null + ?string $locale = null, + ?string $action = null ) { $this->locale = $locale; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getLocale() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressAction.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressAction.php index b27b2667453..51fdce91bc4 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressAction.php @@ -17,6 +17,7 @@ interface CartSetShippingAddressAction extends CartUpdateAction public const FIELD_ADDRESS = 'address'; /** + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressActionBuilder.php index 441b132ed29..5d5a1a70aa8 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressActionBuilder.php @@ -23,11 +23,13 @@ final class CartSetShippingAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressActionModel.php index ce1972f23d6..6a4240d010f 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressActionModel.php @@ -23,11 +23,13 @@ final class CartSetShippingAddressActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -37,13 +39,15 @@ final class CartSetShippingAddressActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomFieldAction.php index 0fe11f778fb..85022f3247f 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomFieldAction.php @@ -19,6 +19,7 @@ interface CartSetShippingAddressCustomFieldAction extends CartUpdateAction /** *

Name of the Custom Field.

* + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomFieldActionBuilder.php index 2f62310a103..e01a05e2d22 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class CartSetShippingAddressCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class CartSetShippingAddressCustomFieldActionBuilder implements Builder /** *

Name of the Custom Field.

* + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomFieldActionModel.php index 2fbe78a98df..6e40075d7a8 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class CartSetShippingAddressCustomFieldActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setShippingAddressCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class CartSetShippingAddressCustomFieldActionModel extends JsonObjectModel */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

Name of the Custom Field.

* + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomTypeAction.php index b29e6ce70c1..139a9dccb4d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomTypeAction.php @@ -22,6 +22,7 @@ interface CartSetShippingAddressCustomTypeAction extends CartUpdateAction *

Defines the Type that extends the shippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the shippingAddress.

* + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

Sets the Custom Fields fields for the shippingAddress.

* + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomTypeActionBuilder.php index 4807e144ee9..b355b80cff3 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class CartSetShippingAddressCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class CartSetShippingAddressCustomTypeActionBuilder implements Builder *

Defines the Type that extends the shippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the shippingAddress.

* + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

Sets the Custom Fields fields for the shippingAddress.

* + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomTypeActionModel.php index 1c8b8a971aa..4d750563aad 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingAddressCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class CartSetShippingAddressCustomTypeActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setShippingAddressCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class CartSetShippingAddressCustomTypeActionModel extends JsonObjectModel */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

Defines the Type that extends the shippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the shippingAddress.

* + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

Sets the Custom Fields fields for the shippingAddress.

* + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldAction.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldAction.php new file mode 100644 index 00000000000..389bbce7e0a --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldAction.php @@ -0,0 +1,60 @@ +User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey(); + + /** + *

Name of the Custom Field.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

If value is absent or null, this field will be removed if it exists. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * If value is provided, it is set for the field defined by name.

+ * + + * @return null|mixed + */ + public function getValue(); + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param mixed $value + */ + public function setValue($value): void; +} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldActionBuilder.php new file mode 100644 index 00000000000..77268bc5015 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldActionBuilder.php @@ -0,0 +1,123 @@ + + */ +final class CartSetShippingCustomFieldActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $shippingKey; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + + /** + *

Name of the Custom Field.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

If value is absent or null, this field will be removed if it exists. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * If value is provided, it is set for the field defined by name.

+ * + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + + public function build(): CartSetShippingCustomFieldAction + { + return new CartSetShippingCustomFieldActionModel( + $this->shippingKey, + $this->name, + $this->value + ); + } + + public static function of(): CartSetShippingCustomFieldActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldActionCollection.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldActionCollection.php new file mode 100644 index 00000000000..7e0503e5701 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldActionCollection.php @@ -0,0 +1,56 @@ + + * @method CartSetShippingCustomFieldAction current() + * @method CartSetShippingCustomFieldAction end() + * @method CartSetShippingCustomFieldAction at($offset) + */ +class CartSetShippingCustomFieldActionCollection extends CartUpdateActionCollection +{ + /** + * @psalm-assert CartSetShippingCustomFieldAction $value + * @psalm-param CartSetShippingCustomFieldAction|stdClass $value + * @throws InvalidArgumentException + * + * @return CartSetShippingCustomFieldActionCollection + */ + public function add($value) + { + if (!$value instanceof CartSetShippingCustomFieldAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CartSetShippingCustomFieldAction + */ + protected function mapper() + { + return function (?int $index): ?CartSetShippingCustomFieldAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CartSetShippingCustomFieldAction $data */ + $data = CartSetShippingCustomFieldActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldActionModel.php new file mode 100644 index 00000000000..994e3c317a4 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomFieldActionModel.php @@ -0,0 +1,167 @@ +shippingKey = $shippingKey; + $this->name = $name; + $this->value = $value; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + + /** + *

Name of the Custom Field.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

If value is absent or null, this field will be removed if it exists. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * If value is provided, it is set for the field defined by name.

+ * + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeAction.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeAction.php new file mode 100644 index 00000000000..3e4b73974a7 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeAction.php @@ -0,0 +1,61 @@ +User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey(); + + /** + *

Defines the Type that extends the shippingAddress with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the shippingAddress.

+ * + + * @return null|TypeResourceIdentifier + */ + public function getType(); + + /** + *

Sets the Custom Fields fields for the shippingAddress.

+ * + + * @return null|FieldContainer + */ + public function getFields(); + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; + + /** + * @param ?TypeResourceIdentifier $type + */ + public function setType(?TypeResourceIdentifier $type): void; + + /** + * @param ?FieldContainer $fields + */ + public function setFields(?FieldContainer $fields): void; +} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeActionBuilder.php new file mode 100644 index 00000000000..0d1d1706f1b --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeActionBuilder.php @@ -0,0 +1,147 @@ + + */ +final class CartSetShippingCustomTypeActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $shippingKey; + + /** + + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder + */ + private $type; + + /** + + * @var null|FieldContainer|FieldContainerBuilder + */ + private $fields; + + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + + /** + *

Defines the Type that extends the shippingAddress with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the shippingAddress.

+ * + + * @return null|TypeResourceIdentifier + */ + public function getType() + { + return $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type; + } + + /** + *

Sets the Custom Fields fields for the shippingAddress.

+ * + + * @return null|FieldContainer + */ + public function getFields() + { + return $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields; + } + + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + + /** + * @param ?TypeResourceIdentifier $type + * @return $this + */ + public function withType(?TypeResourceIdentifier $type) + { + $this->type = $type; + + return $this; + } + + /** + * @param ?FieldContainer $fields + * @return $this + */ + public function withFields(?FieldContainer $fields) + { + $this->fields = $fields; + + return $this; + } + + /** + * @deprecated use withType() instead + * @return $this + */ + public function withTypeBuilder(?TypeResourceIdentifierBuilder $type) + { + $this->type = $type; + + return $this; + } + + /** + * @deprecated use withFields() instead + * @return $this + */ + public function withFieldsBuilder(?FieldContainerBuilder $fields) + { + $this->fields = $fields; + + return $this; + } + + public function build(): CartSetShippingCustomTypeAction + { + return new CartSetShippingCustomTypeActionModel( + $this->shippingKey, + $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type, + $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields + ); + } + + public static function of(): CartSetShippingCustomTypeActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeActionCollection.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeActionCollection.php new file mode 100644 index 00000000000..a5f990cf151 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeActionCollection.php @@ -0,0 +1,56 @@ + + * @method CartSetShippingCustomTypeAction current() + * @method CartSetShippingCustomTypeAction end() + * @method CartSetShippingCustomTypeAction at($offset) + */ +class CartSetShippingCustomTypeActionCollection extends CartUpdateActionCollection +{ + /** + * @psalm-assert CartSetShippingCustomTypeAction $value + * @psalm-param CartSetShippingCustomTypeAction|stdClass $value + * @throws InvalidArgumentException + * + * @return CartSetShippingCustomTypeActionCollection + */ + public function add($value) + { + if (!$value instanceof CartSetShippingCustomTypeAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CartSetShippingCustomTypeAction + */ + protected function mapper() + { + return function (?int $index): ?CartSetShippingCustomTypeAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CartSetShippingCustomTypeAction $data */ + $data = CartSetShippingCustomTypeActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeActionModel.php new file mode 100644 index 00000000000..6637a7bd387 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingCustomTypeActionModel.php @@ -0,0 +1,172 @@ +shippingKey = $shippingKey; + $this->type = $type; + $this->fields = $fields; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + + /** + *

Defines the Type that extends the shippingAddress with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the shippingAddress.

+ * + * + * @return null|TypeResourceIdentifier + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + + $this->type = TypeResourceIdentifierModel::of($data); + } + + return $this->type; + } + + /** + *

Sets the Custom Fields fields for the shippingAddress.

+ * + * + * @return null|FieldContainer + */ + public function getFields() + { + if (is_null($this->fields)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_FIELDS); + if (is_null($data)) { + return null; + } + + $this->fields = FieldContainerModel::of($data); + } + + return $this->fields; + } + + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } + + /** + * @param ?TypeResourceIdentifier $type + */ + public function setType(?TypeResourceIdentifier $type): void + { + $this->type = $type; + } + + /** + * @param ?FieldContainer $fields + */ + public function setFields(?FieldContainer $fields): void + { + $this->fields = $fields; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodAction.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodAction.php index 5219381b8b8..3da4d557467 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodAction.php @@ -20,11 +20,13 @@ interface CartSetShippingMethodAction extends CartUpdateAction /** *

ResourceIdentifier to a ShippingMethod.

* + * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod(); /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionBuilder.php index 39932f81586..f02c54968bc 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionBuilder.php @@ -23,11 +23,13 @@ final class CartSetShippingMethodActionBuilder implements Builder { /** + * @var null|ShippingMethodResourceIdentifier|ShippingMethodResourceIdentifierBuilder */ private $shippingMethod; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; @@ -35,6 +37,7 @@ final class CartSetShippingMethodActionBuilder implements Builder /** *

ResourceIdentifier to a ShippingMethod.

* + * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod() @@ -43,6 +46,7 @@ public function getShippingMethod() } /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionModel.php index b92987f777b..bbb17027fb6 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionModel.php @@ -23,16 +23,19 @@ final class CartSetShippingMethodActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setShippingMethod'; /** + * * @var ?string */ protected $action; /** + * * @var ?ShippingMethodResourceIdentifier */ protected $shippingMethod; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; @@ -43,14 +46,16 @@ final class CartSetShippingMethodActionModel extends JsonObjectModel implements */ public function __construct( ?ShippingMethodResourceIdentifier $shippingMethod = null, - ?ExternalTaxRateDraft $externalTaxRate = null + ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $action = null ) { $this->shippingMethod = $shippingMethod; $this->externalTaxRate = $externalTaxRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() /** *

ResourceIdentifier to a ShippingMethod.

* + * * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod() @@ -88,6 +94,7 @@ public function getShippingMethod() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountAction.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountAction.php index 6fcb856466d..daf35da1015 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountAction.php @@ -16,6 +16,7 @@ interface CartSetShippingMethodTaxAmountAction extends CartUpdateAction public const FIELD_EXTERNAL_TAX_AMOUNT = 'externalTaxAmount'; /** + * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountActionBuilder.php index 32d04428610..63138953113 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountActionBuilder.php @@ -21,11 +21,13 @@ final class CartSetShippingMethodTaxAmountActionBuilder implements Builder { /** + * @var null|ExternalTaxAmountDraft|ExternalTaxAmountDraftBuilder */ private $externalTaxAmount; /** + * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountActionModel.php index 8e81c5c099a..91de19d0adf 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxAmountActionModel.php @@ -21,11 +21,13 @@ final class CartSetShippingMethodTaxAmountActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'setShippingMethodTaxAmount'; /** + * * @var ?string */ protected $action; /** + * * @var ?ExternalTaxAmountDraft */ protected $externalTaxAmount; @@ -35,13 +37,15 @@ final class CartSetShippingMethodTaxAmountActionModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?ExternalTaxAmountDraft $externalTaxAmount = null + ?ExternalTaxAmountDraft $externalTaxAmount = null, + ?string $action = null ) { $this->externalTaxAmount = $externalTaxAmount; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateAction.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateAction.php index d1301c5da70..9f1f937196c 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateAction.php @@ -16,6 +16,7 @@ interface CartSetShippingMethodTaxRateAction extends CartUpdateAction public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateActionBuilder.php index 24242b41a29..636e662d192 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateActionBuilder.php @@ -21,11 +21,13 @@ final class CartSetShippingMethodTaxRateActionBuilder implements Builder { /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateActionModel.php index 9af7a56ac8a..fa811e8269d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodTaxRateActionModel.php @@ -21,11 +21,13 @@ final class CartSetShippingMethodTaxRateActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setShippingMethodTaxRate'; /** + * * @var ?string */ protected $action; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; @@ -35,13 +37,15 @@ final class CartSetShippingMethodTaxRateActionModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?ExternalTaxRateDraft $externalTaxRate = null + ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $action = null ) { $this->externalTaxRate = $externalTaxRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputAction.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputAction.php index 2b8eb85a141..427a3572c2f 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputAction.php @@ -21,6 +21,7 @@ interface CartSetShippingRateInputAction extends CartUpdateAction * If CartScore is defined, it must be ScoreShippingRateInput. * Otherwise it can not bet set.

* + * @return null|ShippingRateInputDraft */ public function getShippingRateInput(); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputActionBuilder.php index 5f7d8aebf0c..50795ef0cea 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputActionBuilder.php @@ -21,6 +21,7 @@ final class CartSetShippingRateInputActionBuilder implements Builder { /** + * @var null|ShippingRateInputDraft|ShippingRateInputDraftBuilder */ private $shippingRateInput; @@ -31,6 +32,7 @@ final class CartSetShippingRateInputActionBuilder implements Builder * If CartScore is defined, it must be ScoreShippingRateInput. * Otherwise it can not bet set.

* + * @return null|ShippingRateInputDraft */ public function getShippingRateInput() diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputActionModel.php index 2f4b69808d0..ebefc9361b8 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingRateInputActionModel.php @@ -21,11 +21,13 @@ final class CartSetShippingRateInputActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'setShippingRateInput'; /** + * * @var ?string */ protected $action; /** + * * @var ?ShippingRateInputDraft */ protected $shippingRateInput; @@ -35,13 +37,15 @@ final class CartSetShippingRateInputActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?ShippingRateInputDraft $shippingRateInput = null + ?ShippingRateInputDraft $shippingRateInput = null, + ?string $action = null ) { $this->shippingRateInput = $shippingRateInput; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -64,6 +68,7 @@ public function getAction() * If CartScore is defined, it must be ScoreShippingRateInput. * Otherwise it can not bet set.

* + * * @return null|ShippingRateInputDraft */ public function getShippingRateInput() diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdate.php b/lib/commercetools-api/src/Models/Cart/CartUpdate.php index 244370f16c9..981e174867d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdate.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdate.php @@ -17,11 +17,13 @@ interface CartUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + * @return null|int */ public function getVersion(); /** + * @return null|CartUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdateAction.php b/lib/commercetools-api/src/Models/Cart/CartUpdateAction.php index f9f8f0e90fb..ac2eed87f18 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdateAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdateAction.php @@ -17,6 +17,7 @@ interface CartUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdateActionModel.php b/lib/commercetools-api/src/Models/Cart/CartUpdateActionModel.php index 3e6d6a47cfc..635bfee5330 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdateActionModel.php @@ -21,6 +21,7 @@ final class CartUpdateActionModel extends JsonObjectModel implements CartUpdateA { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -31,14 +32,17 @@ final class CartUpdateActionModel extends JsonObjectModel implements CartUpdateA */ private static $discriminatorClasses = [ 'addCustomLineItem' => CartAddCustomLineItemActionModel::class, + 'addCustomShippingMethod' => CartAddCustomShippingMethodActionModel::class, 'addDiscountCode' => CartAddDiscountCodeActionModel::class, 'addItemShippingAddress' => CartAddItemShippingAddressActionModel::class, 'addLineItem' => CartAddLineItemActionModel::class, 'addPayment' => CartAddPaymentActionModel::class, + 'addShippingMethod' => CartAddShippingMethodActionModel::class, 'addShoppingList' => CartAddShoppingListActionModel::class, 'applyDeltaToCustomLineItemShippingDetailsTargets' => CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel::class, 'applyDeltaToLineItemShippingDetailsTargets' => CartApplyDeltaToLineItemShippingDetailsTargetsActionModel::class, 'changeCustomLineItemMoney' => CartChangeCustomLineItemMoneyActionModel::class, + 'changeCustomLineItemPriceMode' => CartChangeCustomLineItemPriceModeActionModel::class, 'changeCustomLineItemQuantity' => CartChangeCustomLineItemQuantityActionModel::class, 'changeLineItemQuantity' => CartChangeLineItemQuantityActionModel::class, 'changeTaxCalculationMode' => CartChangeTaxCalculationModeActionModel::class, @@ -50,6 +54,7 @@ final class CartUpdateActionModel extends JsonObjectModel implements CartUpdateA 'removeItemShippingAddress' => CartRemoveItemShippingAddressActionModel::class, 'removeLineItem' => CartRemoveLineItemActionModel::class, 'removePayment' => CartRemovePaymentActionModel::class, + 'removeShippingMethod' => CartRemoveShippingMethodActionModel::class, 'setAnonymousId' => CartSetAnonymousIdActionModel::class, 'setBillingAddress' => CartSetBillingAddressActionModel::class, 'setBillingAddressCustomField' => CartSetBillingAddressCustomFieldActionModel::class, @@ -87,6 +92,8 @@ final class CartUpdateActionModel extends JsonObjectModel implements CartUpdateA 'setShippingAddress' => CartSetShippingAddressActionModel::class, 'setShippingAddressCustomField' => CartSetShippingAddressCustomFieldActionModel::class, 'setShippingAddressCustomType' => CartSetShippingAddressCustomTypeActionModel::class, + 'setShippingCustomField' => CartSetShippingCustomFieldActionModel::class, + 'setShippingCustomType' => CartSetShippingCustomTypeActionModel::class, 'setShippingMethod' => CartSetShippingMethodActionModel::class, 'setShippingMethodTaxAmount' => CartSetShippingMethodTaxAmountActionModel::class, 'setShippingMethodTaxRate' => CartSetShippingMethodTaxRateActionModel::class, @@ -98,11 +105,13 @@ final class CartUpdateActionModel extends JsonObjectModel implements CartUpdateA * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdateBuilder.php b/lib/commercetools-api/src/Models/Cart/CartUpdateBuilder.php index cde33fe7237..4ff957fe461 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdateBuilder.php @@ -21,16 +21,19 @@ final class CartUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?CartUpdateActionCollection */ private $actions; /** + * @return null|int */ public function getVersion() @@ -39,6 +42,7 @@ public function getVersion() } /** + * @return null|CartUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressAction.php index 80539203f37..b91cc283e9d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressAction.php @@ -17,6 +17,7 @@ interface CartUpdateItemShippingAddressAction extends CartUpdateAction public const FIELD_ADDRESS = 'address'; /** + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionBuilder.php index b520fc3f462..690cbdbfe97 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionBuilder.php @@ -23,11 +23,13 @@ final class CartUpdateItemShippingAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionModel.php index 0400117114b..6ca1057249e 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdateItemShippingAddressActionModel.php @@ -23,11 +23,13 @@ final class CartUpdateItemShippingAddressActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'updateItemShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -37,13 +39,15 @@ final class CartUpdateItemShippingAddressActionModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdateModel.php b/lib/commercetools-api/src/Models/Cart/CartUpdateModel.php index 27c09a7d4df..9a061fe6db2 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdateModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdateModel.php @@ -20,11 +20,13 @@ final class CartUpdateModel extends JsonObjectModel implements CartUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?CartUpdateActionCollection */ protected $actions; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|int */ public function getVersion() @@ -59,6 +62,7 @@ public function getVersion() } /** + * * @return null|CartUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInput.php b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInput.php index 94b0cbd3d54..eee8a46bd16 100644 --- a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInput.php +++ b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInput.php @@ -18,6 +18,7 @@ interface ClassificationShippingRateInput extends ShippingRateInput public const FIELD_LABEL = 'label'; /** + * @return null|string */ public function getKey(); @@ -25,6 +26,7 @@ public function getKey(); /** *

JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

* + * @return null|LocalizedString */ public function getLabel(); diff --git a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputBuilder.php b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputBuilder.php index 2cc519d0b4f..07b54cf0567 100644 --- a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputBuilder.php @@ -23,16 +23,19 @@ final class ClassificationShippingRateInputBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; /** + * @return null|string */ public function getKey() @@ -43,6 +46,7 @@ public function getKey() /** *

JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

* + * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraft.php b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraft.php index 16dea0d966b..c428bd78df3 100644 --- a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraft.php +++ b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraft.php @@ -16,6 +16,7 @@ interface ClassificationShippingRateInputDraft extends ShippingRateInputDraft public const FIELD_KEY = 'key'; /** + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraftBuilder.php index 44e1d64bab2..ee44e4795c8 100644 --- a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraftBuilder.php @@ -21,11 +21,13 @@ final class ClassificationShippingRateInputDraftBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraftModel.php b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraftModel.php index 667bce8e1f0..df445e83bbf 100644 --- a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputDraftModel.php @@ -21,11 +21,13 @@ final class ClassificationShippingRateInputDraftModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'Classification'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class ClassificationShippingRateInputDraftModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $type = null ) { $this->key = $key; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,6 +63,7 @@ public function getType() } /** + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputModel.php b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputModel.php index 32a56b58a8c..9094f3c3501 100644 --- a/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputModel.php +++ b/lib/commercetools-api/src/Models/Cart/ClassificationShippingRateInputModel.php @@ -23,16 +23,19 @@ final class ClassificationShippingRateInputModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'Classification'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $label; @@ -43,14 +46,16 @@ final class ClassificationShippingRateInputModel extends JsonObjectModel impleme */ public function __construct( ?string $key = null, - ?LocalizedString $label = null + ?LocalizedString $label = null, + ?string $type = null ) { $this->key = $key; $this->label = $label; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,6 +73,7 @@ public function getType() } /** + * * @return null|string */ public function getKey() @@ -87,6 +93,7 @@ public function getKey() /** *

JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

* + * * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItem.php b/lib/commercetools-api/src/Models/Cart/CustomLineItem.php index b2517c7bfeb..05286289f68 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItem.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItem.php @@ -32,10 +32,12 @@ interface CustomLineItem extends JsonObject public const FIELD_DISCOUNTED_PRICE_PER_QUANTITY = 'discountedPricePerQuantity'; public const FIELD_CUSTOM = 'custom'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; + public const FIELD_PRICE_MODE = 'priceMode'; /** *

Unique identifier of the CustomLineItem.

* + * @return null|string */ public function getId(); @@ -43,6 +45,7 @@ public function getId(); /** *

The name of this CustomLineItem.

* + * @return null|LocalizedString */ public function getName(); @@ -51,6 +54,7 @@ public function getName(); *

The cost to add to the cart. * The amount can be negative.

* + * @return null|TypedMoney */ public function getMoney(); @@ -58,6 +62,7 @@ public function getMoney(); /** *

Set once the taxRate is set.

* + * @return null|TaxedItemPrice */ public function getTaxedPrice(); @@ -68,6 +73,7 @@ public function getTaxedPrice(); * Otherwise a total price is just a money multiplied by the quantity. * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property.

* + * @return null|TypedMoney */ public function getTotalPrice(); @@ -75,6 +81,7 @@ public function getTotalPrice(); /** *

A unique String in the cart to identify this CustomLineItem.

* + * @return null|string */ public function getSlug(); @@ -83,16 +90,19 @@ public function getSlug(); *

The amount of a CustomLineItem in the cart. * Must be a positive integer.

* + * @return null|int */ public function getQuantity(); /** + * @return null|ItemStateCollection */ public function getState(); /** + * @return null|TaxCategoryReference */ public function getTaxCategory(); @@ -101,16 +111,19 @@ public function getTaxCategory(); *

Will be set automatically in the Platform TaxMode once the shipping address is set is set. * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

* + * @return null|TaxRate */ public function getTaxRate(); /** + * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity(); /** + * @return null|CustomFields */ public function getCustom(); @@ -120,10 +133,20 @@ public function getCustom(); * CustomLineItem fields that can be used in query predicates: slug, name, quantity, * money, state, discountedPricePerQuantity.

* + * @return null|ItemShippingDetails */ public function getShippingDetails(); + /** + *

Specifies whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.

+ * + + * @return null|string + */ + public function getPriceMode(); + /** * @param ?string $id */ @@ -188,4 +211,9 @@ public function setCustom(?CustomFields $custom): void; * @param ?ItemShippingDetails $shippingDetails */ public function setShippingDetails(?ItemShippingDetails $shippingDetails): void; + + /** + * @param ?string $priceMode + */ + public function setPriceMode(?string $priceMode): void; } diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php index dca2348503a..8a96d40bd4e 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php @@ -32,73 +32,93 @@ final class CustomLineItemBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $money; /** + * @var null|TaxedItemPrice|TaxedItemPriceBuilder */ private $taxedPrice; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalPrice; /** + * @var ?string */ private $slug; /** + * @var ?int */ private $quantity; /** + * @var ?ItemStateCollection */ private $state; /** + * @var null|TaxCategoryReference|TaxCategoryReferenceBuilder */ private $taxCategory; /** + * @var null|TaxRate|TaxRateBuilder */ private $taxRate; /** + * @var ?DiscountedLineItemPriceForQuantityCollection */ private $discountedPricePerQuantity; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var null|ItemShippingDetails|ItemShippingDetailsBuilder */ private $shippingDetails; + /** + + * @var ?string + */ + private $priceMode; + /** *

Unique identifier of the CustomLineItem.

* + * @return null|string */ public function getId() @@ -109,6 +129,7 @@ public function getId() /** *

The name of this CustomLineItem.

* + * @return null|LocalizedString */ public function getName() @@ -120,6 +141,7 @@ public function getName() *

The cost to add to the cart. * The amount can be negative.

* + * @return null|TypedMoney */ public function getMoney() @@ -130,6 +152,7 @@ public function getMoney() /** *

Set once the taxRate is set.

* + * @return null|TaxedItemPrice */ public function getTaxedPrice() @@ -143,6 +166,7 @@ public function getTaxedPrice() * Otherwise a total price is just a money multiplied by the quantity. * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property.

* + * @return null|TypedMoney */ public function getTotalPrice() @@ -153,6 +177,7 @@ public function getTotalPrice() /** *

A unique String in the cart to identify this CustomLineItem.

* + * @return null|string */ public function getSlug() @@ -164,6 +189,7 @@ public function getSlug() *

The amount of a CustomLineItem in the cart. * Must be a positive integer.

* + * @return null|int */ public function getQuantity() @@ -172,6 +198,7 @@ public function getQuantity() } /** + * @return null|ItemStateCollection */ public function getState() @@ -180,6 +207,7 @@ public function getState() } /** + * @return null|TaxCategoryReference */ public function getTaxCategory() @@ -191,6 +219,7 @@ public function getTaxCategory() *

Will be set automatically in the Platform TaxMode once the shipping address is set is set. * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

* + * @return null|TaxRate */ public function getTaxRate() @@ -199,6 +228,7 @@ public function getTaxRate() } /** + * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity() @@ -207,6 +237,7 @@ public function getDiscountedPricePerQuantity() } /** + * @return null|CustomFields */ public function getCustom() @@ -219,6 +250,7 @@ public function getCustom() * CustomLineItem fields that can be used in query predicates: slug, name, quantity, * money, state, discountedPricePerQuantity.

* + * @return null|ItemShippingDetails */ public function getShippingDetails() @@ -226,6 +258,18 @@ public function getShippingDetails() return $this->shippingDetails instanceof ItemShippingDetailsBuilder ? $this->shippingDetails->build() : $this->shippingDetails; } + /** + *

Specifies whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.

+ * + + * @return null|string + */ + public function getPriceMode() + { + return $this->priceMode; + } + /** * @param ?string $id * @return $this @@ -369,6 +413,17 @@ public function withShippingDetails(?ItemShippingDetails $shippingDetails) return $this; } + /** + * @param ?string $priceMode + * @return $this + */ + public function withPriceMode(?string $priceMode) + { + $this->priceMode = $priceMode; + + return $this; + } + /** * @deprecated use withName() instead * @return $this @@ -472,7 +527,8 @@ public function build(): CustomLineItem $this->taxRate instanceof TaxRateBuilder ? $this->taxRate->build() : $this->taxRate, $this->discountedPricePerQuantity, $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, - $this->shippingDetails instanceof ItemShippingDetailsBuilder ? $this->shippingDetails->build() : $this->shippingDetails + $this->shippingDetails instanceof ItemShippingDetailsBuilder ? $this->shippingDetails->build() : $this->shippingDetails, + $this->priceMode ); } diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraft.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraft.php index 093c60a9640..bd70b638295 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraft.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraft.php @@ -25,8 +25,10 @@ interface CustomLineItemDraft extends JsonObject public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; public const FIELD_CUSTOM = 'custom'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; + public const FIELD_PRICE_MODE = 'priceMode'; /** + * @return null|LocalizedString */ public function getName(); @@ -35,16 +37,19 @@ public function getName(); *

The amount of a CustomLineItemin the cart. * Must be a positive integer.

* + * @return null|int */ public function getQuantity(); /** + * @return null|Money */ public function getMoney(); /** + * @return null|string */ public function getSlug(); @@ -52,6 +57,7 @@ public function getSlug(); /** *

The given tax category will be used to select a tax rate when a cart has the TaxMode Platform.

* + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory(); @@ -59,6 +65,7 @@ public function getTaxCategory(); /** *

An external tax rate can be set if the cart has the External TaxMode.

* + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); @@ -66,6 +73,7 @@ public function getExternalTaxRate(); /** *

The custom fields.

* + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -73,10 +81,23 @@ public function getCustom(); /** *

Container for custom line item specific address(es).

* + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); + /** + *
    + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.
  • + *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • + *
+ * + + * @return null|string + */ + public function getPriceMode(); + /** * @param ?LocalizedString $name */ @@ -116,4 +137,9 @@ public function setCustom(?CustomFieldsDraft $custom): void; * @param ?ItemShippingDetailsDraft $shippingDetails */ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): void; + + /** + * @param ?string $priceMode + */ + public function setPriceMode(?string $priceMode): void; } diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftBuilder.php index 8433429f97c..d315c937a71 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftBuilder.php @@ -29,46 +29,61 @@ final class CustomLineItemDraftBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?int */ private $quantity; /** + * @var null|Money|MoneyBuilder */ private $money; /** + * @var ?string */ private $slug; /** + * @var null|TaxCategoryResourceIdentifier|TaxCategoryResourceIdentifierBuilder */ private $taxCategory; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetails; /** + + * @var ?string + */ + private $priceMode; + + /** + * @return null|LocalizedString */ public function getName() @@ -80,6 +95,7 @@ public function getName() *

The amount of a CustomLineItemin the cart. * Must be a positive integer.

* + * @return null|int */ public function getQuantity() @@ -88,6 +104,7 @@ public function getQuantity() } /** + * @return null|Money */ public function getMoney() @@ -96,6 +113,7 @@ public function getMoney() } /** + * @return null|string */ public function getSlug() @@ -106,6 +124,7 @@ public function getSlug() /** *

The given tax category will be used to select a tax rate when a cart has the TaxMode Platform.

* + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -116,6 +135,7 @@ public function getTaxCategory() /** *

An external tax rate can be set if the cart has the External TaxMode.

* + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() @@ -126,6 +146,7 @@ public function getExternalTaxRate() /** *

The custom fields.

* + * @return null|CustomFieldsDraft */ public function getCustom() @@ -136,6 +157,7 @@ public function getCustom() /** *

Container for custom line item specific address(es).

* + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() @@ -143,6 +165,21 @@ public function getShippingDetails() return $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails; } + /** + *
    + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.
  • + *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • + *
+ * + + * @return null|string + */ + public function getPriceMode() + { + return $this->priceMode; + } + /** * @param ?LocalizedString $name * @return $this @@ -231,6 +268,17 @@ public function withShippingDetails(?ItemShippingDetailsDraft $shippingDetails) return $this; } + /** + * @param ?string $priceMode + * @return $this + */ + public function withPriceMode(?string $priceMode) + { + $this->priceMode = $priceMode; + + return $this; + } + /** * @deprecated use withName() instead * @return $this @@ -307,7 +355,8 @@ public function build(): CustomLineItemDraft $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory, $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, - $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails + $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails, + $this->priceMode ); } diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftModel.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftModel.php index 5efe59dce12..04dcf0b757c 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftModel.php @@ -28,45 +28,59 @@ final class CustomLineItemDraftModel extends JsonObjectModel implements CustomLineItemDraft { /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?int */ protected $quantity; /** + * * @var ?Money */ protected $money; /** + * * @var ?string */ protected $slug; /** + * * @var ?TaxCategoryResourceIdentifier */ protected $taxCategory; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; + /** + * + * @var ?string + */ + protected $priceMode; + /** * @psalm-suppress MissingParamType @@ -79,7 +93,8 @@ public function __construct( ?TaxCategoryResourceIdentifier $taxCategory = null, ?ExternalTaxRateDraft $externalTaxRate = null, ?CustomFieldsDraft $custom = null, - ?ItemShippingDetailsDraft $shippingDetails = null + ?ItemShippingDetailsDraft $shippingDetails = null, + ?string $priceMode = null ) { $this->name = $name; $this->quantity = $quantity; @@ -89,9 +104,11 @@ public function __construct( $this->externalTaxRate = $externalTaxRate; $this->custom = $custom; $this->shippingDetails = $shippingDetails; + $this->priceMode = $priceMode; } /** + * * @return null|LocalizedString */ public function getName() @@ -113,6 +130,7 @@ public function getName() *

The amount of a CustomLineItemin the cart. * Must be a positive integer.

* + * * @return null|int */ public function getQuantity() @@ -130,6 +148,7 @@ public function getQuantity() } /** + * * @return null|Money */ public function getMoney() @@ -148,6 +167,7 @@ public function getMoney() } /** + * * @return null|string */ public function getSlug() @@ -167,6 +187,7 @@ public function getSlug() /** *

The given tax category will be used to select a tax rate when a cart has the TaxMode Platform.

* + * * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -187,6 +208,7 @@ public function getTaxCategory() /** *

An external tax rate can be set if the cart has the External TaxMode.

* + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() @@ -207,6 +229,7 @@ public function getExternalTaxRate() /** *

The custom fields.

* + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -227,6 +250,7 @@ public function getCustom() /** *

Container for custom line item specific address(es).

* + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() @@ -244,6 +268,30 @@ public function getShippingDetails() return $this->shippingDetails; } + /** + *
    + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.
  • + *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • + *
+ * + * + * @return null|string + */ + public function getPriceMode() + { + if (is_null($this->priceMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PRICE_MODE); + if (is_null($data)) { + return null; + } + $this->priceMode = (string) $data; + } + + return $this->priceMode; + } + /** * @param ?LocalizedString $name @@ -308,4 +356,12 @@ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): { $this->shippingDetails = $shippingDetails; } + + /** + * @param ?string $priceMode + */ + public function setPriceMode(?string $priceMode): void + { + $this->priceMode = $priceMode; + } } diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraft.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraft.php index 8449bb285a7..b7762662a26 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraft.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraft.php @@ -28,8 +28,10 @@ interface CustomLineItemImportDraft extends JsonObject public const FIELD_TAX_CATEGORY = 'taxCategory'; public const FIELD_CUSTOM = 'custom'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; + public const FIELD_PRICE_MODE = 'priceMode'; /** + * @return null|LocalizedString */ public function getName(); @@ -38,6 +40,7 @@ public function getName(); *

The amount of a CustomLineItem in the cart. * Must be a positive integer.

* + * @return null|int */ public function getQuantity(); @@ -45,26 +48,31 @@ public function getQuantity(); /** *

The cost to add to the cart. The amount can be negative.

* + * @return null|Money */ public function getMoney(); /** + * @return null|string */ public function getSlug(); /** + * @return null|ItemStateCollection */ public function getState(); /** + * @return null|TaxRate */ public function getTaxRate(); /** + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory(); @@ -72,15 +80,29 @@ public function getTaxCategory(); /** *

The custom fields.

* + * @return null|CustomFieldsDraft */ public function getCustom(); /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); + /** + *
    + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.
  • + *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • + *
+ * + + * @return null|string + */ + public function getPriceMode(); + /** * @param ?LocalizedString $name */ @@ -125,4 +147,9 @@ public function setCustom(?CustomFieldsDraft $custom): void; * @param ?ItemShippingDetailsDraft $shippingDetails */ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): void; + + /** + * @param ?string $priceMode + */ + public function setPriceMode(?string $priceMode): void; } diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraftBuilder.php index fd24db700fc..87914ef7fcb 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraftBuilder.php @@ -32,51 +32,67 @@ final class CustomLineItemImportDraftBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?int */ private $quantity; /** + * @var null|Money|MoneyBuilder */ private $money; /** + * @var ?string */ private $slug; /** + * @var ?ItemStateCollection */ private $state; /** + * @var null|TaxRate|TaxRateBuilder */ private $taxRate; /** + * @var null|TaxCategoryResourceIdentifier|TaxCategoryResourceIdentifierBuilder */ private $taxCategory; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetails; /** + + * @var ?string + */ + private $priceMode; + + /** + * @return null|LocalizedString */ public function getName() @@ -88,6 +104,7 @@ public function getName() *

The amount of a CustomLineItem in the cart. * Must be a positive integer.

* + * @return null|int */ public function getQuantity() @@ -98,6 +115,7 @@ public function getQuantity() /** *

The cost to add to the cart. The amount can be negative.

* + * @return null|Money */ public function getMoney() @@ -106,6 +124,7 @@ public function getMoney() } /** + * @return null|string */ public function getSlug() @@ -114,6 +133,7 @@ public function getSlug() } /** + * @return null|ItemStateCollection */ public function getState() @@ -122,6 +142,7 @@ public function getState() } /** + * @return null|TaxRate */ public function getTaxRate() @@ -130,6 +151,7 @@ public function getTaxRate() } /** + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -140,6 +162,7 @@ public function getTaxCategory() /** *

The custom fields.

* + * @return null|CustomFieldsDraft */ public function getCustom() @@ -148,6 +171,7 @@ public function getCustom() } /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() @@ -155,6 +179,21 @@ public function getShippingDetails() return $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails; } + /** + *
    + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.
  • + *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • + *
+ * + + * @return null|string + */ + public function getPriceMode() + { + return $this->priceMode; + } + /** * @param ?LocalizedString $name * @return $this @@ -254,6 +293,17 @@ public function withShippingDetails(?ItemShippingDetailsDraft $shippingDetails) return $this; } + /** + * @param ?string $priceMode + * @return $this + */ + public function withPriceMode(?string $priceMode) + { + $this->priceMode = $priceMode; + + return $this; + } + /** * @deprecated use withName() instead * @return $this @@ -331,7 +381,8 @@ public function build(): CustomLineItemImportDraft $this->taxRate instanceof TaxRateBuilder ? $this->taxRate->build() : $this->taxRate, $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory, $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, - $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails + $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails, + $this->priceMode ); } diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraftModel.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraftModel.php index c9b330e027e..35964a4148e 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraftModel.php @@ -31,50 +31,65 @@ final class CustomLineItemImportDraftModel extends JsonObjectModel implements CustomLineItemImportDraft { /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?int */ protected $quantity; /** + * * @var ?Money */ protected $money; /** + * * @var ?string */ protected $slug; /** + * * @var ?ItemStateCollection */ protected $state; /** + * * @var ?TaxRate */ protected $taxRate; /** + * * @var ?TaxCategoryResourceIdentifier */ protected $taxCategory; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; + /** + * + * @var ?string + */ + protected $priceMode; + /** * @psalm-suppress MissingParamType @@ -88,7 +103,8 @@ public function __construct( ?TaxRate $taxRate = null, ?TaxCategoryResourceIdentifier $taxCategory = null, ?CustomFieldsDraft $custom = null, - ?ItemShippingDetailsDraft $shippingDetails = null + ?ItemShippingDetailsDraft $shippingDetails = null, + ?string $priceMode = null ) { $this->name = $name; $this->quantity = $quantity; @@ -99,9 +115,11 @@ public function __construct( $this->taxCategory = $taxCategory; $this->custom = $custom; $this->shippingDetails = $shippingDetails; + $this->priceMode = $priceMode; } /** + * * @return null|LocalizedString */ public function getName() @@ -123,6 +141,7 @@ public function getName() *

The amount of a CustomLineItem in the cart. * Must be a positive integer.

* + * * @return null|int */ public function getQuantity() @@ -142,6 +161,7 @@ public function getQuantity() /** *

The cost to add to the cart. The amount can be negative.

* + * * @return null|Money */ public function getMoney() @@ -160,6 +180,7 @@ public function getMoney() } /** + * * @return null|string */ public function getSlug() @@ -177,6 +198,7 @@ public function getSlug() } /** + * * @return null|ItemStateCollection */ public function getState() @@ -194,6 +216,7 @@ public function getState() } /** + * * @return null|TaxRate */ public function getTaxRate() @@ -212,6 +235,7 @@ public function getTaxRate() } /** + * * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -232,6 +256,7 @@ public function getTaxCategory() /** *

The custom fields.

* + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -250,6 +275,7 @@ public function getCustom() } /** + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() @@ -267,6 +293,30 @@ public function getShippingDetails() return $this->shippingDetails; } + /** + *
    + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.
  • + *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • + *
+ * + * + * @return null|string + */ + public function getPriceMode() + { + if (is_null($this->priceMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PRICE_MODE); + if (is_null($data)) { + return null; + } + $this->priceMode = (string) $data; + } + + return $this->priceMode; + } + /** * @param ?LocalizedString $name @@ -339,4 +389,12 @@ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): { $this->shippingDetails = $shippingDetails; } + + /** + * @param ?string $priceMode + */ + public function setPriceMode(?string $priceMode): void + { + $this->priceMode = $priceMode; + } } diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php index e0b49862d52..e30810a9f96 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php @@ -31,70 +31,89 @@ final class CustomLineItemModel extends JsonObjectModel implements CustomLineItem { /** + * * @var ?string */ protected $id; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?TypedMoney */ protected $money; /** + * * @var ?TaxedItemPrice */ protected $taxedPrice; /** + * * @var ?TypedMoney */ protected $totalPrice; /** + * * @var ?string */ protected $slug; /** + * * @var ?int */ protected $quantity; /** + * * @var ?ItemStateCollection */ protected $state; /** + * * @var ?TaxCategoryReference */ protected $taxCategory; /** + * * @var ?TaxRate */ protected $taxRate; /** + * * @var ?DiscountedLineItemPriceForQuantityCollection */ protected $discountedPricePerQuantity; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?ItemShippingDetails */ protected $shippingDetails; + /** + * + * @var ?string + */ + protected $priceMode; + /** * @psalm-suppress MissingParamType @@ -112,7 +131,8 @@ public function __construct( ?TaxRate $taxRate = null, ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity = null, ?CustomFields $custom = null, - ?ItemShippingDetails $shippingDetails = null + ?ItemShippingDetails $shippingDetails = null, + ?string $priceMode = null ) { $this->id = $id; $this->name = $name; @@ -127,11 +147,13 @@ public function __construct( $this->discountedPricePerQuantity = $discountedPricePerQuantity; $this->custom = $custom; $this->shippingDetails = $shippingDetails; + $this->priceMode = $priceMode; } /** *

Unique identifier of the CustomLineItem.

* + * * @return null|string */ public function getId() @@ -151,6 +173,7 @@ public function getId() /** *

The name of this CustomLineItem.

* + * * @return null|LocalizedString */ public function getName() @@ -172,6 +195,7 @@ public function getName() *

The cost to add to the cart. * The amount can be negative.

* + * * @return null|TypedMoney */ public function getMoney() @@ -192,6 +216,7 @@ public function getMoney() /** *

Set once the taxRate is set.

* + * * @return null|TaxedItemPrice */ public function getTaxedPrice() @@ -215,6 +240,7 @@ public function getTaxedPrice() * Otherwise a total price is just a money multiplied by the quantity. * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property.

* + * * @return null|TypedMoney */ public function getTotalPrice() @@ -235,6 +261,7 @@ public function getTotalPrice() /** *

A unique String in the cart to identify this CustomLineItem.

* + * * @return null|string */ public function getSlug() @@ -255,6 +282,7 @@ public function getSlug() *

The amount of a CustomLineItem in the cart. * Must be a positive integer.

* + * * @return null|int */ public function getQuantity() @@ -272,6 +300,7 @@ public function getQuantity() } /** + * * @return null|ItemStateCollection */ public function getState() @@ -289,6 +318,7 @@ public function getState() } /** + * * @return null|TaxCategoryReference */ public function getTaxCategory() @@ -310,6 +340,7 @@ public function getTaxCategory() *

Will be set automatically in the Platform TaxMode once the shipping address is set is set. * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

* + * * @return null|TaxRate */ public function getTaxRate() @@ -328,6 +359,7 @@ public function getTaxRate() } /** + * * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity() @@ -345,6 +377,7 @@ public function getDiscountedPricePerQuantity() } /** + * * @return null|CustomFields */ public function getCustom() @@ -367,6 +400,7 @@ public function getCustom() * CustomLineItem fields that can be used in query predicates: slug, name, quantity, * money, state, discountedPricePerQuantity.

* + * * @return null|ItemShippingDetails */ public function getShippingDetails() @@ -384,6 +418,27 @@ public function getShippingDetails() return $this->shippingDetails; } + /** + *

Specifies whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.

+ * + * + * @return null|string + */ + public function getPriceMode() + { + if (is_null($this->priceMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PRICE_MODE); + if (is_null($data)) { + return null; + } + $this->priceMode = (string) $data; + } + + return $this->priceMode; + } + /** * @param ?string $id @@ -488,4 +543,12 @@ public function setShippingDetails(?ItemShippingDetails $shippingDetails): void { $this->shippingDetails = $shippingDetails; } + + /** + * @param ?string $priceMode + */ + public function setPriceMode(?string $priceMode): void + { + $this->priceMode = $priceMode; + } } diff --git a/lib/commercetools-api/src/Models/Cart/CustomShippingDraft.php b/lib/commercetools-api/src/Models/Cart/CustomShippingDraft.php new file mode 100644 index 00000000000..75e5c9b301d --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CustomShippingDraft.php @@ -0,0 +1,152 @@ +User-defined unique identifier of the custom Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getKey(); + + /** + *

Name of the custom Shipping Method.

+ * + + * @return null|string + */ + public function getShippingMethodName(); + + /** + *

Determines the shipping rate and Tax Rate of the associated Line Items.

+ * + + * @return null|BaseAddress + */ + public function getShippingAddress(); + + /** + *

Determines the shipping price.

+ * + + * @return null|ShippingRateDraft + */ + public function getShippingRate(); + + /** + *

Used as an input to select a ShippingRatePriceTier.

+ * + *

The shippingRateInput cannot be set on the Cart if CartValueType is defined.

+ * + + * @return null|ShippingRateInputDraft + */ + public function getShippingRateInput(); + + /** + *

Tax Category used to determine a shipping Tax Rate if a Cart has the Platform TaxMode.

+ * + + * @return null|TaxCategoryResourceIdentifier + */ + public function getTaxCategory(); + + /** + *

Tax Rate used to tax a shipping expense if the Cart has the External TaxMode.

+ * + + * @return null|string + */ + public function getExternalTaxRate(); + + /** + *

Deliveries tied to a Shipping Method in a multi-shipping method Cart. + * It holds information on how items are delivered to customers.

+ * + + * @return null|DeliveryCollection + */ + public function getDeliveries(); + + /** + *

Custom Fields for the custom Shipping Method.

+ * + + * @return null|string + */ + public function getCustom(); + + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + + /** + * @param ?string $shippingMethodName + */ + public function setShippingMethodName(?string $shippingMethodName): void; + + /** + * @param ?BaseAddress $shippingAddress + */ + public function setShippingAddress(?BaseAddress $shippingAddress): void; + + /** + * @param ?ShippingRateDraft $shippingRate + */ + public function setShippingRate(?ShippingRateDraft $shippingRate): void; + + /** + * @param ?ShippingRateInputDraft $shippingRateInput + */ + public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput): void; + + /** + * @param ?TaxCategoryResourceIdentifier $taxCategory + */ + public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): void; + + /** + * @param ?string $externalTaxRate + */ + public function setExternalTaxRate(?string $externalTaxRate): void; + + /** + * @param ?DeliveryCollection $deliveries + */ + public function setDeliveries(?DeliveryCollection $deliveries): void; + + /** + * @param ?string $custom + */ + public function setCustom(?string $custom): void; +} diff --git a/lib/commercetools-api/src/Models/Cart/CustomShippingDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/CustomShippingDraftBuilder.php new file mode 100644 index 00000000000..eff9e0bbfd7 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CustomShippingDraftBuilder.php @@ -0,0 +1,351 @@ + + */ +final class CustomShippingDraftBuilder implements Builder +{ + /** + + * @var ?string + */ + private $key; + + /** + + * @var ?string + */ + private $shippingMethodName; + + /** + + * @var null|BaseAddress|BaseAddressBuilder + */ + private $shippingAddress; + + /** + + * @var null|ShippingRateDraft|ShippingRateDraftBuilder + */ + private $shippingRate; + + /** + + * @var null|ShippingRateInputDraft|ShippingRateInputDraftBuilder + */ + private $shippingRateInput; + + /** + + * @var null|TaxCategoryResourceIdentifier|TaxCategoryResourceIdentifierBuilder + */ + private $taxCategory; + + /** + + * @var ?string + */ + private $externalTaxRate; + + /** + + * @var ?DeliveryCollection + */ + private $deliveries; + + /** + + * @var ?string + */ + private $custom; + + /** + *

User-defined unique identifier of the custom Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + *

Name of the custom Shipping Method.

+ * + + * @return null|string + */ + public function getShippingMethodName() + { + return $this->shippingMethodName; + } + + /** + *

Determines the shipping rate and Tax Rate of the associated Line Items.

+ * + + * @return null|BaseAddress + */ + public function getShippingAddress() + { + return $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress; + } + + /** + *

Determines the shipping price.

+ * + + * @return null|ShippingRateDraft + */ + public function getShippingRate() + { + return $this->shippingRate instanceof ShippingRateDraftBuilder ? $this->shippingRate->build() : $this->shippingRate; + } + + /** + *

Used as an input to select a ShippingRatePriceTier.

+ * + *

The shippingRateInput cannot be set on the Cart if CartValueType is defined.

+ * + + * @return null|ShippingRateInputDraft + */ + public function getShippingRateInput() + { + return $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput; + } + + /** + *

Tax Category used to determine a shipping Tax Rate if a Cart has the Platform TaxMode.

+ * + + * @return null|TaxCategoryResourceIdentifier + */ + public function getTaxCategory() + { + return $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory; + } + + /** + *

Tax Rate used to tax a shipping expense if the Cart has the External TaxMode.

+ * + + * @return null|string + */ + public function getExternalTaxRate() + { + return $this->externalTaxRate; + } + + /** + *

Deliveries tied to a Shipping Method in a multi-shipping method Cart. + * It holds information on how items are delivered to customers.

+ * + + * @return null|DeliveryCollection + */ + public function getDeliveries() + { + return $this->deliveries; + } + + /** + *

Custom Fields for the custom Shipping Method.

+ * + + * @return null|string + */ + public function getCustom() + { + return $this->custom; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?string $shippingMethodName + * @return $this + */ + public function withShippingMethodName(?string $shippingMethodName) + { + $this->shippingMethodName = $shippingMethodName; + + return $this; + } + + /** + * @param ?BaseAddress $shippingAddress + * @return $this + */ + public function withShippingAddress(?BaseAddress $shippingAddress) + { + $this->shippingAddress = $shippingAddress; + + return $this; + } + + /** + * @param ?ShippingRateDraft $shippingRate + * @return $this + */ + public function withShippingRate(?ShippingRateDraft $shippingRate) + { + $this->shippingRate = $shippingRate; + + return $this; + } + + /** + * @param ?ShippingRateInputDraft $shippingRateInput + * @return $this + */ + public function withShippingRateInput(?ShippingRateInputDraft $shippingRateInput) + { + $this->shippingRateInput = $shippingRateInput; + + return $this; + } + + /** + * @param ?TaxCategoryResourceIdentifier $taxCategory + * @return $this + */ + public function withTaxCategory(?TaxCategoryResourceIdentifier $taxCategory) + { + $this->taxCategory = $taxCategory; + + return $this; + } + + /** + * @param ?string $externalTaxRate + * @return $this + */ + public function withExternalTaxRate(?string $externalTaxRate) + { + $this->externalTaxRate = $externalTaxRate; + + return $this; + } + + /** + * @param ?DeliveryCollection $deliveries + * @return $this + */ + public function withDeliveries(?DeliveryCollection $deliveries) + { + $this->deliveries = $deliveries; + + return $this; + } + + /** + * @param ?string $custom + * @return $this + */ + public function withCustom(?string $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @deprecated use withShippingAddress() instead + * @return $this + */ + public function withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress) + { + $this->shippingAddress = $shippingAddress; + + return $this; + } + + /** + * @deprecated use withShippingRate() instead + * @return $this + */ + public function withShippingRateBuilder(?ShippingRateDraftBuilder $shippingRate) + { + $this->shippingRate = $shippingRate; + + return $this; + } + + /** + * @deprecated use withShippingRateInput() instead + * @return $this + */ + public function withShippingRateInputBuilder(?ShippingRateInputDraftBuilder $shippingRateInput) + { + $this->shippingRateInput = $shippingRateInput; + + return $this; + } + + /** + * @deprecated use withTaxCategory() instead + * @return $this + */ + public function withTaxCategoryBuilder(?TaxCategoryResourceIdentifierBuilder $taxCategory) + { + $this->taxCategory = $taxCategory; + + return $this; + } + + public function build(): CustomShippingDraft + { + return new CustomShippingDraftModel( + $this->key, + $this->shippingMethodName, + $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, + $this->shippingRate instanceof ShippingRateDraftBuilder ? $this->shippingRate->build() : $this->shippingRate, + $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, + $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory, + $this->externalTaxRate, + $this->deliveries, + $this->custom + ); + } + + public static function of(): CustomShippingDraftBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CustomShippingDraftCollection.php b/lib/commercetools-api/src/Models/Cart/CustomShippingDraftCollection.php new file mode 100644 index 00000000000..b3812b54961 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CustomShippingDraftCollection.php @@ -0,0 +1,56 @@ + + * @method CustomShippingDraft current() + * @method CustomShippingDraft end() + * @method CustomShippingDraft at($offset) + */ +class CustomShippingDraftCollection extends MapperSequence +{ + /** + * @psalm-assert CustomShippingDraft $value + * @psalm-param CustomShippingDraft|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomShippingDraftCollection + */ + public function add($value) + { + if (!$value instanceof CustomShippingDraft) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomShippingDraft + */ + protected function mapper() + { + return function (?int $index): ?CustomShippingDraft { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomShippingDraft $data */ + $data = CustomShippingDraftModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CustomShippingDraftModel.php b/lib/commercetools-api/src/Models/Cart/CustomShippingDraftModel.php new file mode 100644 index 00000000000..394dff1ad43 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/CustomShippingDraftModel.php @@ -0,0 +1,371 @@ +key = $key; + $this->shippingMethodName = $shippingMethodName; + $this->shippingAddress = $shippingAddress; + $this->shippingRate = $shippingRate; + $this->shippingRateInput = $shippingRateInput; + $this->taxCategory = $taxCategory; + $this->externalTaxRate = $externalTaxRate; + $this->deliveries = $deliveries; + $this->custom = $custom; + } + + /** + *

User-defined unique identifier of the custom Shipping Method in a Cart with Multiple ShippingMode.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + *

Name of the custom Shipping Method.

+ * + * + * @return null|string + */ + public function getShippingMethodName() + { + if (is_null($this->shippingMethodName)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_METHOD_NAME); + if (is_null($data)) { + return null; + } + $this->shippingMethodName = (string) $data; + } + + return $this->shippingMethodName; + } + + /** + *

Determines the shipping rate and Tax Rate of the associated Line Items.

+ * + * + * @return null|BaseAddress + */ + public function getShippingAddress() + { + if (is_null($this->shippingAddress)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->shippingAddress = BaseAddressModel::of($data); + } + + return $this->shippingAddress; + } + + /** + *

Determines the shipping price.

+ * + * + * @return null|ShippingRateDraft + */ + public function getShippingRate() + { + if (is_null($this->shippingRate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_RATE); + if (is_null($data)) { + return null; + } + + $this->shippingRate = ShippingRateDraftModel::of($data); + } + + return $this->shippingRate; + } + + /** + *

Used as an input to select a ShippingRatePriceTier.

+ * + *

The shippingRateInput cannot be set on the Cart if CartValueType is defined.

+ * + * + * @return null|ShippingRateInputDraft + */ + public function getShippingRateInput() + { + if (is_null($this->shippingRateInput)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_RATE_INPUT); + if (is_null($data)) { + return null; + } + + $this->shippingRateInput = ShippingRateInputDraftModel::of($data); + } + + return $this->shippingRateInput; + } + + /** + *

Tax Category used to determine a shipping Tax Rate if a Cart has the Platform TaxMode.

+ * + * + * @return null|TaxCategoryResourceIdentifier + */ + public function getTaxCategory() + { + if (is_null($this->taxCategory)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TAX_CATEGORY); + if (is_null($data)) { + return null; + } + + $this->taxCategory = TaxCategoryResourceIdentifierModel::of($data); + } + + return $this->taxCategory; + } + + /** + *

Tax Rate used to tax a shipping expense if the Cart has the External TaxMode.

+ * + * + * @return null|string + */ + public function getExternalTaxRate() + { + if (is_null($this->externalTaxRate)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); + if (is_null($data)) { + return null; + } + $this->externalTaxRate = (string) $data; + } + + return $this->externalTaxRate; + } + + /** + *

Deliveries tied to a Shipping Method in a multi-shipping method Cart. + * It holds information on how items are delivered to customers.

+ * + * + * @return null|DeliveryCollection + */ + public function getDeliveries() + { + if (is_null($this->deliveries)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_DELIVERIES); + if (is_null($data)) { + return null; + } + $this->deliveries = DeliveryCollection::fromArray($data); + } + + return $this->deliveries; + } + + /** + *

Custom Fields for the custom Shipping Method.

+ * + * + * @return null|string + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + $this->custom = (string) $data; + } + + return $this->custom; + } + + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + + /** + * @param ?string $shippingMethodName + */ + public function setShippingMethodName(?string $shippingMethodName): void + { + $this->shippingMethodName = $shippingMethodName; + } + + /** + * @param ?BaseAddress $shippingAddress + */ + public function setShippingAddress(?BaseAddress $shippingAddress): void + { + $this->shippingAddress = $shippingAddress; + } + + /** + * @param ?ShippingRateDraft $shippingRate + */ + public function setShippingRate(?ShippingRateDraft $shippingRate): void + { + $this->shippingRate = $shippingRate; + } + + /** + * @param ?ShippingRateInputDraft $shippingRateInput + */ + public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput): void + { + $this->shippingRateInput = $shippingRateInput; + } + + /** + * @param ?TaxCategoryResourceIdentifier $taxCategory + */ + public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): void + { + $this->taxCategory = $taxCategory; + } + + /** + * @param ?string $externalTaxRate + */ + public function setExternalTaxRate(?string $externalTaxRate): void + { + $this->externalTaxRate = $externalTaxRate; + } + + /** + * @param ?DeliveryCollection $deliveries + */ + public function setDeliveries(?DeliveryCollection $deliveries): void + { + $this->deliveries = $deliveries; + } + + /** + * @param ?string $custom + */ + public function setCustom(?string $custom): void + { + $this->custom = $custom; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscount.php b/lib/commercetools-api/src/Models/Cart/DirectDiscount.php index 6d8ffbe16a8..63b230a7d43 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscount.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscount.php @@ -22,11 +22,13 @@ interface DirectDiscount extends JsonObject /** *

The unique ID of the cart discount.

* + * @return null|string */ public function getId(); /** + * @return null|CartDiscountValue */ public function getValue(); @@ -34,6 +36,7 @@ public function getValue(); /** *

Empty when the value has type giftLineItem, otherwise a CartDiscountTarget is set.

* + * @return null|CartDiscountTarget */ public function getTarget(); diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscountBuilder.php b/lib/commercetools-api/src/Models/Cart/DirectDiscountBuilder.php index f49103b0755..17697b750cb 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscountBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscountBuilder.php @@ -25,16 +25,19 @@ final class DirectDiscountBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|CartDiscountValue|CartDiscountValueBuilder */ private $value; /** + * @var null|CartDiscountTarget|CartDiscountTargetBuilder */ private $target; @@ -42,6 +45,7 @@ final class DirectDiscountBuilder implements Builder /** *

The unique ID of the cart discount.

* + * @return null|string */ public function getId() @@ -50,6 +54,7 @@ public function getId() } /** + * @return null|CartDiscountValue */ public function getValue() @@ -60,6 +65,7 @@ public function getValue() /** *

Empty when the value has type giftLineItem, otherwise a CartDiscountTarget is set.

* + * @return null|CartDiscountTarget */ public function getTarget() diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraft.php b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraft.php index 948a0d20fcf..5b8c2fe2073 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraft.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraft.php @@ -19,6 +19,7 @@ interface DirectDiscountDraft extends JsonObject public const FIELD_TARGET = 'target'; /** + * @return null|CartDiscountValue */ public function getValue(); @@ -26,6 +27,7 @@ public function getValue(); /** *

Empty when the value has type giftLineItem, otherwise a CartDiscountTarget is set.

* + * @return null|CartDiscountTarget */ public function getTarget(); diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftBuilder.php index c0aa9ff3f16..8efa0b8cedb 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftBuilder.php @@ -25,16 +25,19 @@ final class DirectDiscountDraftBuilder implements Builder { /** + * @var null|CartDiscountValue|CartDiscountValueBuilder */ private $value; /** + * @var null|CartDiscountTarget|CartDiscountTargetBuilder */ private $target; /** + * @return null|CartDiscountValue */ public function getValue() @@ -45,6 +48,7 @@ public function getValue() /** *

Empty when the value has type giftLineItem, otherwise a CartDiscountTarget is set.

* + * @return null|CartDiscountTarget */ public function getTarget() diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftModel.php b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftModel.php index fd4a426abf3..c0b7a5cb1ad 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftModel.php @@ -24,11 +24,13 @@ final class DirectDiscountDraftModel extends JsonObjectModel implements DirectDiscountDraft { /** + * * @var ?CartDiscountValue */ protected $value; /** + * * @var ?CartDiscountTarget */ protected $target; @@ -46,6 +48,7 @@ public function __construct( } /** + * * @return null|CartDiscountValue */ public function getValue() @@ -66,6 +69,7 @@ public function getValue() /** *

Empty when the value has type giftLineItem, otherwise a CartDiscountTarget is set.

* + * * @return null|CartDiscountTarget */ public function getTarget() diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscountModel.php b/lib/commercetools-api/src/Models/Cart/DirectDiscountModel.php index 7547a8abc76..02900326a08 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscountModel.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscountModel.php @@ -24,16 +24,19 @@ final class DirectDiscountModel extends JsonObjectModel implements DirectDiscount { /** + * * @var ?string */ protected $id; /** + * * @var ?CartDiscountValue */ protected $value; /** + * * @var ?CartDiscountTarget */ protected $target; @@ -55,6 +58,7 @@ public function __construct( /** *

The unique ID of the cart discount.

* + * * @return null|string */ public function getId() @@ -72,6 +76,7 @@ public function getId() } /** + * * @return null|CartDiscountValue */ public function getValue() @@ -92,6 +97,7 @@ public function getValue() /** *

Empty when the value has type giftLineItem, otherwise a CartDiscountTarget is set.

* + * * @return null|CartDiscountTarget */ public function getTarget() diff --git a/lib/commercetools-api/src/Models/Cart/DiscountCodeInfo.php b/lib/commercetools-api/src/Models/Cart/DiscountCodeInfo.php index 359d83ef4f7..4b9b38611ad 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountCodeInfo.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountCodeInfo.php @@ -18,11 +18,13 @@ interface DiscountCodeInfo extends JsonObject public const FIELD_STATE = 'state'; /** + * @return null|DiscountCodeReference */ public function getDiscountCode(); /** + * @return null|string */ public function getState(); diff --git a/lib/commercetools-api/src/Models/Cart/DiscountCodeInfoBuilder.php b/lib/commercetools-api/src/Models/Cart/DiscountCodeInfoBuilder.php index 506e3c23e05..9393c624199 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountCodeInfoBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountCodeInfoBuilder.php @@ -23,16 +23,19 @@ final class DiscountCodeInfoBuilder implements Builder { /** + * @var null|DiscountCodeReference|DiscountCodeReferenceBuilder */ private $discountCode; /** + * @var ?string */ private $state; /** + * @return null|DiscountCodeReference */ public function getDiscountCode() @@ -41,6 +44,7 @@ public function getDiscountCode() } /** + * @return null|string */ public function getState() diff --git a/lib/commercetools-api/src/Models/Cart/DiscountCodeInfoModel.php b/lib/commercetools-api/src/Models/Cart/DiscountCodeInfoModel.php index a5f2c71edba..04174528d24 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountCodeInfoModel.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountCodeInfoModel.php @@ -22,11 +22,13 @@ final class DiscountCodeInfoModel extends JsonObjectModel implements DiscountCodeInfo { /** + * * @var ?DiscountCodeReference */ protected $discountCode; /** + * * @var ?string */ protected $state; @@ -44,6 +46,7 @@ public function __construct( } /** + * * @return null|DiscountCodeReference */ public function getDiscountCode() @@ -62,6 +65,7 @@ public function getDiscountCode() } /** + * * @return null|string */ public function getState() diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortion.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortion.php index 41b380af652..81a5b85a437 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortion.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortion.php @@ -19,11 +19,13 @@ interface DiscountedLineItemPortion extends JsonObject public const FIELD_DISCOUNTED_AMOUNT = 'discountedAmount'; /** + * @return null|CartDiscountReference */ public function getDiscount(); /** + * @return null|TypedMoney */ public function getDiscountedAmount(); diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionBuilder.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionBuilder.php index a1e1143b7be..167aa521343 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionBuilder.php @@ -25,16 +25,19 @@ final class DiscountedLineItemPortionBuilder implements Builder { /** + * @var null|CartDiscountReference|CartDiscountReferenceBuilder */ private $discount; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $discountedAmount; /** + * @return null|CartDiscountReference */ public function getDiscount() @@ -43,6 +46,7 @@ public function getDiscount() } /** + * @return null|TypedMoney */ public function getDiscountedAmount() diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionModel.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionModel.php index ac922b0fcf4..c129029edcf 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionModel.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionModel.php @@ -24,11 +24,13 @@ final class DiscountedLineItemPortionModel extends JsonObjectModel implements DiscountedLineItemPortion { /** + * * @var ?CartDiscountReference */ protected $discount; /** + * * @var ?TypedMoney */ protected $discountedAmount; @@ -46,6 +48,7 @@ public function __construct( } /** + * * @return null|CartDiscountReference */ public function getDiscount() @@ -64,6 +67,7 @@ public function getDiscount() } /** + * * @return null|TypedMoney */ public function getDiscountedAmount() diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPrice.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPrice.php index 08b0382c151..e1a2eb80719 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPrice.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPrice.php @@ -18,11 +18,13 @@ interface DiscountedLineItemPrice extends JsonObject public const FIELD_INCLUDED_DISCOUNTS = 'includedDiscounts'; /** + * @return null|TypedMoney */ public function getValue(); /** + * @return null|DiscountedLineItemPortionCollection */ public function getIncludedDiscounts(); diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceBuilder.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceBuilder.php index dc7e9812510..4f7f7e6d553 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceBuilder.php @@ -23,16 +23,19 @@ final class DiscountedLineItemPriceBuilder implements Builder { /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $value; /** + * @var ?DiscountedLineItemPortionCollection */ private $includedDiscounts; /** + * @return null|TypedMoney */ public function getValue() @@ -41,6 +44,7 @@ public function getValue() } /** + * @return null|DiscountedLineItemPortionCollection */ public function getIncludedDiscounts() diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantity.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantity.php index 71e4825152c..6ad5a4a5196 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantity.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantity.php @@ -17,11 +17,13 @@ interface DiscountedLineItemPriceForQuantity extends JsonObject public const FIELD_DISCOUNTED_PRICE = 'discountedPrice'; /** + * @return null|int */ public function getQuantity(); /** + * @return null|DiscountedLineItemPrice */ public function getDiscountedPrice(); diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantityBuilder.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantityBuilder.php index 5aebfeda922..fd9e3e1923c 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantityBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantityBuilder.php @@ -21,16 +21,19 @@ final class DiscountedLineItemPriceForQuantityBuilder implements Builder { /** + * @var ?int */ private $quantity; /** + * @var null|DiscountedLineItemPrice|DiscountedLineItemPriceBuilder */ private $discountedPrice; /** + * @return null|int */ public function getQuantity() @@ -39,6 +42,7 @@ public function getQuantity() } /** + * @return null|DiscountedLineItemPrice */ public function getDiscountedPrice() diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantityModel.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantityModel.php index 786751f750c..acca3f4faf9 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantityModel.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceForQuantityModel.php @@ -20,11 +20,13 @@ final class DiscountedLineItemPriceForQuantityModel extends JsonObjectModel implements DiscountedLineItemPriceForQuantity { /** + * * @var ?int */ protected $quantity; /** + * * @var ?DiscountedLineItemPrice */ protected $discountedPrice; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|int */ public function getQuantity() @@ -59,6 +62,7 @@ public function getQuantity() } /** + * * @return null|DiscountedLineItemPrice */ public function getDiscountedPrice() diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceModel.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceModel.php index 977f4d78e74..7f88c1fa09b 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceModel.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceModel.php @@ -22,11 +22,13 @@ final class DiscountedLineItemPriceModel extends JsonObjectModel implements DiscountedLineItemPrice { /** + * * @var ?TypedMoney */ protected $value; /** + * * @var ?DiscountedLineItemPortionCollection */ protected $includedDiscounts; @@ -44,6 +46,7 @@ public function __construct( } /** + * * @return null|TypedMoney */ public function getValue() @@ -62,6 +65,7 @@ public function getValue() } /** + * * @return null|DiscountedLineItemPortionCollection */ public function getIncludedDiscounts() diff --git a/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPrice.php b/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPrice.php index 42933b5161a..c2dc425077b 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPrice.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPrice.php @@ -18,11 +18,13 @@ interface ExternalLineItemTotalPrice extends JsonObject public const FIELD_TOTAL_PRICE = 'totalPrice'; /** + * @return null|Money */ public function getPrice(); /** + * @return null|Money */ public function getTotalPrice(); diff --git a/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPriceBuilder.php b/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPriceBuilder.php index 794601622f3..9d1b175f0d5 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPriceBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPriceBuilder.php @@ -23,16 +23,19 @@ final class ExternalLineItemTotalPriceBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $price; /** + * @var null|Money|MoneyBuilder */ private $totalPrice; /** + * @return null|Money */ public function getPrice() @@ -41,6 +44,7 @@ public function getPrice() } /** + * @return null|Money */ public function getTotalPrice() diff --git a/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPriceModel.php b/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPriceModel.php index 559ef055be8..4e79449aa9d 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPriceModel.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalLineItemTotalPriceModel.php @@ -22,11 +22,13 @@ final class ExternalLineItemTotalPriceModel extends JsonObjectModel implements ExternalLineItemTotalPrice { /** + * * @var ?Money */ protected $price; /** + * * @var ?Money */ protected $totalPrice; @@ -44,6 +46,7 @@ public function __construct( } /** + * * @return null|Money */ public function getPrice() @@ -62,6 +65,7 @@ public function getPrice() } /** + * * @return null|Money */ public function getTotalPrice() diff --git a/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraft.php b/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraft.php index 5e7267d5cfb..a693ec35f20 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraft.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraft.php @@ -20,11 +20,13 @@ interface ExternalTaxAmountDraft extends JsonObject /** *

The total gross amount of the item (totalNet + taxes).

* + * @return null|Money */ public function getTotalGross(); /** + * @return null|ExternalTaxRateDraft */ public function getTaxRate(); diff --git a/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraftBuilder.php index f0c9246b9e8..d7aea8449bc 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraftBuilder.php @@ -23,11 +23,13 @@ final class ExternalTaxAmountDraftBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $totalGross; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $taxRate; @@ -35,6 +37,7 @@ final class ExternalTaxAmountDraftBuilder implements Builder /** *

The total gross amount of the item (totalNet + taxes).

* + * @return null|Money */ public function getTotalGross() @@ -43,6 +46,7 @@ public function getTotalGross() } /** + * @return null|ExternalTaxRateDraft */ public function getTaxRate() diff --git a/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraftModel.php b/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraftModel.php index d8614cc039d..b2a5ef33e27 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalTaxAmountDraftModel.php @@ -22,11 +22,13 @@ final class ExternalTaxAmountDraftModel extends JsonObjectModel implements ExternalTaxAmountDraft { /** + * * @var ?Money */ protected $totalGross; /** + * * @var ?ExternalTaxRateDraft */ protected $taxRate; @@ -46,6 +48,7 @@ public function __construct( /** *

The total gross amount of the item (totalNet + taxes).

* + * * @return null|Money */ public function getTotalGross() @@ -64,6 +67,7 @@ public function getTotalGross() } /** + * * @return null|ExternalTaxRateDraft */ public function getTaxRate() diff --git a/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraft.php b/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraft.php index 63ea471cfc7..1df66f7cae6 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraft.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraft.php @@ -22,6 +22,7 @@ interface ExternalTaxRateDraft extends JsonObject public const FIELD_INCLUDED_IN_PRICE = 'includedInPrice'; /** + * @return null|string */ public function getName(); @@ -32,6 +33,7 @@ public function getName(); * If subRates are specified * then the amount can be omitted or it must be the sum of the amounts of all subRates.

* + * @return null|float */ public function getAmount(); @@ -39,6 +41,7 @@ public function getAmount(); /** *

A two-digit country code as per ISO 3166-1 alpha-2.

* + * @return null|string */ public function getCountry(); @@ -46,6 +49,7 @@ public function getCountry(); /** *

The state in the country

* + * @return null|string */ public function getState(); @@ -55,6 +59,7 @@ public function getState(); * the US) where the total tax is a combination of multiple taxes (e.g. * state and local taxes).

* + * @return null|SubRateCollection */ public function getSubRates(); @@ -62,6 +67,7 @@ public function getSubRates(); /** *

The default value for includedInPrice is FALSE.

* + * @return null|bool */ public function getIncludedInPrice(); diff --git a/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraftBuilder.php index 30b52f2eca1..39a945051a7 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraftBuilder.php @@ -22,36 +22,43 @@ final class ExternalTaxRateDraftBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?float */ private $amount; /** + * @var ?string */ private $country; /** + * @var ?string */ private $state; /** + * @var ?SubRateCollection */ private $subRates; /** + * @var ?bool */ private $includedInPrice; /** + * @return null|string */ public function getName() @@ -65,6 +72,7 @@ public function getName() * If subRates are specified * then the amount can be omitted or it must be the sum of the amounts of all subRates.

* + * @return null|float */ public function getAmount() @@ -75,6 +83,7 @@ public function getAmount() /** *

A two-digit country code as per ISO 3166-1 alpha-2.

* + * @return null|string */ public function getCountry() @@ -85,6 +94,7 @@ public function getCountry() /** *

The state in the country

* + * @return null|string */ public function getState() @@ -97,6 +107,7 @@ public function getState() * the US) where the total tax is a combination of multiple taxes (e.g. * state and local taxes).

* + * @return null|SubRateCollection */ public function getSubRates() @@ -107,6 +118,7 @@ public function getSubRates() /** *

The default value for includedInPrice is FALSE.

* + * @return null|bool */ public function getIncludedInPrice() diff --git a/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraftModel.php b/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraftModel.php index 11aaeeb26f8..842ac30f959 100644 --- a/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/ExternalTaxRateDraftModel.php @@ -21,31 +21,37 @@ final class ExternalTaxRateDraftModel extends JsonObjectModel implements ExternalTaxRateDraft { /** + * * @var ?string */ protected $name; /** + * * @var ?float */ protected $amount; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $state; /** + * * @var ?SubRateCollection */ protected $subRates; /** + * * @var ?bool */ protected $includedInPrice; @@ -71,6 +77,7 @@ public function __construct( } /** + * * @return null|string */ public function getName() @@ -93,6 +100,7 @@ public function getName() * If subRates are specified * then the amount can be omitted or it must be the sum of the amounts of all subRates.

* + * * @return null|float */ public function getAmount() @@ -112,6 +120,7 @@ public function getAmount() /** *

A two-digit country code as per ISO 3166-1 alpha-2.

* + * * @return null|string */ public function getCountry() @@ -131,6 +140,7 @@ public function getCountry() /** *

The state in the country

* + * * @return null|string */ public function getState() @@ -152,6 +162,7 @@ public function getState() * the US) where the total tax is a combination of multiple taxes (e.g. * state and local taxes).

* + * * @return null|SubRateCollection */ public function getSubRates() @@ -171,6 +182,7 @@ public function getSubRates() /** *

The default value for includedInPrice is FALSE.

* + * * @return null|bool */ public function getIncludedInPrice() diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingDetails.php b/lib/commercetools-api/src/Models/Cart/ItemShippingDetails.php index 04ef1ea31c7..35755f893fd 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingDetails.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingDetails.php @@ -20,6 +20,7 @@ interface ItemShippingDetails extends JsonObject *

Used to map what sub-quantity should be shipped to which address. * Duplicate address keys are not allowed.

* + * @return null|ItemShippingTargetCollection */ public function getTargets(); @@ -29,6 +30,7 @@ public function getTargets(); * A cart cannot be ordered when the value is false. * The error InvalidItemShippingDetails will be triggered.

* + * @return null|bool */ public function getValid(); diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsBuilder.php b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsBuilder.php index 270c205ebb5..3e741897324 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsBuilder.php @@ -21,11 +21,13 @@ final class ItemShippingDetailsBuilder implements Builder { /** + * @var ?ItemShippingTargetCollection */ private $targets; /** + * @var ?bool */ private $valid; @@ -34,6 +36,7 @@ final class ItemShippingDetailsBuilder implements Builder *

Used to map what sub-quantity should be shipped to which address. * Duplicate address keys are not allowed.

* + * @return null|ItemShippingTargetCollection */ public function getTargets() @@ -46,6 +49,7 @@ public function getTargets() * A cart cannot be ordered when the value is false. * The error InvalidItemShippingDetails will be triggered.

* + * @return null|bool */ public function getValid() diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraft.php b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraft.php index 4ad423456e3..8f7aec48441 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraft.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraft.php @@ -21,6 +21,7 @@ interface ItemShippingDetailsDraft extends JsonObject * A cart can have shippingDetails where the targets sum does not match the quantity of the line item or custom line item. * For the order creation and order updates the targets sum must match the quantity.

* + * @return null|ItemShippingTargetCollection */ public function getTargets(); diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraftBuilder.php index 57705154817..11a6834be20 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraftBuilder.php @@ -21,6 +21,7 @@ final class ItemShippingDetailsDraftBuilder implements Builder { /** + * @var ?ItemShippingTargetCollection */ private $targets; @@ -31,6 +32,7 @@ final class ItemShippingDetailsDraftBuilder implements Builder * A cart can have shippingDetails where the targets sum does not match the quantity of the line item or custom line item. * For the order creation and order updates the targets sum must match the quantity.

* + * @return null|ItemShippingTargetCollection */ public function getTargets() diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraftModel.php b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraftModel.php index 819e1cbc9ed..a36ba85b9bb 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsDraftModel.php @@ -20,6 +20,7 @@ final class ItemShippingDetailsDraftModel extends JsonObjectModel implements ItemShippingDetailsDraft { /** + * * @var ?ItemShippingTargetCollection */ protected $targets; @@ -40,6 +41,7 @@ public function __construct( * A cart can have shippingDetails where the targets sum does not match the quantity of the line item or custom line item. * For the order creation and order updates the targets sum must match the quantity.

* + * * @return null|ItemShippingTargetCollection */ public function getTargets() diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsModel.php b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsModel.php index 7f352c028a5..a18cc48ec82 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsModel.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingDetailsModel.php @@ -20,11 +20,13 @@ final class ItemShippingDetailsModel extends JsonObjectModel implements ItemShippingDetails { /** + * * @var ?ItemShippingTargetCollection */ protected $targets; /** + * * @var ?bool */ protected $valid; @@ -45,6 +47,7 @@ public function __construct( *

Used to map what sub-quantity should be shipped to which address. * Duplicate address keys are not allowed.

* + * * @return null|ItemShippingTargetCollection */ public function getTargets() @@ -66,6 +69,7 @@ public function getTargets() * A cart cannot be ordered when the value is false. * The error InvalidItemShippingDetails will be triggered.

* + * * @return null|bool */ public function getValid() diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingTarget.php b/lib/commercetools-api/src/Models/Cart/ItemShippingTarget.php index 74b8438a82d..070247fddc8 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingTarget.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingTarget.php @@ -15,10 +15,12 @@ interface ItemShippingTarget extends JsonObject { public const FIELD_ADDRESS_KEY = 'addressKey'; public const FIELD_QUANTITY = 'quantity'; + public const FIELD_SHIPPING_METHOD_KEY = 'shippingMethodKey'; /** *

The key of the address in the cart's itemShippingAddresses

* + * @return null|string */ public function getAddressKey(); @@ -28,10 +30,20 @@ public function getAddressKey(); * Only positive values are allowed. * Using 0 as quantity is also possible in a draft object, but the element will not be present in the resulting ItemShippingDetails.

* + * @return null|int */ public function getQuantity(); + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ *

It connects Line Item quantities with individual shipping addresses.

+ * + + * @return null|string + */ + public function getShippingMethodKey(); + /** * @param ?string $addressKey */ @@ -41,4 +53,9 @@ public function setAddressKey(?string $addressKey): void; * @param ?int $quantity */ public function setQuantity(?int $quantity): void; + + /** + * @param ?string $shippingMethodKey + */ + public function setShippingMethodKey(?string $shippingMethodKey): void; } diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingTargetBuilder.php b/lib/commercetools-api/src/Models/Cart/ItemShippingTargetBuilder.php index 287e6c738fc..63403ab48b3 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingTargetBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingTargetBuilder.php @@ -21,18 +21,27 @@ final class ItemShippingTargetBuilder implements Builder { /** + * @var ?string */ private $addressKey; /** + * @var ?int */ private $quantity; + /** + + * @var ?string + */ + private $shippingMethodKey; + /** *

The key of the address in the cart's itemShippingAddresses

* + * @return null|string */ public function getAddressKey() @@ -45,6 +54,7 @@ public function getAddressKey() * Only positive values are allowed. * Using 0 as quantity is also possible in a draft object, but the element will not be present in the resulting ItemShippingDetails.

* + * @return null|int */ public function getQuantity() @@ -52,6 +62,18 @@ public function getQuantity() return $this->quantity; } + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ *

It connects Line Item quantities with individual shipping addresses.

+ * + + * @return null|string + */ + public function getShippingMethodKey() + { + return $this->shippingMethodKey; + } + /** * @param ?string $addressKey * @return $this @@ -74,12 +96,24 @@ public function withQuantity(?int $quantity) return $this; } + /** + * @param ?string $shippingMethodKey + * @return $this + */ + public function withShippingMethodKey(?string $shippingMethodKey) + { + $this->shippingMethodKey = $shippingMethodKey; + + return $this; + } + public function build(): ItemShippingTarget { return new ItemShippingTargetModel( $this->addressKey, - $this->quantity + $this->quantity, + $this->shippingMethodKey ); } diff --git a/lib/commercetools-api/src/Models/Cart/ItemShippingTargetModel.php b/lib/commercetools-api/src/Models/Cart/ItemShippingTargetModel.php index a108eeb40c1..e4857636bb7 100644 --- a/lib/commercetools-api/src/Models/Cart/ItemShippingTargetModel.php +++ b/lib/commercetools-api/src/Models/Cart/ItemShippingTargetModel.php @@ -20,30 +20,41 @@ final class ItemShippingTargetModel extends JsonObjectModel implements ItemShippingTarget { /** + * * @var ?string */ protected $addressKey; /** + * * @var ?int */ protected $quantity; + /** + * + * @var ?string + */ + protected $shippingMethodKey; + /** * @psalm-suppress MissingParamType */ public function __construct( ?string $addressKey = null, - ?int $quantity = null + ?int $quantity = null, + ?string $shippingMethodKey = null ) { $this->addressKey = $addressKey; $this->quantity = $quantity; + $this->shippingMethodKey = $shippingMethodKey; } /** *

The key of the address in the cart's itemShippingAddresses

* + * * @return null|string */ public function getAddressKey() @@ -65,6 +76,7 @@ public function getAddressKey() * Only positive values are allowed. * Using 0 as quantity is also possible in a draft object, but the element will not be present in the resulting ItemShippingDetails.

* + * * @return null|int */ public function getQuantity() @@ -81,6 +93,27 @@ public function getQuantity() return $this->quantity; } + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ *

It connects Line Item quantities with individual shipping addresses.

+ * + * + * @return null|string + */ + public function getShippingMethodKey() + { + if (is_null($this->shippingMethodKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_METHOD_KEY); + if (is_null($data)) { + return null; + } + $this->shippingMethodKey = (string) $data; + } + + return $this->shippingMethodKey; + } + /** * @param ?string $addressKey @@ -97,4 +130,12 @@ public function setQuantity(?int $quantity): void { $this->quantity = $quantity; } + + /** + * @param ?string $shippingMethodKey + */ + public function setShippingMethodKey(?string $shippingMethodKey): void + { + $this->shippingMethodKey = $shippingMethodKey; + } } diff --git a/lib/commercetools-api/src/Models/Cart/LineItem.php b/lib/commercetools-api/src/Models/Cart/LineItem.php index 8af75dafb41..d35c851cf5e 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItem.php +++ b/lib/commercetools-api/src/Models/Cart/LineItem.php @@ -32,28 +32,33 @@ interface LineItem extends JsonObject public const FIELD_VARIANT = 'variant'; public const FIELD_PRICE = 'price'; public const FIELD_TAXED_PRICE = 'taxedPrice'; + public const FIELD_TAXED_PRICE_PORTIONS = 'taxedPricePortions'; public const FIELD_TOTAL_PRICE = 'totalPrice'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_ADDED_AT = 'addedAt'; public const FIELD_STATE = 'state'; public const FIELD_TAX_RATE = 'taxRate'; + public const FIELD_PER_METHOD_TAX_RATE = 'perMethodTaxRate'; public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; public const FIELD_DISCOUNTED_PRICE_PER_QUANTITY = 'discountedPricePerQuantity'; public const FIELD_PRICE_MODE = 'priceMode'; public const FIELD_LINE_ITEM_MODE = 'lineItemMode'; public const FIELD_CUSTOM = 'custom'; + public const FIELD_INVENTORY_MODE = 'inventoryMode'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; public const FIELD_LAST_MODIFIED_AT = 'lastModifiedAt'; /** *

Unique identifier of the LineItem.

* + * @return null|string */ public function getId(); /** + * @return null|string */ public function getProductId(); @@ -62,6 +67,7 @@ public function getProductId(); *

User-defined unique identifier of the Product. * Only present on Line Items in a Cart when the key is available on that specific Product at the time the Line Item is created or updated on the Cart. On Order resources this field is only present when the key is available on the specific Product at the time the Order is created from the Cart. This field is in general not present on Carts that had no updates until 3 December 2021 and on Orders created before this date.

* + * @return null|string */ public function getProductKey(); @@ -69,6 +75,7 @@ public function getProductKey(); /** *

The product name.

* + * @return null|LocalizedString */ public function getName(); @@ -79,11 +86,13 @@ public function getName(); * It is empty if the product has been deleted. * The slug is also empty if the cart or order is retrieved via Reference Expansion or is a snapshot in a Message.

* + * @return null|LocalizedString */ public function getProductSlug(); /** + * @return null|ProductTypeReference */ public function getProductType(); @@ -92,6 +101,7 @@ public function getProductType(); *

The variant data is saved when the variant is added to the cart, and not updated automatically. * It can manually be updated with the Recalculate update action.

* + * @return null|ProductVariant */ public function getVariant(); @@ -100,6 +110,7 @@ public function getVariant(); *

The price of a line item is selected from the product variant according to the Product's priceMode value. * If the priceMode is Embedded ProductPriceMode and the variant field hasn't been updated, the price may not correspond to a price in variant.prices.

* + * @return null|Price */ public function getPrice(); @@ -107,16 +118,26 @@ public function getPrice(); /** *

Set once the taxRate is set.

* + * @return null|TaxedItemPrice */ public function getTaxedPrice(); + /** + *

Taxed price of the Shipping Method that is set automatically after perMethodTaxRate is set.

+ * + + * @return null|MethodTaxedPriceCollection + */ + public function getTaxedPricePortions(); + /** *

The total price of this line item. * If the line item is discounted, then the totalPrice is the DiscountedLineItemPriceForQuantity multiplied by quantity. * Otherwise the total price is the product price multiplied by the quantity. * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property.

* + * @return null|TypedMoney */ public function getTotalPrice(); @@ -125,6 +146,7 @@ public function getTotalPrice(); *

The amount of a LineItem in the cart. * Must be a positive integer.

* + * @return null|int */ public function getQuantity(); @@ -133,11 +155,13 @@ public function getQuantity(); *

When the line item was added to the cart. Optional for backwards * compatibility reasons only.

* + * @return null|DateTimeImmutable */ public function getAddedAt(); /** + * @return null|ItemStateCollection */ public function getState(); @@ -146,15 +170,26 @@ public function getState(); *

Will be set automatically in the Platform TaxMode once the shipping address is set is set. * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

* + * @return null|TaxRate */ public function getTaxRate(); + /** + *

Tax Rate per Shipping Method that is automatically set after the Shipping Method is added to a Cart with the Platform TaxMode and Multiple ShippingMode.

+ *

For the External TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.

+ * + + * @return null|MethodTaxRateCollection + */ + public function getPerMethodTaxRate(); + /** *

The supply channel identifies the inventory entries that should be reserved. * The channel has * the role InventorySupply.

* + * @return null|ChannelReference */ public function getSupplyChannel(); @@ -163,33 +198,48 @@ public function getSupplyChannel(); *

The distribution channel is used to select a ProductPrice. * The channel has the role ProductDistribution.

* + * @return null|ChannelReference */ public function getDistributionChannel(); /** + * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity(); /** + * @return null|string */ public function getPriceMode(); /** + * @return null|string */ public function getLineItemMode(); /** + * @return null|CustomFields */ public function getCustom(); + /** + *

Inventory mode specific to the line item only, valid for the entire quantity of the line item. + * Only present if inventory mode is different from the inventoryMode specified on the Cart.

+ * + + * @return null|string + */ + public function getInventoryMode(); + /** *

Container for line item specific address(es).

* + * @return null|ItemShippingDetails */ public function getShippingDetails(); @@ -199,6 +249,7 @@ public function getShippingDetails(); * setLineItemShippingDetails, addLineItem, removeLineItem, or changeLineItemQuantity. * Optional only for backwards compatible reasons. When the LineItem is created lastModifiedAt is set to addedAt.

* + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -248,6 +299,11 @@ public function setPrice(?Price $price): void; */ public function setTaxedPrice(?TaxedItemPrice $taxedPrice): void; + /** + * @param ?MethodTaxedPriceCollection $taxedPricePortions + */ + public function setTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions): void; + /** * @param ?TypedMoney $totalPrice */ @@ -273,6 +329,11 @@ public function setState(?ItemStateCollection $state): void; */ public function setTaxRate(?TaxRate $taxRate): void; + /** + * @param ?MethodTaxRateCollection $perMethodTaxRate + */ + public function setPerMethodTaxRate(?MethodTaxRateCollection $perMethodTaxRate): void; + /** * @param ?ChannelReference $supplyChannel */ @@ -303,6 +364,11 @@ public function setLineItemMode(?string $lineItemMode): void; */ public function setCustom(?CustomFields $custom): void; + /** + * @param ?string $inventoryMode + */ + public function setInventoryMode(?string $inventoryMode): void; + /** * @param ?ItemShippingDetails $shippingDetails */ diff --git a/lib/commercetools-api/src/Models/Cart/LineItemBuilder.php b/lib/commercetools-api/src/Models/Cart/LineItemBuilder.php index b9b673aa2ab..b8d6fdf6b29 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemBuilder.php @@ -39,111 +39,151 @@ final class LineItemBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $productId; /** + * @var ?string */ private $productKey; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $productSlug; /** + * @var null|ProductTypeReference|ProductTypeReferenceBuilder */ private $productType; /** + * @var null|ProductVariant|ProductVariantBuilder */ private $variant; /** + * @var null|Price|PriceBuilder */ private $price; /** + * @var null|TaxedItemPrice|TaxedItemPriceBuilder */ private $taxedPrice; /** + + * @var ?MethodTaxedPriceCollection + */ + private $taxedPricePortions; + + /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalPrice; /** + * @var ?int */ private $quantity; /** + * @var ?DateTimeImmutable */ private $addedAt; /** + * @var ?ItemStateCollection */ private $state; /** + * @var null|TaxRate|TaxRateBuilder */ private $taxRate; /** + + * @var ?MethodTaxRateCollection + */ + private $perMethodTaxRate; + + /** + * @var null|ChannelReference|ChannelReferenceBuilder */ private $supplyChannel; /** + * @var null|ChannelReference|ChannelReferenceBuilder */ private $distributionChannel; /** + * @var ?DiscountedLineItemPriceForQuantityCollection */ private $discountedPricePerQuantity; /** + * @var ?string */ private $priceMode; /** + * @var ?string */ private $lineItemMode; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + + * @var ?string + */ + private $inventoryMode; + + /** + * @var null|ItemShippingDetails|ItemShippingDetailsBuilder */ private $shippingDetails; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; @@ -151,6 +191,7 @@ final class LineItemBuilder implements Builder /** *

Unique identifier of the LineItem.

* + * @return null|string */ public function getId() @@ -159,6 +200,7 @@ public function getId() } /** + * @return null|string */ public function getProductId() @@ -170,6 +212,7 @@ public function getProductId() *

User-defined unique identifier of the Product. * Only present on Line Items in a Cart when the key is available on that specific Product at the time the Line Item is created or updated on the Cart. On Order resources this field is only present when the key is available on the specific Product at the time the Order is created from the Cart. This field is in general not present on Carts that had no updates until 3 December 2021 and on Orders created before this date.

* + * @return null|string */ public function getProductKey() @@ -180,6 +223,7 @@ public function getProductKey() /** *

The product name.

* + * @return null|LocalizedString */ public function getName() @@ -193,6 +237,7 @@ public function getName() * It is empty if the product has been deleted. * The slug is also empty if the cart or order is retrieved via Reference Expansion or is a snapshot in a Message.

* + * @return null|LocalizedString */ public function getProductSlug() @@ -201,6 +246,7 @@ public function getProductSlug() } /** + * @return null|ProductTypeReference */ public function getProductType() @@ -212,6 +258,7 @@ public function getProductType() *

The variant data is saved when the variant is added to the cart, and not updated automatically. * It can manually be updated with the Recalculate update action.

* + * @return null|ProductVariant */ public function getVariant() @@ -223,6 +270,7 @@ public function getVariant() *

The price of a line item is selected from the product variant according to the Product's priceMode value. * If the priceMode is Embedded ProductPriceMode and the variant field hasn't been updated, the price may not correspond to a price in variant.prices.

* + * @return null|Price */ public function getPrice() @@ -233,6 +281,7 @@ public function getPrice() /** *

Set once the taxRate is set.

* + * @return null|TaxedItemPrice */ public function getTaxedPrice() @@ -240,12 +289,24 @@ public function getTaxedPrice() return $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice; } + /** + *

Taxed price of the Shipping Method that is set automatically after perMethodTaxRate is set.

+ * + + * @return null|MethodTaxedPriceCollection + */ + public function getTaxedPricePortions() + { + return $this->taxedPricePortions; + } + /** *

The total price of this line item. * If the line item is discounted, then the totalPrice is the DiscountedLineItemPriceForQuantity multiplied by quantity. * Otherwise the total price is the product price multiplied by the quantity. * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property.

* + * @return null|TypedMoney */ public function getTotalPrice() @@ -257,6 +318,7 @@ public function getTotalPrice() *

The amount of a LineItem in the cart. * Must be a positive integer.

* + * @return null|int */ public function getQuantity() @@ -268,6 +330,7 @@ public function getQuantity() *

When the line item was added to the cart. Optional for backwards * compatibility reasons only.

* + * @return null|DateTimeImmutable */ public function getAddedAt() @@ -276,6 +339,7 @@ public function getAddedAt() } /** + * @return null|ItemStateCollection */ public function getState() @@ -287,6 +351,7 @@ public function getState() *

Will be set automatically in the Platform TaxMode once the shipping address is set is set. * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

* + * @return null|TaxRate */ public function getTaxRate() @@ -294,11 +359,24 @@ public function getTaxRate() return $this->taxRate instanceof TaxRateBuilder ? $this->taxRate->build() : $this->taxRate; } + /** + *

Tax Rate per Shipping Method that is automatically set after the Shipping Method is added to a Cart with the Platform TaxMode and Multiple ShippingMode.

+ *

For the External TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.

+ * + + * @return null|MethodTaxRateCollection + */ + public function getPerMethodTaxRate() + { + return $this->perMethodTaxRate; + } + /** *

The supply channel identifies the inventory entries that should be reserved. * The channel has * the role InventorySupply.

* + * @return null|ChannelReference */ public function getSupplyChannel() @@ -310,6 +388,7 @@ public function getSupplyChannel() *

The distribution channel is used to select a ProductPrice. * The channel has the role ProductDistribution.

* + * @return null|ChannelReference */ public function getDistributionChannel() @@ -318,6 +397,7 @@ public function getDistributionChannel() } /** + * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity() @@ -326,6 +406,7 @@ public function getDiscountedPricePerQuantity() } /** + * @return null|string */ public function getPriceMode() @@ -334,6 +415,7 @@ public function getPriceMode() } /** + * @return null|string */ public function getLineItemMode() @@ -342,6 +424,7 @@ public function getLineItemMode() } /** + * @return null|CustomFields */ public function getCustom() @@ -349,9 +432,22 @@ public function getCustom() return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; } + /** + *

Inventory mode specific to the line item only, valid for the entire quantity of the line item. + * Only present if inventory mode is different from the inventoryMode specified on the Cart.

+ * + + * @return null|string + */ + public function getInventoryMode() + { + return $this->inventoryMode; + } + /** *

Container for line item specific address(es).

* + * @return null|ItemShippingDetails */ public function getShippingDetails() @@ -364,6 +460,7 @@ public function getShippingDetails() * setLineItemShippingDetails, addLineItem, removeLineItem, or changeLineItemQuantity. * Optional only for backwards compatible reasons. When the LineItem is created lastModifiedAt is set to addedAt.

* + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -470,6 +567,17 @@ public function withTaxedPrice(?TaxedItemPrice $taxedPrice) return $this; } + /** + * @param ?MethodTaxedPriceCollection $taxedPricePortions + * @return $this + */ + public function withTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions) + { + $this->taxedPricePortions = $taxedPricePortions; + + return $this; + } + /** * @param ?TypedMoney $totalPrice * @return $this @@ -525,6 +633,17 @@ public function withTaxRate(?TaxRate $taxRate) return $this; } + /** + * @param ?MethodTaxRateCollection $perMethodTaxRate + * @return $this + */ + public function withPerMethodTaxRate(?MethodTaxRateCollection $perMethodTaxRate) + { + $this->perMethodTaxRate = $perMethodTaxRate; + + return $this; + } + /** * @param ?ChannelReference $supplyChannel * @return $this @@ -591,6 +710,17 @@ public function withCustom(?CustomFields $custom) return $this; } + /** + * @param ?string $inventoryMode + * @return $this + */ + public function withInventoryMode(?string $inventoryMode) + { + $this->inventoryMode = $inventoryMode; + + return $this; + } + /** * @param ?ItemShippingDetails $shippingDetails * @return $this @@ -757,17 +887,20 @@ public function build(): LineItem $this->variant instanceof ProductVariantBuilder ? $this->variant->build() : $this->variant, $this->price instanceof PriceBuilder ? $this->price->build() : $this->price, $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice, + $this->taxedPricePortions, $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, $this->quantity, $this->addedAt, $this->state, $this->taxRate instanceof TaxRateBuilder ? $this->taxRate->build() : $this->taxRate, + $this->perMethodTaxRate, $this->supplyChannel instanceof ChannelReferenceBuilder ? $this->supplyChannel->build() : $this->supplyChannel, $this->distributionChannel instanceof ChannelReferenceBuilder ? $this->distributionChannel->build() : $this->distributionChannel, $this->discountedPricePerQuantity, $this->priceMode, $this->lineItemMode, $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, + $this->inventoryMode, $this->shippingDetails instanceof ItemShippingDetailsBuilder ? $this->shippingDetails->build() : $this->shippingDetails, $this->lastModifiedAt ); diff --git a/lib/commercetools-api/src/Models/Cart/LineItemDraft.php b/lib/commercetools-api/src/Models/Cart/LineItemDraft.php index e63b3045f44..33ba2a139ce 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemDraft.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemDraft.php @@ -28,19 +28,23 @@ interface LineItemDraft extends JsonObject public const FIELD_CUSTOM = 'custom'; public const FIELD_EXTERNAL_PRICE = 'externalPrice'; public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; + public const FIELD_INVENTORY_MODE = 'inventoryMode'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; /** + * @return null|string */ public function getProductId(); /** + * @return null|int */ public function getVariantId(); /** + * @return null|string */ public function getSku(); @@ -49,6 +53,7 @@ public function getSku(); *

The amount of a LineItemin the cart. * Must be a positive integer.

* + * @return null|int */ public function getQuantity(); @@ -57,6 +62,7 @@ public function getQuantity(); *

When the line item was added to the cart. Optional for backwards * compatibility reasons only.

* + * @return null|DateTimeImmutable */ public function getAddedAt(); @@ -67,6 +73,7 @@ public function getAddedAt(); * The provided channel should have * the InventorySupply role.

* + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel(); @@ -75,6 +82,7 @@ public function getSupplyChannel(); *

The channel is used to select a ProductPrice. * The provided channel should have the ProductDistribution role.

* + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel(); @@ -82,6 +90,7 @@ public function getDistributionChannel(); /** *

An external tax rate can be set if the cart has the External TaxMode.

* + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); @@ -89,6 +98,7 @@ public function getExternalTaxRate(); /** *

The custom fields.

* + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -96,6 +106,7 @@ public function getCustom(); /** *

Sets the line item price to the given value and sets the line item priceMode to ExternalPrice LineItemPriceMode.

* + * @return null|Money */ public function getExternalPrice(); @@ -103,13 +114,24 @@ public function getExternalPrice(); /** *

Sets the line item price and totalPrice to the given values and sets the line item priceMode to ExternalTotal LineItemPriceMode.

* + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); + /** + *

Inventory mode specific to the line item only, valid for the entire quantity of the line item. + * Set only if inventory mode should be different from the inventoryMode specified on the Cart.

+ * + + * @return null|string + */ + public function getInventoryMode(); + /** *

Container for line item specific address(es).

* + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); @@ -169,6 +191,11 @@ public function setExternalPrice(?Money $externalPrice): void; */ public function setExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotalPrice): void; + /** + * @param ?string $inventoryMode + */ + public function setInventoryMode(?string $inventoryMode): void; + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ diff --git a/lib/commercetools-api/src/Models/Cart/LineItemDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/LineItemDraftBuilder.php index e77e7bc55f8..3e361356675 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemDraftBuilder.php @@ -28,66 +28,85 @@ final class LineItemDraftBuilder implements Builder { /** + * @var ?string */ private $productId; /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?int */ private $quantity; /** + * @var ?DateTimeImmutable */ private $addedAt; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $supplyChannel; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $distributionChannel; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var null|Money|MoneyBuilder */ private $externalPrice; /** + * @var null|ExternalLineItemTotalPrice|ExternalLineItemTotalPriceBuilder */ private $externalTotalPrice; /** + + * @var ?string + */ + private $inventoryMode; + + /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetails; /** + * @return null|string */ public function getProductId() @@ -96,6 +115,7 @@ public function getProductId() } /** + * @return null|int */ public function getVariantId() @@ -104,6 +124,7 @@ public function getVariantId() } /** + * @return null|string */ public function getSku() @@ -115,6 +136,7 @@ public function getSku() *

The amount of a LineItemin the cart. * Must be a positive integer.

* + * @return null|int */ public function getQuantity() @@ -126,6 +148,7 @@ public function getQuantity() *

When the line item was added to the cart. Optional for backwards * compatibility reasons only.

* + * @return null|DateTimeImmutable */ public function getAddedAt() @@ -139,6 +162,7 @@ public function getAddedAt() * The provided channel should have * the InventorySupply role.

* + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -150,6 +174,7 @@ public function getSupplyChannel() *

The channel is used to select a ProductPrice. * The provided channel should have the ProductDistribution role.

* + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() @@ -160,6 +185,7 @@ public function getDistributionChannel() /** *

An external tax rate can be set if the cart has the External TaxMode.

* + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() @@ -170,6 +196,7 @@ public function getExternalTaxRate() /** *

The custom fields.

* + * @return null|CustomFieldsDraft */ public function getCustom() @@ -180,6 +207,7 @@ public function getCustom() /** *

Sets the line item price to the given value and sets the line item priceMode to ExternalPrice LineItemPriceMode.

* + * @return null|Money */ public function getExternalPrice() @@ -190,6 +218,7 @@ public function getExternalPrice() /** *

Sets the line item price and totalPrice to the given values and sets the line item priceMode to ExternalTotal LineItemPriceMode.

* + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() @@ -197,9 +226,22 @@ public function getExternalTotalPrice() return $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice; } + /** + *

Inventory mode specific to the line item only, valid for the entire quantity of the line item. + * Set only if inventory mode should be different from the inventoryMode specified on the Cart.

+ * + + * @return null|string + */ + public function getInventoryMode() + { + return $this->inventoryMode; + } + /** *

Container for line item specific address(es).

* + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() @@ -328,6 +370,17 @@ public function withExternalTotalPrice(?ExternalLineItemTotalPrice $externalTota return $this; } + /** + * @param ?string $inventoryMode + * @return $this + */ + public function withInventoryMode(?string $inventoryMode) + { + $this->inventoryMode = $inventoryMode; + + return $this; + } + /** * @param ?ItemShippingDetailsDraft $shippingDetails * @return $this @@ -430,6 +483,7 @@ public function build(): LineItemDraft $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, $this->externalPrice instanceof MoneyBuilder ? $this->externalPrice->build() : $this->externalPrice, $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice, + $this->inventoryMode, $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails ); } diff --git a/lib/commercetools-api/src/Models/Cart/LineItemDraftModel.php b/lib/commercetools-api/src/Models/Cart/LineItemDraftModel.php index ea1e80cc9ec..c5fdd3ac811 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemDraftModel.php @@ -27,61 +27,79 @@ final class LineItemDraftModel extends JsonObjectModel implements LineItemDraft { /** + * * @var ?string */ protected $productId; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?int */ protected $quantity; /** + * * @var ?DateTimeImmutable */ protected $addedAt; /** + * * @var ?ChannelResourceIdentifier */ protected $supplyChannel; /** + * * @var ?ChannelResourceIdentifier */ protected $distributionChannel; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?Money */ protected $externalPrice; /** + * * @var ?ExternalLineItemTotalPrice */ protected $externalTotalPrice; /** + * + * @var ?string + */ + protected $inventoryMode; + + /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; @@ -102,6 +120,7 @@ public function __construct( ?CustomFieldsDraft $custom = null, ?Money $externalPrice = null, ?ExternalLineItemTotalPrice $externalTotalPrice = null, + ?string $inventoryMode = null, ?ItemShippingDetailsDraft $shippingDetails = null ) { $this->productId = $productId; @@ -115,10 +134,12 @@ public function __construct( $this->custom = $custom; $this->externalPrice = $externalPrice; $this->externalTotalPrice = $externalTotalPrice; + $this->inventoryMode = $inventoryMode; $this->shippingDetails = $shippingDetails; } /** + * * @return null|string */ public function getProductId() @@ -136,6 +157,7 @@ public function getProductId() } /** + * * @return null|int */ public function getVariantId() @@ -153,6 +175,7 @@ public function getVariantId() } /** + * * @return null|string */ public function getSku() @@ -173,6 +196,7 @@ public function getSku() *

The amount of a LineItemin the cart. * Must be a positive integer.

* + * * @return null|int */ public function getQuantity() @@ -193,6 +217,7 @@ public function getQuantity() *

When the line item was added to the cart. Optional for backwards * compatibility reasons only.

* + * * @return null|DateTimeImmutable */ public function getAddedAt() @@ -219,6 +244,7 @@ public function getAddedAt() * The provided channel should have * the InventorySupply role.

* + * * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -240,6 +266,7 @@ public function getSupplyChannel() *

The channel is used to select a ProductPrice. * The provided channel should have the ProductDistribution role.

* + * * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() @@ -260,6 +287,7 @@ public function getDistributionChannel() /** *

An external tax rate can be set if the cart has the External TaxMode.

* + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() @@ -280,6 +308,7 @@ public function getExternalTaxRate() /** *

The custom fields.

* + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -300,6 +329,7 @@ public function getCustom() /** *

Sets the line item price to the given value and sets the line item priceMode to ExternalPrice LineItemPriceMode.

* + * * @return null|Money */ public function getExternalPrice() @@ -320,6 +350,7 @@ public function getExternalPrice() /** *

Sets the line item price and totalPrice to the given values and sets the line item priceMode to ExternalTotal LineItemPriceMode.

* + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() @@ -337,9 +368,31 @@ public function getExternalTotalPrice() return $this->externalTotalPrice; } + /** + *

Inventory mode specific to the line item only, valid for the entire quantity of the line item. + * Set only if inventory mode should be different from the inventoryMode specified on the Cart.

+ * + * + * @return null|string + */ + public function getInventoryMode() + { + if (is_null($this->inventoryMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_INVENTORY_MODE); + if (is_null($data)) { + return null; + } + $this->inventoryMode = (string) $data; + } + + return $this->inventoryMode; + } + /** *

Container for line item specific address(es).

* + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() @@ -446,6 +499,14 @@ public function setExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotal $this->externalTotalPrice = $externalTotalPrice; } + /** + * @param ?string $inventoryMode + */ + public function setInventoryMode(?string $inventoryMode): void + { + $this->inventoryMode = $inventoryMode; + } + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ diff --git a/lib/commercetools-api/src/Models/Cart/LineItemModel.php b/lib/commercetools-api/src/Models/Cart/LineItemModel.php index e818256c0c2..62d41b591fb 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemModel.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemModel.php @@ -38,111 +38,151 @@ final class LineItemModel extends JsonObjectModel implements LineItem { /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $productId; /** + * * @var ?string */ protected $productKey; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $productSlug; /** + * * @var ?ProductTypeReference */ protected $productType; /** + * * @var ?ProductVariant */ protected $variant; /** + * * @var ?Price */ protected $price; /** + * * @var ?TaxedItemPrice */ protected $taxedPrice; /** + * + * @var ?MethodTaxedPriceCollection + */ + protected $taxedPricePortions; + + /** + * * @var ?TypedMoney */ protected $totalPrice; /** + * * @var ?int */ protected $quantity; /** + * * @var ?DateTimeImmutable */ protected $addedAt; /** + * * @var ?ItemStateCollection */ protected $state; /** + * * @var ?TaxRate */ protected $taxRate; /** + * + * @var ?MethodTaxRateCollection + */ + protected $perMethodTaxRate; + + /** + * * @var ?ChannelReference */ protected $supplyChannel; /** + * * @var ?ChannelReference */ protected $distributionChannel; /** + * * @var ?DiscountedLineItemPriceForQuantityCollection */ protected $discountedPricePerQuantity; /** + * * @var ?string */ protected $priceMode; /** + * * @var ?string */ protected $lineItemMode; /** + * * @var ?CustomFields */ protected $custom; /** + * + * @var ?string + */ + protected $inventoryMode; + + /** + * * @var ?ItemShippingDetails */ protected $shippingDetails; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; @@ -161,17 +201,20 @@ public function __construct( ?ProductVariant $variant = null, ?Price $price = null, ?TaxedItemPrice $taxedPrice = null, + ?MethodTaxedPriceCollection $taxedPricePortions = null, ?TypedMoney $totalPrice = null, ?int $quantity = null, ?DateTimeImmutable $addedAt = null, ?ItemStateCollection $state = null, ?TaxRate $taxRate = null, + ?MethodTaxRateCollection $perMethodTaxRate = null, ?ChannelReference $supplyChannel = null, ?ChannelReference $distributionChannel = null, ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity = null, ?string $priceMode = null, ?string $lineItemMode = null, ?CustomFields $custom = null, + ?string $inventoryMode = null, ?ItemShippingDetails $shippingDetails = null, ?DateTimeImmutable $lastModifiedAt = null ) { @@ -184,17 +227,20 @@ public function __construct( $this->variant = $variant; $this->price = $price; $this->taxedPrice = $taxedPrice; + $this->taxedPricePortions = $taxedPricePortions; $this->totalPrice = $totalPrice; $this->quantity = $quantity; $this->addedAt = $addedAt; $this->state = $state; $this->taxRate = $taxRate; + $this->perMethodTaxRate = $perMethodTaxRate; $this->supplyChannel = $supplyChannel; $this->distributionChannel = $distributionChannel; $this->discountedPricePerQuantity = $discountedPricePerQuantity; $this->priceMode = $priceMode; $this->lineItemMode = $lineItemMode; $this->custom = $custom; + $this->inventoryMode = $inventoryMode; $this->shippingDetails = $shippingDetails; $this->lastModifiedAt = $lastModifiedAt; } @@ -202,6 +248,7 @@ public function __construct( /** *

Unique identifier of the LineItem.

* + * * @return null|string */ public function getId() @@ -219,6 +266,7 @@ public function getId() } /** + * * @return null|string */ public function getProductId() @@ -239,6 +287,7 @@ public function getProductId() *

User-defined unique identifier of the Product. * Only present on Line Items in a Cart when the key is available on that specific Product at the time the Line Item is created or updated on the Cart. On Order resources this field is only present when the key is available on the specific Product at the time the Order is created from the Cart. This field is in general not present on Carts that had no updates until 3 December 2021 and on Orders created before this date.

* + * * @return null|string */ public function getProductKey() @@ -258,6 +307,7 @@ public function getProductKey() /** *

The product name.

* + * * @return null|LocalizedString */ public function getName() @@ -281,6 +331,7 @@ public function getName() * It is empty if the product has been deleted. * The slug is also empty if the cart or order is retrieved via Reference Expansion or is a snapshot in a Message.

* + * * @return null|LocalizedString */ public function getProductSlug() @@ -299,6 +350,7 @@ public function getProductSlug() } /** + * * @return null|ProductTypeReference */ public function getProductType() @@ -320,6 +372,7 @@ public function getProductType() *

The variant data is saved when the variant is added to the cart, and not updated automatically. * It can manually be updated with the Recalculate update action.

* + * * @return null|ProductVariant */ public function getVariant() @@ -341,6 +394,7 @@ public function getVariant() *

The price of a line item is selected from the product variant according to the Product's priceMode value. * If the priceMode is Embedded ProductPriceMode and the variant field hasn't been updated, the price may not correspond to a price in variant.prices.

* + * * @return null|Price */ public function getPrice() @@ -361,6 +415,7 @@ public function getPrice() /** *

Set once the taxRate is set.

* + * * @return null|TaxedItemPrice */ public function getTaxedPrice() @@ -378,12 +433,33 @@ public function getTaxedPrice() return $this->taxedPrice; } + /** + *

Taxed price of the Shipping Method that is set automatically after perMethodTaxRate is set.

+ * + * + * @return null|MethodTaxedPriceCollection + */ + public function getTaxedPricePortions() + { + if (is_null($this->taxedPricePortions)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_TAXED_PRICE_PORTIONS); + if (is_null($data)) { + return null; + } + $this->taxedPricePortions = MethodTaxedPriceCollection::fromArray($data); + } + + return $this->taxedPricePortions; + } + /** *

The total price of this line item. * If the line item is discounted, then the totalPrice is the DiscountedLineItemPriceForQuantity multiplied by quantity. * Otherwise the total price is the product price multiplied by the quantity. * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property.

* + * * @return null|TypedMoney */ public function getTotalPrice() @@ -405,6 +481,7 @@ public function getTotalPrice() *

The amount of a LineItem in the cart. * Must be a positive integer.

* + * * @return null|int */ public function getQuantity() @@ -425,6 +502,7 @@ public function getQuantity() *

When the line item was added to the cart. Optional for backwards * compatibility reasons only.

* + * * @return null|DateTimeImmutable */ public function getAddedAt() @@ -446,6 +524,7 @@ public function getAddedAt() } /** + * * @return null|ItemStateCollection */ public function getState() @@ -466,6 +545,7 @@ public function getState() *

Will be set automatically in the Platform TaxMode once the shipping address is set is set. * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

* + * * @return null|TaxRate */ public function getTaxRate() @@ -483,11 +563,33 @@ public function getTaxRate() return $this->taxRate; } + /** + *

Tax Rate per Shipping Method that is automatically set after the Shipping Method is added to a Cart with the Platform TaxMode and Multiple ShippingMode.

+ *

For the External TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.

+ * + * + * @return null|MethodTaxRateCollection + */ + public function getPerMethodTaxRate() + { + if (is_null($this->perMethodTaxRate)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_PER_METHOD_TAX_RATE); + if (is_null($data)) { + return null; + } + $this->perMethodTaxRate = MethodTaxRateCollection::fromArray($data); + } + + return $this->perMethodTaxRate; + } + /** *

The supply channel identifies the inventory entries that should be reserved. * The channel has * the role InventorySupply.

* + * * @return null|ChannelReference */ public function getSupplyChannel() @@ -509,6 +611,7 @@ public function getSupplyChannel() *

The distribution channel is used to select a ProductPrice. * The channel has the role ProductDistribution.

* + * * @return null|ChannelReference */ public function getDistributionChannel() @@ -527,6 +630,7 @@ public function getDistributionChannel() } /** + * * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity() @@ -544,6 +648,7 @@ public function getDiscountedPricePerQuantity() } /** + * * @return null|string */ public function getPriceMode() @@ -561,6 +666,7 @@ public function getPriceMode() } /** + * * @return null|string */ public function getLineItemMode() @@ -578,6 +684,7 @@ public function getLineItemMode() } /** + * * @return null|CustomFields */ public function getCustom() @@ -595,9 +702,31 @@ public function getCustom() return $this->custom; } + /** + *

Inventory mode specific to the line item only, valid for the entire quantity of the line item. + * Only present if inventory mode is different from the inventoryMode specified on the Cart.

+ * + * + * @return null|string + */ + public function getInventoryMode() + { + if (is_null($this->inventoryMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_INVENTORY_MODE); + if (is_null($data)) { + return null; + } + $this->inventoryMode = (string) $data; + } + + return $this->inventoryMode; + } + /** *

Container for line item specific address(es).

* + * * @return null|ItemShippingDetails */ public function getShippingDetails() @@ -620,6 +749,7 @@ public function getShippingDetails() * setLineItemShippingDetails, addLineItem, removeLineItem, or changeLineItemQuantity. * Optional only for backwards compatible reasons. When the LineItem is created lastModifiedAt is set to addedAt.

* + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -713,6 +843,14 @@ public function setTaxedPrice(?TaxedItemPrice $taxedPrice): void $this->taxedPrice = $taxedPrice; } + /** + * @param ?MethodTaxedPriceCollection $taxedPricePortions + */ + public function setTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions): void + { + $this->taxedPricePortions = $taxedPricePortions; + } + /** * @param ?TypedMoney $totalPrice */ @@ -753,6 +891,14 @@ public function setTaxRate(?TaxRate $taxRate): void $this->taxRate = $taxRate; } + /** + * @param ?MethodTaxRateCollection $perMethodTaxRate + */ + public function setPerMethodTaxRate(?MethodTaxRateCollection $perMethodTaxRate): void + { + $this->perMethodTaxRate = $perMethodTaxRate; + } + /** * @param ?ChannelReference $supplyChannel */ @@ -801,6 +947,14 @@ public function setCustom(?CustomFields $custom): void $this->custom = $custom; } + /** + * @param ?string $inventoryMode + */ + public function setInventoryMode(?string $inventoryMode): void + { + $this->inventoryMode = $inventoryMode; + } + /** * @param ?ItemShippingDetails $shippingDetails */ diff --git a/lib/commercetools-api/src/Models/Cart/MethodTaxRate.php b/lib/commercetools-api/src/Models/Cart/MethodTaxRate.php new file mode 100644 index 00000000000..11880e62827 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/MethodTaxRate.php @@ -0,0 +1,45 @@ +User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingMethodKey(); + + /** + *

Tax Rate for the Shipping Method.

+ * + + * @return null|TaxRate + */ + public function getTaxRate(); + + /** + * @param ?string $shippingMethodKey + */ + public function setShippingMethodKey(?string $shippingMethodKey): void; + + /** + * @param ?TaxRate $taxRate + */ + public function setTaxRate(?TaxRate $taxRate): void; +} diff --git a/lib/commercetools-api/src/Models/Cart/MethodTaxRateBuilder.php b/lib/commercetools-api/src/Models/Cart/MethodTaxRateBuilder.php new file mode 100644 index 00000000000..e7beee2e0c3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/MethodTaxRateBuilder.php @@ -0,0 +1,104 @@ + + */ +final class MethodTaxRateBuilder implements Builder +{ + /** + + * @var ?string + */ + private $shippingMethodKey; + + /** + + * @var null|TaxRate|TaxRateBuilder + */ + private $taxRate; + + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingMethodKey() + { + return $this->shippingMethodKey; + } + + /** + *

Tax Rate for the Shipping Method.

+ * + + * @return null|TaxRate + */ + public function getTaxRate() + { + return $this->taxRate instanceof TaxRateBuilder ? $this->taxRate->build() : $this->taxRate; + } + + /** + * @param ?string $shippingMethodKey + * @return $this + */ + public function withShippingMethodKey(?string $shippingMethodKey) + { + $this->shippingMethodKey = $shippingMethodKey; + + return $this; + } + + /** + * @param ?TaxRate $taxRate + * @return $this + */ + public function withTaxRate(?TaxRate $taxRate) + { + $this->taxRate = $taxRate; + + return $this; + } + + /** + * @deprecated use withTaxRate() instead + * @return $this + */ + public function withTaxRateBuilder(?TaxRateBuilder $taxRate) + { + $this->taxRate = $taxRate; + + return $this; + } + + public function build(): MethodTaxRate + { + return new MethodTaxRateModel( + $this->shippingMethodKey, + $this->taxRate instanceof TaxRateBuilder ? $this->taxRate->build() : $this->taxRate + ); + } + + public static function of(): MethodTaxRateBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Cart/MethodTaxRateCollection.php b/lib/commercetools-api/src/Models/Cart/MethodTaxRateCollection.php new file mode 100644 index 00000000000..530cb31979d --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/MethodTaxRateCollection.php @@ -0,0 +1,56 @@ + + * @method MethodTaxRate current() + * @method MethodTaxRate end() + * @method MethodTaxRate at($offset) + */ +class MethodTaxRateCollection extends MapperSequence +{ + /** + * @psalm-assert MethodTaxRate $value + * @psalm-param MethodTaxRate|stdClass $value + * @throws InvalidArgumentException + * + * @return MethodTaxRateCollection + */ + public function add($value) + { + if (!$value instanceof MethodTaxRate) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MethodTaxRate + */ + protected function mapper() + { + return function (?int $index): ?MethodTaxRate { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MethodTaxRate $data */ + $data = MethodTaxRateModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/MethodTaxRateModel.php b/lib/commercetools-api/src/Models/Cart/MethodTaxRateModel.php new file mode 100644 index 00000000000..f3086e12e9b --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/MethodTaxRateModel.php @@ -0,0 +1,105 @@ +shippingMethodKey = $shippingMethodKey; + $this->taxRate = $taxRate; + } + + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + * + * @return null|string + */ + public function getShippingMethodKey() + { + if (is_null($this->shippingMethodKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_METHOD_KEY); + if (is_null($data)) { + return null; + } + $this->shippingMethodKey = (string) $data; + } + + return $this->shippingMethodKey; + } + + /** + *

Tax Rate for the Shipping Method.

+ * + * + * @return null|TaxRate + */ + public function getTaxRate() + { + if (is_null($this->taxRate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TAX_RATE); + if (is_null($data)) { + return null; + } + + $this->taxRate = TaxRateModel::of($data); + } + + return $this->taxRate; + } + + + /** + * @param ?string $shippingMethodKey + */ + public function setShippingMethodKey(?string $shippingMethodKey): void + { + $this->shippingMethodKey = $shippingMethodKey; + } + + /** + * @param ?TaxRate $taxRate + */ + public function setTaxRate(?TaxRate $taxRate): void + { + $this->taxRate = $taxRate; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/MethodTaxedPrice.php b/lib/commercetools-api/src/Models/Cart/MethodTaxedPrice.php new file mode 100644 index 00000000000..c2fa6e009f7 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/MethodTaxedPrice.php @@ -0,0 +1,44 @@ +User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingMethodKey(); + + /** + *

Taxed price for the Shipping Method.

+ * + + * @return null|TaxedItemPrice + */ + public function getTaxedPrice(); + + /** + * @param ?string $shippingMethodKey + */ + public function setShippingMethodKey(?string $shippingMethodKey): void; + + /** + * @param ?TaxedItemPrice $taxedPrice + */ + public function setTaxedPrice(?TaxedItemPrice $taxedPrice): void; +} diff --git a/lib/commercetools-api/src/Models/Cart/MethodTaxedPriceBuilder.php b/lib/commercetools-api/src/Models/Cart/MethodTaxedPriceBuilder.php new file mode 100644 index 00000000000..412b179964c --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/MethodTaxedPriceBuilder.php @@ -0,0 +1,102 @@ + + */ +final class MethodTaxedPriceBuilder implements Builder +{ + /** + + * @var ?string + */ + private $shippingMethodKey; + + /** + + * @var null|TaxedItemPrice|TaxedItemPriceBuilder + */ + private $taxedPrice; + + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingMethodKey() + { + return $this->shippingMethodKey; + } + + /** + *

Taxed price for the Shipping Method.

+ * + + * @return null|TaxedItemPrice + */ + public function getTaxedPrice() + { + return $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice; + } + + /** + * @param ?string $shippingMethodKey + * @return $this + */ + public function withShippingMethodKey(?string $shippingMethodKey) + { + $this->shippingMethodKey = $shippingMethodKey; + + return $this; + } + + /** + * @param ?TaxedItemPrice $taxedPrice + * @return $this + */ + public function withTaxedPrice(?TaxedItemPrice $taxedPrice) + { + $this->taxedPrice = $taxedPrice; + + return $this; + } + + /** + * @deprecated use withTaxedPrice() instead + * @return $this + */ + public function withTaxedPriceBuilder(?TaxedItemPriceBuilder $taxedPrice) + { + $this->taxedPrice = $taxedPrice; + + return $this; + } + + public function build(): MethodTaxedPrice + { + return new MethodTaxedPriceModel( + $this->shippingMethodKey, + $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice + ); + } + + public static function of(): MethodTaxedPriceBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Cart/MethodTaxedPriceCollection.php b/lib/commercetools-api/src/Models/Cart/MethodTaxedPriceCollection.php new file mode 100644 index 00000000000..aa7c1d5778a --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/MethodTaxedPriceCollection.php @@ -0,0 +1,56 @@ + + * @method MethodTaxedPrice current() + * @method MethodTaxedPrice end() + * @method MethodTaxedPrice at($offset) + */ +class MethodTaxedPriceCollection extends MapperSequence +{ + /** + * @psalm-assert MethodTaxedPrice $value + * @psalm-param MethodTaxedPrice|stdClass $value + * @throws InvalidArgumentException + * + * @return MethodTaxedPriceCollection + */ + public function add($value) + { + if (!$value instanceof MethodTaxedPrice) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MethodTaxedPrice + */ + protected function mapper() + { + return function (?int $index): ?MethodTaxedPrice { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MethodTaxedPrice $data */ + $data = MethodTaxedPriceModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/MethodTaxedPriceModel.php b/lib/commercetools-api/src/Models/Cart/MethodTaxedPriceModel.php new file mode 100644 index 00000000000..15175e582db --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/MethodTaxedPriceModel.php @@ -0,0 +1,103 @@ +shippingMethodKey = $shippingMethodKey; + $this->taxedPrice = $taxedPrice; + } + + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + * + * @return null|string + */ + public function getShippingMethodKey() + { + if (is_null($this->shippingMethodKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_METHOD_KEY); + if (is_null($data)) { + return null; + } + $this->shippingMethodKey = (string) $data; + } + + return $this->shippingMethodKey; + } + + /** + *

Taxed price for the Shipping Method.

+ * + * + * @return null|TaxedItemPrice + */ + public function getTaxedPrice() + { + if (is_null($this->taxedPrice)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TAXED_PRICE); + if (is_null($data)) { + return null; + } + + $this->taxedPrice = TaxedItemPriceModel::of($data); + } + + return $this->taxedPrice; + } + + + /** + * @param ?string $shippingMethodKey + */ + public function setShippingMethodKey(?string $shippingMethodKey): void + { + $this->shippingMethodKey = $shippingMethodKey; + } + + /** + * @param ?TaxedItemPrice $taxedPrice + */ + public function setTaxedPrice(?TaxedItemPrice $taxedPrice): void + { + $this->taxedPrice = $taxedPrice; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/ReplicaCartDraft.php b/lib/commercetools-api/src/Models/Cart/ReplicaCartDraft.php index e1d25bb3f70..ce2d37fa056 100644 --- a/lib/commercetools-api/src/Models/Cart/ReplicaCartDraft.php +++ b/lib/commercetools-api/src/Models/Cart/ReplicaCartDraft.php @@ -18,6 +18,7 @@ interface ReplicaCartDraft extends JsonObject public const FIELD_KEY = 'key'; /** + * @return null|mixed */ public function getReference(); @@ -25,6 +26,7 @@ public function getReference(); /** *

User-specific unique identifier of the cart.

* + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Cart/ReplicaCartDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/ReplicaCartDraftBuilder.php index 93a8bc9943d..eab032bac96 100644 --- a/lib/commercetools-api/src/Models/Cart/ReplicaCartDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ReplicaCartDraftBuilder.php @@ -21,16 +21,19 @@ final class ReplicaCartDraftBuilder implements Builder { /** + * @var ?JsonObject */ private $reference; /** + * @var ?string */ private $key; /** + * @return null|JsonObject */ public function getReference() @@ -41,6 +44,7 @@ public function getReference() /** *

User-specific unique identifier of the cart.

* + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Cart/ReplicaCartDraftModel.php b/lib/commercetools-api/src/Models/Cart/ReplicaCartDraftModel.php index db2dffed092..332afa6dd94 100644 --- a/lib/commercetools-api/src/Models/Cart/ReplicaCartDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/ReplicaCartDraftModel.php @@ -22,11 +22,13 @@ final class ReplicaCartDraftModel extends JsonObjectModel implements ReplicaCartDraft { /** + * * @var ?mixed */ protected $reference; /** + * * @var ?string */ protected $key; @@ -44,6 +46,7 @@ public function __construct( } /** + * * @return ?mixed */ public function getReference() @@ -63,6 +66,7 @@ public function getReference() /** *

User-specific unique identifier of the cart.

* + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInput.php b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInput.php index 1135e0c2661..5a6174bf153 100644 --- a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInput.php +++ b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInput.php @@ -16,12 +16,13 @@ interface ScoreShippingRateInput extends ShippingRateInput public const FIELD_SCORE = 'score'; /** - * @return null|float + + * @return null|int */ public function getScore(); /** - * @param ?float $score + * @param ?int $score */ - public function setScore(?float $score): void; + public function setScore(?int $score): void; } diff --git a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputBuilder.php b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputBuilder.php index ae379f804d8..f6e6b3778b5 100644 --- a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputBuilder.php @@ -21,12 +21,14 @@ final class ScoreShippingRateInputBuilder implements Builder { /** - * @var ?float + + * @var ?int */ private $score; /** - * @return null|float + + * @return null|int */ public function getScore() { @@ -34,10 +36,10 @@ public function getScore() } /** - * @param ?float $score + * @param ?int $score * @return $this */ - public function withScore(?float $score) + public function withScore(?int $score) { $this->score = $score; diff --git a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraft.php b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraft.php index ca5d94c067b..7cc0fc10815 100644 --- a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraft.php +++ b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraft.php @@ -16,12 +16,13 @@ interface ScoreShippingRateInputDraft extends ShippingRateInputDraft public const FIELD_SCORE = 'score'; /** - * @return null|float + + * @return null|int */ public function getScore(); /** - * @param ?float $score + * @param ?int $score */ - public function setScore(?float $score): void; + public function setScore(?int $score): void; } diff --git a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraftBuilder.php index e766803fedf..8c2e2cf8b58 100644 --- a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraftBuilder.php @@ -21,12 +21,14 @@ final class ScoreShippingRateInputDraftBuilder implements Builder { /** - * @var ?float + + * @var ?int */ private $score; /** - * @return null|float + + * @return null|int */ public function getScore() { @@ -34,10 +36,10 @@ public function getScore() } /** - * @param ?float $score + * @param ?int $score * @return $this */ - public function withScore(?float $score) + public function withScore(?int $score) { $this->score = $score; diff --git a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraftModel.php b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraftModel.php index 58821294fcf..1221b1112f9 100644 --- a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputDraftModel.php @@ -21,12 +21,14 @@ final class ScoreShippingRateInputDraftModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'Score'; /** + * * @var ?string */ protected $type; /** - * @var ?float + * + * @var ?int */ protected $score; @@ -35,13 +37,15 @@ final class ScoreShippingRateInputDraftModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?float $score = null + ?int $score = null, + ?string $type = null ) { $this->score = $score; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,17 +63,18 @@ public function getType() } /** - * @return null|float + * + * @return null|int */ public function getScore() { if (is_null($this->score)) { - /** @psalm-var ?float $data */ + /** @psalm-var ?int $data */ $data = $this->raw(self::FIELD_SCORE); if (is_null($data)) { return null; } - $this->score = (float) $data; + $this->score = (int) $data; } return $this->score; @@ -77,9 +82,9 @@ public function getScore() /** - * @param ?float $score + * @param ?int $score */ - public function setScore(?float $score): void + public function setScore(?int $score): void { $this->score = $score; } diff --git a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputModel.php b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputModel.php index b834bfd586f..ae98d05d4e1 100644 --- a/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputModel.php +++ b/lib/commercetools-api/src/Models/Cart/ScoreShippingRateInputModel.php @@ -21,12 +21,14 @@ final class ScoreShippingRateInputModel extends JsonObjectModel implements Score { public const DISCRIMINATOR_VALUE = 'Score'; /** + * * @var ?string */ protected $type; /** - * @var ?float + * + * @var ?int */ protected $score; @@ -35,13 +37,15 @@ final class ScoreShippingRateInputModel extends JsonObjectModel implements Score * @psalm-suppress MissingParamType */ public function __construct( - ?float $score = null + ?int $score = null, + ?string $type = null ) { $this->score = $score; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,17 +63,18 @@ public function getType() } /** - * @return null|float + * + * @return null|int */ public function getScore() { if (is_null($this->score)) { - /** @psalm-var ?float $data */ + /** @psalm-var ?int $data */ $data = $this->raw(self::FIELD_SCORE); if (is_null($data)) { return null; } - $this->score = (float) $data; + $this->score = (int) $data; } return $this->score; @@ -77,9 +82,9 @@ public function getScore() /** - * @param ?float $score + * @param ?int $score */ - public function setScore(?float $score): void + public function setScore(?int $score): void { $this->score = $score; } diff --git a/lib/commercetools-api/src/Models/Cart/Shipping.php b/lib/commercetools-api/src/Models/Cart/Shipping.php new file mode 100644 index 00000000000..121d27fef2e --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/Shipping.php @@ -0,0 +1,92 @@ +User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey(); + + /** + *

Automatically set when the Shipping Method is added.

+ * + + * @return null|ShippingInfo + */ + public function getShippingInfo(); + + /** + *

Determines the shipping rates and Tax Rates of the associated Line Item quantities.

+ * + + * @return null|Address + */ + public function getShippingAddress(); + + /** + *

Used as an input to select a ShippingRatePriceTier.

+ * + * + + * @return null|ShippingRateInput + */ + public function getShippingRateInput(); + + /** + *

Custom Fields of Shipping.

+ * + + * @return null|CustomFields + */ + public function getShippingCustomFields(); + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; + + /** + * @param ?ShippingInfo $shippingInfo + */ + public function setShippingInfo(?ShippingInfo $shippingInfo): void; + + /** + * @param ?Address $shippingAddress + */ + public function setShippingAddress(?Address $shippingAddress): void; + + /** + * @param ?ShippingRateInput $shippingRateInput + */ + public function setShippingRateInput(?ShippingRateInput $shippingRateInput): void; + + /** + * @param ?CustomFields $shippingCustomFields + */ + public function setShippingCustomFields(?CustomFields $shippingCustomFields): void; +} diff --git a/lib/commercetools-api/src/Models/Cart/ShippingBuilder.php b/lib/commercetools-api/src/Models/Cart/ShippingBuilder.php new file mode 100644 index 00000000000..5d4772ca324 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/ShippingBuilder.php @@ -0,0 +1,230 @@ + + */ +final class ShippingBuilder implements Builder +{ + /** + + * @var ?string + */ + private $shippingKey; + + /** + + * @var null|ShippingInfo|ShippingInfoBuilder + */ + private $shippingInfo; + + /** + + * @var null|Address|AddressBuilder + */ + private $shippingAddress; + + /** + + * @var null|ShippingRateInput|ShippingRateInputBuilder + */ + private $shippingRateInput; + + /** + + * @var null|CustomFields|CustomFieldsBuilder + */ + private $shippingCustomFields; + + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + + /** + *

Automatically set when the Shipping Method is added.

+ * + + * @return null|ShippingInfo + */ + public function getShippingInfo() + { + return $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo; + } + + /** + *

Determines the shipping rates and Tax Rates of the associated Line Item quantities.

+ * + + * @return null|Address + */ + public function getShippingAddress() + { + return $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress; + } + + /** + *

Used as an input to select a ShippingRatePriceTier.

+ * + * + + * @return null|ShippingRateInput + */ + public function getShippingRateInput() + { + return $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput; + } + + /** + *

Custom Fields of Shipping.

+ * + + * @return null|CustomFields + */ + public function getShippingCustomFields() + { + return $this->shippingCustomFields instanceof CustomFieldsBuilder ? $this->shippingCustomFields->build() : $this->shippingCustomFields; + } + + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + + /** + * @param ?ShippingInfo $shippingInfo + * @return $this + */ + public function withShippingInfo(?ShippingInfo $shippingInfo) + { + $this->shippingInfo = $shippingInfo; + + return $this; + } + + /** + * @param ?Address $shippingAddress + * @return $this + */ + public function withShippingAddress(?Address $shippingAddress) + { + $this->shippingAddress = $shippingAddress; + + return $this; + } + + /** + * @param ?ShippingRateInput $shippingRateInput + * @return $this + */ + public function withShippingRateInput(?ShippingRateInput $shippingRateInput) + { + $this->shippingRateInput = $shippingRateInput; + + return $this; + } + + /** + * @param ?CustomFields $shippingCustomFields + * @return $this + */ + public function withShippingCustomFields(?CustomFields $shippingCustomFields) + { + $this->shippingCustomFields = $shippingCustomFields; + + return $this; + } + + /** + * @deprecated use withShippingInfo() instead + * @return $this + */ + public function withShippingInfoBuilder(?ShippingInfoBuilder $shippingInfo) + { + $this->shippingInfo = $shippingInfo; + + return $this; + } + + /** + * @deprecated use withShippingAddress() instead + * @return $this + */ + public function withShippingAddressBuilder(?AddressBuilder $shippingAddress) + { + $this->shippingAddress = $shippingAddress; + + return $this; + } + + /** + * @deprecated use withShippingRateInput() instead + * @return $this + */ + public function withShippingRateInputBuilder(?ShippingRateInputBuilder $shippingRateInput) + { + $this->shippingRateInput = $shippingRateInput; + + return $this; + } + + /** + * @deprecated use withShippingCustomFields() instead + * @return $this + */ + public function withShippingCustomFieldsBuilder(?CustomFieldsBuilder $shippingCustomFields) + { + $this->shippingCustomFields = $shippingCustomFields; + + return $this; + } + + public function build(): Shipping + { + return new ShippingModel( + $this->shippingKey, + $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo, + $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, + $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, + $this->shippingCustomFields instanceof CustomFieldsBuilder ? $this->shippingCustomFields->build() : $this->shippingCustomFields + ); + } + + public static function of(): ShippingBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Cart/ShippingCollection.php b/lib/commercetools-api/src/Models/Cart/ShippingCollection.php new file mode 100644 index 00000000000..c0c950fc731 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/ShippingCollection.php @@ -0,0 +1,56 @@ + + * @method Shipping current() + * @method Shipping end() + * @method Shipping at($offset) + */ +class ShippingCollection extends MapperSequence +{ + /** + * @psalm-assert Shipping $value + * @psalm-param Shipping|stdClass $value + * @throws InvalidArgumentException + * + * @return ShippingCollection + */ + public function add($value) + { + if (!$value instanceof Shipping) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?Shipping + */ + protected function mapper() + { + return function (?int $index): ?Shipping { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var Shipping $data */ + $data = ShippingModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/ShippingDraft.php b/lib/commercetools-api/src/Models/Cart/ShippingDraft.php new file mode 100644 index 00000000000..adc925fc2fe --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/ShippingDraft.php @@ -0,0 +1,122 @@ +User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getKey(); + + /** + *

Shipping Methods added to the Cart with Multiple ShippingMode.

+ * + + * @return null|ShippingMethodReference + */ + public function getShippingMethod(); + + /** + *

Determines the shipping rate and Tax Rate of the associated Line Items.

+ * + + * @return null|BaseAddress + */ + public function getShippingAddress(); + + /** + *

Used as an input to select a ShippingRatePriceTier.

+ * + *

The shippingRateInput cannot be set on the Cart if CartValueType is defined.

+ * + + * @return null|ShippingRateInputDraft + */ + public function getShippingRateInput(); + + /** + *

Tax Rate used for taxing a shipping expense if the Cart has the External TaxMode.

+ * + + * @return null|string + */ + public function getExternalTaxRate(); + + /** + *

Holds information on how items are delivered to customers.

+ * + + * @return null|DeliveryCollection + */ + public function getDeliveries(); + + /** + *

Custom Fields for Shipping.

+ * + + * @return null|string + */ + public function getCustom(); + + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + + /** + * @param ?ShippingMethodReference $shippingMethod + */ + public function setShippingMethod(?ShippingMethodReference $shippingMethod): void; + + /** + * @param ?BaseAddress $shippingAddress + */ + public function setShippingAddress(?BaseAddress $shippingAddress): void; + + /** + * @param ?ShippingRateInputDraft $shippingRateInput + */ + public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput): void; + + /** + * @param ?string $externalTaxRate + */ + public function setExternalTaxRate(?string $externalTaxRate): void; + + /** + * @param ?DeliveryCollection $deliveries + */ + public function setDeliveries(?DeliveryCollection $deliveries): void; + + /** + * @param ?string $custom + */ + public function setCustom(?string $custom): void; +} diff --git a/lib/commercetools-api/src/Models/Cart/ShippingDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/ShippingDraftBuilder.php new file mode 100644 index 00000000000..0fea58d858b --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/ShippingDraftBuilder.php @@ -0,0 +1,279 @@ + + */ +final class ShippingDraftBuilder implements Builder +{ + /** + + * @var ?string + */ + private $key; + + /** + + * @var null|ShippingMethodReference|ShippingMethodReferenceBuilder + */ + private $shippingMethod; + + /** + + * @var null|BaseAddress|BaseAddressBuilder + */ + private $shippingAddress; + + /** + + * @var null|ShippingRateInputDraft|ShippingRateInputDraftBuilder + */ + private $shippingRateInput; + + /** + + * @var ?string + */ + private $externalTaxRate; + + /** + + * @var ?DeliveryCollection + */ + private $deliveries; + + /** + + * @var ?string + */ + private $custom; + + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + *

Shipping Methods added to the Cart with Multiple ShippingMode.

+ * + + * @return null|ShippingMethodReference + */ + public function getShippingMethod() + { + return $this->shippingMethod instanceof ShippingMethodReferenceBuilder ? $this->shippingMethod->build() : $this->shippingMethod; + } + + /** + *

Determines the shipping rate and Tax Rate of the associated Line Items.

+ * + + * @return null|BaseAddress + */ + public function getShippingAddress() + { + return $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress; + } + + /** + *

Used as an input to select a ShippingRatePriceTier.

+ * + *

The shippingRateInput cannot be set on the Cart if CartValueType is defined.

+ * + + * @return null|ShippingRateInputDraft + */ + public function getShippingRateInput() + { + return $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput; + } + + /** + *

Tax Rate used for taxing a shipping expense if the Cart has the External TaxMode.

+ * + + * @return null|string + */ + public function getExternalTaxRate() + { + return $this->externalTaxRate; + } + + /** + *

Holds information on how items are delivered to customers.

+ * + + * @return null|DeliveryCollection + */ + public function getDeliveries() + { + return $this->deliveries; + } + + /** + *

Custom Fields for Shipping.

+ * + + * @return null|string + */ + public function getCustom() + { + return $this->custom; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?ShippingMethodReference $shippingMethod + * @return $this + */ + public function withShippingMethod(?ShippingMethodReference $shippingMethod) + { + $this->shippingMethod = $shippingMethod; + + return $this; + } + + /** + * @param ?BaseAddress $shippingAddress + * @return $this + */ + public function withShippingAddress(?BaseAddress $shippingAddress) + { + $this->shippingAddress = $shippingAddress; + + return $this; + } + + /** + * @param ?ShippingRateInputDraft $shippingRateInput + * @return $this + */ + public function withShippingRateInput(?ShippingRateInputDraft $shippingRateInput) + { + $this->shippingRateInput = $shippingRateInput; + + return $this; + } + + /** + * @param ?string $externalTaxRate + * @return $this + */ + public function withExternalTaxRate(?string $externalTaxRate) + { + $this->externalTaxRate = $externalTaxRate; + + return $this; + } + + /** + * @param ?DeliveryCollection $deliveries + * @return $this + */ + public function withDeliveries(?DeliveryCollection $deliveries) + { + $this->deliveries = $deliveries; + + return $this; + } + + /** + * @param ?string $custom + * @return $this + */ + public function withCustom(?string $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @deprecated use withShippingMethod() instead + * @return $this + */ + public function withShippingMethodBuilder(?ShippingMethodReferenceBuilder $shippingMethod) + { + $this->shippingMethod = $shippingMethod; + + return $this; + } + + /** + * @deprecated use withShippingAddress() instead + * @return $this + */ + public function withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress) + { + $this->shippingAddress = $shippingAddress; + + return $this; + } + + /** + * @deprecated use withShippingRateInput() instead + * @return $this + */ + public function withShippingRateInputBuilder(?ShippingRateInputDraftBuilder $shippingRateInput) + { + $this->shippingRateInput = $shippingRateInput; + + return $this; + } + + public function build(): ShippingDraft + { + return new ShippingDraftModel( + $this->key, + $this->shippingMethod instanceof ShippingMethodReferenceBuilder ? $this->shippingMethod->build() : $this->shippingMethod, + $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, + $this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, + $this->externalTaxRate, + $this->deliveries, + $this->custom + ); + } + + public static function of(): ShippingDraftBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Cart/ShippingDraftCollection.php b/lib/commercetools-api/src/Models/Cart/ShippingDraftCollection.php new file mode 100644 index 00000000000..3fde3ff2d97 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/ShippingDraftCollection.php @@ -0,0 +1,56 @@ + + * @method ShippingDraft current() + * @method ShippingDraft end() + * @method ShippingDraft at($offset) + */ +class ShippingDraftCollection extends MapperSequence +{ + /** + * @psalm-assert ShippingDraft $value + * @psalm-param ShippingDraft|stdClass $value + * @throws InvalidArgumentException + * + * @return ShippingDraftCollection + */ + public function add($value) + { + if (!$value instanceof ShippingDraft) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ShippingDraft + */ + protected function mapper() + { + return function (?int $index): ?ShippingDraft { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ShippingDraft $data */ + $data = ShippingDraftModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/ShippingDraftModel.php b/lib/commercetools-api/src/Models/Cart/ShippingDraftModel.php new file mode 100644 index 00000000000..4fcd30537d3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/ShippingDraftModel.php @@ -0,0 +1,295 @@ +key = $key; + $this->shippingMethod = $shippingMethod; + $this->shippingAddress = $shippingAddress; + $this->shippingRateInput = $shippingRateInput; + $this->externalTaxRate = $externalTaxRate; + $this->deliveries = $deliveries; + $this->custom = $custom; + } + + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + *

Shipping Methods added to the Cart with Multiple ShippingMode.

+ * + * + * @return null|ShippingMethodReference + */ + public function getShippingMethod() + { + if (is_null($this->shippingMethod)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_METHOD); + if (is_null($data)) { + return null; + } + + $this->shippingMethod = ShippingMethodReferenceModel::of($data); + } + + return $this->shippingMethod; + } + + /** + *

Determines the shipping rate and Tax Rate of the associated Line Items.

+ * + * + * @return null|BaseAddress + */ + public function getShippingAddress() + { + if (is_null($this->shippingAddress)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->shippingAddress = BaseAddressModel::of($data); + } + + return $this->shippingAddress; + } + + /** + *

Used as an input to select a ShippingRatePriceTier.

+ * + *

The shippingRateInput cannot be set on the Cart if CartValueType is defined.

+ * + * + * @return null|ShippingRateInputDraft + */ + public function getShippingRateInput() + { + if (is_null($this->shippingRateInput)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_RATE_INPUT); + if (is_null($data)) { + return null; + } + + $this->shippingRateInput = ShippingRateInputDraftModel::of($data); + } + + return $this->shippingRateInput; + } + + /** + *

Tax Rate used for taxing a shipping expense if the Cart has the External TaxMode.

+ * + * + * @return null|string + */ + public function getExternalTaxRate() + { + if (is_null($this->externalTaxRate)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); + if (is_null($data)) { + return null; + } + $this->externalTaxRate = (string) $data; + } + + return $this->externalTaxRate; + } + + /** + *

Holds information on how items are delivered to customers.

+ * + * + * @return null|DeliveryCollection + */ + public function getDeliveries() + { + if (is_null($this->deliveries)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_DELIVERIES); + if (is_null($data)) { + return null; + } + $this->deliveries = DeliveryCollection::fromArray($data); + } + + return $this->deliveries; + } + + /** + *

Custom Fields for Shipping.

+ * + * + * @return null|string + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + $this->custom = (string) $data; + } + + return $this->custom; + } + + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + + /** + * @param ?ShippingMethodReference $shippingMethod + */ + public function setShippingMethod(?ShippingMethodReference $shippingMethod): void + { + $this->shippingMethod = $shippingMethod; + } + + /** + * @param ?BaseAddress $shippingAddress + */ + public function setShippingAddress(?BaseAddress $shippingAddress): void + { + $this->shippingAddress = $shippingAddress; + } + + /** + * @param ?ShippingRateInputDraft $shippingRateInput + */ + public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput): void + { + $this->shippingRateInput = $shippingRateInput; + } + + /** + * @param ?string $externalTaxRate + */ + public function setExternalTaxRate(?string $externalTaxRate): void + { + $this->externalTaxRate = $externalTaxRate; + } + + /** + * @param ?DeliveryCollection $deliveries + */ + public function setDeliveries(?DeliveryCollection $deliveries): void + { + $this->deliveries = $deliveries; + } + + /** + * @param ?string $custom + */ + public function setCustom(?string $custom): void + { + $this->custom = $custom; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/ShippingInfo.php b/lib/commercetools-api/src/Models/Cart/ShippingInfo.php index 043d1f93a5a..33a4043070a 100644 --- a/lib/commercetools-api/src/Models/Cart/ShippingInfo.php +++ b/lib/commercetools-api/src/Models/Cart/ShippingInfo.php @@ -31,6 +31,7 @@ interface ShippingInfo extends JsonObject public const FIELD_SHIPPING_METHOD_STATE = 'shippingMethodState'; /** + * @return null|string */ public function getShippingMethodName(); @@ -38,6 +39,7 @@ public function getShippingMethodName(); /** *

Determined based on the ShippingRate and its tiered prices, and either the sum of LineItem prices or the shippingRateInput field.

* + * @return null|TypedMoney */ public function getPrice(); @@ -45,6 +47,7 @@ public function getPrice(); /** *

The shipping rate used to determine the price.

* + * @return null|ShippingRate */ public function getShippingRate(); @@ -52,6 +55,7 @@ public function getShippingRate(); /** *

Set once the taxRate is set.

* + * @return null|TaxedItemPrice */ public function getTaxedPrice(); @@ -60,11 +64,13 @@ public function getTaxedPrice(); *

Will be set automatically in the Platform TaxMode once the shipping address is set is set. * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

* + * @return null|TaxRate */ public function getTaxRate(); /** + * @return null|TaxCategoryReference */ public function getTaxCategory(); @@ -72,6 +78,7 @@ public function getTaxCategory(); /** *

Not set if custom shipping method is used.

* + * @return null|ShippingMethodReference */ public function getShippingMethod(); @@ -79,11 +86,13 @@ public function getShippingMethod(); /** *

Deliveries are compilations of information on how the articles are being delivered to the customers.

* + * @return null|DeliveryCollection */ public function getDeliveries(); /** + * @return null|DiscountedLineItemPrice */ public function getDiscountedPrice(); @@ -91,6 +100,7 @@ public function getDiscountedPrice(); /** *

Indicates whether the ShippingMethod referenced in this ShippingInfo is allowed for the cart or not.

* + * @return null|string */ public function getShippingMethodState(); diff --git a/lib/commercetools-api/src/Models/Cart/ShippingInfoBuilder.php b/lib/commercetools-api/src/Models/Cart/ShippingInfoBuilder.php index 1e461a0c750..40da58fbae1 100644 --- a/lib/commercetools-api/src/Models/Cart/ShippingInfoBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/ShippingInfoBuilder.php @@ -32,56 +32,67 @@ final class ShippingInfoBuilder implements Builder { /** + * @var ?string */ private $shippingMethodName; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $price; /** + * @var null|ShippingRate|ShippingRateBuilder */ private $shippingRate; /** + * @var null|TaxedItemPrice|TaxedItemPriceBuilder */ private $taxedPrice; /** + * @var null|TaxRate|TaxRateBuilder */ private $taxRate; /** + * @var null|TaxCategoryReference|TaxCategoryReferenceBuilder */ private $taxCategory; /** + * @var null|ShippingMethodReference|ShippingMethodReferenceBuilder */ private $shippingMethod; /** + * @var ?DeliveryCollection */ private $deliveries; /** + * @var null|DiscountedLineItemPrice|DiscountedLineItemPriceBuilder */ private $discountedPrice; /** + * @var ?string */ private $shippingMethodState; /** + * @return null|string */ public function getShippingMethodName() @@ -92,6 +103,7 @@ public function getShippingMethodName() /** *

Determined based on the ShippingRate and its tiered prices, and either the sum of LineItem prices or the shippingRateInput field.

* + * @return null|TypedMoney */ public function getPrice() @@ -102,6 +114,7 @@ public function getPrice() /** *

The shipping rate used to determine the price.

* + * @return null|ShippingRate */ public function getShippingRate() @@ -112,6 +125,7 @@ public function getShippingRate() /** *

Set once the taxRate is set.

* + * @return null|TaxedItemPrice */ public function getTaxedPrice() @@ -123,6 +137,7 @@ public function getTaxedPrice() *

Will be set automatically in the Platform TaxMode once the shipping address is set is set. * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

* + * @return null|TaxRate */ public function getTaxRate() @@ -131,6 +146,7 @@ public function getTaxRate() } /** + * @return null|TaxCategoryReference */ public function getTaxCategory() @@ -141,6 +157,7 @@ public function getTaxCategory() /** *

Not set if custom shipping method is used.

* + * @return null|ShippingMethodReference */ public function getShippingMethod() @@ -151,6 +168,7 @@ public function getShippingMethod() /** *

Deliveries are compilations of information on how the articles are being delivered to the customers.

* + * @return null|DeliveryCollection */ public function getDeliveries() @@ -159,6 +177,7 @@ public function getDeliveries() } /** + * @return null|DiscountedLineItemPrice */ public function getDiscountedPrice() @@ -169,6 +188,7 @@ public function getDiscountedPrice() /** *

Indicates whether the ShippingMethod referenced in this ShippingInfo is allowed for the cart or not.

* + * @return null|string */ public function getShippingMethodState() diff --git a/lib/commercetools-api/src/Models/Cart/ShippingInfoModel.php b/lib/commercetools-api/src/Models/Cart/ShippingInfoModel.php index 52bf2b9e8a7..89853689ec5 100644 --- a/lib/commercetools-api/src/Models/Cart/ShippingInfoModel.php +++ b/lib/commercetools-api/src/Models/Cart/ShippingInfoModel.php @@ -31,51 +31,61 @@ final class ShippingInfoModel extends JsonObjectModel implements ShippingInfo { /** + * * @var ?string */ protected $shippingMethodName; /** + * * @var ?TypedMoney */ protected $price; /** + * * @var ?ShippingRate */ protected $shippingRate; /** + * * @var ?TaxedItemPrice */ protected $taxedPrice; /** + * * @var ?TaxRate */ protected $taxRate; /** + * * @var ?TaxCategoryReference */ protected $taxCategory; /** + * * @var ?ShippingMethodReference */ protected $shippingMethod; /** + * * @var ?DeliveryCollection */ protected $deliveries; /** + * * @var ?DiscountedLineItemPrice */ protected $discountedPrice; /** + * * @var ?string */ protected $shippingMethodState; @@ -109,6 +119,7 @@ public function __construct( } /** + * * @return null|string */ public function getShippingMethodName() @@ -128,6 +139,7 @@ public function getShippingMethodName() /** *

Determined based on the ShippingRate and its tiered prices, and either the sum of LineItem prices or the shippingRateInput field.

* + * * @return null|TypedMoney */ public function getPrice() @@ -148,6 +160,7 @@ public function getPrice() /** *

The shipping rate used to determine the price.

* + * * @return null|ShippingRate */ public function getShippingRate() @@ -168,6 +181,7 @@ public function getShippingRate() /** *

Set once the taxRate is set.

* + * * @return null|TaxedItemPrice */ public function getTaxedPrice() @@ -189,6 +203,7 @@ public function getTaxedPrice() *

Will be set automatically in the Platform TaxMode once the shipping address is set is set. * For the External tax mode the tax rate has to be set explicitly with the ExternalTaxRateDraft.

* + * * @return null|TaxRate */ public function getTaxRate() @@ -207,6 +222,7 @@ public function getTaxRate() } /** + * * @return null|TaxCategoryReference */ public function getTaxCategory() @@ -227,6 +243,7 @@ public function getTaxCategory() /** *

Not set if custom shipping method is used.

* + * * @return null|ShippingMethodReference */ public function getShippingMethod() @@ -247,6 +264,7 @@ public function getShippingMethod() /** *

Deliveries are compilations of information on how the articles are being delivered to the customers.

* + * * @return null|DeliveryCollection */ public function getDeliveries() @@ -264,6 +282,7 @@ public function getDeliveries() } /** + * * @return null|DiscountedLineItemPrice */ public function getDiscountedPrice() @@ -284,6 +303,7 @@ public function getDiscountedPrice() /** *

Indicates whether the ShippingMethod referenced in this ShippingInfo is allowed for the cart or not.

* + * * @return null|string */ public function getShippingMethodState() diff --git a/lib/commercetools-api/src/Models/Cart/ShippingModel.php b/lib/commercetools-api/src/Models/Cart/ShippingModel.php new file mode 100644 index 00000000000..22923d095f9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/ShippingModel.php @@ -0,0 +1,222 @@ +shippingKey = $shippingKey; + $this->shippingInfo = $shippingInfo; + $this->shippingAddress = $shippingAddress; + $this->shippingRateInput = $shippingRateInput; + $this->shippingCustomFields = $shippingCustomFields; + } + + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + + /** + *

Automatically set when the Shipping Method is added.

+ * + * + * @return null|ShippingInfo + */ + public function getShippingInfo() + { + if (is_null($this->shippingInfo)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_INFO); + if (is_null($data)) { + return null; + } + + $this->shippingInfo = ShippingInfoModel::of($data); + } + + return $this->shippingInfo; + } + + /** + *

Determines the shipping rates and Tax Rates of the associated Line Item quantities.

+ * + * + * @return null|Address + */ + public function getShippingAddress() + { + if (is_null($this->shippingAddress)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->shippingAddress = AddressModel::of($data); + } + + return $this->shippingAddress; + } + + /** + *

Used as an input to select a ShippingRatePriceTier.

+ * + * + * + * @return null|ShippingRateInput + */ + public function getShippingRateInput() + { + if (is_null($this->shippingRateInput)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_RATE_INPUT); + if (is_null($data)) { + return null; + } + + $this->shippingRateInput = ShippingRateInputModel::of($data); + } + + return $this->shippingRateInput; + } + + /** + *

Custom Fields of Shipping.

+ * + * + * @return null|CustomFields + */ + public function getShippingCustomFields() + { + if (is_null($this->shippingCustomFields)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_CUSTOM_FIELDS); + if (is_null($data)) { + return null; + } + + $this->shippingCustomFields = CustomFieldsModel::of($data); + } + + return $this->shippingCustomFields; + } + + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } + + /** + * @param ?ShippingInfo $shippingInfo + */ + public function setShippingInfo(?ShippingInfo $shippingInfo): void + { + $this->shippingInfo = $shippingInfo; + } + + /** + * @param ?Address $shippingAddress + */ + public function setShippingAddress(?Address $shippingAddress): void + { + $this->shippingAddress = $shippingAddress; + } + + /** + * @param ?ShippingRateInput $shippingRateInput + */ + public function setShippingRateInput(?ShippingRateInput $shippingRateInput): void + { + $this->shippingRateInput = $shippingRateInput; + } + + /** + * @param ?CustomFields $shippingCustomFields + */ + public function setShippingCustomFields(?CustomFields $shippingCustomFields): void + { + $this->shippingCustomFields = $shippingCustomFields; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/ShippingRateInput.php b/lib/commercetools-api/src/Models/Cart/ShippingRateInput.php index f8abc5b11d1..ce07978f081 100644 --- a/lib/commercetools-api/src/Models/Cart/ShippingRateInput.php +++ b/lib/commercetools-api/src/Models/Cart/ShippingRateInput.php @@ -17,6 +17,7 @@ interface ShippingRateInput extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/Cart/ShippingRateInputDraft.php b/lib/commercetools-api/src/Models/Cart/ShippingRateInputDraft.php index bcd3758fc04..6940ac40704 100644 --- a/lib/commercetools-api/src/Models/Cart/ShippingRateInputDraft.php +++ b/lib/commercetools-api/src/Models/Cart/ShippingRateInputDraft.php @@ -17,6 +17,7 @@ interface ShippingRateInputDraft extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/Cart/ShippingRateInputDraftModel.php b/lib/commercetools-api/src/Models/Cart/ShippingRateInputDraftModel.php index 82f81ca4466..663e97a5f90 100644 --- a/lib/commercetools-api/src/Models/Cart/ShippingRateInputDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/ShippingRateInputDraftModel.php @@ -21,6 +21,7 @@ final class ShippingRateInputDraftModel extends JsonObjectModel implements Shipp { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -38,11 +39,13 @@ final class ShippingRateInputDraftModel extends JsonObjectModel implements Shipp * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Cart/ShippingRateInputModel.php b/lib/commercetools-api/src/Models/Cart/ShippingRateInputModel.php index 4e383e36080..83d1fc6d823 100644 --- a/lib/commercetools-api/src/Models/Cart/ShippingRateInputModel.php +++ b/lib/commercetools-api/src/Models/Cart/ShippingRateInputModel.php @@ -21,6 +21,7 @@ final class ShippingRateInputModel extends JsonObjectModel implements ShippingRa { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -38,11 +39,13 @@ final class ShippingRateInputModel extends JsonObjectModel implements ShippingRa * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Cart/TaxPortion.php b/lib/commercetools-api/src/Models/Cart/TaxPortion.php index d196e24b18e..83ebb9187f3 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxPortion.php +++ b/lib/commercetools-api/src/Models/Cart/TaxPortion.php @@ -19,6 +19,7 @@ interface TaxPortion extends JsonObject public const FIELD_AMOUNT = 'amount'; /** + * @return null|string */ public function getName(); @@ -26,11 +27,13 @@ public function getName(); /** *

A number in the range [0..1]

* + * @return null|float */ public function getRate(); /** + * @return null|TypedMoney */ public function getAmount(); diff --git a/lib/commercetools-api/src/Models/Cart/TaxPortionBuilder.php b/lib/commercetools-api/src/Models/Cart/TaxPortionBuilder.php index d01499fabcf..17374eb0d1e 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxPortionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/TaxPortionBuilder.php @@ -23,21 +23,25 @@ final class TaxPortionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?float */ private $rate; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $amount; /** + * @return null|string */ public function getName() @@ -48,6 +52,7 @@ public function getName() /** *

A number in the range [0..1]

* + * @return null|float */ public function getRate() @@ -56,6 +61,7 @@ public function getRate() } /** + * @return null|TypedMoney */ public function getAmount() diff --git a/lib/commercetools-api/src/Models/Cart/TaxPortionDraft.php b/lib/commercetools-api/src/Models/Cart/TaxPortionDraft.php index 97cc955874c..6a8b2509e43 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxPortionDraft.php +++ b/lib/commercetools-api/src/Models/Cart/TaxPortionDraft.php @@ -19,11 +19,13 @@ interface TaxPortionDraft extends JsonObject public const FIELD_AMOUNT = 'amount'; /** + * @return null|string */ public function getName(); /** + * @return null|float */ public function getRate(); @@ -32,6 +34,7 @@ public function getRate(); *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getAmount(); diff --git a/lib/commercetools-api/src/Models/Cart/TaxPortionDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/TaxPortionDraftBuilder.php index b2051f5932f..c3ccead37fb 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxPortionDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/TaxPortionDraftBuilder.php @@ -23,21 +23,25 @@ final class TaxPortionDraftBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?float */ private $rate; /** + * @var null|Money|MoneyBuilder */ private $amount; /** + * @return null|string */ public function getName() @@ -46,6 +50,7 @@ public function getName() } /** + * @return null|float */ public function getRate() @@ -57,6 +62,7 @@ public function getRate() *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getAmount() diff --git a/lib/commercetools-api/src/Models/Cart/TaxPortionDraftModel.php b/lib/commercetools-api/src/Models/Cart/TaxPortionDraftModel.php index 3beef12708b..e7220234a3e 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxPortionDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/TaxPortionDraftModel.php @@ -22,16 +22,19 @@ final class TaxPortionDraftModel extends JsonObjectModel implements TaxPortionDraft { /** + * * @var ?string */ protected $name; /** + * * @var ?float */ protected $rate; /** + * * @var ?Money */ protected $amount; @@ -51,6 +54,7 @@ public function __construct( } /** + * * @return null|string */ public function getName() @@ -68,6 +72,7 @@ public function getName() } /** + * * @return null|float */ public function getRate() @@ -88,6 +93,7 @@ public function getRate() *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * * @return null|Money */ public function getAmount() diff --git a/lib/commercetools-api/src/Models/Cart/TaxPortionModel.php b/lib/commercetools-api/src/Models/Cart/TaxPortionModel.php index d0536429527..13017937b41 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxPortionModel.php +++ b/lib/commercetools-api/src/Models/Cart/TaxPortionModel.php @@ -22,16 +22,19 @@ final class TaxPortionModel extends JsonObjectModel implements TaxPortion { /** + * * @var ?string */ protected $name; /** + * * @var ?float */ protected $rate; /** + * * @var ?TypedMoney */ protected $amount; @@ -51,6 +54,7 @@ public function __construct( } /** + * * @return null|string */ public function getName() @@ -70,6 +74,7 @@ public function getName() /** *

A number in the range [0..1]

* + * * @return null|float */ public function getRate() @@ -87,6 +92,7 @@ public function getRate() } /** + * * @return null|TypedMoney */ public function getAmount() diff --git a/lib/commercetools-api/src/Models/Cart/TaxedItemPrice.php b/lib/commercetools-api/src/Models/Cart/TaxedItemPrice.php index 5a154e127c0..7961a68cf32 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedItemPrice.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedItemPrice.php @@ -19,6 +19,7 @@ interface TaxedItemPrice extends JsonObject public const FIELD_TOTAL_TAX = 'totalTax'; /** + * @return null|TypedMoney */ public function getTotalNet(); @@ -26,6 +27,7 @@ public function getTotalNet(); /** *

TaxedItemPrice fields can not be used in query predicates.

* + * @return null|TypedMoney */ public function getTotalGross(); @@ -33,6 +35,7 @@ public function getTotalGross(); /** *

Calculated automatically as the subtraction of totalGross - totalNet.

* + * @return null|TypedMoney */ public function getTotalTax(); diff --git a/lib/commercetools-api/src/Models/Cart/TaxedItemPriceBuilder.php b/lib/commercetools-api/src/Models/Cart/TaxedItemPriceBuilder.php index 6d04766da29..254e13dc0a6 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedItemPriceBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedItemPriceBuilder.php @@ -23,21 +23,25 @@ final class TaxedItemPriceBuilder implements Builder { /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalNet; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalGross; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalTax; /** + * @return null|TypedMoney */ public function getTotalNet() @@ -48,6 +52,7 @@ public function getTotalNet() /** *

TaxedItemPrice fields can not be used in query predicates.

* + * @return null|TypedMoney */ public function getTotalGross() @@ -58,6 +63,7 @@ public function getTotalGross() /** *

Calculated automatically as the subtraction of totalGross - totalNet.

* + * @return null|TypedMoney */ public function getTotalTax() diff --git a/lib/commercetools-api/src/Models/Cart/TaxedItemPriceModel.php b/lib/commercetools-api/src/Models/Cart/TaxedItemPriceModel.php index 9e39c82d5d8..0587d550f0e 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedItemPriceModel.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedItemPriceModel.php @@ -22,16 +22,19 @@ final class TaxedItemPriceModel extends JsonObjectModel implements TaxedItemPrice { /** + * * @var ?TypedMoney */ protected $totalNet; /** + * * @var ?TypedMoney */ protected $totalGross; /** + * * @var ?TypedMoney */ protected $totalTax; @@ -51,6 +54,7 @@ public function __construct( } /** + * * @return null|TypedMoney */ public function getTotalNet() @@ -71,6 +75,7 @@ public function getTotalNet() /** *

TaxedItemPrice fields can not be used in query predicates.

* + * * @return null|TypedMoney */ public function getTotalGross() @@ -91,6 +96,7 @@ public function getTotalGross() /** *

Calculated automatically as the subtraction of totalGross - totalNet.

* + * * @return null|TypedMoney */ public function getTotalTax() diff --git a/lib/commercetools-api/src/Models/Cart/TaxedPrice.php b/lib/commercetools-api/src/Models/Cart/TaxedPrice.php index 3adb71ab3f4..887686be75e 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedPrice.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedPrice.php @@ -20,11 +20,13 @@ interface TaxedPrice extends JsonObject public const FIELD_TOTAL_TAX = 'totalTax'; /** + * @return null|TypedMoney */ public function getTotalNet(); /** + * @return null|TypedMoney */ public function getTotalGross(); @@ -32,6 +34,7 @@ public function getTotalGross(); /** *

TaxedPrice fields that can be used in query predicates: totalNet, totalGross.

* + * @return null|TaxPortionCollection */ public function getTaxPortions(); @@ -39,6 +42,7 @@ public function getTaxPortions(); /** *

Calculated automatically as the subtraction of totalGross - totalNet.

* + * @return null|TypedMoney */ public function getTotalTax(); diff --git a/lib/commercetools-api/src/Models/Cart/TaxedPriceBuilder.php b/lib/commercetools-api/src/Models/Cart/TaxedPriceBuilder.php index d094d548e30..4fde5eafa5e 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedPriceBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedPriceBuilder.php @@ -23,26 +23,31 @@ final class TaxedPriceBuilder implements Builder { /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalNet; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalGross; /** + * @var ?TaxPortionCollection */ private $taxPortions; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalTax; /** + * @return null|TypedMoney */ public function getTotalNet() @@ -51,6 +56,7 @@ public function getTotalNet() } /** + * @return null|TypedMoney */ public function getTotalGross() @@ -61,6 +67,7 @@ public function getTotalGross() /** *

TaxedPrice fields that can be used in query predicates: totalNet, totalGross.

* + * @return null|TaxPortionCollection */ public function getTaxPortions() @@ -71,6 +78,7 @@ public function getTaxPortions() /** *

Calculated automatically as the subtraction of totalGross - totalNet.

* + * @return null|TypedMoney */ public function getTotalTax() diff --git a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraft.php b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraft.php index 6837d91883e..6d74b5ae51a 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraft.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraft.php @@ -22,6 +22,7 @@ interface TaxedPriceDraft extends JsonObject *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getTotalNet(); @@ -30,11 +31,13 @@ public function getTotalNet(); *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getTotalGross(); /** + * @return null|TaxPortionDraftCollection */ public function getTaxPortions(); diff --git a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftBuilder.php index a7eac79cddd..8a281d0530f 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftBuilder.php @@ -23,16 +23,19 @@ final class TaxedPriceDraftBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $totalNet; /** + * @var null|Money|MoneyBuilder */ private $totalGross; /** + * @var ?TaxPortionDraftCollection */ private $taxPortions; @@ -41,6 +44,7 @@ final class TaxedPriceDraftBuilder implements Builder *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getTotalNet() @@ -52,6 +56,7 @@ public function getTotalNet() *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * @return null|Money */ public function getTotalGross() @@ -60,6 +65,7 @@ public function getTotalGross() } /** + * @return null|TaxPortionDraftCollection */ public function getTaxPortions() diff --git a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftModel.php b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftModel.php index 11e169b044f..c6703d03aed 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftModel.php @@ -22,16 +22,19 @@ final class TaxedPriceDraftModel extends JsonObjectModel implements TaxedPriceDraft { /** + * * @var ?Money */ protected $totalNet; /** + * * @var ?Money */ protected $totalGross; /** + * * @var ?TaxPortionDraftCollection */ protected $taxPortions; @@ -54,6 +57,7 @@ public function __construct( *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * * @return null|Money */ public function getTotalNet() @@ -75,6 +79,7 @@ public function getTotalNet() *

Draft type that stores amounts in cent precision for the specified currency.

*

For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

* + * * @return null|Money */ public function getTotalGross() @@ -93,6 +98,7 @@ public function getTotalGross() } /** + * * @return null|TaxPortionDraftCollection */ public function getTaxPortions() diff --git a/lib/commercetools-api/src/Models/Cart/TaxedPriceModel.php b/lib/commercetools-api/src/Models/Cart/TaxedPriceModel.php index 160c05810f9..bc9ad0e4d1b 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedPriceModel.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedPriceModel.php @@ -22,21 +22,25 @@ final class TaxedPriceModel extends JsonObjectModel implements TaxedPrice { /** + * * @var ?TypedMoney */ protected $totalNet; /** + * * @var ?TypedMoney */ protected $totalGross; /** + * * @var ?TaxPortionCollection */ protected $taxPortions; /** + * * @var ?TypedMoney */ protected $totalTax; @@ -58,6 +62,7 @@ public function __construct( } /** + * * @return null|TypedMoney */ public function getTotalNet() @@ -76,6 +81,7 @@ public function getTotalNet() } /** + * * @return null|TypedMoney */ public function getTotalGross() @@ -96,6 +102,7 @@ public function getTotalGross() /** *

TaxedPrice fields that can be used in query predicates: totalNet, totalGross.

* + * * @return null|TaxPortionCollection */ public function getTaxPortions() @@ -115,6 +122,7 @@ public function getTaxPortions() /** *

Calculated automatically as the subtraction of totalGross - totalNet.

* + * * @return null|TypedMoney */ public function getTotalTax() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscount.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscount.php index a8a7775475b..ecebcc2ce03 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscount.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscount.php @@ -40,6 +40,7 @@ interface CartDiscount extends BaseResource /** *

Unique identifier of the CartDiscount.

* + * @return null|string */ public function getId(); @@ -47,6 +48,7 @@ public function getId(); /** *

Current version of the CartDiscount.

* + * @return null|int */ public function getVersion(); @@ -54,6 +56,7 @@ public function getVersion(); /** *

Date and time (UTC) for the CartDiscount was initially created.

* + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -61,6 +64,7 @@ public function getCreatedAt(); /** *

Date and time (UTC) for the CartDiscount was last updated.

* + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -68,6 +72,7 @@ public function getLastModifiedAt(); /** *

Present on resources updated after 1 February 2019 except for events not tracked.

* + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -75,6 +80,7 @@ public function getLastModifiedBy(); /** *

Present on resources created after 1 February 2019 except for events not tracked.

* + * @return null|CreatedBy */ public function getCreatedBy(); @@ -82,6 +88,7 @@ public function getCreatedBy(); /** *

Name of the CartDiscount.

* + * @return null|LocalizedString */ public function getName(); @@ -89,6 +96,7 @@ public function getName(); /** *

User-defined unique identifier of the CartDiscount.

* + * @return null|string */ public function getKey(); @@ -96,6 +104,7 @@ public function getKey(); /** *

Description of the CartDiscount.

* + * @return null|LocalizedString */ public function getDescription(); @@ -103,6 +112,7 @@ public function getDescription(); /** *

Effect of the CartDiscount.

* + * @return null|CartDiscountValue */ public function getValue(); @@ -110,6 +120,7 @@ public function getValue(); /** *

Valid Cart Predicate.

* + * @return null|string */ public function getCartPredicate(); @@ -117,6 +128,7 @@ public function getCartPredicate(); /** *

Sets a CartDiscountTarget. Empty if value has type giftLineItem.

* + * @return null|CartDiscountTarget */ public function getTarget(); @@ -127,6 +139,7 @@ public function getTarget(); * A Discount with a higher sortOrder is prioritized. * The sort order is unambiguous among all CartDiscounts.

* + * @return null|string */ public function getSortOrder(); @@ -134,6 +147,7 @@ public function getSortOrder(); /** *

Indicates if the CartDiscount is active and can be applied to the Cart.

* + * @return null|bool */ public function getIsActive(); @@ -141,6 +155,7 @@ public function getIsActive(); /** *

Date and time (UTC) from which the Discount is effective.

* + * @return null|DateTimeImmutable */ public function getValidFrom(); @@ -148,6 +163,7 @@ public function getValidFrom(); /** *

Date and time (UTC) until which the Discount is effective.

* + * @return null|DateTimeImmutable */ public function getValidUntil(); @@ -155,6 +171,7 @@ public function getValidUntil(); /** *

Indicates if the Discount can be used in connection with a DiscountCode.

* + * @return null|bool */ public function getRequiresDiscountCode(); @@ -163,6 +180,7 @@ public function getRequiresDiscountCode(); *

References of all resources that are addressed in the predicate. * The API generates this array from the predicate.

* + * @return null|ReferenceCollection */ public function getReferences(); @@ -170,6 +188,7 @@ public function getReferences(); /** *

Indicates whether the application of the CartDiscount causes other discounts to be ignored.

* + * @return null|string */ public function getStackingMode(); @@ -177,6 +196,7 @@ public function getStackingMode(); /** *

Custom Fields of the CartDiscount.

* + * @return null|CustomFields */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountBuilder.php index aa41994f69e..d0988021332 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountBuilder.php @@ -33,101 +33,121 @@ final class CartDiscountBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var null|CartDiscountValue|CartDiscountValueBuilder */ private $value; /** + * @var ?string */ private $cartPredicate; /** + * @var null|CartDiscountTarget|CartDiscountTargetBuilder */ private $target; /** + * @var ?string */ private $sortOrder; /** + * @var ?bool */ private $isActive; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; /** + * @var ?bool */ private $requiresDiscountCode; /** + * @var ?ReferenceCollection */ private $references; /** + * @var ?string */ private $stackingMode; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; @@ -135,6 +155,7 @@ final class CartDiscountBuilder implements Builder /** *

Unique identifier of the CartDiscount.

* + * @return null|string */ public function getId() @@ -145,6 +166,7 @@ public function getId() /** *

Current version of the CartDiscount.

* + * @return null|int */ public function getVersion() @@ -155,6 +177,7 @@ public function getVersion() /** *

Date and time (UTC) for the CartDiscount was initially created.

* + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -165,6 +188,7 @@ public function getCreatedAt() /** *

Date and time (UTC) for the CartDiscount was last updated.

* + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -175,6 +199,7 @@ public function getLastModifiedAt() /** *

Present on resources updated after 1 February 2019 except for events not tracked.

* + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -185,6 +210,7 @@ public function getLastModifiedBy() /** *

Present on resources created after 1 February 2019 except for events not tracked.

* + * @return null|CreatedBy */ public function getCreatedBy() @@ -195,6 +221,7 @@ public function getCreatedBy() /** *

Name of the CartDiscount.

* + * @return null|LocalizedString */ public function getName() @@ -205,6 +232,7 @@ public function getName() /** *

User-defined unique identifier of the CartDiscount.

* + * @return null|string */ public function getKey() @@ -215,6 +243,7 @@ public function getKey() /** *

Description of the CartDiscount.

* + * @return null|LocalizedString */ public function getDescription() @@ -225,6 +254,7 @@ public function getDescription() /** *

Effect of the CartDiscount.

* + * @return null|CartDiscountValue */ public function getValue() @@ -235,6 +265,7 @@ public function getValue() /** *

Valid Cart Predicate.

* + * @return null|string */ public function getCartPredicate() @@ -245,6 +276,7 @@ public function getCartPredicate() /** *

Sets a CartDiscountTarget. Empty if value has type giftLineItem.

* + * @return null|CartDiscountTarget */ public function getTarget() @@ -258,6 +290,7 @@ public function getTarget() * A Discount with a higher sortOrder is prioritized. * The sort order is unambiguous among all CartDiscounts.

* + * @return null|string */ public function getSortOrder() @@ -268,6 +301,7 @@ public function getSortOrder() /** *

Indicates if the CartDiscount is active and can be applied to the Cart.

* + * @return null|bool */ public function getIsActive() @@ -278,6 +312,7 @@ public function getIsActive() /** *

Date and time (UTC) from which the Discount is effective.

* + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -288,6 +323,7 @@ public function getValidFrom() /** *

Date and time (UTC) until which the Discount is effective.

* + * @return null|DateTimeImmutable */ public function getValidUntil() @@ -298,6 +334,7 @@ public function getValidUntil() /** *

Indicates if the Discount can be used in connection with a DiscountCode.

* + * @return null|bool */ public function getRequiresDiscountCode() @@ -309,6 +346,7 @@ public function getRequiresDiscountCode() *

References of all resources that are addressed in the predicate. * The API generates this array from the predicate.

* + * @return null|ReferenceCollection */ public function getReferences() @@ -319,6 +357,7 @@ public function getReferences() /** *

Indicates whether the application of the CartDiscount causes other discounts to be ignored.

* + * @return null|string */ public function getStackingMode() @@ -329,6 +368,7 @@ public function getStackingMode() /** *

Custom Fields of the CartDiscount.

* + * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeCartPredicateAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeCartPredicateAction.php index f5548c79840..083b3f01c63 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeCartPredicateAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeCartPredicateAction.php @@ -18,6 +18,7 @@ interface CartDiscountChangeCartPredicateAction extends CartDiscountUpdateAction /** *

New value to set.

* + * @return null|string */ public function getCartPredicate(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeCartPredicateActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeCartPredicateActionBuilder.php index ae4f5d4e4b6..ef839c07681 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeCartPredicateActionBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeCartPredicateActionBuilder.php @@ -21,6 +21,7 @@ final class CartDiscountChangeCartPredicateActionBuilder implements Builder { /** + * @var ?string */ private $cartPredicate; @@ -28,6 +29,7 @@ final class CartDiscountChangeCartPredicateActionBuilder implements Builder /** *

New value to set.

* + * @return null|string */ public function getCartPredicate() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeCartPredicateActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeCartPredicateActionModel.php index 632114ec22d..b5204b3fbe9 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeCartPredicateActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeCartPredicateActionModel.php @@ -21,11 +21,13 @@ final class CartDiscountChangeCartPredicateActionModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'changeCartPredicate'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $cartPredicate; @@ -35,13 +37,15 @@ final class CartDiscountChangeCartPredicateActionModel extends JsonObjectModel i * @psalm-suppress MissingParamType */ public function __construct( - ?string $cartPredicate = null + ?string $cartPredicate = null, + ?string $action = null ) { $this->cartPredicate = $cartPredicate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

New value to set.

* + * * @return null|string */ public function getCartPredicate() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveAction.php index d363ed969da..f6323511454 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveAction.php @@ -19,6 +19,7 @@ interface CartDiscountChangeIsActiveAction extends CartDiscountUpdateAction *

New value to set. * If set to true, the Discount will be applied to the Cart.

* + * @return null|bool */ public function getIsActive(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveActionBuilder.php index 699bb195a51..cc2c50d7c02 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveActionBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveActionBuilder.php @@ -21,6 +21,7 @@ final class CartDiscountChangeIsActiveActionBuilder implements Builder { /** + * @var ?bool */ private $isActive; @@ -29,6 +30,7 @@ final class CartDiscountChangeIsActiveActionBuilder implements Builder *

New value to set. * If set to true, the Discount will be applied to the Cart.

* + * @return null|bool */ public function getIsActive() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveActionModel.php index d0ff247cc42..1dc3c3dd1c6 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveActionModel.php @@ -21,11 +21,13 @@ final class CartDiscountChangeIsActiveActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'changeIsActive'; /** + * * @var ?string */ protected $action; /** + * * @var ?bool */ protected $isActive; @@ -35,13 +37,15 @@ final class CartDiscountChangeIsActiveActionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?bool $isActive = null + ?bool $isActive = null, + ?string $action = null ) { $this->isActive = $isActive; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() *

New value to set. * If set to true, the Discount will be applied to the Cart.

* + * * @return null|bool */ public function getIsActive() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeNameAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeNameAction.php index 85047e6f4c2..167304f3c93 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeNameAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeNameAction.php @@ -19,6 +19,7 @@ interface CartDiscountChangeNameAction extends CartDiscountUpdateAction /** *

New value to set.

* + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeNameActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeNameActionBuilder.php index cf0c708c0fa..57920a92008 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeNameActionBuilder.php @@ -23,6 +23,7 @@ final class CartDiscountChangeNameActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; @@ -30,6 +31,7 @@ final class CartDiscountChangeNameActionBuilder implements Builder /** *

New value to set.

* + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeNameActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeNameActionModel.php index 0d4f919a018..318447f36e1 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeNameActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeNameActionModel.php @@ -23,11 +23,13 @@ final class CartDiscountChangeNameActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'changeName'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $name; @@ -37,13 +39,15 @@ final class CartDiscountChangeNameActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

New value to set.

* + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeRequiresDiscountCodeAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeRequiresDiscountCodeAction.php index 9d92974953f..8f14787cee1 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeRequiresDiscountCodeAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeRequiresDiscountCodeAction.php @@ -19,6 +19,7 @@ interface CartDiscountChangeRequiresDiscountCodeAction extends CartDiscountUpdat *

New value to set. * If set to true, the Discount can only be used in connection with a DiscountCode.

* + * @return null|bool */ public function getRequiresDiscountCode(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeRequiresDiscountCodeActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeRequiresDiscountCodeActionBuilder.php index cf3ed468071..dfc28496c05 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeRequiresDiscountCodeActionBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeRequiresDiscountCodeActionBuilder.php @@ -21,6 +21,7 @@ final class CartDiscountChangeRequiresDiscountCodeActionBuilder implements Builder { /** + * @var ?bool */ private $requiresDiscountCode; @@ -29,6 +30,7 @@ final class CartDiscountChangeRequiresDiscountCodeActionBuilder implements Build *

New value to set. * If set to true, the Discount can only be used in connection with a DiscountCode.

* + * @return null|bool */ public function getRequiresDiscountCode() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeRequiresDiscountCodeActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeRequiresDiscountCodeActionModel.php index 22e870d0a14..52f78ca1901 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeRequiresDiscountCodeActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeRequiresDiscountCodeActionModel.php @@ -21,11 +21,13 @@ final class CartDiscountChangeRequiresDiscountCodeActionModel extends JsonObject { public const DISCRIMINATOR_VALUE = 'changeRequiresDiscountCode'; /** + * * @var ?string */ protected $action; /** + * * @var ?bool */ protected $requiresDiscountCode; @@ -35,13 +37,15 @@ final class CartDiscountChangeRequiresDiscountCodeActionModel extends JsonObject * @psalm-suppress MissingParamType */ public function __construct( - ?bool $requiresDiscountCode = null + ?bool $requiresDiscountCode = null, + ?string $action = null ) { $this->requiresDiscountCode = $requiresDiscountCode; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() *

New value to set. * If set to true, the Discount can only be used in connection with a DiscountCode.

* + * * @return null|bool */ public function getRequiresDiscountCode() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeSortOrderAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeSortOrderAction.php index d59d0c42ff5..8af3d4006b6 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeSortOrderAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeSortOrderAction.php @@ -19,6 +19,7 @@ interface CartDiscountChangeSortOrderAction extends CartDiscountUpdateAction *

New value to set (between 0 and 1). * A Discount with a higher sortOrder is prioritized.

* + * @return null|string */ public function getSortOrder(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeSortOrderActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeSortOrderActionBuilder.php index 0841d4f8cc8..4ddb9c79175 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeSortOrderActionBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeSortOrderActionBuilder.php @@ -21,6 +21,7 @@ final class CartDiscountChangeSortOrderActionBuilder implements Builder { /** + * @var ?string */ private $sortOrder; @@ -29,6 +30,7 @@ final class CartDiscountChangeSortOrderActionBuilder implements Builder *

New value to set (between 0 and 1). * A Discount with a higher sortOrder is prioritized.

* + * @return null|string */ public function getSortOrder() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeSortOrderActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeSortOrderActionModel.php index 2708c08c004..d715bc4d80e 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeSortOrderActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeSortOrderActionModel.php @@ -21,11 +21,13 @@ final class CartDiscountChangeSortOrderActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'changeSortOrder'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $sortOrder; @@ -35,13 +37,15 @@ final class CartDiscountChangeSortOrderActionModel extends JsonObjectModel imple * @psalm-suppress MissingParamType */ public function __construct( - ?string $sortOrder = null + ?string $sortOrder = null, + ?string $action = null ) { $this->sortOrder = $sortOrder; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() *

New value to set (between 0 and 1). * A Discount with a higher sortOrder is prioritized.

* + * * @return null|string */ public function getSortOrder() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeStackingModeAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeStackingModeAction.php index 237eba12576..a1167372787 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeStackingModeAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeStackingModeAction.php @@ -18,6 +18,7 @@ interface CartDiscountChangeStackingModeAction extends CartDiscountUpdateAction /** *

New value to set.

* + * @return null|string */ public function getStackingMode(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeStackingModeActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeStackingModeActionBuilder.php index f0ebf4bdffa..593a32af778 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeStackingModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeStackingModeActionBuilder.php @@ -21,6 +21,7 @@ final class CartDiscountChangeStackingModeActionBuilder implements Builder { /** + * @var ?string */ private $stackingMode; @@ -28,6 +29,7 @@ final class CartDiscountChangeStackingModeActionBuilder implements Builder /** *

New value to set.

* + * @return null|string */ public function getStackingMode() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeStackingModeActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeStackingModeActionModel.php index 74584a6dfab..3a83189bd51 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeStackingModeActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeStackingModeActionModel.php @@ -21,11 +21,13 @@ final class CartDiscountChangeStackingModeActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'changeStackingMode'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $stackingMode; @@ -35,13 +37,15 @@ final class CartDiscountChangeStackingModeActionModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?string $stackingMode = null + ?string $stackingMode = null, + ?string $action = null ) { $this->stackingMode = $stackingMode; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

New value to set.

* + * * @return null|string */ public function getStackingMode() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeTargetAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeTargetAction.php index a7f4f1b3f7c..21443469112 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeTargetAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeTargetAction.php @@ -18,6 +18,7 @@ interface CartDiscountChangeTargetAction extends CartDiscountUpdateAction /** *

New value to set.

* + * @return null|CartDiscountTarget */ public function getTarget(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeTargetActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeTargetActionBuilder.php index 4d3963d2060..26726be0460 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeTargetActionBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeTargetActionBuilder.php @@ -21,6 +21,7 @@ final class CartDiscountChangeTargetActionBuilder implements Builder { /** + * @var null|CartDiscountTarget|CartDiscountTargetBuilder */ private $target; @@ -28,6 +29,7 @@ final class CartDiscountChangeTargetActionBuilder implements Builder /** *

New value to set.

* + * @return null|CartDiscountTarget */ public function getTarget() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeTargetActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeTargetActionModel.php index ad5e730e641..07e01e83c35 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeTargetActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeTargetActionModel.php @@ -21,11 +21,13 @@ final class CartDiscountChangeTargetActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'changeTarget'; /** + * * @var ?string */ protected $action; /** + * * @var ?CartDiscountTarget */ protected $target; @@ -35,13 +37,15 @@ final class CartDiscountChangeTargetActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?CartDiscountTarget $target = null + ?CartDiscountTarget $target = null, + ?string $action = null ) { $this->target = $target; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

New value to set.

* + * * @return null|CartDiscountTarget */ public function getTarget() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueAction.php index 49a14774392..2536ed89176 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueAction.php @@ -18,6 +18,7 @@ interface CartDiscountChangeValueAction extends CartDiscountUpdateAction /** *

New value to set.

* + * @return null|CartDiscountValueDraft */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueActionBuilder.php index 9429928fdd5..12d702bc6e1 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueActionBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueActionBuilder.php @@ -21,6 +21,7 @@ final class CartDiscountChangeValueActionBuilder implements Builder { /** + * @var null|CartDiscountValueDraft|CartDiscountValueDraftBuilder */ private $value; @@ -28,6 +29,7 @@ final class CartDiscountChangeValueActionBuilder implements Builder /** *

New value to set.

* + * @return null|CartDiscountValueDraft */ public function getValue() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueActionModel.php index c382ccfe19b..e7378b89dca 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueActionModel.php @@ -21,11 +21,13 @@ final class CartDiscountChangeValueActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'changeValue'; /** + * * @var ?string */ protected $action; /** + * * @var ?CartDiscountValueDraft */ protected $value; @@ -35,13 +37,15 @@ final class CartDiscountChangeValueActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?CartDiscountValueDraft $value = null + ?CartDiscountValueDraft $value = null, + ?string $action = null ) { $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

New value to set.

* + * * @return null|CartDiscountValueDraft */ public function getValue() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountCustomLineItemsTarget.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountCustomLineItemsTarget.php index 414bb769aba..cb595263851 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountCustomLineItemsTarget.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountCustomLineItemsTarget.php @@ -18,6 +18,7 @@ interface CartDiscountCustomLineItemsTarget extends CartDiscountTarget /** *

Valid CustomLineItem target predicate.

* + * @return null|string */ public function getPredicate(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountCustomLineItemsTargetBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountCustomLineItemsTargetBuilder.php index 827c6f0dc2f..8e51303d1af 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountCustomLineItemsTargetBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountCustomLineItemsTargetBuilder.php @@ -21,6 +21,7 @@ final class CartDiscountCustomLineItemsTargetBuilder implements Builder { /** + * @var ?string */ private $predicate; @@ -28,6 +29,7 @@ final class CartDiscountCustomLineItemsTargetBuilder implements Builder /** *

Valid CustomLineItem target predicate.

* + * @return null|string */ public function getPredicate() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountCustomLineItemsTargetModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountCustomLineItemsTargetModel.php index 4dd720fcf55..49730d6db1e 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountCustomLineItemsTargetModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountCustomLineItemsTargetModel.php @@ -21,11 +21,13 @@ final class CartDiscountCustomLineItemsTargetModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'customLineItems'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $predicate; @@ -35,13 +37,15 @@ final class CartDiscountCustomLineItemsTargetModel extends JsonObjectModel imple * @psalm-suppress MissingParamType */ public function __construct( - ?string $predicate = null + ?string $predicate = null, + ?string $type = null ) { $this->predicate = $predicate; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() /** *

Valid CustomLineItem target predicate.

* + * * @return null|string */ public function getPredicate() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraft.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraft.php index 6e8ebe078cd..dea5120cb4e 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraft.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraft.php @@ -33,6 +33,7 @@ interface CartDiscountDraft extends JsonObject /** *

Name of the CartDiscount.

* + * @return null|LocalizedString */ public function getName(); @@ -40,6 +41,7 @@ public function getName(); /** *

User-defined unique identifier for the CartDiscount.

* + * @return null|string */ public function getKey(); @@ -47,6 +49,7 @@ public function getKey(); /** *

Description of the CartDiscount.

* + * @return null|LocalizedString */ public function getDescription(); @@ -55,6 +58,7 @@ public function getDescription(); *

Effect of the CartDiscount. * For a target, relative or absolute discount values, or a fixed item price value can be specified. If no target is specified, a gift line item can be added to the cart.

* + * @return null|CartDiscountValueDraft */ public function getValue(); @@ -62,6 +66,7 @@ public function getValue(); /** *

Valid Cart Predicate.

* + * @return null|string */ public function getCartPredicate(); @@ -69,6 +74,7 @@ public function getCartPredicate(); /** *

Must not be set when the value has type giftLineItem, otherwise a CartDiscountTarget must be set.

* + * @return null|CartDiscountTarget */ public function getTarget(); @@ -78,6 +84,7 @@ public function getTarget(); * A Discount with a higher sortOrder is prioritized. * The sort order must be unambiguous among all CartDiscounts.

* + * @return null|string */ public function getSortOrder(); @@ -85,6 +92,7 @@ public function getSortOrder(); /** *

Only active Discounts can be applied to the Cart.

* + * @return null|bool */ public function getIsActive(); @@ -92,6 +100,7 @@ public function getIsActive(); /** *

Date and time (UTC) from which the Discount is effective.

* + * @return null|DateTimeImmutable */ public function getValidFrom(); @@ -99,6 +108,7 @@ public function getValidFrom(); /** *

Date and time (UTC) until which the Discount is effective.

* + * @return null|DateTimeImmutable */ public function getValidUntil(); @@ -106,6 +116,7 @@ public function getValidUntil(); /** *

States whether the Discount can only be used in a connection with a DiscountCode.

* + * @return null|bool */ public function getRequiresDiscountCode(); @@ -113,6 +124,7 @@ public function getRequiresDiscountCode(); /** *

Specifies whether the application of this discount causes the following discounts to be ignored.

* + * @return null|string */ public function getStackingMode(); @@ -120,6 +132,7 @@ public function getStackingMode(); /** *

Custom Fields of the CartDiscount.

* + * @return null|CustomFieldsDraft */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftBuilder.php index a2c15124cdf..06d17dad6d3 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftBuilder.php @@ -26,66 +26,79 @@ final class CartDiscountDraftBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var null|CartDiscountValueDraft|CartDiscountValueDraftBuilder */ private $value; /** + * @var ?string */ private $cartPredicate; /** + * @var null|CartDiscountTarget|CartDiscountTargetBuilder */ private $target; /** + * @var ?string */ private $sortOrder; /** + * @var ?bool */ private $isActive; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; /** + * @var ?bool */ private $requiresDiscountCode; /** + * @var ?string */ private $stackingMode; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; @@ -93,6 +106,7 @@ final class CartDiscountDraftBuilder implements Builder /** *

Name of the CartDiscount.

* + * @return null|LocalizedString */ public function getName() @@ -103,6 +117,7 @@ public function getName() /** *

User-defined unique identifier for the CartDiscount.

* + * @return null|string */ public function getKey() @@ -113,6 +128,7 @@ public function getKey() /** *

Description of the CartDiscount.

* + * @return null|LocalizedString */ public function getDescription() @@ -124,6 +140,7 @@ public function getDescription() *

Effect of the CartDiscount. * For a target, relative or absolute discount values, or a fixed item price value can be specified. If no target is specified, a gift line item can be added to the cart.

* + * @return null|CartDiscountValueDraft */ public function getValue() @@ -134,6 +151,7 @@ public function getValue() /** *

Valid Cart Predicate.

* + * @return null|string */ public function getCartPredicate() @@ -144,6 +162,7 @@ public function getCartPredicate() /** *

Must not be set when the value has type giftLineItem, otherwise a CartDiscountTarget must be set.

* + * @return null|CartDiscountTarget */ public function getTarget() @@ -156,6 +175,7 @@ public function getTarget() * A Discount with a higher sortOrder is prioritized. * The sort order must be unambiguous among all CartDiscounts.

* + * @return null|string */ public function getSortOrder() @@ -166,6 +186,7 @@ public function getSortOrder() /** *

Only active Discounts can be applied to the Cart.

* + * @return null|bool */ public function getIsActive() @@ -176,6 +197,7 @@ public function getIsActive() /** *

Date and time (UTC) from which the Discount is effective.

* + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -186,6 +208,7 @@ public function getValidFrom() /** *

Date and time (UTC) until which the Discount is effective.

* + * @return null|DateTimeImmutable */ public function getValidUntil() @@ -196,6 +219,7 @@ public function getValidUntil() /** *

States whether the Discount can only be used in a connection with a DiscountCode.

* + * @return null|bool */ public function getRequiresDiscountCode() @@ -206,6 +230,7 @@ public function getRequiresDiscountCode() /** *

Specifies whether the application of this discount causes the following discounts to be ignored.

* + * @return null|string */ public function getStackingMode() @@ -216,6 +241,7 @@ public function getStackingMode() /** *

Custom Fields of the CartDiscount.

* + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftModel.php index 03df3cbf254..05acd8c5e95 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftModel.php @@ -25,66 +25,79 @@ final class CartDiscountDraftModel extends JsonObjectModel implements CartDiscountDraft { /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?CartDiscountValueDraft */ protected $value; /** + * * @var ?string */ protected $cartPredicate; /** + * * @var ?CartDiscountTarget */ protected $target; /** + * * @var ?string */ protected $sortOrder; /** + * * @var ?bool */ protected $isActive; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; /** + * * @var ?bool */ protected $requiresDiscountCode; /** + * * @var ?string */ protected $stackingMode; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -126,6 +139,7 @@ public function __construct( /** *

Name of the CartDiscount.

* + * * @return null|LocalizedString */ public function getName() @@ -146,6 +160,7 @@ public function getName() /** *

User-defined unique identifier for the CartDiscount.

* + * * @return null|string */ public function getKey() @@ -165,6 +180,7 @@ public function getKey() /** *

Description of the CartDiscount.

* + * * @return null|LocalizedString */ public function getDescription() @@ -186,6 +202,7 @@ public function getDescription() *

Effect of the CartDiscount. * For a target, relative or absolute discount values, or a fixed item price value can be specified. If no target is specified, a gift line item can be added to the cart.

* + * * @return null|CartDiscountValueDraft */ public function getValue() @@ -206,6 +223,7 @@ public function getValue() /** *

Valid Cart Predicate.

* + * * @return null|string */ public function getCartPredicate() @@ -225,6 +243,7 @@ public function getCartPredicate() /** *

Must not be set when the value has type giftLineItem, otherwise a CartDiscountTarget must be set.

* + * * @return null|CartDiscountTarget */ public function getTarget() @@ -247,6 +266,7 @@ public function getTarget() * A Discount with a higher sortOrder is prioritized. * The sort order must be unambiguous among all CartDiscounts.

* + * * @return null|string */ public function getSortOrder() @@ -266,6 +286,7 @@ public function getSortOrder() /** *

Only active Discounts can be applied to the Cart.

* + * * @return null|bool */ public function getIsActive() @@ -285,6 +306,7 @@ public function getIsActive() /** *

Date and time (UTC) from which the Discount is effective.

* + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -308,6 +330,7 @@ public function getValidFrom() /** *

Date and time (UTC) until which the Discount is effective.

* + * * @return null|DateTimeImmutable */ public function getValidUntil() @@ -331,6 +354,7 @@ public function getValidUntil() /** *

States whether the Discount can only be used in a connection with a DiscountCode.

* + * * @return null|bool */ public function getRequiresDiscountCode() @@ -350,6 +374,7 @@ public function getRequiresDiscountCode() /** *

Specifies whether the application of this discount causes the following discounts to be ignored.

* + * * @return null|string */ public function getStackingMode() @@ -369,6 +394,7 @@ public function getStackingMode() /** *

Custom Fields of the CartDiscount.

* + * * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountLineItemsTarget.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountLineItemsTarget.php index 2bff399711b..4d7a6a68639 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountLineItemsTarget.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountLineItemsTarget.php @@ -18,6 +18,7 @@ interface CartDiscountLineItemsTarget extends CartDiscountTarget /** *

Valid LineItem target predicate.

* + * @return null|string */ public function getPredicate(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountLineItemsTargetBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountLineItemsTargetBuilder.php index 52b5b2b646b..769590f1cf5 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountLineItemsTargetBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountLineItemsTargetBuilder.php @@ -21,6 +21,7 @@ final class CartDiscountLineItemsTargetBuilder implements Builder { /** + * @var ?string */ private $predicate; @@ -28,6 +29,7 @@ final class CartDiscountLineItemsTargetBuilder implements Builder /** *

Valid LineItem target predicate.

* + * @return null|string */ public function getPredicate() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountLineItemsTargetModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountLineItemsTargetModel.php index 55cf3401634..9e06a4bf33e 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountLineItemsTargetModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountLineItemsTargetModel.php @@ -21,11 +21,13 @@ final class CartDiscountLineItemsTargetModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'lineItems'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $predicate; @@ -35,13 +37,15 @@ final class CartDiscountLineItemsTargetModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $predicate = null + ?string $predicate = null, + ?string $type = null ) { $this->predicate = $predicate; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() /** *

Valid LineItem target predicate.

* + * * @return null|string */ public function getPredicate() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountModel.php index d33e1e94aef..c856e302bb0 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountModel.php @@ -32,101 +32,121 @@ final class CartDiscountModel extends JsonObjectModel implements CartDiscount { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?CartDiscountValue */ protected $value; /** + * * @var ?string */ protected $cartPredicate; /** + * * @var ?CartDiscountTarget */ protected $target; /** + * * @var ?string */ protected $sortOrder; /** + * * @var ?bool */ protected $isActive; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; /** + * * @var ?bool */ protected $requiresDiscountCode; /** + * * @var ?ReferenceCollection */ protected $references; /** + * * @var ?string */ protected $stackingMode; /** + * * @var ?CustomFields */ protected $custom; @@ -182,6 +202,7 @@ public function __construct( /** *

Unique identifier of the CartDiscount.

* + * * @return null|string */ public function getId() @@ -201,6 +222,7 @@ public function getId() /** *

Current version of the CartDiscount.

* + * * @return null|int */ public function getVersion() @@ -220,6 +242,7 @@ public function getVersion() /** *

Date and time (UTC) for the CartDiscount was initially created.

* + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -243,6 +266,7 @@ public function getCreatedAt() /** *

Date and time (UTC) for the CartDiscount was last updated.

* + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -266,6 +290,7 @@ public function getLastModifiedAt() /** *

Present on resources updated after 1 February 2019 except for events not tracked.

* + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -286,6 +311,7 @@ public function getLastModifiedBy() /** *

Present on resources created after 1 February 2019 except for events not tracked.

* + * * @return null|CreatedBy */ public function getCreatedBy() @@ -306,6 +332,7 @@ public function getCreatedBy() /** *

Name of the CartDiscount.

* + * * @return null|LocalizedString */ public function getName() @@ -326,6 +353,7 @@ public function getName() /** *

User-defined unique identifier of the CartDiscount.

* + * * @return null|string */ public function getKey() @@ -345,6 +373,7 @@ public function getKey() /** *

Description of the CartDiscount.

* + * * @return null|LocalizedString */ public function getDescription() @@ -365,6 +394,7 @@ public function getDescription() /** *

Effect of the CartDiscount.

* + * * @return null|CartDiscountValue */ public function getValue() @@ -385,6 +415,7 @@ public function getValue() /** *

Valid Cart Predicate.

* + * * @return null|string */ public function getCartPredicate() @@ -404,6 +435,7 @@ public function getCartPredicate() /** *

Sets a CartDiscountTarget. Empty if value has type giftLineItem.

* + * * @return null|CartDiscountTarget */ public function getTarget() @@ -427,6 +459,7 @@ public function getTarget() * A Discount with a higher sortOrder is prioritized. * The sort order is unambiguous among all CartDiscounts.

* + * * @return null|string */ public function getSortOrder() @@ -446,6 +479,7 @@ public function getSortOrder() /** *

Indicates if the CartDiscount is active and can be applied to the Cart.

* + * * @return null|bool */ public function getIsActive() @@ -465,6 +499,7 @@ public function getIsActive() /** *

Date and time (UTC) from which the Discount is effective.

* + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -488,6 +523,7 @@ public function getValidFrom() /** *

Date and time (UTC) until which the Discount is effective.

* + * * @return null|DateTimeImmutable */ public function getValidUntil() @@ -511,6 +547,7 @@ public function getValidUntil() /** *

Indicates if the Discount can be used in connection with a DiscountCode.

* + * * @return null|bool */ public function getRequiresDiscountCode() @@ -531,6 +568,7 @@ public function getRequiresDiscountCode() *

References of all resources that are addressed in the predicate. * The API generates this array from the predicate.

* + * * @return null|ReferenceCollection */ public function getReferences() @@ -550,6 +588,7 @@ public function getReferences() /** *

Indicates whether the application of the CartDiscount causes other discounts to be ignored.

* + * * @return null|string */ public function getStackingMode() @@ -569,6 +608,7 @@ public function getStackingMode() /** *

Custom Fields of the CartDiscount.

* + * * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountPagedQueryResponse.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountPagedQueryResponse.php index 155106f4536..b889a8b578d 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountPagedQueryResponse.php @@ -22,6 +22,7 @@ interface CartDiscountPagedQueryResponse extends JsonObject /** *

Number of results requested.

* + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

Number of elements skipped.

* + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

Actual number of results returned.

* + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

* + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

CartDiscounts matching the query.

* + * @return null|CartDiscountCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountPagedQueryResponseBuilder.php index 2f604ad7e20..20fab050941 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class CartDiscountPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?CartDiscountCollection */ private $results; @@ -48,6 +53,7 @@ final class CartDiscountPagedQueryResponseBuilder implements Builder /** *

Number of results requested.

* + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

Number of elements skipped.

* + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

Actual number of results returned.

* + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

* + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

CartDiscounts matching the query.

* + * @return null|CartDiscountCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountPagedQueryResponseModel.php index 316e9292826..4568bef9a1d 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class CartDiscountPagedQueryResponseModel extends JsonObjectModel implements CartDiscountPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?CartDiscountCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

Number of results requested.

* + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

Number of elements skipped.

* + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

Actual number of results returned.

* + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

* + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

CartDiscounts matching the query.

* + * * @return null|CartDiscountCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountReference.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountReference.php index bfd48496920..5005d181071 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountReference.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountReference.php @@ -19,6 +19,7 @@ interface CartDiscountReference extends Reference /** *

Contains the representation of the expanded CartDiscount. Only present in responses to requests with Reference Expansion for CartDiscounts.

* + * @return null|CartDiscount */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

Unique identifier of the referenced CartDiscount.

* + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountReferenceBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountReferenceBuilder.php index 2c4752027ae..99c6ce58abe 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountReferenceBuilder.php @@ -23,11 +23,13 @@ final class CartDiscountReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|CartDiscount|CartDiscountBuilder */ private $obj; @@ -35,6 +37,7 @@ final class CartDiscountReferenceBuilder implements Builder /** *

Unique identifier of the referenced CartDiscount.

* + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

Contains the representation of the expanded CartDiscount. Only present in responses to requests with Reference Expansion for CartDiscounts.

* + * @return null|CartDiscount */ public function getObj() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountReferenceModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountReferenceModel.php index 22f10e5228f..2e6c0a600da 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountReferenceModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountReferenceModel.php @@ -23,16 +23,19 @@ final class CartDiscountReferenceModel extends JsonObjectModel implements CartDi { public const DISCRIMINATOR_VALUE = 'cart-discount'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?CartDiscount */ protected $obj; @@ -43,16 +46,18 @@ final class CartDiscountReferenceModel extends JsonObjectModel implements CartDi */ public function __construct( ?string $id = null, - ?CartDiscount $obj = null + ?CartDiscount $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

Type of referenced resource.

* + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

Unique identifier of the referenced CartDiscount.

* + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

Contains the representation of the expanded CartDiscount. Only present in responses to requests with Reference Expansion for CartDiscounts.

* + * * @return null|CartDiscount */ public function getObj() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountResourceIdentifier.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountResourceIdentifier.php index cb56b869d0e..67a89af7eb2 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountResourceIdentifier.php @@ -17,6 +17,7 @@ interface CartDiscountResourceIdentifier extends ResourceIdentifier /** *

Unique identifier of the referenced CartDiscount. Either id or key is required.

* + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

User-defined unique identifier of the referenced CartDiscount. Either id or key is required.

* + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountResourceIdentifierBuilder.php index a2030844b3f..04247bd82e1 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class CartDiscountResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class CartDiscountResourceIdentifierBuilder implements Builder /** *

Unique identifier of the referenced CartDiscount. Either id or key is required.

* + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

User-defined unique identifier of the referenced CartDiscount. Either id or key is required.

* + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountResourceIdentifierModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountResourceIdentifierModel.php index 113279c6c06..8139ecd1ee7 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class CartDiscountResourceIdentifierModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'cart-discount'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class CartDiscountResourceIdentifierModel extends JsonObjectModel implemen */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

* + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

Unique identifier of the referenced CartDiscount. Either id or key is required.

* + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

User-defined unique identifier of the referenced CartDiscount. Either id or key is required.

* + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomFieldAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomFieldAction.php index f439aad7f1d..0d9665d003d 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface CartDiscountSetCustomFieldAction extends CartDiscountUpdateAction /** *

Name of the Custom Field.

* + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomFieldActionBuilder.php index bd4d63e4feb..1de8bd41fe8 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class CartDiscountSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class CartDiscountSetCustomFieldActionBuilder implements Builder /** *

Name of the Custom Field.

* + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomFieldActionModel.php index 5886fa05258..b4fa8a25cbe 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class CartDiscountSetCustomFieldActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class CartDiscountSetCustomFieldActionModel extends JsonObjectModel implem */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

Name of the Custom Field.

* + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomTypeAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomTypeAction.php index c48e5c06c7e..f8f7abd1806 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface CartDiscountSetCustomTypeAction extends CartDiscountUpdateAction *

Defines the Type that extends the CartDiscount with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CartDiscount.

* + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

Sets the Custom Fields fields for the CartDiscount.

* + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomTypeActionBuilder.php index 58d5d4afaa1..e7b0bab03a9 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class CartDiscountSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class CartDiscountSetCustomTypeActionBuilder implements Builder *

Defines the Type that extends the CartDiscount with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CartDiscount.

* + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

Sets the Custom Fields fields for the CartDiscount.

* + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomTypeActionModel.php index 111589c912b..0caeb578c69 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class CartDiscountSetCustomTypeActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class CartDiscountSetCustomTypeActionModel extends JsonObjectModel impleme */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

Defines the Type that extends the CartDiscount with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CartDiscount.

* + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

Sets the Custom Fields fields for the CartDiscount.

* + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetDescriptionAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetDescriptionAction.php index ec03485e9dd..cad3195e9c8 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetDescriptionAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetDescriptionAction.php @@ -19,6 +19,7 @@ interface CartDiscountSetDescriptionAction extends CartDiscountUpdateAction /** *

Value to set. If empty, any existing value will be removed.

* + * @return null|LocalizedString */ public function getDescription(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetDescriptionActionBuilder.php index ee1d49d3fc5..17f5409e8a0 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetDescriptionActionBuilder.php @@ -23,6 +23,7 @@ final class CartDiscountSetDescriptionActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; @@ -30,6 +31,7 @@ final class CartDiscountSetDescriptionActionBuilder implements Builder /** *

Value to set. If empty, any existing value will be removed.

* + * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetDescriptionActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetDescriptionActionModel.php index 7d950210324..f07f1edbbe9 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetDescriptionActionModel.php @@ -23,11 +23,13 @@ final class CartDiscountSetDescriptionActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $description; @@ -37,13 +39,15 @@ final class CartDiscountSetDescriptionActionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $description = null + ?LocalizedString $description = null, + ?string $action = null ) { $this->description = $description; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

Value to set. If empty, any existing value will be removed.

* + * * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetKeyAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetKeyAction.php index 762a388d77c..e23a8181cb6 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetKeyAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetKeyAction.php @@ -18,6 +18,7 @@ interface CartDiscountSetKeyAction extends CartDiscountUpdateAction /** *

Value to set. If empty, any existing value will be removed.

* + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetKeyActionBuilder.php index d9d6b3b895a..1774f0e8276 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetKeyActionBuilder.php @@ -21,6 +21,7 @@ final class CartDiscountSetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; @@ -28,6 +29,7 @@ final class CartDiscountSetKeyActionBuilder implements Builder /** *

Value to set. If empty, any existing value will be removed.

* + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetKeyActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetKeyActionModel.php index e20c067cfd0..188311df9f3 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetKeyActionModel.php @@ -21,11 +21,13 @@ final class CartDiscountSetKeyActionModel extends JsonObjectModel implements Car { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class CartDiscountSetKeyActionModel extends JsonObjectModel implements Car * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

Value to set. If empty, any existing value will be removed.

* + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromAction.php index bdc7f665b4e..576e7b058da 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromAction.php @@ -20,6 +20,7 @@ interface CartDiscountSetValidFromAction extends CartDiscountUpdateAction *

Value to set. * If empty, any existing value will be removed.

* + * @return null|DateTimeImmutable */ public function getValidFrom(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromActionBuilder.php index af51b671747..1c99fe74ac5 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromActionBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromActionBuilder.php @@ -22,6 +22,7 @@ final class CartDiscountSetValidFromActionBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $validFrom; @@ -30,6 +31,7 @@ final class CartDiscountSetValidFromActionBuilder implements Builder *

Value to set. * If empty, any existing value will be removed.

* + * @return null|DateTimeImmutable */ public function getValidFrom() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromActionModel.php index 15f1a5c2586..871b252f603 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromActionModel.php @@ -22,11 +22,13 @@ final class CartDiscountSetValidFromActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'setValidFrom'; /** + * * @var ?string */ protected $action; /** + * * @var ?DateTimeImmutable */ protected $validFrom; @@ -36,13 +38,15 @@ final class CartDiscountSetValidFromActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutable $validFrom = null + ?DateTimeImmutable $validFrom = null, + ?string $action = null ) { $this->validFrom = $validFrom; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() *

Value to set. * If empty, any existing value will be removed.

* + * * @return null|DateTimeImmutable */ public function getValidFrom() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromAndUntilAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromAndUntilAction.php index 840ffd57d9d..734affebe58 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromAndUntilAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromAndUntilAction.php @@ -21,6 +21,7 @@ interface CartDiscountSetValidFromAndUntilAction extends CartDiscountUpdateActio *

Value to set. * If empty, any existing value will be removed.

* + * @return null|DateTimeImmutable */ public function getValidFrom(); @@ -29,6 +30,7 @@ public function getValidFrom(); *

Value to set. * If empty, any existing value will be removed.

* + * @return null|DateTimeImmutable */ public function getValidUntil(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromAndUntilActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromAndUntilActionBuilder.php index 36806309823..4385758f709 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromAndUntilActionBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromAndUntilActionBuilder.php @@ -22,11 +22,13 @@ final class CartDiscountSetValidFromAndUntilActionBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; @@ -35,6 +37,7 @@ final class CartDiscountSetValidFromAndUntilActionBuilder implements Builder *

Value to set. * If empty, any existing value will be removed.

* + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -46,6 +49,7 @@ public function getValidFrom() *

Value to set. * If empty, any existing value will be removed.

* + * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromAndUntilActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromAndUntilActionModel.php index 053ce18ff9a..43520f1d0b0 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromAndUntilActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidFromAndUntilActionModel.php @@ -22,16 +22,19 @@ final class CartDiscountSetValidFromAndUntilActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setValidFromAndUntil'; /** + * * @var ?string */ protected $action; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; @@ -42,14 +45,16 @@ final class CartDiscountSetValidFromAndUntilActionModel extends JsonObjectModel */ public function __construct( ?DateTimeImmutable $validFrom = null, - ?DateTimeImmutable $validUntil = null + ?DateTimeImmutable $validUntil = null, + ?string $action = null ) { $this->validFrom = $validFrom; $this->validUntil = $validUntil; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() *

Value to set. * If empty, any existing value will be removed.

* + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -94,6 +100,7 @@ public function getValidFrom() *

Value to set. * If empty, any existing value will be removed.

* + * * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidUntilAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidUntilAction.php index e55815ba651..62b7a7d56f7 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidUntilAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidUntilAction.php @@ -20,6 +20,7 @@ interface CartDiscountSetValidUntilAction extends CartDiscountUpdateAction *

Value to set. * If empty, any existing value will be removed.

* + * @return null|DateTimeImmutable */ public function getValidUntil(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidUntilActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidUntilActionBuilder.php index 2758c2342e2..54f47b18971 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidUntilActionBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidUntilActionBuilder.php @@ -22,6 +22,7 @@ final class CartDiscountSetValidUntilActionBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $validUntil; @@ -30,6 +31,7 @@ final class CartDiscountSetValidUntilActionBuilder implements Builder *

Value to set. * If empty, any existing value will be removed.

* + * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidUntilActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidUntilActionModel.php index 1917b6ae238..a9639690f47 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidUntilActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetValidUntilActionModel.php @@ -22,11 +22,13 @@ final class CartDiscountSetValidUntilActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setValidUntil'; /** + * * @var ?string */ protected $action; /** + * * @var ?DateTimeImmutable */ protected $validUntil; @@ -36,13 +38,15 @@ final class CartDiscountSetValidUntilActionModel extends JsonObjectModel impleme * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutable $validUntil = null + ?DateTimeImmutable $validUntil = null, + ?string $action = null ) { $this->validUntil = $validUntil; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() *

Value to set. * If empty, any existing value will be removed.

* + * * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountShippingCostTargetModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountShippingCostTargetModel.php index 819ad7c652f..6d930b65f2b 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountShippingCostTargetModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountShippingCostTargetModel.php @@ -21,6 +21,7 @@ final class CartDiscountShippingCostTargetModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'shipping'; /** + * * @var ?string */ protected $type; @@ -30,11 +31,13 @@ final class CartDiscountShippingCostTargetModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountTarget.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountTarget.php index 44c03bc1721..b7fccca0a81 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountTarget.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountTarget.php @@ -17,6 +17,7 @@ interface CartDiscountTarget extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountTargetModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountTargetModel.php index 5e2ee9c1bd3..0c12bc618f9 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountTargetModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountTargetModel.php @@ -21,6 +21,7 @@ final class CartDiscountTargetModel extends JsonObjectModel implements CartDisco { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -41,11 +42,13 @@ final class CartDiscountTargetModel extends JsonObjectModel implements CartDisco * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdate.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdate.php index 6f9c7e51a0b..5c5d95ecc67 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdate.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdate.php @@ -19,6 +19,7 @@ interface CartDiscountUpdate extends JsonObject /** *

Expected version of the CartDiscount on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

* + * @return null|int */ public function getVersion(); @@ -26,6 +27,7 @@ public function getVersion(); /** *

Update actions to be performed on the CartDiscount.

* + * @return null|CartDiscountUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateAction.php index a86d2ffc608..97b3d20d65a 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateAction.php @@ -17,6 +17,7 @@ interface CartDiscountUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateActionModel.php index e7c504a5be9..7189d2f9b5d 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateActionModel.php @@ -21,6 +21,7 @@ final class CartDiscountUpdateActionModel extends JsonObjectModel implements Car { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -51,11 +52,13 @@ final class CartDiscountUpdateActionModel extends JsonObjectModel implements Car * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateBuilder.php index 6fed058d783..bb3fdf28d37 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateBuilder.php @@ -21,11 +21,13 @@ final class CartDiscountUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?CartDiscountUpdateActionCollection */ private $actions; @@ -33,6 +35,7 @@ final class CartDiscountUpdateBuilder implements Builder /** *

Expected version of the CartDiscount on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

* + * @return null|int */ public function getVersion() @@ -43,6 +46,7 @@ public function getVersion() /** *

Update actions to be performed on the CartDiscount.

* + * @return null|CartDiscountUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateModel.php index ab02510cbae..0452b0e5b37 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateModel.php @@ -20,11 +20,13 @@ final class CartDiscountUpdateModel extends JsonObjectModel implements CartDiscountUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?CartDiscountUpdateActionCollection */ protected $actions; @@ -44,6 +46,7 @@ public function __construct( /** *

Expected version of the CartDiscount on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

* + * * @return null|int */ public function getVersion() @@ -63,6 +66,7 @@ public function getVersion() /** *

Update actions to be performed on the CartDiscount.

* + * * @return null|CartDiscountUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValue.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValue.php index ad87773797f..66d07fc8be6 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValue.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValue.php @@ -17,6 +17,7 @@ interface CartDiscountValue extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsolute.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsolute.php index 98418a28d54..1321c43dba7 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsolute.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsolute.php @@ -19,6 +19,7 @@ interface CartDiscountValueAbsolute extends CartDiscountValue /** *

Cent precision money values in different currencies.

* + * @return null|CentPrecisionMoneyCollection */ public function getMoney(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteBuilder.php index 32a9b5667a0..a380b7e747b 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteBuilder.php @@ -22,6 +22,7 @@ final class CartDiscountValueAbsoluteBuilder implements Builder { /** + * @var ?CentPrecisionMoneyCollection */ private $money; @@ -29,6 +30,7 @@ final class CartDiscountValueAbsoluteBuilder implements Builder /** *

Cent precision money values in different currencies.

* + * @return null|CentPrecisionMoneyCollection */ public function getMoney() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteDraft.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteDraft.php index 1069d6dd9e5..4c16f65676c 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteDraft.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteDraft.php @@ -20,6 +20,7 @@ interface CartDiscountValueAbsoluteDraft extends CartDiscountValueDraft *

Money values in different currencies. * An absolute Cart Discount will only match a price if this array contains a value with the same currency. If it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.

* + * @return null|MoneyCollection */ public function getMoney(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteDraftBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteDraftBuilder.php index 9ee421fe35c..32df2af7f3c 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteDraftBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteDraftBuilder.php @@ -22,6 +22,7 @@ final class CartDiscountValueAbsoluteDraftBuilder implements Builder { /** + * @var ?MoneyCollection */ private $money; @@ -30,6 +31,7 @@ final class CartDiscountValueAbsoluteDraftBuilder implements Builder *

Money values in different currencies. * An absolute Cart Discount will only match a price if this array contains a value with the same currency. If it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.

* + * @return null|MoneyCollection */ public function getMoney() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteDraftModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteDraftModel.php index d066d724c7c..22ce00675ba 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteDraftModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteDraftModel.php @@ -22,11 +22,13 @@ final class CartDiscountValueAbsoluteDraftModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'absolute'; /** + * * @var ?string */ protected $type; /** + * * @var ?MoneyCollection */ protected $money; @@ -36,13 +38,15 @@ final class CartDiscountValueAbsoluteDraftModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?MoneyCollection $money = null + ?MoneyCollection $money = null, + ?string $type = null ) { $this->money = $money; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -63,6 +67,7 @@ public function getType() *

Money values in different currencies. * An absolute Cart Discount will only match a price if this array contains a value with the same currency. If it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.

* + * * @return null|MoneyCollection */ public function getMoney() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteModel.php index 593204ab11a..87fc9184d5c 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueAbsoluteModel.php @@ -22,11 +22,13 @@ final class CartDiscountValueAbsoluteModel extends JsonObjectModel implements Ca { public const DISCRIMINATOR_VALUE = 'absolute'; /** + * * @var ?string */ protected $type; /** + * * @var ?CentPrecisionMoneyCollection */ protected $money; @@ -36,13 +38,15 @@ final class CartDiscountValueAbsoluteModel extends JsonObjectModel implements Ca * @psalm-suppress MissingParamType */ public function __construct( - ?CentPrecisionMoneyCollection $money = null + ?CentPrecisionMoneyCollection $money = null, + ?string $type = null ) { $this->money = $money; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -62,6 +66,7 @@ public function getType() /** *

Cent precision money values in different currencies.

* + * * @return null|CentPrecisionMoneyCollection */ public function getMoney() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueDraft.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueDraft.php index 43926f5244b..4d1a1df79dd 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueDraft.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueDraft.php @@ -17,6 +17,7 @@ interface CartDiscountValueDraft extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueDraftModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueDraftModel.php index b6eb20a9d36..bb4e7a2a2df 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueDraftModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueDraftModel.php @@ -21,6 +21,7 @@ final class CartDiscountValueDraftModel extends JsonObjectModel implements CartD { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -40,11 +41,13 @@ final class CartDiscountValueDraftModel extends JsonObjectModel implements CartD * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixed.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixed.php index 095f0f3c819..9d32c943f65 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixed.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixed.php @@ -19,6 +19,7 @@ interface CartDiscountValueFixed extends CartDiscountValue /** *

Cent precision money values in different currencies.

* + * @return null|CentPrecisionMoneyCollection */ public function getMoney(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedBuilder.php index 1a92a429cfa..5c8f1706a7e 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedBuilder.php @@ -22,6 +22,7 @@ final class CartDiscountValueFixedBuilder implements Builder { /** + * @var ?CentPrecisionMoneyCollection */ private $money; @@ -29,6 +30,7 @@ final class CartDiscountValueFixedBuilder implements Builder /** *

Cent precision money values in different currencies.

* + * @return null|CentPrecisionMoneyCollection */ public function getMoney() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraft.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraft.php index 9565247d1a8..aad2280141d 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraft.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraft.php @@ -20,6 +20,7 @@ interface CartDiscountValueFixedDraft extends CartDiscountValueDraft *

Money values in different currencies. * A fixed Cart Discount will only match a price if this array contains a value with the same currency. If it contains 10€ and 15$, the matching € price will be discounted by 10€ and the matching $ price will be discounted to 15$.

* + * @return null|MoneyCollection */ public function getMoney(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftBuilder.php index 025c4570e98..be04a0f60d6 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftBuilder.php @@ -22,6 +22,7 @@ final class CartDiscountValueFixedDraftBuilder implements Builder { /** + * @var ?MoneyCollection */ private $money; @@ -30,6 +31,7 @@ final class CartDiscountValueFixedDraftBuilder implements Builder *

Money values in different currencies. * A fixed Cart Discount will only match a price if this array contains a value with the same currency. If it contains 10€ and 15$, the matching € price will be discounted by 10€ and the matching $ price will be discounted to 15$.

* + * @return null|MoneyCollection */ public function getMoney() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftModel.php index a878e842916..cd893f9826f 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftModel.php @@ -22,11 +22,13 @@ final class CartDiscountValueFixedDraftModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'fixed'; /** + * * @var ?string */ protected $type; /** + * * @var ?MoneyCollection */ protected $money; @@ -36,13 +38,15 @@ final class CartDiscountValueFixedDraftModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?MoneyCollection $money = null + ?MoneyCollection $money = null, + ?string $type = null ) { $this->money = $money; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -63,6 +67,7 @@ public function getType() *

Money values in different currencies. * A fixed Cart Discount will only match a price if this array contains a value with the same currency. If it contains 10€ and 15$, the matching € price will be discounted by 10€ and the matching $ price will be discounted to 15$.

* + * * @return null|MoneyCollection */ public function getMoney() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedModel.php index 5cf08b006a8..4fa4dbc17aa 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedModel.php @@ -22,11 +22,13 @@ final class CartDiscountValueFixedModel extends JsonObjectModel implements CartD { public const DISCRIMINATOR_VALUE = 'fixed'; /** + * * @var ?string */ protected $type; /** + * * @var ?CentPrecisionMoneyCollection */ protected $money; @@ -36,13 +38,15 @@ final class CartDiscountValueFixedModel extends JsonObjectModel implements CartD * @psalm-suppress MissingParamType */ public function __construct( - ?CentPrecisionMoneyCollection $money = null + ?CentPrecisionMoneyCollection $money = null, + ?string $type = null ) { $this->money = $money; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -62,6 +66,7 @@ public function getType() /** *

Cent precision money values in different currencies.

* + * * @return null|CentPrecisionMoneyCollection */ public function getMoney() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItem.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItem.php index a45095beb4b..a1b9753eb43 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItem.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItem.php @@ -23,6 +23,7 @@ interface CartDiscountValueGiftLineItem extends CartDiscountValue /** *

Reference to a Product.

* + * @return null|ProductReference */ public function getProduct(); @@ -30,6 +31,7 @@ public function getProduct(); /** *

ProductVariant of the Product.

* + * @return null|int */ public function getVariantId(); @@ -37,6 +39,7 @@ public function getVariantId(); /** *

Channel must have the ChannelRoleEnum InventorySupply.

* + * @return null|ChannelReference */ public function getSupplyChannel(); @@ -44,6 +47,7 @@ public function getSupplyChannel(); /** *

Channel must have the ChannelRoleEnum ProductDistribution.

* + * @return null|ChannelReference */ public function getDistributionChannel(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemBuilder.php index 49f50416582..a428c66373a 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemBuilder.php @@ -25,21 +25,25 @@ final class CartDiscountValueGiftLineItemBuilder implements Builder { /** + * @var null|ProductReference|ProductReferenceBuilder */ private $product; /** + * @var ?int */ private $variantId; /** + * @var null|ChannelReference|ChannelReferenceBuilder */ private $supplyChannel; /** + * @var null|ChannelReference|ChannelReferenceBuilder */ private $distributionChannel; @@ -47,6 +51,7 @@ final class CartDiscountValueGiftLineItemBuilder implements Builder /** *

Reference to a Product.

* + * @return null|ProductReference */ public function getProduct() @@ -57,6 +62,7 @@ public function getProduct() /** *

ProductVariant of the Product.

* + * @return null|int */ public function getVariantId() @@ -67,6 +73,7 @@ public function getVariantId() /** *

Channel must have the ChannelRoleEnum InventorySupply.

* + * @return null|ChannelReference */ public function getSupplyChannel() @@ -77,6 +84,7 @@ public function getSupplyChannel() /** *

Channel must have the ChannelRoleEnum ProductDistribution.

* + * @return null|ChannelReference */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemDraft.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemDraft.php index 956fc7368e9..7e01ad95814 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemDraft.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemDraft.php @@ -23,6 +23,7 @@ interface CartDiscountValueGiftLineItemDraft extends CartDiscountValueDraft /** *

ResourceIdentifier of a Product.

* + * @return null|ProductResourceIdentifier */ public function getProduct(); @@ -30,6 +31,7 @@ public function getProduct(); /** *

ProductVariant of the Product.

* + * @return null|int */ public function getVariantId(); @@ -37,6 +39,7 @@ public function getVariantId(); /** *

Channel must have the role InventorySupply.

* + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel(); @@ -44,6 +47,7 @@ public function getSupplyChannel(); /** *

Channel must have the role ProductDistribution.

* + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemDraftBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemDraftBuilder.php index 4be60bff884..228fd92abc9 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemDraftBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemDraftBuilder.php @@ -25,21 +25,25 @@ final class CartDiscountValueGiftLineItemDraftBuilder implements Builder { /** + * @var null|ProductResourceIdentifier|ProductResourceIdentifierBuilder */ private $product; /** + * @var ?int */ private $variantId; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $supplyChannel; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $distributionChannel; @@ -47,6 +51,7 @@ final class CartDiscountValueGiftLineItemDraftBuilder implements Builder /** *

ResourceIdentifier of a Product.

* + * @return null|ProductResourceIdentifier */ public function getProduct() @@ -57,6 +62,7 @@ public function getProduct() /** *

ProductVariant of the Product.

* + * @return null|int */ public function getVariantId() @@ -67,6 +73,7 @@ public function getVariantId() /** *

Channel must have the role InventorySupply.

* + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -77,6 +84,7 @@ public function getSupplyChannel() /** *

Channel must have the role ProductDistribution.

* + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemDraftModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemDraftModel.php index a3135a81cf2..635217a5b61 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemDraftModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemDraftModel.php @@ -25,26 +25,31 @@ final class CartDiscountValueGiftLineItemDraftModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'giftLineItem'; /** + * * @var ?string */ protected $type; /** + * * @var ?ProductResourceIdentifier */ protected $product; /** + * * @var ?int */ protected $variantId; /** + * * @var ?ChannelResourceIdentifier */ protected $supplyChannel; /** + * * @var ?ChannelResourceIdentifier */ protected $distributionChannel; @@ -57,16 +62,18 @@ public function __construct( ?ProductResourceIdentifier $product = null, ?int $variantId = null, ?ChannelResourceIdentifier $supplyChannel = null, - ?ChannelResourceIdentifier $distributionChannel = null + ?ChannelResourceIdentifier $distributionChannel = null, + ?string $type = null ) { $this->product = $product; $this->variantId = $variantId; $this->supplyChannel = $supplyChannel; $this->distributionChannel = $distributionChannel; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -86,6 +93,7 @@ public function getType() /** *

ResourceIdentifier of a Product.

* + * * @return null|ProductResourceIdentifier */ public function getProduct() @@ -106,6 +114,7 @@ public function getProduct() /** *

ProductVariant of the Product.

* + * * @return null|int */ public function getVariantId() @@ -125,6 +134,7 @@ public function getVariantId() /** *

Channel must have the role InventorySupply.

* + * * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -145,6 +155,7 @@ public function getSupplyChannel() /** *

Channel must have the role ProductDistribution.

* + * * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemModel.php index f080a6e37cc..ade138435e6 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueGiftLineItemModel.php @@ -25,26 +25,31 @@ final class CartDiscountValueGiftLineItemModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'giftLineItem'; /** + * * @var ?string */ protected $type; /** + * * @var ?ProductReference */ protected $product; /** + * * @var ?int */ protected $variantId; /** + * * @var ?ChannelReference */ protected $supplyChannel; /** + * * @var ?ChannelReference */ protected $distributionChannel; @@ -57,16 +62,18 @@ public function __construct( ?ProductReference $product = null, ?int $variantId = null, ?ChannelReference $supplyChannel = null, - ?ChannelReference $distributionChannel = null + ?ChannelReference $distributionChannel = null, + ?string $type = null ) { $this->product = $product; $this->variantId = $variantId; $this->supplyChannel = $supplyChannel; $this->distributionChannel = $distributionChannel; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -86,6 +93,7 @@ public function getType() /** *

Reference to a Product.

* + * * @return null|ProductReference */ public function getProduct() @@ -106,6 +114,7 @@ public function getProduct() /** *

ProductVariant of the Product.

* + * * @return null|int */ public function getVariantId() @@ -125,6 +134,7 @@ public function getVariantId() /** *

Channel must have the ChannelRoleEnum InventorySupply.

* + * * @return null|ChannelReference */ public function getSupplyChannel() @@ -145,6 +155,7 @@ public function getSupplyChannel() /** *

Channel must have the ChannelRoleEnum ProductDistribution.

* + * * @return null|ChannelReference */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueModel.php index cb339cdd692..40d12144506 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueModel.php @@ -21,6 +21,7 @@ final class CartDiscountValueModel extends JsonObjectModel implements CartDiscou { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -40,11 +41,13 @@ final class CartDiscountValueModel extends JsonObjectModel implements CartDiscou * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelative.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelative.php index d0d069128a3..8257fe7690f 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelative.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelative.php @@ -18,6 +18,7 @@ interface CartDiscountValueRelative extends CartDiscountValue /** *

Fraction (per ten thousand) the price is reduced by. For example, 1000 will result in a 10% price reduction.

* + * @return null|int */ public function getPermyriad(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeBuilder.php index fc551b2afc8..b152dbbef68 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeBuilder.php @@ -21,6 +21,7 @@ final class CartDiscountValueRelativeBuilder implements Builder { /** + * @var ?int */ private $permyriad; @@ -28,6 +29,7 @@ final class CartDiscountValueRelativeBuilder implements Builder /** *

Fraction (per ten thousand) the price is reduced by. For example, 1000 will result in a 10% price reduction.

* + * @return null|int */ public function getPermyriad() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeDraft.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeDraft.php index 213eafa201e..3eca8fed444 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeDraft.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeDraft.php @@ -18,6 +18,7 @@ interface CartDiscountValueRelativeDraft extends CartDiscountValueDraft /** *

Fraction (per ten thousand) the price is reduced by. For example, 1000 will result in a 10% price reduction.

* + * @return null|int */ public function getPermyriad(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeDraftBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeDraftBuilder.php index 23ab93bed9e..3f85fff5e1f 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeDraftBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeDraftBuilder.php @@ -21,6 +21,7 @@ final class CartDiscountValueRelativeDraftBuilder implements Builder { /** + * @var ?int */ private $permyriad; @@ -28,6 +29,7 @@ final class CartDiscountValueRelativeDraftBuilder implements Builder /** *

Fraction (per ten thousand) the price is reduced by. For example, 1000 will result in a 10% price reduction.

* + * @return null|int */ public function getPermyriad() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeDraftModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeDraftModel.php index 3639eaad59d..691e96562f8 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeDraftModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeDraftModel.php @@ -21,11 +21,13 @@ final class CartDiscountValueRelativeDraftModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'relative'; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $permyriad; @@ -35,13 +37,15 @@ final class CartDiscountValueRelativeDraftModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?int $permyriad = null + ?int $permyriad = null, + ?string $type = null ) { $this->permyriad = $permyriad; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() /** *

Fraction (per ten thousand) the price is reduced by. For example, 1000 will result in a 10% price reduction.

* + * * @return null|int */ public function getPermyriad() diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeModel.php index 0dcc2528e45..be7be1dc00f 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueRelativeModel.php @@ -21,11 +21,13 @@ final class CartDiscountValueRelativeModel extends JsonObjectModel implements Ca { public const DISCRIMINATOR_VALUE = 'relative'; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $permyriad; @@ -35,13 +37,15 @@ final class CartDiscountValueRelativeModel extends JsonObjectModel implements Ca * @psalm-suppress MissingParamType */ public function __construct( - ?int $permyriad = null + ?int $permyriad = null, + ?string $type = null ) { $this->permyriad = $permyriad; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() /** *

Fraction (per ten thousand) the price is reduced by. For example, 1000 will result in a 10% price reduction.

* + * * @return null|int */ public function getPermyriad() diff --git a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTarget.php b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTarget.php index 42843c1fba3..1fe78cc0bc4 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTarget.php +++ b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTarget.php @@ -22,6 +22,7 @@ interface MultiBuyCustomLineItemsTarget extends CartDiscountTarget /** *

Valid CustomLineItems target predicate. The Discount will be applied to Custom Line Items that are matched by the predicate.

* + * @return null|string */ public function getPredicate(); @@ -29,6 +30,7 @@ public function getPredicate(); /** *

Number of Custom Line Items to be present in order to trigger an application of this Discount.

* + * @return null|int */ public function getTriggerQuantity(); @@ -36,6 +38,7 @@ public function getTriggerQuantity(); /** *

Number of Custom Line Items that are discounted per application of this Discount.

* + * @return null|int */ public function getDiscountedQuantity(); @@ -43,6 +46,7 @@ public function getDiscountedQuantity(); /** *

Maximum number of times this Discount can be applied.

* + * @return null|int */ public function getMaxOccurrence(); @@ -50,6 +54,7 @@ public function getMaxOccurrence(); /** *

Discounts particular Line Items only according to the SelectionMode.

* + * @return null|string */ public function getSelectionMode(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTargetBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTargetBuilder.php index 9402651175e..cd0e4257fbd 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTargetBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTargetBuilder.php @@ -21,26 +21,31 @@ final class MultiBuyCustomLineItemsTargetBuilder implements Builder { /** + * @var ?string */ private $predicate; /** + * @var ?int */ private $triggerQuantity; /** + * @var ?int */ private $discountedQuantity; /** + * @var ?int */ private $maxOccurrence; /** + * @var ?string */ private $selectionMode; @@ -48,6 +53,7 @@ final class MultiBuyCustomLineItemsTargetBuilder implements Builder /** *

Valid CustomLineItems target predicate. The Discount will be applied to Custom Line Items that are matched by the predicate.

* + * @return null|string */ public function getPredicate() @@ -58,6 +64,7 @@ public function getPredicate() /** *

Number of Custom Line Items to be present in order to trigger an application of this Discount.

* + * @return null|int */ public function getTriggerQuantity() @@ -68,6 +75,7 @@ public function getTriggerQuantity() /** *

Number of Custom Line Items that are discounted per application of this Discount.

* + * @return null|int */ public function getDiscountedQuantity() @@ -78,6 +86,7 @@ public function getDiscountedQuantity() /** *

Maximum number of times this Discount can be applied.

* + * @return null|int */ public function getMaxOccurrence() @@ -88,6 +97,7 @@ public function getMaxOccurrence() /** *

Discounts particular Line Items only according to the SelectionMode.

* + * @return null|string */ public function getSelectionMode() diff --git a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTargetModel.php b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTargetModel.php index e7615ef3297..a57670da524 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTargetModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTargetModel.php @@ -21,31 +21,37 @@ final class MultiBuyCustomLineItemsTargetModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'multiBuyCustomLineItems'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $predicate; /** + * * @var ?int */ protected $triggerQuantity; /** + * * @var ?int */ protected $discountedQuantity; /** + * * @var ?int */ protected $maxOccurrence; /** + * * @var ?string */ protected $selectionMode; @@ -59,17 +65,19 @@ public function __construct( ?int $triggerQuantity = null, ?int $discountedQuantity = null, ?int $maxOccurrence = null, - ?string $selectionMode = null + ?string $selectionMode = null, + ?string $type = null ) { $this->predicate = $predicate; $this->triggerQuantity = $triggerQuantity; $this->discountedQuantity = $discountedQuantity; $this->maxOccurrence = $maxOccurrence; $this->selectionMode = $selectionMode; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -89,6 +97,7 @@ public function getType() /** *

Valid CustomLineItems target predicate. The Discount will be applied to Custom Line Items that are matched by the predicate.

* + * * @return null|string */ public function getPredicate() @@ -108,6 +117,7 @@ public function getPredicate() /** *

Number of Custom Line Items to be present in order to trigger an application of this Discount.

* + * * @return null|int */ public function getTriggerQuantity() @@ -127,6 +137,7 @@ public function getTriggerQuantity() /** *

Number of Custom Line Items that are discounted per application of this Discount.

* + * * @return null|int */ public function getDiscountedQuantity() @@ -146,6 +157,7 @@ public function getDiscountedQuantity() /** *

Maximum number of times this Discount can be applied.

* + * * @return null|int */ public function getMaxOccurrence() @@ -165,6 +177,7 @@ public function getMaxOccurrence() /** *

Discounts particular Line Items only according to the SelectionMode.

* + * * @return null|string */ public function getSelectionMode() diff --git a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTarget.php b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTarget.php index 11fb794e7e5..e28e85e90e2 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTarget.php +++ b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTarget.php @@ -22,6 +22,7 @@ interface MultiBuyLineItemsTarget extends CartDiscountTarget /** *

Valid LineItem target predicate. The Discount will be applied to Line Items that are matched by the predicate.

* + * @return null|string */ public function getPredicate(); @@ -29,6 +30,7 @@ public function getPredicate(); /** *

Number of Line Items to be present in order to trigger an application of this Discount.

* + * @return null|int */ public function getTriggerQuantity(); @@ -36,6 +38,7 @@ public function getTriggerQuantity(); /** *

Number of Line Items that are discounted per application of this Discount.

* + * @return null|int */ public function getDiscountedQuantity(); @@ -43,6 +46,7 @@ public function getDiscountedQuantity(); /** *

Maximum number of times this Discount can be applied.

* + * @return null|int */ public function getMaxOccurrence(); @@ -50,6 +54,7 @@ public function getMaxOccurrence(); /** *

Discounts particular Line Items only according to the SelectionMode.

* + * @return null|string */ public function getSelectionMode(); diff --git a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTargetBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTargetBuilder.php index 083b6a90998..015176885a7 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTargetBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTargetBuilder.php @@ -21,26 +21,31 @@ final class MultiBuyLineItemsTargetBuilder implements Builder { /** + * @var ?string */ private $predicate; /** + * @var ?int */ private $triggerQuantity; /** + * @var ?int */ private $discountedQuantity; /** + * @var ?int */ private $maxOccurrence; /** + * @var ?string */ private $selectionMode; @@ -48,6 +53,7 @@ final class MultiBuyLineItemsTargetBuilder implements Builder /** *

Valid LineItem target predicate. The Discount will be applied to Line Items that are matched by the predicate.

* + * @return null|string */ public function getPredicate() @@ -58,6 +64,7 @@ public function getPredicate() /** *

Number of Line Items to be present in order to trigger an application of this Discount.

* + * @return null|int */ public function getTriggerQuantity() @@ -68,6 +75,7 @@ public function getTriggerQuantity() /** *

Number of Line Items that are discounted per application of this Discount.

* + * @return null|int */ public function getDiscountedQuantity() @@ -78,6 +86,7 @@ public function getDiscountedQuantity() /** *

Maximum number of times this Discount can be applied.

* + * @return null|int */ public function getMaxOccurrence() @@ -88,6 +97,7 @@ public function getMaxOccurrence() /** *

Discounts particular Line Items only according to the SelectionMode.

* + * @return null|string */ public function getSelectionMode() diff --git a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTargetModel.php b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTargetModel.php index 24747a04dde..c118dfd93e1 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTargetModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTargetModel.php @@ -21,31 +21,37 @@ final class MultiBuyLineItemsTargetModel extends JsonObjectModel implements Mult { public const DISCRIMINATOR_VALUE = 'multiBuyLineItems'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $predicate; /** + * * @var ?int */ protected $triggerQuantity; /** + * * @var ?int */ protected $discountedQuantity; /** + * * @var ?int */ protected $maxOccurrence; /** + * * @var ?string */ protected $selectionMode; @@ -59,17 +65,19 @@ public function __construct( ?int $triggerQuantity = null, ?int $discountedQuantity = null, ?int $maxOccurrence = null, - ?string $selectionMode = null + ?string $selectionMode = null, + ?string $type = null ) { $this->predicate = $predicate; $this->triggerQuantity = $triggerQuantity; $this->discountedQuantity = $discountedQuantity; $this->maxOccurrence = $maxOccurrence; $this->selectionMode = $selectionMode; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -89,6 +97,7 @@ public function getType() /** *

Valid LineItem target predicate. The Discount will be applied to Line Items that are matched by the predicate.

* + * * @return null|string */ public function getPredicate() @@ -108,6 +117,7 @@ public function getPredicate() /** *

Number of Line Items to be present in order to trigger an application of this Discount.

* + * * @return null|int */ public function getTriggerQuantity() @@ -127,6 +137,7 @@ public function getTriggerQuantity() /** *

Number of Line Items that are discounted per application of this Discount.

* + * * @return null|int */ public function getDiscountedQuantity() @@ -146,6 +157,7 @@ public function getDiscountedQuantity() /** *

Maximum number of times this Discount can be applied.

* + * * @return null|int */ public function getMaxOccurrence() @@ -165,6 +177,7 @@ public function getMaxOccurrence() /** *

Discounts particular Line Items only according to the SelectionMode.

* + * * @return null|string */ public function getSelectionMode() diff --git a/lib/commercetools-api/src/Models/Category/Category.php b/lib/commercetools-api/src/Models/Category/Category.php index 3b73e2d8981..2ee707a87ac 100644 --- a/lib/commercetools-api/src/Models/Category/Category.php +++ b/lib/commercetools-api/src/Models/Category/Category.php @@ -39,6 +39,7 @@ interface Category extends BaseResource /** *

Unique identifier of the Category.

* + * @return null|string */ public function getId(); @@ -46,6 +47,7 @@ public function getId(); /** *

Current version of the Category.

* + * @return null|int */ public function getVersion(); @@ -53,6 +55,7 @@ public function getVersion(); /** *

Date and time (UTC) the Category was initially created.

* + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -60,6 +63,7 @@ public function getCreatedAt(); /** *

Date and time (UTC) the Category was last updated.

* + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -67,6 +71,7 @@ public function getLastModifiedAt(); /** *

Present on resources updated after 1 February 2019 except for events not tracked.

* + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -74,6 +79,7 @@ public function getLastModifiedBy(); /** *

Present on resources created after 1 February 2019 except for events not tracked.

* + * @return null|CreatedBy */ public function getCreatedBy(); @@ -81,6 +87,7 @@ public function getCreatedBy(); /** *

Name of the Category.

* + * @return null|LocalizedString */ public function getName(); @@ -91,6 +98,7 @@ public function getName(); * Valid slugs match the pattern ^[A-Za-z0-9_-]{2,256}+$. * For good performance, indexes are provided for the first 15 languages set in a Project.

* + * @return null|LocalizedString */ public function getSlug(); @@ -98,6 +106,7 @@ public function getSlug(); /** *

Description of the Category.

* + * @return null|LocalizedString */ public function getDescription(); @@ -105,6 +114,7 @@ public function getDescription(); /** *

Contains the parent path towards the root Category.

* + * @return null|CategoryReferenceCollection */ public function getAncestors(); @@ -112,6 +122,7 @@ public function getAncestors(); /** *

Parent Category of this Category.

* + * @return null|CategoryReference */ public function getParent(); @@ -119,6 +130,7 @@ public function getParent(); /** *

Decimal value between 0 and 1 used to order Categories that are on the same level in the Category tree.

* + * @return null|string */ public function getOrderHint(); @@ -126,6 +138,7 @@ public function getOrderHint(); /** *

Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

* + * @return null|string */ public function getExternalId(); @@ -133,6 +146,7 @@ public function getExternalId(); /** *

Name of the Category used by external search engines for improved search engine performance.

* + * @return null|LocalizedString */ public function getMetaTitle(); @@ -140,6 +154,7 @@ public function getMetaTitle(); /** *

Description of the Category used by external search engines for improved search engine performance.

* + * @return null|LocalizedString */ public function getMetaDescription(); @@ -147,6 +162,7 @@ public function getMetaDescription(); /** *

Keywords related to the Category for improved search engine performance.

* + * @return null|LocalizedString */ public function getMetaKeywords(); @@ -154,6 +170,7 @@ public function getMetaKeywords(); /** *

Custom Fields for the Category.

* + * @return null|CustomFields */ public function getCustom(); @@ -161,6 +178,7 @@ public function getCustom(); /** *

Media related to the Category.

* + * @return null|AssetCollection */ public function getAssets(); @@ -168,6 +186,7 @@ public function getAssets(); /** *

User-defined unique identifier of the Category.

* + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Category/CategoryAddAssetAction.php b/lib/commercetools-api/src/Models/Category/CategoryAddAssetAction.php index bc468b849a1..c6e4bc33718 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryAddAssetAction.php +++ b/lib/commercetools-api/src/Models/Category/CategoryAddAssetAction.php @@ -20,6 +20,7 @@ interface CategoryAddAssetAction extends CategoryUpdateAction /** *

Value to append.

* + * @return null|AssetDraft */ public function getAsset(); @@ -27,6 +28,7 @@ public function getAsset(); /** *

Position in the array at which the Asset should be put. When specified, the value must be between 0 and the total number of Assets minus 1.

* + * @return null|int */ public function getPosition(); diff --git a/lib/commercetools-api/src/Models/Category/CategoryAddAssetActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategoryAddAssetActionBuilder.php index 2d4d25a1330..e23b22fdadb 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryAddAssetActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategoryAddAssetActionBuilder.php @@ -23,11 +23,13 @@ final class CategoryAddAssetActionBuilder implements Builder { /** + * @var null|AssetDraft|AssetDraftBuilder */ private $asset; /** + * @var ?int */ private $position; @@ -35,6 +37,7 @@ final class CategoryAddAssetActionBuilder implements Builder /** *

Value to append.

* + * @return null|AssetDraft */ public function getAsset() @@ -45,6 +48,7 @@ public function getAsset() /** *

Position in the array at which the Asset should be put. When specified, the value must be between 0 and the total number of Assets minus 1.

* + * @return null|int */ public function getPosition() diff --git a/lib/commercetools-api/src/Models/Category/CategoryAddAssetActionModel.php b/lib/commercetools-api/src/Models/Category/CategoryAddAssetActionModel.php index 6e24ea4d562..1da00c835e0 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryAddAssetActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategoryAddAssetActionModel.php @@ -23,16 +23,19 @@ final class CategoryAddAssetActionModel extends JsonObjectModel implements Categ { public const DISCRIMINATOR_VALUE = 'addAsset'; /** + * * @var ?string */ protected $action; /** + * * @var ?AssetDraft */ protected $asset; /** + * * @var ?int */ protected $position; @@ -43,14 +46,16 @@ final class CategoryAddAssetActionModel extends JsonObjectModel implements Categ */ public function __construct( ?AssetDraft $asset = null, - ?int $position = null + ?int $position = null, + ?string $action = null ) { $this->asset = $asset; $this->position = $position; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() /** *

Value to append.

* + * * @return null|AssetDraft */ public function getAsset() @@ -90,6 +96,7 @@ public function getAsset() /** *

Position in the array at which the Asset should be put. When specified, the value must be between 0 and the total number of Assets minus 1.

* + * * @return null|int */ public function getPosition() diff --git a/lib/commercetools-api/src/Models/Category/CategoryBuilder.php b/lib/commercetools-api/src/Models/Category/CategoryBuilder.php index 49fa08455d2..5c57c3a410c 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategoryBuilder.php @@ -33,96 +33,115 @@ final class CategoryBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?CategoryReferenceCollection */ private $ancestors; /** + * @var null|CategoryReference|CategoryReferenceBuilder */ private $parent; /** + * @var ?string */ private $orderHint; /** + * @var ?string */ private $externalId; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaTitle; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaDescription; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaKeywords; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var ?AssetCollection */ private $assets; /** + * @var ?string */ private $key; @@ -130,6 +149,7 @@ final class CategoryBuilder implements Builder /** *

Unique identifier of the Category.

* + * @return null|string */ public function getId() @@ -140,6 +160,7 @@ public function getId() /** *

Current version of the Category.

* + * @return null|int */ public function getVersion() @@ -150,6 +171,7 @@ public function getVersion() /** *

Date and time (UTC) the Category was initially created.

* + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -160,6 +182,7 @@ public function getCreatedAt() /** *

Date and time (UTC) the Category was last updated.

* + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -170,6 +193,7 @@ public function getLastModifiedAt() /** *

Present on resources updated after 1 February 2019 except for events not tracked.

* + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -180,6 +204,7 @@ public function getLastModifiedBy() /** *

Present on resources created after 1 February 2019 except for events not tracked.

* + * @return null|CreatedBy */ public function getCreatedBy() @@ -190,6 +215,7 @@ public function getCreatedBy() /** *

Name of the Category.

* + * @return null|LocalizedString */ public function getName() @@ -203,6 +229,7 @@ public function getName() * Valid slugs match the pattern ^[A-Za-z0-9_-]{2,256}+$. * For good performance, indexes are provided for the first 15 languages set in a Project.

* + * @return null|LocalizedString */ public function getSlug() @@ -213,6 +240,7 @@ public function getSlug() /** *

Description of the Category.

* + * @return null|LocalizedString */ public function getDescription() @@ -223,6 +251,7 @@ public function getDescription() /** *

Contains the parent path towards the root Category.

* + * @return null|CategoryReferenceCollection */ public function getAncestors() @@ -233,6 +262,7 @@ public function getAncestors() /** *

Parent Category of this Category.

* + * @return null|CategoryReference */ public function getParent() @@ -243,6 +273,7 @@ public function getParent() /** *

Decimal value between 0 and 1 used to order Categories that are on the same level in the Category tree.

* + * @return null|string */ public function getOrderHint() @@ -253,6 +284,7 @@ public function getOrderHint() /** *

Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

* + * @return null|string */ public function getExternalId() @@ -263,6 +295,7 @@ public function getExternalId() /** *

Name of the Category used by external search engines for improved search engine performance.

* + * @return null|LocalizedString */ public function getMetaTitle() @@ -273,6 +306,7 @@ public function getMetaTitle() /** *

Description of the Category used by external search engines for improved search engine performance.

* + * @return null|LocalizedString */ public function getMetaDescription() @@ -283,6 +317,7 @@ public function getMetaDescription() /** *

Keywords related to the Category for improved search engine performance.

* + * @return null|LocalizedString */ public function getMetaKeywords() @@ -293,6 +328,7 @@ public function getMetaKeywords() /** *

Custom Fields for the Category.

* + * @return null|CustomFields */ public function getCustom() @@ -303,6 +339,7 @@ public function getCustom() /** *

Media related to the Category.

* + * @return null|AssetCollection */ public function getAssets() @@ -313,6 +350,7 @@ public function getAssets() /** *

User-defined unique identifier of the Category.

* + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeAssetNameAction.php b/lib/commercetools-api/src/Models/Category/CategoryChangeAssetNameAction.php index 29f2ca2201a..566ad16525e 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeAssetNameAction.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeAssetNameAction.php @@ -21,6 +21,7 @@ interface CategoryChangeAssetNameAction extends CategoryUpdateAction /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetId(); @@ -28,6 +29,7 @@ public function getAssetId(); /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetKey(); @@ -35,6 +37,7 @@ public function getAssetKey(); /** *

New value to set. Must not be empty.

* + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeAssetNameActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategoryChangeAssetNameActionBuilder.php index d8f6a394f76..f9e0df4b0ff 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeAssetNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeAssetNameActionBuilder.php @@ -23,16 +23,19 @@ final class CategoryChangeAssetNameActionBuilder implements Builder { /** + * @var ?string */ private $assetId; /** + * @var ?string */ private $assetKey; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; @@ -40,6 +43,7 @@ final class CategoryChangeAssetNameActionBuilder implements Builder /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetId() @@ -50,6 +54,7 @@ public function getAssetId() /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetKey() @@ -60,6 +65,7 @@ public function getAssetKey() /** *

New value to set. Must not be empty.

* + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeAssetNameActionModel.php b/lib/commercetools-api/src/Models/Category/CategoryChangeAssetNameActionModel.php index 110d7df5ba1..4d9239b929c 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeAssetNameActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeAssetNameActionModel.php @@ -23,21 +23,25 @@ final class CategoryChangeAssetNameActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'changeAssetName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $assetId; /** + * * @var ?string */ protected $assetKey; /** + * * @var ?LocalizedString */ protected $name; @@ -49,15 +53,17 @@ final class CategoryChangeAssetNameActionModel extends JsonObjectModel implement public function __construct( ?string $assetId = null, ?string $assetKey = null, - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $action = null ) { $this->assetId = $assetId; $this->assetKey = $assetKey; $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() /** *

New value to set. Either assetId or assetKey is required.

* + * * @return null|string */ public function getAssetId() @@ -96,6 +103,7 @@ public function getAssetId() /** *

New value to set. Either assetId or assetKey is required.

* + * * @return null|string */ public function getAssetKey() @@ -115,6 +123,7 @@ public function getAssetKey() /** *

New value to set. Must not be empty.

* + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeAssetOrderAction.php b/lib/commercetools-api/src/Models/Category/CategoryChangeAssetOrderAction.php index 3b6fc550069..3d452ee4a7f 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeAssetOrderAction.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeAssetOrderAction.php @@ -18,6 +18,7 @@ interface CategoryChangeAssetOrderAction extends CategoryUpdateAction /** *

New value to set. Must contain all Asset ids.

* + * @return null|array */ public function getAssetOrder(); diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeAssetOrderActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategoryChangeAssetOrderActionBuilder.php index 0f38d8defcc..aa2514631d6 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeAssetOrderActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeAssetOrderActionBuilder.php @@ -21,6 +21,7 @@ final class CategoryChangeAssetOrderActionBuilder implements Builder { /** + * @var ?array */ private $assetOrder; @@ -28,6 +29,7 @@ final class CategoryChangeAssetOrderActionBuilder implements Builder /** *

New value to set. Must contain all Asset ids.

* + * @return null|array */ public function getAssetOrder() diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeAssetOrderActionModel.php b/lib/commercetools-api/src/Models/Category/CategoryChangeAssetOrderActionModel.php index 13ea1b1b6d3..28876c40999 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeAssetOrderActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeAssetOrderActionModel.php @@ -21,11 +21,13 @@ final class CategoryChangeAssetOrderActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'changeAssetOrder'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $assetOrder; @@ -35,13 +37,15 @@ final class CategoryChangeAssetOrderActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?array $assetOrder = null + ?array $assetOrder = null, + ?string $action = null ) { $this->assetOrder = $assetOrder; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

New value to set. Must contain all Asset ids.

* + * * @return null|array */ public function getAssetOrder() diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeNameAction.php b/lib/commercetools-api/src/Models/Category/CategoryChangeNameAction.php index 139b45d3d55..56ca886e109 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeNameAction.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeNameAction.php @@ -19,6 +19,7 @@ interface CategoryChangeNameAction extends CategoryUpdateAction /** *

New value to set. Must not be empty.

* + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeNameActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategoryChangeNameActionBuilder.php index 8f46ed9a2be..3493ca74fd5 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeNameActionBuilder.php @@ -23,6 +23,7 @@ final class CategoryChangeNameActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; @@ -30,6 +31,7 @@ final class CategoryChangeNameActionBuilder implements Builder /** *

New value to set. Must not be empty.

* + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeNameActionModel.php b/lib/commercetools-api/src/Models/Category/CategoryChangeNameActionModel.php index 14473676fe7..6a835bb5258 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeNameActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeNameActionModel.php @@ -23,11 +23,13 @@ final class CategoryChangeNameActionModel extends JsonObjectModel implements Cat { public const DISCRIMINATOR_VALUE = 'changeName'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $name; @@ -37,13 +39,15 @@ final class CategoryChangeNameActionModel extends JsonObjectModel implements Cat * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

New value to set. Must not be empty.

* + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeOrderHintAction.php b/lib/commercetools-api/src/Models/Category/CategoryChangeOrderHintAction.php index f7a65492500..717b5b8a020 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeOrderHintAction.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeOrderHintAction.php @@ -18,6 +18,7 @@ interface CategoryChangeOrderHintAction extends CategoryUpdateAction /** *

New value to set. Must be a decimal value between 0 and 1.

* + * @return null|string */ public function getOrderHint(); diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeOrderHintActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategoryChangeOrderHintActionBuilder.php index 766817c2c32..2d74390fbe1 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeOrderHintActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeOrderHintActionBuilder.php @@ -21,6 +21,7 @@ final class CategoryChangeOrderHintActionBuilder implements Builder { /** + * @var ?string */ private $orderHint; @@ -28,6 +29,7 @@ final class CategoryChangeOrderHintActionBuilder implements Builder /** *

New value to set. Must be a decimal value between 0 and 1.

* + * @return null|string */ public function getOrderHint() diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeOrderHintActionModel.php b/lib/commercetools-api/src/Models/Category/CategoryChangeOrderHintActionModel.php index c9fce39e0bf..3c7ab5c2538 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeOrderHintActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeOrderHintActionModel.php @@ -21,11 +21,13 @@ final class CategoryChangeOrderHintActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'changeOrderHint'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $orderHint; @@ -35,13 +37,15 @@ final class CategoryChangeOrderHintActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?string $orderHint = null + ?string $orderHint = null, + ?string $action = null ) { $this->orderHint = $orderHint; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

New value to set. Must be a decimal value between 0 and 1.

* + * * @return null|string */ public function getOrderHint() diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeParentAction.php b/lib/commercetools-api/src/Models/Category/CategoryChangeParentAction.php index 221a47b31ac..91aba471bd5 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeParentAction.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeParentAction.php @@ -18,6 +18,7 @@ interface CategoryChangeParentAction extends CategoryUpdateAction /** *

New value to set as parent.

* + * @return null|CategoryResourceIdentifier */ public function getParent(); diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeParentActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategoryChangeParentActionBuilder.php index fe63f1c7770..e60bb02ed40 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeParentActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeParentActionBuilder.php @@ -21,6 +21,7 @@ final class CategoryChangeParentActionBuilder implements Builder { /** + * @var null|CategoryResourceIdentifier|CategoryResourceIdentifierBuilder */ private $parent; @@ -28,6 +29,7 @@ final class CategoryChangeParentActionBuilder implements Builder /** *

New value to set as parent.

* + * @return null|CategoryResourceIdentifier */ public function getParent() diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeParentActionModel.php b/lib/commercetools-api/src/Models/Category/CategoryChangeParentActionModel.php index 4ae415b2bc9..f4c93620709 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeParentActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeParentActionModel.php @@ -21,11 +21,13 @@ final class CategoryChangeParentActionModel extends JsonObjectModel implements C { public const DISCRIMINATOR_VALUE = 'changeParent'; /** + * * @var ?string */ protected $action; /** + * * @var ?CategoryResourceIdentifier */ protected $parent; @@ -35,13 +37,15 @@ final class CategoryChangeParentActionModel extends JsonObjectModel implements C * @psalm-suppress MissingParamType */ public function __construct( - ?CategoryResourceIdentifier $parent = null + ?CategoryResourceIdentifier $parent = null, + ?string $action = null ) { $this->parent = $parent; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

New value to set as parent.

* + * * @return null|CategoryResourceIdentifier */ public function getParent() diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeSlugAction.php b/lib/commercetools-api/src/Models/Category/CategoryChangeSlugAction.php index a93cda74e30..bf85b6198ce 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeSlugAction.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeSlugAction.php @@ -21,6 +21,7 @@ interface CategoryChangeSlugAction extends CategoryUpdateAction * A Category can have the same slug for different Locales, but it must be unique across the Project. * Valid slugs must match the pattern ^[A-Za-z0-9_-]{2,256}+$.

* + * @return null|LocalizedString */ public function getSlug(); diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeSlugActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategoryChangeSlugActionBuilder.php index e7b52e43de2..b03be79f865 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeSlugActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeSlugActionBuilder.php @@ -23,6 +23,7 @@ final class CategoryChangeSlugActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; @@ -32,6 +33,7 @@ final class CategoryChangeSlugActionBuilder implements Builder * A Category can have the same slug for different Locales, but it must be unique across the Project. * Valid slugs must match the pattern ^[A-Za-z0-9_-]{2,256}+$.

* + * @return null|LocalizedString */ public function getSlug() diff --git a/lib/commercetools-api/src/Models/Category/CategoryChangeSlugActionModel.php b/lib/commercetools-api/src/Models/Category/CategoryChangeSlugActionModel.php index 8e77dcd32d7..dc0be60a07e 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryChangeSlugActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategoryChangeSlugActionModel.php @@ -23,11 +23,13 @@ final class CategoryChangeSlugActionModel extends JsonObjectModel implements Cat { public const DISCRIMINATOR_VALUE = 'changeSlug'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $slug; @@ -37,13 +39,15 @@ final class CategoryChangeSlugActionModel extends JsonObjectModel implements Cat * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $slug = null + ?LocalizedString $slug = null, + ?string $action = null ) { $this->slug = $slug; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -65,6 +69,7 @@ public function getAction() * A Category can have the same slug for different Locales, but it must be unique across the Project. * Valid slugs must match the pattern ^[A-Za-z0-9_-]{2,256}+$.

* + * * @return null|LocalizedString */ public function getSlug() diff --git a/lib/commercetools-api/src/Models/Category/CategoryDraft.php b/lib/commercetools-api/src/Models/Category/CategoryDraft.php index 79626437492..e00aa2ac2f0 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryDraft.php +++ b/lib/commercetools-api/src/Models/Category/CategoryDraft.php @@ -32,6 +32,7 @@ interface CategoryDraft extends JsonObject /** *

Name of the Category.

* + * @return null|LocalizedString */ public function getName(); @@ -41,6 +42,7 @@ public function getName(); * A Category can have the same slug for different Locales, but it must be unique across the Project. * Valid slugs must match the pattern ^[A-Za-z0-9_-]{2,256}+$.

* + * @return null|LocalizedString */ public function getSlug(); @@ -48,6 +50,7 @@ public function getSlug(); /** *

Description of the Category.

* + * @return null|LocalizedString */ public function getDescription(); @@ -56,6 +59,7 @@ public function getDescription(); *

Parent Category of the Category. * The parent can be set by its id or key.

* + * @return null|CategoryResourceIdentifier */ public function getParent(); @@ -64,6 +68,7 @@ public function getParent(); *

Decimal value between 0 and 1 used to order Categories that are on the same level in the Category tree. * If not set, a random value will be assigned.

* + * @return null|string */ public function getOrderHint(); @@ -71,6 +76,7 @@ public function getOrderHint(); /** *

Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

* + * @return null|string */ public function getExternalId(); @@ -78,6 +84,7 @@ public function getExternalId(); /** *

Name of the Category used by external search engines for improved search engine performance.

* + * @return null|LocalizedString */ public function getMetaTitle(); @@ -85,6 +92,7 @@ public function getMetaTitle(); /** *

Description of the Category used by external search engines for improved search engine performance.

* + * @return null|LocalizedString */ public function getMetaDescription(); @@ -92,6 +100,7 @@ public function getMetaDescription(); /** *

Keywords related to the Category for improved search engine performance.

* + * @return null|LocalizedString */ public function getMetaKeywords(); @@ -99,6 +108,7 @@ public function getMetaKeywords(); /** *

Custom Fields for the Category.

* + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -106,6 +116,7 @@ public function getCustom(); /** *

Media related to the Category.

* + * @return null|AssetDraftCollection */ public function getAssets(); @@ -113,6 +124,7 @@ public function getAssets(); /** *

User-defined unique identifier for the Category.

* + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Category/CategoryDraftBuilder.php b/lib/commercetools-api/src/Models/Category/CategoryDraftBuilder.php index 21cce0b1275..9808f2292cd 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategoryDraftBuilder.php @@ -26,61 +26,73 @@ final class CategoryDraftBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var null|CategoryResourceIdentifier|CategoryResourceIdentifierBuilder */ private $parent; /** + * @var ?string */ private $orderHint; /** + * @var ?string */ private $externalId; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaTitle; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaDescription; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaKeywords; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var ?AssetDraftCollection */ private $assets; /** + * @var ?string */ private $key; @@ -88,6 +100,7 @@ final class CategoryDraftBuilder implements Builder /** *

Name of the Category.

* + * @return null|LocalizedString */ public function getName() @@ -100,6 +113,7 @@ public function getName() * A Category can have the same slug for different Locales, but it must be unique across the Project. * Valid slugs must match the pattern ^[A-Za-z0-9_-]{2,256}+$.

* + * @return null|LocalizedString */ public function getSlug() @@ -110,6 +124,7 @@ public function getSlug() /** *

Description of the Category.

* + * @return null|LocalizedString */ public function getDescription() @@ -121,6 +136,7 @@ public function getDescription() *

Parent Category of the Category. * The parent can be set by its id or key.

* + * @return null|CategoryResourceIdentifier */ public function getParent() @@ -132,6 +148,7 @@ public function getParent() *

Decimal value between 0 and 1 used to order Categories that are on the same level in the Category tree. * If not set, a random value will be assigned.

* + * @return null|string */ public function getOrderHint() @@ -142,6 +159,7 @@ public function getOrderHint() /** *

Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

* + * @return null|string */ public function getExternalId() @@ -152,6 +170,7 @@ public function getExternalId() /** *

Name of the Category used by external search engines for improved search engine performance.

* + * @return null|LocalizedString */ public function getMetaTitle() @@ -162,6 +181,7 @@ public function getMetaTitle() /** *

Description of the Category used by external search engines for improved search engine performance.

* + * @return null|LocalizedString */ public function getMetaDescription() @@ -172,6 +192,7 @@ public function getMetaDescription() /** *

Keywords related to the Category for improved search engine performance.

* + * @return null|LocalizedString */ public function getMetaKeywords() @@ -182,6 +203,7 @@ public function getMetaKeywords() /** *

Custom Fields for the Category.

* + * @return null|CustomFieldsDraft */ public function getCustom() @@ -192,6 +214,7 @@ public function getCustom() /** *

Media related to the Category.

* + * @return null|AssetDraftCollection */ public function getAssets() @@ -202,6 +225,7 @@ public function getAssets() /** *

User-defined unique identifier for the Category.

* + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Category/CategoryDraftModel.php b/lib/commercetools-api/src/Models/Category/CategoryDraftModel.php index 319565c5db3..867f70e21e5 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryDraftModel.php +++ b/lib/commercetools-api/src/Models/Category/CategoryDraftModel.php @@ -25,61 +25,73 @@ final class CategoryDraftModel extends JsonObjectModel implements CategoryDraft { /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $slug; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?CategoryResourceIdentifier */ protected $parent; /** + * * @var ?string */ protected $orderHint; /** + * * @var ?string */ protected $externalId; /** + * * @var ?LocalizedString */ protected $metaTitle; /** + * * @var ?LocalizedString */ protected $metaDescription; /** + * * @var ?LocalizedString */ protected $metaKeywords; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?AssetDraftCollection */ protected $assets; /** + * * @var ?string */ protected $key; @@ -119,6 +131,7 @@ public function __construct( /** *

Name of the Category.

* + * * @return null|LocalizedString */ public function getName() @@ -141,6 +154,7 @@ public function getName() * A Category can have the same slug for different Locales, but it must be unique across the Project. * Valid slugs must match the pattern ^[A-Za-z0-9_-]{2,256}+$.

* + * * @return null|LocalizedString */ public function getSlug() @@ -161,6 +175,7 @@ public function getSlug() /** *

Description of the Category.

* + * * @return null|LocalizedString */ public function getDescription() @@ -182,6 +197,7 @@ public function getDescription() *

Parent Category of the Category. * The parent can be set by its id or key.

* + * * @return null|CategoryResourceIdentifier */ public function getParent() @@ -203,6 +219,7 @@ public function getParent() *

Decimal value between 0 and 1 used to order Categories that are on the same level in the Category tree. * If not set, a random value will be assigned.

* + * * @return null|string */ public function getOrderHint() @@ -222,6 +239,7 @@ public function getOrderHint() /** *

Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

* + * * @return null|string */ public function getExternalId() @@ -241,6 +259,7 @@ public function getExternalId() /** *

Name of the Category used by external search engines for improved search engine performance.

* + * * @return null|LocalizedString */ public function getMetaTitle() @@ -261,6 +280,7 @@ public function getMetaTitle() /** *

Description of the Category used by external search engines for improved search engine performance.

* + * * @return null|LocalizedString */ public function getMetaDescription() @@ -281,6 +301,7 @@ public function getMetaDescription() /** *

Keywords related to the Category for improved search engine performance.

* + * * @return null|LocalizedString */ public function getMetaKeywords() @@ -301,6 +322,7 @@ public function getMetaKeywords() /** *

Custom Fields for the Category.

* + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -321,6 +343,7 @@ public function getCustom() /** *

Media related to the Category.

* + * * @return null|AssetDraftCollection */ public function getAssets() @@ -340,6 +363,7 @@ public function getAssets() /** *

User-defined unique identifier for the Category.

* + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Category/CategoryModel.php b/lib/commercetools-api/src/Models/Category/CategoryModel.php index f522aa38694..b537a477eb1 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryModel.php +++ b/lib/commercetools-api/src/Models/Category/CategoryModel.php @@ -32,96 +32,115 @@ final class CategoryModel extends JsonObjectModel implements Category { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $slug; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?CategoryReferenceCollection */ protected $ancestors; /** + * * @var ?CategoryReference */ protected $parent; /** + * * @var ?string */ protected $orderHint; /** + * * @var ?string */ protected $externalId; /** + * * @var ?LocalizedString */ protected $metaTitle; /** + * * @var ?LocalizedString */ protected $metaDescription; /** + * * @var ?LocalizedString */ protected $metaKeywords; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?AssetCollection */ protected $assets; /** + * * @var ?string */ protected $key; @@ -175,6 +194,7 @@ public function __construct( /** *

Unique identifier of the Category.

* + * * @return null|string */ public function getId() @@ -194,6 +214,7 @@ public function getId() /** *

Current version of the Category.

* + * * @return null|int */ public function getVersion() @@ -213,6 +234,7 @@ public function getVersion() /** *

Date and time (UTC) the Category was initially created.

* + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -236,6 +258,7 @@ public function getCreatedAt() /** *

Date and time (UTC) the Category was last updated.

* + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -259,6 +282,7 @@ public function getLastModifiedAt() /** *

Present on resources updated after 1 February 2019 except for events not tracked.

* + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -279,6 +303,7 @@ public function getLastModifiedBy() /** *

Present on resources created after 1 February 2019 except for events not tracked.

* + * * @return null|CreatedBy */ public function getCreatedBy() @@ -299,6 +324,7 @@ public function getCreatedBy() /** *

Name of the Category.

* + * * @return null|LocalizedString */ public function getName() @@ -322,6 +348,7 @@ public function getName() * Valid slugs match the pattern ^[A-Za-z0-9_-]{2,256}+$. * For good performance, indexes are provided for the first 15 languages set in a Project.

* + * * @return null|LocalizedString */ public function getSlug() @@ -342,6 +369,7 @@ public function getSlug() /** *

Description of the Category.

* + * * @return null|LocalizedString */ public function getDescription() @@ -362,6 +390,7 @@ public function getDescription() /** *

Contains the parent path towards the root Category.

* + * * @return null|CategoryReferenceCollection */ public function getAncestors() @@ -381,6 +410,7 @@ public function getAncestors() /** *

Parent Category of this Category.

* + * * @return null|CategoryReference */ public function getParent() @@ -401,6 +431,7 @@ public function getParent() /** *

Decimal value between 0 and 1 used to order Categories that are on the same level in the Category tree.

* + * * @return null|string */ public function getOrderHint() @@ -420,6 +451,7 @@ public function getOrderHint() /** *

Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

* + * * @return null|string */ public function getExternalId() @@ -439,6 +471,7 @@ public function getExternalId() /** *

Name of the Category used by external search engines for improved search engine performance.

* + * * @return null|LocalizedString */ public function getMetaTitle() @@ -459,6 +492,7 @@ public function getMetaTitle() /** *

Description of the Category used by external search engines for improved search engine performance.

* + * * @return null|LocalizedString */ public function getMetaDescription() @@ -479,6 +513,7 @@ public function getMetaDescription() /** *

Keywords related to the Category for improved search engine performance.

* + * * @return null|LocalizedString */ public function getMetaKeywords() @@ -499,6 +534,7 @@ public function getMetaKeywords() /** *

Custom Fields for the Category.

* + * * @return null|CustomFields */ public function getCustom() @@ -519,6 +555,7 @@ public function getCustom() /** *

Media related to the Category.

* + * * @return null|AssetCollection */ public function getAssets() @@ -538,6 +575,7 @@ public function getAssets() /** *

User-defined unique identifier of the Category.

* + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Category/CategoryPagedQueryResponse.php b/lib/commercetools-api/src/Models/Category/CategoryPagedQueryResponse.php index 3e7337da56e..67881be9372 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Category/CategoryPagedQueryResponse.php @@ -22,6 +22,7 @@ interface CategoryPagedQueryResponse extends JsonObject /** *

Number of results requested.

* + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

Number of elements skipped.

* + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

Actual number of results returned.

* + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

* + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

Category matching the query.

* + * @return null|CategoryCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/Category/CategoryPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Category/CategoryPagedQueryResponseBuilder.php index 8bf883705f2..71ba72cd877 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategoryPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class CategoryPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?CategoryCollection */ private $results; @@ -48,6 +53,7 @@ final class CategoryPagedQueryResponseBuilder implements Builder /** *

Number of results requested.

* + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

Number of elements skipped.

* + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

Actual number of results returned.

* + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

* + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

Category matching the query.

* + * @return null|CategoryCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Category/CategoryPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Category/CategoryPagedQueryResponseModel.php index 44c0bf26488..cc2a1fe83c1 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Category/CategoryPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class CategoryPagedQueryResponseModel extends JsonObjectModel implements CategoryPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?CategoryCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

Number of results requested.

* + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

Number of elements skipped.

* + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

Actual number of results returned.

* + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

* + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

Category matching the query.

* + * * @return null|CategoryCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Category/CategoryReference.php b/lib/commercetools-api/src/Models/Category/CategoryReference.php index 15b502bb89a..5e528c2c8dc 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryReference.php +++ b/lib/commercetools-api/src/Models/Category/CategoryReference.php @@ -19,6 +19,7 @@ interface CategoryReference extends Reference /** *

Contains the representation of the expanded Category. Only present in responses to requests with Reference Expansion for Categories.

* + * @return null|Category */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

Unique identifier of the referenced Category.

* + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/Category/CategoryReferenceBuilder.php b/lib/commercetools-api/src/Models/Category/CategoryReferenceBuilder.php index 8d0e309ff53..22990e90d0c 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategoryReferenceBuilder.php @@ -23,11 +23,13 @@ final class CategoryReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|Category|CategoryBuilder */ private $obj; @@ -35,6 +37,7 @@ final class CategoryReferenceBuilder implements Builder /** *

Unique identifier of the referenced Category.

* + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

Contains the representation of the expanded Category. Only present in responses to requests with Reference Expansion for Categories.

* + * @return null|Category */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Category/CategoryReferenceModel.php b/lib/commercetools-api/src/Models/Category/CategoryReferenceModel.php index ffc6e2cbb1b..a84b2c30263 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryReferenceModel.php +++ b/lib/commercetools-api/src/Models/Category/CategoryReferenceModel.php @@ -23,16 +23,19 @@ final class CategoryReferenceModel extends JsonObjectModel implements CategoryRe { public const DISCRIMINATOR_VALUE = 'category'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?Category */ protected $obj; @@ -43,16 +46,18 @@ final class CategoryReferenceModel extends JsonObjectModel implements CategoryRe */ public function __construct( ?string $id = null, - ?Category $obj = null + ?Category $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

Type of referenced resource.

* + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

Unique identifier of the referenced Category.

* + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

Contains the representation of the expanded Category. Only present in responses to requests with Reference Expansion for Categories.

* + * * @return null|Category */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Category/CategoryRemoveAssetAction.php b/lib/commercetools-api/src/Models/Category/CategoryRemoveAssetAction.php index dd3d33470a2..49ec717fabd 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryRemoveAssetAction.php +++ b/lib/commercetools-api/src/Models/Category/CategoryRemoveAssetAction.php @@ -19,6 +19,7 @@ interface CategoryRemoveAssetAction extends CategoryUpdateAction /** *

Value to remove. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetId(); @@ -26,6 +27,7 @@ public function getAssetId(); /** *

Value to remove. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetKey(); diff --git a/lib/commercetools-api/src/Models/Category/CategoryRemoveAssetActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategoryRemoveAssetActionBuilder.php index 8ea652beb6e..379763ae220 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryRemoveAssetActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategoryRemoveAssetActionBuilder.php @@ -21,11 +21,13 @@ final class CategoryRemoveAssetActionBuilder implements Builder { /** + * @var ?string */ private $assetId; /** + * @var ?string */ private $assetKey; @@ -33,6 +35,7 @@ final class CategoryRemoveAssetActionBuilder implements Builder /** *

Value to remove. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetId() @@ -43,6 +46,7 @@ public function getAssetId() /** *

Value to remove. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetKey() diff --git a/lib/commercetools-api/src/Models/Category/CategoryRemoveAssetActionModel.php b/lib/commercetools-api/src/Models/Category/CategoryRemoveAssetActionModel.php index d54789e7419..f0b2cdda05a 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryRemoveAssetActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategoryRemoveAssetActionModel.php @@ -21,16 +21,19 @@ final class CategoryRemoveAssetActionModel extends JsonObjectModel implements Ca { public const DISCRIMINATOR_VALUE = 'removeAsset'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $assetId; /** + * * @var ?string */ protected $assetKey; @@ -41,14 +44,16 @@ final class CategoryRemoveAssetActionModel extends JsonObjectModel implements Ca */ public function __construct( ?string $assetId = null, - ?string $assetKey = null + ?string $assetKey = null, + ?string $action = null ) { $this->assetId = $assetId; $this->assetKey = $assetKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

Value to remove. Either assetId or assetKey is required.

* + * * @return null|string */ public function getAssetId() @@ -87,6 +93,7 @@ public function getAssetId() /** *

Value to remove. Either assetId or assetKey is required.

* + * * @return null|string */ public function getAssetKey() diff --git a/lib/commercetools-api/src/Models/Category/CategoryResourceIdentifier.php b/lib/commercetools-api/src/Models/Category/CategoryResourceIdentifier.php index db63bebae52..3fa33c87b4a 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/Category/CategoryResourceIdentifier.php @@ -17,6 +17,7 @@ interface CategoryResourceIdentifier extends ResourceIdentifier /** *

Unique identifier of the referenced Category. Either id or key is required.

* + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

User-defined unique identifier of the referenced Category. Either id or key is required.

* + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Category/CategoryResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/Category/CategoryResourceIdentifierBuilder.php index 740c263ffd0..d8319cb6992 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategoryResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class CategoryResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class CategoryResourceIdentifierBuilder implements Builder /** *

Unique identifier of the referenced Category. Either id or key is required.

* + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

User-defined unique identifier of the referenced Category. Either id or key is required.

* + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Category/CategoryResourceIdentifierModel.php b/lib/commercetools-api/src/Models/Category/CategoryResourceIdentifierModel.php index d7e1cc0e671..bb0282b9f1a 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/Category/CategoryResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class CategoryResourceIdentifierModel extends JsonObjectModel implements C { public const DISCRIMINATOR_VALUE = 'category'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class CategoryResourceIdentifierModel extends JsonObjectModel implements C */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

* + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

Unique identifier of the referenced Category. Either id or key is required.

* + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

User-defined unique identifier of the referenced Category. Either id or key is required.

* + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomFieldAction.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomFieldAction.php index fab80119a36..5dbbbd33b03 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomFieldAction.php @@ -21,6 +21,7 @@ interface CategorySetAssetCustomFieldAction extends CategoryUpdateAction /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetId(); @@ -28,6 +29,7 @@ public function getAssetId(); /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetKey(); @@ -35,6 +37,7 @@ public function getAssetKey(); /** *

Name of the Custom Field.

* + * @return null|string */ public function getName(); @@ -44,6 +47,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomFieldActionBuilder.php index bc8d5ce714e..8ed1bab0d3d 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class CategorySetAssetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $assetId; /** + * @var ?string */ private $assetKey; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -43,6 +47,7 @@ final class CategorySetAssetCustomFieldActionBuilder implements Builder /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetId() @@ -53,6 +58,7 @@ public function getAssetId() /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetKey() @@ -63,6 +69,7 @@ public function getAssetKey() /** *

Name of the Custom Field.

* + * @return null|string */ public function getName() @@ -75,6 +82,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomFieldActionModel.php index 303efa8bd75..851f34ade9c 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomFieldActionModel.php @@ -21,26 +21,31 @@ final class CategorySetAssetCustomFieldActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setAssetCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $assetId; /** + * * @var ?string */ protected $assetKey; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -53,16 +58,18 @@ public function __construct( ?string $assetId = null, ?string $assetKey = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->assetId = $assetId; $this->assetKey = $assetKey; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -82,6 +89,7 @@ public function getAction() /** *

New value to set. Either assetId or assetKey is required.

* + * * @return null|string */ public function getAssetId() @@ -101,6 +109,7 @@ public function getAssetId() /** *

New value to set. Either assetId or assetKey is required.

* + * * @return null|string */ public function getAssetKey() @@ -120,6 +129,7 @@ public function getAssetKey() /** *

Name of the Custom Field.

* + * * @return null|string */ public function getName() @@ -141,6 +151,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomTypeAction.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomTypeAction.php index b489d1d17b2..8bd77dfb80c 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomTypeAction.php @@ -23,6 +23,7 @@ interface CategorySetAssetCustomTypeAction extends CategoryUpdateAction /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetId(); @@ -30,6 +31,7 @@ public function getAssetId(); /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetKey(); @@ -38,6 +40,7 @@ public function getAssetKey(); *

Defines the Type that extends the Asset with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Asset.

* + * @return null|TypeResourceIdentifier */ public function getType(); @@ -45,6 +48,7 @@ public function getType(); /** *

Sets the Custom Fields fields for the Asset.

* + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomTypeActionBuilder.php index 5505b9c7f7c..ad074ff7f51 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class CategorySetAssetCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $assetId; /** + * @var ?string */ private $assetKey; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -47,6 +51,7 @@ final class CategorySetAssetCustomTypeActionBuilder implements Builder /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetId() @@ -57,6 +62,7 @@ public function getAssetId() /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetKey() @@ -68,6 +74,7 @@ public function getAssetKey() *

Defines the Type that extends the Asset with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Asset.

* + * @return null|TypeResourceIdentifier */ public function getType() @@ -78,6 +85,7 @@ public function getType() /** *

Sets the Custom Fields fields for the Asset.

* + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomTypeActionModel.php index c9f93c356bd..adaa463fa41 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetCustomTypeActionModel.php @@ -25,26 +25,31 @@ final class CategorySetAssetCustomTypeActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setAssetCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $assetId; /** + * * @var ?string */ protected $assetKey; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -57,16 +62,18 @@ public function __construct( ?string $assetId = null, ?string $assetKey = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->assetId = $assetId; $this->assetKey = $assetKey; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -86,6 +93,7 @@ public function getAction() /** *

New value to set. Either assetId or assetKey is required.

* + * * @return null|string */ public function getAssetId() @@ -105,6 +113,7 @@ public function getAssetId() /** *

New value to set. Either assetId or assetKey is required.

* + * * @return null|string */ public function getAssetKey() @@ -125,6 +134,7 @@ public function getAssetKey() *

Defines the Type that extends the Asset with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Asset.

* + * * @return null|TypeResourceIdentifier */ public function getType() @@ -145,6 +155,7 @@ public function getType() /** *

Sets the Custom Fields fields for the Asset.

* + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetDescriptionAction.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetDescriptionAction.php index 1e08676a5e0..23ce995db44 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetDescriptionAction.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetDescriptionAction.php @@ -21,6 +21,7 @@ interface CategorySetAssetDescriptionAction extends CategoryUpdateAction /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetId(); @@ -28,6 +29,7 @@ public function getAssetId(); /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetKey(); @@ -35,6 +37,7 @@ public function getAssetKey(); /** *

Value to set. If empty, any existing value will be removed.

* + * @return null|LocalizedString */ public function getDescription(); diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetDescriptionActionBuilder.php index e833ead665f..126a6e69c13 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetDescriptionActionBuilder.php @@ -23,16 +23,19 @@ final class CategorySetAssetDescriptionActionBuilder implements Builder { /** + * @var ?string */ private $assetId; /** + * @var ?string */ private $assetKey; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; @@ -40,6 +43,7 @@ final class CategorySetAssetDescriptionActionBuilder implements Builder /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetId() @@ -50,6 +54,7 @@ public function getAssetId() /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetKey() @@ -60,6 +65,7 @@ public function getAssetKey() /** *

Value to set. If empty, any existing value will be removed.

* + * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetDescriptionActionModel.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetDescriptionActionModel.php index e8d6f26019f..664f7cf87d7 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetDescriptionActionModel.php @@ -23,21 +23,25 @@ final class CategorySetAssetDescriptionActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setAssetDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $assetId; /** + * * @var ?string */ protected $assetKey; /** + * * @var ?LocalizedString */ protected $description; @@ -49,15 +53,17 @@ final class CategorySetAssetDescriptionActionModel extends JsonObjectModel imple public function __construct( ?string $assetId = null, ?string $assetKey = null, - ?LocalizedString $description = null + ?LocalizedString $description = null, + ?string $action = null ) { $this->assetId = $assetId; $this->assetKey = $assetKey; $this->description = $description; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() /** *

New value to set. Either assetId or assetKey is required.

* + * * @return null|string */ public function getAssetId() @@ -96,6 +103,7 @@ public function getAssetId() /** *

New value to set. Either assetId or assetKey is required.

* + * * @return null|string */ public function getAssetKey() @@ -115,6 +123,7 @@ public function getAssetKey() /** *

Value to set. If empty, any existing value will be removed.

* + * * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetKeyAction.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetKeyAction.php index 974fb49a6c4..b2147066458 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetKeyAction.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetKeyAction.php @@ -19,6 +19,7 @@ interface CategorySetAssetKeyAction extends CategoryUpdateAction /** *

Value to set.

* + * @return null|string */ public function getAssetId(); @@ -26,6 +27,7 @@ public function getAssetId(); /** *

Value to set. If empty, any existing value will be removed.

* + * @return null|string */ public function getAssetKey(); diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetKeyActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetKeyActionBuilder.php index 7b4d42b6cc7..937f7951556 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetKeyActionBuilder.php @@ -21,11 +21,13 @@ final class CategorySetAssetKeyActionBuilder implements Builder { /** + * @var ?string */ private $assetId; /** + * @var ?string */ private $assetKey; @@ -33,6 +35,7 @@ final class CategorySetAssetKeyActionBuilder implements Builder /** *

Value to set.

* + * @return null|string */ public function getAssetId() @@ -43,6 +46,7 @@ public function getAssetId() /** *

Value to set. If empty, any existing value will be removed.

* + * @return null|string */ public function getAssetKey() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetKeyActionModel.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetKeyActionModel.php index 07048dc764d..006b0f1139f 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetKeyActionModel.php @@ -21,16 +21,19 @@ final class CategorySetAssetKeyActionModel extends JsonObjectModel implements Ca { public const DISCRIMINATOR_VALUE = 'setAssetKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $assetId; /** + * * @var ?string */ protected $assetKey; @@ -41,14 +44,16 @@ final class CategorySetAssetKeyActionModel extends JsonObjectModel implements Ca */ public function __construct( ?string $assetId = null, - ?string $assetKey = null + ?string $assetKey = null, + ?string $action = null ) { $this->assetId = $assetId; $this->assetKey = $assetKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

Value to set.

* + * * @return null|string */ public function getAssetId() @@ -87,6 +93,7 @@ public function getAssetId() /** *

Value to set. If empty, any existing value will be removed.

* + * * @return null|string */ public function getAssetKey() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetSourcesAction.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetSourcesAction.php index 346dda68d6e..3e5c2abebaa 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetSourcesAction.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetSourcesAction.php @@ -21,6 +21,7 @@ interface CategorySetAssetSourcesAction extends CategoryUpdateAction /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetId(); @@ -28,6 +29,7 @@ public function getAssetId(); /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetKey(); @@ -35,6 +37,7 @@ public function getAssetKey(); /** *

Must not be empty. At least one entry is required.

* + * @return null|AssetSourceCollection */ public function getSources(); diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetSourcesActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetSourcesActionBuilder.php index 11dc00301cf..7aea21fceb5 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetSourcesActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetSourcesActionBuilder.php @@ -22,16 +22,19 @@ final class CategorySetAssetSourcesActionBuilder implements Builder { /** + * @var ?string */ private $assetId; /** + * @var ?string */ private $assetKey; /** + * @var ?AssetSourceCollection */ private $sources; @@ -39,6 +42,7 @@ final class CategorySetAssetSourcesActionBuilder implements Builder /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetId() @@ -49,6 +53,7 @@ public function getAssetId() /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetKey() @@ -59,6 +64,7 @@ public function getAssetKey() /** *

Must not be empty. At least one entry is required.

* + * @return null|AssetSourceCollection */ public function getSources() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetSourcesActionModel.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetSourcesActionModel.php index ca00c01d021..293634da421 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetSourcesActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetSourcesActionModel.php @@ -22,21 +22,25 @@ final class CategorySetAssetSourcesActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'setAssetSources'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $assetId; /** + * * @var ?string */ protected $assetKey; /** + * * @var ?AssetSourceCollection */ protected $sources; @@ -48,15 +52,17 @@ final class CategorySetAssetSourcesActionModel extends JsonObjectModel implement public function __construct( ?string $assetId = null, ?string $assetKey = null, - ?AssetSourceCollection $sources = null + ?AssetSourceCollection $sources = null, + ?string $action = null ) { $this->assetId = $assetId; $this->assetKey = $assetKey; $this->sources = $sources; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -76,6 +82,7 @@ public function getAction() /** *

New value to set. Either assetId or assetKey is required.

* + * * @return null|string */ public function getAssetId() @@ -95,6 +102,7 @@ public function getAssetId() /** *

New value to set. Either assetId or assetKey is required.

* + * * @return null|string */ public function getAssetKey() @@ -114,6 +122,7 @@ public function getAssetKey() /** *

Must not be empty. At least one entry is required.

* + * * @return null|AssetSourceCollection */ public function getSources() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetTagsAction.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetTagsAction.php index ce580845a7a..93ddb48aef8 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetTagsAction.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetTagsAction.php @@ -20,6 +20,7 @@ interface CategorySetAssetTagsAction extends CategoryUpdateAction /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetId(); @@ -27,6 +28,7 @@ public function getAssetId(); /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetKey(); @@ -34,6 +36,7 @@ public function getAssetKey(); /** *

Keywords for categorizing and organizing Assets.

* + * @return null|array */ public function getTags(); diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetTagsActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetTagsActionBuilder.php index c0c2ddbbbbe..82fcc925e41 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetTagsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetTagsActionBuilder.php @@ -21,16 +21,19 @@ final class CategorySetAssetTagsActionBuilder implements Builder { /** + * @var ?string */ private $assetId; /** + * @var ?string */ private $assetKey; /** + * @var ?array */ private $tags; @@ -38,6 +41,7 @@ final class CategorySetAssetTagsActionBuilder implements Builder /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetId() @@ -48,6 +52,7 @@ public function getAssetId() /** *

New value to set. Either assetId or assetKey is required.

* + * @return null|string */ public function getAssetKey() @@ -58,6 +63,7 @@ public function getAssetKey() /** *

Keywords for categorizing and organizing Assets.

* + * @return null|array */ public function getTags() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetAssetTagsActionModel.php b/lib/commercetools-api/src/Models/Category/CategorySetAssetTagsActionModel.php index 524f5123ba0..9ac71c50128 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetAssetTagsActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetAssetTagsActionModel.php @@ -21,21 +21,25 @@ final class CategorySetAssetTagsActionModel extends JsonObjectModel implements C { public const DISCRIMINATOR_VALUE = 'setAssetTags'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $assetId; /** + * * @var ?string */ protected $assetKey; /** + * * @var ?array */ protected $tags; @@ -47,15 +51,17 @@ final class CategorySetAssetTagsActionModel extends JsonObjectModel implements C public function __construct( ?string $assetId = null, ?string $assetKey = null, - ?array $tags = null + ?array $tags = null, + ?string $action = null ) { $this->assetId = $assetId; $this->assetKey = $assetKey; $this->tags = $tags; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -75,6 +81,7 @@ public function getAction() /** *

New value to set. Either assetId or assetKey is required.

* + * * @return null|string */ public function getAssetId() @@ -94,6 +101,7 @@ public function getAssetId() /** *

New value to set. Either assetId or assetKey is required.

* + * * @return null|string */ public function getAssetKey() @@ -113,6 +121,7 @@ public function getAssetKey() /** *

Keywords for categorizing and organizing Assets.

* + * * @return null|array */ public function getTags() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetCustomFieldAction.php b/lib/commercetools-api/src/Models/Category/CategorySetCustomFieldAction.php index 9413a4e8631..bcb2560a2ad 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetCustomFieldAction.php @@ -19,6 +19,7 @@ interface CategorySetCustomFieldAction extends CategoryUpdateAction /** *

Name of the Custom Field.

* + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Category/CategorySetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategorySetCustomFieldActionBuilder.php index 30c2a09a59b..d9f87504c46 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class CategorySetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class CategorySetCustomFieldActionBuilder implements Builder /** *

Name of the Custom Field.

* + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Category/CategorySetCustomFieldActionModel.php index 035fb60b382..f7491772baf 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class CategorySetCustomFieldActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class CategorySetCustomFieldActionModel extends JsonObjectModel implements */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

Name of the Custom Field.

* + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetCustomTypeAction.php b/lib/commercetools-api/src/Models/Category/CategorySetCustomTypeAction.php index bbc80fb5088..7444c93538b 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetCustomTypeAction.php @@ -22,6 +22,7 @@ interface CategorySetCustomTypeAction extends CategoryUpdateAction *

Defines the Type that extends the Category with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Category.

* + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

Sets the Custom Fields fields for the Category.

* + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Category/CategorySetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategorySetCustomTypeActionBuilder.php index f86eed7d470..aab0ce1e5a0 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class CategorySetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class CategorySetCustomTypeActionBuilder implements Builder *

Defines the Type that extends the Category with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Category.

* + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

Sets the Custom Fields fields for the Category.

* + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Category/CategorySetCustomTypeActionModel.php index 30aaa807995..959b285b7fd 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class CategorySetCustomTypeActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class CategorySetCustomTypeActionModel extends JsonObjectModel implements */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

Defines the Type that extends the Category with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Category.

* + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

Sets the Custom Fields fields for the Category.

* + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetDescriptionAction.php b/lib/commercetools-api/src/Models/Category/CategorySetDescriptionAction.php index 1ab790fc924..d7763fe7d15 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetDescriptionAction.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetDescriptionAction.php @@ -19,6 +19,7 @@ interface CategorySetDescriptionAction extends CategoryUpdateAction /** *

Value to set. If empty, any existing value will be removed.

* + * @return null|LocalizedString */ public function getDescription(); diff --git a/lib/commercetools-api/src/Models/Category/CategorySetDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategorySetDescriptionActionBuilder.php index 6e4c27d3e95..36d097abc78 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetDescriptionActionBuilder.php @@ -23,6 +23,7 @@ final class CategorySetDescriptionActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; @@ -30,6 +31,7 @@ final class CategorySetDescriptionActionBuilder implements Builder /** *

Value to set. If empty, any existing value will be removed.

* + * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetDescriptionActionModel.php b/lib/commercetools-api/src/Models/Category/CategorySetDescriptionActionModel.php index 9afc9daa5a2..c0ee78d9af6 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetDescriptionActionModel.php @@ -23,11 +23,13 @@ final class CategorySetDescriptionActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $description; @@ -37,13 +39,15 @@ final class CategorySetDescriptionActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $description = null + ?LocalizedString $description = null, + ?string $action = null ) { $this->description = $description; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

Value to set. If empty, any existing value will be removed.

* + * * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetExternalIdAction.php b/lib/commercetools-api/src/Models/Category/CategorySetExternalIdAction.php index 636c87a6cac..f9951e77ce3 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetExternalIdAction.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetExternalIdAction.php @@ -18,6 +18,7 @@ interface CategorySetExternalIdAction extends CategoryUpdateAction /** *

Value to set. If empty, any existing value will be removed.

* + * @return null|string */ public function getExternalId(); diff --git a/lib/commercetools-api/src/Models/Category/CategorySetExternalIdActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategorySetExternalIdActionBuilder.php index a19fb82dd15..355776728ab 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetExternalIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetExternalIdActionBuilder.php @@ -21,6 +21,7 @@ final class CategorySetExternalIdActionBuilder implements Builder { /** + * @var ?string */ private $externalId; @@ -28,6 +29,7 @@ final class CategorySetExternalIdActionBuilder implements Builder /** *

Value to set. If empty, any existing value will be removed.

* + * @return null|string */ public function getExternalId() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetExternalIdActionModel.php b/lib/commercetools-api/src/Models/Category/CategorySetExternalIdActionModel.php index bd7f62f965d..32c57cda759 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetExternalIdActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetExternalIdActionModel.php @@ -21,11 +21,13 @@ final class CategorySetExternalIdActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setExternalId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $externalId; @@ -35,13 +37,15 @@ final class CategorySetExternalIdActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $externalId = null + ?string $externalId = null, + ?string $action = null ) { $this->externalId = $externalId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

Value to set. If empty, any existing value will be removed.

* + * * @return null|string */ public function getExternalId() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetKeyAction.php b/lib/commercetools-api/src/Models/Category/CategorySetKeyAction.php index 475673b08cf..c590717512a 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetKeyAction.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetKeyAction.php @@ -18,6 +18,7 @@ interface CategorySetKeyAction extends CategoryUpdateAction /** *

Value to set. If empty, any existing value will be removed.

* + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Category/CategorySetKeyActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategorySetKeyActionBuilder.php index ea6d2e60425..a2f0a1fc98f 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetKeyActionBuilder.php @@ -21,6 +21,7 @@ final class CategorySetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; @@ -28,6 +29,7 @@ final class CategorySetKeyActionBuilder implements Builder /** *

Value to set. If empty, any existing value will be removed.

* + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetKeyActionModel.php b/lib/commercetools-api/src/Models/Category/CategorySetKeyActionModel.php index f764b090dbd..dc0a6ca1057 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetKeyActionModel.php @@ -21,11 +21,13 @@ final class CategorySetKeyActionModel extends JsonObjectModel implements Categor { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class CategorySetKeyActionModel extends JsonObjectModel implements Categor * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

Value to set. If empty, any existing value will be removed.

* + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetMetaDescriptionAction.php b/lib/commercetools-api/src/Models/Category/CategorySetMetaDescriptionAction.php index 0dbaca1c598..47a364b3e82 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetMetaDescriptionAction.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetMetaDescriptionAction.php @@ -19,6 +19,7 @@ interface CategorySetMetaDescriptionAction extends CategoryUpdateAction /** *

Value to set.

* + * @return null|LocalizedString */ public function getMetaDescription(); diff --git a/lib/commercetools-api/src/Models/Category/CategorySetMetaDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategorySetMetaDescriptionActionBuilder.php index 5ce1beda429..026b670a289 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetMetaDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetMetaDescriptionActionBuilder.php @@ -23,6 +23,7 @@ final class CategorySetMetaDescriptionActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaDescription; @@ -30,6 +31,7 @@ final class CategorySetMetaDescriptionActionBuilder implements Builder /** *

Value to set.

* + * @return null|LocalizedString */ public function getMetaDescription() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetMetaDescriptionActionModel.php b/lib/commercetools-api/src/Models/Category/CategorySetMetaDescriptionActionModel.php index af682cfee7c..3cbc710e88d 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetMetaDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetMetaDescriptionActionModel.php @@ -23,11 +23,13 @@ final class CategorySetMetaDescriptionActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setMetaDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $metaDescription; @@ -37,13 +39,15 @@ final class CategorySetMetaDescriptionActionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $metaDescription = null + ?LocalizedString $metaDescription = null, + ?string $action = null ) { $this->metaDescription = $metaDescription; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

Value to set.

* + * * @return null|LocalizedString */ public function getMetaDescription() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetMetaKeywordsAction.php b/lib/commercetools-api/src/Models/Category/CategorySetMetaKeywordsAction.php index 2270dd4a80e..f1cc482649d 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetMetaKeywordsAction.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetMetaKeywordsAction.php @@ -19,6 +19,7 @@ interface CategorySetMetaKeywordsAction extends CategoryUpdateAction /** *

Value to set.

* + * @return null|LocalizedString */ public function getMetaKeywords(); diff --git a/lib/commercetools-api/src/Models/Category/CategorySetMetaKeywordsActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategorySetMetaKeywordsActionBuilder.php index 7ad4739a0c9..98e5391383a 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetMetaKeywordsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetMetaKeywordsActionBuilder.php @@ -23,6 +23,7 @@ final class CategorySetMetaKeywordsActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaKeywords; @@ -30,6 +31,7 @@ final class CategorySetMetaKeywordsActionBuilder implements Builder /** *

Value to set.

* + * @return null|LocalizedString */ public function getMetaKeywords() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetMetaKeywordsActionModel.php b/lib/commercetools-api/src/Models/Category/CategorySetMetaKeywordsActionModel.php index e6ba43dd4b9..3ae3fefefa0 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetMetaKeywordsActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetMetaKeywordsActionModel.php @@ -23,11 +23,13 @@ final class CategorySetMetaKeywordsActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'setMetaKeywords'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $metaKeywords; @@ -37,13 +39,15 @@ final class CategorySetMetaKeywordsActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $metaKeywords = null + ?LocalizedString $metaKeywords = null, + ?string $action = null ) { $this->metaKeywords = $metaKeywords; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

Value to set.

* + * * @return null|LocalizedString */ public function getMetaKeywords() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetMetaTitleAction.php b/lib/commercetools-api/src/Models/Category/CategorySetMetaTitleAction.php index b6d3cdbb64f..02db91d2d7c 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetMetaTitleAction.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetMetaTitleAction.php @@ -19,6 +19,7 @@ interface CategorySetMetaTitleAction extends CategoryUpdateAction /** *

Value to set.

* + * @return null|LocalizedString */ public function getMetaTitle(); diff --git a/lib/commercetools-api/src/Models/Category/CategorySetMetaTitleActionBuilder.php b/lib/commercetools-api/src/Models/Category/CategorySetMetaTitleActionBuilder.php index 87e12c2b3ff..10fa832af60 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetMetaTitleActionBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetMetaTitleActionBuilder.php @@ -23,6 +23,7 @@ final class CategorySetMetaTitleActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaTitle; @@ -30,6 +31,7 @@ final class CategorySetMetaTitleActionBuilder implements Builder /** *

Value to set.

* + * @return null|LocalizedString */ public function getMetaTitle() diff --git a/lib/commercetools-api/src/Models/Category/CategorySetMetaTitleActionModel.php b/lib/commercetools-api/src/Models/Category/CategorySetMetaTitleActionModel.php index 8e5a6bc22eb..2f65ad40a92 100644 --- a/lib/commercetools-api/src/Models/Category/CategorySetMetaTitleActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategorySetMetaTitleActionModel.php @@ -23,11 +23,13 @@ final class CategorySetMetaTitleActionModel extends JsonObjectModel implements C { public const DISCRIMINATOR_VALUE = 'setMetaTitle'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $metaTitle; @@ -37,13 +39,15 @@ final class CategorySetMetaTitleActionModel extends JsonObjectModel implements C * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $metaTitle = null + ?LocalizedString $metaTitle = null, + ?string $action = null ) { $this->metaTitle = $metaTitle; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

Value to set.

* + * * @return null|LocalizedString */ public function getMetaTitle() diff --git a/lib/commercetools-api/src/Models/Category/CategoryUpdate.php b/lib/commercetools-api/src/Models/Category/CategoryUpdate.php index ecd5d87f5e0..9124b824aab 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryUpdate.php +++ b/lib/commercetools-api/src/Models/Category/CategoryUpdate.php @@ -20,6 +20,7 @@ interface CategoryUpdate extends JsonObject *

Expected version of the Category on which the changes should be applied. * If the expected version does not match the actual version, a 409 Conflict will be returned.

* + * @return null|int */ public function getVersion(); @@ -27,6 +28,7 @@ public function getVersion(); /** *

Update actions to be performed on the Category.

* + * @return null|CategoryUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Category/CategoryUpdateAction.php b/lib/commercetools-api/src/Models/Category/CategoryUpdateAction.php index f432dc91079..66e71895e04 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryUpdateAction.php +++ b/lib/commercetools-api/src/Models/Category/CategoryUpdateAction.php @@ -17,6 +17,7 @@ interface CategoryUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Category/CategoryUpdateActionModel.php b/lib/commercetools-api/src/Models/Category/CategoryUpdateActionModel.php index 407db479670..3e4e169a5ec 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Category/CategoryUpdateActionModel.php @@ -21,6 +21,7 @@ final class CategoryUpdateActionModel extends JsonObjectModel implements Categor { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -58,11 +59,13 @@ final class CategoryUpdateActionModel extends JsonObjectModel implements Categor * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Category/CategoryUpdateBuilder.php b/lib/commercetools-api/src/Models/Category/CategoryUpdateBuilder.php index 54f503af46d..b148b183e26 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Category/CategoryUpdateBuilder.php @@ -21,11 +21,13 @@ final class CategoryUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?CategoryUpdateActionCollection */ private $actions; @@ -34,6 +36,7 @@ final class CategoryUpdateBuilder implements Builder *

Expected version of the Category on which the changes should be applied. * If the expected version does not match the actual version, a 409 Conflict will be returned.

* + * @return null|int */ public function getVersion() @@ -44,6 +47,7 @@ public function getVersion() /** *

Update actions to be performed on the Category.

* + * @return null|CategoryUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Category/CategoryUpdateModel.php b/lib/commercetools-api/src/Models/Category/CategoryUpdateModel.php index 4c13a38220b..9e932c1b14b 100644 --- a/lib/commercetools-api/src/Models/Category/CategoryUpdateModel.php +++ b/lib/commercetools-api/src/Models/Category/CategoryUpdateModel.php @@ -20,11 +20,13 @@ final class CategoryUpdateModel extends JsonObjectModel implements CategoryUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?CategoryUpdateActionCollection */ protected $actions; @@ -45,6 +47,7 @@ public function __construct( *

Expected version of the Category on which the changes should be applied. * If the expected version does not match the actual version, a 409 Conflict will be returned.

* + * * @return null|int */ public function getVersion() @@ -64,6 +67,7 @@ public function getVersion() /** *

Update actions to be performed on the Category.

* + * * @return null|CategoryUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Channel/Channel.php b/lib/commercetools-api/src/Models/Channel/Channel.php index de0b938a2c9..145a6f9f101 100644 --- a/lib/commercetools-api/src/Models/Channel/Channel.php +++ b/lib/commercetools-api/src/Models/Channel/Channel.php @@ -36,6 +36,7 @@ interface Channel extends BaseResource /** *

Unique identifier of the Channel.

* + * @return null|string */ public function getId(); @@ -43,6 +44,7 @@ public function getId(); /** *

Current version of the Channel.

* + * @return null|int */ public function getVersion(); @@ -50,6 +52,7 @@ public function getVersion(); /** *

Date and time (UTC) the Channel was initially created.

* + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -57,6 +60,7 @@ public function getCreatedAt(); /** *

Date and time (UTC) the Channel was last updated.

* + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -64,6 +68,7 @@ public function getLastModifiedAt(); /** *

Present on resources updated after 1 February 2019 except for events not tracked.

* + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -71,6 +76,7 @@ public function getLastModifiedBy(); /** *

Present on resources created after 1 February 2019 except for events not tracked.

* + * @return null|CreatedBy */ public function getCreatedBy(); @@ -78,6 +84,7 @@ public function getCreatedBy(); /** *

User-defined unique identifier of the Channel.

* + * @return null|string */ public function getKey(); @@ -85,6 +92,7 @@ public function getKey(); /** *

Roles of the Channel.

* + * @return null|array */ public function getRoles(); @@ -92,6 +100,7 @@ public function getRoles(); /** *

Name of the Channel.

* + * @return null|LocalizedString */ public function getName(); @@ -99,6 +108,7 @@ public function getName(); /** *

Description of the Channel.

* + * @return null|LocalizedString */ public function getDescription(); @@ -106,6 +116,7 @@ public function getDescription(); /** *

Address where the Channel is located (for example, if the Channel is a physical store).

* + * @return null|Address */ public function getAddress(); @@ -113,6 +124,7 @@ public function getAddress(); /** *

Statistics about the review ratings taken into account for the Channel.

* + * @return null|ReviewRatingStatistics */ public function getReviewRatingStatistics(); @@ -120,6 +132,7 @@ public function getReviewRatingStatistics(); /** *

Custom Fields defined for the Channel.

* + * @return null|CustomFields */ public function getCustom(); @@ -127,6 +140,7 @@ public function getCustom(); /** *

GeoJSON geometry object encoding the geo location of the Channel.

* + * @return null|GeoJson */ public function getGeoLocation(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelAddRolesAction.php b/lib/commercetools-api/src/Models/Channel/ChannelAddRolesAction.php index ef331472b5d..e9b931041aa 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelAddRolesAction.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelAddRolesAction.php @@ -18,6 +18,7 @@ interface ChannelAddRolesAction extends ChannelUpdateAction /** *

Value to append to the array.

* + * @return null|array */ public function getRoles(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelAddRolesActionBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelAddRolesActionBuilder.php index d85b98e1f3f..67069d5cd05 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelAddRolesActionBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelAddRolesActionBuilder.php @@ -21,6 +21,7 @@ final class ChannelAddRolesActionBuilder implements Builder { /** + * @var ?array */ private $roles; @@ -28,6 +29,7 @@ final class ChannelAddRolesActionBuilder implements Builder /** *

Value to append to the array.

* + * @return null|array */ public function getRoles() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelAddRolesActionModel.php b/lib/commercetools-api/src/Models/Channel/ChannelAddRolesActionModel.php index 6110ef11823..591845a7aa6 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelAddRolesActionModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelAddRolesActionModel.php @@ -21,11 +21,13 @@ final class ChannelAddRolesActionModel extends JsonObjectModel implements Channe { public const DISCRIMINATOR_VALUE = 'addRoles'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $roles; @@ -35,13 +37,15 @@ final class ChannelAddRolesActionModel extends JsonObjectModel implements Channe * @psalm-suppress MissingParamType */ public function __construct( - ?array $roles = null + ?array $roles = null, + ?string $action = null ) { $this->roles = $roles; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

Value to append to the array.

* + * * @return null|array */ public function getRoles() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelBuilder.php index b026955df65..7326bbd39cf 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelBuilder.php @@ -38,71 +38,85 @@ final class ChannelBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $key; /** + * @var ?array */ private $roles; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var null|Address|AddressBuilder */ private $address; /** + * @var null|ReviewRatingStatistics|ReviewRatingStatisticsBuilder */ private $reviewRatingStatistics; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var null|GeoJson|GeoJsonBuilder */ private $geoLocation; @@ -110,6 +124,7 @@ final class ChannelBuilder implements Builder /** *

Unique identifier of the Channel.

* + * @return null|string */ public function getId() @@ -120,6 +135,7 @@ public function getId() /** *

Current version of the Channel.

* + * @return null|int */ public function getVersion() @@ -130,6 +146,7 @@ public function getVersion() /** *

Date and time (UTC) the Channel was initially created.

* + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -140,6 +157,7 @@ public function getCreatedAt() /** *

Date and time (UTC) the Channel was last updated.

* + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -150,6 +168,7 @@ public function getLastModifiedAt() /** *

Present on resources updated after 1 February 2019 except for events not tracked.

* + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -160,6 +179,7 @@ public function getLastModifiedBy() /** *

Present on resources created after 1 February 2019 except for events not tracked.

* + * @return null|CreatedBy */ public function getCreatedBy() @@ -170,6 +190,7 @@ public function getCreatedBy() /** *

User-defined unique identifier of the Channel.

* + * @return null|string */ public function getKey() @@ -180,6 +201,7 @@ public function getKey() /** *

Roles of the Channel.

* + * @return null|array */ public function getRoles() @@ -190,6 +212,7 @@ public function getRoles() /** *

Name of the Channel.

* + * @return null|LocalizedString */ public function getName() @@ -200,6 +223,7 @@ public function getName() /** *

Description of the Channel.

* + * @return null|LocalizedString */ public function getDescription() @@ -210,6 +234,7 @@ public function getDescription() /** *

Address where the Channel is located (for example, if the Channel is a physical store).

* + * @return null|Address */ public function getAddress() @@ -220,6 +245,7 @@ public function getAddress() /** *

Statistics about the review ratings taken into account for the Channel.

* + * @return null|ReviewRatingStatistics */ public function getReviewRatingStatistics() @@ -230,6 +256,7 @@ public function getReviewRatingStatistics() /** *

Custom Fields defined for the Channel.

* + * @return null|CustomFields */ public function getCustom() @@ -240,6 +267,7 @@ public function getCustom() /** *

GeoJSON geometry object encoding the geo location of the Channel.

* + * @return null|GeoJson */ public function getGeoLocation() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelChangeDescriptionAction.php b/lib/commercetools-api/src/Models/Channel/ChannelChangeDescriptionAction.php index dbe12eb0fd5..35189110bb9 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelChangeDescriptionAction.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelChangeDescriptionAction.php @@ -19,6 +19,7 @@ interface ChannelChangeDescriptionAction extends ChannelUpdateAction /** *

New value to set. Must not be empty.

* + * @return null|LocalizedString */ public function getDescription(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelChangeDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelChangeDescriptionActionBuilder.php index 02748e20a3e..ef8d5b520d1 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelChangeDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelChangeDescriptionActionBuilder.php @@ -23,6 +23,7 @@ final class ChannelChangeDescriptionActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; @@ -30,6 +31,7 @@ final class ChannelChangeDescriptionActionBuilder implements Builder /** *

New value to set. Must not be empty.

* + * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelChangeDescriptionActionModel.php b/lib/commercetools-api/src/Models/Channel/ChannelChangeDescriptionActionModel.php index c496d576085..dcf98776fd6 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelChangeDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelChangeDescriptionActionModel.php @@ -23,11 +23,13 @@ final class ChannelChangeDescriptionActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'changeDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $description; @@ -37,13 +39,15 @@ final class ChannelChangeDescriptionActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $description = null + ?LocalizedString $description = null, + ?string $action = null ) { $this->description = $description; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

New value to set. Must not be empty.

* + * * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelChangeKeyAction.php b/lib/commercetools-api/src/Models/Channel/ChannelChangeKeyAction.php index 5e2f3436014..db630f7f3b1 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelChangeKeyAction.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelChangeKeyAction.php @@ -18,6 +18,7 @@ interface ChannelChangeKeyAction extends ChannelUpdateAction /** *

New value to set. Must not be empty.

* + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelChangeKeyActionBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelChangeKeyActionBuilder.php index 85b210bfba6..3b5dd2dce66 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelChangeKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelChangeKeyActionBuilder.php @@ -21,6 +21,7 @@ final class ChannelChangeKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; @@ -28,6 +29,7 @@ final class ChannelChangeKeyActionBuilder implements Builder /** *

New value to set. Must not be empty.

* + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelChangeKeyActionModel.php b/lib/commercetools-api/src/Models/Channel/ChannelChangeKeyActionModel.php index 4f3ecbea5e6..e20d73e7c14 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelChangeKeyActionModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelChangeKeyActionModel.php @@ -21,11 +21,13 @@ final class ChannelChangeKeyActionModel extends JsonObjectModel implements Chann { public const DISCRIMINATOR_VALUE = 'changeKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class ChannelChangeKeyActionModel extends JsonObjectModel implements Chann * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

New value to set. Must not be empty.

* + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelChangeNameAction.php b/lib/commercetools-api/src/Models/Channel/ChannelChangeNameAction.php index 2a85b04fe1a..db0cc599d75 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelChangeNameAction.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelChangeNameAction.php @@ -19,6 +19,7 @@ interface ChannelChangeNameAction extends ChannelUpdateAction /** *

New value to set. Must not be empty.

* + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelChangeNameActionBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelChangeNameActionBuilder.php index 3e69796afc1..bbff1b54fa7 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelChangeNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelChangeNameActionBuilder.php @@ -23,6 +23,7 @@ final class ChannelChangeNameActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; @@ -30,6 +31,7 @@ final class ChannelChangeNameActionBuilder implements Builder /** *

New value to set. Must not be empty.

* + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelChangeNameActionModel.php b/lib/commercetools-api/src/Models/Channel/ChannelChangeNameActionModel.php index 776897f7b50..342c52ca929 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelChangeNameActionModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelChangeNameActionModel.php @@ -23,11 +23,13 @@ final class ChannelChangeNameActionModel extends JsonObjectModel implements Chan { public const DISCRIMINATOR_VALUE = 'changeName'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $name; @@ -37,13 +39,15 @@ final class ChannelChangeNameActionModel extends JsonObjectModel implements Chan * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

New value to set. Must not be empty.

* + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelDraft.php b/lib/commercetools-api/src/Models/Channel/ChannelDraft.php index a58b7cfc6f9..e83c5d43a57 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelDraft.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelDraft.php @@ -28,6 +28,7 @@ interface ChannelDraft extends JsonObject /** *

User-defined unique identifier for the Channel.

* + * @return null|string */ public function getKey(); @@ -37,6 +38,7 @@ public function getKey(); * Each channel must have at least one role. * If not specified, then InventorySupply is assigned by default.

* + * @return null|array */ public function getRoles(); @@ -44,6 +46,7 @@ public function getRoles(); /** *

Name of the Channel.

* + * @return null|LocalizedString */ public function getName(); @@ -51,6 +54,7 @@ public function getName(); /** *

Description of the Channel.

* + * @return null|LocalizedString */ public function getDescription(); @@ -58,6 +62,7 @@ public function getDescription(); /** *

Address where the Channel is located.

* + * @return null|BaseAddress */ public function getAddress(); @@ -65,6 +70,7 @@ public function getAddress(); /** *

Custom fields defined for the Channel.

* + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -73,6 +79,7 @@ public function getCustom(); *

GeoJSON geometry object encoding the geo location of the Channel. * Currently, only the Point type is supported.

* + * @return null|GeoJson */ public function getGeoLocation(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelDraftBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelDraftBuilder.php index adc4381a147..25b88b44b9b 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelDraftBuilder.php @@ -29,36 +29,43 @@ final class ChannelDraftBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?array */ private $roles; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var null|GeoJson|GeoJsonBuilder */ private $geoLocation; @@ -66,6 +73,7 @@ final class ChannelDraftBuilder implements Builder /** *

User-defined unique identifier for the Channel.

* + * @return null|string */ public function getKey() @@ -78,6 +86,7 @@ public function getKey() * Each channel must have at least one role. * If not specified, then InventorySupply is assigned by default.

* + * @return null|array */ public function getRoles() @@ -88,6 +97,7 @@ public function getRoles() /** *

Name of the Channel.

* + * @return null|LocalizedString */ public function getName() @@ -98,6 +108,7 @@ public function getName() /** *

Description of the Channel.

* + * @return null|LocalizedString */ public function getDescription() @@ -108,6 +119,7 @@ public function getDescription() /** *

Address where the Channel is located.

* + * @return null|BaseAddress */ public function getAddress() @@ -118,6 +130,7 @@ public function getAddress() /** *

Custom fields defined for the Channel.

* + * @return null|CustomFieldsDraft */ public function getCustom() @@ -129,6 +142,7 @@ public function getCustom() *

GeoJSON geometry object encoding the geo location of the Channel. * Currently, only the Point type is supported.

* + * @return null|GeoJson */ public function getGeoLocation() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelDraftModel.php b/lib/commercetools-api/src/Models/Channel/ChannelDraftModel.php index eef0ddda5d8..7f179f1cd66 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelDraftModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelDraftModel.php @@ -28,36 +28,43 @@ final class ChannelDraftModel extends JsonObjectModel implements ChannelDraft { /** + * * @var ?string */ protected $key; /** + * * @var ?array */ protected $roles; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?BaseAddress */ protected $address; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?GeoJson */ protected $geoLocation; @@ -87,6 +94,7 @@ public function __construct( /** *

User-defined unique identifier for the Channel.

* + * * @return null|string */ public function getKey() @@ -108,6 +116,7 @@ public function getKey() * Each channel must have at least one role. * If not specified, then InventorySupply is assigned by default.

* + * * @return null|array */ public function getRoles() @@ -127,6 +136,7 @@ public function getRoles() /** *

Name of the Channel.

* + * * @return null|LocalizedString */ public function getName() @@ -147,6 +157,7 @@ public function getName() /** *

Description of the Channel.

* + * * @return null|LocalizedString */ public function getDescription() @@ -167,6 +178,7 @@ public function getDescription() /** *

Address where the Channel is located.

* + * * @return null|BaseAddress */ public function getAddress() @@ -187,6 +199,7 @@ public function getAddress() /** *

Custom fields defined for the Channel.

* + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -208,6 +221,7 @@ public function getCustom() *

GeoJSON geometry object encoding the geo location of the Channel. * Currently, only the Point type is supported.

* + * * @return null|GeoJson */ public function getGeoLocation() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelModel.php b/lib/commercetools-api/src/Models/Channel/ChannelModel.php index d639688032c..b57cad0182c 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelModel.php @@ -37,71 +37,85 @@ final class ChannelModel extends JsonObjectModel implements Channel { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $key; /** + * * @var ?array */ protected $roles; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?Address */ protected $address; /** + * * @var ?ReviewRatingStatistics */ protected $reviewRatingStatistics; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?GeoJson */ protected $geoLocation; @@ -145,6 +159,7 @@ public function __construct( /** *

Unique identifier of the Channel.

* + * * @return null|string */ public function getId() @@ -164,6 +179,7 @@ public function getId() /** *

Current version of the Channel.

* + * * @return null|int */ public function getVersion() @@ -183,6 +199,7 @@ public function getVersion() /** *

Date and time (UTC) the Channel was initially created.

* + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -206,6 +223,7 @@ public function getCreatedAt() /** *

Date and time (UTC) the Channel was last updated.

* + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -229,6 +247,7 @@ public function getLastModifiedAt() /** *

Present on resources updated after 1 February 2019 except for events not tracked.

* + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -249,6 +268,7 @@ public function getLastModifiedBy() /** *

Present on resources created after 1 February 2019 except for events not tracked.

* + * * @return null|CreatedBy */ public function getCreatedBy() @@ -269,6 +289,7 @@ public function getCreatedBy() /** *

User-defined unique identifier of the Channel.

* + * * @return null|string */ public function getKey() @@ -288,6 +309,7 @@ public function getKey() /** *

Roles of the Channel.

* + * * @return null|array */ public function getRoles() @@ -307,6 +329,7 @@ public function getRoles() /** *

Name of the Channel.

* + * * @return null|LocalizedString */ public function getName() @@ -327,6 +350,7 @@ public function getName() /** *

Description of the Channel.

* + * * @return null|LocalizedString */ public function getDescription() @@ -347,6 +371,7 @@ public function getDescription() /** *

Address where the Channel is located (for example, if the Channel is a physical store).

* + * * @return null|Address */ public function getAddress() @@ -367,6 +392,7 @@ public function getAddress() /** *

Statistics about the review ratings taken into account for the Channel.

* + * * @return null|ReviewRatingStatistics */ public function getReviewRatingStatistics() @@ -387,6 +413,7 @@ public function getReviewRatingStatistics() /** *

Custom Fields defined for the Channel.

* + * * @return null|CustomFields */ public function getCustom() @@ -407,6 +434,7 @@ public function getCustom() /** *

GeoJSON geometry object encoding the geo location of the Channel.

* + * * @return null|GeoJson */ public function getGeoLocation() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelPagedQueryResponse.php b/lib/commercetools-api/src/Models/Channel/ChannelPagedQueryResponse.php index 18768763fc5..ee34b2b851c 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelPagedQueryResponse.php @@ -22,6 +22,7 @@ interface ChannelPagedQueryResponse extends JsonObject /** *

Number of results requested.

* + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

Number of elements skipped.

* + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

Actual number of results returned.

* + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

* + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

Channels matching the query.

* + * @return null|ChannelCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelPagedQueryResponseBuilder.php index 426b0006c55..4517af2ae07 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class ChannelPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?ChannelCollection */ private $results; @@ -48,6 +53,7 @@ final class ChannelPagedQueryResponseBuilder implements Builder /** *

Number of results requested.

* + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

Number of elements skipped.

* + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

Actual number of results returned.

* + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

* + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

Channels matching the query.

* + * @return null|ChannelCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Channel/ChannelPagedQueryResponseModel.php index 2b95d8f0aab..61046a1a794 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class ChannelPagedQueryResponseModel extends JsonObjectModel implements ChannelPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?ChannelCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

Number of results requested.

* + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

Number of elements skipped.

* + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

Actual number of results returned.

* + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

* + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

Channels matching the query.

* + * * @return null|ChannelCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelReference.php b/lib/commercetools-api/src/Models/Channel/ChannelReference.php index c884f7c25a6..496db2b5b11 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelReference.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelReference.php @@ -20,6 +20,7 @@ interface ChannelReference extends Reference *

Contains the representation of the expanded Channel. * Only present in responses to requests with Reference Expansion for Channels.

* + * @return null|Channel */ public function getObj(); @@ -27,6 +28,7 @@ public function getObj(); /** *

Unique identifier of the referenced Channel.

* + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelReferenceBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelReferenceBuilder.php index 516b7dbb05b..f28cece7070 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelReferenceBuilder.php @@ -23,11 +23,13 @@ final class ChannelReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|Channel|ChannelBuilder */ private $obj; @@ -35,6 +37,7 @@ final class ChannelReferenceBuilder implements Builder /** *

Unique identifier of the referenced Channel.

* + * @return null|string */ public function getId() @@ -46,6 +49,7 @@ public function getId() *

Contains the representation of the expanded Channel. * Only present in responses to requests with Reference Expansion for Channels.

* + * @return null|Channel */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelReferenceModel.php b/lib/commercetools-api/src/Models/Channel/ChannelReferenceModel.php index a30663075a1..9e86ebe4ba9 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelReferenceModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelReferenceModel.php @@ -23,16 +23,19 @@ final class ChannelReferenceModel extends JsonObjectModel implements ChannelRefe { public const DISCRIMINATOR_VALUE = 'channel'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?Channel */ protected $obj; @@ -43,16 +46,18 @@ final class ChannelReferenceModel extends JsonObjectModel implements ChannelRefe */ public function __construct( ?string $id = null, - ?Channel $obj = null + ?Channel $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

Type of referenced resource.

* + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

Unique identifier of the referenced Channel.

* + * * @return null|string */ public function getId() @@ -92,6 +98,7 @@ public function getId() *

Contains the representation of the expanded Channel. * Only present in responses to requests with Reference Expansion for Channels.

* + * * @return null|Channel */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelRemoveRolesAction.php b/lib/commercetools-api/src/Models/Channel/ChannelRemoveRolesAction.php index 7c02098cf18..cb402aa00c4 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelRemoveRolesAction.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelRemoveRolesAction.php @@ -18,6 +18,7 @@ interface ChannelRemoveRolesAction extends ChannelUpdateAction /** *

Value to remove from the array.

* + * @return null|array */ public function getRoles(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelRemoveRolesActionBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelRemoveRolesActionBuilder.php index 7a7a3239880..ce33a7a95f9 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelRemoveRolesActionBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelRemoveRolesActionBuilder.php @@ -21,6 +21,7 @@ final class ChannelRemoveRolesActionBuilder implements Builder { /** + * @var ?array */ private $roles; @@ -28,6 +29,7 @@ final class ChannelRemoveRolesActionBuilder implements Builder /** *

Value to remove from the array.

* + * @return null|array */ public function getRoles() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelRemoveRolesActionModel.php b/lib/commercetools-api/src/Models/Channel/ChannelRemoveRolesActionModel.php index 9727b8f131c..67802cf69a2 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelRemoveRolesActionModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelRemoveRolesActionModel.php @@ -21,11 +21,13 @@ final class ChannelRemoveRolesActionModel extends JsonObjectModel implements Cha { public const DISCRIMINATOR_VALUE = 'removeRoles'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $roles; @@ -35,13 +37,15 @@ final class ChannelRemoveRolesActionModel extends JsonObjectModel implements Cha * @psalm-suppress MissingParamType */ public function __construct( - ?array $roles = null + ?array $roles = null, + ?string $action = null ) { $this->roles = $roles; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

Value to remove from the array.

* + * * @return null|array */ public function getRoles() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelResourceIdentifier.php b/lib/commercetools-api/src/Models/Channel/ChannelResourceIdentifier.php index 4eb1070eeb1..3586a9d7611 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelResourceIdentifier.php @@ -17,6 +17,7 @@ interface ChannelResourceIdentifier extends ResourceIdentifier /** *

Unique identifier of the referenced Channel. Either id or key is required.

* + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

User-defined unique identifier of the referenced Channel. Either id or key is required.

* + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelResourceIdentifierBuilder.php index 295cbc701e3..744565b3420 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class ChannelResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class ChannelResourceIdentifierBuilder implements Builder /** *

Unique identifier of the referenced Channel. Either id or key is required.

* + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

User-defined unique identifier of the referenced Channel. Either id or key is required.

* + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelResourceIdentifierModel.php b/lib/commercetools-api/src/Models/Channel/ChannelResourceIdentifierModel.php index ef308893137..06d40589023 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class ChannelResourceIdentifierModel extends JsonObjectModel implements Ch { public const DISCRIMINATOR_VALUE = 'channel'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class ChannelResourceIdentifierModel extends JsonObjectModel implements Ch */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

* + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

Unique identifier of the referenced Channel. Either id or key is required.

* + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

User-defined unique identifier of the referenced Channel. Either id or key is required.

* + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressAction.php b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressAction.php index d6d93e5eaef..5a9030f33b7 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressAction.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressAction.php @@ -19,6 +19,7 @@ interface ChannelSetAddressAction extends ChannelUpdateAction /** *

Value to set. If empty, any existing value will be removed.

* + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressActionBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressActionBuilder.php index 4e479d03f26..8d856a9af87 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressActionBuilder.php @@ -23,6 +23,7 @@ final class ChannelSetAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; @@ -30,6 +31,7 @@ final class ChannelSetAddressActionBuilder implements Builder /** *

Value to set. If empty, any existing value will be removed.

* + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressActionModel.php b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressActionModel.php index 0137ca943d8..51123497b12 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressActionModel.php @@ -23,11 +23,13 @@ final class ChannelSetAddressActionModel extends JsonObjectModel implements Chan { public const DISCRIMINATOR_VALUE = 'setAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -37,13 +39,15 @@ final class ChannelSetAddressActionModel extends JsonObjectModel implements Chan * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

Value to set. If empty, any existing value will be removed.

* + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomFieldAction.php index 814631a7191..5d806ecca3d 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomFieldAction.php @@ -19,6 +19,7 @@ interface ChannelSetAddressCustomFieldAction extends ChannelUpdateAction /** *

Name of the Custom Field.

* + * @return null|string */ public function getName(); @@ -27,6 +28,7 @@ public function getName(); *

Specifies the format of the value of the Custom Field defined by name. * If value is absent or null, this field will be removed, if it exists. Trying to remove a field that does not exist will fail with an InvalidOperation error.

* + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomFieldActionBuilder.php index 28d198aa74e..90ca2606510 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class ChannelSetAddressCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class ChannelSetAddressCustomFieldActionBuilder implements Builder /** *

Name of the Custom Field.

* + * @return null|string */ public function getName() @@ -44,6 +47,7 @@ public function getName() *

Specifies the format of the value of the Custom Field defined by name. * If value is absent or null, this field will be removed, if it exists. Trying to remove a field that does not exist will fail with an InvalidOperation error.

* + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomFieldActionModel.php index bf4d0bb1753..d4508e67a96 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class ChannelSetAddressCustomFieldActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setAddressCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class ChannelSetAddressCustomFieldActionModel extends JsonObjectModel impl */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

Name of the Custom Field.

* + * * @return null|string */ public function getName() @@ -88,6 +94,7 @@ public function getName() *

Specifies the format of the value of the Custom Field defined by name. * If value is absent or null, this field will be removed, if it exists. Trying to remove a field that does not exist will fail with an InvalidOperation error.

* + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomTypeAction.php index d027ca28500..980c9bece61 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomTypeAction.php @@ -22,6 +22,7 @@ interface ChannelSetAddressCustomTypeAction extends ChannelUpdateAction *

Defines the Type that extends the address with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the address.

* + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

Sets the Custom Fields fields for the address.

* + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomTypeActionBuilder.php index 8d73a6f2bca..30f028535b9 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class ChannelSetAddressCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class ChannelSetAddressCustomTypeActionBuilder implements Builder *

Defines the Type that extends the address with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the address.

* + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

Sets the Custom Fields fields for the address.

* + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomTypeActionModel.php index 9fc2871b01d..383416b198f 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetAddressCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class ChannelSetAddressCustomTypeActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setAddressCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class ChannelSetAddressCustomTypeActionModel extends JsonObjectModel imple */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

Defines the Type that extends the address with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the address.

* + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

Sets the Custom Fields fields for the address.

* + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetCustomFieldAction.php b/lib/commercetools-api/src/Models/Channel/ChannelSetCustomFieldAction.php index 1c533947976..d8f5f825354 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface ChannelSetCustomFieldAction extends ChannelUpdateAction /** *

Name of the Custom Field.

* + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelSetCustomFieldActionBuilder.php index bafb8c30d8b..ac3bd2ea1e0 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class ChannelSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class ChannelSetCustomFieldActionBuilder implements Builder /** *

Name of the Custom Field.

* + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Channel/ChannelSetCustomFieldActionModel.php index 2904f1b6d7b..e8c0100ba10 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class ChannelSetCustomFieldActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class ChannelSetCustomFieldActionModel extends JsonObjectModel implements */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

Name of the Custom Field.

* + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

* + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetCustomTypeAction.php b/lib/commercetools-api/src/Models/Channel/ChannelSetCustomTypeAction.php index 1bea652810f..631dc72ac40 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface ChannelSetCustomTypeAction extends ChannelUpdateAction *

Defines the Type that extends the Channel with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Channel.

* + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

Sets the Custom Fields fields for the Channel.

* + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelSetCustomTypeActionBuilder.php index 4c7c86630b5..4228475a43a 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class ChannelSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class ChannelSetCustomTypeActionBuilder implements Builder *

Defines the Type that extends the Channel with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Channel.

* + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

Sets the Custom Fields fields for the Channel.

* + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Channel/ChannelSetCustomTypeActionModel.php index fe692ac0715..e5fee2291ce 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class ChannelSetCustomTypeActionModel extends JsonObjectModel implements C { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class ChannelSetCustomTypeActionModel extends JsonObjectModel implements C */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

Defines the Type that extends the Channel with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Channel.

* + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

Sets the Custom Fields fields for the Channel.

* + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetGeoLocationAction.php b/lib/commercetools-api/src/Models/Channel/ChannelSetGeoLocationAction.php index 7129044c3ea..f65c7abeb25 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetGeoLocationAction.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetGeoLocationAction.php @@ -19,6 +19,7 @@ interface ChannelSetGeoLocationAction extends ChannelUpdateAction /** *

Value to set.

* + * @return null|GeoJson */ public function getGeoLocation(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetGeoLocationActionBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelSetGeoLocationActionBuilder.php index 966d906afdc..e4e2d2ac63e 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetGeoLocationActionBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetGeoLocationActionBuilder.php @@ -23,6 +23,7 @@ final class ChannelSetGeoLocationActionBuilder implements Builder { /** + * @var null|GeoJson|GeoJsonBuilder */ private $geoLocation; @@ -30,6 +31,7 @@ final class ChannelSetGeoLocationActionBuilder implements Builder /** *

Value to set.

* + * @return null|GeoJson */ public function getGeoLocation() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetGeoLocationActionModel.php b/lib/commercetools-api/src/Models/Channel/ChannelSetGeoLocationActionModel.php index 25c97641ee6..88dbe9f4ad2 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetGeoLocationActionModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetGeoLocationActionModel.php @@ -23,11 +23,13 @@ final class ChannelSetGeoLocationActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setGeoLocation'; /** + * * @var ?string */ protected $action; /** + * * @var ?GeoJson */ protected $geoLocation; @@ -37,13 +39,15 @@ final class ChannelSetGeoLocationActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?GeoJson $geoLocation = null + ?GeoJson $geoLocation = null, + ?string $action = null ) { $this->geoLocation = $geoLocation; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

Value to set.

* + * * @return null|GeoJson */ public function getGeoLocation() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetRolesAction.php b/lib/commercetools-api/src/Models/Channel/ChannelSetRolesAction.php index 14af7dbe19d..fb7bc6262c0 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetRolesAction.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetRolesAction.php @@ -18,6 +18,7 @@ interface ChannelSetRolesAction extends ChannelUpdateAction /** *

Value to set. If not specified, then InventorySupply is assigned by default.

* + * @return null|array */ public function getRoles(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetRolesActionBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelSetRolesActionBuilder.php index 0f10b924cec..fb06cdbce1b 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetRolesActionBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetRolesActionBuilder.php @@ -21,6 +21,7 @@ final class ChannelSetRolesActionBuilder implements Builder { /** + * @var ?array */ private $roles; @@ -28,6 +29,7 @@ final class ChannelSetRolesActionBuilder implements Builder /** *

Value to set. If not specified, then InventorySupply is assigned by default.

* + * @return null|array */ public function getRoles() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetRolesActionModel.php b/lib/commercetools-api/src/Models/Channel/ChannelSetRolesActionModel.php index 3e8f1925c75..daf7ea1f42d 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetRolesActionModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetRolesActionModel.php @@ -21,11 +21,13 @@ final class ChannelSetRolesActionModel extends JsonObjectModel implements Channe { public const DISCRIMINATOR_VALUE = 'setRoles'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $roles; @@ -35,13 +37,15 @@ final class ChannelSetRolesActionModel extends JsonObjectModel implements Channe * @psalm-suppress MissingParamType */ public function __construct( - ?array $roles = null + ?array $roles = null, + ?string $action = null ) { $this->roles = $roles; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

Value to set. If not specified, then InventorySupply is assigned by default.

* + * * @return null|array */ public function getRoles() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelUpdate.php b/lib/commercetools-api/src/Models/Channel/ChannelUpdate.php index d960804723e..dde2b294160 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelUpdate.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelUpdate.php @@ -19,6 +19,7 @@ interface ChannelUpdate extends JsonObject /** *

Expected version of the Channel on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

* + * @return null|int */ public function getVersion(); @@ -26,6 +27,7 @@ public function getVersion(); /** *

Update actions to be performed on the Channel.

* + * @return null|ChannelUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelUpdateAction.php b/lib/commercetools-api/src/Models/Channel/ChannelUpdateAction.php index 5c5b81b0cbb..03715dc9091 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelUpdateAction.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelUpdateAction.php @@ -17,6 +17,7 @@ interface ChannelUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Channel/ChannelUpdateActionModel.php b/lib/commercetools-api/src/Models/Channel/ChannelUpdateActionModel.php index d518d94bb02..affef9438c1 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelUpdateActionModel.php @@ -21,6 +21,7 @@ final class ChannelUpdateActionModel extends JsonObjectModel implements ChannelU { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -48,11 +49,13 @@ final class ChannelUpdateActionModel extends JsonObjectModel implements ChannelU * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelUpdateBuilder.php b/lib/commercetools-api/src/Models/Channel/ChannelUpdateBuilder.php index aff4da890de..72b97fa19d4 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelUpdateBuilder.php @@ -21,11 +21,13 @@ final class ChannelUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?ChannelUpdateActionCollection */ private $actions; @@ -33,6 +35,7 @@ final class ChannelUpdateBuilder implements Builder /** *

Expected version of the Channel on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

* + * @return null|int */ public function getVersion() @@ -43,6 +46,7 @@ public function getVersion() /** *

Update actions to be performed on the Channel.

* + * @return null|ChannelUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Channel/ChannelUpdateModel.php b/lib/commercetools-api/src/Models/Channel/ChannelUpdateModel.php index d96fe3b8656..5c4abd7eb3b 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelUpdateModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelUpdateModel.php @@ -20,11 +20,13 @@ final class ChannelUpdateModel extends JsonObjectModel implements ChannelUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?ChannelUpdateActionCollection */ protected $actions; @@ -44,6 +46,7 @@ public function __construct( /** *

Expected version of the Channel on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

* + * * @return null|int */ public function getVersion() @@ -63,6 +66,7 @@ public function getVersion() /** *

Update actions to be performed on the Channel.

* + * * @return null|ChannelUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Common/Address.php b/lib/commercetools-api/src/Models/Common/Address.php index 8d9bbb5e479..a502faf569c 100644 --- a/lib/commercetools-api/src/Models/Common/Address.php +++ b/lib/commercetools-api/src/Models/Common/Address.php @@ -19,6 +19,7 @@ interface Address extends BaseAddress /** *

Unique identifier of the Address.

* + * @return null|string */ public function getId(); @@ -26,6 +27,7 @@ public function getId(); /** *

Custom Fields defined for the Address.

* + * @return null|CustomFields */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Common/AddressBuilder.php b/lib/commercetools-api/src/Models/Common/AddressBuilder.php index a8403f0aa9b..58a04e6c16e 100644 --- a/lib/commercetools-api/src/Models/Common/AddressBuilder.php +++ b/lib/commercetools-api/src/Models/Common/AddressBuilder.php @@ -23,131 +23,157 @@ final class AddressBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; /** + * @var ?string */ private $country; /** + * @var ?string */ private $title; /** + * @var ?string */ private $salutation; /** + * @var ?string */ private $firstName; /** + * @var ?string */ private $lastName; /** + * @var ?string */ private $streetName; /** + * @var ?string */ private $streetNumber; /** + * @var ?string */ private $additionalStreetInfo; /** + * @var ?string */ private $postalCode; /** + * @var ?string */ private $city; /** + * @var ?string */ private $region; /** + * @var ?string */ private $state; /** + * @var ?string */ private $company; /** + * @var ?string */ private $department; /** + * @var ?string */ private $building; /** + * @var ?string */ private $apartment; /** + * @var ?string */ private $pOBox; /** + * @var ?string */ private $phone; /** + * @var ?string */ private $mobile; /** + * @var ?string */ private $email; /** + * @var ?string */ private $fax; /** + * @var ?string */ private $additionalAddressInfo; /** + * @var ?string */ private $externalId; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; @@ -155,6 +181,7 @@ final class AddressBuilder implements Builder /** *

Unique identifier of the Address.

* + * @return null|string */ public function getId() @@ -165,6 +192,7 @@ public function getId() /** *

User-defined unique identifier of the Address.

* + * @return null|string */ public function getKey() @@ -175,6 +203,7 @@ public function getKey() /** *

Two-digit country code as per ISO 3166-1 alpha-2.

* + * @return null|string */ public function getCountry() @@ -185,6 +214,7 @@ public function getCountry() /** *

Title of the contact, for example 'Dr.'

* + * @return null|string */ public function getTitle() @@ -195,6 +225,7 @@ public function getTitle() /** *

Salutation of the contact, for example 'Mr.' or 'Ms.'

* + * @return null|string */ public function getSalutation() @@ -205,6 +236,7 @@ public function getSalutation() /** *

Given name (first name) of the contact.

* + * @return null|string */ public function getFirstName() @@ -215,6 +247,7 @@ public function getFirstName() /** *

Family name (last name) of the contact.

* + * @return null|string */ public function getLastName() @@ -225,6 +258,7 @@ public function getLastName() /** *

Name of the street.

* + * @return null|string */ public function getStreetName() @@ -235,6 +269,7 @@ public function getStreetName() /** *

Street number.

* + * @return null|string */ public function getStreetNumber() @@ -245,6 +280,7 @@ public function getStreetNumber() /** *

Further information on the street address.

* + * @return null|string */ public function getAdditionalStreetInfo() @@ -255,6 +291,7 @@ public function getAdditionalStreetInfo() /** *

Postal code.

* + * @return null|string */ public function getPostalCode() @@ -265,6 +302,7 @@ public function getPostalCode() /** *

Name of the city.

* + * @return null|string */ public function getCity() @@ -275,6 +313,7 @@ public function getCity() /** *

Name of the region.

* + * @return null|string */ public function getRegion() @@ -285,6 +324,7 @@ public function getRegion() /** *

Name of the state, for example, Colorado.

* + * @return null|string */ public function getState() @@ -295,6 +335,7 @@ public function getState() /** *

Name of the company.

* + * @return null|string */ public function getCompany() @@ -305,6 +346,7 @@ public function getCompany() /** *

Name of the department.

* + * @return null|string */ public function getDepartment() @@ -315,6 +357,7 @@ public function getDepartment() /** *

Number or name of the building.

* + * @return null|string */ public function getBuilding() @@ -325,6 +368,7 @@ public function getBuilding() /** *

Number or name of the apartment.

* + * @return null|string */ public function getApartment() @@ -335,6 +379,7 @@ public function getApartment() /** *

Post office box number.

* + * @return null|string */ public function getPOBox() @@ -345,6 +390,7 @@ public function getPOBox() /** *

Phone number of the contact.

* + * @return null|string */ public function getPhone() @@ -355,6 +401,7 @@ public function getPhone() /** *

Mobile phone number of the contact.

* + * @return null|string */ public function getMobile() @@ -365,6 +412,7 @@ public function getMobile() /** *

Email address of the contact.

* + * @return null|string */ public function getEmail() @@ -375,6 +423,7 @@ public function getEmail() /** *

Fax number of the contact.

* + * @return null|string */ public function getFax() @@ -385,6 +434,7 @@ public function getFax() /** *

Further information on the Address.

* + * @return null|string */ public function getAdditionalAddressInfo() @@ -395,6 +445,7 @@ public function getAdditionalAddressInfo() /** *

ID for the contact used in an external system.

* + * @return null|string */ public function getExternalId() @@ -405,6 +456,7 @@ public function getExternalId() /** *

Custom Fields defined for the Address.

* + * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Common/AddressDraft.php b/lib/commercetools-api/src/Models/Common/AddressDraft.php index 6e7a93960ce..66130f5dfe4 100644 --- a/lib/commercetools-api/src/Models/Common/AddressDraft.php +++ b/lib/commercetools-api/src/Models/Common/AddressDraft.php @@ -19,6 +19,7 @@ interface AddressDraft extends BaseAddress /** *

Custom Fields defined for the Address.

* + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -26,6 +27,7 @@ public function getCustom(); /** *

Unique identifier for the Address. Not recommended to set it manually since the API overwrites this ID when creating an Address for a Customer. Use key instead and omit this field from the request to let the API generate the ID for the Address.

* + * @return null|string */ public function getId(); @@ -33,6 +35,7 @@ public function getId(); /** *

User-defined unique identifier for the Address.

* + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Common/AddressDraftBuilder.php b/lib/commercetools-api/src/Models/Common/AddressDraftBuilder.php index 888eec6226f..32e8e639b20 100644 --- a/lib/commercetools-api/src/Models/Common/AddressDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Common/AddressDraftBuilder.php @@ -23,131 +23,157 @@ final class AddressDraftBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; /** + * @var ?string */ private $country; /** + * @var ?string */ private $title; /** + * @var ?string */ private $salutation; /** + * @var ?string */ private $firstName; /** + * @var ?string */ private $lastName; /** + * @var ?string */ private $streetName; /** + * @var ?string */ private $streetNumber; /** + * @var ?string */ private $additionalStreetInfo; /** + * @var ?string */ private $postalCode; /** + * @var ?string */ private $city; /** + * @var ?string */ private $region; /** + * @var ?string */ private $state; /** + * @var ?string */ private $company; /** + * @var ?string */ private $department; /** + * @var ?string */ private $building; /** + * @var ?string */ private $apartment; /** + * @var ?string */ private $pOBox; /** + * @var ?string */ private $phone; /** + * @var ?string */ private $mobile; /** + * @var ?string */ private $email; /** + * @var ?string */ private $fax; /** + * @var ?string */ private $additionalAddressInfo; /** + * @var ?string */ private $externalId; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; @@ -155,6 +181,7 @@ final class AddressDraftBuilder implements Builder /** *

Unique identifier for the Address. Not recommended to set it manually since the API overwrites this ID when creating an Address for a Customer. Use key instead and omit this field from the request to let the API generate the ID for the Address.

* + * @return null|string */ public function getId() @@ -165,6 +192,7 @@ public function getId() /** *

User-defined unique identifier for the Address.

* + * @return null|string */ public function getKey() @@ -175,6 +203,7 @@ public function getKey() /** *

Two-digit country code as per ISO 3166-1 alpha-2.

* + * @return null|string */ public function getCountry() @@ -185,6 +214,7 @@ public function getCountry() /** *

Title of the contact, for example 'Dr.'

* + * @return null|string */ public function getTitle() @@ -195,6 +225,7 @@ public function getTitle() /** *

Salutation of the contact, for example 'Mr.' or 'Ms.'

* + * @return null|string */ public function getSalutation() @@ -205,6 +236,7 @@ public function getSalutation() /** *

Given name (first name) of the contact.

* + * @return null|string */ public function getFirstName() @@ -215,6 +247,7 @@ public function getFirstName() /** *

Family name (last name) of the contact.

* + * @return null|string */ public function getLastName() @@ -225,6 +258,7 @@ public function getLastName() /** *

Name of the street.

* + * @return null|string */ public function getStreetName() @@ -235,6 +269,7 @@ public function getStreetName() /** *

Street number.

* + * @return null|string */ public function getStreetNumber() @@ -245,6 +280,7 @@ public function getStreetNumber() /** *

Further information on the street address.

* + * @return null|string */ public function getAdditionalStreetInfo() @@ -255,6 +291,7 @@ public function getAdditionalStreetInfo() /** *

Postal code.

* + * @return null|string */ public function getPostalCode() @@ -265,6 +302,7 @@ public function getPostalCode() /** *

Name of the city.

* + * @return null|string */ public function getCity() @@ -275,6 +313,7 @@ public function getCity() /** *

Name of the region.

* + * @return null|string */ public function getRegion() @@ -285,6 +324,7 @@ public function getRegion() /** *

Name of the state, for example, Colorado.

* + * @return null|string */ public function getState() @@ -295,6 +335,7 @@ public function getState() /** *

Name of the company.

* + * @return null|string */ public function getCompany() @@ -305,6 +346,7 @@ public function getCompany() /** *

Name of the department.

* + * @return null|string */ public function getDepartment() @@ -315,6 +357,7 @@ public function getDepartment() /** *

Number or name of the building.

* + * @return null|string */ public function getBuilding() @@ -325,6 +368,7 @@ public function getBuilding() /** *

Number or name of the apartment.

* + * @return null|string */ public function getApartment() @@ -335,6 +379,7 @@ public function getApartment() /** *

Post office box number.

* + * @return null|string */ public function getPOBox() @@ -345,6 +390,7 @@ public function getPOBox() /** *

Phone number of the contact.

* + * @return null|string */ public function getPhone() @@ -355,6 +401,7 @@ public function getPhone() /** *

Mobile phone number of the contact.

* + * @return null|string */ public function getMobile() @@ -365,6 +412,7 @@ public function getMobile() /** *

Email address of the contact.

* + * @return null|string */ public function getEmail() @@ -375,6 +423,7 @@ public function getEmail() /** *

Fax number of the contact.

* + * @return null|string */ public function getFax() @@ -385,6 +434,7 @@ public function getFax() /** *

Further information on the Address.

* + * @return null|string */ public function getAdditionalAddressInfo() @@ -395,6 +445,7 @@ public function getAdditionalAddressInfo() /** *

ID for the contact used in an external system.

* + * @return null|string */ public function getExternalId() @@ -405,6 +456,7 @@ public function getExternalId() /** *

Custom Fields defined for the Address.

* + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Common/AddressDraftModel.php b/lib/commercetools-api/src/Models/Common/AddressDraftModel.php index 5b18b8091e6..85477532c1f 100644 --- a/lib/commercetools-api/src/Models/Common/AddressDraftModel.php +++ b/lib/commercetools-api/src/Models/Common/AddressDraftModel.php @@ -22,131 +22,157 @@ final class AddressDraftModel extends JsonObjectModel implements AddressDraft { /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $title; /** + * * @var ?string */ protected $salutation; /** + * * @var ?string */ protected $firstName; /** + * * @var ?string */ protected $lastName; /** + * * @var ?string */ protected $streetName; /** + * * @var ?string */ protected $streetNumber; /** + * * @var ?string */ protected $additionalStreetInfo; /** + * * @var ?string */ protected $postalCode; /** + * * @var ?string */ protected $city; /** + * * @var ?string */ protected $region; /** + * * @var ?string */ protected $state; /** + * * @var ?string */ protected $company; /** + * * @var ?string */ protected $department; /** + * * @var ?string */ protected $building; /** + * * @var ?string */ protected $apartment; /** + * * @var ?string */ protected $pOBox; /** + * * @var ?string */ protected $phone; /** + * * @var ?string */ protected $mobile; /** + * * @var ?string */ protected $email; /** + * * @var ?string */ protected $fax; /** + * * @var ?string */ protected $additionalAddressInfo; /** + * * @var ?string */ protected $externalId; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -214,6 +240,7 @@ public function __construct( /** *

Unique identifier for the Address. Not recommended to set it manually since the API overwrites this ID when creating an Address for a Customer. Use key instead and omit this field from the request to let the API generate the ID for the Address.

* + * * @return null|string */ public function getId() @@ -233,6 +260,7 @@ public function getId() /** *

User-defined unique identifier for the Address.

* + * * @return null|string */ public function getKey() @@ -252,6 +280,7 @@ public function getKey() /** *

Two-digit country code as per ISO 3166-1 alpha-2.

* + * * @return null|string */ public function getCountry() @@ -271,6 +300,7 @@ public function getCountry() /** *

Title of the contact, for example 'Dr.'

* + * * @return null|string */ public function getTitle() @@ -290,6 +320,7 @@ public function getTitle() /** *

Salutation of the contact, for example 'Mr.' or 'Ms.'

* + * * @return null|string */ public function getSalutation() @@ -309,6 +340,7 @@ public function getSalutation() /** *

Given name (first name) of the contact.

* + * * @return null|string */ public function getFirstName() @@ -328,6 +360,7 @@ public function getFirstName() /** *

Family name (last name) of the contact.

* + * * @return null|string */ public function getLastName() @@ -347,6 +380,7 @@ public function getLastName() /** *

Name of the street.

* + * * @return null|string */ public function getStreetName() @@ -366,6 +400,7 @@ public function getStreetName() /** *

Street number.

* + * * @return null|string */ public function getStreetNumber() @@ -385,6 +420,7 @@ public function getStreetNumber() /** *

Further information on the street address.

* + * * @return null|string */ public function getAdditionalStreetInfo() @@ -404,6 +440,7 @@ public function getAdditionalStreetInfo() /** *

Postal code.

* + * * @return null|string */ public function getPostalCode() @@ -423,6 +460,7 @@ public function getPostalCode() /** *

Name of the city.

* + * * @return null|string */ public function getCity() @@ -442,6 +480,7 @@ public function getCity() /** *

Name of the region.

* + * * @return null|string */ public function getRegion() @@ -461,6 +500,7 @@ public function getRegion() /** *

Name of the state, for example, Colorado.

* + * * @return null|string */ public function getState() @@ -480,6 +520,7 @@ public function getState() /** *

Name of the company.

* + * * @return null|string */ public function getCompany() @@ -499,6 +540,7 @@ public function getCompany() /** *

Name of the department.

* + * * @return null|string */ public function getDepartment() @@ -518,6 +560,7 @@ public function getDepartment() /** *

Number or name of the building.

* + * * @return null|string */ public function getBuilding() @@ -537,6 +580,7 @@ public function getBuilding() /** *

Number or name of the apartment.

* + * * @return null|string */ public function getApartment() @@ -556,6 +600,7 @@ public function getApartment() /** *

Post office box number.

* + * * @return null|string */ public function getPOBox() @@ -575,6 +620,7 @@ public function getPOBox() /** *

Phone number of the contact.

* + * * @return null|string */ public function getPhone() @@ -594,6 +640,7 @@ public function getPhone() /** *

Mobile phone number of the contact.

* + * * @return null|string */ public function getMobile() @@ -613,6 +660,7 @@ public function getMobile() /** *

Email address of the contact.

* + * * @return null|string */ public function getEmail() @@ -632,6 +680,7 @@ public function getEmail() /** *

Fax number of the contact.

* + * * @return null|string */ public function getFax() @@ -651,6 +700,7 @@ public function getFax() /** *

Further information on the Address.

* + * * @return null|string */ public function getAdditionalAddressInfo() @@ -670,6 +720,7 @@ public function getAdditionalAddressInfo() /** *

ID for the contact used in an external system.

* + * * @return null|string */ public function getExternalId() @@ -689,6 +740,7 @@ public function getExternalId() /** *

Custom Fields defined for the Address.

* + * * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Common/AddressModel.php b/lib/commercetools-api/src/Models/Common/AddressModel.php index 2c402008bd5..a610fd877f9 100644 --- a/lib/commercetools-api/src/Models/Common/AddressModel.php +++ b/lib/commercetools-api/src/Models/Common/AddressModel.php @@ -22,131 +22,157 @@ final class AddressModel extends JsonObjectModel implements Address { /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $title; /** + * * @var ?string */ protected $salutation; /** + * * @var ?string */ protected $firstName; /** + * * @var ?string */ protected $lastName; /** + * * @var ?string */ protected $streetName; /** + * * @var ?string */ protected $streetNumber; /** + * * @var ?string */ protected $additionalStreetInfo; /** + * * @var ?string */ protected $postalCode; /** + * * @var ?string */ protected $city; /** + * * @var ?string */ protected $region; /** + * * @var ?string */ protected $state; /** + * * @var ?string */ protected $company; /** + * * @var ?string */ protected $department; /** + * * @var ?string */ protected $building; /** + * * @var ?string */ protected $apartment; /** + * * @var ?string */ protected $pOBox; /** + * * @var ?string */ protected $phone; /** + * * @var ?string */ protected $mobile; /** + * * @var ?string */ protected $email; /** + * * @var ?string */ protected $fax; /** + * * @var ?string */ protected $additionalAddressInfo; /** + * * @var ?string */ protected $externalId; /** + * * @var ?CustomFields */ protected $custom; @@ -214,6 +240,7 @@ public function __construct( /** *

Unique identifier of the Address.

* + * * @return null|string */ public function getId() @@ -233,6 +260,7 @@ public function getId() /** *

User-defined unique identifier of the Address.

* + * * @return null|string */ public function getKey() @@ -252,6 +280,7 @@ public function getKey() /** *

Two-digit country code as per ISO 3166-1 alpha-2.

* + * * @return null|string */ public function getCountry() @@ -271,6 +300,7 @@ public function getCountry() /** *

Title of the contact, for example 'Dr.'

* + * * @return null|string */ public function getTitle() @@ -290,6 +320,7 @@ public function getTitle() /** *

Salutation of the contact, for example 'Mr.' or 'Ms.'

* + * * @return null|string */ public function getSalutation() @@ -309,6 +340,7 @@ public function getSalutation() /** *

Given name (first name) of the contact.

* + * * @return null|string */ public function getFirstName() @@ -328,6 +360,7 @@ public function getFirstName() /** *

Family name (last name) of the contact.

* + * * @return null|string */ public function getLastName() @@ -347,6 +380,7 @@ public function getLastName() /** *

Name of the street.

* + * * @return null|string */ public function getStreetName() @@ -366,6 +400,7 @@ public function getStreetName() /** *

Street number.

* + * * @return null|string */ public function getStreetNumber() @@ -385,6 +420,7 @@ public function getStreetNumber() /** *

Further information on the street address.

* + * * @return null|string */ public function getAdditionalStreetInfo() @@ -404,6 +440,7 @@ public function getAdditionalStreetInfo() /** *

Postal code.

* + * * @return null|string */ public function getPostalCode() @@ -423,6 +460,7 @@ public function getPostalCode() /** *

Name of the city.

* + * * @return null|string */ public function getCity() @@ -442,6 +480,7 @@ public function getCity() /** *

Name of the region.

* + * * @return null|string */ public function getRegion() @@ -461,6 +500,7 @@ public function getRegion() /** *

Name of the state, for example, Colorado.

* + * * @return null|string */ public function getState() @@ -480,6 +520,7 @@ public function getState() /** *

Name of the company.

* + * * @return null|string */ public function getCompany() @@ -499,6 +540,7 @@ public function getCompany() /** *

Name of the department.

* + * * @return null|string */ public function getDepartment() @@ -518,6 +560,7 @@ public function getDepartment() /** *

Number or name of the building.

* + * * @return null|string */ public function getBuilding() @@ -537,6 +580,7 @@ public function getBuilding() /** *

Number or name of the apartment.

* + * * @return null|string */ public function getApartment() @@ -556,6 +600,7 @@ public function getApartment() /** *

Post office box number.

* + * * @return null|string */ public function getPOBox() @@ -575,6 +620,7 @@ public function getPOBox() /** *

Phone number of the contact.

* + * * @return null|string */ public function getPhone() @@ -594,6 +640,7 @@ public function getPhone() /** *

Mobile phone number of the contact.

* + * * @return null|string */ public function getMobile() @@ -613,6 +660,7 @@ public function getMobile() /** *

Email address of the contact.

* + * * @return null|string */ public function getEmail() @@ -632,6 +680,7 @@ public function getEmail() /** *

Fax number of the contact.

* + * * @return null|string */ public function getFax() @@ -651,6 +700,7 @@ public function getFax() /** *

Further information on the Address.

* + * * @return null|string */ public function getAdditionalAddressInfo() @@ -670,6 +720,7 @@ public function getAdditionalAddressInfo() /** *

ID for the contact used in an external system.

* + * * @return null|string */ public function getExternalId() @@ -689,6 +740,7 @@ public function getExternalId() /** *

Custom Fields defined for the Address.

* + * * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Common/Asset.php b/lib/commercetools-api/src/Models/Common/Asset.php index b9499077ccf..92780cbfc06 100644 --- a/lib/commercetools-api/src/Models/Common/Asset.php +++ b/lib/commercetools-api/src/Models/Common/Asset.php @@ -25,11 +25,13 @@ interface Asset extends JsonObject /** *

Unique identifier of the Asset.

* + * @return null|string */ public function getId(); /** + * @return null|AssetSourceCollection */ public function getSources(); @@ -37,6 +39,7 @@ public function getSources(); /** *

Name of the Asset.

* + * @return null|LocalizedString */ public function getName(); @@ -44,6 +47,7 @@ public function getName(); /** *

Description of the Asset.

* + * @return null|LocalizedString */ public function getDescription(); @@ -51,6 +55,7 @@ public function getDescription(); /** *

Keywords for categorizing and organizing Assets.

* + * @return null|array */ public function getTags(); @@ -58,6 +63,7 @@ public function getTags(); /** *

Custom Fields defined for the Asset.

* + * @return null|CustomFields */ public function getCustom(); @@ -65,6 +71,7 @@ public function getCustom(); /** *

User-defined unique identifier of the Asset.

* + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Common/AssetBuilder.php b/lib/commercetools-api/src/Models/Common/AssetBuilder.php index 031d1c27caa..ed57074d5c5 100644 --- a/lib/commercetools-api/src/Models/Common/AssetBuilder.php +++ b/lib/commercetools-api/src/Models/Common/AssetBuilder.php @@ -23,36 +23,43 @@ final class AssetBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?AssetSourceCollection */ private $sources; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?array */ private $tags; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var ?string */ private $key; @@ -60,6 +67,7 @@ final class AssetBuilder implements Builder /** *

Unique identifier of the Asset.

* + * @return null|string */ public function getId() @@ -68,6 +76,7 @@ public function getId() } /** + * @return null|AssetSourceCollection */ public function getSources() @@ -78,6 +87,7 @@ public function getSources() /** *

Name of the Asset.

* + * @return null|LocalizedString */ public function getName() @@ -88,6 +98,7 @@ public function getName() /** *

Description of the Asset.

* + * @return null|LocalizedString */ public function getDescription() @@ -98,6 +109,7 @@ public function getDescription() /** *

Keywords for categorizing and organizing Assets.

* + * @return null|array */ public function getTags() @@ -108,6 +120,7 @@ public function getTags() /** *

Custom Fields defined for the Asset.

* + * @return null|CustomFields */ public function getCustom() @@ -118,6 +131,7 @@ public function getCustom() /** *

User-defined unique identifier of the Asset.

* + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Common/AssetDimensions.php b/lib/commercetools-api/src/Models/Common/AssetDimensions.php index 10f96524de2..a9a4bede735 100644 --- a/lib/commercetools-api/src/Models/Common/AssetDimensions.php +++ b/lib/commercetools-api/src/Models/Common/AssetDimensions.php @@ -19,6 +19,7 @@ interface AssetDimensions extends JsonObject /** *

Width of the Asset source.

* + * @return null|int */ public function getW(); @@ -26,6 +27,7 @@ public function getW(); /** *

Height of the Asset source.

* + * @return null|int */ public function getH(); diff --git a/lib/commercetools-api/src/Models/Common/AssetDimensionsBuilder.php b/lib/commercetools-api/src/Models/Common/AssetDimensionsBuilder.php index bb62ff13d30..be98e2a5716 100644 --- a/lib/commercetools-api/src/Models/Common/AssetDimensionsBuilder.php +++ b/lib/commercetools-api/src/Models/Common/AssetDimensionsBuilder.php @@ -21,11 +21,13 @@ final class AssetDimensionsBuilder implements Builder { /** + * @var ?int */ private $w; /** + * @var ?int */ private $h; @@ -33,6 +35,7 @@ final class AssetDimensionsBuilder implements Builder /** *

Width of the Asset source.

* + * @return null|int */ public function getW() @@ -43,6 +46,7 @@ public function getW() /** *

Height of the Asset source.

* + * @return null|int */ public function getH() diff --git a/lib/commercetools-api/src/Models/Common/AssetDimensionsModel.php b/lib/commercetools-api/src/Models/Common/AssetDimensionsModel.php index 5511423034b..f40965c0d93 100644 --- a/lib/commercetools-api/src/Models/Common/AssetDimensionsModel.php +++ b/lib/commercetools-api/src/Models/Common/AssetDimensionsModel.php @@ -20,11 +20,13 @@ final class AssetDimensionsModel extends JsonObjectModel implements AssetDimensions { /** + * * @var ?int */ protected $w; /** + * * @var ?int */ protected $h; @@ -44,6 +46,7 @@ public function __construct( /** *

Width of the Asset source.

* + * * @return null|int */ public function getW() @@ -63,6 +66,7 @@ public function getW() /** *

Height of the Asset source.

* + * * @return null|int */ public function getH() diff --git a/lib/commercetools-api/src/Models/Common/AssetDraft.php b/lib/commercetools-api/src/Models/Common/AssetDraft.php index 9399e05dcd3..e9cbdc9cbb2 100644 --- a/lib/commercetools-api/src/Models/Common/AssetDraft.php +++ b/lib/commercetools-api/src/Models/Common/AssetDraft.php @@ -22,6 +22,7 @@ interface AssetDraft extends JsonObject public const FIELD_KEY = 'key'; /** + * @return null|AssetSourceCollection */ public function getSources(); @@ -29,6 +30,7 @@ public function getSources(); /** *

Name of the Asset.

* + * @return null|LocalizedString */ public function getName(); @@ -36,6 +38,7 @@ public function getName(); /** *

Description of the Asset.

* + * @return null|LocalizedString */ public function getDescription(); @@ -43,6 +46,7 @@ public function getDescription(); /** *

Keywords for categorizing and organizing Assets.

* + * @return null|array */ public function getTags(); @@ -50,6 +54,7 @@ public function getTags(); /** *

Custom Fields defined for the Asset.

* + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -57,6 +62,7 @@ public function getCustom(); /** *

User-defined unique identifier for the Asset.

* + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Common/AssetDraftBuilder.php b/lib/commercetools-api/src/Models/Common/AssetDraftBuilder.php index 4b8ac6e33d1..4c8d8799ae9 100644 --- a/lib/commercetools-api/src/Models/Common/AssetDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Common/AssetDraftBuilder.php @@ -23,36 +23,43 @@ final class AssetDraftBuilder implements Builder { /** + * @var ?AssetSourceCollection */ private $sources; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?array */ private $tags; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var ?string */ private $key; /** + * @return null|AssetSourceCollection */ public function getSources() @@ -63,6 +70,7 @@ public function getSources() /** *

Name of the Asset.

* + * @return null|LocalizedString */ public function getName() @@ -73,6 +81,7 @@ public function getName() /** *

Description of the Asset.

* + * @return null|LocalizedString */ public function getDescription() @@ -83,6 +92,7 @@ public function getDescription() /** *

Keywords for categorizing and organizing Assets.

* + * @return null|array */ public function getTags() @@ -93,6 +103,7 @@ public function getTags() /** *

Custom Fields defined for the Asset.

* + * @return null|CustomFieldsDraft */ public function getCustom() @@ -103,6 +114,7 @@ public function getCustom() /** *

User-defined unique identifier for the Asset.

* + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Common/AssetDraftModel.php b/lib/commercetools-api/src/Models/Common/AssetDraftModel.php index 2e42ce94f38..e61e9242b45 100644 --- a/lib/commercetools-api/src/Models/Common/AssetDraftModel.php +++ b/lib/commercetools-api/src/Models/Common/AssetDraftModel.php @@ -22,31 +22,37 @@ final class AssetDraftModel extends JsonObjectModel implements AssetDraft { /** + * * @var ?AssetSourceCollection */ protected $sources; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?array */ protected $tags; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?string */ protected $key; @@ -72,6 +78,7 @@ public function __construct( } /** + * * @return null|AssetSourceCollection */ public function getSources() @@ -91,6 +98,7 @@ public function getSources() /** *

Name of the Asset.

* + * * @return null|LocalizedString */ public function getName() @@ -111,6 +119,7 @@ public function getName() /** *

Description of the Asset.

* + * * @return null|LocalizedString */ public function getDescription() @@ -131,6 +140,7 @@ public function getDescription() /** *

Keywords for categorizing and organizing Assets.

* + * * @return null|array */ public function getTags() @@ -150,6 +160,7 @@ public function getTags() /** *

Custom Fields defined for the Asset.

* + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -170,6 +181,7 @@ public function getCustom() /** *

User-defined unique identifier for the Asset.

* + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Common/AssetModel.php b/lib/commercetools-api/src/Models/Common/AssetModel.php index dba638eab3a..0b4e8d9ee28 100644 --- a/lib/commercetools-api/src/Models/Common/AssetModel.php +++ b/lib/commercetools-api/src/Models/Common/AssetModel.php @@ -22,36 +22,43 @@ final class AssetModel extends JsonObjectModel implements Asset { /** + * * @var ?string */ protected $id; /** + * * @var ?AssetSourceCollection */ protected $sources; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?array */ protected $tags; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?string */ protected $key; @@ -81,6 +88,7 @@ public function __construct( /** *

Unique identifier of the Asset.

* + * * @return null|string */ public function getId() @@ -98,6 +106,7 @@ public function getId() } /** + * * @return null|AssetSourceCollection */ public function getSources() @@ -117,6 +126,7 @@ public function getSources() /** *

Name of the Asset.

* + * * @return null|LocalizedString */ public function getName() @@ -137,6 +147,7 @@ public function getName() /** *

Description of the Asset.

* + * * @return null|LocalizedString */ public function getDescription() @@ -157,6 +168,7 @@ public function getDescription() /** *

Keywords for categorizing and organizing Assets.

* + * * @return null|array */ public function getTags() @@ -176,6 +188,7 @@ public function getTags() /** *

Custom Fields defined for the Asset.

* + * * @return null|CustomFields */ public function getCustom() @@ -196,6 +209,7 @@ public function getCustom() /** *

User-defined unique identifier of the Asset.

* + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Common/AssetSource.php b/lib/commercetools-api/src/Models/Common/AssetSource.php index 0b0b8db961d..e438482cdb6 100644 --- a/lib/commercetools-api/src/Models/Common/AssetSource.php +++ b/lib/commercetools-api/src/Models/Common/AssetSource.php @@ -21,6 +21,7 @@ interface AssetSource extends JsonObject /** *

URI of the AssetSource.

* + * @return null|string */ public function getUri(); @@ -28,6 +29,7 @@ public function getUri(); /** *

User-defined unique identifier of the AssetSource.

* + * @return null|string */ public function getKey(); @@ -35,6 +37,7 @@ public function getKey(); /** *

Width and height of the AssetSource.

* + * @return null|AssetDimensions */ public function getDimensions(); @@ -42,6 +45,7 @@ public function getDimensions(); /** *

Indicates the type of content, for example application/pdf.

* + * @return null|string */ public function getContentType(); diff --git a/lib/commercetools-api/src/Models/Common/AssetSourceBuilder.php b/lib/commercetools-api/src/Models/Common/AssetSourceBuilder.php index bb7ccf8b192..e7ec770137c 100644 --- a/lib/commercetools-api/src/Models/Common/AssetSourceBuilder.php +++ b/lib/commercetools-api/src/Models/Common/AssetSourceBuilder.php @@ -21,21 +21,25 @@ final class AssetSourceBuilder implements Builder { /** + * @var ?string */ private $uri; /** + * @var ?string */ private $key; /** + * @var null|AssetDimensions|AssetDimensionsBuilder */ private $dimensions; /** + * @var ?string */ private $contentType; @@ -43,6 +47,7 @@ final class AssetSourceBuilder implements Builder /** *

URI of the AssetSource.

* + * @return null|string */ public function getUri() @@ -53,6 +58,7 @@ public function getUri() /** *

User-defined unique identifier of the AssetSource.

* + * @return null|string */ public function getKey() @@ -63,6 +69,7 @@ public function getKey() /** *

Width and height of the AssetSource.

* + * @return null|AssetDimensions */ public function getDimensions() @@ -73,6 +80,7 @@ public function getDimensions() /** *

Indicates the type of content, for example application/pdf.

* + * @return null|string */ public function getContentType() diff --git a/lib/commercetools-api/src/Models/Common/AssetSourceModel.php b/lib/commercetools-api/src/Models/Common/AssetSourceModel.php index aff8506189e..3349e2961a6 100644 --- a/lib/commercetools-api/src/Models/Common/AssetSourceModel.php +++ b/lib/commercetools-api/src/Models/Common/AssetSourceModel.php @@ -20,21 +20,25 @@ final class AssetSourceModel extends JsonObjectModel implements AssetSource { /** + * * @var ?string */ protected $uri; /** + * * @var ?string */ protected $key; /** + * * @var ?AssetDimensions */ protected $dimensions; /** + * * @var ?string */ protected $contentType; @@ -58,6 +62,7 @@ public function __construct( /** *

URI of the AssetSource.

* + * * @return null|string */ public function getUri() @@ -77,6 +82,7 @@ public function getUri() /** *

User-defined unique identifier of the AssetSource.

* + * * @return null|string */ public function getKey() @@ -96,6 +102,7 @@ public function getKey() /** *

Width and height of the AssetSource.

* + * * @return null|AssetDimensions */ public function getDimensions() @@ -116,6 +123,7 @@ public function getDimensions() /** *

Indicates the type of content, for example application/pdf.

* + * * @return null|string */ public function getContentType() diff --git a/lib/commercetools-api/src/Models/Common/BaseAddress.php b/lib/commercetools-api/src/Models/Common/BaseAddress.php index 843e021cad1..b2e1bde3eb2 100644 --- a/lib/commercetools-api/src/Models/Common/BaseAddress.php +++ b/lib/commercetools-api/src/Models/Common/BaseAddress.php @@ -42,6 +42,7 @@ interface BaseAddress extends JsonObject /** *

Unique identifier of the Address.

* + * @return null|string */ public function getId(); @@ -49,6 +50,7 @@ public function getId(); /** *

User-defined unique identifier of the Address.

* + * @return null|string */ public function getKey(); @@ -56,6 +58,7 @@ public function getKey(); /** *

Two-digit country code as per ISO 3166-1 alpha-2.

* + * @return null|string */ public function getCountry(); @@ -63,6 +66,7 @@ public function getCountry(); /** *

Title of the contact, for example 'Dr.'

* + * @return null|string */ public function getTitle(); @@ -70,6 +74,7 @@ public function getTitle(); /** *

Salutation of the contact, for example 'Mr.' or 'Ms.'

* + * @return null|string */ public function getSalutation(); @@ -77,6 +82,7 @@ public function getSalutation(); /** *

Given name (first name) of the contact.

* + * @return null|string */ public function getFirstName(); @@ -84,6 +90,7 @@ public function getFirstName(); /** *

Family name (last name) of the contact.

* + * @return null|string */ public function getLastName(); @@ -91,6 +98,7 @@ public function getLastName(); /** *

Name of the street.

* + * @return null|string */ public function getStreetName(); @@ -98,6 +106,7 @@ public function getStreetName(); /** *

Street number.

* + * @return null|string */ public function getStreetNumber(); @@ -105,6 +114,7 @@ public function getStreetNumber(); /** *

Further information on the street address.

* + * @return null|string */ public function getAdditionalStreetInfo(); @@ -112,6 +122,7 @@ public function getAdditionalStreetInfo(); /** *

Postal code.

* + * @return null|string */ public function getPostalCode(); @@ -119,6 +130,7 @@ public function getPostalCode(); /** *

Name of the city.

* + * @return null|string */ public function getCity(); @@ -126,6 +138,7 @@ public function getCity(); /** *

Name of the region.

* + * @return null|string */ public function getRegion(); @@ -133,6 +146,7 @@ public function getRegion(); /** *

Name of the state, for example, Colorado.

* + * @return null|string */ public function getState(); @@ -140,6 +154,7 @@ public function getState(); /** *

Name of the company.

* + * @return null|string */ public function getCompany(); @@ -147,6 +162,7 @@ public function getCompany(); /** *

Name of the department.

* + * @return null|string */ public function getDepartment(); @@ -154,6 +170,7 @@ public function getDepartment(); /** *

Number or name of the building.

* + * @return null|string */ public function getBuilding(); @@ -161,6 +178,7 @@ public function getBuilding(); /** *

Number or name of the apartment.

* + * @return null|string */ public function getApartment(); @@ -168,6 +186,7 @@ public function getApartment(); /** *

Post office box number.

* + * @return null|string */ public function getPOBox(); @@ -175,6 +194,7 @@ public function getPOBox(); /** *

Phone number of the contact.

* + * @return null|string */ public function getPhone(); @@ -182,6 +202,7 @@ public function getPhone(); /** *

Mobile phone number of the contact.

* + * @return null|string */ public function getMobile(); @@ -189,6 +210,7 @@ public function getMobile(); /** *

Email address of the contact.

* + * @return null|string */ public function getEmail(); @@ -196,6 +218,7 @@ public function getEmail(); /** *

Fax number of the contact.

* + * @return null|string */ public function getFax(); @@ -203,6 +226,7 @@ public function getFax(); /** *

Further information on the Address.

* + * @return null|string */ public function getAdditionalAddressInfo(); @@ -210,6 +234,7 @@ public function getAdditionalAddressInfo(); /** *

ID for the contact used in an external system.

* + * @return null|string */ public function getExternalId(); diff --git a/lib/commercetools-api/src/Models/Common/BaseAddressBuilder.php b/lib/commercetools-api/src/Models/Common/BaseAddressBuilder.php index d8214d26cf4..b4819928343 100644 --- a/lib/commercetools-api/src/Models/Common/BaseAddressBuilder.php +++ b/lib/commercetools-api/src/Models/Common/BaseAddressBuilder.php @@ -21,126 +21,151 @@ final class BaseAddressBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; /** + * @var ?string */ private $country; /** + * @var ?string */ private $title; /** + * @var ?string */ private $salutation; /** + * @var ?string */ private $firstName; /** + * @var ?string */ private $lastName; /** + * @var ?string */ private $streetName; /** + * @var ?string */ private $streetNumber; /** + * @var ?string */ private $additionalStreetInfo; /** + * @var ?string */ private $postalCode; /** + * @var ?string */ private $city; /** + * @var ?string */ private $region; /** + * @var ?string */ private $state; /** + * @var ?string */ private $company; /** + * @var ?string */ private $department; /** + * @var ?string */ private $building; /** + * @var ?string */ private $apartment; /** + * @var ?string */ private $pOBox; /** + * @var ?string */ private $phone; /** + * @var ?string */ private $mobile; /** + * @var ?string */ private $email; /** + * @var ?string */ private $fax; /** + * @var ?string */ private $additionalAddressInfo; /** + * @var ?string */ private $externalId; @@ -148,6 +173,7 @@ final class BaseAddressBuilder implements Builder /** *

Unique identifier of the Address.

* + * @return null|string */ public function getId() @@ -158,6 +184,7 @@ public function getId() /** *

User-defined unique identifier of the Address.

* + * @return null|string */ public function getKey() @@ -168,6 +195,7 @@ public function getKey() /** *

Two-digit country code as per ISO 3166-1 alpha-2.

* + * @return null|string */ public function getCountry() @@ -178,6 +206,7 @@ public function getCountry() /** *

Title of the contact, for example 'Dr.'

* + * @return null|string */ public function getTitle() @@ -188,6 +217,7 @@ public function getTitle() /** *

Salutation of the contact, for example 'Mr.' or 'Ms.'

* + * @return null|string */ public function getSalutation() @@ -198,6 +228,7 @@ public function getSalutation() /** *

Given name (first name) of the contact.

* + * @return null|string */ public function getFirstName() @@ -208,6 +239,7 @@ public function getFirstName() /** *

Family name (last name) of the contact.

* + * @return null|string */ public function getLastName() @@ -218,6 +250,7 @@ public function getLastName() /** *

Name of the street.

* + * @return null|string */ public function getStreetName() @@ -228,6 +261,7 @@ public function getStreetName() /** *

Street number.

* + * @return null|string */ public function getStreetNumber() @@ -238,6 +272,7 @@ public function getStreetNumber() /** *

Further information on the street address.

* + * @return null|string */ public function getAdditionalStreetInfo() @@ -248,6 +283,7 @@ public function getAdditionalStreetInfo() /** *

Postal code.

* + * @return null|string */ public function getPostalCode() @@ -258,6 +294,7 @@ public function getPostalCode() /** *

Name of the city.

* + * @return null|string */ public function getCity() @@ -268,6 +305,7 @@ public function getCity() /** *

Name of the region.

* + * @return null|string */ public function getRegion() @@ -278,6 +316,7 @@ public function getRegion() /** *

Name of the state, for example, Colorado.

* + * @return null|string */ public function getState() @@ -288,6 +327,7 @@ public function getState() /** *

Name of the company.

* + * @return null|string */ public function getCompany() @@ -298,6 +338,7 @@ public function getCompany() /** *

Name of the department.

* + * @return null|string */ public function getDepartment() @@ -308,6 +349,7 @@ public function getDepartment() /** *

Number or name of the building.

* + * @return null|string */ public function getBuilding() @@ -318,6 +360,7 @@ public function getBuilding() /** *

Number or name of the apartment.

* + * @return null|string */ public function getApartment() @@ -328,6 +371,7 @@ public function getApartment() /** *

Post office box number.

* + * @return null|string */ public function getPOBox() @@ -338,6 +382,7 @@ public function getPOBox() /** *

Phone number of the contact.

* + * @return null|string */ public function getPhone() @@ -348,6 +393,7 @@ public function getPhone() /** *

Mobile phone number of the contact.

* + * @return null|string */ public function getMobile() @@ -358,6 +404,7 @@ public function getMobile() /** *

Email address of the contact.

* + * @return null|string */ public function getEmail() @@ -368,6 +415,7 @@ public function getEmail() /** *

Fax number of the contact.

* + * @return null|string */ public function getFax() @@ -378,6 +426,7 @@ public function getFax() /** *

Further information on the Address.

* + * @return null|string */ public function getAdditionalAddressInfo() @@ -388,6 +437,7 @@ public function getAdditionalAddressInfo() /** *

ID for the contact used in an external system.

* + * @return null|string */ public function getExternalId() diff --git a/lib/commercetools-api/src/Models/Common/BaseAddressModel.php b/lib/commercetools-api/src/Models/Common/BaseAddressModel.php index ee42fa38e72..3f81e2082d2 100644 --- a/lib/commercetools-api/src/Models/Common/BaseAddressModel.php +++ b/lib/commercetools-api/src/Models/Common/BaseAddressModel.php @@ -20,126 +20,151 @@ final class BaseAddressModel extends JsonObjectModel implements BaseAddress { /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $title; /** + * * @var ?string */ protected $salutation; /** + * * @var ?string */ protected $firstName; /** + * * @var ?string */ protected $lastName; /** + * * @var ?string */ protected $streetName; /** + * * @var ?string */ protected $streetNumber; /** + * * @var ?string */ protected $additionalStreetInfo; /** + * * @var ?string */ protected $postalCode; /** + * * @var ?string */ protected $city; /** + * * @var ?string */ protected $region; /** + * * @var ?string */ protected $state; /** + * * @var ?string */ protected $company; /** + * * @var ?string */ protected $department; /** + * * @var ?string */ protected $building; /** + * * @var ?string */ protected $apartment; /** + * * @var ?string */ protected $pOBox; /** + * * @var ?string */ protected $phone; /** + * * @var ?string */ protected $mobile; /** + * * @var ?string */ protected $email; /** + * * @var ?string */ protected $fax; /** + * * @var ?string */ protected $additionalAddressInfo; /** + * * @var ?string */ protected $externalId; @@ -205,6 +230,7 @@ public function __construct( /** *

Unique identifier of the Address.

* + * * @return null|string */ public function getId() @@ -224,6 +250,7 @@ public function getId() /** *

User-defined unique identifier of the Address.

* + * * @return null|string */ public function getKey() @@ -243,6 +270,7 @@ public function getKey() /** *

Two-digit country code as per ISO 3166-1 alpha-2.

* + * * @return null|string */ public function getCountry() @@ -262,6 +290,7 @@ public function getCountry() /** *

Title of the contact, for example 'Dr.'

* + * * @return null|string */ public function getTitle() @@ -281,6 +310,7 @@ public function getTitle() /** *

Salutation of the contact, for example 'Mr.' or 'Ms.'

* + * * @return null|string */ public function getSalutation() @@ -300,6 +330,7 @@ public function getSalutation() /** *

Given name (first name) of the contact.

* + * * @return null|string */ public function getFirstName() @@ -319,6 +350,7 @@ public function getFirstName() /** *

Family name (last name) of the contact.

* + * * @return null|string */ public function getLastName() @@ -338,6 +370,7 @@ public function getLastName() /** *

Name of the street.

* + * * @return null|string */ public function getStreetName() @@ -357,6 +390,7 @@ public function getStreetName() /** *

Street number.

* + * * @return null|string */ public function getStreetNumber() @@ -376,6 +410,7 @@ public function getStreetNumber() /** *

Further information on the street address.

* + * * @return null|string */ public function getAdditionalStreetInfo() @@ -395,6 +430,7 @@ public function getAdditionalStreetInfo() /** *

Postal code.

* + * * @return null|string */ public function getPostalCode() @@ -414,6 +450,7 @@ public function getPostalCode() /** *

Name of the city.

* + * * @return null|string */ public function getCity() @@ -433,6 +470,7 @@ public function getCity() /** *

Name of the region.

* + * * @return null|string */ public function getRegion() @@ -452,6 +490,7 @@ public function getRegion() /** *

Name of the state, for example, Colorado.

* + * * @return null|string */ public function getState() @@ -471,6 +510,7 @@ public function getState() /** *

Name of the company.

* + * * @return null|string */ public function getCompany() @@ -490,6 +530,7 @@ public function getCompany() /** *

Name of the department.

* + * * @return null|string */ public function getDepartment() @@ -509,6 +550,7 @@ public function getDepartment() /** *

Number or name of the building.

* + * * @return null|string */ public function getBuilding() @@ -528,6 +570,7 @@ public function getBuilding() /** *

Number or name of the apartment.

* + * * @return null|string */ public function getApartment() @@ -547,6 +590,7 @@ public function getApartment() /** *

Post office box number.

* + * * @return null|string */ public function getPOBox() @@ -566,6 +610,7 @@ public function getPOBox() /** *

Phone number of the contact.

* + * * @return null|string */ public function getPhone() @@ -585,6 +630,7 @@ public function getPhone() /** *

Mobile phone number of the contact.

* + * * @return null|string */ public function getMobile() @@ -604,6 +650,7 @@ public function getMobile() /** *

Email address of the contact.

* + * * @return null|string */ public function getEmail() @@ -623,6 +670,7 @@ public function getEmail() /** *

Fax number of the contact.

* + * * @return null|string */ public function getFax() @@ -642,6 +690,7 @@ public function getFax() /** *

Further information on the Address.

* + * * @return null|string */ public function getAdditionalAddressInfo() @@ -661,6 +710,7 @@ public function getAdditionalAddressInfo() /** *

ID for the contact used in an external system.

* + * * @return null|string */ public function getExternalId() diff --git a/lib/commercetools-api/src/Models/Common/BaseResource.php b/lib/commercetools-api/src/Models/Common/BaseResource.php index 984dfb58ee0..6e7a9f3ed96 100644 --- a/lib/commercetools-api/src/Models/Common/BaseResource.php +++ b/lib/commercetools-api/src/Models/Common/BaseResource.php @@ -8,6 +8,9 @@ namespace Commercetools\Api\Models\Common; +use Commercetools\Api\Models\BusinessUnit\BusinessUnit; +use Commercetools\Api\Models\BusinessUnit\Company; +use Commercetools\Api\Models\BusinessUnit\Division; use Commercetools\Api\Models\Cart\Cart; use Commercetools\Api\Models\CartDiscount\CartDiscount; use Commercetools\Api\Models\Category\Category; @@ -18,6 +21,29 @@ use Commercetools\Api\Models\DiscountCode\DiscountCode; use Commercetools\Api\Models\Extension\Extension; use Commercetools\Api\Models\Inventory\InventoryEntry; +use Commercetools\Api\Models\Message\BusinessUnitAddressAddedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAddressChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAddressRemovedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAssociateAddedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAssociateChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAssociateRemovedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAssociatesSetMessage; +use Commercetools\Api\Models\Message\BusinessUnitBillingAddressAddedMessage; +use Commercetools\Api\Models\Message\BusinessUnitBillingAddressRemovedMessage; +use Commercetools\Api\Models\Message\BusinessUnitContactEmailSetMessage; +use Commercetools\Api\Models\Message\BusinessUnitCreatedMessage; +use Commercetools\Api\Models\Message\BusinessUnitDefaultBillingAddressSetMessage; +use Commercetools\Api\Models\Message\BusinessUnitDefaultShippingAddressSetMessage; +use Commercetools\Api\Models\Message\BusinessUnitDeletedMessage; +use Commercetools\Api\Models\Message\BusinessUnitNameChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitParentUnitChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitShippingAddressAddedMessage; +use Commercetools\Api\Models\Message\BusinessUnitShippingAddressRemovedMessage; +use Commercetools\Api\Models\Message\BusinessUnitStatusChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitStoreAddedMessage; +use Commercetools\Api\Models\Message\BusinessUnitStoreModeChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitStoreRemovedMessage; +use Commercetools\Api\Models\Message\BusinessUnitStoresSetMessage; use Commercetools\Api\Models\Message\CategoryCreatedMessage; use Commercetools\Api\Models\Message\CategorySlugChangedMessage; use Commercetools\Api\Models\Message\CustomerAddressAddedMessage; @@ -70,7 +96,9 @@ use Commercetools\Api\Models\Message\QuoteRequestCreatedMessage; use Commercetools\Api\Models\Message\QuoteRequestDeletedMessage; use Commercetools\Api\Models\Message\QuoteRequestStateChangedMessage; +use Commercetools\Api\Models\Message\QuoteRequestStateTransitionMessage; use Commercetools\Api\Models\Message\QuoteStateChangedMessage; +use Commercetools\Api\Models\Message\QuoteStateTransitionMessage; use Commercetools\Api\Models\Message\ReviewCreatedMessage; use Commercetools\Api\Models\Message\ReviewRatingSetMessage; use Commercetools\Api\Models\Message\ReviewStateTransitionMessage; @@ -78,15 +106,22 @@ use Commercetools\Api\Models\Message\StagedQuoteDeletedMessage; use Commercetools\Api\Models\Message\StagedQuoteSellerCommentSetMessage; use Commercetools\Api\Models\Message\StagedQuoteStateChangedMessage; +use Commercetools\Api\Models\Message\StagedQuoteStateTransitionMessage; use Commercetools\Api\Models\Message\StagedQuoteValidToSetMessage; +use Commercetools\Api\Models\Message\StandalonePriceActiveChangedMessage; use Commercetools\Api\Models\Message\StandalonePriceCreatedMessage; use Commercetools\Api\Models\Message\StandalonePriceDeletedMessage; use Commercetools\Api\Models\Message\StandalonePriceDiscountSetMessage; use Commercetools\Api\Models\Message\StandalonePriceExternalDiscountSetMessage; +use Commercetools\Api\Models\Message\StandalonePriceStagedChangesAppliedMessage; use Commercetools\Api\Models\Message\StandalonePriceValueChangedMessage; use Commercetools\Api\Models\Message\StoreCreatedMessage; use Commercetools\Api\Models\Message\StoreDeletedMessage; +use Commercetools\Api\Models\Message\StoreDistributionChannelsChangedMessage; +use Commercetools\Api\Models\Message\StoreLanguagesChangedMessage; +use Commercetools\Api\Models\Message\StoreNameSetMessage; use Commercetools\Api\Models\Message\StoreProductSelectionsChangedMessage; +use Commercetools\Api\Models\Message\StoreSupplyChannelsChangedMessage; use Commercetools\Api\Models\Order\Order; use Commercetools\Api\Models\OrderEdit\OrderEdit; use Commercetools\Api\Models\OrderEdit\StagedOrder; @@ -121,21 +156,25 @@ interface BaseResource extends JsonObject public const FIELD_LAST_MODIFIED_AT = 'lastModifiedAt'; /** + * @return null|string */ public function getId(); /** + * @return null|int */ public function getVersion(); /** + * @return null|DateTimeImmutable */ public function getCreatedAt(); /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); diff --git a/lib/commercetools-api/src/Models/Common/BaseResourceBuilder.php b/lib/commercetools-api/src/Models/Common/BaseResourceBuilder.php index f357b461730..17f5b1e6a8d 100644 --- a/lib/commercetools-api/src/Models/Common/BaseResourceBuilder.php +++ b/lib/commercetools-api/src/Models/Common/BaseResourceBuilder.php @@ -8,6 +8,12 @@ namespace Commercetools\Api\Models\Common; +use Commercetools\Api\Models\BusinessUnit\BusinessUnit; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitBuilder; +use Commercetools\Api\Models\BusinessUnit\Company; +use Commercetools\Api\Models\BusinessUnit\CompanyBuilder; +use Commercetools\Api\Models\BusinessUnit\Division; +use Commercetools\Api\Models\BusinessUnit\DivisionBuilder; use Commercetools\Api\Models\Cart\Cart; use Commercetools\Api\Models\Cart\CartBuilder; use Commercetools\Api\Models\CartDiscount\CartDiscount; @@ -28,6 +34,52 @@ use Commercetools\Api\Models\Extension\ExtensionBuilder; use Commercetools\Api\Models\Inventory\InventoryEntry; use Commercetools\Api\Models\Inventory\InventoryEntryBuilder; +use Commercetools\Api\Models\Message\BusinessUnitAddressAddedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAddressAddedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitAddressChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAddressChangedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitAddressRemovedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAddressRemovedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitAssociateAddedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAssociateAddedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitAssociateChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAssociateChangedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitAssociateRemovedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAssociateRemovedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitAssociatesSetMessage; +use Commercetools\Api\Models\Message\BusinessUnitAssociatesSetMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitBillingAddressAddedMessage; +use Commercetools\Api\Models\Message\BusinessUnitBillingAddressAddedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitBillingAddressRemovedMessage; +use Commercetools\Api\Models\Message\BusinessUnitBillingAddressRemovedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitContactEmailSetMessage; +use Commercetools\Api\Models\Message\BusinessUnitContactEmailSetMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitCreatedMessage; +use Commercetools\Api\Models\Message\BusinessUnitCreatedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitDefaultBillingAddressSetMessage; +use Commercetools\Api\Models\Message\BusinessUnitDefaultBillingAddressSetMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitDefaultShippingAddressSetMessage; +use Commercetools\Api\Models\Message\BusinessUnitDefaultShippingAddressSetMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitDeletedMessage; +use Commercetools\Api\Models\Message\BusinessUnitDeletedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitNameChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitNameChangedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitParentUnitChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitParentUnitChangedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitShippingAddressAddedMessage; +use Commercetools\Api\Models\Message\BusinessUnitShippingAddressAddedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitShippingAddressRemovedMessage; +use Commercetools\Api\Models\Message\BusinessUnitShippingAddressRemovedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitStatusChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitStatusChangedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitStoreAddedMessage; +use Commercetools\Api\Models\Message\BusinessUnitStoreAddedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitStoreModeChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitStoreModeChangedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitStoreRemovedMessage; +use Commercetools\Api\Models\Message\BusinessUnitStoreRemovedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitStoresSetMessage; +use Commercetools\Api\Models\Message\BusinessUnitStoresSetMessageBuilder; use Commercetools\Api\Models\Message\CategoryCreatedMessage; use Commercetools\Api\Models\Message\CategoryCreatedMessageBuilder; use Commercetools\Api\Models\Message\CategorySlugChangedMessage; @@ -132,8 +184,12 @@ use Commercetools\Api\Models\Message\QuoteRequestDeletedMessageBuilder; use Commercetools\Api\Models\Message\QuoteRequestStateChangedMessage; use Commercetools\Api\Models\Message\QuoteRequestStateChangedMessageBuilder; +use Commercetools\Api\Models\Message\QuoteRequestStateTransitionMessage; +use Commercetools\Api\Models\Message\QuoteRequestStateTransitionMessageBuilder; use Commercetools\Api\Models\Message\QuoteStateChangedMessage; use Commercetools\Api\Models\Message\QuoteStateChangedMessageBuilder; +use Commercetools\Api\Models\Message\QuoteStateTransitionMessage; +use Commercetools\Api\Models\Message\QuoteStateTransitionMessageBuilder; use Commercetools\Api\Models\Message\ReviewCreatedMessage; use Commercetools\Api\Models\Message\ReviewCreatedMessageBuilder; use Commercetools\Api\Models\Message\ReviewRatingSetMessage; @@ -148,8 +204,12 @@ use Commercetools\Api\Models\Message\StagedQuoteSellerCommentSetMessageBuilder; use Commercetools\Api\Models\Message\StagedQuoteStateChangedMessage; use Commercetools\Api\Models\Message\StagedQuoteStateChangedMessageBuilder; +use Commercetools\Api\Models\Message\StagedQuoteStateTransitionMessage; +use Commercetools\Api\Models\Message\StagedQuoteStateTransitionMessageBuilder; use Commercetools\Api\Models\Message\StagedQuoteValidToSetMessage; use Commercetools\Api\Models\Message\StagedQuoteValidToSetMessageBuilder; +use Commercetools\Api\Models\Message\StandalonePriceActiveChangedMessage; +use Commercetools\Api\Models\Message\StandalonePriceActiveChangedMessageBuilder; use Commercetools\Api\Models\Message\StandalonePriceCreatedMessage; use Commercetools\Api\Models\Message\StandalonePriceCreatedMessageBuilder; use Commercetools\Api\Models\Message\StandalonePriceDeletedMessage; @@ -158,14 +218,24 @@ use Commercetools\Api\Models\Message\StandalonePriceDiscountSetMessageBuilder; use Commercetools\Api\Models\Message\StandalonePriceExternalDiscountSetMessage; use Commercetools\Api\Models\Message\StandalonePriceExternalDiscountSetMessageBuilder; +use Commercetools\Api\Models\Message\StandalonePriceStagedChangesAppliedMessage; +use Commercetools\Api\Models\Message\StandalonePriceStagedChangesAppliedMessageBuilder; use Commercetools\Api\Models\Message\StandalonePriceValueChangedMessage; use Commercetools\Api\Models\Message\StandalonePriceValueChangedMessageBuilder; use Commercetools\Api\Models\Message\StoreCreatedMessage; use Commercetools\Api\Models\Message\StoreCreatedMessageBuilder; use Commercetools\Api\Models\Message\StoreDeletedMessage; use Commercetools\Api\Models\Message\StoreDeletedMessageBuilder; +use Commercetools\Api\Models\Message\StoreDistributionChannelsChangedMessage; +use Commercetools\Api\Models\Message\StoreDistributionChannelsChangedMessageBuilder; +use Commercetools\Api\Models\Message\StoreLanguagesChangedMessage; +use Commercetools\Api\Models\Message\StoreLanguagesChangedMessageBuilder; +use Commercetools\Api\Models\Message\StoreNameSetMessage; +use Commercetools\Api\Models\Message\StoreNameSetMessageBuilder; use Commercetools\Api\Models\Message\StoreProductSelectionsChangedMessage; use Commercetools\Api\Models\Message\StoreProductSelectionsChangedMessageBuilder; +use Commercetools\Api\Models\Message\StoreSupplyChannelsChangedMessage; +use Commercetools\Api\Models\Message\StoreSupplyChannelsChangedMessageBuilder; use Commercetools\Api\Models\Order\Order; use Commercetools\Api\Models\Order\OrderBuilder; use Commercetools\Api\Models\OrderEdit\OrderEdit; @@ -224,26 +294,31 @@ final class BaseResourceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @return null|string */ public function getId() @@ -252,6 +327,7 @@ public function getId() } /** + * @return null|int */ public function getVersion() @@ -260,6 +336,7 @@ public function getVersion() } /** + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -268,6 +345,7 @@ public function getCreatedAt() } /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt() diff --git a/lib/commercetools-api/src/Models/Common/BaseResourceModel.php b/lib/commercetools-api/src/Models/Common/BaseResourceModel.php index 93ed49ed537..371ac13aa6b 100644 --- a/lib/commercetools-api/src/Models/Common/BaseResourceModel.php +++ b/lib/commercetools-api/src/Models/Common/BaseResourceModel.php @@ -8,6 +8,12 @@ namespace Commercetools\Api\Models\Common; +use Commercetools\Api\Models\BusinessUnit\BusinessUnit; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitModel; +use Commercetools\Api\Models\BusinessUnit\Company; +use Commercetools\Api\Models\BusinessUnit\CompanyModel; +use Commercetools\Api\Models\BusinessUnit\Division; +use Commercetools\Api\Models\BusinessUnit\DivisionModel; use Commercetools\Api\Models\Cart\Cart; use Commercetools\Api\Models\Cart\CartModel; use Commercetools\Api\Models\CartDiscount\CartDiscount; @@ -28,6 +34,52 @@ use Commercetools\Api\Models\Extension\ExtensionModel; use Commercetools\Api\Models\Inventory\InventoryEntry; use Commercetools\Api\Models\Inventory\InventoryEntryModel; +use Commercetools\Api\Models\Message\BusinessUnitAddressAddedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAddressAddedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitAddressChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAddressChangedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitAddressRemovedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAddressRemovedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitAssociateAddedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAssociateAddedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitAssociateChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAssociateChangedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitAssociateRemovedMessage; +use Commercetools\Api\Models\Message\BusinessUnitAssociateRemovedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitAssociatesSetMessage; +use Commercetools\Api\Models\Message\BusinessUnitAssociatesSetMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitBillingAddressAddedMessage; +use Commercetools\Api\Models\Message\BusinessUnitBillingAddressAddedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitBillingAddressRemovedMessage; +use Commercetools\Api\Models\Message\BusinessUnitBillingAddressRemovedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitContactEmailSetMessage; +use Commercetools\Api\Models\Message\BusinessUnitContactEmailSetMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitCreatedMessage; +use Commercetools\Api\Models\Message\BusinessUnitCreatedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitDefaultBillingAddressSetMessage; +use Commercetools\Api\Models\Message\BusinessUnitDefaultBillingAddressSetMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitDefaultShippingAddressSetMessage; +use Commercetools\Api\Models\Message\BusinessUnitDefaultShippingAddressSetMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitDeletedMessage; +use Commercetools\Api\Models\Message\BusinessUnitDeletedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitNameChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitNameChangedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitParentUnitChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitParentUnitChangedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitShippingAddressAddedMessage; +use Commercetools\Api\Models\Message\BusinessUnitShippingAddressAddedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitShippingAddressRemovedMessage; +use Commercetools\Api\Models\Message\BusinessUnitShippingAddressRemovedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitStatusChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitStatusChangedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitStoreAddedMessage; +use Commercetools\Api\Models\Message\BusinessUnitStoreAddedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitStoreModeChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitStoreModeChangedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitStoreRemovedMessage; +use Commercetools\Api\Models\Message\BusinessUnitStoreRemovedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitStoresSetMessage; +use Commercetools\Api\Models\Message\BusinessUnitStoresSetMessageModel; use Commercetools\Api\Models\Message\CategoryCreatedMessage; use Commercetools\Api\Models\Message\CategoryCreatedMessageModel; use Commercetools\Api\Models\Message\CategorySlugChangedMessage; @@ -132,8 +184,12 @@ use Commercetools\Api\Models\Message\QuoteRequestDeletedMessageModel; use Commercetools\Api\Models\Message\QuoteRequestStateChangedMessage; use Commercetools\Api\Models\Message\QuoteRequestStateChangedMessageModel; +use Commercetools\Api\Models\Message\QuoteRequestStateTransitionMessage; +use Commercetools\Api\Models\Message\QuoteRequestStateTransitionMessageModel; use Commercetools\Api\Models\Message\QuoteStateChangedMessage; use Commercetools\Api\Models\Message\QuoteStateChangedMessageModel; +use Commercetools\Api\Models\Message\QuoteStateTransitionMessage; +use Commercetools\Api\Models\Message\QuoteStateTransitionMessageModel; use Commercetools\Api\Models\Message\ReviewCreatedMessage; use Commercetools\Api\Models\Message\ReviewCreatedMessageModel; use Commercetools\Api\Models\Message\ReviewRatingSetMessage; @@ -148,8 +204,12 @@ use Commercetools\Api\Models\Message\StagedQuoteSellerCommentSetMessageModel; use Commercetools\Api\Models\Message\StagedQuoteStateChangedMessage; use Commercetools\Api\Models\Message\StagedQuoteStateChangedMessageModel; +use Commercetools\Api\Models\Message\StagedQuoteStateTransitionMessage; +use Commercetools\Api\Models\Message\StagedQuoteStateTransitionMessageModel; use Commercetools\Api\Models\Message\StagedQuoteValidToSetMessage; use Commercetools\Api\Models\Message\StagedQuoteValidToSetMessageModel; +use Commercetools\Api\Models\Message\StandalonePriceActiveChangedMessage; +use Commercetools\Api\Models\Message\StandalonePriceActiveChangedMessageModel; use Commercetools\Api\Models\Message\StandalonePriceCreatedMessage; use Commercetools\Api\Models\Message\StandalonePriceCreatedMessageModel; use Commercetools\Api\Models\Message\StandalonePriceDeletedMessage; @@ -158,14 +218,24 @@ use Commercetools\Api\Models\Message\StandalonePriceDiscountSetMessageModel; use Commercetools\Api\Models\Message\StandalonePriceExternalDiscountSetMessage; use Commercetools\Api\Models\Message\StandalonePriceExternalDiscountSetMessageModel; +use Commercetools\Api\Models\Message\StandalonePriceStagedChangesAppliedMessage; +use Commercetools\Api\Models\Message\StandalonePriceStagedChangesAppliedMessageModel; use Commercetools\Api\Models\Message\StandalonePriceValueChangedMessage; use Commercetools\Api\Models\Message\StandalonePriceValueChangedMessageModel; use Commercetools\Api\Models\Message\StoreCreatedMessage; use Commercetools\Api\Models\Message\StoreCreatedMessageModel; use Commercetools\Api\Models\Message\StoreDeletedMessage; use Commercetools\Api\Models\Message\StoreDeletedMessageModel; +use Commercetools\Api\Models\Message\StoreDistributionChannelsChangedMessage; +use Commercetools\Api\Models\Message\StoreDistributionChannelsChangedMessageModel; +use Commercetools\Api\Models\Message\StoreLanguagesChangedMessage; +use Commercetools\Api\Models\Message\StoreLanguagesChangedMessageModel; +use Commercetools\Api\Models\Message\StoreNameSetMessage; +use Commercetools\Api\Models\Message\StoreNameSetMessageModel; use Commercetools\Api\Models\Message\StoreProductSelectionsChangedMessage; use Commercetools\Api\Models\Message\StoreProductSelectionsChangedMessageModel; +use Commercetools\Api\Models\Message\StoreSupplyChannelsChangedMessage; +use Commercetools\Api\Models\Message\StoreSupplyChannelsChangedMessageModel; use Commercetools\Api\Models\Order\Order; use Commercetools\Api\Models\Order\OrderModel; use Commercetools\Api\Models\OrderEdit\OrderEdit; @@ -223,21 +293,25 @@ final class BaseResourceModel extends JsonObjectModel implements BaseResource { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; @@ -259,6 +333,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -276,6 +351,7 @@ public function getId() } /** + * * @return null|int */ public function getVersion() @@ -293,6 +369,7 @@ public function getVersion() } /** + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -314,6 +391,7 @@ public function getCreatedAt() } /** + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() diff --git a/lib/commercetools-api/src/Models/Common/CentPrecisionMoney.php b/lib/commercetools-api/src/Models/Common/CentPrecisionMoney.php index 2c37b642b47..377f08e8d0e 100644 --- a/lib/commercetools-api/src/Models/Common/CentPrecisionMoney.php +++ b/lib/commercetools-api/src/Models/Common/CentPrecisionMoney.php @@ -16,6 +16,7 @@ interface CentPrecisionMoney extends TypedMoney /** *

The number of default fraction digits for the given currency, like 2 for EUR or 0 for JPY.

* + * @return null|int */ public function getFractionDigits(); diff --git a/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyBuilder.php b/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyBuilder.php index c0a90f361c7..a76717f141e 100644 --- a/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyBuilder.php +++ b/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyBuilder.php @@ -21,16 +21,19 @@ final class CentPrecisionMoneyBuilder implements Builder { /** + * @var ?int */ private $centAmount; /** + * @var ?string */ private $currencyCode; /** + * @var ?int */ private $fractionDigits; @@ -42,6 +45,7 @@ final class CentPrecisionMoneyBuilder implements Builder *
  • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
  • * * + * @return null|int */ public function getCentAmount() @@ -52,6 +56,7 @@ public function getCentAmount() /** *

    Currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode() @@ -62,6 +67,7 @@ public function getCurrencyCode() /** *

    The number of default fraction digits for the given currency, like 2 for EUR or 0 for JPY.

    * + * @return null|int */ public function getFractionDigits() diff --git a/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraft.php b/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraft.php index 6c6b7ac430d..47bbb853c10 100644 --- a/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraft.php +++ b/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraft.php @@ -16,6 +16,7 @@ interface CentPrecisionMoneyDraft extends TypedMoneyDraft /** *

    This field is optional for cent precision. If provided, it must be equal to the default number of fraction digits for the specified currency.

    * + * @return null|int */ public function getFractionDigits(); diff --git a/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraftBuilder.php b/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraftBuilder.php index 4f1a38b857c..dedddb991e8 100644 --- a/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraftBuilder.php @@ -21,16 +21,19 @@ final class CentPrecisionMoneyDraftBuilder implements Builder { /** + * @var ?int */ private $centAmount; /** + * @var ?string */ private $currencyCode; /** + * @var ?int */ private $fractionDigits; @@ -42,6 +45,7 @@ final class CentPrecisionMoneyDraftBuilder implements Builder *
  • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
  • * * + * @return null|int */ public function getCentAmount() @@ -52,6 +56,7 @@ public function getCentAmount() /** *

    Currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode() @@ -62,6 +67,7 @@ public function getCurrencyCode() /** *

    This field is optional for cent precision. If provided, it must be equal to the default number of fraction digits for the specified currency.

    * + * @return null|int */ public function getFractionDigits() diff --git a/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraftModel.php b/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraftModel.php index ae57cc5de60..4de6f0eaf99 100644 --- a/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraftModel.php +++ b/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraftModel.php @@ -21,21 +21,25 @@ final class CentPrecisionMoneyDraftModel extends JsonObjectModel implements Cent { public const DISCRIMINATOR_VALUE = 'centPrecision'; /** + * * @var ?int */ protected $centAmount; /** + * * @var ?string */ protected $currencyCode; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $fractionDigits; @@ -47,12 +51,13 @@ final class CentPrecisionMoneyDraftModel extends JsonObjectModel implements Cent public function __construct( ?int $centAmount = null, ?string $currencyCode = null, - ?int $fractionDigits = null + ?int $fractionDigits = null, + ?string $type = null ) { $this->centAmount = $centAmount; $this->currencyCode = $currencyCode; $this->fractionDigits = $fractionDigits; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -62,6 +67,7 @@ public function __construct( *
  • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
  • * * + * * @return null|int */ public function getCentAmount() @@ -81,6 +87,7 @@ public function getCentAmount() /** *

    Currency code compliant to ISO 4217.

    * + * * @return null|string */ public function getCurrencyCode() @@ -98,6 +105,7 @@ public function getCurrencyCode() } /** + * * @return null|string */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

    This field is optional for cent precision. If provided, it must be equal to the default number of fraction digits for the specified currency.

    * + * * @return null|int */ public function getFractionDigits() diff --git a/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyModel.php b/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyModel.php index b90602e583c..fb5cf371060 100644 --- a/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyModel.php +++ b/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyModel.php @@ -21,21 +21,25 @@ final class CentPrecisionMoneyModel extends JsonObjectModel implements CentPreci { public const DISCRIMINATOR_VALUE = 'centPrecision'; /** + * * @var ?int */ protected $centAmount; /** + * * @var ?string */ protected $currencyCode; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $fractionDigits; @@ -47,12 +51,13 @@ final class CentPrecisionMoneyModel extends JsonObjectModel implements CentPreci public function __construct( ?int $centAmount = null, ?string $currencyCode = null, - ?int $fractionDigits = null + ?int $fractionDigits = null, + ?string $type = null ) { $this->centAmount = $centAmount; $this->currencyCode = $currencyCode; $this->fractionDigits = $fractionDigits; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -62,6 +67,7 @@ public function __construct( *
  • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
  • * * + * * @return null|int */ public function getCentAmount() @@ -81,6 +87,7 @@ public function getCentAmount() /** *

    Currency code compliant to ISO 4217.

    * + * * @return null|string */ public function getCurrencyCode() @@ -100,6 +107,7 @@ public function getCurrencyCode() /** *

    MoneyType supports two different values, one for amounts in cent precision and another one for sub-cent amounts up to 20 fraction digits.

    * + * * @return null|string */ public function getType() @@ -119,6 +127,7 @@ public function getType() /** *

    The number of default fraction digits for the given currency, like 2 for EUR or 0 for JPY.

    * + * * @return null|int */ public function getFractionDigits() diff --git a/lib/commercetools-api/src/Models/Common/ClientLogging.php b/lib/commercetools-api/src/Models/Common/ClientLogging.php index b631e16b836..3a3271e598a 100644 --- a/lib/commercetools-api/src/Models/Common/ClientLogging.php +++ b/lib/commercetools-api/src/Models/Common/ClientLogging.php @@ -22,6 +22,7 @@ interface ClientLogging extends JsonObject /** *

    id of the APIClient which created the resource.

    * + * @return null|string */ public function getClientId(); @@ -29,6 +30,7 @@ public function getClientId(); /** *

    External user ID provided by X-External-User-ID HTTP Header.

    * + * @return null|string */ public function getExternalUserId(); @@ -36,6 +38,7 @@ public function getExternalUserId(); /** *

    Indicates the Customer who modified the resource using a token from the password flow.

    * + * @return null|CustomerReference */ public function getCustomer(); @@ -43,6 +46,7 @@ public function getCustomer(); /** *

    Indicates that the resource was modified during an anonymous session with the logged ID.

    * + * @return null|string */ public function getAnonymousId(); diff --git a/lib/commercetools-api/src/Models/Common/ClientLoggingBuilder.php b/lib/commercetools-api/src/Models/Common/ClientLoggingBuilder.php index 84f5fcc1b28..c2dbbc989fe 100644 --- a/lib/commercetools-api/src/Models/Common/ClientLoggingBuilder.php +++ b/lib/commercetools-api/src/Models/Common/ClientLoggingBuilder.php @@ -23,21 +23,25 @@ final class ClientLoggingBuilder implements Builder { /** + * @var ?string */ private $clientId; /** + * @var ?string */ private $externalUserId; /** + * @var null|CustomerReference|CustomerReferenceBuilder */ private $customer; /** + * @var ?string */ private $anonymousId; @@ -45,6 +49,7 @@ final class ClientLoggingBuilder implements Builder /** *

    id of the APIClient which created the resource.

    * + * @return null|string */ public function getClientId() @@ -55,6 +60,7 @@ public function getClientId() /** *

    External user ID provided by X-External-User-ID HTTP Header.

    * + * @return null|string */ public function getExternalUserId() @@ -65,6 +71,7 @@ public function getExternalUserId() /** *

    Indicates the Customer who modified the resource using a token from the password flow.

    * + * @return null|CustomerReference */ public function getCustomer() @@ -75,6 +82,7 @@ public function getCustomer() /** *

    Indicates that the resource was modified during an anonymous session with the logged ID.

    * + * @return null|string */ public function getAnonymousId() diff --git a/lib/commercetools-api/src/Models/Common/ClientLoggingModel.php b/lib/commercetools-api/src/Models/Common/ClientLoggingModel.php index eb7c5363368..f570170714a 100644 --- a/lib/commercetools-api/src/Models/Common/ClientLoggingModel.php +++ b/lib/commercetools-api/src/Models/Common/ClientLoggingModel.php @@ -22,21 +22,25 @@ final class ClientLoggingModel extends JsonObjectModel implements ClientLogging { /** + * * @var ?string */ protected $clientId; /** + * * @var ?string */ protected $externalUserId; /** + * * @var ?CustomerReference */ protected $customer; /** + * * @var ?string */ protected $anonymousId; @@ -60,6 +64,7 @@ public function __construct( /** *

    id of the APIClient which created the resource.

    * + * * @return null|string */ public function getClientId() @@ -79,6 +84,7 @@ public function getClientId() /** *

    External user ID provided by X-External-User-ID HTTP Header.

    * + * * @return null|string */ public function getExternalUserId() @@ -98,6 +104,7 @@ public function getExternalUserId() /** *

    Indicates the Customer who modified the resource using a token from the password flow.

    * + * * @return null|CustomerReference */ public function getCustomer() @@ -118,6 +125,7 @@ public function getCustomer() /** *

    Indicates that the resource was modified during an anonymous session with the logged ID.

    * + * * @return null|string */ public function getAnonymousId() diff --git a/lib/commercetools-api/src/Models/Common/CreatedBy.php b/lib/commercetools-api/src/Models/Common/CreatedBy.php index 51bebc5d086..90fe56bfb40 100644 --- a/lib/commercetools-api/src/Models/Common/CreatedBy.php +++ b/lib/commercetools-api/src/Models/Common/CreatedBy.php @@ -17,6 +17,7 @@ interface CreatedBy extends ClientLogging /** *

    id of the APIClient which created the resource.

    * + * @return null|string */ public function getClientId(); @@ -24,6 +25,7 @@ public function getClientId(); /** *

    External user ID provided by X-External-User-ID HTTP Header.

    * + * @return null|string */ public function getExternalUserId(); @@ -31,6 +33,7 @@ public function getExternalUserId(); /** *

    Indicates the Customer who created the resource using a token from the password flow.

    * + * @return null|CustomerReference */ public function getCustomer(); @@ -38,6 +41,7 @@ public function getCustomer(); /** *

    Indicates the anonymous session during which the resource was created.

    * + * @return null|string */ public function getAnonymousId(); diff --git a/lib/commercetools-api/src/Models/Common/CreatedByBuilder.php b/lib/commercetools-api/src/Models/Common/CreatedByBuilder.php index 6250f3d819b..d5095fb0297 100644 --- a/lib/commercetools-api/src/Models/Common/CreatedByBuilder.php +++ b/lib/commercetools-api/src/Models/Common/CreatedByBuilder.php @@ -23,21 +23,25 @@ final class CreatedByBuilder implements Builder { /** + * @var ?string */ private $clientId; /** + * @var ?string */ private $externalUserId; /** + * @var null|CustomerReference|CustomerReferenceBuilder */ private $customer; /** + * @var ?string */ private $anonymousId; @@ -45,6 +49,7 @@ final class CreatedByBuilder implements Builder /** *

    id of the APIClient which created the resource.

    * + * @return null|string */ public function getClientId() @@ -55,6 +60,7 @@ public function getClientId() /** *

    External user ID provided by X-External-User-ID HTTP Header.

    * + * @return null|string */ public function getExternalUserId() @@ -65,6 +71,7 @@ public function getExternalUserId() /** *

    Indicates the Customer who created the resource using a token from the password flow.

    * + * @return null|CustomerReference */ public function getCustomer() @@ -75,6 +82,7 @@ public function getCustomer() /** *

    Indicates the anonymous session during which the resource was created.

    * + * @return null|string */ public function getAnonymousId() diff --git a/lib/commercetools-api/src/Models/Common/CreatedByModel.php b/lib/commercetools-api/src/Models/Common/CreatedByModel.php index 08542bb3bd0..75c443a1668 100644 --- a/lib/commercetools-api/src/Models/Common/CreatedByModel.php +++ b/lib/commercetools-api/src/Models/Common/CreatedByModel.php @@ -22,21 +22,25 @@ final class CreatedByModel extends JsonObjectModel implements CreatedBy { /** + * * @var ?string */ protected $clientId; /** + * * @var ?string */ protected $externalUserId; /** + * * @var ?CustomerReference */ protected $customer; /** + * * @var ?string */ protected $anonymousId; @@ -60,6 +64,7 @@ public function __construct( /** *

    id of the APIClient which created the resource.

    * + * * @return null|string */ public function getClientId() @@ -79,6 +84,7 @@ public function getClientId() /** *

    External user ID provided by X-External-User-ID HTTP Header.

    * + * * @return null|string */ public function getExternalUserId() @@ -98,6 +104,7 @@ public function getExternalUserId() /** *

    Indicates the Customer who created the resource using a token from the password flow.

    * + * * @return null|CustomerReference */ public function getCustomer() @@ -118,6 +125,7 @@ public function getCustomer() /** *

    Indicates the anonymous session during which the resource was created.

    * + * * @return null|string */ public function getAnonymousId() diff --git a/lib/commercetools-api/src/Models/Common/DiscountedPrice.php b/lib/commercetools-api/src/Models/Common/DiscountedPrice.php index ef30f5244e1..ebb12e1106c 100644 --- a/lib/commercetools-api/src/Models/Common/DiscountedPrice.php +++ b/lib/commercetools-api/src/Models/Common/DiscountedPrice.php @@ -20,6 +20,7 @@ interface DiscountedPrice extends JsonObject /** *

    Money value of the discounted price.

    * + * @return null|TypedMoney */ public function getValue(); @@ -27,6 +28,7 @@ public function getValue(); /** *

    ProductDiscount related to the discounted price.

    * + * @return null|ProductDiscountReference */ public function getDiscount(); diff --git a/lib/commercetools-api/src/Models/Common/DiscountedPriceBuilder.php b/lib/commercetools-api/src/Models/Common/DiscountedPriceBuilder.php index 84a013b82bb..2f33efea8c0 100644 --- a/lib/commercetools-api/src/Models/Common/DiscountedPriceBuilder.php +++ b/lib/commercetools-api/src/Models/Common/DiscountedPriceBuilder.php @@ -23,11 +23,13 @@ final class DiscountedPriceBuilder implements Builder { /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $value; /** + * @var null|ProductDiscountReference|ProductDiscountReferenceBuilder */ private $discount; @@ -35,6 +37,7 @@ final class DiscountedPriceBuilder implements Builder /** *

    Money value of the discounted price.

    * + * @return null|TypedMoney */ public function getValue() @@ -45,6 +48,7 @@ public function getValue() /** *

    ProductDiscount related to the discounted price.

    * + * @return null|ProductDiscountReference */ public function getDiscount() diff --git a/lib/commercetools-api/src/Models/Common/DiscountedPriceDraft.php b/lib/commercetools-api/src/Models/Common/DiscountedPriceDraft.php index 66c71321b13..67e8a067d41 100644 --- a/lib/commercetools-api/src/Models/Common/DiscountedPriceDraft.php +++ b/lib/commercetools-api/src/Models/Common/DiscountedPriceDraft.php @@ -20,6 +20,7 @@ interface DiscountedPriceDraft extends JsonObject /** *

    Sets the money value for the discounted price.

    * + * @return null|Money */ public function getValue(); @@ -27,6 +28,7 @@ public function getValue(); /** *

    Relates the referenced ProductDiscount to the discounted price.

    * + * @return null|ProductDiscountReference */ public function getDiscount(); diff --git a/lib/commercetools-api/src/Models/Common/DiscountedPriceDraftBuilder.php b/lib/commercetools-api/src/Models/Common/DiscountedPriceDraftBuilder.php index 5373b1942a9..742e2d41038 100644 --- a/lib/commercetools-api/src/Models/Common/DiscountedPriceDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Common/DiscountedPriceDraftBuilder.php @@ -23,11 +23,13 @@ final class DiscountedPriceDraftBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $value; /** + * @var null|ProductDiscountReference|ProductDiscountReferenceBuilder */ private $discount; @@ -35,6 +37,7 @@ final class DiscountedPriceDraftBuilder implements Builder /** *

    Sets the money value for the discounted price.

    * + * @return null|Money */ public function getValue() @@ -45,6 +48,7 @@ public function getValue() /** *

    Relates the referenced ProductDiscount to the discounted price.

    * + * @return null|ProductDiscountReference */ public function getDiscount() diff --git a/lib/commercetools-api/src/Models/Common/DiscountedPriceDraftModel.php b/lib/commercetools-api/src/Models/Common/DiscountedPriceDraftModel.php index 4b5503785a8..c1e9974bfb8 100644 --- a/lib/commercetools-api/src/Models/Common/DiscountedPriceDraftModel.php +++ b/lib/commercetools-api/src/Models/Common/DiscountedPriceDraftModel.php @@ -22,11 +22,13 @@ final class DiscountedPriceDraftModel extends JsonObjectModel implements DiscountedPriceDraft { /** + * * @var ?Money */ protected $value; /** + * * @var ?ProductDiscountReference */ protected $discount; @@ -46,6 +48,7 @@ public function __construct( /** *

    Sets the money value for the discounted price.

    * + * * @return null|Money */ public function getValue() @@ -66,6 +69,7 @@ public function getValue() /** *

    Relates the referenced ProductDiscount to the discounted price.

    * + * * @return null|ProductDiscountReference */ public function getDiscount() diff --git a/lib/commercetools-api/src/Models/Common/DiscountedPriceModel.php b/lib/commercetools-api/src/Models/Common/DiscountedPriceModel.php index a757ad2b98b..c7fabe1c614 100644 --- a/lib/commercetools-api/src/Models/Common/DiscountedPriceModel.php +++ b/lib/commercetools-api/src/Models/Common/DiscountedPriceModel.php @@ -22,11 +22,13 @@ final class DiscountedPriceModel extends JsonObjectModel implements DiscountedPrice { /** + * * @var ?TypedMoney */ protected $value; /** + * * @var ?ProductDiscountReference */ protected $discount; @@ -46,6 +48,7 @@ public function __construct( /** *

    Money value of the discounted price.

    * + * * @return null|TypedMoney */ public function getValue() @@ -66,6 +69,7 @@ public function getValue() /** *

    ProductDiscount related to the discounted price.

    * + * * @return null|ProductDiscountReference */ public function getDiscount() diff --git a/lib/commercetools-api/src/Models/Common/GeoJson.php b/lib/commercetools-api/src/Models/Common/GeoJson.php index c6d4ad33a2c..e5ad4814b81 100644 --- a/lib/commercetools-api/src/Models/Common/GeoJson.php +++ b/lib/commercetools-api/src/Models/Common/GeoJson.php @@ -17,6 +17,7 @@ interface GeoJson extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/Common/GeoJsonModel.php b/lib/commercetools-api/src/Models/Common/GeoJsonModel.php index 4ffea82a3e3..68b8fb72655 100644 --- a/lib/commercetools-api/src/Models/Common/GeoJsonModel.php +++ b/lib/commercetools-api/src/Models/Common/GeoJsonModel.php @@ -21,6 +21,7 @@ final class GeoJsonModel extends JsonObjectModel implements GeoJson { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -37,11 +38,13 @@ final class GeoJsonModel extends JsonObjectModel implements GeoJson * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Common/GeoJsonPoint.php b/lib/commercetools-api/src/Models/Common/GeoJsonPoint.php index 3434bb348bd..9910812e53b 100644 --- a/lib/commercetools-api/src/Models/Common/GeoJsonPoint.php +++ b/lib/commercetools-api/src/Models/Common/GeoJsonPoint.php @@ -18,6 +18,7 @@ interface GeoJsonPoint extends GeoJson /** *

    Longitude (stored on index [0]) and latitude (stored on index [1]) of the Point.

    * + * @return null|array */ public function getCoordinates(); diff --git a/lib/commercetools-api/src/Models/Common/GeoJsonPointBuilder.php b/lib/commercetools-api/src/Models/Common/GeoJsonPointBuilder.php index 0b48196b59a..e2fc0dc8e2a 100644 --- a/lib/commercetools-api/src/Models/Common/GeoJsonPointBuilder.php +++ b/lib/commercetools-api/src/Models/Common/GeoJsonPointBuilder.php @@ -21,6 +21,7 @@ final class GeoJsonPointBuilder implements Builder { /** + * @var ?array */ private $coordinates; @@ -28,6 +29,7 @@ final class GeoJsonPointBuilder implements Builder /** *

    Longitude (stored on index [0]) and latitude (stored on index [1]) of the Point.

    * + * @return null|array */ public function getCoordinates() diff --git a/lib/commercetools-api/src/Models/Common/GeoJsonPointModel.php b/lib/commercetools-api/src/Models/Common/GeoJsonPointModel.php index 15bf153a128..e9e925c1ec3 100644 --- a/lib/commercetools-api/src/Models/Common/GeoJsonPointModel.php +++ b/lib/commercetools-api/src/Models/Common/GeoJsonPointModel.php @@ -21,11 +21,13 @@ final class GeoJsonPointModel extends JsonObjectModel implements GeoJsonPoint { public const DISCRIMINATOR_VALUE = 'Point'; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $coordinates; @@ -35,13 +37,15 @@ final class GeoJsonPointModel extends JsonObjectModel implements GeoJsonPoint * @psalm-suppress MissingParamType */ public function __construct( - ?array $coordinates = null + ?array $coordinates = null, + ?string $type = null ) { $this->coordinates = $coordinates; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() /** *

    Longitude (stored on index [0]) and latitude (stored on index [1]) of the Point.

    * + * * @return null|array */ public function getCoordinates() diff --git a/lib/commercetools-api/src/Models/Common/HighPrecisionMoney.php b/lib/commercetools-api/src/Models/Common/HighPrecisionMoney.php index 6e03f77e5f5..ee6147642c4 100644 --- a/lib/commercetools-api/src/Models/Common/HighPrecisionMoney.php +++ b/lib/commercetools-api/src/Models/Common/HighPrecisionMoney.php @@ -18,6 +18,7 @@ interface HighPrecisionMoney extends TypedMoney /** *

    Amount in 1 / (10 ^ fractionDigits) of a currency.

    * + * @return null|int */ public function getPreciseAmount(); @@ -25,6 +26,7 @@ public function getPreciseAmount(); /** *

    Number of digits after the decimal separator, greater than the default number of fraction digits for a currency.

    * + * @return null|int */ public function getFractionDigits(); diff --git a/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyBuilder.php b/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyBuilder.php index bb09e651fb0..9dc7c2c377f 100644 --- a/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyBuilder.php +++ b/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyBuilder.php @@ -21,21 +21,25 @@ final class HighPrecisionMoneyBuilder implements Builder { /** + * @var ?int */ private $centAmount; /** + * @var ?string */ private $currencyCode; /** + * @var ?int */ private $fractionDigits; /** + * @var ?int */ private $preciseAmount; @@ -47,6 +51,7 @@ final class HighPrecisionMoneyBuilder implements Builder *
  • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
  • * * + * @return null|int */ public function getCentAmount() @@ -57,6 +62,7 @@ public function getCentAmount() /** *

    Currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode() @@ -67,6 +73,7 @@ public function getCurrencyCode() /** *

    Number of digits after the decimal separator, greater than the default number of fraction digits for a currency.

    * + * @return null|int */ public function getFractionDigits() @@ -77,6 +84,7 @@ public function getFractionDigits() /** *

    Amount in 1 / (10 ^ fractionDigits) of a currency.

    * + * @return null|int */ public function getPreciseAmount() diff --git a/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyDraft.php b/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyDraft.php index 3cd4e25c897..34ffb7b4b71 100644 --- a/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyDraft.php +++ b/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyDraft.php @@ -18,6 +18,7 @@ interface HighPrecisionMoneyDraft extends TypedMoneyDraft /** *

    Number of fraction digits for a specified high precision money. It must be greater than the default number of fraction digits for the specified currency.

    * + * @return null|int */ public function getFractionDigits(); @@ -25,6 +26,7 @@ public function getFractionDigits(); /** *

    Amount in 1 / (10 ^ fractionDigits) of a currency.

    * + * @return null|int */ public function getPreciseAmount(); @@ -34,6 +36,7 @@ public function getPreciseAmount(); *

    A Price of 1.015 USD can be rounded either to 1.01 USD or 1.02 USD. If it lies outside of this range, an error message stating that centAmount must be rounded correctly will be returned.

    *

    If centAmount is not provided, the API calculates the value automatically using the default rounding mode half even.

    * + * @return null|int */ public function getCentAmount(); diff --git a/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyDraftBuilder.php b/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyDraftBuilder.php index 2428b0bae86..edd5d78264c 100644 --- a/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyDraftBuilder.php @@ -21,21 +21,25 @@ final class HighPrecisionMoneyDraftBuilder implements Builder { /** + * @var ?int */ private $centAmount; /** + * @var ?string */ private $currencyCode; /** + * @var ?int */ private $fractionDigits; /** + * @var ?int */ private $preciseAmount; @@ -45,6 +49,7 @@ final class HighPrecisionMoneyDraftBuilder implements Builder *

    A Price of 1.015 USD can be rounded either to 1.01 USD or 1.02 USD. If it lies outside of this range, an error message stating that centAmount must be rounded correctly will be returned.

    *

    If centAmount is not provided, the API calculates the value automatically using the default rounding mode half even.

    * + * @return null|int */ public function getCentAmount() @@ -55,6 +60,7 @@ public function getCentAmount() /** *

    Currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode() @@ -65,6 +71,7 @@ public function getCurrencyCode() /** *

    Number of fraction digits for a specified high precision money. It must be greater than the default number of fraction digits for the specified currency.

    * + * @return null|int */ public function getFractionDigits() @@ -75,6 +82,7 @@ public function getFractionDigits() /** *

    Amount in 1 / (10 ^ fractionDigits) of a currency.

    * + * @return null|int */ public function getPreciseAmount() diff --git a/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyDraftModel.php b/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyDraftModel.php index 181858b6a76..478987282aa 100644 --- a/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyDraftModel.php +++ b/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyDraftModel.php @@ -21,26 +21,31 @@ final class HighPrecisionMoneyDraftModel extends JsonObjectModel implements High { public const DISCRIMINATOR_VALUE = 'highPrecision'; /** + * * @var ?int */ protected $centAmount; /** + * * @var ?string */ protected $currencyCode; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $fractionDigits; /** + * * @var ?int */ protected $preciseAmount; @@ -53,13 +58,14 @@ public function __construct( ?int $centAmount = null, ?string $currencyCode = null, ?int $fractionDigits = null, - ?int $preciseAmount = null + ?int $preciseAmount = null, + ?string $type = null ) { $this->centAmount = $centAmount; $this->currencyCode = $currencyCode; $this->fractionDigits = $fractionDigits; $this->preciseAmount = $preciseAmount; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -67,6 +73,7 @@ public function __construct( *

    A Price of 1.015 USD can be rounded either to 1.01 USD or 1.02 USD. If it lies outside of this range, an error message stating that centAmount must be rounded correctly will be returned.

    *

    If centAmount is not provided, the API calculates the value automatically using the default rounding mode half even.

    * + * * @return null|int */ public function getCentAmount() @@ -86,6 +93,7 @@ public function getCentAmount() /** *

    Currency code compliant to ISO 4217.

    * + * * @return null|string */ public function getCurrencyCode() @@ -103,6 +111,7 @@ public function getCurrencyCode() } /** + * * @return null|string */ public function getType() @@ -122,6 +131,7 @@ public function getType() /** *

    Number of fraction digits for a specified high precision money. It must be greater than the default number of fraction digits for the specified currency.

    * + * * @return null|int */ public function getFractionDigits() @@ -141,6 +151,7 @@ public function getFractionDigits() /** *

    Amount in 1 / (10 ^ fractionDigits) of a currency.

    * + * * @return null|int */ public function getPreciseAmount() diff --git a/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyModel.php b/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyModel.php index 65436782b67..dae8697e48e 100644 --- a/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyModel.php +++ b/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyModel.php @@ -21,26 +21,31 @@ final class HighPrecisionMoneyModel extends JsonObjectModel implements HighPreci { public const DISCRIMINATOR_VALUE = 'highPrecision'; /** + * * @var ?int */ protected $centAmount; /** + * * @var ?string */ protected $currencyCode; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $fractionDigits; /** + * * @var ?int */ protected $preciseAmount; @@ -53,13 +58,14 @@ public function __construct( ?int $centAmount = null, ?string $currencyCode = null, ?int $fractionDigits = null, - ?int $preciseAmount = null + ?int $preciseAmount = null, + ?string $type = null ) { $this->centAmount = $centAmount; $this->currencyCode = $currencyCode; $this->fractionDigits = $fractionDigits; $this->preciseAmount = $preciseAmount; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -69,6 +75,7 @@ public function __construct( *
  • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
  • * * + * * @return null|int */ public function getCentAmount() @@ -88,6 +95,7 @@ public function getCentAmount() /** *

    Currency code compliant to ISO 4217.

    * + * * @return null|string */ public function getCurrencyCode() @@ -107,6 +115,7 @@ public function getCurrencyCode() /** *

    MoneyType supports two different values, one for amounts in cent precision and another one for sub-cent amounts up to 20 fraction digits.

    * + * * @return null|string */ public function getType() @@ -126,6 +135,7 @@ public function getType() /** *

    Number of digits after the decimal separator, greater than the default number of fraction digits for a currency.

    * + * * @return null|int */ public function getFractionDigits() @@ -145,6 +155,7 @@ public function getFractionDigits() /** *

    Amount in 1 / (10 ^ fractionDigits) of a currency.

    * + * * @return null|int */ public function getPreciseAmount() diff --git a/lib/commercetools-api/src/Models/Common/Image.php b/lib/commercetools-api/src/Models/Common/Image.php index 509df846c2e..35e72da940c 100644 --- a/lib/commercetools-api/src/Models/Common/Image.php +++ b/lib/commercetools-api/src/Models/Common/Image.php @@ -18,16 +18,25 @@ interface Image extends JsonObject public const FIELD_LABEL = 'label'; /** + *

    URL of the image in its original size that must be unique within a single ProductVariant.

    + * + * @return null|string */ public function getUrl(); /** + *

    Dimensions of the original image.

    + * + * @return null|ImageDimensions */ public function getDimensions(); /** + *

    Custom label for the image.

    + * + * @return null|string */ public function getLabel(); diff --git a/lib/commercetools-api/src/Models/Common/ImageBuilder.php b/lib/commercetools-api/src/Models/Common/ImageBuilder.php index dcc3b94d7ab..151bfe44499 100644 --- a/lib/commercetools-api/src/Models/Common/ImageBuilder.php +++ b/lib/commercetools-api/src/Models/Common/ImageBuilder.php @@ -21,21 +21,27 @@ final class ImageBuilder implements Builder { /** + * @var ?string */ private $url; /** + * @var null|ImageDimensions|ImageDimensionsBuilder */ private $dimensions; /** + * @var ?string */ private $label; /** + *

    URL of the image in its original size that must be unique within a single ProductVariant.

    + * + * @return null|string */ public function getUrl() @@ -44,6 +50,9 @@ public function getUrl() } /** + *

    Dimensions of the original image.

    + * + * @return null|ImageDimensions */ public function getDimensions() @@ -52,6 +61,9 @@ public function getDimensions() } /** + *

    Custom label for the image.

    + * + * @return null|string */ public function getLabel() diff --git a/lib/commercetools-api/src/Models/Common/ImageDimensions.php b/lib/commercetools-api/src/Models/Common/ImageDimensions.php index 8cbe79a7500..e6d5a8db54e 100644 --- a/lib/commercetools-api/src/Models/Common/ImageDimensions.php +++ b/lib/commercetools-api/src/Models/Common/ImageDimensions.php @@ -17,11 +17,17 @@ interface ImageDimensions extends JsonObject public const FIELD_H = 'h'; /** + *

    Width of the image.

    + * + * @return null|int */ public function getW(); /** + *

    Height of the image.

    + * + * @return null|int */ public function getH(); diff --git a/lib/commercetools-api/src/Models/Common/ImageDimensionsBuilder.php b/lib/commercetools-api/src/Models/Common/ImageDimensionsBuilder.php index 08e00d0048c..5724af67b2d 100644 --- a/lib/commercetools-api/src/Models/Common/ImageDimensionsBuilder.php +++ b/lib/commercetools-api/src/Models/Common/ImageDimensionsBuilder.php @@ -21,16 +21,21 @@ final class ImageDimensionsBuilder implements Builder { /** + * @var ?int */ private $w; /** + * @var ?int */ private $h; /** + *

    Width of the image.

    + * + * @return null|int */ public function getW() @@ -39,6 +44,9 @@ public function getW() } /** + *

    Height of the image.

    + * + * @return null|int */ public function getH() diff --git a/lib/commercetools-api/src/Models/Common/ImageDimensionsModel.php b/lib/commercetools-api/src/Models/Common/ImageDimensionsModel.php index 12366b07ea6..409aa680534 100644 --- a/lib/commercetools-api/src/Models/Common/ImageDimensionsModel.php +++ b/lib/commercetools-api/src/Models/Common/ImageDimensionsModel.php @@ -20,11 +20,13 @@ final class ImageDimensionsModel extends JsonObjectModel implements ImageDimensions { /** + * * @var ?int */ protected $w; /** + * * @var ?int */ protected $h; @@ -42,6 +44,9 @@ public function __construct( } /** + *

    Width of the image.

    + * + * * @return null|int */ public function getW() @@ -59,6 +64,9 @@ public function getW() } /** + *

    Height of the image.

    + * + * * @return null|int */ public function getH() diff --git a/lib/commercetools-api/src/Models/Common/ImageModel.php b/lib/commercetools-api/src/Models/Common/ImageModel.php index 5d700f367e0..29fa779c2ff 100644 --- a/lib/commercetools-api/src/Models/Common/ImageModel.php +++ b/lib/commercetools-api/src/Models/Common/ImageModel.php @@ -20,16 +20,19 @@ final class ImageModel extends JsonObjectModel implements Image { /** + * * @var ?string */ protected $url; /** + * * @var ?ImageDimensions */ protected $dimensions; /** + * * @var ?string */ protected $label; @@ -49,6 +52,9 @@ public function __construct( } /** + *

    URL of the image in its original size that must be unique within a single ProductVariant.

    + * + * * @return null|string */ public function getUrl() @@ -66,6 +72,9 @@ public function getUrl() } /** + *

    Dimensions of the original image.

    + * + * * @return null|ImageDimensions */ public function getDimensions() @@ -84,6 +93,9 @@ public function getDimensions() } /** + *

    Custom label for the image.

    + * + * * @return null|string */ public function getLabel() diff --git a/lib/commercetools-api/src/Models/Common/KeyReference.php b/lib/commercetools-api/src/Models/Common/KeyReference.php index 38aa82a8c31..ab9a2e2fc5f 100644 --- a/lib/commercetools-api/src/Models/Common/KeyReference.php +++ b/lib/commercetools-api/src/Models/Common/KeyReference.php @@ -8,6 +8,7 @@ namespace Commercetools\Api\Models\Common; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; use Commercetools\Api\Models\Store\StoreKeyReference; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -21,6 +22,7 @@ interface KeyReference extends JsonObject /** *

    Type of referenced resource.

    * + * @return null|string */ public function getTypeId(); @@ -28,6 +30,7 @@ public function getTypeId(); /** *

    User-defined unique and immutable key of the referenced resource.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Common/KeyReferenceBuilder.php b/lib/commercetools-api/src/Models/Common/KeyReferenceBuilder.php index 91de0e4a3bb..1e52456ace3 100644 --- a/lib/commercetools-api/src/Models/Common/KeyReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/Common/KeyReferenceBuilder.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Common; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceBuilder; use Commercetools\Api\Models\Store\StoreKeyReference; use Commercetools\Api\Models\Store\StoreKeyReferenceBuilder; use Commercetools\Base\Builder; @@ -23,6 +25,7 @@ final class KeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; @@ -30,6 +33,7 @@ final class KeyReferenceBuilder implements Builder /** *

    User-defined unique and immutable key of the referenced resource.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Common/KeyReferenceModel.php b/lib/commercetools-api/src/Models/Common/KeyReferenceModel.php index 6b0a83c7f63..7fe465049d2 100644 --- a/lib/commercetools-api/src/Models/Common/KeyReferenceModel.php +++ b/lib/commercetools-api/src/Models/Common/KeyReferenceModel.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Common; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceModel; use Commercetools\Api\Models\Store\StoreKeyReference; use Commercetools\Api\Models\Store\StoreKeyReferenceModel; use Commercetools\Base\DateTimeImmutableCollection; @@ -23,11 +25,13 @@ final class KeyReferenceModel extends JsonObjectModel implements KeyReference { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $key; @@ -37,6 +41,7 @@ final class KeyReferenceModel extends JsonObjectModel implements KeyReference * */ private static $discriminatorClasses = [ + 'business-unit' => BusinessUnitKeyReferenceModel::class, 'store' => StoreKeyReferenceModel::class, ]; @@ -44,15 +49,17 @@ final class KeyReferenceModel extends JsonObjectModel implements KeyReference * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +79,7 @@ public function getTypeId() /** *

    User-defined unique and immutable key of the referenced resource.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Common/LastModifiedBy.php b/lib/commercetools-api/src/Models/Common/LastModifiedBy.php index ad8eb5bb050..efcd6ebbcf2 100644 --- a/lib/commercetools-api/src/Models/Common/LastModifiedBy.php +++ b/lib/commercetools-api/src/Models/Common/LastModifiedBy.php @@ -17,6 +17,7 @@ interface LastModifiedBy extends ClientLogging /** *

    id of the APIClient which modified the resource.

    * + * @return null|string */ public function getClientId(); @@ -24,6 +25,7 @@ public function getClientId(); /** *

    External user ID provided by X-External-User-ID HTTP Header.

    * + * @return null|string */ public function getExternalUserId(); @@ -31,6 +33,7 @@ public function getExternalUserId(); /** *

    Indicates the Customer who modified the resource using a token from the password flow.

    * + * @return null|CustomerReference */ public function getCustomer(); @@ -38,6 +41,7 @@ public function getCustomer(); /** *

    Indicates the anonymous session during which the resource was modified.

    * + * @return null|string */ public function getAnonymousId(); diff --git a/lib/commercetools-api/src/Models/Common/LastModifiedByBuilder.php b/lib/commercetools-api/src/Models/Common/LastModifiedByBuilder.php index abd2dc195b7..e537fa304ea 100644 --- a/lib/commercetools-api/src/Models/Common/LastModifiedByBuilder.php +++ b/lib/commercetools-api/src/Models/Common/LastModifiedByBuilder.php @@ -23,21 +23,25 @@ final class LastModifiedByBuilder implements Builder { /** + * @var ?string */ private $clientId; /** + * @var ?string */ private $externalUserId; /** + * @var null|CustomerReference|CustomerReferenceBuilder */ private $customer; /** + * @var ?string */ private $anonymousId; @@ -45,6 +49,7 @@ final class LastModifiedByBuilder implements Builder /** *

    id of the APIClient which modified the resource.

    * + * @return null|string */ public function getClientId() @@ -55,6 +60,7 @@ public function getClientId() /** *

    External user ID provided by X-External-User-ID HTTP Header.

    * + * @return null|string */ public function getExternalUserId() @@ -65,6 +71,7 @@ public function getExternalUserId() /** *

    Indicates the Customer who modified the resource using a token from the password flow.

    * + * @return null|CustomerReference */ public function getCustomer() @@ -75,6 +82,7 @@ public function getCustomer() /** *

    Indicates the anonymous session during which the resource was modified.

    * + * @return null|string */ public function getAnonymousId() diff --git a/lib/commercetools-api/src/Models/Common/LastModifiedByModel.php b/lib/commercetools-api/src/Models/Common/LastModifiedByModel.php index 2c3f125d63e..660ef209eb7 100644 --- a/lib/commercetools-api/src/Models/Common/LastModifiedByModel.php +++ b/lib/commercetools-api/src/Models/Common/LastModifiedByModel.php @@ -22,21 +22,25 @@ final class LastModifiedByModel extends JsonObjectModel implements LastModifiedBy { /** + * * @var ?string */ protected $clientId; /** + * * @var ?string */ protected $externalUserId; /** + * * @var ?CustomerReference */ protected $customer; /** + * * @var ?string */ protected $anonymousId; @@ -60,6 +64,7 @@ public function __construct( /** *

    id of the APIClient which modified the resource.

    * + * * @return null|string */ public function getClientId() @@ -79,6 +84,7 @@ public function getClientId() /** *

    External user ID provided by X-External-User-ID HTTP Header.

    * + * * @return null|string */ public function getExternalUserId() @@ -98,6 +104,7 @@ public function getExternalUserId() /** *

    Indicates the Customer who modified the resource using a token from the password flow.

    * + * * @return null|CustomerReference */ public function getCustomer() @@ -118,6 +125,7 @@ public function getCustomer() /** *

    Indicates the anonymous session during which the resource was modified.

    * + * * @return null|string */ public function getAnonymousId() diff --git a/lib/commercetools-api/src/Models/Common/Money.php b/lib/commercetools-api/src/Models/Common/Money.php index ca339f886d8..cab4834f6eb 100644 --- a/lib/commercetools-api/src/Models/Common/Money.php +++ b/lib/commercetools-api/src/Models/Common/Money.php @@ -23,6 +23,7 @@ interface Money extends JsonObject *
  • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
  • * * + * @return null|int */ public function getCentAmount(); @@ -30,6 +31,7 @@ public function getCentAmount(); /** *

    Currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode(); diff --git a/lib/commercetools-api/src/Models/Common/MoneyBuilder.php b/lib/commercetools-api/src/Models/Common/MoneyBuilder.php index 2ca43a5a4a3..7bece8edf76 100644 --- a/lib/commercetools-api/src/Models/Common/MoneyBuilder.php +++ b/lib/commercetools-api/src/Models/Common/MoneyBuilder.php @@ -21,11 +21,13 @@ final class MoneyBuilder implements Builder { /** + * @var ?int */ private $centAmount; /** + * @var ?string */ private $currencyCode; @@ -37,6 +39,7 @@ final class MoneyBuilder implements Builder *
  • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
  • * * + * @return null|int */ public function getCentAmount() @@ -47,6 +50,7 @@ public function getCentAmount() /** *

    Currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode() diff --git a/lib/commercetools-api/src/Models/Common/MoneyModel.php b/lib/commercetools-api/src/Models/Common/MoneyModel.php index f9cd9d2faa3..debe15b6322 100644 --- a/lib/commercetools-api/src/Models/Common/MoneyModel.php +++ b/lib/commercetools-api/src/Models/Common/MoneyModel.php @@ -20,11 +20,13 @@ final class MoneyModel extends JsonObjectModel implements Money { /** + * * @var ?int */ protected $centAmount; /** + * * @var ?string */ protected $currencyCode; @@ -48,6 +50,7 @@ public function __construct( *
  • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
  • * * + * * @return null|int */ public function getCentAmount() @@ -67,6 +70,7 @@ public function getCentAmount() /** *

    Currency code compliant to ISO 4217.

    * + * * @return null|string */ public function getCurrencyCode() diff --git a/lib/commercetools-api/src/Models/Common/PagedQueryResponse.php b/lib/commercetools-api/src/Models/Common/PagedQueryResponse.php index 8d6efe6e5bf..03b8dcf87eb 100644 --- a/lib/commercetools-api/src/Models/Common/PagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Common/PagedQueryResponse.php @@ -23,6 +23,7 @@ interface PagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -30,6 +31,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -37,6 +39,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -48,16 +51,19 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); /** + * @return null|BaseResourceCollection */ public function getResults(); /** + * @return null|mixed */ public function getMeta(); diff --git a/lib/commercetools-api/src/Models/Common/PagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Common/PagedQueryResponseBuilder.php index 4d1d99aecb5..4d68c061316 100644 --- a/lib/commercetools-api/src/Models/Common/PagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Common/PagedQueryResponseBuilder.php @@ -21,31 +21,37 @@ final class PagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?BaseResourceCollection */ private $results; /** + * @var ?JsonObject */ private $meta; @@ -53,6 +59,7 @@ final class PagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -63,6 +70,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -73,6 +81,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -87,6 +96,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -95,6 +105,7 @@ public function getTotal() } /** + * @return null|BaseResourceCollection */ public function getResults() @@ -103,6 +114,7 @@ public function getResults() } /** + * @return null|JsonObject */ public function getMeta() diff --git a/lib/commercetools-api/src/Models/Common/PagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Common/PagedQueryResponseModel.php index 8c7a1bd80eb..4628f15cb6a 100644 --- a/lib/commercetools-api/src/Models/Common/PagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Common/PagedQueryResponseModel.php @@ -20,31 +20,37 @@ final class PagedQueryResponseModel extends JsonObjectModel implements PagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?BaseResourceCollection */ protected $results; /** + * * @var ?mixed */ protected $meta; @@ -72,6 +78,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -91,6 +98,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -110,6 +118,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -133,6 +142,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -150,6 +160,7 @@ public function getTotal() } /** + * * @return null|BaseResourceCollection */ public function getResults() @@ -167,6 +178,7 @@ public function getResults() } /** + * * @return null|mixed */ public function getMeta() diff --git a/lib/commercetools-api/src/Models/Common/Price.php b/lib/commercetools-api/src/Models/Common/Price.php index 4f2ad1f8ecd..1a607bb5005 100644 --- a/lib/commercetools-api/src/Models/Common/Price.php +++ b/lib/commercetools-api/src/Models/Common/Price.php @@ -18,6 +18,7 @@ interface Price extends JsonObject { public const FIELD_ID = 'id'; + public const FIELD_KEY = 'key'; public const FIELD_VALUE = 'value'; public const FIELD_COUNTRY = 'country'; public const FIELD_CUSTOMER_GROUP = 'customerGroup'; @@ -31,13 +32,23 @@ interface Price extends JsonObject /** *

    Unique identifier of this Price.

    * + * @return null|string */ public function getId(); + /** + *

    User-defined identifier of the Price. It is unique per ProductVariant.

    + * + + * @return null|string + */ + public function getKey(); + /** *

    Money value of this Price.

    * + * @return null|TypedMoney */ public function getValue(); @@ -45,6 +56,7 @@ public function getValue(); /** *

    Country for which this Price is valid.

    * + * @return null|string */ public function getCountry(); @@ -52,6 +64,7 @@ public function getCountry(); /** *

    CustomerGroup for which this Price is valid.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup(); @@ -59,6 +72,7 @@ public function getCustomerGroup(); /** *

    ProductDistribution Channel for which this Price is valid.

    * + * @return null|ChannelReference */ public function getChannel(); @@ -66,6 +80,7 @@ public function getChannel(); /** *

    Date and time from which this Price is valid.

    * + * @return null|DateTimeImmutable */ public function getValidFrom(); @@ -73,6 +88,7 @@ public function getValidFrom(); /** *

    Date and time until this Price is valid.

    * + * @return null|DateTimeImmutable */ public function getValidUntil(); @@ -82,6 +98,7 @@ public function getValidUntil(); * If set, the API uses the DiscountedPrice value for the LineItem Price selection. * When a relative discount has been applied and the fraction part of the DiscountedPrice value is 0.5, the value is rounded in favor of the customer with half down rounding.

    * + * @return null|DiscountedPrice */ public function getDiscounted(); @@ -89,6 +106,7 @@ public function getDiscounted(); /** *

    Present if different Prices for certain LineItem quantities have been specified.

    * + * @return null|PriceTierCollection */ public function getTiers(); @@ -96,6 +114,7 @@ public function getTiers(); /** *

    Custom Fields defined for the Price.

    * + * @return null|CustomFields */ public function getCustom(); @@ -105,6 +124,11 @@ public function getCustom(); */ public function setId(?string $id): void; + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?TypedMoney $value */ diff --git a/lib/commercetools-api/src/Models/Common/PriceBuilder.php b/lib/commercetools-api/src/Models/Common/PriceBuilder.php index e0b5bc384b0..932e6017cfb 100644 --- a/lib/commercetools-api/src/Models/Common/PriceBuilder.php +++ b/lib/commercetools-api/src/Models/Common/PriceBuilder.php @@ -28,51 +28,67 @@ final class PriceBuilder implements Builder { /** + * @var ?string */ private $id; /** + + * @var ?string + */ + private $key; + + /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $value; /** + * @var ?string */ private $country; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $customerGroup; /** + * @var null|ChannelReference|ChannelReferenceBuilder */ private $channel; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; /** + * @var null|DiscountedPrice|DiscountedPriceBuilder */ private $discounted; /** + * @var ?PriceTierCollection */ private $tiers; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; @@ -80,6 +96,7 @@ final class PriceBuilder implements Builder /** *

    Unique identifier of this Price.

    * + * @return null|string */ public function getId() @@ -87,9 +104,21 @@ public function getId() return $this->id; } + /** + *

    User-defined identifier of the Price. It is unique per ProductVariant.

    + * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

    Money value of this Price.

    * + * @return null|TypedMoney */ public function getValue() @@ -100,6 +129,7 @@ public function getValue() /** *

    Country for which this Price is valid.

    * + * @return null|string */ public function getCountry() @@ -110,6 +140,7 @@ public function getCountry() /** *

    CustomerGroup for which this Price is valid.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -120,6 +151,7 @@ public function getCustomerGroup() /** *

    ProductDistribution Channel for which this Price is valid.

    * + * @return null|ChannelReference */ public function getChannel() @@ -130,6 +162,7 @@ public function getChannel() /** *

    Date and time from which this Price is valid.

    * + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -140,6 +173,7 @@ public function getValidFrom() /** *

    Date and time until this Price is valid.

    * + * @return null|DateTimeImmutable */ public function getValidUntil() @@ -152,6 +186,7 @@ public function getValidUntil() * If set, the API uses the DiscountedPrice value for the LineItem Price selection. * When a relative discount has been applied and the fraction part of the DiscountedPrice value is 0.5, the value is rounded in favor of the customer with half down rounding.

    * + * @return null|DiscountedPrice */ public function getDiscounted() @@ -162,6 +197,7 @@ public function getDiscounted() /** *

    Present if different Prices for certain LineItem quantities have been specified.

    * + * @return null|PriceTierCollection */ public function getTiers() @@ -172,6 +208,7 @@ public function getTiers() /** *

    Custom Fields defined for the Price.

    * + * @return null|CustomFields */ public function getCustom() @@ -190,6 +227,17 @@ public function withId(?string $id) return $this; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?TypedMoney $value * @return $this @@ -348,6 +396,7 @@ public function build(): Price { return new PriceModel( $this->id, + $this->key, $this->value instanceof TypedMoneyBuilder ? $this->value->build() : $this->value, $this->country, $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup, diff --git a/lib/commercetools-api/src/Models/Common/PriceDraft.php b/lib/commercetools-api/src/Models/Common/PriceDraft.php index efef0477dc4..d8549d0eb37 100644 --- a/lib/commercetools-api/src/Models/Common/PriceDraft.php +++ b/lib/commercetools-api/src/Models/Common/PriceDraft.php @@ -17,6 +17,7 @@ interface PriceDraft extends JsonObject { + public const FIELD_KEY = 'key'; public const FIELD_VALUE = 'value'; public const FIELD_COUNTRY = 'country'; public const FIELD_CUSTOMER_GROUP = 'customerGroup'; @@ -27,9 +28,18 @@ interface PriceDraft extends JsonObject public const FIELD_TIERS = 'tiers'; public const FIELD_CUSTOM = 'custom'; + /** + *

    User-defined identifier for the Price. It must be unique per ProductVariant.

    + * + + * @return null|string + */ + public function getKey(); + /** *

    Money value of this Price.

    * + * @return null|Money */ public function getValue(); @@ -37,6 +47,7 @@ public function getValue(); /** *

    Set this field if this Price is only valid for the specified country.

    * + * @return null|string */ public function getCountry(); @@ -44,6 +55,7 @@ public function getCountry(); /** *

    Set this field if this Price is only valid for the referenced CustomerGroup.

    * + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup(); @@ -51,27 +63,30 @@ public function getCustomerGroup(); /** *

    Set this field if this Price is only valid for the referenced ProductDistribution Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getChannel(); /** - *

    Set this field if this Price is valid only valid from the specified date and time.

    + *

    Set this field if this Price is only valid from the specified date and time. Must be at least 1 ms earlier than validUntil.

    * + * @return null|DateTimeImmutable */ public function getValidFrom(); /** - *

    Set this field if this Price is valid only valid until the specified date and time.

    + *

    Set this field if this Price is only valid until the specified date and time. Must be at least 1 ms later than validFrom.

    * + * @return null|DateTimeImmutable */ public function getValidUntil(); /** - *

    Set this field to add a DiscountedPrice from an external service.

    - *

    The API sets this field automatically if at least one ProductDiscount applies. + *

    Set this field to add a DiscountedPrice from an external service.

    + *

    Otherwise, Composable Commerce sets this field automatically if at least one ProductDiscount applies. * The DiscountedPrice must reference a ProductDiscount with:

    *
      *
    • The isActive flag set to true.
    • @@ -79,6 +94,7 @@ public function getValidUntil(); *
    • A predicate that matches the ProductVariant the Price is referenced from.
    • *
    * + * @return null|DiscountedPriceDraft */ public function getDiscounted(); @@ -86,6 +102,7 @@ public function getDiscounted(); /** *

    Set this field to specify different Prices for certain LineItem quantities.

    * + * @return null|PriceTierDraftCollection */ public function getTiers(); @@ -93,10 +110,16 @@ public function getTiers(); /** *

    Custom Fields for the Price.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?Money $value */ diff --git a/lib/commercetools-api/src/Models/Common/PriceDraftBuilder.php b/lib/commercetools-api/src/Models/Common/PriceDraftBuilder.php index 977540d719c..85a0c3e6b1c 100644 --- a/lib/commercetools-api/src/Models/Common/PriceDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Common/PriceDraftBuilder.php @@ -28,53 +28,80 @@ final class PriceDraftBuilder implements Builder { /** + + * @var ?string + */ + private $key; + + /** + * @var null|Money|MoneyBuilder */ private $value; /** + * @var ?string */ private $country; /** + * @var null|CustomerGroupResourceIdentifier|CustomerGroupResourceIdentifierBuilder */ private $customerGroup; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $channel; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; /** + * @var null|DiscountedPriceDraft|DiscountedPriceDraftBuilder */ private $discounted; /** + * @var ?PriceTierDraftCollection */ private $tiers; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; + /** + *

    User-defined identifier for the Price. It must be unique per ProductVariant.

    + * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

    Money value of this Price.

    * + * @return null|Money */ public function getValue() @@ -85,6 +112,7 @@ public function getValue() /** *

    Set this field if this Price is only valid for the specified country.

    * + * @return null|string */ public function getCountry() @@ -95,6 +123,7 @@ public function getCountry() /** *

    Set this field if this Price is only valid for the referenced CustomerGroup.

    * + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() @@ -105,6 +134,7 @@ public function getCustomerGroup() /** *

    Set this field if this Price is only valid for the referenced ProductDistribution Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getChannel() @@ -113,8 +143,9 @@ public function getChannel() } /** - *

    Set this field if this Price is valid only valid from the specified date and time.

    + *

    Set this field if this Price is only valid from the specified date and time. Must be at least 1 ms earlier than validUntil.

    * + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -123,8 +154,9 @@ public function getValidFrom() } /** - *

    Set this field if this Price is valid only valid until the specified date and time.

    + *

    Set this field if this Price is only valid until the specified date and time. Must be at least 1 ms later than validFrom.

    * + * @return null|DateTimeImmutable */ public function getValidUntil() @@ -133,8 +165,8 @@ public function getValidUntil() } /** - *

    Set this field to add a DiscountedPrice from an external service.

    - *

    The API sets this field automatically if at least one ProductDiscount applies. + *

    Set this field to add a DiscountedPrice from an external service.

    + *

    Otherwise, Composable Commerce sets this field automatically if at least one ProductDiscount applies. * The DiscountedPrice must reference a ProductDiscount with:

    *
      *
    • The isActive flag set to true.
    • @@ -142,6 +174,7 @@ public function getValidUntil() *
    • A predicate that matches the ProductVariant the Price is referenced from.
    • *
    * + * @return null|DiscountedPriceDraft */ public function getDiscounted() @@ -152,6 +185,7 @@ public function getDiscounted() /** *

    Set this field to specify different Prices for certain LineItem quantities.

    * + * @return null|PriceTierDraftCollection */ public function getTiers() @@ -162,6 +196,7 @@ public function getTiers() /** *

    Custom Fields for the Price.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -169,6 +204,17 @@ public function getCustom() return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?Money $value * @return $this @@ -326,6 +372,7 @@ public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) public function build(): PriceDraft { return new PriceDraftModel( + $this->key, $this->value instanceof MoneyBuilder ? $this->value->build() : $this->value, $this->country, $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup, diff --git a/lib/commercetools-api/src/Models/Common/PriceDraftModel.php b/lib/commercetools-api/src/Models/Common/PriceDraftModel.php index 33a7709e83e..c6c9a787cdb 100644 --- a/lib/commercetools-api/src/Models/Common/PriceDraftModel.php +++ b/lib/commercetools-api/src/Models/Common/PriceDraftModel.php @@ -27,46 +27,61 @@ final class PriceDraftModel extends JsonObjectModel implements PriceDraft { /** + * + * @var ?string + */ + protected $key; + + /** + * * @var ?Money */ protected $value; /** + * * @var ?string */ protected $country; /** + * * @var ?CustomerGroupResourceIdentifier */ protected $customerGroup; /** + * * @var ?ChannelResourceIdentifier */ protected $channel; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; /** + * * @var ?DiscountedPriceDraft */ protected $discounted; /** + * * @var ?PriceTierDraftCollection */ protected $tiers; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -76,6 +91,7 @@ final class PriceDraftModel extends JsonObjectModel implements PriceDraft * @psalm-suppress MissingParamType */ public function __construct( + ?string $key = null, ?Money $value = null, ?string $country = null, ?CustomerGroupResourceIdentifier $customerGroup = null, @@ -86,6 +102,7 @@ public function __construct( ?PriceTierDraftCollection $tiers = null, ?CustomFieldsDraft $custom = null ) { + $this->key = $key; $this->value = $value; $this->country = $country; $this->customerGroup = $customerGroup; @@ -97,9 +114,30 @@ public function __construct( $this->custom = $custom; } + /** + *

    User-defined identifier for the Price. It must be unique per ProductVariant.

    + * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

    Money value of this Price.

    * + * * @return null|Money */ public function getValue() @@ -120,6 +158,7 @@ public function getValue() /** *

    Set this field if this Price is only valid for the specified country.

    * + * * @return null|string */ public function getCountry() @@ -139,6 +178,7 @@ public function getCountry() /** *

    Set this field if this Price is only valid for the referenced CustomerGroup.

    * + * * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() @@ -159,6 +199,7 @@ public function getCustomerGroup() /** *

    Set this field if this Price is only valid for the referenced ProductDistribution Channel.

    * + * * @return null|ChannelResourceIdentifier */ public function getChannel() @@ -177,7 +218,8 @@ public function getChannel() } /** - *

    Set this field if this Price is valid only valid from the specified date and time.

    + *

    Set this field if this Price is only valid from the specified date and time. Must be at least 1 ms earlier than validUntil.

    + * * * @return null|DateTimeImmutable */ @@ -200,7 +242,8 @@ public function getValidFrom() } /** - *

    Set this field if this Price is valid only valid until the specified date and time.

    + *

    Set this field if this Price is only valid until the specified date and time. Must be at least 1 ms later than validFrom.

    + * * * @return null|DateTimeImmutable */ @@ -223,8 +266,8 @@ public function getValidUntil() } /** - *

    Set this field to add a DiscountedPrice from an external service.

    - *

    The API sets this field automatically if at least one ProductDiscount applies. + *

    Set this field to add a DiscountedPrice from an external service.

    + *

    Otherwise, Composable Commerce sets this field automatically if at least one ProductDiscount applies. * The DiscountedPrice must reference a ProductDiscount with:

    *
      *
    • The isActive flag set to true.
    • @@ -232,6 +275,7 @@ public function getValidUntil() *
    • A predicate that matches the ProductVariant the Price is referenced from.
    • *
    * + * * @return null|DiscountedPriceDraft */ public function getDiscounted() @@ -252,6 +296,7 @@ public function getDiscounted() /** *

    Set this field to specify different Prices for certain LineItem quantities.

    * + * * @return null|PriceTierDraftCollection */ public function getTiers() @@ -271,6 +316,7 @@ public function getTiers() /** *

    Custom Fields for the Price.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -289,6 +335,14 @@ public function getCustom() } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?Money $value */ diff --git a/lib/commercetools-api/src/Models/Common/PriceModel.php b/lib/commercetools-api/src/Models/Common/PriceModel.php index 76d7a5f9e1c..f59cf09eefc 100644 --- a/lib/commercetools-api/src/Models/Common/PriceModel.php +++ b/lib/commercetools-api/src/Models/Common/PriceModel.php @@ -27,51 +27,67 @@ final class PriceModel extends JsonObjectModel implements Price { /** + * * @var ?string */ protected $id; /** + * + * @var ?string + */ + protected $key; + + /** + * * @var ?TypedMoney */ protected $value; /** + * * @var ?string */ protected $country; /** + * * @var ?CustomerGroupReference */ protected $customerGroup; /** + * * @var ?ChannelReference */ protected $channel; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; /** + * * @var ?DiscountedPrice */ protected $discounted; /** + * * @var ?PriceTierCollection */ protected $tiers; /** + * * @var ?CustomFields */ protected $custom; @@ -82,6 +98,7 @@ final class PriceModel extends JsonObjectModel implements Price */ public function __construct( ?string $id = null, + ?string $key = null, ?TypedMoney $value = null, ?string $country = null, ?CustomerGroupReference $customerGroup = null, @@ -93,6 +110,7 @@ public function __construct( ?CustomFields $custom = null ) { $this->id = $id; + $this->key = $key; $this->value = $value; $this->country = $country; $this->customerGroup = $customerGroup; @@ -107,6 +125,7 @@ public function __construct( /** *

    Unique identifier of this Price.

    * + * * @return null|string */ public function getId() @@ -123,9 +142,30 @@ public function getId() return $this->id; } + /** + *

    User-defined identifier of the Price. It is unique per ProductVariant.

    + * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

    Money value of this Price.

    * + * * @return null|TypedMoney */ public function getValue() @@ -146,6 +186,7 @@ public function getValue() /** *

    Country for which this Price is valid.

    * + * * @return null|string */ public function getCountry() @@ -165,6 +206,7 @@ public function getCountry() /** *

    CustomerGroup for which this Price is valid.

    * + * * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -185,6 +227,7 @@ public function getCustomerGroup() /** *

    ProductDistribution Channel for which this Price is valid.

    * + * * @return null|ChannelReference */ public function getChannel() @@ -205,6 +248,7 @@ public function getChannel() /** *

    Date and time from which this Price is valid.

    * + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -228,6 +272,7 @@ public function getValidFrom() /** *

    Date and time until this Price is valid.

    * + * * @return null|DateTimeImmutable */ public function getValidUntil() @@ -253,6 +298,7 @@ public function getValidUntil() * If set, the API uses the DiscountedPrice value for the LineItem Price selection. * When a relative discount has been applied and the fraction part of the DiscountedPrice value is 0.5, the value is rounded in favor of the customer with half down rounding.

    * + * * @return null|DiscountedPrice */ public function getDiscounted() @@ -273,6 +319,7 @@ public function getDiscounted() /** *

    Present if different Prices for certain LineItem quantities have been specified.

    * + * * @return null|PriceTierCollection */ public function getTiers() @@ -292,6 +339,7 @@ public function getTiers() /** *

    Custom Fields defined for the Price.

    * + * * @return null|CustomFields */ public function getCustom() @@ -318,6 +366,14 @@ public function setId(?string $id): void $this->id = $id; } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?TypedMoney $value */ diff --git a/lib/commercetools-api/src/Models/Common/PriceTier.php b/lib/commercetools-api/src/Models/Common/PriceTier.php index 0637b89dc9d..c2803397557 100644 --- a/lib/commercetools-api/src/Models/Common/PriceTier.php +++ b/lib/commercetools-api/src/Models/Common/PriceTier.php @@ -20,6 +20,7 @@ interface PriceTier extends JsonObject *

    Minimum quantity this Price tier is valid for.

    *

    The minimum quantity is always greater than or equal to 2. The base Price is interpreted as valid for a minimum quantity equal to 1.

    * + * @return null|int */ public function getMinimumQuantity(); @@ -28,6 +29,7 @@ public function getMinimumQuantity(); *

    Money value that applies when the minimumQuantity is greater than or equal to the LineItem quantity.

    *

    The currencyCode of a Price tier is always the same as the currencyCode in the value of the related Price.

    * + * @return null|TypedMoney */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Common/PriceTierBuilder.php b/lib/commercetools-api/src/Models/Common/PriceTierBuilder.php index 16d4bd83f1a..b8e7b0e211f 100644 --- a/lib/commercetools-api/src/Models/Common/PriceTierBuilder.php +++ b/lib/commercetools-api/src/Models/Common/PriceTierBuilder.php @@ -21,11 +21,13 @@ final class PriceTierBuilder implements Builder { /** + * @var ?int */ private $minimumQuantity; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $value; @@ -34,6 +36,7 @@ final class PriceTierBuilder implements Builder *

    Minimum quantity this Price tier is valid for.

    *

    The minimum quantity is always greater than or equal to 2. The base Price is interpreted as valid for a minimum quantity equal to 1.

    * + * @return null|int */ public function getMinimumQuantity() @@ -45,6 +48,7 @@ public function getMinimumQuantity() *

    Money value that applies when the minimumQuantity is greater than or equal to the LineItem quantity.

    *

    The currencyCode of a Price tier is always the same as the currencyCode in the value of the related Price.

    * + * @return null|TypedMoney */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Common/PriceTierDraft.php b/lib/commercetools-api/src/Models/Common/PriceTierDraft.php index c7e3b982921..e1793add0a0 100644 --- a/lib/commercetools-api/src/Models/Common/PriceTierDraft.php +++ b/lib/commercetools-api/src/Models/Common/PriceTierDraft.php @@ -20,6 +20,7 @@ interface PriceTierDraft extends JsonObject *

    Minimum quantity this Price tier is valid for.

    *

    The minimum quantity is always greater than or equal to 2. The base Price is interpreted as valid for a minimum quantity equal to 1.

    * + * @return null|int */ public function getMinimumQuantity(); @@ -28,6 +29,7 @@ public function getMinimumQuantity(); *

    Money value that applies when the minimumQuantity is greater than or equal to the LineItem quantity.

    *

    The currencyCode of a Price tier must be the same as the currencyCode in the value of the related Price.

    * + * @return null|Money */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Common/PriceTierDraftBuilder.php b/lib/commercetools-api/src/Models/Common/PriceTierDraftBuilder.php index 709d68a8023..b028aad3736 100644 --- a/lib/commercetools-api/src/Models/Common/PriceTierDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Common/PriceTierDraftBuilder.php @@ -21,11 +21,13 @@ final class PriceTierDraftBuilder implements Builder { /** + * @var ?int */ private $minimumQuantity; /** + * @var null|Money|MoneyBuilder */ private $value; @@ -34,6 +36,7 @@ final class PriceTierDraftBuilder implements Builder *

    Minimum quantity this Price tier is valid for.

    *

    The minimum quantity is always greater than or equal to 2. The base Price is interpreted as valid for a minimum quantity equal to 1.

    * + * @return null|int */ public function getMinimumQuantity() @@ -45,6 +48,7 @@ public function getMinimumQuantity() *

    Money value that applies when the minimumQuantity is greater than or equal to the LineItem quantity.

    *

    The currencyCode of a Price tier must be the same as the currencyCode in the value of the related Price.

    * + * @return null|Money */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Common/PriceTierDraftModel.php b/lib/commercetools-api/src/Models/Common/PriceTierDraftModel.php index c38a712bf14..e530a7558ba 100644 --- a/lib/commercetools-api/src/Models/Common/PriceTierDraftModel.php +++ b/lib/commercetools-api/src/Models/Common/PriceTierDraftModel.php @@ -20,11 +20,13 @@ final class PriceTierDraftModel extends JsonObjectModel implements PriceTierDraft { /** + * * @var ?int */ protected $minimumQuantity; /** + * * @var ?Money */ protected $value; @@ -45,6 +47,7 @@ public function __construct( *

    Minimum quantity this Price tier is valid for.

    *

    The minimum quantity is always greater than or equal to 2. The base Price is interpreted as valid for a minimum quantity equal to 1.

    * + * * @return null|int */ public function getMinimumQuantity() @@ -65,6 +68,7 @@ public function getMinimumQuantity() *

    Money value that applies when the minimumQuantity is greater than or equal to the LineItem quantity.

    *

    The currencyCode of a Price tier must be the same as the currencyCode in the value of the related Price.

    * + * * @return null|Money */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Common/PriceTierModel.php b/lib/commercetools-api/src/Models/Common/PriceTierModel.php index 2beecb8541a..0a9f012c769 100644 --- a/lib/commercetools-api/src/Models/Common/PriceTierModel.php +++ b/lib/commercetools-api/src/Models/Common/PriceTierModel.php @@ -20,11 +20,13 @@ final class PriceTierModel extends JsonObjectModel implements PriceTier { /** + * * @var ?int */ protected $minimumQuantity; /** + * * @var ?TypedMoney */ protected $value; @@ -45,6 +47,7 @@ public function __construct( *

    Minimum quantity this Price tier is valid for.

    *

    The minimum quantity is always greater than or equal to 2. The base Price is interpreted as valid for a minimum quantity equal to 1.

    * + * * @return null|int */ public function getMinimumQuantity() @@ -65,6 +68,7 @@ public function getMinimumQuantity() *

    Money value that applies when the minimumQuantity is greater than or equal to the LineItem quantity.

    *

    The currencyCode of a Price tier is always the same as the currencyCode in the value of the related Price.

    * + * * @return null|TypedMoney */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Common/QueryPrice.php b/lib/commercetools-api/src/Models/Common/QueryPrice.php index f77c95e1639..3a7cc2ad2fa 100644 --- a/lib/commercetools-api/src/Models/Common/QueryPrice.php +++ b/lib/commercetools-api/src/Models/Common/QueryPrice.php @@ -31,6 +31,7 @@ interface QueryPrice extends JsonObject /** *

    Unique identifier of the given Price.

    * + * @return null|string */ public function getId(); @@ -38,6 +39,7 @@ public function getId(); /** *

    Money value of the given Price.

    * + * @return null|Money */ public function getValue(); @@ -45,6 +47,7 @@ public function getValue(); /** *

    Country for which the given Price is valid.

    * + * @return null|string */ public function getCountry(); @@ -52,6 +55,7 @@ public function getCountry(); /** *

    CustomerGroup for which the given Price is valid.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup(); @@ -59,6 +63,7 @@ public function getCustomerGroup(); /** *

    ProductDistribution Channel for which the given Price is valid.

    * + * @return null|ChannelReference */ public function getChannel(); @@ -66,6 +71,7 @@ public function getChannel(); /** *

    Date from which the given Price is valid.

    * + * @return null|DateTimeImmutable */ public function getValidFrom(); @@ -73,6 +79,7 @@ public function getValidFrom(); /** *

    Date until which the given Price is valid.

    * + * @return null|DateTimeImmutable */ public function getValidUntil(); @@ -80,6 +87,7 @@ public function getValidUntil(); /** *

    DiscountedPrice you specify for the given Price.

    * + * @return null|DiscountedPriceDraft */ public function getDiscounted(); @@ -87,6 +95,7 @@ public function getDiscounted(); /** *

    Custom Fields for the Price.

    * + * @return null|CustomFields */ public function getCustom(); @@ -94,6 +103,7 @@ public function getCustom(); /** *

    Price tier applied when the minimum quantity for the LineItem of a ProductVariant with the related Price is reached in a Cart.

    * + * @return null|PriceTierDraftCollection */ public function getTiers(); diff --git a/lib/commercetools-api/src/Models/Common/QueryPriceBuilder.php b/lib/commercetools-api/src/Models/Common/QueryPriceBuilder.php index d666ff92208..33173ec01d3 100644 --- a/lib/commercetools-api/src/Models/Common/QueryPriceBuilder.php +++ b/lib/commercetools-api/src/Models/Common/QueryPriceBuilder.php @@ -28,51 +28,61 @@ final class QueryPriceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|Money|MoneyBuilder */ private $value; /** + * @var ?string */ private $country; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $customerGroup; /** + * @var null|ChannelReference|ChannelReferenceBuilder */ private $channel; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; /** + * @var null|DiscountedPriceDraft|DiscountedPriceDraftBuilder */ private $discounted; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var ?PriceTierDraftCollection */ private $tiers; @@ -80,6 +90,7 @@ final class QueryPriceBuilder implements Builder /** *

    Unique identifier of the given Price.

    * + * @return null|string */ public function getId() @@ -90,6 +101,7 @@ public function getId() /** *

    Money value of the given Price.

    * + * @return null|Money */ public function getValue() @@ -100,6 +112,7 @@ public function getValue() /** *

    Country for which the given Price is valid.

    * + * @return null|string */ public function getCountry() @@ -110,6 +123,7 @@ public function getCountry() /** *

    CustomerGroup for which the given Price is valid.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -120,6 +134,7 @@ public function getCustomerGroup() /** *

    ProductDistribution Channel for which the given Price is valid.

    * + * @return null|ChannelReference */ public function getChannel() @@ -130,6 +145,7 @@ public function getChannel() /** *

    Date from which the given Price is valid.

    * + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -140,6 +156,7 @@ public function getValidFrom() /** *

    Date until which the given Price is valid.

    * + * @return null|DateTimeImmutable */ public function getValidUntil() @@ -150,6 +167,7 @@ public function getValidUntil() /** *

    DiscountedPrice you specify for the given Price.

    * + * @return null|DiscountedPriceDraft */ public function getDiscounted() @@ -160,6 +178,7 @@ public function getDiscounted() /** *

    Custom Fields for the Price.

    * + * @return null|CustomFields */ public function getCustom() @@ -170,6 +189,7 @@ public function getCustom() /** *

    Price tier applied when the minimum quantity for the LineItem of a ProductVariant with the related Price is reached in a Cart.

    * + * @return null|PriceTierDraftCollection */ public function getTiers() diff --git a/lib/commercetools-api/src/Models/Common/QueryPriceModel.php b/lib/commercetools-api/src/Models/Common/QueryPriceModel.php index 7d68242d7e9..7e9ffa153e8 100644 --- a/lib/commercetools-api/src/Models/Common/QueryPriceModel.php +++ b/lib/commercetools-api/src/Models/Common/QueryPriceModel.php @@ -27,51 +27,61 @@ final class QueryPriceModel extends JsonObjectModel implements QueryPrice { /** + * * @var ?string */ protected $id; /** + * * @var ?Money */ protected $value; /** + * * @var ?string */ protected $country; /** + * * @var ?CustomerGroupReference */ protected $customerGroup; /** + * * @var ?ChannelReference */ protected $channel; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; /** + * * @var ?DiscountedPriceDraft */ protected $discounted; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?PriceTierDraftCollection */ protected $tiers; @@ -107,6 +117,7 @@ public function __construct( /** *

    Unique identifier of the given Price.

    * + * * @return null|string */ public function getId() @@ -126,6 +137,7 @@ public function getId() /** *

    Money value of the given Price.

    * + * * @return null|Money */ public function getValue() @@ -146,6 +158,7 @@ public function getValue() /** *

    Country for which the given Price is valid.

    * + * * @return null|string */ public function getCountry() @@ -165,6 +178,7 @@ public function getCountry() /** *

    CustomerGroup for which the given Price is valid.

    * + * * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -185,6 +199,7 @@ public function getCustomerGroup() /** *

    ProductDistribution Channel for which the given Price is valid.

    * + * * @return null|ChannelReference */ public function getChannel() @@ -205,6 +220,7 @@ public function getChannel() /** *

    Date from which the given Price is valid.

    * + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -228,6 +244,7 @@ public function getValidFrom() /** *

    Date until which the given Price is valid.

    * + * * @return null|DateTimeImmutable */ public function getValidUntil() @@ -251,6 +268,7 @@ public function getValidUntil() /** *

    DiscountedPrice you specify for the given Price.

    * + * * @return null|DiscountedPriceDraft */ public function getDiscounted() @@ -271,6 +289,7 @@ public function getDiscounted() /** *

    Custom Fields for the Price.

    * + * * @return null|CustomFields */ public function getCustom() @@ -291,6 +310,7 @@ public function getCustom() /** *

    Price tier applied when the minimum quantity for the LineItem of a ProductVariant with the related Price is reached in a Cart.

    * + * * @return null|PriceTierDraftCollection */ public function getTiers() diff --git a/lib/commercetools-api/src/Models/Common/Reference.php b/lib/commercetools-api/src/Models/Common/Reference.php index 3d54276bb7d..d6f2763784c 100644 --- a/lib/commercetools-api/src/Models/Common/Reference.php +++ b/lib/commercetools-api/src/Models/Common/Reference.php @@ -8,6 +8,7 @@ namespace Commercetools\Api\Models\Common; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitReference; use Commercetools\Api\Models\Cart\CartReference; use Commercetools\Api\Models\CartDiscount\CartDiscountReference; use Commercetools\Api\Models\Category\CategoryReference; @@ -48,6 +49,7 @@ interface Reference extends JsonObject /** *

    Type of referenced resource.

    * + * @return null|string */ public function getTypeId(); @@ -55,6 +57,7 @@ public function getTypeId(); /** *

    Unique ID of the referenced resource.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/Common/ReferenceBuilder.php b/lib/commercetools-api/src/Models/Common/ReferenceBuilder.php index a2ac65c2c5d..ccc1cecbaab 100644 --- a/lib/commercetools-api/src/Models/Common/ReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/Common/ReferenceBuilder.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Common; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitReferenceBuilder; use Commercetools\Api\Models\Cart\CartReference; use Commercetools\Api\Models\Cart\CartReferenceBuilder; use Commercetools\Api\Models\CartDiscount\CartDiscountReference; @@ -77,6 +79,7 @@ final class ReferenceBuilder implements Builder { /** + * @var ?string */ private $id; @@ -84,6 +87,7 @@ final class ReferenceBuilder implements Builder /** *

    Unique ID of the referenced resource.

    * + * @return null|string */ public function getId() diff --git a/lib/commercetools-api/src/Models/Common/ReferenceModel.php b/lib/commercetools-api/src/Models/Common/ReferenceModel.php index b49f6a92504..0897f256857 100644 --- a/lib/commercetools-api/src/Models/Common/ReferenceModel.php +++ b/lib/commercetools-api/src/Models/Common/ReferenceModel.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Common; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitReferenceModel; use Commercetools\Api\Models\Cart\CartReference; use Commercetools\Api\Models\Cart\CartReferenceModel; use Commercetools\Api\Models\CartDiscount\CartDiscountReference; @@ -77,11 +79,13 @@ final class ReferenceModel extends JsonObjectModel implements Reference { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; @@ -91,6 +95,7 @@ final class ReferenceModel extends JsonObjectModel implements Reference * */ private static $discriminatorClasses = [ + 'business-unit' => BusinessUnitReferenceModel::class, 'cart' => CartReferenceModel::class, 'cart-discount' => CartDiscountReferenceModel::class, 'category' => CategoryReferenceModel::class, @@ -125,15 +130,17 @@ final class ReferenceModel extends JsonObjectModel implements Reference * @psalm-suppress MissingParamType */ public function __construct( - ?string $id = null + ?string $id = null, + ?string $typeId = null ) { $this->id = $id; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -153,6 +160,7 @@ public function getTypeId() /** *

    Unique ID of the referenced resource.

    * + * * @return null|string */ public function getId() diff --git a/lib/commercetools-api/src/Models/Common/ResourceIdentifier.php b/lib/commercetools-api/src/Models/Common/ResourceIdentifier.php index bc31747762b..58b16277eae 100644 --- a/lib/commercetools-api/src/Models/Common/ResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/Common/ResourceIdentifier.php @@ -8,6 +8,7 @@ namespace Commercetools\Api\Models\Common; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifier; use Commercetools\Api\Models\Cart\CartResourceIdentifier; use Commercetools\Api\Models\CartDiscount\CartDiscountResourceIdentifier; use Commercetools\Api\Models\Category\CategoryResourceIdentifier; @@ -48,6 +49,7 @@ interface ResourceIdentifier extends JsonObject /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * @return null|string */ public function getTypeId(); @@ -55,6 +57,7 @@ public function getTypeId(); /** *

    Unique identifier of the referenced resource. Required if key is absent.

    * + * @return null|string */ public function getId(); @@ -62,6 +65,7 @@ public function getId(); /** *

    User-defined unique identifier of the referenced resource. Required if id is absent.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Common/ResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/Common/ResourceIdentifierBuilder.php index cca942b4070..b7e0d62dd17 100644 --- a/lib/commercetools-api/src/Models/Common/ResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/Common/ResourceIdentifierBuilder.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Common; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifier; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifierBuilder; use Commercetools\Api\Models\Cart\CartResourceIdentifier; use Commercetools\Api\Models\Cart\CartResourceIdentifierBuilder; use Commercetools\Api\Models\CartDiscount\CartDiscountResourceIdentifier; @@ -75,11 +77,13 @@ final class ResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -87,6 +91,7 @@ final class ResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced resource. Required if key is absent.

    * + * @return null|string */ public function getId() @@ -97,6 +102,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced resource. Required if id is absent.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Common/ResourceIdentifierModel.php b/lib/commercetools-api/src/Models/Common/ResourceIdentifierModel.php index 4b3fe75310c..3e60814a2e5 100644 --- a/lib/commercetools-api/src/Models/Common/ResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/Common/ResourceIdentifierModel.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Common; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifier; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifierModel; use Commercetools\Api\Models\Cart\CartResourceIdentifier; use Commercetools\Api\Models\Cart\CartResourceIdentifierModel; use Commercetools\Api\Models\CartDiscount\CartDiscountResourceIdentifier; @@ -75,16 +77,19 @@ final class ResourceIdentifierModel extends JsonObjectModel implements ResourceI { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -94,6 +99,7 @@ final class ResourceIdentifierModel extends JsonObjectModel implements ResourceI * */ private static $discriminatorClasses = [ + 'business-unit' => BusinessUnitResourceIdentifierModel::class, 'cart' => CartResourceIdentifierModel::class, 'cart-discount' => CartDiscountResourceIdentifierModel::class, 'category' => CategoryResourceIdentifierModel::class, @@ -128,16 +134,18 @@ final class ResourceIdentifierModel extends JsonObjectModel implements ResourceI */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -157,6 +165,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced resource. Required if key is absent.

    * + * * @return null|string */ public function getId() @@ -176,6 +185,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced resource. Required if id is absent.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Common/ScopedPrice.php b/lib/commercetools-api/src/Models/Common/ScopedPrice.php index 9fdde86fda8..f79834aa433 100644 --- a/lib/commercetools-api/src/Models/Common/ScopedPrice.php +++ b/lib/commercetools-api/src/Models/Common/ScopedPrice.php @@ -29,63 +29,82 @@ interface ScopedPrice extends JsonObject public const FIELD_CUSTOM = 'custom'; /** + *

    Platform-generated unique identifier of the Price.

    + * + * @return null|string */ public function getId(); /** - *

    Base polymorphic read-only Money type which is stored in cent precision or high precision. The actual type is determined by the type field.

    + *

    Original value of the Price.

    * + * @return null|TypedMoney */ public function getValue(); /** - *

    Base polymorphic read-only Money type which is stored in cent precision or high precision. The actual type is determined by the type field.

    + *

    If available, either the original price value or discounted value.

    * + * @return null|TypedMoney */ public function getCurrentValue(); /** - *

    Two-digit country code as per ISO 3166-1 alpha-2.

    + *

    Country code of the geographic location.

    * + * @return null|string */ public function getCountry(); /** - *

    Reference to a CustomerGroup.

    + *

    Reference to a CustomerGroup.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup(); /** - *

    Reference to a Channel.

    + *

    Reference to a Channel.

    * + * @return null|ChannelReference */ public function getChannel(); /** + *

    Date and time from which the Price is valid.

    + * + * @return null|DateTimeImmutable */ public function getValidFrom(); /** + *

    Date and time until which the Price is valid.

    + * + * @return null|DateTimeImmutable */ public function getValidUntil(); /** + *

    Is set if a matching ProductDiscount exists. If set, the Cart uses the discounted value for the Cart Price calculation.

    + *

    When a relative Product Discount is applied and the fractional part of the discounted Price is 0.5, the discounted Price is rounded half down in favor of the Customer.

    + * + * @return null|DiscountedPrice */ public function getDiscounted(); /** - *

    Serves as value of the custom field on a resource or data type customized with a Type.

    + *

    Custom Fields for the Price.

    * + * @return null|CustomFields */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Common/ScopedPriceBuilder.php b/lib/commercetools-api/src/Models/Common/ScopedPriceBuilder.php index 99be50d8c1d..ffc3b9d7e78 100644 --- a/lib/commercetools-api/src/Models/Common/ScopedPriceBuilder.php +++ b/lib/commercetools-api/src/Models/Common/ScopedPriceBuilder.php @@ -28,56 +28,69 @@ final class ScopedPriceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $value; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $currentValue; /** + * @var ?string */ private $country; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $customerGroup; /** + * @var null|ChannelReference|ChannelReferenceBuilder */ private $channel; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; /** + * @var null|DiscountedPrice|DiscountedPriceBuilder */ private $discounted; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + *

    Platform-generated unique identifier of the Price.

    + * + * @return null|string */ public function getId() @@ -86,8 +99,9 @@ public function getId() } /** - *

    Base polymorphic read-only Money type which is stored in cent precision or high precision. The actual type is determined by the type field.

    + *

    Original value of the Price.

    * + * @return null|TypedMoney */ public function getValue() @@ -96,8 +110,9 @@ public function getValue() } /** - *

    Base polymorphic read-only Money type which is stored in cent precision or high precision. The actual type is determined by the type field.

    + *

    If available, either the original price value or discounted value.

    * + * @return null|TypedMoney */ public function getCurrentValue() @@ -106,8 +121,9 @@ public function getCurrentValue() } /** - *

    Two-digit country code as per ISO 3166-1 alpha-2.

    + *

    Country code of the geographic location.

    * + * @return null|string */ public function getCountry() @@ -116,8 +132,9 @@ public function getCountry() } /** - *

    Reference to a CustomerGroup.

    + *

    Reference to a CustomerGroup.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -126,8 +143,9 @@ public function getCustomerGroup() } /** - *

    Reference to a Channel.

    + *

    Reference to a Channel.

    * + * @return null|ChannelReference */ public function getChannel() @@ -136,6 +154,9 @@ public function getChannel() } /** + *

    Date and time from which the Price is valid.

    + * + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -144,6 +165,9 @@ public function getValidFrom() } /** + *

    Date and time until which the Price is valid.

    + * + * @return null|DateTimeImmutable */ public function getValidUntil() @@ -152,6 +176,10 @@ public function getValidUntil() } /** + *

    Is set if a matching ProductDiscount exists. If set, the Cart uses the discounted value for the Cart Price calculation.

    + *

    When a relative Product Discount is applied and the fractional part of the discounted Price is 0.5, the discounted Price is rounded half down in favor of the Customer.

    + * + * @return null|DiscountedPrice */ public function getDiscounted() @@ -160,8 +188,9 @@ public function getDiscounted() } /** - *

    Serves as value of the custom field on a resource or data type customized with a Type.

    + *

    Custom Fields for the Price.

    * + * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Common/ScopedPriceModel.php b/lib/commercetools-api/src/Models/Common/ScopedPriceModel.php index d4757e53ad3..d6f4ad5e6ff 100644 --- a/lib/commercetools-api/src/Models/Common/ScopedPriceModel.php +++ b/lib/commercetools-api/src/Models/Common/ScopedPriceModel.php @@ -27,51 +27,61 @@ final class ScopedPriceModel extends JsonObjectModel implements ScopedPrice { /** + * * @var ?string */ protected $id; /** + * * @var ?TypedMoney */ protected $value; /** + * * @var ?TypedMoney */ protected $currentValue; /** + * * @var ?string */ protected $country; /** + * * @var ?CustomerGroupReference */ protected $customerGroup; /** + * * @var ?ChannelReference */ protected $channel; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; /** + * * @var ?DiscountedPrice */ protected $discounted; /** + * * @var ?CustomFields */ protected $custom; @@ -105,6 +115,9 @@ public function __construct( } /** + *

    Platform-generated unique identifier of the Price.

    + * + * * @return null|string */ public function getId() @@ -122,7 +135,8 @@ public function getId() } /** - *

    Base polymorphic read-only Money type which is stored in cent precision or high precision. The actual type is determined by the type field.

    + *

    Original value of the Price.

    + * * * @return null|TypedMoney */ @@ -134,15 +148,16 @@ public function getValue() if (is_null($data)) { return null; } - $className = TypedMoneyModel::resolveDiscriminatorClass($data); - $this->value = $className::of($data); + + $this->value = TypedMoneyModel::of($data); } return $this->value; } /** - *

    Base polymorphic read-only Money type which is stored in cent precision or high precision. The actual type is determined by the type field.

    + *

    If available, either the original price value or discounted value.

    + * * * @return null|TypedMoney */ @@ -154,15 +169,16 @@ public function getCurrentValue() if (is_null($data)) { return null; } - $className = TypedMoneyModel::resolveDiscriminatorClass($data); - $this->currentValue = $className::of($data); + + $this->currentValue = TypedMoneyModel::of($data); } return $this->currentValue; } /** - *

    Two-digit country code as per ISO 3166-1 alpha-2.

    + *

    Country code of the geographic location.

    + * * * @return null|string */ @@ -181,7 +197,8 @@ public function getCountry() } /** - *

    Reference to a CustomerGroup.

    + *

    Reference to a CustomerGroup.

    + * * * @return null|CustomerGroupReference */ @@ -201,7 +218,8 @@ public function getCustomerGroup() } /** - *

    Reference to a Channel.

    + *

    Reference to a Channel.

    + * * * @return null|ChannelReference */ @@ -221,6 +239,9 @@ public function getChannel() } /** + *

    Date and time from which the Price is valid.

    + * + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -242,6 +263,9 @@ public function getValidFrom() } /** + *

    Date and time until which the Price is valid.

    + * + * * @return null|DateTimeImmutable */ public function getValidUntil() @@ -263,6 +287,10 @@ public function getValidUntil() } /** + *

    Is set if a matching ProductDiscount exists. If set, the Cart uses the discounted value for the Cart Price calculation.

    + *

    When a relative Product Discount is applied and the fractional part of the discounted Price is 0.5, the discounted Price is rounded half down in favor of the Customer.

    + * + * * @return null|DiscountedPrice */ public function getDiscounted() @@ -281,7 +309,8 @@ public function getDiscounted() } /** - *

    Serves as value of the custom field on a resource or data type customized with a Type.

    + *

    Custom Fields for the Price.

    + * * * @return null|CustomFields */ diff --git a/lib/commercetools-api/src/Models/Common/TypedMoney.php b/lib/commercetools-api/src/Models/Common/TypedMoney.php index 8e3088ab811..40e767bdbaf 100644 --- a/lib/commercetools-api/src/Models/Common/TypedMoney.php +++ b/lib/commercetools-api/src/Models/Common/TypedMoney.php @@ -20,6 +20,7 @@ interface TypedMoney extends Money /** *

    MoneyType supports two different values, one for amounts in cent precision and another one for sub-cent amounts up to 20 fraction digits.

    * + * @return null|string */ public function getType(); @@ -31,6 +32,7 @@ public function getType(); *
  • Greater than the default number of fraction digits for a currency in HighPrecisionMoney.
  • * * + * @return null|int */ public function getFractionDigits(); diff --git a/lib/commercetools-api/src/Models/Common/TypedMoneyBuilder.php b/lib/commercetools-api/src/Models/Common/TypedMoneyBuilder.php index 3859ba3d8c8..89ef19fccae 100644 --- a/lib/commercetools-api/src/Models/Common/TypedMoneyBuilder.php +++ b/lib/commercetools-api/src/Models/Common/TypedMoneyBuilder.php @@ -21,16 +21,19 @@ final class TypedMoneyBuilder implements Builder { /** + * @var ?int */ private $centAmount; /** + * @var ?string */ private $currencyCode; /** + * @var ?int */ private $fractionDigits; @@ -42,6 +45,7 @@ final class TypedMoneyBuilder implements Builder *
  • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
  • * * + * @return null|int */ public function getCentAmount() @@ -52,6 +56,7 @@ public function getCentAmount() /** *

    Currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode() @@ -66,6 +71,7 @@ public function getCurrencyCode() *
  • Greater than the default number of fraction digits for a currency in HighPrecisionMoney.
  • * * + * @return null|int */ public function getFractionDigits() diff --git a/lib/commercetools-api/src/Models/Common/TypedMoneyDraft.php b/lib/commercetools-api/src/Models/Common/TypedMoneyDraft.php index a63b295fbdd..ac4f149316b 100644 --- a/lib/commercetools-api/src/Models/Common/TypedMoneyDraft.php +++ b/lib/commercetools-api/src/Models/Common/TypedMoneyDraft.php @@ -18,6 +18,7 @@ interface TypedMoneyDraft extends Money public const FIELD_FRACTION_DIGITS = 'fractionDigits'; /** + * @return null|string */ public function getType(); @@ -25,6 +26,7 @@ public function getType(); /** *

    Must be equal to the default number of fraction digits for the specified currency.

    * + * @return null|int */ public function getFractionDigits(); diff --git a/lib/commercetools-api/src/Models/Common/TypedMoneyDraftBuilder.php b/lib/commercetools-api/src/Models/Common/TypedMoneyDraftBuilder.php index e1362755469..67770da0e14 100644 --- a/lib/commercetools-api/src/Models/Common/TypedMoneyDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Common/TypedMoneyDraftBuilder.php @@ -21,16 +21,19 @@ final class TypedMoneyDraftBuilder implements Builder { /** + * @var ?int */ private $centAmount; /** + * @var ?string */ private $currencyCode; /** + * @var ?int */ private $fractionDigits; @@ -42,6 +45,7 @@ final class TypedMoneyDraftBuilder implements Builder *
  • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
  • * * + * @return null|int */ public function getCentAmount() @@ -52,6 +56,7 @@ public function getCentAmount() /** *

    Currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode() @@ -62,6 +67,7 @@ public function getCurrencyCode() /** *

    Must be equal to the default number of fraction digits for the specified currency.

    * + * @return null|int */ public function getFractionDigits() diff --git a/lib/commercetools-api/src/Models/Common/TypedMoneyDraftModel.php b/lib/commercetools-api/src/Models/Common/TypedMoneyDraftModel.php index 693c14a0e0c..371190240d4 100644 --- a/lib/commercetools-api/src/Models/Common/TypedMoneyDraftModel.php +++ b/lib/commercetools-api/src/Models/Common/TypedMoneyDraftModel.php @@ -21,21 +21,25 @@ final class TypedMoneyDraftModel extends JsonObjectModel implements TypedMoneyDr { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?int */ protected $centAmount; /** + * * @var ?string */ protected $currencyCode; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $fractionDigits; @@ -55,12 +59,13 @@ final class TypedMoneyDraftModel extends JsonObjectModel implements TypedMoneyDr public function __construct( ?int $centAmount = null, ?string $currencyCode = null, - ?int $fractionDigits = null + ?int $fractionDigits = null, + ?string $type = null ) { $this->centAmount = $centAmount; $this->currencyCode = $currencyCode; $this->fractionDigits = $fractionDigits; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** @@ -70,6 +75,7 @@ public function __construct( *
  • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
  • * * + * * @return null|int */ public function getCentAmount() @@ -89,6 +95,7 @@ public function getCentAmount() /** *

    Currency code compliant to ISO 4217.

    * + * * @return null|string */ public function getCurrencyCode() @@ -106,6 +113,7 @@ public function getCurrencyCode() } /** + * * @return null|string */ public function getType() @@ -125,6 +133,7 @@ public function getType() /** *

    Must be equal to the default number of fraction digits for the specified currency.

    * + * * @return null|int */ public function getFractionDigits() diff --git a/lib/commercetools-api/src/Models/Common/TypedMoneyModel.php b/lib/commercetools-api/src/Models/Common/TypedMoneyModel.php index 4aecd22fbc3..eb44aebac3a 100644 --- a/lib/commercetools-api/src/Models/Common/TypedMoneyModel.php +++ b/lib/commercetools-api/src/Models/Common/TypedMoneyModel.php @@ -21,21 +21,25 @@ final class TypedMoneyModel extends JsonObjectModel implements TypedMoney { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?int */ protected $centAmount; /** + * * @var ?string */ protected $currencyCode; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $fractionDigits; @@ -55,12 +59,13 @@ final class TypedMoneyModel extends JsonObjectModel implements TypedMoney public function __construct( ?int $centAmount = null, ?string $currencyCode = null, - ?int $fractionDigits = null + ?int $fractionDigits = null, + ?string $type = null ) { $this->centAmount = $centAmount; $this->currencyCode = $currencyCode; $this->fractionDigits = $fractionDigits; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** @@ -70,6 +75,7 @@ public function __construct( *
  • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
  • * * + * * @return null|int */ public function getCentAmount() @@ -89,6 +95,7 @@ public function getCentAmount() /** *

    Currency code compliant to ISO 4217.

    * + * * @return null|string */ public function getCurrencyCode() @@ -108,6 +115,7 @@ public function getCurrencyCode() /** *

    MoneyType supports two different values, one for amounts in cent precision and another one for sub-cent amounts up to 20 fraction digits.

    * + * * @return null|string */ public function getType() @@ -131,6 +139,7 @@ public function getType() *
  • Greater than the default number of fraction digits for a currency in HighPrecisionMoney.
  • * * + * * @return null|int */ public function getFractionDigits() diff --git a/lib/commercetools-api/src/Models/Common/Update.php b/lib/commercetools-api/src/Models/Common/Update.php index a1bed5f1a30..6d6dc045cea 100644 --- a/lib/commercetools-api/src/Models/Common/Update.php +++ b/lib/commercetools-api/src/Models/Common/Update.php @@ -17,11 +17,13 @@ interface Update extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + * @return null|int */ public function getVersion(); /** + * @return null|UpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Common/UpdateAction.php b/lib/commercetools-api/src/Models/Common/UpdateAction.php index 4df6a02fe09..3883e6528a3 100644 --- a/lib/commercetools-api/src/Models/Common/UpdateAction.php +++ b/lib/commercetools-api/src/Models/Common/UpdateAction.php @@ -16,6 +16,7 @@ interface UpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Common/UpdateActionBuilder.php b/lib/commercetools-api/src/Models/Common/UpdateActionBuilder.php index 99ee254440e..556e5214792 100644 --- a/lib/commercetools-api/src/Models/Common/UpdateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Common/UpdateActionBuilder.php @@ -21,11 +21,13 @@ final class UpdateActionBuilder implements Builder { /** + * @var ?string */ private $action; /** + * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Common/UpdateActionModel.php b/lib/commercetools-api/src/Models/Common/UpdateActionModel.php index be9d9950af1..0044f300833 100644 --- a/lib/commercetools-api/src/Models/Common/UpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Common/UpdateActionModel.php @@ -20,6 +20,7 @@ final class UpdateActionModel extends JsonObjectModel implements UpdateAction { /** + * * @var ?string */ protected $action; @@ -35,6 +36,7 @@ public function __construct( } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Common/UpdateBuilder.php b/lib/commercetools-api/src/Models/Common/UpdateBuilder.php index d5ef02ed204..b3fb371701e 100644 --- a/lib/commercetools-api/src/Models/Common/UpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Common/UpdateBuilder.php @@ -21,16 +21,19 @@ final class UpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?UpdateActionCollection */ private $actions; /** + * @return null|int */ public function getVersion() @@ -39,6 +42,7 @@ public function getVersion() } /** + * @return null|UpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Common/UpdateModel.php b/lib/commercetools-api/src/Models/Common/UpdateModel.php index ad7e418bf45..5c5f4e18828 100644 --- a/lib/commercetools-api/src/Models/Common/UpdateModel.php +++ b/lib/commercetools-api/src/Models/Common/UpdateModel.php @@ -20,11 +20,13 @@ final class UpdateModel extends JsonObjectModel implements Update { /** + * * @var ?int */ protected $version; /** + * * @var ?UpdateActionCollection */ protected $actions; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|int */ public function getVersion() @@ -59,6 +62,7 @@ public function getVersion() } /** + * * @return null|UpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/CustomObject/CustomObject.php b/lib/commercetools-api/src/Models/CustomObject/CustomObject.php index c5d42ef9e84..8b38667f738 100644 --- a/lib/commercetools-api/src/Models/CustomObject/CustomObject.php +++ b/lib/commercetools-api/src/Models/CustomObject/CustomObject.php @@ -26,6 +26,7 @@ interface CustomObject extends BaseResource /** *

    Unique identifier of the CustomObject.

    * + * @return null|string */ public function getId(); @@ -33,6 +34,7 @@ public function getId(); /** *

    Current version of the CustomObject.

    * + * @return null|int */ public function getVersion(); @@ -40,6 +42,7 @@ public function getVersion(); /** *

    Date and time (UTC) the CustomObject was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -47,6 +50,7 @@ public function getCreatedAt(); /** *

    Date and time (UTC) the CustomObject was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -54,6 +58,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -61,6 +66,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -68,6 +74,7 @@ public function getCreatedBy(); /** *

    Namespace to group CustomObjects.

    * + * @return null|string */ public function getContainer(); @@ -75,6 +82,7 @@ public function getContainer(); /** *

    User-defined unique identifier of the CustomObject within the defined container.

    * + * @return null|string */ public function getKey(); @@ -84,6 +92,7 @@ public function getKey(); * For values of type Reference the integrity of the data is not guaranteed. * If the referenced object is deleted, the API does not delete the corresponding reference to it and the value points to a non-existing object in such case.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/CustomObject/CustomObjectBuilder.php b/lib/commercetools-api/src/Models/CustomObject/CustomObjectBuilder.php index 25e6744005f..4219056e690 100644 --- a/lib/commercetools-api/src/Models/CustomObject/CustomObjectBuilder.php +++ b/lib/commercetools-api/src/Models/CustomObject/CustomObjectBuilder.php @@ -28,46 +28,55 @@ final class CustomObjectBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $container; /** + * @var ?string */ private $key; /** + * @var null|mixed|mixed */ private $value; @@ -75,6 +84,7 @@ final class CustomObjectBuilder implements Builder /** *

    Unique identifier of the CustomObject.

    * + * @return null|string */ public function getId() @@ -85,6 +95,7 @@ public function getId() /** *

    Current version of the CustomObject.

    * + * @return null|int */ public function getVersion() @@ -95,6 +106,7 @@ public function getVersion() /** *

    Date and time (UTC) the CustomObject was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -105,6 +117,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the CustomObject was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -115,6 +128,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -125,6 +139,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -135,6 +150,7 @@ public function getCreatedBy() /** *

    Namespace to group CustomObjects.

    * + * @return null|string */ public function getContainer() @@ -145,6 +161,7 @@ public function getContainer() /** *

    User-defined unique identifier of the CustomObject within the defined container.

    * + * @return null|string */ public function getKey() @@ -157,6 +174,7 @@ public function getKey() * For values of type Reference the integrity of the data is not guaranteed. * If the referenced object is deleted, the API does not delete the corresponding reference to it and the value points to a non-existing object in such case.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/CustomObject/CustomObjectDraft.php b/lib/commercetools-api/src/Models/CustomObject/CustomObjectDraft.php index 3e462cbfb32..1bffee8d3f4 100644 --- a/lib/commercetools-api/src/Models/CustomObject/CustomObjectDraft.php +++ b/lib/commercetools-api/src/Models/CustomObject/CustomObjectDraft.php @@ -21,6 +21,7 @@ interface CustomObjectDraft extends JsonObject /** *

    Namespace to group CustomObjects.

    * + * @return null|string */ public function getContainer(); @@ -28,6 +29,7 @@ public function getContainer(); /** *

    User-defined unique identifier of the CustomObject within the defined container.

    * + * @return null|string */ public function getKey(); @@ -37,6 +39,7 @@ public function getKey(); * For values of type Reference the integrity of the data is not guaranteed. * If the referenced object is deleted, the API does not delete the corresponding reference to it and the value points to a non-existing object in such case.

    * + * @return null|mixed */ public function getValue(); @@ -44,6 +47,7 @@ public function getValue(); /** *

    Current version of the CustomObject.

    * + * @return null|int */ public function getVersion(); diff --git a/lib/commercetools-api/src/Models/CustomObject/CustomObjectDraftBuilder.php b/lib/commercetools-api/src/Models/CustomObject/CustomObjectDraftBuilder.php index db2d5a9ec90..8447f246a91 100644 --- a/lib/commercetools-api/src/Models/CustomObject/CustomObjectDraftBuilder.php +++ b/lib/commercetools-api/src/Models/CustomObject/CustomObjectDraftBuilder.php @@ -21,21 +21,25 @@ final class CustomObjectDraftBuilder implements Builder { /** + * @var ?string */ private $container; /** + * @var ?string */ private $key; /** + * @var null|mixed|mixed */ private $value; /** + * @var ?int */ private $version; @@ -43,6 +47,7 @@ final class CustomObjectDraftBuilder implements Builder /** *

    Namespace to group CustomObjects.

    * + * @return null|string */ public function getContainer() @@ -53,6 +58,7 @@ public function getContainer() /** *

    User-defined unique identifier of the CustomObject within the defined container.

    * + * @return null|string */ public function getKey() @@ -65,6 +71,7 @@ public function getKey() * For values of type Reference the integrity of the data is not guaranteed. * If the referenced object is deleted, the API does not delete the corresponding reference to it and the value points to a non-existing object in such case.

    * + * @return null|mixed */ public function getValue() @@ -75,6 +82,7 @@ public function getValue() /** *

    Current version of the CustomObject.

    * + * @return null|int */ public function getVersion() diff --git a/lib/commercetools-api/src/Models/CustomObject/CustomObjectDraftModel.php b/lib/commercetools-api/src/Models/CustomObject/CustomObjectDraftModel.php index 308704e870a..8a3c0b0b7fc 100644 --- a/lib/commercetools-api/src/Models/CustomObject/CustomObjectDraftModel.php +++ b/lib/commercetools-api/src/Models/CustomObject/CustomObjectDraftModel.php @@ -20,21 +20,25 @@ final class CustomObjectDraftModel extends JsonObjectModel implements CustomObjectDraft { /** + * * @var ?string */ protected $container; /** + * * @var ?string */ protected $key; /** + * * @var ?mixed */ protected $value; /** + * * @var ?int */ protected $version; @@ -58,6 +62,7 @@ public function __construct( /** *

    Namespace to group CustomObjects.

    * + * * @return null|string */ public function getContainer() @@ -77,6 +82,7 @@ public function getContainer() /** *

    User-defined unique identifier of the CustomObject within the defined container.

    * + * * @return null|string */ public function getKey() @@ -98,6 +104,7 @@ public function getKey() * For values of type Reference the integrity of the data is not guaranteed. * If the referenced object is deleted, the API does not delete the corresponding reference to it and the value points to a non-existing object in such case.

    * + * * @return null|mixed */ public function getValue() @@ -117,6 +124,7 @@ public function getValue() /** *

    Current version of the CustomObject.

    * + * * @return null|int */ public function getVersion() diff --git a/lib/commercetools-api/src/Models/CustomObject/CustomObjectModel.php b/lib/commercetools-api/src/Models/CustomObject/CustomObjectModel.php index 5eb41929e4b..6c55c5657b5 100644 --- a/lib/commercetools-api/src/Models/CustomObject/CustomObjectModel.php +++ b/lib/commercetools-api/src/Models/CustomObject/CustomObjectModel.php @@ -27,46 +27,55 @@ final class CustomObjectModel extends JsonObjectModel implements CustomObject { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $container; /** + * * @var ?string */ protected $key; /** + * * @var ?mixed */ protected $value; @@ -100,6 +109,7 @@ public function __construct( /** *

    Unique identifier of the CustomObject.

    * + * * @return null|string */ public function getId() @@ -119,6 +129,7 @@ public function getId() /** *

    Current version of the CustomObject.

    * + * * @return null|int */ public function getVersion() @@ -138,6 +149,7 @@ public function getVersion() /** *

    Date and time (UTC) the CustomObject was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -161,6 +173,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the CustomObject was last updated.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -184,6 +197,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -204,6 +218,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -224,6 +239,7 @@ public function getCreatedBy() /** *

    Namespace to group CustomObjects.

    * + * * @return null|string */ public function getContainer() @@ -243,6 +259,7 @@ public function getContainer() /** *

    User-defined unique identifier of the CustomObject within the defined container.

    * + * * @return null|string */ public function getKey() @@ -264,6 +281,7 @@ public function getKey() * For values of type Reference the integrity of the data is not guaranteed. * If the referenced object is deleted, the API does not delete the corresponding reference to it and the value points to a non-existing object in such case.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/CustomObject/CustomObjectPagedQueryResponse.php b/lib/commercetools-api/src/Models/CustomObject/CustomObjectPagedQueryResponse.php index 8599c835838..a049a934f43 100644 --- a/lib/commercetools-api/src/Models/CustomObject/CustomObjectPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/CustomObject/CustomObjectPagedQueryResponse.php @@ -22,6 +22,7 @@ interface CustomObjectPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    CustomObjects matching the query.

    * + * @return null|CustomObjectCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/CustomObject/CustomObjectPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/CustomObject/CustomObjectPagedQueryResponseBuilder.php index b5b395abf0c..a5f320baf30 100644 --- a/lib/commercetools-api/src/Models/CustomObject/CustomObjectPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/CustomObject/CustomObjectPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class CustomObjectPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?CustomObjectCollection */ private $results; @@ -48,6 +53,7 @@ final class CustomObjectPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    CustomObjects matching the query.

    * + * @return null|CustomObjectCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/CustomObject/CustomObjectPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/CustomObject/CustomObjectPagedQueryResponseModel.php index e6555e7c828..9852380938c 100644 --- a/lib/commercetools-api/src/Models/CustomObject/CustomObjectPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/CustomObject/CustomObjectPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class CustomObjectPagedQueryResponseModel extends JsonObjectModel implements CustomObjectPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?CustomObjectCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    CustomObjects matching the query.

    * + * * @return null|CustomObjectCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/CustomObject/CustomObjectReference.php b/lib/commercetools-api/src/Models/CustomObject/CustomObjectReference.php index bd2de4b6e59..4c93ffd0257 100644 --- a/lib/commercetools-api/src/Models/CustomObject/CustomObjectReference.php +++ b/lib/commercetools-api/src/Models/CustomObject/CustomObjectReference.php @@ -19,6 +19,7 @@ interface CustomObjectReference extends Reference /** *

    Contains the representation of the expanded CustomObject. Only present in responses to requests with Reference Expansion for CustomObjects.

    * + * @return null|CustomObject */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

    Unique identifier of the referenced CustomObject.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/CustomObject/CustomObjectReferenceBuilder.php b/lib/commercetools-api/src/Models/CustomObject/CustomObjectReferenceBuilder.php index ccd15717a9d..ba0c7d9b4b9 100644 --- a/lib/commercetools-api/src/Models/CustomObject/CustomObjectReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/CustomObject/CustomObjectReferenceBuilder.php @@ -23,11 +23,13 @@ final class CustomObjectReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|CustomObject|CustomObjectBuilder */ private $obj; @@ -35,6 +37,7 @@ final class CustomObjectReferenceBuilder implements Builder /** *

    Unique identifier of the referenced CustomObject.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded CustomObject. Only present in responses to requests with Reference Expansion for CustomObjects.

    * + * @return null|CustomObject */ public function getObj() diff --git a/lib/commercetools-api/src/Models/CustomObject/CustomObjectReferenceModel.php b/lib/commercetools-api/src/Models/CustomObject/CustomObjectReferenceModel.php index 108f6213445..80a9ea838ba 100644 --- a/lib/commercetools-api/src/Models/CustomObject/CustomObjectReferenceModel.php +++ b/lib/commercetools-api/src/Models/CustomObject/CustomObjectReferenceModel.php @@ -23,16 +23,19 @@ final class CustomObjectReferenceModel extends JsonObjectModel implements Custom { public const DISCRIMINATOR_VALUE = 'key-value-document'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?CustomObject */ protected $obj; @@ -43,16 +46,18 @@ final class CustomObjectReferenceModel extends JsonObjectModel implements Custom */ public function __construct( ?string $id = null, - ?CustomObject $obj = null + ?CustomObject $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced CustomObject.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded CustomObject. Only present in responses to requests with Reference Expansion for CustomObjects.

    * + * * @return null|CustomObject */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Customer/Customer.php b/lib/commercetools-api/src/Models/Customer/Customer.php index f112bcfcdc5..d8ef54fbc7f 100644 --- a/lib/commercetools-api/src/Models/Customer/Customer.php +++ b/lib/commercetools-api/src/Models/Customer/Customer.php @@ -21,9 +21,11 @@ interface Customer extends BaseResource { + public const FIELD_KEY = 'key'; + public const FIELD_CUSTOMER_NUMBER = 'customerNumber'; + public const FIELD_EXTERNAL_ID = 'externalId'; public const FIELD_LAST_MODIFIED_BY = 'lastModifiedBy'; public const FIELD_CREATED_BY = 'createdBy'; - public const FIELD_CUSTOMER_NUMBER = 'customerNumber'; public const FIELD_EMAIL = 'email'; public const FIELD_PASSWORD = 'password'; public const FIELD_FIRST_NAME = 'firstName'; @@ -39,197 +41,255 @@ interface Customer extends BaseResource public const FIELD_DEFAULT_BILLING_ADDRESS_ID = 'defaultBillingAddressId'; public const FIELD_BILLING_ADDRESS_IDS = 'billingAddressIds'; public const FIELD_IS_EMAIL_VERIFIED = 'isEmailVerified'; - public const FIELD_EXTERNAL_ID = 'externalId'; public const FIELD_CUSTOMER_GROUP = 'customerGroup'; public const FIELD_CUSTOM = 'custom'; public const FIELD_LOCALE = 'locale'; public const FIELD_SALUTATION = 'salutation'; - public const FIELD_KEY = 'key'; public const FIELD_STORES = 'stores'; public const FIELD_AUTHENTICATION_MODE = 'authenticationMode'; /** *

    Unique identifier of the Customer.

    * + * @return null|string */ public function getId(); /** - *

    The current version of the customer.

    + *

    Current version of the Customer.

    * + * @return null|int */ public function getVersion(); /** + *

    User-defined unique identifier of the Customer.

    + * + + * @return null|string + */ + public function getKey(); + + /** + *

    User-defined unique identifier of the Customer.

    + *

    Can be used to refer to a Customer in a human-readable way (in emails, invoices, and other correspondence).

    + * + + * @return null|string + */ + public function getCustomerNumber(); + + /** + *

    Optional identifier for use in external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

    + * + + * @return null|string + */ + public function getExternalId(); + + /** + *

    Date and time (UTC) the Customer was initially created.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt(); /** + *

    Date and time (UTC) the Customer was last updated.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); /** - *

    The customer number can be used to create a more human-readable (in contrast to ID) identifier for the customer. - * It should be unique across a project. - * Once the field was set it cannot be changed anymore.

    + *

    Email address of the Customer that is unique for an entire Project or to a Store the Customer is assigned to. + * It is the mandatory unique identifier of a Customer.

    * - * @return null|string - */ - public function getCustomerNumber(); - /** - *

    The customer's email address and the main identifier of uniqueness for a customer account. - * Email addresses are either unique to the store they're specified for, or for the entire project. - * For more information, see Email uniquenes.

    - * * @return null|string */ public function getEmail(); /** - *

    Only present with the default authenticationMode, Password.

    + *

    Present only when authenticationMode is set to Password.

    * + * @return null|string */ public function getPassword(); /** + *

    Given name (first name) of the Customer.

    + * + * @return null|string */ public function getFirstName(); /** + *

    Family name (last name) of the Customer.

    + * + * @return null|string */ public function getLastName(); /** + *

    Middle name of the Customer.

    + * + * @return null|string */ public function getMiddleName(); /** + *

    Title of the Customer, for example, 'Dr.'.

    + * + * @return null|string */ public function getTitle(); /** + *

    Date of birth of the Customer.

    + * + * @return null|DateTimeImmutable */ public function getDateOfBirth(); /** + *

    Company name of the Customer.

    + * + * @return null|string */ public function getCompanyName(); /** + *

    Unique VAT ID of the Customer.

    + * + * @return null|string */ public function getVatId(); /** - *

    The addresses have unique IDs in the addresses list

    + *

    Addresses used by the Customer.

    * + * @return null|AddressCollection */ public function getAddresses(); /** - *

    The address ID in the addresses list

    + *

    ID of the address in addresses used as the default shipping address.

    * + * @return null|string */ public function getDefaultShippingAddressId(); /** - *

    The IDs from the addresses list which are used as shipping addresses

    + *

    IDs of addresses in addresses used as shipping addresses.

    * + * @return null|array */ public function getShippingAddressIds(); /** - *

    The address ID in the addresses list

    + *

    ID of the address in addresses used as the default billing address.

    * + * @return null|string */ public function getDefaultBillingAddressId(); /** - *

    The IDs from the addresses list which are used as billing addresses

    + *

    IDs of addresses in addresses used as billing addresses.

    * + * @return null|array */ public function getBillingAddressIds(); /** + *

    Indicates whether the email address of the Customer is verified.

    + * + * @return null|bool */ public function getIsEmailVerified(); /** - * @return null|string - */ - public function getExternalId(); + *

    CustomerGroup to which the Customer belongs.

    + * - /** * @return null|CustomerGroupReference */ public function getCustomerGroup(); /** + *

    Custom Fields for the Customer.

    + * + * @return null|CustomFields */ public function getCustom(); /** + *

    Preferred language of the Customer.

    + * + * @return null|string */ public function getLocale(); /** + *

    Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.

    + * + * @return null|string */ public function getSalutation(); /** - *

    User-defined unique identifier of the Customer.

    + *

    Stores to which the Customer is assigned to.

    + * * - * @return null|string - */ - public function getKey(); - /** - *

    References to the stores the customer account is associated with. - * If no stores are specified, the customer is a global customer, and can log in using the Password Flow for global Customers. - * If one or more stores are specified, the customer can only log in using the Password Flow for Customers in a Store for those specific stores.

    - * * @return null|StoreKeyReferenceCollection */ public function getStores(); /** - *

    Defines whether a Customer has a password.

    + *

    Indicates whether the password is required for the Customer.

    * + * @return null|string */ public function getAuthenticationMode(); @@ -244,6 +304,21 @@ public function setId(?string $id): void; */ public function setVersion(?int $version): void; + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + + /** + * @param ?string $customerNumber + */ + public function setCustomerNumber(?string $customerNumber): void; + + /** + * @param ?string $externalId + */ + public function setExternalId(?string $externalId): void; + /** * @param ?DateTimeImmutable $createdAt */ @@ -264,11 +339,6 @@ public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void; */ public function setCreatedBy(?CreatedBy $createdBy): void; - /** - * @param ?string $customerNumber - */ - public function setCustomerNumber(?string $customerNumber): void; - /** * @param ?string $email */ @@ -344,11 +414,6 @@ public function setBillingAddressIds(?array $billingAddressIds): void; */ public function setIsEmailVerified(?bool $isEmailVerified): void; - /** - * @param ?string $externalId - */ - public function setExternalId(?string $externalId): void; - /** * @param ?CustomerGroupReference $customerGroup */ @@ -369,11 +434,6 @@ public function setLocale(?string $locale): void; */ public function setSalutation(?string $salutation): void; - /** - * @param ?string $key - */ - public function setKey(?string $key): void; - /** * @param ?StoreKeyReferenceCollection $stores */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerAddAddressAction.php b/lib/commercetools-api/src/Models/Customer/CustomerAddAddressAction.php index ec4ed5711fb..ef0f84ae0cf 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerAddAddressAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerAddAddressAction.php @@ -17,6 +17,9 @@ interface CustomerAddAddressAction extends CustomerUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

    Value to append to the addresses array.

    + * + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerAddAddressActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerAddAddressActionBuilder.php index 38c22986f14..c1e1ad9d7e6 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerAddAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerAddAddressActionBuilder.php @@ -23,11 +23,15 @@ final class CustomerAddAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + *

    Value to append to the addresses array.

    + * + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerAddAddressActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerAddAddressActionModel.php index 7bbc9ec43ea..84e1b0aec36 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerAddAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerAddAddressActionModel.php @@ -23,11 +23,13 @@ final class CustomerAddAddressActionModel extends JsonObjectModel implements Cus { public const DISCRIMINATOR_VALUE = 'addAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -37,13 +39,15 @@ final class CustomerAddAddressActionModel extends JsonObjectModel implements Cus * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,9 @@ public function getAction() } /** + *

    Value to append to the addresses array.

    + * + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerAddBillingAddressIdAction.php b/lib/commercetools-api/src/Models/Customer/CustomerAddBillingAddressIdAction.php index 29a9bdaa673..5b47c99c7dd 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerAddBillingAddressIdAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerAddBillingAddressIdAction.php @@ -17,11 +17,17 @@ interface CustomerAddBillingAddressIdAction extends CustomerUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** + *

    id of the Address to become a billing address.

    + * + * @return null|string */ public function getAddressId(); /** + *

    key of the Address to become a billing address.

    + * + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerAddBillingAddressIdActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerAddBillingAddressIdActionBuilder.php index 7d65e1920a2..11043402e09 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerAddBillingAddressIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerAddBillingAddressIdActionBuilder.php @@ -21,16 +21,21 @@ final class CustomerAddBillingAddressIdActionBuilder implements Builder { /** + * @var ?string */ private $addressId; /** + * @var ?string */ private $addressKey; /** + *

    id of the Address to become a billing address.

    + * + * @return null|string */ public function getAddressId() @@ -39,6 +44,9 @@ public function getAddressId() } /** + *

    key of the Address to become a billing address.

    + * + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerAddBillingAddressIdActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerAddBillingAddressIdActionModel.php index 42ceeceaaa0..f4b6b3af0cf 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerAddBillingAddressIdActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerAddBillingAddressIdActionModel.php @@ -21,16 +21,19 @@ final class CustomerAddBillingAddressIdActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'addBillingAddressId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressId; /** + * * @var ?string */ protected $addressKey; @@ -41,14 +44,16 @@ final class CustomerAddBillingAddressIdActionModel extends JsonObjectModel imple */ public function __construct( ?string $addressId = null, - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressId = $addressId; $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,9 @@ public function getAction() } /** + *

    id of the Address to become a billing address.

    + * + * * @return null|string */ public function getAddressId() @@ -83,6 +91,9 @@ public function getAddressId() } /** + *

    key of the Address to become a billing address.

    + * + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerAddShippingAddressIdAction.php b/lib/commercetools-api/src/Models/Customer/CustomerAddShippingAddressIdAction.php index d271a04c13f..1b9d8bfa2fb 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerAddShippingAddressIdAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerAddShippingAddressIdAction.php @@ -17,11 +17,17 @@ interface CustomerAddShippingAddressIdAction extends CustomerUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** + *

    id of the Address to become a shipping address.

    + * + * @return null|string */ public function getAddressId(); /** + *

    key of the Address to become a shipping address.

    + * + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerAddShippingAddressIdActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerAddShippingAddressIdActionBuilder.php index c124cbe9fdc..9ef2d134c0d 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerAddShippingAddressIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerAddShippingAddressIdActionBuilder.php @@ -21,16 +21,21 @@ final class CustomerAddShippingAddressIdActionBuilder implements Builder { /** + * @var ?string */ private $addressId; /** + * @var ?string */ private $addressKey; /** + *

    id of the Address to become a shipping address.

    + * + * @return null|string */ public function getAddressId() @@ -39,6 +44,9 @@ public function getAddressId() } /** + *

    key of the Address to become a shipping address.

    + * + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerAddShippingAddressIdActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerAddShippingAddressIdActionModel.php index d36f3e96ffb..f0cf0e562b9 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerAddShippingAddressIdActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerAddShippingAddressIdActionModel.php @@ -21,16 +21,19 @@ final class CustomerAddShippingAddressIdActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'addShippingAddressId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressId; /** + * * @var ?string */ protected $addressKey; @@ -41,14 +44,16 @@ final class CustomerAddShippingAddressIdActionModel extends JsonObjectModel impl */ public function __construct( ?string $addressId = null, - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressId = $addressId; $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,9 @@ public function getAction() } /** + *

    id of the Address to become a shipping address.

    + * + * * @return null|string */ public function getAddressId() @@ -83,6 +91,9 @@ public function getAddressId() } /** + *

    key of the Address to become a shipping address.

    + * + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerAddStoreAction.php b/lib/commercetools-api/src/Models/Customer/CustomerAddStoreAction.php index dbd74359faa..f3687b99c85 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerAddStoreAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerAddStoreAction.php @@ -17,8 +17,9 @@ interface CustomerAddStoreAction extends CustomerUpdateAction public const FIELD_STORE = 'store'; /** - *

    ResourceIdentifier to a Store.

    + *

    ResourceIdentifier of the Store to add.

    * + * @return null|StoreResourceIdentifier */ public function getStore(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerAddStoreActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerAddStoreActionBuilder.php index 8c65bb60525..5c790640f79 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerAddStoreActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerAddStoreActionBuilder.php @@ -23,13 +23,15 @@ final class CustomerAddStoreActionBuilder implements Builder { /** + * @var null|StoreResourceIdentifier|StoreResourceIdentifierBuilder */ private $store; /** - *

    ResourceIdentifier to a Store.

    + *

    ResourceIdentifier of the Store to add.

    * + * @return null|StoreResourceIdentifier */ public function getStore() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerAddStoreActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerAddStoreActionModel.php index d74bed1f827..ffbda8860c3 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerAddStoreActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerAddStoreActionModel.php @@ -23,11 +23,13 @@ final class CustomerAddStoreActionModel extends JsonObjectModel implements Custo { public const DISCRIMINATOR_VALUE = 'addStore'; /** + * * @var ?string */ protected $action; /** + * * @var ?StoreResourceIdentifier */ protected $store; @@ -37,13 +39,15 @@ final class CustomerAddStoreActionModel extends JsonObjectModel implements Custo * @psalm-suppress MissingParamType */ public function __construct( - ?StoreResourceIdentifier $store = null + ?StoreResourceIdentifier $store = null, + ?string $action = null ) { $this->store = $store; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,7 +65,8 @@ public function getAction() } /** - *

    ResourceIdentifier to a Store.

    + *

    ResourceIdentifier of the Store to add.

    + * * * @return null|StoreResourceIdentifier */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerBuilder.php index a2260aee732..e0445f690d7 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerBuilder.php @@ -34,151 +34,181 @@ final class CustomerBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + + * @var ?string + */ + private $key; + + /** + + * @var ?string + */ + private $customerNumber; + + /** + + * @var ?string + */ + private $externalId; + + /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** - * @var ?string - */ - private $customerNumber; - /** * @var ?string */ private $email; /** + * @var ?string */ private $password; /** + * @var ?string */ private $firstName; /** + * @var ?string */ private $lastName; /** + * @var ?string */ private $middleName; /** + * @var ?string */ private $title; /** + * @var ?DateTimeImmutable */ private $dateOfBirth; /** + * @var ?string */ private $companyName; /** + * @var ?string */ private $vatId; /** + * @var ?AddressCollection */ private $addresses; /** + * @var ?string */ private $defaultShippingAddressId; /** + * @var ?array */ private $shippingAddressIds; /** + * @var ?string */ private $defaultBillingAddressId; /** + * @var ?array */ private $billingAddressIds; /** + * @var ?bool */ private $isEmailVerified; /** - * @var ?string - */ - private $externalId; - /** * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $customerGroup; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var ?string */ private $locale; /** + * @var ?string */ private $salutation; /** - * @var ?string - */ - private $key; - /** * @var ?StoreKeyReferenceCollection */ private $stores; /** + * @var ?string */ private $authenticationMode; @@ -186,6 +216,7 @@ final class CustomerBuilder implements Builder /** *

    Unique identifier of the Customer.

    * + * @return null|string */ public function getId() @@ -194,8 +225,9 @@ public function getId() } /** - *

    The current version of the customer.

    + *

    Current version of the Customer.

    * + * @return null|int */ public function getVersion() @@ -204,6 +236,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Customer was initially created.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -212,6 +247,9 @@ public function getCreatedAt() } /** + *

    Date and time (UTC) the Customer was last updated.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -220,42 +258,66 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    User-defined unique identifier of the Customer.

    * - * @return null|LastModifiedBy + + * @return null|string */ - public function getLastModifiedBy() + public function getKey() { - return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + return $this->key; } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    User-defined unique identifier of the Customer.

    + *

    Can be used to refer to a Customer in a human-readable way (in emails, invoices, and other correspondence).

    * - * @return null|CreatedBy + + * @return null|string */ - public function getCreatedBy() + public function getCustomerNumber() { - return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + return $this->customerNumber; } /** - *

    The customer number can be used to create a more human-readable (in contrast to ID) identifier for the customer. - * It should be unique across a project. - * Once the field was set it cannot be changed anymore.

    + *

    Optional identifier for use in external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

    * + * @return null|string */ - public function getCustomerNumber() + public function getExternalId() { - return $this->customerNumber; + return $this->externalId; } /** - *

    The customer's email address and the main identifier of uniqueness for a customer account. - * Email addresses are either unique to the store they're specified for, or for the entire project. - * For more information, see Email uniquenes.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Email address of the Customer that is unique for an entire Project or to a Store the Customer is assigned to. + * It is the mandatory unique identifier of a Customer.

    + * + * @return null|string */ public function getEmail() @@ -264,8 +326,9 @@ public function getEmail() } /** - *

    Only present with the default authenticationMode, Password.

    + *

    Present only when authenticationMode is set to Password.

    * + * @return null|string */ public function getPassword() @@ -274,6 +337,9 @@ public function getPassword() } /** + *

    Given name (first name) of the Customer.

    + * + * @return null|string */ public function getFirstName() @@ -282,6 +348,9 @@ public function getFirstName() } /** + *

    Family name (last name) of the Customer.

    + * + * @return null|string */ public function getLastName() @@ -290,6 +359,9 @@ public function getLastName() } /** + *

    Middle name of the Customer.

    + * + * @return null|string */ public function getMiddleName() @@ -298,6 +370,9 @@ public function getMiddleName() } /** + *

    Title of the Customer, for example, 'Dr.'.

    + * + * @return null|string */ public function getTitle() @@ -306,6 +381,9 @@ public function getTitle() } /** + *

    Date of birth of the Customer.

    + * + * @return null|DateTimeImmutable */ public function getDateOfBirth() @@ -314,6 +392,9 @@ public function getDateOfBirth() } /** + *

    Company name of the Customer.

    + * + * @return null|string */ public function getCompanyName() @@ -322,6 +403,9 @@ public function getCompanyName() } /** + *

    Unique VAT ID of the Customer.

    + * + * @return null|string */ public function getVatId() @@ -330,8 +414,9 @@ public function getVatId() } /** - *

    The addresses have unique IDs in the addresses list

    + *

    Addresses used by the Customer.

    * + * @return null|AddressCollection */ public function getAddresses() @@ -340,8 +425,9 @@ public function getAddresses() } /** - *

    The address ID in the addresses list

    + *

    ID of the address in addresses used as the default shipping address.

    * + * @return null|string */ public function getDefaultShippingAddressId() @@ -350,8 +436,9 @@ public function getDefaultShippingAddressId() } /** - *

    The IDs from the addresses list which are used as shipping addresses

    + *

    IDs of addresses in addresses used as shipping addresses.

    * + * @return null|array */ public function getShippingAddressIds() @@ -360,8 +447,9 @@ public function getShippingAddressIds() } /** - *

    The address ID in the addresses list

    + *

    ID of the address in addresses used as the default billing address.

    * + * @return null|string */ public function getDefaultBillingAddressId() @@ -370,8 +458,9 @@ public function getDefaultBillingAddressId() } /** - *

    The IDs from the addresses list which are used as billing addresses

    + *

    IDs of addresses in addresses used as billing addresses.

    * + * @return null|array */ public function getBillingAddressIds() @@ -380,6 +469,9 @@ public function getBillingAddressIds() } /** + *

    Indicates whether the email address of the Customer is verified.

    + * + * @return null|bool */ public function getIsEmailVerified() @@ -388,14 +480,9 @@ public function getIsEmailVerified() } /** - * @return null|string - */ - public function getExternalId() - { - return $this->externalId; - } + *

    CustomerGroup to which the Customer belongs.

    + * - /** * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -404,6 +491,9 @@ public function getCustomerGroup() } /** + *

    Custom Fields for the Customer.

    + * + * @return null|CustomFields */ public function getCustom() @@ -412,6 +502,9 @@ public function getCustom() } /** + *

    Preferred language of the Customer.

    + * + * @return null|string */ public function getLocale() @@ -420,6 +513,9 @@ public function getLocale() } /** + *

    Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.

    + * + * @return null|string */ public function getSalutation() @@ -428,20 +524,13 @@ public function getSalutation() } /** - *

    User-defined unique identifier of the Customer.

    + *

    Stores to which the Customer is assigned to.

    + * * - * @return null|string - */ - public function getKey() - { - return $this->key; - } - /** - *

    References to the stores the customer account is associated with. - * If no stores are specified, the customer is a global customer, and can log in using the Password Flow for global Customers. - * If one or more stores are specified, the customer can only log in using the Password Flow for Customers in a Store for those specific stores.

    - * * @return null|StoreKeyReferenceCollection */ public function getStores() @@ -450,8 +539,9 @@ public function getStores() } /** - *

    Defines whether a Customer has a password.

    + *

    Indicates whether the password is required for the Customer.

    * + * @return null|string */ public function getAuthenticationMode() @@ -504,34 +594,56 @@ public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) } /** - * @param ?LastModifiedBy $lastModifiedBy + * @param ?string $key * @return $this */ - public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + public function withKey(?string $key) { - $this->lastModifiedBy = $lastModifiedBy; + $this->key = $key; return $this; } /** - * @param ?CreatedBy $createdBy + * @param ?string $customerNumber * @return $this */ - public function withCreatedBy(?CreatedBy $createdBy) + public function withCustomerNumber(?string $customerNumber) { - $this->createdBy = $createdBy; + $this->customerNumber = $customerNumber; return $this; } /** - * @param ?string $customerNumber + * @param ?string $externalId * @return $this */ - public function withCustomerNumber(?string $customerNumber) + public function withExternalId(?string $externalId) { - $this->customerNumber = $customerNumber; + $this->externalId = $externalId; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; return $this; } @@ -701,17 +813,6 @@ public function withIsEmailVerified(?bool $isEmailVerified) return $this; } - /** - * @param ?string $externalId - * @return $this - */ - public function withExternalId(?string $externalId) - { - $this->externalId = $externalId; - - return $this; - } - /** * @param ?CustomerGroupReference $customerGroup * @return $this @@ -756,17 +857,6 @@ public function withSalutation(?string $salutation) return $this; } - /** - * @param ?string $key - * @return $this - */ - public function withKey(?string $key) - { - $this->key = $key; - - return $this; - } - /** * @param ?StoreKeyReferenceCollection $stores * @return $this @@ -840,9 +930,11 @@ public function build(): Customer $this->version, $this->createdAt, $this->lastModifiedAt, + $this->key, + $this->customerNumber, + $this->externalId, $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, - $this->customerNumber, $this->email, $this->password, $this->firstName, @@ -858,12 +950,10 @@ public function build(): Customer $this->defaultBillingAddressId, $this->billingAddressIds, $this->isEmailVerified, - $this->externalId, $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup, $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, $this->locale, $this->salutation, - $this->key, $this->stores, $this->authenticationMode ); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerChangeAddressAction.php b/lib/commercetools-api/src/Models/Customer/CustomerChangeAddressAction.php index 976e79930e8..1b2ced1fe6a 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerChangeAddressAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerChangeAddressAction.php @@ -19,16 +19,25 @@ interface CustomerChangeAddressAction extends CustomerUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

    id of the Address to change.

    + * + * @return null|string */ public function getAddressId(); /** + *

    key of the Address to change.

    + * + * @return null|string */ public function getAddressKey(); /** + *

    Value to set.

    + * + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerChangeAddressActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerChangeAddressActionBuilder.php index dacba101ef5..473e831c7f6 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerChangeAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerChangeAddressActionBuilder.php @@ -23,21 +23,27 @@ final class CustomerChangeAddressActionBuilder implements Builder { /** + * @var ?string */ private $addressId; /** + * @var ?string */ private $addressKey; /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + *

    id of the Address to change.

    + * + * @return null|string */ public function getAddressId() @@ -46,6 +52,9 @@ public function getAddressId() } /** + *

    key of the Address to change.

    + * + * @return null|string */ public function getAddressKey() @@ -54,6 +63,9 @@ public function getAddressKey() } /** + *

    Value to set.

    + * + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerChangeAddressActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerChangeAddressActionModel.php index 58b7840fa7f..a92623e2143 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerChangeAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerChangeAddressActionModel.php @@ -23,21 +23,25 @@ final class CustomerChangeAddressActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'changeAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressId; /** + * * @var ?string */ protected $addressKey; /** + * * @var ?BaseAddress */ protected $address; @@ -49,15 +53,17 @@ final class CustomerChangeAddressActionModel extends JsonObjectModel implements public function __construct( ?string $addressId = null, ?string $addressKey = null, - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->addressId = $addressId; $this->addressKey = $addressKey; $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -75,6 +81,9 @@ public function getAction() } /** + *

    id of the Address to change.

    + * + * * @return null|string */ public function getAddressId() @@ -92,6 +101,9 @@ public function getAddressId() } /** + *

    key of the Address to change.

    + * + * * @return null|string */ public function getAddressKey() @@ -109,6 +121,9 @@ public function getAddressKey() } /** + *

    Value to set.

    + * + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerChangeEmailAction.php b/lib/commercetools-api/src/Models/Customer/CustomerChangeEmailAction.php index 00c7782248e..f0fb5cdd177 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerChangeEmailAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerChangeEmailAction.php @@ -16,6 +16,9 @@ interface CustomerChangeEmailAction extends CustomerUpdateAction public const FIELD_EMAIL = 'email'; /** + *

    Value to set.

    + * + * @return null|string */ public function getEmail(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerChangeEmailActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerChangeEmailActionBuilder.php index 915e7660570..93480fa837d 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerChangeEmailActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerChangeEmailActionBuilder.php @@ -21,11 +21,15 @@ final class CustomerChangeEmailActionBuilder implements Builder { /** + * @var ?string */ private $email; /** + *

    Value to set.

    + * + * @return null|string */ public function getEmail() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerChangeEmailActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerChangeEmailActionModel.php index 967adaba1a2..2cd77253bb8 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerChangeEmailActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerChangeEmailActionModel.php @@ -21,11 +21,13 @@ final class CustomerChangeEmailActionModel extends JsonObjectModel implements Cu { public const DISCRIMINATOR_VALUE = 'changeEmail'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $email; @@ -35,13 +37,15 @@ final class CustomerChangeEmailActionModel extends JsonObjectModel implements Cu * @psalm-suppress MissingParamType */ public function __construct( - ?string $email = null + ?string $email = null, + ?string $action = null ) { $this->email = $email; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,9 @@ public function getAction() } /** + *

    Value to set.

    + * + * * @return null|string */ public function getEmail() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerChangePassword.php b/lib/commercetools-api/src/Models/Customer/CustomerChangePassword.php index 1aef10a11be..4352494e5e6 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerChangePassword.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerChangePassword.php @@ -21,21 +21,32 @@ interface CustomerChangePassword extends JsonObject /** *

    Unique identifier of the Customer.

    * + * @return null|string */ public function getId(); /** + *

    Expected version of the Customer on which the changes should be applied.

    + * + * @return null|int */ public function getVersion(); /** + *

    Current password of the Customer.

    + *

    If the current password does not match, an InvalidCurrentPassword error is returned.

    + * + * @return null|string */ public function getCurrentPassword(); /** + *

    New password to be set.

    + * + * @return null|string */ public function getNewPassword(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerChangePasswordBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerChangePasswordBuilder.php index 7b71d816502..0b86825de63 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerChangePasswordBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerChangePasswordBuilder.php @@ -21,21 +21,25 @@ final class CustomerChangePasswordBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?string */ private $currentPassword; /** + * @var ?string */ private $newPassword; @@ -43,6 +47,7 @@ final class CustomerChangePasswordBuilder implements Builder /** *

    Unique identifier of the Customer.

    * + * @return null|string */ public function getId() @@ -51,6 +56,9 @@ public function getId() } /** + *

    Expected version of the Customer on which the changes should be applied.

    + * + * @return null|int */ public function getVersion() @@ -59,6 +67,10 @@ public function getVersion() } /** + *

    Current password of the Customer.

    + *

    If the current password does not match, an InvalidCurrentPassword error is returned.

    + * + * @return null|string */ public function getCurrentPassword() @@ -67,6 +79,9 @@ public function getCurrentPassword() } /** + *

    New password to be set.

    + * + * @return null|string */ public function getNewPassword() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerChangePasswordModel.php b/lib/commercetools-api/src/Models/Customer/CustomerChangePasswordModel.php index d48622a588e..71c2a1f750c 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerChangePasswordModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerChangePasswordModel.php @@ -20,21 +20,25 @@ final class CustomerChangePasswordModel extends JsonObjectModel implements CustomerChangePassword { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?string */ protected $currentPassword; /** + * * @var ?string */ protected $newPassword; @@ -58,6 +62,7 @@ public function __construct( /** *

    Unique identifier of the Customer.

    * + * * @return null|string */ public function getId() @@ -75,6 +80,9 @@ public function getId() } /** + *

    Expected version of the Customer on which the changes should be applied.

    + * + * * @return null|int */ public function getVersion() @@ -92,6 +100,10 @@ public function getVersion() } /** + *

    Current password of the Customer.

    + *

    If the current password does not match, an InvalidCurrentPassword error is returned.

    + * + * * @return null|string */ public function getCurrentPassword() @@ -109,6 +121,9 @@ public function getCurrentPassword() } /** + *

    New password to be set.

    + * + * * @return null|string */ public function getNewPassword() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailToken.php b/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailToken.php index 47bc7011aff..84daddebee7 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailToken.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailToken.php @@ -18,18 +18,25 @@ interface CustomerCreateEmailToken extends JsonObject public const FIELD_TTL_MINUTES = 'ttlMinutes'; /** - *

    Unique identifier of the email token.

    + *

    Unique identifier of the Customer.

    * + * @return null|string */ public function getId(); /** + *

    Expected version of the Customer.

    + * + * @return null|int */ public function getVersion(); /** + *

    Validity period of the generated token in minutes.

    + * + * @return null|int */ public function getTtlMinutes(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailTokenBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailTokenBuilder.php index b46817e8f79..8e7eb661df3 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailTokenBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailTokenBuilder.php @@ -21,23 +21,27 @@ final class CustomerCreateEmailTokenBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?int */ private $ttlMinutes; /** - *

    Unique identifier of the email token.

    + *

    Unique identifier of the Customer.

    * + * @return null|string */ public function getId() @@ -46,6 +50,9 @@ public function getId() } /** + *

    Expected version of the Customer.

    + * + * @return null|int */ public function getVersion() @@ -54,6 +61,9 @@ public function getVersion() } /** + *

    Validity period of the generated token in minutes.

    + * + * @return null|int */ public function getTtlMinutes() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailTokenModel.php b/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailTokenModel.php index eced7504d6b..33edfa00186 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailTokenModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerCreateEmailTokenModel.php @@ -20,16 +20,19 @@ final class CustomerCreateEmailTokenModel extends JsonObjectModel implements CustomerCreateEmailToken { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?int */ protected $ttlMinutes; @@ -49,7 +52,8 @@ public function __construct( } /** - *

    Unique identifier of the email token.

    + *

    Unique identifier of the Customer.

    + * * * @return null|string */ @@ -68,6 +72,9 @@ public function getId() } /** + *

    Expected version of the Customer.

    + * + * * @return null|int */ public function getVersion() @@ -85,6 +92,9 @@ public function getVersion() } /** + *

    Validity period of the generated token in minutes.

    + * + * * @return null|int */ public function getTtlMinutes() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetToken.php b/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetToken.php index 902224f6b05..03edeb4f3d4 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetToken.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetToken.php @@ -17,11 +17,17 @@ interface CustomerCreatePasswordResetToken extends JsonObject public const FIELD_TTL_MINUTES = 'ttlMinutes'; /** + *

    Email address of the Customer treated as case-insensitive.

    + * + * @return null|string */ public function getEmail(); /** + *

    Validity period of the generated token in minutes.

    + * + * @return null|int */ public function getTtlMinutes(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetTokenBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetTokenBuilder.php index 3944329c20d..65cf3788077 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetTokenBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetTokenBuilder.php @@ -21,16 +21,21 @@ final class CustomerCreatePasswordResetTokenBuilder implements Builder { /** + * @var ?string */ private $email; /** + * @var ?int */ private $ttlMinutes; /** + *

    Email address of the Customer treated as case-insensitive.

    + * + * @return null|string */ public function getEmail() @@ -39,6 +44,9 @@ public function getEmail() } /** + *

    Validity period of the generated token in minutes.

    + * + * @return null|int */ public function getTtlMinutes() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetTokenModel.php b/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetTokenModel.php index ea7dd676c72..76816e84238 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetTokenModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerCreatePasswordResetTokenModel.php @@ -20,11 +20,13 @@ final class CustomerCreatePasswordResetTokenModel extends JsonObjectModel implements CustomerCreatePasswordResetToken { /** + * * @var ?string */ protected $email; /** + * * @var ?int */ protected $ttlMinutes; @@ -42,6 +44,9 @@ public function __construct( } /** + *

    Email address of the Customer treated as case-insensitive.

    + * + * * @return null|string */ public function getEmail() @@ -59,6 +64,9 @@ public function getEmail() } /** + *

    Validity period of the generated token in minutes.

    + * + * * @return null|int */ public function getTtlMinutes() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerDraft.php b/lib/commercetools-api/src/Models/Customer/CustomerDraft.php index 3dca75dca77..be6f9c14887 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerDraft.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerDraft.php @@ -19,7 +19,9 @@ interface CustomerDraft extends JsonObject { + public const FIELD_KEY = 'key'; public const FIELD_CUSTOMER_NUMBER = 'customerNumber'; + public const FIELD_EXTERNAL_ID = 'externalId'; public const FIELD_EMAIL = 'email'; public const FIELD_PASSWORD = 'password'; public const FIELD_FIRST_NAME = 'firstName'; @@ -38,198 +40,262 @@ interface CustomerDraft extends JsonObject public const FIELD_DEFAULT_BILLING_ADDRESS = 'defaultBillingAddress'; public const FIELD_BILLING_ADDRESSES = 'billingAddresses'; public const FIELD_IS_EMAIL_VERIFIED = 'isEmailVerified'; - public const FIELD_EXTERNAL_ID = 'externalId'; public const FIELD_CUSTOMER_GROUP = 'customerGroup'; public const FIELD_CUSTOM = 'custom'; public const FIELD_LOCALE = 'locale'; public const FIELD_SALUTATION = 'salutation'; - public const FIELD_KEY = 'key'; public const FIELD_STORES = 'stores'; public const FIELD_AUTHENTICATION_MODE = 'authenticationMode'; /** - *

    String that uniquely identifies a customer. - * It can be used to create more human-readable (in contrast to ID) identifier for the customer. - * It should be unique across a project. - * Once it's set it cannot be changed.

    + *

    User-defined unique identifier for the Customer. + * The key field is preferred over customerNumber as it is mutable and provides more flexibility.

    + * + + * @return null|string + */ + public function getKey(); + + /** + *

    User-defined unique identifier for a Customer. + * Once set, it cannot be changed.

    + *

    Can be used to refer to a Customer in a human-readable way (in emails, invoices, and other correspondence).

    * + * @return null|string */ public function getCustomerNumber(); /** - *

    The customer's email address and the main identifier of uniqueness for a customer account. - * Email addresses are either unique to the store they're specified for, or for the entire project, and are case insensitive. - * For more information, see Email uniquenes.

    + *

    Optional identifier for use in external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

    + * + + * @return null|string + */ + public function getExternalId(); + + /** + *

    Email address of the Customer that must be unique for an entire Project or to a Store the Customer is assigned to. + * It is the mandatory unique identifier of a Customer.

    * + * @return null|string */ public function getEmail(); /** - *

    Only optional with authenticationMode set to ExternalAuth.

    + *

    Required when authenticationMode is set to Password. + * Provide the Customer's password in plain text. The API stores passwords in an encrypted format.

    * + * @return null|string */ public function getPassword(); /** + *

    Given name (first name) of the Customer.

    + * + * @return null|string */ public function getFirstName(); /** + *

    Family name (last name) of the Customer.

    + * + * @return null|string */ public function getLastName(); /** + *

    Middle name of the Customer.

    + * + * @return null|string */ public function getMiddleName(); /** + *

    Title of the Customer, for example, 'Dr.'.

    + * + * @return null|string */ public function getTitle(); /** - *

    Identifies a single cart that will be assigned to the new customer account.

    + *

    Deprecated since an anonymous Cart can be identified by its id or external key.

    * + * @deprecated * @return null|string */ public function getAnonymousCartId(); /** - *

    Identifies a single cart that will be assigned to the new customer account.

    + *

    Identifies a Cart that will be assigned to the new Customer.

    * + * @return null|CartResourceIdentifier */ public function getAnonymousCart(); /** - *

    Identifies carts and orders belonging to an anonymous session that will be assigned to the new customer account.

    + *

    Identifies Carts and Orders belonging to an anonymous session that will be assigned to the new Customer.

    * + * @return null|string */ public function getAnonymousId(); /** + *

    Date of birth of the Customer.

    + * + * @return null|DateTimeImmutable */ public function getDateOfBirth(); /** + *

    Company name of the Customer. When representing a company as a Customer, Business Units provide extended funtionality.

    + * + * @return null|string */ public function getCompanyName(); /** + *

    Unique VAT ID of the Customer.

    + * + * @return null|string */ public function getVatId(); /** - *

    Sets the ID of each address to be unique in the addresses list.

    + *

    Addresses of the Customer.

    * + * @return null|BaseAddressCollection */ public function getAddresses(); /** - *

    The index of the address in the addresses array. - * The defaultShippingAddressId of the customer will be set to the ID of that address.

    + *

    Index of the address in the addresses array to use as the default shipping address. + * The defaultShippingAddressId of the Customer will be set to the id of that address.

    * + * @return null|int */ public function getDefaultShippingAddress(); /** - *

    The indices of the shipping addresses in the addresses array. - * The shippingAddressIds of the Customer will be set to the IDs of that addresses.

    + *

    Indices of the shipping addresses in the addresses array. + * The shippingAddressIds of the Customer will be set to the IDs of these addresses.

    * + * @return null|array */ public function getShippingAddresses(); /** - *

    The index of the address in the addresses array. - * The defaultBillingAddressId of the customer will be set to the ID of that address.

    + *

    Index of the address in the addresses array to use as the default billing address. + * The defaultBillingAddressId of the Customer will be set to the id of that address.

    * + * @return null|int */ public function getDefaultBillingAddress(); /** - *

    The indices of the billing addresses in the addresses array. - * The billingAddressIds of the customer will be set to the IDs of that addresses.

    + *

    Indices of the billing addresses in the addresses array. + * The billingAddressIds of the Customer will be set to the IDs of these addresses.

    * + * @return null|array */ public function getBillingAddresses(); /** + *

    Set to true if the email address of the Customer has been verified already. + * The intended use is to leave this field unset upon sign-up of the Customer and initiate the email verification afterwards.

    + * + * @return null|bool */ public function getIsEmailVerified(); /** - * @return null|string - */ - public function getExternalId(); + *

    Sets the CustomerGroup for the Customer.

    + * - /** * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup(); /** - *

    The custom fields.

    + *

    Custom Fields for the Customer.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); /** - *

    Must be one of the languages supported for this project

    + *

    Preferred language of the Customer. + * Must be one of the languages supported by the Project.

    * + * @return null|string */ public function getLocale(); /** + *

    Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.

    + * + * @return null|string */ public function getSalutation(); /** - *

    User-defined unique identifier for the Customer.

    + *

    Sets the Stores for the Customer.

    + * * - * @return null|string - */ - public function getKey(); - /** - *

    References to the stores the customer account is associated with. - * If no stores are specified, the customer is a global customer, and can log in using the Password Flow for global Customers. - * If one or more stores are specified, the customer can only log in using the Password Flow for Customers in a Store for those specific stores.

    - * * @return null|StoreResourceIdentifierCollection */ public function getStores(); /** - *

    Defines whether a password field is a required field for the Customer.

    + *
      + *
    • Set to Password to make the password field required for the Customer.
    • + *
    • Set to ExternalAuth when the password is not required for the Customer.
    • + *
    * + * @return null|string */ public function getAuthenticationMode(); + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?string $customerNumber */ public function setCustomerNumber(?string $customerNumber): void; + /** + * @param ?string $externalId + */ + public function setExternalId(?string $externalId): void; + /** * @param ?string $email */ @@ -320,11 +386,6 @@ public function setBillingAddresses(?array $billingAddresses): void; */ public function setIsEmailVerified(?bool $isEmailVerified): void; - /** - * @param ?string $externalId - */ - public function setExternalId(?string $externalId): void; - /** * @param ?CustomerGroupResourceIdentifier $customerGroup */ @@ -345,11 +406,6 @@ public function setLocale(?string $locale): void; */ public function setSalutation(?string $salutation): void; - /** - * @param ?string $key - */ - public function setKey(?string $key): void; - /** * @param ?StoreResourceIdentifierCollection $stores */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php index ad6d5781832..2aa79250f55 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php @@ -30,146 +30,185 @@ final class CustomerDraftBuilder implements Builder { /** + + * @var ?string + */ + private $key; + + /** + * @var ?string */ private $customerNumber; /** + + * @var ?string + */ + private $externalId; + + /** + * @var ?string */ private $email; /** + * @var ?string */ private $password; /** + * @var ?string */ private $firstName; /** + * @var ?string */ private $lastName; /** + * @var ?string */ private $middleName; /** + * @var ?string */ private $title; /** + * @deprecated * @var ?string */ private $anonymousCartId; /** + * @var null|CartResourceIdentifier|CartResourceIdentifierBuilder */ private $anonymousCart; /** + * @var ?string */ private $anonymousId; /** + * @var ?DateTimeImmutable */ private $dateOfBirth; /** + * @var ?string */ private $companyName; /** + * @var ?string */ private $vatId; /** + * @var ?BaseAddressCollection */ private $addresses; /** + * @var ?int */ private $defaultShippingAddress; /** + * @var ?array */ private $shippingAddresses; /** + * @var ?int */ private $defaultBillingAddress; /** + * @var ?array */ private $billingAddresses; /** + * @var ?bool */ private $isEmailVerified; /** - * @var ?string - */ - private $externalId; - /** * @var null|CustomerGroupResourceIdentifier|CustomerGroupResourceIdentifierBuilder */ private $customerGroup; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var ?string */ private $locale; /** + * @var ?string */ private $salutation; /** - * @var ?string - */ - private $key; - /** * @var ?StoreResourceIdentifierCollection */ private $stores; /** + * @var ?string */ private $authenticationMode; /** - *

    String that uniquely identifies a customer. - * It can be used to create more human-readable (in contrast to ID) identifier for the customer. - * It should be unique across a project. - * Once it's set it cannot be changed.

    + *

    User-defined unique identifier for the Customer. + * The key field is preferred over customerNumber as it is mutable and provides more flexibility.

    + * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + *

    User-defined unique identifier for a Customer. + * Once set, it cannot be changed.

    + *

    Can be used to refer to a Customer in a human-readable way (in emails, invoices, and other correspondence).

    * + * @return null|string */ public function getCustomerNumber() @@ -178,10 +217,21 @@ public function getCustomerNumber() } /** - *

    The customer's email address and the main identifier of uniqueness for a customer account. - * Email addresses are either unique to the store they're specified for, or for the entire project, and are case insensitive. - * For more information, see Email uniquenes.

    + *

    Optional identifier for use in external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

    * + + * @return null|string + */ + public function getExternalId() + { + return $this->externalId; + } + + /** + *

    Email address of the Customer that must be unique for an entire Project or to a Store the Customer is assigned to. + * It is the mandatory unique identifier of a Customer.

    + * + * @return null|string */ public function getEmail() @@ -190,8 +240,10 @@ public function getEmail() } /** - *

    Only optional with authenticationMode set to ExternalAuth.

    + *

    Required when authenticationMode is set to Password. + * Provide the Customer's password in plain text. The API stores passwords in an encrypted format.

    * + * @return null|string */ public function getPassword() @@ -200,6 +252,9 @@ public function getPassword() } /** + *

    Given name (first name) of the Customer.

    + * + * @return null|string */ public function getFirstName() @@ -208,6 +263,9 @@ public function getFirstName() } /** + *

    Family name (last name) of the Customer.

    + * + * @return null|string */ public function getLastName() @@ -216,6 +274,9 @@ public function getLastName() } /** + *

    Middle name of the Customer.

    + * + * @return null|string */ public function getMiddleName() @@ -224,6 +285,9 @@ public function getMiddleName() } /** + *

    Title of the Customer, for example, 'Dr.'.

    + * + * @return null|string */ public function getTitle() @@ -232,8 +296,9 @@ public function getTitle() } /** - *

    Identifies a single cart that will be assigned to the new customer account.

    + *

    Deprecated since an anonymous Cart can be identified by its id or external key.

    * + * @deprecated * @return null|string */ public function getAnonymousCartId() @@ -242,8 +307,9 @@ public function getAnonymousCartId() } /** - *

    Identifies a single cart that will be assigned to the new customer account.

    + *

    Identifies a Cart that will be assigned to the new Customer.

    * + * @return null|CartResourceIdentifier */ public function getAnonymousCart() @@ -252,8 +318,9 @@ public function getAnonymousCart() } /** - *

    Identifies carts and orders belonging to an anonymous session that will be assigned to the new customer account.

    + *

    Identifies Carts and Orders belonging to an anonymous session that will be assigned to the new Customer.

    * + * @return null|string */ public function getAnonymousId() @@ -262,6 +329,9 @@ public function getAnonymousId() } /** + *

    Date of birth of the Customer.

    + * + * @return null|DateTimeImmutable */ public function getDateOfBirth() @@ -270,6 +340,9 @@ public function getDateOfBirth() } /** + *

    Company name of the Customer. When representing a company as a Customer, Business Units provide extended funtionality.

    + * + * @return null|string */ public function getCompanyName() @@ -278,6 +351,9 @@ public function getCompanyName() } /** + *

    Unique VAT ID of the Customer.

    + * + * @return null|string */ public function getVatId() @@ -286,8 +362,9 @@ public function getVatId() } /** - *

    Sets the ID of each address to be unique in the addresses list.

    + *

    Addresses of the Customer.

    * + * @return null|BaseAddressCollection */ public function getAddresses() @@ -296,9 +373,10 @@ public function getAddresses() } /** - *

    The index of the address in the addresses array. - * The defaultShippingAddressId of the customer will be set to the ID of that address.

    + *

    Index of the address in the addresses array to use as the default shipping address. + * The defaultShippingAddressId of the Customer will be set to the id of that address.

    * + * @return null|int */ public function getDefaultShippingAddress() @@ -307,9 +385,10 @@ public function getDefaultShippingAddress() } /** - *

    The indices of the shipping addresses in the addresses array. - * The shippingAddressIds of the Customer will be set to the IDs of that addresses.

    + *

    Indices of the shipping addresses in the addresses array. + * The shippingAddressIds of the Customer will be set to the IDs of these addresses.

    * + * @return null|array */ public function getShippingAddresses() @@ -318,9 +397,10 @@ public function getShippingAddresses() } /** - *

    The index of the address in the addresses array. - * The defaultBillingAddressId of the customer will be set to the ID of that address.

    + *

    Index of the address in the addresses array to use as the default billing address. + * The defaultBillingAddressId of the Customer will be set to the id of that address.

    * + * @return null|int */ public function getDefaultBillingAddress() @@ -329,9 +409,10 @@ public function getDefaultBillingAddress() } /** - *

    The indices of the billing addresses in the addresses array. - * The billingAddressIds of the customer will be set to the IDs of that addresses.

    + *

    Indices of the billing addresses in the addresses array. + * The billingAddressIds of the Customer will be set to the IDs of these addresses.

    * + * @return null|array */ public function getBillingAddresses() @@ -340,6 +421,10 @@ public function getBillingAddresses() } /** + *

    Set to true if the email address of the Customer has been verified already. + * The intended use is to leave this field unset upon sign-up of the Customer and initiate the email verification afterwards.

    + * + * @return null|bool */ public function getIsEmailVerified() @@ -348,14 +433,9 @@ public function getIsEmailVerified() } /** - * @return null|string - */ - public function getExternalId() - { - return $this->externalId; - } + *

    Sets the CustomerGroup for the Customer.

    + * - /** * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() @@ -364,8 +444,9 @@ public function getCustomerGroup() } /** - *

    The custom fields.

    + *

    Custom Fields for the Customer.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -374,8 +455,10 @@ public function getCustom() } /** - *

    Must be one of the languages supported for this project

    + *

    Preferred language of the Customer. + * Must be one of the languages supported by the Project.

    * + * @return null|string */ public function getLocale() @@ -384,6 +467,9 @@ public function getLocale() } /** + *

    Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.

    + * + * @return null|string */ public function getSalutation() @@ -392,20 +478,13 @@ public function getSalutation() } /** - *

    User-defined unique identifier for the Customer.

    + *

    Sets the Stores for the Customer.

    + * * - * @return null|string - */ - public function getKey() - { - return $this->key; - } - /** - *

    References to the stores the customer account is associated with. - * If no stores are specified, the customer is a global customer, and can log in using the Password Flow for global Customers. - * If one or more stores are specified, the customer can only log in using the Password Flow for Customers in a Store for those specific stores.

    - * * @return null|StoreResourceIdentifierCollection */ public function getStores() @@ -414,8 +493,12 @@ public function getStores() } /** - *

    Defines whether a password field is a required field for the Customer.

    + *
      + *
    • Set to Password to make the password field required for the Customer.
    • + *
    • Set to ExternalAuth when the password is not required for the Customer.
    • + *
    * + * @return null|string */ public function getAuthenticationMode() @@ -423,6 +506,17 @@ public function getAuthenticationMode() return $this->authenticationMode; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?string $customerNumber * @return $this @@ -434,6 +528,17 @@ public function withCustomerNumber(?string $customerNumber) return $this; } + /** + * @param ?string $externalId + * @return $this + */ + public function withExternalId(?string $externalId) + { + $this->externalId = $externalId; + + return $this; + } + /** * @param ?string $email * @return $this @@ -632,17 +737,6 @@ public function withIsEmailVerified(?bool $isEmailVerified) return $this; } - /** - * @param ?string $externalId - * @return $this - */ - public function withExternalId(?string $externalId) - { - $this->externalId = $externalId; - - return $this; - } - /** * @param ?CustomerGroupResourceIdentifier $customerGroup * @return $this @@ -687,17 +781,6 @@ public function withSalutation(?string $salutation) return $this; } - /** - * @param ?string $key - * @return $this - */ - public function withKey(?string $key) - { - $this->key = $key; - - return $this; - } - /** * @param ?StoreResourceIdentifierCollection $stores * @return $this @@ -756,7 +839,9 @@ public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) public function build(): CustomerDraft { return new CustomerDraftModel( + $this->key, $this->customerNumber, + $this->externalId, $this->email, $this->password, $this->firstName, @@ -775,12 +860,10 @@ public function build(): CustomerDraft $this->defaultBillingAddress, $this->billingAddresses, $this->isEmailVerified, - $this->externalId, $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup, $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, $this->locale, $this->salutation, - $this->key, $this->stores, $this->authenticationMode ); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerDraftModel.php b/lib/commercetools-api/src/Models/Customer/CustomerDraftModel.php index 80763bf113f..b199c56ea09 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerDraftModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerDraftModel.php @@ -29,136 +29,163 @@ final class CustomerDraftModel extends JsonObjectModel implements CustomerDraft { /** + * + * @var ?string + */ + protected $key; + + /** + * * @var ?string */ protected $customerNumber; /** + * + * @var ?string + */ + protected $externalId; + + /** + * * @var ?string */ protected $email; /** + * * @var ?string */ protected $password; /** + * * @var ?string */ protected $firstName; /** + * * @var ?string */ protected $lastName; /** + * * @var ?string */ protected $middleName; /** + * * @var ?string */ protected $title; /** + * @deprecated * @var ?string */ protected $anonymousCartId; /** + * * @var ?CartResourceIdentifier */ protected $anonymousCart; /** + * * @var ?string */ protected $anonymousId; /** + * * @var ?DateTimeImmutable */ protected $dateOfBirth; /** + * * @var ?string */ protected $companyName; /** + * * @var ?string */ protected $vatId; /** + * * @var ?BaseAddressCollection */ protected $addresses; /** + * * @var ?int */ protected $defaultShippingAddress; /** + * * @var ?array */ protected $shippingAddresses; /** + * * @var ?int */ protected $defaultBillingAddress; /** + * * @var ?array */ protected $billingAddresses; /** + * * @var ?bool */ protected $isEmailVerified; /** - * @var ?string - */ - protected $externalId; - - /** + * * @var ?CustomerGroupResourceIdentifier */ protected $customerGroup; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?string */ protected $locale; /** + * * @var ?string */ protected $salutation; /** - * @var ?string - */ - protected $key; - - /** + * * @var ?StoreResourceIdentifierCollection */ protected $stores; /** + * * @var ?string */ protected $authenticationMode; @@ -168,7 +195,9 @@ final class CustomerDraftModel extends JsonObjectModel implements CustomerDraft * @psalm-suppress MissingParamType */ public function __construct( + ?string $key = null, ?string $customerNumber = null, + ?string $externalId = null, ?string $email = null, ?string $password = null, ?string $firstName = null, @@ -187,16 +216,16 @@ public function __construct( ?int $defaultBillingAddress = null, ?array $billingAddresses = null, ?bool $isEmailVerified = null, - ?string $externalId = null, ?CustomerGroupResourceIdentifier $customerGroup = null, ?CustomFieldsDraft $custom = null, ?string $locale = null, ?string $salutation = null, - ?string $key = null, ?StoreResourceIdentifierCollection $stores = null, ?string $authenticationMode = null ) { + $this->key = $key; $this->customerNumber = $customerNumber; + $this->externalId = $externalId; $this->email = $email; $this->password = $password; $this->firstName = $firstName; @@ -215,21 +244,40 @@ public function __construct( $this->defaultBillingAddress = $defaultBillingAddress; $this->billingAddresses = $billingAddresses; $this->isEmailVerified = $isEmailVerified; - $this->externalId = $externalId; $this->customerGroup = $customerGroup; $this->custom = $custom; $this->locale = $locale; $this->salutation = $salutation; - $this->key = $key; $this->stores = $stores; $this->authenticationMode = $authenticationMode; } /** - *

    String that uniquely identifies a customer. - * It can be used to create more human-readable (in contrast to ID) identifier for the customer. - * It should be unique across a project. - * Once it's set it cannot be changed.

    + *

    User-defined unique identifier for the Customer. + * The key field is preferred over customerNumber as it is mutable and provides more flexibility.

    + * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + *

    User-defined unique identifier for a Customer. + * Once set, it cannot be changed.

    + *

    Can be used to refer to a Customer in a human-readable way (in emails, invoices, and other correspondence).

    + * * * @return null|string */ @@ -248,9 +296,29 @@ public function getCustomerNumber() } /** - *

    The customer's email address and the main identifier of uniqueness for a customer account. - * Email addresses are either unique to the store they're specified for, or for the entire project, and are case insensitive. - * For more information, see Email uniquenes.

    + *

    Optional identifier for use in external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

    + * + * + * @return null|string + */ + public function getExternalId() + { + if (is_null($this->externalId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_EXTERNAL_ID); + if (is_null($data)) { + return null; + } + $this->externalId = (string) $data; + } + + return $this->externalId; + } + + /** + *

    Email address of the Customer that must be unique for an entire Project or to a Store the Customer is assigned to. + * It is the mandatory unique identifier of a Customer.

    + * * * @return null|string */ @@ -269,7 +337,9 @@ public function getEmail() } /** - *

    Only optional with authenticationMode set to ExternalAuth.

    + *

    Required when authenticationMode is set to Password. + * Provide the Customer's password in plain text. The API stores passwords in an encrypted format.

    + * * * @return null|string */ @@ -288,6 +358,9 @@ public function getPassword() } /** + *

    Given name (first name) of the Customer.

    + * + * * @return null|string */ public function getFirstName() @@ -305,6 +378,9 @@ public function getFirstName() } /** + *

    Family name (last name) of the Customer.

    + * + * * @return null|string */ public function getLastName() @@ -322,6 +398,9 @@ public function getLastName() } /** + *

    Middle name of the Customer.

    + * + * * @return null|string */ public function getMiddleName() @@ -339,6 +418,9 @@ public function getMiddleName() } /** + *

    Title of the Customer, for example, 'Dr.'.

    + * + * * @return null|string */ public function getTitle() @@ -356,8 +438,9 @@ public function getTitle() } /** - *

    Identifies a single cart that will be assigned to the new customer account.

    + *

    Deprecated since an anonymous Cart can be identified by its id or external key.

    * + * @deprecated * @return null|string */ public function getAnonymousCartId() @@ -375,7 +458,8 @@ public function getAnonymousCartId() } /** - *

    Identifies a single cart that will be assigned to the new customer account.

    + *

    Identifies a Cart that will be assigned to the new Customer.

    + * * * @return null|CartResourceIdentifier */ @@ -395,7 +479,8 @@ public function getAnonymousCart() } /** - *

    Identifies carts and orders belonging to an anonymous session that will be assigned to the new customer account.

    + *

    Identifies Carts and Orders belonging to an anonymous session that will be assigned to the new Customer.

    + * * * @return null|string */ @@ -414,6 +499,9 @@ public function getAnonymousId() } /** + *

    Date of birth of the Customer.

    + * + * * @return null|DateTimeImmutable */ public function getDateOfBirth() @@ -435,6 +523,9 @@ public function getDateOfBirth() } /** + *

    Company name of the Customer. When representing a company as a Customer, Business Units provide extended funtionality.

    + * + * * @return null|string */ public function getCompanyName() @@ -452,6 +543,9 @@ public function getCompanyName() } /** + *

    Unique VAT ID of the Customer.

    + * + * * @return null|string */ public function getVatId() @@ -469,7 +563,8 @@ public function getVatId() } /** - *

    Sets the ID of each address to be unique in the addresses list.

    + *

    Addresses of the Customer.

    + * * * @return null|BaseAddressCollection */ @@ -488,8 +583,9 @@ public function getAddresses() } /** - *

    The index of the address in the addresses array. - * The defaultShippingAddressId of the customer will be set to the ID of that address.

    + *

    Index of the address in the addresses array to use as the default shipping address. + * The defaultShippingAddressId of the Customer will be set to the id of that address.

    + * * * @return null|int */ @@ -508,8 +604,9 @@ public function getDefaultShippingAddress() } /** - *

    The indices of the shipping addresses in the addresses array. - * The shippingAddressIds of the Customer will be set to the IDs of that addresses.

    + *

    Indices of the shipping addresses in the addresses array. + * The shippingAddressIds of the Customer will be set to the IDs of these addresses.

    + * * * @return null|array */ @@ -528,8 +625,9 @@ public function getShippingAddresses() } /** - *

    The index of the address in the addresses array. - * The defaultBillingAddressId of the customer will be set to the ID of that address.

    + *

    Index of the address in the addresses array to use as the default billing address. + * The defaultBillingAddressId of the Customer will be set to the id of that address.

    + * * * @return null|int */ @@ -548,8 +646,9 @@ public function getDefaultBillingAddress() } /** - *

    The indices of the billing addresses in the addresses array. - * The billingAddressIds of the customer will be set to the IDs of that addresses.

    + *

    Indices of the billing addresses in the addresses array. + * The billingAddressIds of the Customer will be set to the IDs of these addresses.

    + * * * @return null|array */ @@ -568,6 +667,10 @@ public function getBillingAddresses() } /** + *

    Set to true if the email address of the Customer has been verified already. + * The intended use is to leave this field unset upon sign-up of the Customer and initiate the email verification afterwards.

    + * + * * @return null|bool */ public function getIsEmailVerified() @@ -585,23 +688,9 @@ public function getIsEmailVerified() } /** - * @return null|string - */ - public function getExternalId() - { - if (is_null($this->externalId)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_EXTERNAL_ID); - if (is_null($data)) { - return null; - } - $this->externalId = (string) $data; - } - - return $this->externalId; - } - - /** + *

    Sets the CustomerGroup for the Customer.

    + * + * * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() @@ -620,7 +709,8 @@ public function getCustomerGroup() } /** - *

    The custom fields.

    + *

    Custom Fields for the Customer.

    + * * * @return null|CustomFieldsDraft */ @@ -640,7 +730,9 @@ public function getCustom() } /** - *

    Must be one of the languages supported for this project

    + *

    Preferred language of the Customer. + * Must be one of the languages supported by the Project.

    + * * * @return null|string */ @@ -659,6 +751,9 @@ public function getLocale() } /** + *

    Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.

    + * + * * @return null|string */ public function getSalutation() @@ -676,28 +771,12 @@ public function getSalutation() } /** - *

    User-defined unique identifier for the Customer.

    + *

    Sets the Stores for the Customer.

    + * * - * @return null|string - */ - public function getKey() - { - if (is_null($this->key)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_KEY); - if (is_null($data)) { - return null; - } - $this->key = (string) $data; - } - - return $this->key; - } - - /** - *

    References to the stores the customer account is associated with. - * If no stores are specified, the customer is a global customer, and can log in using the Password Flow for global Customers. - * If one or more stores are specified, the customer can only log in using the Password Flow for Customers in a Store for those specific stores.

    * * @return null|StoreResourceIdentifierCollection */ @@ -716,7 +795,11 @@ public function getStores() } /** - *

    Defines whether a password field is a required field for the Customer.

    + *
      + *
    • Set to Password to make the password field required for the Customer.
    • + *
    • Set to ExternalAuth when the password is not required for the Customer.
    • + *
    + * * * @return null|string */ @@ -735,6 +818,14 @@ public function getAuthenticationMode() } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?string $customerNumber */ @@ -743,6 +834,14 @@ public function setCustomerNumber(?string $customerNumber): void $this->customerNumber = $customerNumber; } + /** + * @param ?string $externalId + */ + public function setExternalId(?string $externalId): void + { + $this->externalId = $externalId; + } + /** * @param ?string $email */ @@ -887,14 +986,6 @@ public function setIsEmailVerified(?bool $isEmailVerified): void $this->isEmailVerified = $isEmailVerified; } - /** - * @param ?string $externalId - */ - public function setExternalId(?string $externalId): void - { - $this->externalId = $externalId; - } - /** * @param ?CustomerGroupResourceIdentifier $customerGroup */ @@ -927,14 +1018,6 @@ public function setSalutation(?string $salutation): void $this->salutation = $salutation; } - /** - * @param ?string $key - */ - public function setKey(?string $key): void - { - $this->key = $key; - } - /** * @param ?StoreResourceIdentifierCollection $stores */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerEmailVerify.php b/lib/commercetools-api/src/Models/Customer/CustomerEmailVerify.php index 47b2722cd17..0b8b0bd00de 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerEmailVerify.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerEmailVerify.php @@ -17,11 +17,17 @@ interface CustomerEmailVerify extends JsonObject public const FIELD_TOKEN_VALUE = 'tokenValue'; /** + *

    Expected version of the Customer.

    + * + * @return null|int */ public function getVersion(); /** + *

    Value of the token to verify Customer email.

    + * + * @return null|string */ public function getTokenValue(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerEmailVerifyBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerEmailVerifyBuilder.php index 248cbbb5da8..e9f2b285c08 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerEmailVerifyBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerEmailVerifyBuilder.php @@ -21,16 +21,21 @@ final class CustomerEmailVerifyBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?string */ private $tokenValue; /** + *

    Expected version of the Customer.

    + * + * @return null|int */ public function getVersion() @@ -39,6 +44,9 @@ public function getVersion() } /** + *

    Value of the token to verify Customer email.

    + * + * @return null|string */ public function getTokenValue() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerEmailVerifyModel.php b/lib/commercetools-api/src/Models/Customer/CustomerEmailVerifyModel.php index b6f4cc58471..f82cdf7d976 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerEmailVerifyModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerEmailVerifyModel.php @@ -20,11 +20,13 @@ final class CustomerEmailVerifyModel extends JsonObjectModel implements CustomerEmailVerify { /** + * * @var ?int */ protected $version; /** + * * @var ?string */ protected $tokenValue; @@ -42,6 +44,9 @@ public function __construct( } /** + *

    Expected version of the Customer.

    + * + * * @return null|int */ public function getVersion() @@ -59,6 +64,9 @@ public function getVersion() } /** + *

    Value of the token to verify Customer email.

    + * + * * @return null|string */ public function getTokenValue() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerModel.php b/lib/commercetools-api/src/Models/Customer/CustomerModel.php index b635c10045a..0424db6fd25 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerModel.php @@ -33,151 +33,181 @@ final class CustomerModel extends JsonObjectModel implements Customer { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** - * @var ?LastModifiedBy + * + * @var ?string */ - protected $lastModifiedBy; + protected $key; /** - * @var ?CreatedBy + * + * @var ?string */ - protected $createdBy; + protected $customerNumber; /** + * * @var ?string */ - protected $customerNumber; + protected $externalId; /** + * + * @var ?LastModifiedBy + */ + protected $lastModifiedBy; + + /** + * + * @var ?CreatedBy + */ + protected $createdBy; + + /** + * * @var ?string */ protected $email; /** + * * @var ?string */ protected $password; /** + * * @var ?string */ protected $firstName; /** + * * @var ?string */ protected $lastName; /** + * * @var ?string */ protected $middleName; /** + * * @var ?string */ protected $title; /** + * * @var ?DateTimeImmutable */ protected $dateOfBirth; /** + * * @var ?string */ protected $companyName; /** + * * @var ?string */ protected $vatId; /** + * * @var ?AddressCollection */ protected $addresses; /** + * * @var ?string */ protected $defaultShippingAddressId; /** + * * @var ?array */ protected $shippingAddressIds; /** + * * @var ?string */ protected $defaultBillingAddressId; /** + * * @var ?array */ protected $billingAddressIds; /** + * * @var ?bool */ protected $isEmailVerified; /** - * @var ?string - */ - protected $externalId; - - /** + * * @var ?CustomerGroupReference */ protected $customerGroup; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?string */ protected $locale; /** + * * @var ?string */ protected $salutation; /** - * @var ?string - */ - protected $key; - - /** + * * @var ?StoreKeyReferenceCollection */ protected $stores; /** + * * @var ?string */ protected $authenticationMode; @@ -191,9 +221,11 @@ public function __construct( ?int $version = null, ?DateTimeImmutable $createdAt = null, ?DateTimeImmutable $lastModifiedAt = null, + ?string $key = null, + ?string $customerNumber = null, + ?string $externalId = null, ?LastModifiedBy $lastModifiedBy = null, ?CreatedBy $createdBy = null, - ?string $customerNumber = null, ?string $email = null, ?string $password = null, ?string $firstName = null, @@ -209,12 +241,10 @@ public function __construct( ?string $defaultBillingAddressId = null, ?array $billingAddressIds = null, ?bool $isEmailVerified = null, - ?string $externalId = null, ?CustomerGroupReference $customerGroup = null, ?CustomFields $custom = null, ?string $locale = null, ?string $salutation = null, - ?string $key = null, ?StoreKeyReferenceCollection $stores = null, ?string $authenticationMode = null ) { @@ -222,9 +252,11 @@ public function __construct( $this->version = $version; $this->createdAt = $createdAt; $this->lastModifiedAt = $lastModifiedAt; + $this->key = $key; + $this->customerNumber = $customerNumber; + $this->externalId = $externalId; $this->lastModifiedBy = $lastModifiedBy; $this->createdBy = $createdBy; - $this->customerNumber = $customerNumber; $this->email = $email; $this->password = $password; $this->firstName = $firstName; @@ -240,12 +272,10 @@ public function __construct( $this->defaultBillingAddressId = $defaultBillingAddressId; $this->billingAddressIds = $billingAddressIds; $this->isEmailVerified = $isEmailVerified; - $this->externalId = $externalId; $this->customerGroup = $customerGroup; $this->custom = $custom; $this->locale = $locale; $this->salutation = $salutation; - $this->key = $key; $this->stores = $stores; $this->authenticationMode = $authenticationMode; } @@ -253,6 +283,7 @@ public function __construct( /** *

    Unique identifier of the Customer.

    * + * * @return null|string */ public function getId() @@ -270,7 +301,8 @@ public function getId() } /** - *

    The current version of the customer.

    + *

    Current version of the Customer.

    + * * * @return null|int */ @@ -289,6 +321,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Customer was initially created.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -310,6 +345,9 @@ public function getCreatedAt() } /** + *

    Date and time (UTC) the Customer was last updated.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -331,7 +369,69 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    User-defined unique identifier of the Customer.

    + * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + *

    User-defined unique identifier of the Customer.

    + *

    Can be used to refer to a Customer in a human-readable way (in emails, invoices, and other correspondence).

    + * + * + * @return null|string + */ + public function getCustomerNumber() + { + if (is_null($this->customerNumber)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOMER_NUMBER); + if (is_null($data)) { + return null; + } + $this->customerNumber = (string) $data; + } + + return $this->customerNumber; + } + + /** + *

    Optional identifier for use in external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

    + * + * + * @return null|string + */ + public function getExternalId() + { + if (is_null($this->externalId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_EXTERNAL_ID); + if (is_null($data)) { + return null; + } + $this->externalId = (string) $data; + } + + return $this->externalId; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * * * @return null|LastModifiedBy */ @@ -351,7 +451,8 @@ public function getLastModifiedBy() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * * * @return null|CreatedBy */ @@ -371,30 +472,9 @@ public function getCreatedBy() } /** - *

    The customer number can be used to create a more human-readable (in contrast to ID) identifier for the customer. - * It should be unique across a project. - * Once the field was set it cannot be changed anymore.

    + *

    Email address of the Customer that is unique for an entire Project or to a Store the Customer is assigned to. + * It is the mandatory unique identifier of a Customer.

    * - * @return null|string - */ - public function getCustomerNumber() - { - if (is_null($this->customerNumber)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_CUSTOMER_NUMBER); - if (is_null($data)) { - return null; - } - $this->customerNumber = (string) $data; - } - - return $this->customerNumber; - } - - /** - *

    The customer's email address and the main identifier of uniqueness for a customer account. - * Email addresses are either unique to the store they're specified for, or for the entire project. - * For more information, see Email uniquenes.

    * * @return null|string */ @@ -413,7 +493,8 @@ public function getEmail() } /** - *

    Only present with the default authenticationMode, Password.

    + *

    Present only when authenticationMode is set to Password.

    + * * * @return null|string */ @@ -432,6 +513,9 @@ public function getPassword() } /** + *

    Given name (first name) of the Customer.

    + * + * * @return null|string */ public function getFirstName() @@ -449,6 +533,9 @@ public function getFirstName() } /** + *

    Family name (last name) of the Customer.

    + * + * * @return null|string */ public function getLastName() @@ -466,6 +553,9 @@ public function getLastName() } /** + *

    Middle name of the Customer.

    + * + * * @return null|string */ public function getMiddleName() @@ -483,6 +573,9 @@ public function getMiddleName() } /** + *

    Title of the Customer, for example, 'Dr.'.

    + * + * * @return null|string */ public function getTitle() @@ -500,6 +593,9 @@ public function getTitle() } /** + *

    Date of birth of the Customer.

    + * + * * @return null|DateTimeImmutable */ public function getDateOfBirth() @@ -521,6 +617,9 @@ public function getDateOfBirth() } /** + *

    Company name of the Customer.

    + * + * * @return null|string */ public function getCompanyName() @@ -538,6 +637,9 @@ public function getCompanyName() } /** + *

    Unique VAT ID of the Customer.

    + * + * * @return null|string */ public function getVatId() @@ -555,7 +657,8 @@ public function getVatId() } /** - *

    The addresses have unique IDs in the addresses list

    + *

    Addresses used by the Customer.

    + * * * @return null|AddressCollection */ @@ -574,7 +677,8 @@ public function getAddresses() } /** - *

    The address ID in the addresses list

    + *

    ID of the address in addresses used as the default shipping address.

    + * * * @return null|string */ @@ -593,7 +697,8 @@ public function getDefaultShippingAddressId() } /** - *

    The IDs from the addresses list which are used as shipping addresses

    + *

    IDs of addresses in addresses used as shipping addresses.

    + * * * @return null|array */ @@ -612,7 +717,8 @@ public function getShippingAddressIds() } /** - *

    The address ID in the addresses list

    + *

    ID of the address in addresses used as the default billing address.

    + * * * @return null|string */ @@ -631,7 +737,8 @@ public function getDefaultBillingAddressId() } /** - *

    The IDs from the addresses list which are used as billing addresses

    + *

    IDs of addresses in addresses used as billing addresses.

    + * * * @return null|array */ @@ -650,6 +757,9 @@ public function getBillingAddressIds() } /** + *

    Indicates whether the email address of the Customer is verified.

    + * + * * @return null|bool */ public function getIsEmailVerified() @@ -667,23 +777,9 @@ public function getIsEmailVerified() } /** - * @return null|string - */ - public function getExternalId() - { - if (is_null($this->externalId)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_EXTERNAL_ID); - if (is_null($data)) { - return null; - } - $this->externalId = (string) $data; - } - - return $this->externalId; - } - - /** + *

    CustomerGroup to which the Customer belongs.

    + * + * * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -702,6 +798,9 @@ public function getCustomerGroup() } /** + *

    Custom Fields for the Customer.

    + * + * * @return null|CustomFields */ public function getCustom() @@ -720,6 +819,9 @@ public function getCustom() } /** + *

    Preferred language of the Customer.

    + * + * * @return null|string */ public function getLocale() @@ -737,6 +839,9 @@ public function getLocale() } /** + *

    Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.

    + * + * * @return null|string */ public function getSalutation() @@ -754,28 +859,12 @@ public function getSalutation() } /** - *

    User-defined unique identifier of the Customer.

    + *

    Stores to which the Customer is assigned to.

    + * * - * @return null|string - */ - public function getKey() - { - if (is_null($this->key)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_KEY); - if (is_null($data)) { - return null; - } - $this->key = (string) $data; - } - - return $this->key; - } - - /** - *

    References to the stores the customer account is associated with. - * If no stores are specified, the customer is a global customer, and can log in using the Password Flow for global Customers. - * If one or more stores are specified, the customer can only log in using the Password Flow for Customers in a Store for those specific stores.

    * * @return null|StoreKeyReferenceCollection */ @@ -794,7 +883,8 @@ public function getStores() } /** - *

    Defines whether a Customer has a password.

    + *

    Indicates whether the password is required for the Customer.

    + * * * @return null|string */ @@ -845,6 +935,30 @@ public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void $this->lastModifiedAt = $lastModifiedAt; } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + + /** + * @param ?string $customerNumber + */ + public function setCustomerNumber(?string $customerNumber): void + { + $this->customerNumber = $customerNumber; + } + + /** + * @param ?string $externalId + */ + public function setExternalId(?string $externalId): void + { + $this->externalId = $externalId; + } + /** * @param ?LastModifiedBy $lastModifiedBy */ @@ -861,14 +975,6 @@ public function setCreatedBy(?CreatedBy $createdBy): void $this->createdBy = $createdBy; } - /** - * @param ?string $customerNumber - */ - public function setCustomerNumber(?string $customerNumber): void - { - $this->customerNumber = $customerNumber; - } - /** * @param ?string $email */ @@ -989,14 +1095,6 @@ public function setIsEmailVerified(?bool $isEmailVerified): void $this->isEmailVerified = $isEmailVerified; } - /** - * @param ?string $externalId - */ - public function setExternalId(?string $externalId): void - { - $this->externalId = $externalId; - } - /** * @param ?CustomerGroupReference $customerGroup */ @@ -1029,14 +1127,6 @@ public function setSalutation(?string $salutation): void $this->salutation = $salutation; } - /** - * @param ?string $key - */ - public function setKey(?string $key): void - { - $this->key = $key; - } - /** * @param ?StoreKeyReferenceCollection $stores */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerPagedQueryResponse.php b/lib/commercetools-api/src/Models/Customer/CustomerPagedQueryResponse.php index 596d54fb6ee..1f48cf3d876 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerPagedQueryResponse.php @@ -14,36 +14,51 @@ interface CustomerPagedQueryResponse extends JsonObject { public const FIELD_LIMIT = 'limit'; + public const FIELD_OFFSET = 'offset'; public const FIELD_COUNT = 'count'; public const FIELD_TOTAL = 'total'; - public const FIELD_OFFSET = 'offset'; public const FIELD_RESULTS = 'results'; /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); /** + *

    Number of elements skipped.

    + * + * @return null|int */ - public function getCount(); + public function getOffset(); /** + *

    Actual number of results returned.

    + * + * @return null|int */ - public function getTotal(); + public function getCount(); /** - *

    Number of elements skipped.

    + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ - public function getOffset(); + public function getTotal(); /** + *

    Customers matching the query.

    + * + * @return null|CustomerCollection */ public function getResults(); @@ -53,6 +68,11 @@ public function getResults(); */ public function setLimit(?int $limit): void; + /** + * @param ?int $offset + */ + public function setOffset(?int $offset): void; + /** * @param ?int $count */ @@ -63,11 +83,6 @@ public function setCount(?int $count): void; */ public function setTotal(?int $total): void; - /** - * @param ?int $offset - */ - public function setOffset(?int $offset): void; - /** * @param ?CustomerCollection $results */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerPagedQueryResponseBuilder.php index 76edcf67782..8d9dff7a033 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class CustomerPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ - private $count; + private $offset; /** + * @var ?int */ - private $total; + private $count; /** + * @var ?int */ - private $offset; + private $total; /** + * @var ?CustomerCollection */ private $results; @@ -48,6 +53,7 @@ final class CustomerPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -56,32 +62,46 @@ public function getLimit() } /** + *

    Number of elements skipped.

    + * + * @return null|int */ - public function getCount() + public function getOffset() { - return $this->count; + return $this->offset; } /** + *

    Actual number of results returned.

    + * + * @return null|int */ - public function getTotal() + public function getCount() { - return $this->total; + return $this->count; } /** - *

    Number of elements skipped.

    + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ - public function getOffset() + public function getTotal() { - return $this->offset; + return $this->total; } /** + *

    Customers matching the query.

    + * + * @return null|CustomerCollection */ public function getResults() @@ -101,34 +121,34 @@ public function withLimit(?int $limit) } /** - * @param ?int $count + * @param ?int $offset * @return $this */ - public function withCount(?int $count) + public function withOffset(?int $offset) { - $this->count = $count; + $this->offset = $offset; return $this; } /** - * @param ?int $total + * @param ?int $count * @return $this */ - public function withTotal(?int $total) + public function withCount(?int $count) { - $this->total = $total; + $this->count = $count; return $this; } /** - * @param ?int $offset + * @param ?int $total * @return $this */ - public function withOffset(?int $offset) + public function withTotal(?int $total) { - $this->offset = $offset; + $this->total = $total; return $this; } @@ -149,9 +169,9 @@ public function build(): CustomerPagedQueryResponse { return new CustomerPagedQueryResponseModel( $this->limit, + $this->offset, $this->count, $this->total, - $this->offset, $this->results ); } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Customer/CustomerPagedQueryResponseModel.php index 817c184bd80..2c482d7949a 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class CustomerPagedQueryResponseModel extends JsonObjectModel implements CustomerPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ - protected $count; + protected $offset; /** + * * @var ?int */ - protected $total; + protected $count; /** + * * @var ?int */ - protected $offset; + protected $total; /** + * * @var ?CustomerCollection */ protected $results; @@ -50,21 +55,22 @@ final class CustomerPagedQueryResponseModel extends JsonObjectModel implements C */ public function __construct( ?int $limit = null, + ?int $offset = null, ?int $count = null, ?int $total = null, - ?int $offset = null, ?CustomerCollection $results = null ) { $this->limit = $limit; + $this->offset = $offset; $this->count = $count; $this->total = $total; - $this->offset = $offset; $this->results = $results; } /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -82,59 +88,73 @@ public function getLimit() } /** + *

    Number of elements skipped.

    + * + * * @return null|int */ - public function getCount() + public function getOffset() { - if (is_null($this->count)) { + if (is_null($this->offset)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_COUNT); + $data = $this->raw(self::FIELD_OFFSET); if (is_null($data)) { return null; } - $this->count = (int) $data; + $this->offset = (int) $data; } - return $this->count; + return $this->offset; } /** + *

    Actual number of results returned.

    + * + * * @return null|int */ - public function getTotal() + public function getCount() { - if (is_null($this->total)) { + if (is_null($this->count)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_TOTAL); + $data = $this->raw(self::FIELD_COUNT); if (is_null($data)) { return null; } - $this->total = (int) $data; + $this->count = (int) $data; } - return $this->total; + return $this->count; } /** - *

    Number of elements skipped.

    + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    + * * * @return null|int */ - public function getOffset() + public function getTotal() { - if (is_null($this->offset)) { + if (is_null($this->total)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_OFFSET); + $data = $this->raw(self::FIELD_TOTAL); if (is_null($data)) { return null; } - $this->offset = (int) $data; + $this->total = (int) $data; } - return $this->offset; + return $this->total; } /** + *

    Customers matching the query.

    + * + * * @return null|CustomerCollection */ public function getResults() @@ -160,6 +180,14 @@ public function setLimit(?int $limit): void $this->limit = $limit; } + /** + * @param ?int $offset + */ + public function setOffset(?int $offset): void + { + $this->offset = $offset; + } + /** * @param ?int $count */ @@ -176,14 +204,6 @@ public function setTotal(?int $total): void $this->total = $total; } - /** - * @param ?int $offset - */ - public function setOffset(?int $offset): void - { - $this->offset = $offset; - } - /** * @param ?CustomerCollection $results */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerReference.php b/lib/commercetools-api/src/Models/Customer/CustomerReference.php index 91aab4fdd13..be7317c4ca5 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerReference.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerReference.php @@ -17,8 +17,9 @@ interface CustomerReference extends Reference public const FIELD_OBJ = 'obj'; /** - *

    Contains the representation of the expanded Customer. Only present in responses to requests with Reference Expansion for Customers.

    + *

    Contains the representation of the expanded Customer. Only present in responses to requests with Reference Expansion for Customers.

    * + * @return null|Customer */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

    Unique identifier of the referenced Customer.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerReferenceBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerReferenceBuilder.php index 77386840997..78217bf5889 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerReferenceBuilder.php @@ -23,11 +23,13 @@ final class CustomerReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|Customer|CustomerBuilder */ private $obj; @@ -35,6 +37,7 @@ final class CustomerReferenceBuilder implements Builder /** *

    Unique identifier of the referenced Customer.

    * + * @return null|string */ public function getId() @@ -43,8 +46,9 @@ public function getId() } /** - *

    Contains the representation of the expanded Customer. Only present in responses to requests with Reference Expansion for Customers.

    + *

    Contains the representation of the expanded Customer. Only present in responses to requests with Reference Expansion for Customers.

    * + * @return null|Customer */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerReferenceModel.php b/lib/commercetools-api/src/Models/Customer/CustomerReferenceModel.php index 1792be5640c..35fcfec6b49 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerReferenceModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerReferenceModel.php @@ -23,16 +23,19 @@ final class CustomerReferenceModel extends JsonObjectModel implements CustomerRe { public const DISCRIMINATOR_VALUE = 'customer'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?Customer */ protected $obj; @@ -43,16 +46,18 @@ final class CustomerReferenceModel extends JsonObjectModel implements CustomerRe */ public function __construct( ?string $id = null, - ?Customer $obj = null + ?Customer $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced Customer.

    * + * * @return null|string */ public function getId() @@ -89,7 +95,8 @@ public function getId() } /** - *

    Contains the representation of the expanded Customer. Only present in responses to requests with Reference Expansion for Customers.

    + *

    Contains the representation of the expanded Customer. Only present in responses to requests with Reference Expansion for Customers.

    + * * * @return null|Customer */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerRemoveAddressAction.php b/lib/commercetools-api/src/Models/Customer/CustomerRemoveAddressAction.php index 34772ffc81d..ea1902c199d 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerRemoveAddressAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerRemoveAddressAction.php @@ -17,11 +17,17 @@ interface CustomerRemoveAddressAction extends CustomerUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** + *

    id of the Address to remove.

    + * + * @return null|string */ public function getAddressId(); /** + *

    key of the Address to remove.

    + * + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerRemoveAddressActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerRemoveAddressActionBuilder.php index ba14c18494f..494172c4628 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerRemoveAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerRemoveAddressActionBuilder.php @@ -21,16 +21,21 @@ final class CustomerRemoveAddressActionBuilder implements Builder { /** + * @var ?string */ private $addressId; /** + * @var ?string */ private $addressKey; /** + *

    id of the Address to remove.

    + * + * @return null|string */ public function getAddressId() @@ -39,6 +44,9 @@ public function getAddressId() } /** + *

    key of the Address to remove.

    + * + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerRemoveAddressActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerRemoveAddressActionModel.php index 421fd11b04a..b3724cc9148 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerRemoveAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerRemoveAddressActionModel.php @@ -21,16 +21,19 @@ final class CustomerRemoveAddressActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'removeAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressId; /** + * * @var ?string */ protected $addressKey; @@ -41,14 +44,16 @@ final class CustomerRemoveAddressActionModel extends JsonObjectModel implements */ public function __construct( ?string $addressId = null, - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressId = $addressId; $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,9 @@ public function getAction() } /** + *

    id of the Address to remove.

    + * + * * @return null|string */ public function getAddressId() @@ -83,6 +91,9 @@ public function getAddressId() } /** + *

    key of the Address to remove.

    + * + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerRemoveBillingAddressIdAction.php b/lib/commercetools-api/src/Models/Customer/CustomerRemoveBillingAddressIdAction.php index 825b2806208..69804166ecd 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerRemoveBillingAddressIdAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerRemoveBillingAddressIdAction.php @@ -17,11 +17,17 @@ interface CustomerRemoveBillingAddressIdAction extends CustomerUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** + *

    id of the Address to remove from billingAddressesIds.

    + * + * @return null|string */ public function getAddressId(); /** + *

    key of the Address to remove from billingAddressesIds.

    + * + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerRemoveBillingAddressIdActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerRemoveBillingAddressIdActionBuilder.php index 9c638a74542..9446a1634b2 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerRemoveBillingAddressIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerRemoveBillingAddressIdActionBuilder.php @@ -21,16 +21,21 @@ final class CustomerRemoveBillingAddressIdActionBuilder implements Builder { /** + * @var ?string */ private $addressId; /** + * @var ?string */ private $addressKey; /** + *

    id of the Address to remove from billingAddressesIds.

    + * + * @return null|string */ public function getAddressId() @@ -39,6 +44,9 @@ public function getAddressId() } /** + *

    key of the Address to remove from billingAddressesIds.

    + * + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerRemoveBillingAddressIdActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerRemoveBillingAddressIdActionModel.php index c610274e8b2..bb8715063e2 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerRemoveBillingAddressIdActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerRemoveBillingAddressIdActionModel.php @@ -21,16 +21,19 @@ final class CustomerRemoveBillingAddressIdActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'removeBillingAddressId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressId; /** + * * @var ?string */ protected $addressKey; @@ -41,14 +44,16 @@ final class CustomerRemoveBillingAddressIdActionModel extends JsonObjectModel im */ public function __construct( ?string $addressId = null, - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressId = $addressId; $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,9 @@ public function getAction() } /** + *

    id of the Address to remove from billingAddressesIds.

    + * + * * @return null|string */ public function getAddressId() @@ -83,6 +91,9 @@ public function getAddressId() } /** + *

    key of the Address to remove from billingAddressesIds.

    + * + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerRemoveShippingAddressIdAction.php b/lib/commercetools-api/src/Models/Customer/CustomerRemoveShippingAddressIdAction.php index 36baf15748b..2d0a6c0e95d 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerRemoveShippingAddressIdAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerRemoveShippingAddressIdAction.php @@ -17,11 +17,17 @@ interface CustomerRemoveShippingAddressIdAction extends CustomerUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** + *

    id of the Address to remove from shippingAddressesIds.

    + * + * @return null|string */ public function getAddressId(); /** + *

    key of the Address to remove from shippingAddressesIds.

    + * + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerRemoveShippingAddressIdActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerRemoveShippingAddressIdActionBuilder.php index 2236ab14f32..69ab03f2732 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerRemoveShippingAddressIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerRemoveShippingAddressIdActionBuilder.php @@ -21,16 +21,21 @@ final class CustomerRemoveShippingAddressIdActionBuilder implements Builder { /** + * @var ?string */ private $addressId; /** + * @var ?string */ private $addressKey; /** + *

    id of the Address to remove from shippingAddressesIds.

    + * + * @return null|string */ public function getAddressId() @@ -39,6 +44,9 @@ public function getAddressId() } /** + *

    key of the Address to remove from shippingAddressesIds.

    + * + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerRemoveShippingAddressIdActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerRemoveShippingAddressIdActionModel.php index 6a1cf7e63a8..7b7ed01cc32 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerRemoveShippingAddressIdActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerRemoveShippingAddressIdActionModel.php @@ -21,16 +21,19 @@ final class CustomerRemoveShippingAddressIdActionModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'removeShippingAddressId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressId; /** + * * @var ?string */ protected $addressKey; @@ -41,14 +44,16 @@ final class CustomerRemoveShippingAddressIdActionModel extends JsonObjectModel i */ public function __construct( ?string $addressId = null, - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressId = $addressId; $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,9 @@ public function getAction() } /** + *

    id of the Address to remove from shippingAddressesIds.

    + * + * * @return null|string */ public function getAddressId() @@ -83,6 +91,9 @@ public function getAddressId() } /** + *

    key of the Address to remove from shippingAddressesIds.

    + * + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerRemoveStoreAction.php b/lib/commercetools-api/src/Models/Customer/CustomerRemoveStoreAction.php index f4cca033902..138b119fd4c 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerRemoveStoreAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerRemoveStoreAction.php @@ -17,8 +17,9 @@ interface CustomerRemoveStoreAction extends CustomerUpdateAction public const FIELD_STORE = 'store'; /** - *

    ResourceIdentifier to a Store.

    + *

    ResourceIdentifier of the Store to remove.

    * + * @return null|StoreResourceIdentifier */ public function getStore(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerRemoveStoreActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerRemoveStoreActionBuilder.php index 223662ef245..9b046b8a7d7 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerRemoveStoreActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerRemoveStoreActionBuilder.php @@ -23,13 +23,15 @@ final class CustomerRemoveStoreActionBuilder implements Builder { /** + * @var null|StoreResourceIdentifier|StoreResourceIdentifierBuilder */ private $store; /** - *

    ResourceIdentifier to a Store.

    + *

    ResourceIdentifier of the Store to remove.

    * + * @return null|StoreResourceIdentifier */ public function getStore() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerRemoveStoreActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerRemoveStoreActionModel.php index ea00c43a1eb..8f2a8960184 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerRemoveStoreActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerRemoveStoreActionModel.php @@ -23,11 +23,13 @@ final class CustomerRemoveStoreActionModel extends JsonObjectModel implements Cu { public const DISCRIMINATOR_VALUE = 'removeStore'; /** + * * @var ?string */ protected $action; /** + * * @var ?StoreResourceIdentifier */ protected $store; @@ -37,13 +39,15 @@ final class CustomerRemoveStoreActionModel extends JsonObjectModel implements Cu * @psalm-suppress MissingParamType */ public function __construct( - ?StoreResourceIdentifier $store = null + ?StoreResourceIdentifier $store = null, + ?string $action = null ) { $this->store = $store; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,7 +65,8 @@ public function getAction() } /** - *

    ResourceIdentifier to a Store.

    + *

    ResourceIdentifier of the Store to remove.

    + * * * @return null|StoreResourceIdentifier */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerResetPassword.php b/lib/commercetools-api/src/Models/Customer/CustomerResetPassword.php index a515896dc0c..cec7905eab4 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerResetPassword.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerResetPassword.php @@ -18,16 +18,25 @@ interface CustomerResetPassword extends JsonObject public const FIELD_VERSION = 'version'; /** + *

    Value of the token to reset the Customer password.

    + * + * @return null|string */ public function getTokenValue(); /** + *

    New password to be set.

    + * + * @return null|string */ public function getNewPassword(); /** + *

    Expected version of the Customer.

    + * + * @return null|int */ public function getVersion(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerResetPasswordBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerResetPasswordBuilder.php index 6c4836457db..c725ab88c24 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerResetPasswordBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerResetPasswordBuilder.php @@ -21,21 +21,27 @@ final class CustomerResetPasswordBuilder implements Builder { /** + * @var ?string */ private $tokenValue; /** + * @var ?string */ private $newPassword; /** + * @var ?int */ private $version; /** + *

    Value of the token to reset the Customer password.

    + * + * @return null|string */ public function getTokenValue() @@ -44,6 +50,9 @@ public function getTokenValue() } /** + *

    New password to be set.

    + * + * @return null|string */ public function getNewPassword() @@ -52,6 +61,9 @@ public function getNewPassword() } /** + *

    Expected version of the Customer.

    + * + * @return null|int */ public function getVersion() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerResetPasswordModel.php b/lib/commercetools-api/src/Models/Customer/CustomerResetPasswordModel.php index d6eaaa38af4..7a10d9bef15 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerResetPasswordModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerResetPasswordModel.php @@ -20,16 +20,19 @@ final class CustomerResetPasswordModel extends JsonObjectModel implements CustomerResetPassword { /** + * * @var ?string */ protected $tokenValue; /** + * * @var ?string */ protected $newPassword; /** + * * @var ?int */ protected $version; @@ -49,6 +52,9 @@ public function __construct( } /** + *

    Value of the token to reset the Customer password.

    + * + * * @return null|string */ public function getTokenValue() @@ -66,6 +72,9 @@ public function getTokenValue() } /** + *

    New password to be set.

    + * + * * @return null|string */ public function getNewPassword() @@ -83,6 +92,9 @@ public function getNewPassword() } /** + *

    Expected version of the Customer.

    + * + * * @return null|int */ public function getVersion() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerResourceIdentifier.php b/lib/commercetools-api/src/Models/Customer/CustomerResourceIdentifier.php index e3720f49642..444b8857247 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerResourceIdentifier.php @@ -15,15 +15,17 @@ interface CustomerResourceIdentifier extends ResourceIdentifier { /** - *

    Unique identifier of the referenced Customer. Either id or key is required.

    + *

    Unique identifier of the referenced Customer.

    * + * @return null|string */ public function getId(); /** - *

    User-defined unique identifier of the referenced Customer. Either id or key is required.

    + *

    User-defined unique identifier of the referenced Customer.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerResourceIdentifierBuilder.php index 4f9890f6ad0..222aa1eb1fa 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerResourceIdentifierBuilder.php @@ -23,18 +23,21 @@ final class CustomerResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; /** - *

    Unique identifier of the referenced Customer. Either id or key is required.

    + *

    Unique identifier of the referenced Customer.

    * + * @return null|string */ public function getId() @@ -43,8 +46,9 @@ public function getId() } /** - *

    User-defined unique identifier of the referenced Customer. Either id or key is required.

    + *

    User-defined unique identifier of the referenced Customer.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerResourceIdentifierModel.php b/lib/commercetools-api/src/Models/Customer/CustomerResourceIdentifierModel.php index 1cfba7c918a..cb691ed21a5 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class CustomerResourceIdentifierModel extends JsonObjectModel implements C { public const DISCRIMINATOR_VALUE = 'customer'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class CustomerResourceIdentifierModel extends JsonObjectModel implements C */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -70,7 +75,8 @@ public function getTypeId() } /** - *

    Unique identifier of the referenced Customer. Either id or key is required.

    + *

    Unique identifier of the referenced Customer.

    + * * * @return null|string */ @@ -89,7 +95,8 @@ public function getId() } /** - *

    User-defined unique identifier of the referenced Customer. Either id or key is required.

    + *

    User-defined unique identifier of the referenced Customer.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomFieldAction.php index b7556a8621c..6fb29430a69 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomFieldAction.php @@ -18,6 +18,9 @@ interface CustomerSetAddressCustomFieldAction extends CustomerUpdateAction public const FIELD_VALUE = 'value'; /** + *

    User-defined unique identifier of the Address to be updated.

    + * + * @return null|string */ public function getAddressId(); @@ -25,15 +28,17 @@ public function getAddressId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); /** *

    If value is absent or null, this field will be removed if it exists. - * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomFieldActionBuilder.php index 5f2f61cf3fd..c56d0e2602a 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomFieldActionBuilder.php @@ -21,21 +21,27 @@ final class CustomerSetAddressCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $addressId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + *

    User-defined unique identifier of the Address to be updated.

    + * + * @return null|string */ public function getAddressId() @@ -46,6 +52,7 @@ public function getAddressId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -55,9 +62,10 @@ public function getName() /** *

    If value is absent or null, this field will be removed if it exists. - * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomFieldActionModel.php index 61c6cda5be5..14119650c88 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class CustomerSetAddressCustomFieldActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'setAddressCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class CustomerSetAddressCustomFieldActionModel extends JsonObjectModel imp public function __construct( ?string $addressId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->addressId = $addressId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,9 @@ public function getAction() } /** + *

    User-defined unique identifier of the Address to be updated.

    + * + * * @return null|string */ public function getAddressId() @@ -92,6 +101,7 @@ public function getAddressId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -110,9 +120,10 @@ public function getName() /** *

    If value is absent or null, this field will be removed if it exists. - * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomTypeAction.php index 3ab0ce552af..f2c2c98e891 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomTypeAction.php @@ -15,14 +15,23 @@ interface CustomerSetAddressCustomTypeAction extends CustomerUpdateAction { + public const FIELD_ADDRESS_ID = 'addressId'; public const FIELD_TYPE = 'type'; public const FIELD_FIELDS = 'fields'; - public const FIELD_ADDRESS_ID = 'addressId'; + + /** + *

    User-defined unique identifier of the Address to be updated.

    + * + + * @return null|string + */ + public function getAddressId(); /** *

    Defines the Type that extends the address with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the address.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -30,14 +39,15 @@ public function getType(); /** *

    Sets the Custom Fields fields for the address.

    * + * @return null|FieldContainer */ public function getFields(); /** - * @return null|string + * @param ?string $addressId */ - public function getAddressId(); + public function setAddressId(?string $addressId): void; /** * @param ?TypeResourceIdentifier $type @@ -48,9 +58,4 @@ public function setType(?TypeResourceIdentifier $type): void; * @param ?FieldContainer $fields */ public function setFields(?FieldContainer $fields): void; - - /** - * @param ?string $addressId - */ - public function setAddressId(?string $addressId): void; } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomTypeActionBuilder.php index c2514cb0d58..b42f67f768b 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomTypeActionBuilder.php @@ -25,24 +25,39 @@ final class CustomerSetAddressCustomTypeActionBuilder implements Builder { /** + + * @var ?string + */ + private $addressId; + + /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** - * @var ?string + *

    User-defined unique identifier of the Address to be updated.

    + * + + * @return null|string */ - private $addressId; + public function getAddressId() + { + return $this->addressId; + } /** *

    Defines the Type that extends the address with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the address.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -53,6 +68,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the address.

    * + * @return null|FieldContainer */ public function getFields() @@ -61,11 +77,14 @@ public function getFields() } /** - * @return null|string + * @param ?string $addressId + * @return $this */ - public function getAddressId() + public function withAddressId(?string $addressId) { - return $this->addressId; + $this->addressId = $addressId; + + return $this; } /** @@ -90,17 +109,6 @@ public function withFields(?FieldContainer $fields) return $this; } - /** - * @param ?string $addressId - * @return $this - */ - public function withAddressId(?string $addressId) - { - $this->addressId = $addressId; - - return $this; - } - /** * @deprecated use withType() instead * @return $this @@ -126,9 +134,9 @@ public function withFieldsBuilder(?FieldContainerBuilder $fields) public function build(): CustomerSetAddressCustomTypeAction { return new CustomerSetAddressCustomTypeActionModel( + $this->addressId, $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type, - $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields, - $this->addressId + $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields ); } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomTypeActionModel.php index 488110cf3c9..e9dfed9515c 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetAddressCustomTypeActionModel.php @@ -25,41 +25,47 @@ final class CustomerSetAddressCustomTypeActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setAddressCustomType'; /** + * * @var ?string */ protected $action; /** + * + * @var ?string + */ + protected $addressId; + + /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; - /** - * @var ?string - */ - protected $addressId; - /** * @psalm-suppress MissingParamType */ public function __construct( + ?string $addressId = null, ?TypeResourceIdentifier $type = null, ?FieldContainer $fields = null, - ?string $addressId = null + ?string $action = null ) { + $this->addressId = $addressId; $this->type = $type; $this->fields = $fields; - $this->addressId = $addressId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -76,10 +82,31 @@ public function getAction() return $this->action; } + /** + *

    User-defined unique identifier of the Address to be updated.

    + * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + /** *

    Defines the Type that extends the address with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the address.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -100,6 +127,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the address.

    * + * * @return null|FieldContainer */ public function getFields() @@ -117,24 +145,15 @@ public function getFields() return $this->fields; } + /** - * @return null|string + * @param ?string $addressId */ - public function getAddressId() + public function setAddressId(?string $addressId): void { - if (is_null($this->addressId)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_ADDRESS_ID); - if (is_null($data)) { - return null; - } - $this->addressId = (string) $data; - } - - return $this->addressId; + $this->addressId = $addressId; } - /** * @param ?TypeResourceIdentifier $type */ @@ -150,12 +169,4 @@ public function setFields(?FieldContainer $fields): void { $this->fields = $fields; } - - /** - * @param ?string $addressId - */ - public function setAddressId(?string $addressId): void - { - $this->addressId = $addressId; - } } diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetAuthenticationModeAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetAuthenticationModeAction.php index e6de40fa07f..f91be2f7fdf 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetAuthenticationModeAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetAuthenticationModeAction.php @@ -17,13 +17,18 @@ interface CustomerSetAuthenticationModeAction extends CustomerUpdateAction public const FIELD_PASSWORD = 'password'; /** + *

    Value to set. + * Changing a Customer's authMode from Password to ExternalAuth deletes the Customer's password.

    + * + * @return null|string */ public function getAuthMode(); /** - *

    Required when authMode is Password

    + *

    Required when authMode is Password.

    * + * @return null|string */ public function getPassword(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetAuthenticationModeActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetAuthenticationModeActionBuilder.php index 62c1be07427..752a9e6dd77 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetAuthenticationModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetAuthenticationModeActionBuilder.php @@ -21,16 +21,22 @@ final class CustomerSetAuthenticationModeActionBuilder implements Builder { /** + * @var ?string */ private $authMode; /** + * @var ?string */ private $password; /** + *

    Value to set. + * Changing a Customer's authMode from Password to ExternalAuth deletes the Customer's password.

    + * + * @return null|string */ public function getAuthMode() @@ -39,8 +45,9 @@ public function getAuthMode() } /** - *

    Required when authMode is Password

    + *

    Required when authMode is Password.

    * + * @return null|string */ public function getPassword() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetAuthenticationModeActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetAuthenticationModeActionModel.php index 8f83b58c935..d71436cdd1c 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetAuthenticationModeActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetAuthenticationModeActionModel.php @@ -21,16 +21,19 @@ final class CustomerSetAuthenticationModeActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'setAuthenticationMode'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $authMode; /** + * * @var ?string */ protected $password; @@ -41,14 +44,16 @@ final class CustomerSetAuthenticationModeActionModel extends JsonObjectModel imp */ public function __construct( ?string $authMode = null, - ?string $password = null + ?string $password = null, + ?string $action = null ) { $this->authMode = $authMode; $this->password = $password; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,10 @@ public function getAction() } /** + *

    Value to set. + * Changing a Customer's authMode from Password to ExternalAuth deletes the Customer's password.

    + * + * * @return null|string */ public function getAuthMode() @@ -83,7 +92,8 @@ public function getAuthMode() } /** - *

    Required when authMode is Password

    + *

    Required when authMode is Password.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCompanyNameAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCompanyNameAction.php index 90bc5b77138..d5785e86e95 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetCompanyNameAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCompanyNameAction.php @@ -16,8 +16,10 @@ interface CustomerSetCompanyNameAction extends CustomerUpdateAction public const FIELD_COMPANY_NAME = 'companyName'; /** - *

    If not defined, the company name is unset.

    + *

    Value to set. + * If empty, any existing value is removed.

    * + * @return null|string */ public function getCompanyName(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCompanyNameActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCompanyNameActionBuilder.php index 13247dae092..b934c6a5d93 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetCompanyNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCompanyNameActionBuilder.php @@ -21,13 +21,16 @@ final class CustomerSetCompanyNameActionBuilder implements Builder { /** + * @var ?string */ private $companyName; /** - *

    If not defined, the company name is unset.

    + *

    Value to set. + * If empty, any existing value is removed.

    * + * @return null|string */ public function getCompanyName() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCompanyNameActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCompanyNameActionModel.php index c22287a47da..eeb13215f4d 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetCompanyNameActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCompanyNameActionModel.php @@ -21,11 +21,13 @@ final class CustomerSetCompanyNameActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setCompanyName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $companyName; @@ -35,13 +37,15 @@ final class CustomerSetCompanyNameActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $companyName = null + ?string $companyName = null, + ?string $action = null ) { $this->companyName = $companyName; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,7 +63,9 @@ public function getAction() } /** - *

    If not defined, the company name is unset.

    + *

    Value to set. + * If empty, any existing value is removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomFieldAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomFieldAction.php index 0ef39642e17..661f4c80183 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomFieldAction.php @@ -19,15 +19,17 @@ interface CustomerSetCustomFieldAction extends CustomerUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); /** *

    If value is absent or null, this field will be removed if it exists. - * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomFieldActionBuilder.php index cbd6fb9070c..89c2b908552 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class CustomerSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class CustomerSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -42,9 +45,10 @@ public function getName() /** *

    If value is absent or null, this field will be removed if it exists. - * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomFieldActionModel.php index d0dd8a3e1f0..4c5b4fa5e74 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class CustomerSetCustomFieldActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class CustomerSetCustomFieldActionModel extends JsonObjectModel implements */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -86,9 +92,10 @@ public function getName() /** *

    If value is absent or null, this field will be removed if it exists. - * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomTypeAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomTypeAction.php index 154b8e14b68..31e49f07f02 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface CustomerSetCustomTypeAction extends CustomerUpdateAction *

    Defines the Type that extends the Customer with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Customer.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the Customer.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomTypeActionBuilder.php index dd28edbb919..2d823489f49 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class CustomerSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class CustomerSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the Customer with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Customer.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Customer.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomTypeActionModel.php index 831f0789a4c..93937b869c3 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class CustomerSetCustomTypeActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class CustomerSetCustomTypeActionModel extends JsonObjectModel implements */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the Customer with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Customer.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Customer.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupAction.php index 0e9ac416cad..739bba9d02b 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupAction.php @@ -17,8 +17,10 @@ interface CustomerSetCustomerGroupAction extends CustomerUpdateAction public const FIELD_CUSTOMER_GROUP = 'customerGroup'; /** - *

    If not defined, the customer group is unset.

    + *

    Value to set. + * If empty, any existing value is removed.

    * + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupActionBuilder.php index 051fcdbc99f..3082dd7c93c 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupActionBuilder.php @@ -23,13 +23,16 @@ final class CustomerSetCustomerGroupActionBuilder implements Builder { /** + * @var null|CustomerGroupResourceIdentifier|CustomerGroupResourceIdentifierBuilder */ private $customerGroup; /** - *

    If not defined, the customer group is unset.

    + *

    Value to set. + * If empty, any existing value is removed.

    * + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupActionModel.php index 181a599e523..ce116dfe671 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerGroupActionModel.php @@ -23,11 +23,13 @@ final class CustomerSetCustomerGroupActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'setCustomerGroup'; /** + * * @var ?string */ protected $action; /** + * * @var ?CustomerGroupResourceIdentifier */ protected $customerGroup; @@ -37,13 +39,15 @@ final class CustomerSetCustomerGroupActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?CustomerGroupResourceIdentifier $customerGroup = null + ?CustomerGroupResourceIdentifier $customerGroup = null, + ?string $action = null ) { $this->customerGroup = $customerGroup; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,7 +65,9 @@ public function getAction() } /** - *

    If not defined, the customer group is unset.

    + *

    Value to set. + * If empty, any existing value is removed.

    + * * * @return null|CustomerGroupResourceIdentifier */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerNumberAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerNumberAction.php index bba93533c64..688feaf4348 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerNumberAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerNumberAction.php @@ -16,9 +16,10 @@ interface CustomerSetCustomerNumberAction extends CustomerUpdateAction public const FIELD_CUSTOMER_NUMBER = 'customerNumber'; /** - *

    It should be unique across a project. - * Once it's set, it cannot be changed.

    + *

    Value to set. + * Once set, it cannot be changed.

    * + * @return null|string */ public function getCustomerNumber(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerNumberActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerNumberActionBuilder.php index c80a7d8a62b..06e38bd8128 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerNumberActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerNumberActionBuilder.php @@ -21,14 +21,16 @@ final class CustomerSetCustomerNumberActionBuilder implements Builder { /** + * @var ?string */ private $customerNumber; /** - *

    It should be unique across a project. - * Once it's set, it cannot be changed.

    + *

    Value to set. + * Once set, it cannot be changed.

    * + * @return null|string */ public function getCustomerNumber() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerNumberActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerNumberActionModel.php index a4e94898c3d..bd42ca36dd4 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerNumberActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetCustomerNumberActionModel.php @@ -21,11 +21,13 @@ final class CustomerSetCustomerNumberActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setCustomerNumber'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customerNumber; @@ -35,13 +37,15 @@ final class CustomerSetCustomerNumberActionModel extends JsonObjectModel impleme * @psalm-suppress MissingParamType */ public function __construct( - ?string $customerNumber = null + ?string $customerNumber = null, + ?string $action = null ) { $this->customerNumber = $customerNumber; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,8 +63,9 @@ public function getAction() } /** - *

    It should be unique across a project. - * Once it's set, it cannot be changed.

    + *

    Value to set. + * Once set, it cannot be changed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetDateOfBirthAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetDateOfBirthAction.php index 8793bc57cda..1cf00d6f9b0 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetDateOfBirthAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetDateOfBirthAction.php @@ -17,8 +17,10 @@ interface CustomerSetDateOfBirthAction extends CustomerUpdateAction public const FIELD_DATE_OF_BIRTH = 'dateOfBirth'; /** - *

    If not defined, the date of birth is unset.

    + *

    Value to set. + * If empty, any existing value is removed.

    * + * @return null|DateTimeImmutable */ public function getDateOfBirth(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetDateOfBirthActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetDateOfBirthActionBuilder.php index 133b326bd9d..e066fd97ec0 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetDateOfBirthActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetDateOfBirthActionBuilder.php @@ -22,13 +22,16 @@ final class CustomerSetDateOfBirthActionBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $dateOfBirth; /** - *

    If not defined, the date of birth is unset.

    + *

    Value to set. + * If empty, any existing value is removed.

    * + * @return null|DateTimeImmutable */ public function getDateOfBirth() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetDateOfBirthActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetDateOfBirthActionModel.php index 8ca9027515f..5f1368c42df 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetDateOfBirthActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetDateOfBirthActionModel.php @@ -22,11 +22,13 @@ final class CustomerSetDateOfBirthActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setDateOfBirth'; /** + * * @var ?string */ protected $action; /** + * * @var ?DateTimeImmutable */ protected $dateOfBirth; @@ -36,13 +38,15 @@ final class CustomerSetDateOfBirthActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutable $dateOfBirth = null + ?DateTimeImmutable $dateOfBirth = null, + ?string $action = null ) { $this->dateOfBirth = $dateOfBirth; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -60,7 +64,9 @@ public function getAction() } /** - *

    If not defined, the date of birth is unset.

    + *

    Value to set. + * If empty, any existing value is removed.

    + * * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultBillingAddressAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultBillingAddressAction.php index 317398402ee..8384b900467 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultBillingAddressAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultBillingAddressAction.php @@ -17,13 +17,17 @@ interface CustomerSetDefaultBillingAddressAction extends CustomerUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** - *

    If not defined, the customer's defaultBillingAddress is unset.

    + *

    id of the Address to become the default billing address.

    * + * @return null|string */ public function getAddressId(); /** + *

    key of the Address to become the default billing address.

    + * + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultBillingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultBillingAddressActionBuilder.php index 78c611ee85b..8e85826029e 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultBillingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultBillingAddressActionBuilder.php @@ -21,18 +21,21 @@ final class CustomerSetDefaultBillingAddressActionBuilder implements Builder { /** + * @var ?string */ private $addressId; /** + * @var ?string */ private $addressKey; /** - *

    If not defined, the customer's defaultBillingAddress is unset.

    + *

    id of the Address to become the default billing address.

    * + * @return null|string */ public function getAddressId() @@ -41,6 +44,9 @@ public function getAddressId() } /** + *

    key of the Address to become the default billing address.

    + * + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultBillingAddressActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultBillingAddressActionModel.php index ec0a63f03cc..d7e0f532eb3 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultBillingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultBillingAddressActionModel.php @@ -21,16 +21,19 @@ final class CustomerSetDefaultBillingAddressActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setDefaultBillingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressId; /** + * * @var ?string */ protected $addressKey; @@ -41,14 +44,16 @@ final class CustomerSetDefaultBillingAddressActionModel extends JsonObjectModel */ public function __construct( ?string $addressId = null, - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressId = $addressId; $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,7 +71,8 @@ public function getAction() } /** - *

    If not defined, the customer's defaultBillingAddress is unset.

    + *

    id of the Address to become the default billing address.

    + * * * @return null|string */ @@ -85,6 +91,9 @@ public function getAddressId() } /** + *

    key of the Address to become the default billing address.

    + * + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultShippingAddressAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultShippingAddressAction.php index 9f0cbfc594a..3eee376141c 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultShippingAddressAction.php @@ -17,13 +17,17 @@ interface CustomerSetDefaultShippingAddressAction extends CustomerUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** - *

    If not defined, the customer's defaultShippingAddress is unset.

    + *

    id of the Address to become the default shipping address.

    * + * @return null|string */ public function getAddressId(); /** + *

    key of the Address to become the default shipping address.

    + * + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultShippingAddressActionBuilder.php index 3b22df0d607..4cc1e4c66e0 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultShippingAddressActionBuilder.php @@ -21,18 +21,21 @@ final class CustomerSetDefaultShippingAddressActionBuilder implements Builder { /** + * @var ?string */ private $addressId; /** + * @var ?string */ private $addressKey; /** - *

    If not defined, the customer's defaultShippingAddress is unset.

    + *

    id of the Address to become the default shipping address.

    * + * @return null|string */ public function getAddressId() @@ -41,6 +44,9 @@ public function getAddressId() } /** + *

    key of the Address to become the default shipping address.

    + * + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultShippingAddressActionModel.php index ec6ae88c30b..ae6c1938b67 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetDefaultShippingAddressActionModel.php @@ -21,16 +21,19 @@ final class CustomerSetDefaultShippingAddressActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setDefaultShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressId; /** + * * @var ?string */ protected $addressKey; @@ -41,14 +44,16 @@ final class CustomerSetDefaultShippingAddressActionModel extends JsonObjectModel */ public function __construct( ?string $addressId = null, - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressId = $addressId; $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,7 +71,8 @@ public function getAction() } /** - *

    If not defined, the customer's defaultShippingAddress is unset.

    + *

    id of the Address to become the default shipping address.

    + * * * @return null|string */ @@ -85,6 +91,9 @@ public function getAddressId() } /** + *

    key of the Address to become the default shipping address.

    + * + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetExternalIdAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetExternalIdAction.php index 1a9172e37c3..a4be428ce9b 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetExternalIdAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetExternalIdAction.php @@ -16,8 +16,10 @@ interface CustomerSetExternalIdAction extends CustomerUpdateAction public const FIELD_EXTERNAL_ID = 'externalId'; /** - *

    If not defined, the external ID is unset.

    + *

    Value to set. + * If empty, any existing value is removed.

    * + * @return null|string */ public function getExternalId(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetExternalIdActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetExternalIdActionBuilder.php index 812403f66b0..e4994ef8b70 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetExternalIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetExternalIdActionBuilder.php @@ -21,13 +21,16 @@ final class CustomerSetExternalIdActionBuilder implements Builder { /** + * @var ?string */ private $externalId; /** - *

    If not defined, the external ID is unset.

    + *

    Value to set. + * If empty, any existing value is removed.

    * + * @return null|string */ public function getExternalId() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetExternalIdActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetExternalIdActionModel.php index 32f601c8e44..4f6701f0f0b 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetExternalIdActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetExternalIdActionModel.php @@ -21,11 +21,13 @@ final class CustomerSetExternalIdActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setExternalId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $externalId; @@ -35,13 +37,15 @@ final class CustomerSetExternalIdActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $externalId = null + ?string $externalId = null, + ?string $action = null ) { $this->externalId = $externalId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,7 +63,9 @@ public function getAction() } /** - *

    If not defined, the external ID is unset.

    + *

    Value to set. + * If empty, any existing value is removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetFirstNameAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetFirstNameAction.php index 35aad70ba0d..db29895d56c 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetFirstNameAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetFirstNameAction.php @@ -16,6 +16,9 @@ interface CustomerSetFirstNameAction extends CustomerUpdateAction public const FIELD_FIRST_NAME = 'firstName'; /** + *

    Value to set. If empty, any existing value is removed.

    + * + * @return null|string */ public function getFirstName(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetFirstNameActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetFirstNameActionBuilder.php index 448e3bb7acb..2e91106e198 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetFirstNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetFirstNameActionBuilder.php @@ -21,11 +21,15 @@ final class CustomerSetFirstNameActionBuilder implements Builder { /** + * @var ?string */ private $firstName; /** + *

    Value to set. If empty, any existing value is removed.

    + * + * @return null|string */ public function getFirstName() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetFirstNameActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetFirstNameActionModel.php index 914b01cc573..069b8836167 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetFirstNameActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetFirstNameActionModel.php @@ -21,11 +21,13 @@ final class CustomerSetFirstNameActionModel extends JsonObjectModel implements C { public const DISCRIMINATOR_VALUE = 'setFirstName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $firstName; @@ -35,13 +37,15 @@ final class CustomerSetFirstNameActionModel extends JsonObjectModel implements C * @psalm-suppress MissingParamType */ public function __construct( - ?string $firstName = null + ?string $firstName = null, + ?string $action = null ) { $this->firstName = $firstName; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,9 @@ public function getAction() } /** + *

    Value to set. If empty, any existing value is removed.

    + * + * * @return null|string */ public function getFirstName() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetKeyAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetKeyAction.php index 73428c2da66..2d634856adb 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetKeyAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetKeyAction.php @@ -16,8 +16,9 @@ interface CustomerSetKeyAction extends CustomerUpdateAction public const FIELD_KEY = 'key'; /** - *

    If key is absent or null, this field will be removed if it exists.

    + *

    If key is absent or null, the existing key, if any, will be removed.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetKeyActionBuilder.php index 67de42a140c..a90cf62ac53 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetKeyActionBuilder.php @@ -21,13 +21,15 @@ final class CustomerSetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; /** - *

    If key is absent or null, this field will be removed if it exists.

    + *

    If key is absent or null, the existing key, if any, will be removed.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetKeyActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetKeyActionModel.php index 0fa9f482e2e..2366aa949ab 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetKeyActionModel.php @@ -21,11 +21,13 @@ final class CustomerSetKeyActionModel extends JsonObjectModel implements Custome { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class CustomerSetKeyActionModel extends JsonObjectModel implements Custome * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,7 +63,8 @@ public function getAction() } /** - *

    If key is absent or null, this field will be removed if it exists.

    + *

    If key is absent or null, the existing key, if any, will be removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetLastNameAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetLastNameAction.php index af77c336c89..a0055df2952 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetLastNameAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetLastNameAction.php @@ -16,6 +16,9 @@ interface CustomerSetLastNameAction extends CustomerUpdateAction public const FIELD_LAST_NAME = 'lastName'; /** + *

    Value to set. If empty, any existing value is removed.

    + * + * @return null|string */ public function getLastName(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetLastNameActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetLastNameActionBuilder.php index 0e7f6359b01..cbd56296a0f 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetLastNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetLastNameActionBuilder.php @@ -21,11 +21,15 @@ final class CustomerSetLastNameActionBuilder implements Builder { /** + * @var ?string */ private $lastName; /** + *

    Value to set. If empty, any existing value is removed.

    + * + * @return null|string */ public function getLastName() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetLastNameActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetLastNameActionModel.php index 183c65b9f04..57143b390ac 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetLastNameActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetLastNameActionModel.php @@ -21,11 +21,13 @@ final class CustomerSetLastNameActionModel extends JsonObjectModel implements Cu { public const DISCRIMINATOR_VALUE = 'setLastName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lastName; @@ -35,13 +37,15 @@ final class CustomerSetLastNameActionModel extends JsonObjectModel implements Cu * @psalm-suppress MissingParamType */ public function __construct( - ?string $lastName = null + ?string $lastName = null, + ?string $action = null ) { $this->lastName = $lastName; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,9 @@ public function getAction() } /** + *

    Value to set. If empty, any existing value is removed.

    + * + * * @return null|string */ public function getLastName() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetLocaleAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetLocaleAction.php index 2bad8962390..10331d35738 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetLocaleAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetLocaleAction.php @@ -16,6 +16,10 @@ interface CustomerSetLocaleAction extends CustomerUpdateAction public const FIELD_LOCALE = 'locale'; /** + *

    Value to set. + * Must be one of the languages supported by the Project.

    + * + * @return null|string */ public function getLocale(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetLocaleActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetLocaleActionBuilder.php index ae880283646..b737df39416 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetLocaleActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetLocaleActionBuilder.php @@ -21,11 +21,16 @@ final class CustomerSetLocaleActionBuilder implements Builder { /** + * @var ?string */ private $locale; /** + *

    Value to set. + * Must be one of the languages supported by the Project.

    + * + * @return null|string */ public function getLocale() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetLocaleActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetLocaleActionModel.php index 0253816b2ff..c28e3bc86c6 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetLocaleActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetLocaleActionModel.php @@ -21,11 +21,13 @@ final class CustomerSetLocaleActionModel extends JsonObjectModel implements Cust { public const DISCRIMINATOR_VALUE = 'setLocale'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $locale; @@ -35,13 +37,15 @@ final class CustomerSetLocaleActionModel extends JsonObjectModel implements Cust * @psalm-suppress MissingParamType */ public function __construct( - ?string $locale = null + ?string $locale = null, + ?string $action = null ) { $this->locale = $locale; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,10 @@ public function getAction() } /** + *

    Value to set. + * Must be one of the languages supported by the Project.

    + * + * * @return null|string */ public function getLocale() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetMiddleNameAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetMiddleNameAction.php index 4e75eb044ef..4d22f4c8baf 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetMiddleNameAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetMiddleNameAction.php @@ -16,6 +16,9 @@ interface CustomerSetMiddleNameAction extends CustomerUpdateAction public const FIELD_MIDDLE_NAME = 'middleName'; /** + *

    Value to set. If empty, any existing value is removed.

    + * + * @return null|string */ public function getMiddleName(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetMiddleNameActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetMiddleNameActionBuilder.php index b75836c0d0e..bd1f913c7f8 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetMiddleNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetMiddleNameActionBuilder.php @@ -21,11 +21,15 @@ final class CustomerSetMiddleNameActionBuilder implements Builder { /** + * @var ?string */ private $middleName; /** + *

    Value to set. If empty, any existing value is removed.

    + * + * @return null|string */ public function getMiddleName() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetMiddleNameActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetMiddleNameActionModel.php index 7df1400a14d..cb42d0b5c7b 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetMiddleNameActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetMiddleNameActionModel.php @@ -21,11 +21,13 @@ final class CustomerSetMiddleNameActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setMiddleName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $middleName; @@ -35,13 +37,15 @@ final class CustomerSetMiddleNameActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $middleName = null + ?string $middleName = null, + ?string $action = null ) { $this->middleName = $middleName; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,9 @@ public function getAction() } /** + *

    Value to set. If empty, any existing value is removed.

    + * + * * @return null|string */ public function getMiddleName() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetSalutationAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetSalutationAction.php index 2bb5ba0454c..8c17e483ba4 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetSalutationAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetSalutationAction.php @@ -16,6 +16,9 @@ interface CustomerSetSalutationAction extends CustomerUpdateAction public const FIELD_SALUTATION = 'salutation'; /** + *

    Value to set. If empty, any existing value is removed.

    + * + * @return null|string */ public function getSalutation(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetSalutationActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetSalutationActionBuilder.php index 22235b5f86e..42fcf0603a3 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetSalutationActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetSalutationActionBuilder.php @@ -21,11 +21,15 @@ final class CustomerSetSalutationActionBuilder implements Builder { /** + * @var ?string */ private $salutation; /** + *

    Value to set. If empty, any existing value is removed.

    + * + * @return null|string */ public function getSalutation() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetSalutationActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetSalutationActionModel.php index b4ed55d17cf..6cc12120192 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetSalutationActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetSalutationActionModel.php @@ -21,11 +21,13 @@ final class CustomerSetSalutationActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setSalutation'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $salutation; @@ -35,13 +37,15 @@ final class CustomerSetSalutationActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $salutation = null + ?string $salutation = null, + ?string $action = null ) { $this->salutation = $salutation; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,9 @@ public function getAction() } /** + *

    Value to set. If empty, any existing value is removed.

    + * + * * @return null|string */ public function getSalutation() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetStoresAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetStoresAction.php index b305ad24a4f..2abd49fda5a 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetStoresAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetStoresAction.php @@ -17,6 +17,9 @@ interface CustomerSetStoresAction extends CustomerUpdateAction public const FIELD_STORES = 'stores'; /** + *

    ResourceIdentifier of the Stores to set.

    + * + * @return null|StoreResourceIdentifierCollection */ public function getStores(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetStoresActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetStoresActionBuilder.php index 1f7754c24f4..c71935cc2eb 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetStoresActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetStoresActionBuilder.php @@ -22,11 +22,15 @@ final class CustomerSetStoresActionBuilder implements Builder { /** + * @var ?StoreResourceIdentifierCollection */ private $stores; /** + *

    ResourceIdentifier of the Stores to set.

    + * + * @return null|StoreResourceIdentifierCollection */ public function getStores() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetStoresActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetStoresActionModel.php index 27f0f31219a..a203b50702f 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetStoresActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetStoresActionModel.php @@ -22,11 +22,13 @@ final class CustomerSetStoresActionModel extends JsonObjectModel implements Cust { public const DISCRIMINATOR_VALUE = 'setStores'; /** + * * @var ?string */ protected $action; /** + * * @var ?StoreResourceIdentifierCollection */ protected $stores; @@ -36,13 +38,15 @@ final class CustomerSetStoresActionModel extends JsonObjectModel implements Cust * @psalm-suppress MissingParamType */ public function __construct( - ?StoreResourceIdentifierCollection $stores = null + ?StoreResourceIdentifierCollection $stores = null, + ?string $action = null ) { $this->stores = $stores; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -60,6 +64,9 @@ public function getAction() } /** + *

    ResourceIdentifier of the Stores to set.

    + * + * * @return null|StoreResourceIdentifierCollection */ public function getStores() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetTitleAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetTitleAction.php index ccef191d0d9..dec017f9fd1 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetTitleAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetTitleAction.php @@ -16,6 +16,9 @@ interface CustomerSetTitleAction extends CustomerUpdateAction public const FIELD_TITLE = 'title'; /** + *

    Value to set. If empty, any existing value is removed.

    + * + * @return null|string */ public function getTitle(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetTitleActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetTitleActionBuilder.php index d86d92b8833..2c3e0ea9bc7 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetTitleActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetTitleActionBuilder.php @@ -21,11 +21,15 @@ final class CustomerSetTitleActionBuilder implements Builder { /** + * @var ?string */ private $title; /** + *

    Value to set. If empty, any existing value is removed.

    + * + * @return null|string */ public function getTitle() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetTitleActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetTitleActionModel.php index a83d608b44e..ba97061f8c1 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetTitleActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetTitleActionModel.php @@ -21,11 +21,13 @@ final class CustomerSetTitleActionModel extends JsonObjectModel implements Custo { public const DISCRIMINATOR_VALUE = 'setTitle'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $title; @@ -35,13 +37,15 @@ final class CustomerSetTitleActionModel extends JsonObjectModel implements Custo * @psalm-suppress MissingParamType */ public function __construct( - ?string $title = null + ?string $title = null, + ?string $action = null ) { $this->title = $title; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,9 @@ public function getAction() } /** + *

    Value to set. If empty, any existing value is removed.

    + * + * * @return null|string */ public function getTitle() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetVatIdAction.php b/lib/commercetools-api/src/Models/Customer/CustomerSetVatIdAction.php index add43b3f886..7c66ac7b18d 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetVatIdAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetVatIdAction.php @@ -16,8 +16,10 @@ interface CustomerSetVatIdAction extends CustomerUpdateAction public const FIELD_VAT_ID = 'vatId'; /** - *

    If not defined, the vat Id is unset.

    + *

    Value to set. + * If empty, any existing value is removed.

    * + * @return null|string */ public function getVatId(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetVatIdActionBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSetVatIdActionBuilder.php index e14cb270c1a..4da540656f1 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetVatIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetVatIdActionBuilder.php @@ -21,13 +21,16 @@ final class CustomerSetVatIdActionBuilder implements Builder { /** + * @var ?string */ private $vatId; /** - *

    If not defined, the vat Id is unset.

    + *

    Value to set. + * If empty, any existing value is removed.

    * + * @return null|string */ public function getVatId() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSetVatIdActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSetVatIdActionModel.php index 7b87cdd2833..1b4f2bd83c4 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSetVatIdActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSetVatIdActionModel.php @@ -21,11 +21,13 @@ final class CustomerSetVatIdActionModel extends JsonObjectModel implements Custo { public const DISCRIMINATOR_VALUE = 'setVatId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $vatId; @@ -35,13 +37,15 @@ final class CustomerSetVatIdActionModel extends JsonObjectModel implements Custo * @psalm-suppress MissingParamType */ public function __construct( - ?string $vatId = null + ?string $vatId = null, + ?string $action = null ) { $this->vatId = $vatId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,7 +63,9 @@ public function getAction() } /** - *

    If not defined, the vat Id is unset.

    + *

    Value to set. + * If empty, any existing value is removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSignInResult.php b/lib/commercetools-api/src/Models/Customer/CustomerSignInResult.php index 86feb342a60..43258760b8b 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSignInResult.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSignInResult.php @@ -18,14 +18,18 @@ interface CustomerSignInResult extends JsonObject public const FIELD_CART = 'cart'; /** + *

    Customer signed up or signed in after authentication.

    + * + * @return null|Customer */ public function getCustomer(); /** - *

    A cart that is associated to the customer. - * Empty if the customer does not have a cart yet.

    + *

    Cart associated with the Customer. + * If empty, the Customer does not have a Cart assigned.

    * + * @return null|Cart */ public function getCart(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSignInResultBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSignInResultBuilder.php index 3703ea6b781..65061e9e6b0 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSignInResultBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSignInResultBuilder.php @@ -23,16 +23,21 @@ final class CustomerSignInResultBuilder implements Builder { /** + * @var null|Customer|CustomerBuilder */ private $customer; /** + * @var null|Cart|CartBuilder */ private $cart; /** + *

    Customer signed up or signed in after authentication.

    + * + * @return null|Customer */ public function getCustomer() @@ -41,9 +46,10 @@ public function getCustomer() } /** - *

    A cart that is associated to the customer. - * Empty if the customer does not have a cart yet.

    + *

    Cart associated with the Customer. + * If empty, the Customer does not have a Cart assigned.

    * + * @return null|Cart */ public function getCart() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSignInResultModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSignInResultModel.php index 32412ffee71..53d56ae17ee 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSignInResultModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSignInResultModel.php @@ -22,11 +22,13 @@ final class CustomerSignInResultModel extends JsonObjectModel implements CustomerSignInResult { /** + * * @var ?Customer */ protected $customer; /** + * * @var ?Cart */ protected $cart; @@ -44,6 +46,9 @@ public function __construct( } /** + *

    Customer signed up or signed in after authentication.

    + * + * * @return null|Customer */ public function getCustomer() @@ -62,8 +67,9 @@ public function getCustomer() } /** - *

    A cart that is associated to the customer. - * Empty if the customer does not have a cart yet.

    + *

    Cart associated with the Customer. + * If empty, the Customer does not have a Cart assigned.

    + * * * @return null|Cart */ diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSignin.php b/lib/commercetools-api/src/Models/Customer/CustomerSignin.php index 64d511f9399..a19ef9f21d1 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSignin.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSignin.php @@ -23,38 +23,65 @@ interface CustomerSignin extends JsonObject public const FIELD_UPDATE_PRODUCT_DATA = 'updateProductData'; /** + *

    Email address of the Customer treated as case-insensitive.

    + * + * @return null|string */ public function getEmail(); /** + *

    Password of the Customer.

    + * + * @return null|string */ public function getPassword(); /** + *

    Deprecated since it is now possible to identify an anonymous cart by using its id or external key.

    + * + * @deprecated * @return null|string */ public function getAnonymousCartId(); /** - *

    ResourceIdentifier to a Cart.

    + *

    Identifies a Cart that will be assigned to the Customer.

    * + * @return null|CartResourceIdentifier */ public function getAnonymousCart(); /** + *
      + *
    • Set to MergeWithExistingCustomerCart if LineItems of the anonymous Cart should be merged with the active Customer Cart that has been modified most recently.
    • + *
    • Set to UseAsNewActiveCustomerCart if the anonymous Cart should be used as the new active Customer Cart and no LineItems are to be merged.
    • + *
    + * + * @return null|string */ public function getAnonymousCartSignInMode(); /** + *

    If both anonymousCart and anonymousId are provided, the anonymousId on the CustomerSignin must match that of the anonymous [Cart](ctp:api:type:Cart]. + * Otherwise a 400 Bad Request Invalid Operation error is returned with the message: + * "Cart with the ID cart-id does not have the expected anonymousId.".

    + * + * @return null|string */ public function getAnonymousId(); /** + *
      + *
    • If true, the LineItem Product data (name, variant, and productType) of the returned Cart will be updated.
    • + *
    • If false, only the prices, discounts, and tax rates will be updated.
    • + *
    + * + * @return null|bool */ public function getUpdateProductData(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSigninBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSigninBuilder.php index fca539b98a2..907c37276e6 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSigninBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSigninBuilder.php @@ -23,41 +23,51 @@ final class CustomerSigninBuilder implements Builder { /** + * @var ?string */ private $email; /** + * @var ?string */ private $password; /** + * @deprecated * @var ?string */ private $anonymousCartId; /** + * @var null|CartResourceIdentifier|CartResourceIdentifierBuilder */ private $anonymousCart; /** + * @var ?string */ private $anonymousCartSignInMode; /** + * @var ?string */ private $anonymousId; /** + * @var ?bool */ private $updateProductData; /** + *

    Email address of the Customer treated as case-insensitive.

    + * + * @return null|string */ public function getEmail() @@ -66,6 +76,9 @@ public function getEmail() } /** + *

    Password of the Customer.

    + * + * @return null|string */ public function getPassword() @@ -74,6 +87,9 @@ public function getPassword() } /** + *

    Deprecated since it is now possible to identify an anonymous cart by using its id or external key.

    + * + * @deprecated * @return null|string */ public function getAnonymousCartId() @@ -82,8 +98,9 @@ public function getAnonymousCartId() } /** - *

    ResourceIdentifier to a Cart.

    + *

    Identifies a Cart that will be assigned to the Customer.

    * + * @return null|CartResourceIdentifier */ public function getAnonymousCart() @@ -92,6 +109,12 @@ public function getAnonymousCart() } /** + *
      + *
    • Set to MergeWithExistingCustomerCart if LineItems of the anonymous Cart should be merged with the active Customer Cart that has been modified most recently.
    • + *
    • Set to UseAsNewActiveCustomerCart if the anonymous Cart should be used as the new active Customer Cart and no LineItems are to be merged.
    • + *
    + * + * @return null|string */ public function getAnonymousCartSignInMode() @@ -100,6 +123,11 @@ public function getAnonymousCartSignInMode() } /** + *

    If both anonymousCart and anonymousId are provided, the anonymousId on the CustomerSignin must match that of the anonymous [Cart](ctp:api:type:Cart]. + * Otherwise a 400 Bad Request Invalid Operation error is returned with the message: + * "Cart with the ID cart-id does not have the expected anonymousId.".

    + * + * @return null|string */ public function getAnonymousId() @@ -108,6 +136,12 @@ public function getAnonymousId() } /** + *
      + *
    • If true, the LineItem Product data (name, variant, and productType) of the returned Cart will be updated.
    • + *
    • If false, only the prices, discounts, and tax rates will be updated.
    • + *
    + * + * @return null|bool */ public function getUpdateProductData() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSigninModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSigninModel.php index 982fda1c8ed..271076a8459 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSigninModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSigninModel.php @@ -22,36 +22,43 @@ final class CustomerSigninModel extends JsonObjectModel implements CustomerSignin { /** + * * @var ?string */ protected $email; /** + * * @var ?string */ protected $password; /** + * @deprecated * @var ?string */ protected $anonymousCartId; /** + * * @var ?CartResourceIdentifier */ protected $anonymousCart; /** + * * @var ?string */ protected $anonymousCartSignInMode; /** + * * @var ?string */ protected $anonymousId; /** + * * @var ?bool */ protected $updateProductData; @@ -79,6 +86,9 @@ public function __construct( } /** + *

    Email address of the Customer treated as case-insensitive.

    + * + * * @return null|string */ public function getEmail() @@ -96,6 +106,9 @@ public function getEmail() } /** + *

    Password of the Customer.

    + * + * * @return null|string */ public function getPassword() @@ -113,6 +126,9 @@ public function getPassword() } /** + *

    Deprecated since it is now possible to identify an anonymous cart by using its id or external key.

    + * + * @deprecated * @return null|string */ public function getAnonymousCartId() @@ -130,7 +146,8 @@ public function getAnonymousCartId() } /** - *

    ResourceIdentifier to a Cart.

    + *

    Identifies a Cart that will be assigned to the Customer.

    + * * * @return null|CartResourceIdentifier */ @@ -150,6 +167,12 @@ public function getAnonymousCart() } /** + *
      + *
    • Set to MergeWithExistingCustomerCart if LineItems of the anonymous Cart should be merged with the active Customer Cart that has been modified most recently.
    • + *
    • Set to UseAsNewActiveCustomerCart if the anonymous Cart should be used as the new active Customer Cart and no LineItems are to be merged.
    • + *
    + * + * * @return null|string */ public function getAnonymousCartSignInMode() @@ -167,6 +190,11 @@ public function getAnonymousCartSignInMode() } /** + *

    If both anonymousCart and anonymousId are provided, the anonymousId on the CustomerSignin must match that of the anonymous [Cart](ctp:api:type:Cart]. + * Otherwise a 400 Bad Request Invalid Operation error is returned with the message: + * "Cart with the ID cart-id does not have the expected anonymousId.".

    + * + * * @return null|string */ public function getAnonymousId() @@ -184,6 +212,12 @@ public function getAnonymousId() } /** + *
      + *
    • If true, the LineItem Product data (name, variant, and productType) of the returned Cart will be updated.
    • + *
    • If false, only the prices, discounts, and tax rates will be updated.
    • + *
    + * + * * @return null|bool */ public function getUpdateProductData() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerToken.php b/lib/commercetools-api/src/Models/Customer/CustomerToken.php index 2d7c72912f2..d2cf334788d 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerToken.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerToken.php @@ -22,33 +22,49 @@ interface CustomerToken extends JsonObject public const FIELD_VALUE = 'value'; /** - *

    Unique identifier of the CustomerToken.

    + *

    Unique identifier of the token.

    * + * @return null|string */ public function getId(); /** + *

    Date and time (UTC) the token was initially created.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt(); /** + *

    When the token is created, lastModifiedAt is set to createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); /** + *

    The id of the Customer.

    + * + * @return null|string */ public function getCustomerId(); /** + *

    Date and time (UTC) the token expires.

    + * + * @return null|DateTimeImmutable */ public function getExpiresAt(); /** + *

    Value of the token.

    + * + * @return null|string */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerTokenBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerTokenBuilder.php index 860c718f83c..20525cad66c 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerTokenBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerTokenBuilder.php @@ -22,38 +22,45 @@ final class CustomerTokenBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var ?string */ private $customerId; /** + * @var ?DateTimeImmutable */ private $expiresAt; /** + * @var ?string */ private $value; /** - *

    Unique identifier of the CustomerToken.

    + *

    Unique identifier of the token.

    * + * @return null|string */ public function getId() @@ -62,6 +69,9 @@ public function getId() } /** + *

    Date and time (UTC) the token was initially created.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -70,6 +80,9 @@ public function getCreatedAt() } /** + *

    When the token is created, lastModifiedAt is set to createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -78,6 +91,9 @@ public function getLastModifiedAt() } /** + *

    The id of the Customer.

    + * + * @return null|string */ public function getCustomerId() @@ -86,6 +102,9 @@ public function getCustomerId() } /** + *

    Date and time (UTC) the token expires.

    + * + * @return null|DateTimeImmutable */ public function getExpiresAt() @@ -94,6 +113,9 @@ public function getExpiresAt() } /** + *

    Value of the token.

    + * + * @return null|string */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerTokenModel.php b/lib/commercetools-api/src/Models/Customer/CustomerTokenModel.php index 74d930c8f4f..c7e7f3c0476 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerTokenModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerTokenModel.php @@ -21,31 +21,37 @@ final class CustomerTokenModel extends JsonObjectModel implements CustomerToken { /** + * * @var ?string */ protected $id; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?string */ protected $customerId; /** + * * @var ?DateTimeImmutable */ protected $expiresAt; /** + * * @var ?string */ protected $value; @@ -71,7 +77,8 @@ public function __construct( } /** - *

    Unique identifier of the CustomerToken.

    + *

    Unique identifier of the token.

    + * * * @return null|string */ @@ -90,6 +97,9 @@ public function getId() } /** + *

    Date and time (UTC) the token was initially created.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +121,9 @@ public function getCreatedAt() } /** + *

    When the token is created, lastModifiedAt is set to createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -132,6 +145,9 @@ public function getLastModifiedAt() } /** + *

    The id of the Customer.

    + * + * * @return null|string */ public function getCustomerId() @@ -149,6 +165,9 @@ public function getCustomerId() } /** + *

    Date and time (UTC) the token expires.

    + * + * * @return null|DateTimeImmutable */ public function getExpiresAt() @@ -170,6 +189,9 @@ public function getExpiresAt() } /** + *

    Value of the token.

    + * + * * @return null|string */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerUpdate.php b/lib/commercetools-api/src/Models/Customer/CustomerUpdate.php index 403545f33c3..04de62bd8cb 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerUpdate.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerUpdate.php @@ -17,11 +17,17 @@ interface CustomerUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + *

    Expected version of the Customer on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * @return null|int */ public function getVersion(); /** + *

    Update actions to be performed on the Customer.

    + * + * @return null|CustomerUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerUpdateAction.php b/lib/commercetools-api/src/Models/Customer/CustomerUpdateAction.php index 17337bcba2b..694af45606c 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerUpdateAction.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerUpdateAction.php @@ -17,6 +17,7 @@ interface CustomerUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Customer/CustomerUpdateActionModel.php b/lib/commercetools-api/src/Models/Customer/CustomerUpdateActionModel.php index 2956cc39083..dd9ed9ee2c8 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerUpdateActionModel.php @@ -21,6 +21,7 @@ final class CustomerUpdateActionModel extends JsonObjectModel implements Custome { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -67,11 +68,13 @@ final class CustomerUpdateActionModel extends JsonObjectModel implements Custome * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerUpdateBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerUpdateBuilder.php index 70f686f6192..5c7a7576ecc 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerUpdateBuilder.php @@ -21,16 +21,21 @@ final class CustomerUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?CustomerUpdateActionCollection */ private $actions; /** + *

    Expected version of the Customer on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * @return null|int */ public function getVersion() @@ -39,6 +44,9 @@ public function getVersion() } /** + *

    Update actions to be performed on the Customer.

    + * + * @return null|CustomerUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Customer/CustomerUpdateModel.php b/lib/commercetools-api/src/Models/Customer/CustomerUpdateModel.php index 61c9fda7aef..e1f25ff2837 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerUpdateModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerUpdateModel.php @@ -20,11 +20,13 @@ final class CustomerUpdateModel extends JsonObjectModel implements CustomerUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?CustomerUpdateActionCollection */ protected $actions; @@ -42,6 +44,9 @@ public function __construct( } /** + *

    Expected version of the Customer on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * * @return null|int */ public function getVersion() @@ -59,6 +64,9 @@ public function getVersion() } /** + *

    Update actions to be performed on the Customer.

    + * + * * @return null|CustomerUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Customer/MyCustomerChangePassword.php b/lib/commercetools-api/src/Models/Customer/MyCustomerChangePassword.php index bf5d37ec098..71000e4912f 100644 --- a/lib/commercetools-api/src/Models/Customer/MyCustomerChangePassword.php +++ b/lib/commercetools-api/src/Models/Customer/MyCustomerChangePassword.php @@ -18,16 +18,26 @@ interface MyCustomerChangePassword extends JsonObject public const FIELD_NEW_PASSWORD = 'newPassword'; /** + *

    Expected version of the Customer on which the changes should be applied.

    + * + * @return null|int */ public function getVersion(); /** + *

    Current password of the Customer.

    + *

    If the current password does not match, an InvalidCurrentPassword error is returned.

    + * + * @return null|string */ public function getCurrentPassword(); /** + *

    New password to be set.

    + * + * @return null|string */ public function getNewPassword(); diff --git a/lib/commercetools-api/src/Models/Customer/MyCustomerChangePasswordBuilder.php b/lib/commercetools-api/src/Models/Customer/MyCustomerChangePasswordBuilder.php index ee86226b8ce..38d830e864c 100644 --- a/lib/commercetools-api/src/Models/Customer/MyCustomerChangePasswordBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/MyCustomerChangePasswordBuilder.php @@ -21,21 +21,27 @@ final class MyCustomerChangePasswordBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?string */ private $currentPassword; /** + * @var ?string */ private $newPassword; /** + *

    Expected version of the Customer on which the changes should be applied.

    + * + * @return null|int */ public function getVersion() @@ -44,6 +50,10 @@ public function getVersion() } /** + *

    Current password of the Customer.

    + *

    If the current password does not match, an InvalidCurrentPassword error is returned.

    + * + * @return null|string */ public function getCurrentPassword() @@ -52,6 +62,9 @@ public function getCurrentPassword() } /** + *

    New password to be set.

    + * + * @return null|string */ public function getNewPassword() diff --git a/lib/commercetools-api/src/Models/Customer/MyCustomerChangePasswordModel.php b/lib/commercetools-api/src/Models/Customer/MyCustomerChangePasswordModel.php index eb64f3d3987..613022deb62 100644 --- a/lib/commercetools-api/src/Models/Customer/MyCustomerChangePasswordModel.php +++ b/lib/commercetools-api/src/Models/Customer/MyCustomerChangePasswordModel.php @@ -20,16 +20,19 @@ final class MyCustomerChangePasswordModel extends JsonObjectModel implements MyCustomerChangePassword { /** + * * @var ?int */ protected $version; /** + * * @var ?string */ protected $currentPassword; /** + * * @var ?string */ protected $newPassword; @@ -49,6 +52,9 @@ public function __construct( } /** + *

    Expected version of the Customer on which the changes should be applied.

    + * + * * @return null|int */ public function getVersion() @@ -66,6 +72,10 @@ public function getVersion() } /** + *

    Current password of the Customer.

    + *

    If the current password does not match, an InvalidCurrentPassword error is returned.

    + * + * * @return null|string */ public function getCurrentPassword() @@ -83,6 +93,9 @@ public function getCurrentPassword() } /** + *

    New password to be set.

    + * + * * @return null|string */ public function getNewPassword() diff --git a/lib/commercetools-api/src/Models/Customer/MyCustomerEmailVerify.php b/lib/commercetools-api/src/Models/Customer/MyCustomerEmailVerify.php new file mode 100644 index 00000000000..db8a2c385ad --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/MyCustomerEmailVerify.php @@ -0,0 +1,30 @@ +Value of the token to verify Customer email.

    + * + + * @return null|string + */ + public function getTokenValue(); + + /** + * @param ?string $tokenValue + */ + public function setTokenValue(?string $tokenValue): void; +} diff --git a/lib/commercetools-api/src/Models/Customer/MyCustomerEmailVerifyBuilder.php b/lib/commercetools-api/src/Models/Customer/MyCustomerEmailVerifyBuilder.php new file mode 100644 index 00000000000..2aeed095a80 --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/MyCustomerEmailVerifyBuilder.php @@ -0,0 +1,63 @@ + + */ +final class MyCustomerEmailVerifyBuilder implements Builder +{ + /** + + * @var ?string + */ + private $tokenValue; + + /** + *

    Value of the token to verify Customer email.

    + * + + * @return null|string + */ + public function getTokenValue() + { + return $this->tokenValue; + } + + /** + * @param ?string $tokenValue + * @return $this + */ + public function withTokenValue(?string $tokenValue) + { + $this->tokenValue = $tokenValue; + + return $this; + } + + + public function build(): MyCustomerEmailVerify + { + return new MyCustomerEmailVerifyModel( + $this->tokenValue + ); + } + + public static function of(): MyCustomerEmailVerifyBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Customer/MyCustomerEmailVerifyCollection.php b/lib/commercetools-api/src/Models/Customer/MyCustomerEmailVerifyCollection.php new file mode 100644 index 00000000000..e181d959388 --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/MyCustomerEmailVerifyCollection.php @@ -0,0 +1,56 @@ + + * @method MyCustomerEmailVerify current() + * @method MyCustomerEmailVerify end() + * @method MyCustomerEmailVerify at($offset) + */ +class MyCustomerEmailVerifyCollection extends MapperSequence +{ + /** + * @psalm-assert MyCustomerEmailVerify $value + * @psalm-param MyCustomerEmailVerify|stdClass $value + * @throws InvalidArgumentException + * + * @return MyCustomerEmailVerifyCollection + */ + public function add($value) + { + if (!$value instanceof MyCustomerEmailVerify) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyCustomerEmailVerify + */ + protected function mapper() + { + return function (?int $index): ?MyCustomerEmailVerify { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyCustomerEmailVerify $data */ + $data = MyCustomerEmailVerifyModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Customer/MyCustomerEmailVerifyModel.php b/lib/commercetools-api/src/Models/Customer/MyCustomerEmailVerifyModel.php new file mode 100644 index 00000000000..a375e773678 --- /dev/null +++ b/lib/commercetools-api/src/Models/Customer/MyCustomerEmailVerifyModel.php @@ -0,0 +1,66 @@ +tokenValue = $tokenValue; + } + + /** + *

    Value of the token to verify Customer email.

    + * + * + * @return null|string + */ + public function getTokenValue() + { + if (is_null($this->tokenValue)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TOKEN_VALUE); + if (is_null($data)) { + return null; + } + $this->tokenValue = (string) $data; + } + + return $this->tokenValue; + } + + + /** + * @param ?string $tokenValue + */ + public function setTokenValue(?string $tokenValue): void + { + $this->tokenValue = $tokenValue; + } +} diff --git a/lib/commercetools-api/src/Models/Customer/MyCustomerResetPassword.php b/lib/commercetools-api/src/Models/Customer/MyCustomerResetPassword.php index 17968b11e0b..b46724d5301 100644 --- a/lib/commercetools-api/src/Models/Customer/MyCustomerResetPassword.php +++ b/lib/commercetools-api/src/Models/Customer/MyCustomerResetPassword.php @@ -17,11 +17,17 @@ interface MyCustomerResetPassword extends JsonObject public const FIELD_NEW_PASSWORD = 'newPassword'; /** + *

    Value of the token to reset the Customer password.

    + * + * @return null|string */ public function getTokenValue(); /** + *

    New password to be set.

    + * + * @return null|string */ public function getNewPassword(); diff --git a/lib/commercetools-api/src/Models/Customer/MyCustomerResetPasswordBuilder.php b/lib/commercetools-api/src/Models/Customer/MyCustomerResetPasswordBuilder.php index 0616215cdb4..3dccd8378b0 100644 --- a/lib/commercetools-api/src/Models/Customer/MyCustomerResetPasswordBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/MyCustomerResetPasswordBuilder.php @@ -21,16 +21,21 @@ final class MyCustomerResetPasswordBuilder implements Builder { /** + * @var ?string */ private $tokenValue; /** + * @var ?string */ private $newPassword; /** + *

    Value of the token to reset the Customer password.

    + * + * @return null|string */ public function getTokenValue() @@ -39,6 +44,9 @@ public function getTokenValue() } /** + *

    New password to be set.

    + * + * @return null|string */ public function getNewPassword() diff --git a/lib/commercetools-api/src/Models/Customer/MyCustomerResetPasswordModel.php b/lib/commercetools-api/src/Models/Customer/MyCustomerResetPasswordModel.php index d0501c4fcb3..c8c8cbff7bb 100644 --- a/lib/commercetools-api/src/Models/Customer/MyCustomerResetPasswordModel.php +++ b/lib/commercetools-api/src/Models/Customer/MyCustomerResetPasswordModel.php @@ -20,11 +20,13 @@ final class MyCustomerResetPasswordModel extends JsonObjectModel implements MyCustomerResetPassword { /** + * * @var ?string */ protected $tokenValue; /** + * * @var ?string */ protected $newPassword; @@ -42,6 +44,9 @@ public function __construct( } /** + *

    Value of the token to reset the Customer password.

    + * + * * @return null|string */ public function getTokenValue() @@ -59,6 +64,9 @@ public function getTokenValue() } /** + *

    New password to be set.

    + * + * * @return null|string */ public function getNewPassword() diff --git a/lib/commercetools-api/src/Models/Customer/MyCustomerSignin.php b/lib/commercetools-api/src/Models/Customer/MyCustomerSignin.php index d3bfd2f7a9e..204859045aa 100644 --- a/lib/commercetools-api/src/Models/Customer/MyCustomerSignin.php +++ b/lib/commercetools-api/src/Models/Customer/MyCustomerSignin.php @@ -19,21 +19,39 @@ interface MyCustomerSignin extends JsonObject public const FIELD_UPDATE_PRODUCT_DATA = 'updateProductData'; /** + *

    Email address of the Customer treated as case-insensitive.

    + * + * @return null|string */ public function getEmail(); /** + *

    Password of the Customer.

    + * + * @return null|string */ public function getPassword(); /** + *
      + *
    • If MergeWithExistingCustomerCart, LineItems of the anonymous Cart are merged with the recently modified active Customer Cart.
    • + *
    • If UseAsNewActiveCustomerCart, the anonymous Cart is used as the new active Customer Cart, and no LineItems are merged.
    • + *
    + * + * @return null|string */ public function getActiveCartSignInMode(); /** + *
      + *
    • If true, the LineItem Product data (name, variant, and productType) of the returned Cart is updated.
    • + *
    • If false, only the prices, discounts, and tax rates are updated.
    • + *
    + * + * @return null|bool */ public function getUpdateProductData(); diff --git a/lib/commercetools-api/src/Models/Customer/MyCustomerSigninBuilder.php b/lib/commercetools-api/src/Models/Customer/MyCustomerSigninBuilder.php index 8abdee02d02..5dddd8ac9c2 100644 --- a/lib/commercetools-api/src/Models/Customer/MyCustomerSigninBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/MyCustomerSigninBuilder.php @@ -21,26 +21,33 @@ final class MyCustomerSigninBuilder implements Builder { /** + * @var ?string */ private $email; /** + * @var ?string */ private $password; /** + * @var ?string */ private $activeCartSignInMode; /** + * @var ?bool */ private $updateProductData; /** + *

    Email address of the Customer treated as case-insensitive.

    + * + * @return null|string */ public function getEmail() @@ -49,6 +56,9 @@ public function getEmail() } /** + *

    Password of the Customer.

    + * + * @return null|string */ public function getPassword() @@ -57,6 +67,12 @@ public function getPassword() } /** + *
      + *
    • If MergeWithExistingCustomerCart, LineItems of the anonymous Cart are merged with the recently modified active Customer Cart.
    • + *
    • If UseAsNewActiveCustomerCart, the anonymous Cart is used as the new active Customer Cart, and no LineItems are merged.
    • + *
    + * + * @return null|string */ public function getActiveCartSignInMode() @@ -65,6 +81,12 @@ public function getActiveCartSignInMode() } /** + *
      + *
    • If true, the LineItem Product data (name, variant, and productType) of the returned Cart is updated.
    • + *
    • If false, only the prices, discounts, and tax rates are updated.
    • + *
    + * + * @return null|bool */ public function getUpdateProductData() diff --git a/lib/commercetools-api/src/Models/Customer/MyCustomerSigninModel.php b/lib/commercetools-api/src/Models/Customer/MyCustomerSigninModel.php index 84e187d90d1..c50738dd916 100644 --- a/lib/commercetools-api/src/Models/Customer/MyCustomerSigninModel.php +++ b/lib/commercetools-api/src/Models/Customer/MyCustomerSigninModel.php @@ -20,21 +20,25 @@ final class MyCustomerSigninModel extends JsonObjectModel implements MyCustomerSignin { /** + * * @var ?string */ protected $email; /** + * * @var ?string */ protected $password; /** + * * @var ?string */ protected $activeCartSignInMode; /** + * * @var ?bool */ protected $updateProductData; @@ -56,6 +60,9 @@ public function __construct( } /** + *

    Email address of the Customer treated as case-insensitive.

    + * + * * @return null|string */ public function getEmail() @@ -73,6 +80,9 @@ public function getEmail() } /** + *

    Password of the Customer.

    + * + * * @return null|string */ public function getPassword() @@ -90,6 +100,12 @@ public function getPassword() } /** + *
      + *
    • If MergeWithExistingCustomerCart, LineItems of the anonymous Cart are merged with the recently modified active Customer Cart.
    • + *
    • If UseAsNewActiveCustomerCart, the anonymous Cart is used as the new active Customer Cart, and no LineItems are merged.
    • + *
    + * + * * @return null|string */ public function getActiveCartSignInMode() @@ -107,6 +123,12 @@ public function getActiveCartSignInMode() } /** + *
      + *
    • If true, the LineItem Product data (name, variant, and productType) of the returned Cart is updated.
    • + *
    • If false, only the prices, discounts, and tax rates are updated.
    • + *
    + * + * * @return null|bool */ public function getUpdateProductData() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroup.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroup.php index bb6f8a6eee2..bddd9cb8803 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroup.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroup.php @@ -27,6 +27,7 @@ interface CustomerGroup extends BaseResource /** *

    Unique identifier of the CustomerGroup.

    * + * @return null|string */ public function getId(); @@ -34,6 +35,7 @@ public function getId(); /** *

    Current version of the CustomerGroup.

    * + * @return null|int */ public function getVersion(); @@ -41,6 +43,7 @@ public function getVersion(); /** *

    Date and time (UTC) the CustomerGroup was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -48,6 +51,7 @@ public function getCreatedAt(); /** *

    Date and time (UTC) the CustomerGroup was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -55,6 +59,7 @@ public function getLastModifiedAt(); /** *

    Present on resources updated after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -62,6 +67,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -69,6 +75,7 @@ public function getCreatedBy(); /** *

    User-defined unique identifier for the CustomerGroup.

    * + * @return null|string */ public function getKey(); @@ -76,6 +83,7 @@ public function getKey(); /** *

    Unique name of the CustomerGroup.

    * + * @return null|string */ public function getName(); @@ -83,6 +91,7 @@ public function getName(); /** *

    Custom Fields for the CustomerGroup.

    * + * @return null|CustomFields */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupBuilder.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupBuilder.php index e1a3f561012..20a3edc7d78 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupBuilder.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupBuilder.php @@ -30,46 +30,55 @@ final class CustomerGroupBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $key; /** + * @var ?string */ private $name; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; @@ -77,6 +86,7 @@ final class CustomerGroupBuilder implements Builder /** *

    Unique identifier of the CustomerGroup.

    * + * @return null|string */ public function getId() @@ -87,6 +97,7 @@ public function getId() /** *

    Current version of the CustomerGroup.

    * + * @return null|int */ public function getVersion() @@ -97,6 +108,7 @@ public function getVersion() /** *

    Date and time (UTC) the CustomerGroup was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -107,6 +119,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the CustomerGroup was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -117,6 +130,7 @@ public function getLastModifiedAt() /** *

    Present on resources updated after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -127,6 +141,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -137,6 +152,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier for the CustomerGroup.

    * + * @return null|string */ public function getKey() @@ -147,6 +163,7 @@ public function getKey() /** *

    Unique name of the CustomerGroup.

    * + * @return null|string */ public function getName() @@ -157,6 +174,7 @@ public function getName() /** *

    Custom Fields for the CustomerGroup.

    * + * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupChangeNameAction.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupChangeNameAction.php index 22f7d4a0134..728459e8e70 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupChangeNameAction.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupChangeNameAction.php @@ -18,6 +18,7 @@ interface CustomerGroupChangeNameAction extends CustomerGroupUpdateAction /** *

    New name of the CustomerGroup.

    * + * @return null|string */ public function getName(); diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupChangeNameActionBuilder.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupChangeNameActionBuilder.php index a12a26bcc9b..a5b8e8ffb68 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupChangeNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupChangeNameActionBuilder.php @@ -21,6 +21,7 @@ final class CustomerGroupChangeNameActionBuilder implements Builder { /** + * @var ?string */ private $name; @@ -28,6 +29,7 @@ final class CustomerGroupChangeNameActionBuilder implements Builder /** *

    New name of the CustomerGroup.

    * + * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupChangeNameActionModel.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupChangeNameActionModel.php index 27ea6fe4ef3..138992a81a9 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupChangeNameActionModel.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupChangeNameActionModel.php @@ -21,11 +21,13 @@ final class CustomerGroupChangeNameActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'changeName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; @@ -35,13 +37,15 @@ final class CustomerGroupChangeNameActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?string $name = null + ?string $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    New name of the CustomerGroup.

    * + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupDraft.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupDraft.php index 9b9babdea4b..9bc817a2b3e 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupDraft.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupDraft.php @@ -21,6 +21,7 @@ interface CustomerGroupDraft extends JsonObject /** *

    User-defined unique identifier for the CustomerGroup.

    * + * @return null|string */ public function getKey(); @@ -29,6 +30,7 @@ public function getKey(); *

    Unique value which must be different from any value used for name in CustomerGroup in the Project. * If not, a DuplicateField error is thrown.

    * + * @return null|string */ public function getGroupName(); @@ -36,6 +38,7 @@ public function getGroupName(); /** *

    Custom Fields for the CustomerGroup.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupDraftBuilder.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupDraftBuilder.php index 4162308b8ca..eb1db777546 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupDraftBuilder.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupDraftBuilder.php @@ -23,16 +23,19 @@ final class CustomerGroupDraftBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $groupName; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; @@ -40,6 +43,7 @@ final class CustomerGroupDraftBuilder implements Builder /** *

    User-defined unique identifier for the CustomerGroup.

    * + * @return null|string */ public function getKey() @@ -51,6 +55,7 @@ public function getKey() *

    Unique value which must be different from any value used for name in CustomerGroup in the Project. * If not, a DuplicateField error is thrown.

    * + * @return null|string */ public function getGroupName() @@ -61,6 +66,7 @@ public function getGroupName() /** *

    Custom Fields for the CustomerGroup.

    * + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupDraftModel.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupDraftModel.php index 9826ffeb6ad..f93c24f447e 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupDraftModel.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupDraftModel.php @@ -22,16 +22,19 @@ final class CustomerGroupDraftModel extends JsonObjectModel implements CustomerGroupDraft { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $groupName; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -53,6 +56,7 @@ public function __construct( /** *

    User-defined unique identifier for the CustomerGroup.

    * + * * @return null|string */ public function getKey() @@ -73,6 +77,7 @@ public function getKey() *

    Unique value which must be different from any value used for name in CustomerGroup in the Project. * If not, a DuplicateField error is thrown.

    * + * * @return null|string */ public function getGroupName() @@ -92,6 +97,7 @@ public function getGroupName() /** *

    Custom Fields for the CustomerGroup.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupModel.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupModel.php index a13efc4bf67..10b3483e309 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupModel.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupModel.php @@ -29,46 +29,55 @@ final class CustomerGroupModel extends JsonObjectModel implements CustomerGroup { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $name; /** + * * @var ?CustomFields */ protected $custom; @@ -102,6 +111,7 @@ public function __construct( /** *

    Unique identifier of the CustomerGroup.

    * + * * @return null|string */ public function getId() @@ -121,6 +131,7 @@ public function getId() /** *

    Current version of the CustomerGroup.

    * + * * @return null|int */ public function getVersion() @@ -140,6 +151,7 @@ public function getVersion() /** *

    Date and time (UTC) the CustomerGroup was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -163,6 +175,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the CustomerGroup was last updated.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -186,6 +199,7 @@ public function getLastModifiedAt() /** *

    Present on resources updated after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -206,6 +220,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -226,6 +241,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier for the CustomerGroup.

    * + * * @return null|string */ public function getKey() @@ -245,6 +261,7 @@ public function getKey() /** *

    Unique name of the CustomerGroup.

    * + * * @return null|string */ public function getName() @@ -264,6 +281,7 @@ public function getName() /** *

    Custom Fields for the CustomerGroup.

    * + * * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupPagedQueryResponse.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupPagedQueryResponse.php index 902e89f4dd9..105c2ab44ae 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupPagedQueryResponse.php @@ -22,6 +22,7 @@ interface CustomerGroupPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    CustomerGroups matching the query.

    * + * @return null|CustomerGroupCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupPagedQueryResponseBuilder.php index c0dd402d11b..7730411b70a 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class CustomerGroupPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?CustomerGroupCollection */ private $results; @@ -48,6 +53,7 @@ final class CustomerGroupPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    CustomerGroups matching the query.

    * + * @return null|CustomerGroupCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupPagedQueryResponseModel.php index 21331f88709..d5bd7af3639 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class CustomerGroupPagedQueryResponseModel extends JsonObjectModel implements CustomerGroupPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?CustomerGroupCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    CustomerGroups matching the query.

    * + * * @return null|CustomerGroupCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupReference.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupReference.php index 3b4fb483f0e..d103101f79b 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupReference.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupReference.php @@ -19,6 +19,7 @@ interface CustomerGroupReference extends Reference /** *

    Contains the representation of the expanded CustomerGroup. Only present in responses to requests with Reference Expansion for CustomerGroups.

    * + * @return null|CustomerGroup */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

    Unique identifier of the referenced CustomerGroup.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupReferenceBuilder.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupReferenceBuilder.php index 0fc160d8f51..6482a1535a9 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupReferenceBuilder.php @@ -23,11 +23,13 @@ final class CustomerGroupReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|CustomerGroup|CustomerGroupBuilder */ private $obj; @@ -35,6 +37,7 @@ final class CustomerGroupReferenceBuilder implements Builder /** *

    Unique identifier of the referenced CustomerGroup.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded CustomerGroup. Only present in responses to requests with Reference Expansion for CustomerGroups.

    * + * @return null|CustomerGroup */ public function getObj() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupReferenceModel.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupReferenceModel.php index 380a17878a7..a0b049057a8 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupReferenceModel.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupReferenceModel.php @@ -23,16 +23,19 @@ final class CustomerGroupReferenceModel extends JsonObjectModel implements Custo { public const DISCRIMINATOR_VALUE = 'customer-group'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?CustomerGroup */ protected $obj; @@ -43,16 +46,18 @@ final class CustomerGroupReferenceModel extends JsonObjectModel implements Custo */ public function __construct( ?string $id = null, - ?CustomerGroup $obj = null + ?CustomerGroup $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced CustomerGroup.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded CustomerGroup. Only present in responses to requests with Reference Expansion for CustomerGroups.

    * + * * @return null|CustomerGroup */ public function getObj() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupResourceIdentifier.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupResourceIdentifier.php index 099be88e633..9fba801d321 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupResourceIdentifier.php @@ -17,6 +17,7 @@ interface CustomerGroupResourceIdentifier extends ResourceIdentifier /** *

    Unique identifier of the referenced CustomerGroup. Either id or key is required.

    * + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

    User-defined unique identifier of the referenced CustomerGroup. Either id or key is required.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupResourceIdentifierBuilder.php index 3f031680697..15cc1753c85 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class CustomerGroupResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class CustomerGroupResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced CustomerGroup. Either id or key is required.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced CustomerGroup. Either id or key is required.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupResourceIdentifierModel.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupResourceIdentifierModel.php index 0787f67c9b1..c1052a8f764 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class CustomerGroupResourceIdentifierModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'customer-group'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class CustomerGroupResourceIdentifierModel extends JsonObjectModel impleme */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced CustomerGroup. Either id or key is required.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced CustomerGroup. Either id or key is required.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomFieldAction.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomFieldAction.php index 1a951e170ba..c0742dac814 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface CustomerGroupSetCustomFieldAction extends CustomerGroupUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomFieldActionBuilder.php index 5cd3f03e42d..3f53d4deec0 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class CustomerGroupSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class CustomerGroupSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomFieldActionModel.php index a159dadfbec..2c07a1827fc 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class CustomerGroupSetCustomFieldActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class CustomerGroupSetCustomFieldActionModel extends JsonObjectModel imple */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomTypeAction.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomTypeAction.php index a97d76b8f1b..287ebce427c 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface CustomerGroupSetCustomTypeAction extends CustomerGroupUpdateAction *

    Defines the Type that extends the CustomerGroup with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CustomerGroup.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the CustomerGroup.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomTypeActionBuilder.php index d43fca5486e..19760510d14 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class CustomerGroupSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class CustomerGroupSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the CustomerGroup with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CustomerGroup.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the CustomerGroup.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomTypeActionModel.php index e81dc795dd5..38ff2a0be2c 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class CustomerGroupSetCustomTypeActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class CustomerGroupSetCustomTypeActionModel extends JsonObjectModel implem */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the CustomerGroup with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CustomerGroup.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the CustomerGroup.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetKeyAction.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetKeyAction.php index c0f7a26a504..b2700c07f2f 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetKeyAction.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetKeyAction.php @@ -18,6 +18,7 @@ interface CustomerGroupSetKeyAction extends CustomerGroupUpdateAction /** *

    If key is absent or null, the existing key, if any, will be removed.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetKeyActionBuilder.php index 41da04eb1a8..91cbe6b9a1a 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetKeyActionBuilder.php @@ -21,6 +21,7 @@ final class CustomerGroupSetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; @@ -28,6 +29,7 @@ final class CustomerGroupSetKeyActionBuilder implements Builder /** *

    If key is absent or null, the existing key, if any, will be removed.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetKeyActionModel.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetKeyActionModel.php index ae052bdf144..a5796454fc2 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupSetKeyActionModel.php @@ -21,11 +21,13 @@ final class CustomerGroupSetKeyActionModel extends JsonObjectModel implements Cu { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class CustomerGroupSetKeyActionModel extends JsonObjectModel implements Cu * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    If key is absent or null, the existing key, if any, will be removed.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdate.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdate.php index 6567ccb02ea..ebc5da43aa7 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdate.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdate.php @@ -20,6 +20,7 @@ interface CustomerGroupUpdate extends JsonObject *

    Expected version of the CustomerGroup on which the changes should be applied. * If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion(); @@ -27,6 +28,7 @@ public function getVersion(); /** *

    Update actions to be performed on the CustomerGroup.

    * + * @return null|CustomerGroupUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdateAction.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdateAction.php index 07260cc8c17..7e765a2bccc 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdateAction.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdateAction.php @@ -17,6 +17,7 @@ interface CustomerGroupUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdateActionModel.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdateActionModel.php index 198c344220e..7ee8d659350 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdateActionModel.php @@ -21,6 +21,7 @@ final class CustomerGroupUpdateActionModel extends JsonObjectModel implements Cu { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -40,11 +41,13 @@ final class CustomerGroupUpdateActionModel extends JsonObjectModel implements Cu * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdateBuilder.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdateBuilder.php index 7d43186192f..6b2e1837d3c 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdateBuilder.php @@ -21,11 +21,13 @@ final class CustomerGroupUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?CustomerGroupUpdateActionCollection */ private $actions; @@ -34,6 +36,7 @@ final class CustomerGroupUpdateBuilder implements Builder *

    Expected version of the CustomerGroup on which the changes should be applied. * If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion() @@ -44,6 +47,7 @@ public function getVersion() /** *

    Update actions to be performed on the CustomerGroup.

    * + * @return null|CustomerGroupUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdateModel.php b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdateModel.php index 7c2258dccab..0d349b9e279 100644 --- a/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdateModel.php +++ b/lib/commercetools-api/src/Models/CustomerGroup/CustomerGroupUpdateModel.php @@ -20,11 +20,13 @@ final class CustomerGroupUpdateModel extends JsonObjectModel implements CustomerGroupUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?CustomerGroupUpdateActionCollection */ protected $actions; @@ -45,6 +47,7 @@ public function __construct( *

    Expected version of the CustomerGroup on which the changes should be applied. * If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * * @return null|int */ public function getVersion() @@ -64,6 +67,7 @@ public function getVersion() /** *

    Update actions to be performed on the CustomerGroup.

    * + * * @return null|CustomerGroupUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCode.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCode.php index 482d76dba45..bebcc851ea4 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCode.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCode.php @@ -41,6 +41,7 @@ interface DiscountCode extends BaseResource /** *

    Unique identifier of the DiscountCode.

    * + * @return null|string */ public function getId(); @@ -48,6 +49,7 @@ public function getId(); /** *

    Current version of the DiscountCode.

    * + * @return null|int */ public function getVersion(); @@ -55,6 +57,7 @@ public function getVersion(); /** *

    Date and time (UTC) the DiscountCode was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -62,6 +65,7 @@ public function getCreatedAt(); /** *

    Date and time (UTC) the DiscountCode was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -69,6 +73,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -76,6 +81,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -83,6 +89,7 @@ public function getCreatedBy(); /** *

    Name of the DiscountCode.

    * + * @return null|LocalizedString */ public function getName(); @@ -90,6 +97,7 @@ public function getName(); /** *

    Description of the DiscountCode.

    * + * @return null|LocalizedString */ public function getDescription(); @@ -97,6 +105,7 @@ public function getDescription(); /** *

    User-defined unique identifier of the DiscountCode added to the Cart to apply the related CartDiscounts.

    * + * @return null|string */ public function getCode(); @@ -104,6 +113,7 @@ public function getCode(); /** *

    Reference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.

    * + * @return null|CartDiscountReferenceCollection */ public function getCartDiscounts(); @@ -111,6 +121,7 @@ public function getCartDiscounts(); /** *

    DiscountCode can only be applied to Carts that match this predicate.

    * + * @return null|string */ public function getCartPredicate(); @@ -118,6 +129,7 @@ public function getCartPredicate(); /** *

    Indicates if the DiscountCode is active and can be applied to the Cart.

    * + * @return null|bool */ public function getIsActive(); @@ -126,6 +138,7 @@ public function getIsActive(); *

    Array generated from the Cart predicate. * It contains the references of all the resources that are addressed in the predicate.

    * + * @return null|ReferenceCollection */ public function getReferences(); @@ -134,6 +147,7 @@ public function getReferences(); *

    Number of times the DiscountCode can be applied. * DiscountCode application is counted at the time of Order creation or edit. However, Order cancellation or deletion does not decrement the count.

    * + * @return null|int */ public function getMaxApplications(); @@ -142,6 +156,7 @@ public function getMaxApplications(); *

    Number of times the DiscountCode can be applied per Customer (anonymous Carts are not supported). * DiscountCode application is counted at the time of Order creation or edit. However, Order cancellation or deletion does not decrement the count.

    * + * @return null|int */ public function getMaxApplicationsPerCustomer(); @@ -149,6 +164,7 @@ public function getMaxApplicationsPerCustomer(); /** *

    Custom Fields of the DiscountCode.

    * + * @return null|CustomFields */ public function getCustom(); @@ -156,6 +172,7 @@ public function getCustom(); /** *

    Groups to which the DiscountCode belongs to.

    * + * @return null|array */ public function getGroups(); @@ -163,6 +180,7 @@ public function getGroups(); /** *

    Date and time (UTC) from which the DiscountCode is effective.

    * + * @return null|DateTimeImmutable */ public function getValidFrom(); @@ -170,6 +188,7 @@ public function getValidFrom(); /** *

    Date and time (UTC) until which the DiscountCode is effective.

    * + * @return null|DateTimeImmutable */ public function getValidUntil(); @@ -178,6 +197,7 @@ public function getValidUntil(); *

    Used and managed by the API and must not be used in customer logic. * The value can change at any time due to internal and external factors.

    * + * @return null|int */ public function getApplicationVersion(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeBuilder.php index c3efe5d21b9..c09f2c4156f 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeBuilder.php @@ -34,101 +34,121 @@ final class DiscountCodeBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?string */ private $code; /** + * @var ?CartDiscountReferenceCollection */ private $cartDiscounts; /** + * @var ?string */ private $cartPredicate; /** + * @var ?bool */ private $isActive; /** + * @var ?ReferenceCollection */ private $references; /** + * @var ?int */ private $maxApplications; /** + * @var ?int */ private $maxApplicationsPerCustomer; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var ?array */ private $groups; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; /** + * @var ?int */ private $applicationVersion; @@ -136,6 +156,7 @@ final class DiscountCodeBuilder implements Builder /** *

    Unique identifier of the DiscountCode.

    * + * @return null|string */ public function getId() @@ -146,6 +167,7 @@ public function getId() /** *

    Current version of the DiscountCode.

    * + * @return null|int */ public function getVersion() @@ -156,6 +178,7 @@ public function getVersion() /** *

    Date and time (UTC) the DiscountCode was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -166,6 +189,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the DiscountCode was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -176,6 +200,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -186,6 +211,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -196,6 +222,7 @@ public function getCreatedBy() /** *

    Name of the DiscountCode.

    * + * @return null|LocalizedString */ public function getName() @@ -206,6 +233,7 @@ public function getName() /** *

    Description of the DiscountCode.

    * + * @return null|LocalizedString */ public function getDescription() @@ -216,6 +244,7 @@ public function getDescription() /** *

    User-defined unique identifier of the DiscountCode added to the Cart to apply the related CartDiscounts.

    * + * @return null|string */ public function getCode() @@ -226,6 +255,7 @@ public function getCode() /** *

    Reference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.

    * + * @return null|CartDiscountReferenceCollection */ public function getCartDiscounts() @@ -236,6 +266,7 @@ public function getCartDiscounts() /** *

    DiscountCode can only be applied to Carts that match this predicate.

    * + * @return null|string */ public function getCartPredicate() @@ -246,6 +277,7 @@ public function getCartPredicate() /** *

    Indicates if the DiscountCode is active and can be applied to the Cart.

    * + * @return null|bool */ public function getIsActive() @@ -257,6 +289,7 @@ public function getIsActive() *

    Array generated from the Cart predicate. * It contains the references of all the resources that are addressed in the predicate.

    * + * @return null|ReferenceCollection */ public function getReferences() @@ -268,6 +301,7 @@ public function getReferences() *

    Number of times the DiscountCode can be applied. * DiscountCode application is counted at the time of Order creation or edit. However, Order cancellation or deletion does not decrement the count.

    * + * @return null|int */ public function getMaxApplications() @@ -279,6 +313,7 @@ public function getMaxApplications() *

    Number of times the DiscountCode can be applied per Customer (anonymous Carts are not supported). * DiscountCode application is counted at the time of Order creation or edit. However, Order cancellation or deletion does not decrement the count.

    * + * @return null|int */ public function getMaxApplicationsPerCustomer() @@ -289,6 +324,7 @@ public function getMaxApplicationsPerCustomer() /** *

    Custom Fields of the DiscountCode.

    * + * @return null|CustomFields */ public function getCustom() @@ -299,6 +335,7 @@ public function getCustom() /** *

    Groups to which the DiscountCode belongs to.

    * + * @return null|array */ public function getGroups() @@ -309,6 +346,7 @@ public function getGroups() /** *

    Date and time (UTC) from which the DiscountCode is effective.

    * + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -319,6 +357,7 @@ public function getValidFrom() /** *

    Date and time (UTC) until which the DiscountCode is effective.

    * + * @return null|DateTimeImmutable */ public function getValidUntil() @@ -330,6 +369,7 @@ public function getValidUntil() *

    Used and managed by the API and must not be used in customer logic. * The value can change at any time due to internal and external factors.

    * + * @return null|int */ public function getApplicationVersion() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeCartDiscountsAction.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeCartDiscountsAction.php index 0e5f4f40157..439e60b17e4 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeCartDiscountsAction.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeCartDiscountsAction.php @@ -19,6 +19,7 @@ interface DiscountCodeChangeCartDiscountsAction extends DiscountCodeUpdateAction /** *

    New value to set.

    * + * @return null|CartDiscountResourceIdentifierCollection */ public function getCartDiscounts(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeCartDiscountsActionBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeCartDiscountsActionBuilder.php index 145321797c2..8f85c2953a3 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeCartDiscountsActionBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeCartDiscountsActionBuilder.php @@ -22,6 +22,7 @@ final class DiscountCodeChangeCartDiscountsActionBuilder implements Builder { /** + * @var ?CartDiscountResourceIdentifierCollection */ private $cartDiscounts; @@ -29,6 +30,7 @@ final class DiscountCodeChangeCartDiscountsActionBuilder implements Builder /** *

    New value to set.

    * + * @return null|CartDiscountResourceIdentifierCollection */ public function getCartDiscounts() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeCartDiscountsActionModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeCartDiscountsActionModel.php index 9b205ea77eb..b3ef75bc0b8 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeCartDiscountsActionModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeCartDiscountsActionModel.php @@ -22,11 +22,13 @@ final class DiscountCodeChangeCartDiscountsActionModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'changeCartDiscounts'; /** + * * @var ?string */ protected $action; /** + * * @var ?CartDiscountResourceIdentifierCollection */ protected $cartDiscounts; @@ -36,13 +38,15 @@ final class DiscountCodeChangeCartDiscountsActionModel extends JsonObjectModel i * @psalm-suppress MissingParamType */ public function __construct( - ?CartDiscountResourceIdentifierCollection $cartDiscounts = null + ?CartDiscountResourceIdentifierCollection $cartDiscounts = null, + ?string $action = null ) { $this->cartDiscounts = $cartDiscounts; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() /** *

    New value to set.

    * + * * @return null|CartDiscountResourceIdentifierCollection */ public function getCartDiscounts() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeGroupsAction.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeGroupsAction.php index 38c5540c93f..ec399190556 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeGroupsAction.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeGroupsAction.php @@ -18,6 +18,7 @@ interface DiscountCodeChangeGroupsAction extends DiscountCodeUpdateAction /** *

    New value to set. An empty array removes the DiscountCode from all groups.

    * + * @return null|array */ public function getGroups(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeGroupsActionBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeGroupsActionBuilder.php index 3a848d6577c..a7612c80177 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeGroupsActionBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeGroupsActionBuilder.php @@ -21,6 +21,7 @@ final class DiscountCodeChangeGroupsActionBuilder implements Builder { /** + * @var ?array */ private $groups; @@ -28,6 +29,7 @@ final class DiscountCodeChangeGroupsActionBuilder implements Builder /** *

    New value to set. An empty array removes the DiscountCode from all groups.

    * + * @return null|array */ public function getGroups() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeGroupsActionModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeGroupsActionModel.php index 6e59bc94119..26d5257900e 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeGroupsActionModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeGroupsActionModel.php @@ -21,11 +21,13 @@ final class DiscountCodeChangeGroupsActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'changeGroups'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $groups; @@ -35,13 +37,15 @@ final class DiscountCodeChangeGroupsActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?array $groups = null + ?array $groups = null, + ?string $action = null ) { $this->groups = $groups; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    New value to set. An empty array removes the DiscountCode from all groups.

    * + * * @return null|array */ public function getGroups() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeIsActiveAction.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeIsActiveAction.php index 3382a71afb2..22302a0cc1b 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeIsActiveAction.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeIsActiveAction.php @@ -18,6 +18,7 @@ interface DiscountCodeChangeIsActiveAction extends DiscountCodeUpdateAction /** *

    New value to set. Set to true to activate the DiscountCode for all matching Discounts.

    * + * @return null|bool */ public function getIsActive(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeIsActiveActionBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeIsActiveActionBuilder.php index 83fd80437f0..6edfc9bd93d 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeIsActiveActionBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeIsActiveActionBuilder.php @@ -21,6 +21,7 @@ final class DiscountCodeChangeIsActiveActionBuilder implements Builder { /** + * @var ?bool */ private $isActive; @@ -28,6 +29,7 @@ final class DiscountCodeChangeIsActiveActionBuilder implements Builder /** *

    New value to set. Set to true to activate the DiscountCode for all matching Discounts.

    * + * @return null|bool */ public function getIsActive() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeIsActiveActionModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeIsActiveActionModel.php index 18b40ac8855..f93fc9b51b8 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeIsActiveActionModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeChangeIsActiveActionModel.php @@ -21,11 +21,13 @@ final class DiscountCodeChangeIsActiveActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'changeIsActive'; /** + * * @var ?string */ protected $action; /** + * * @var ?bool */ protected $isActive; @@ -35,13 +37,15 @@ final class DiscountCodeChangeIsActiveActionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?bool $isActive = null + ?bool $isActive = null, + ?string $action = null ) { $this->isActive = $isActive; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    New value to set. Set to true to activate the DiscountCode for all matching Discounts.

    * + * * @return null|bool */ public function getIsActive() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeDraft.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeDraft.php index 1f159d3434a..c9eaf140c07 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeDraft.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeDraft.php @@ -33,6 +33,7 @@ interface DiscountCodeDraft extends JsonObject /** *

    Name of the DiscountCode.

    * + * @return null|LocalizedString */ public function getName(); @@ -40,6 +41,7 @@ public function getName(); /** *

    Description of the DiscountCode.

    * + * @return null|LocalizedString */ public function getDescription(); @@ -48,6 +50,7 @@ public function getDescription(); *

    User-defined unique identifier for the DiscountCode that can be added to the Cart to apply the related CartDiscounts. * It cannot be modified after the DiscountCode is created.

    * + * @return null|string */ public function getCode(); @@ -55,6 +58,7 @@ public function getCode(); /** *

    Specify what CartDiscounts the API applies when you add the DiscountCode to the Cart.

    * + * @return null|CartDiscountResourceIdentifierCollection */ public function getCartDiscounts(); @@ -62,6 +66,7 @@ public function getCartDiscounts(); /** *

    DiscountCode can only be applied to Carts that match this predicate.

    * + * @return null|string */ public function getCartPredicate(); @@ -69,6 +74,7 @@ public function getCartPredicate(); /** *

    Only active DiscountCodes can be applied to the Cart.

    * + * @return null|bool */ public function getIsActive(); @@ -76,6 +82,7 @@ public function getIsActive(); /** *

    Number of times the DiscountCode can be applied.

    * + * @return null|int */ public function getMaxApplications(); @@ -83,6 +90,7 @@ public function getMaxApplications(); /** *

    Number of times the DiscountCode can be applied per Customer.

    * + * @return null|int */ public function getMaxApplicationsPerCustomer(); @@ -90,6 +98,7 @@ public function getMaxApplicationsPerCustomer(); /** *

    Custom Fields for the DiscountCode.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -97,6 +106,7 @@ public function getCustom(); /** *

    Groups to which the DiscountCode will belong to.

    * + * @return null|array */ public function getGroups(); @@ -104,6 +114,7 @@ public function getGroups(); /** *

    Date and time (UTC) from which the DiscountCode is effective. Must be earlier than validUntil.

    * + * @return null|DateTimeImmutable */ public function getValidFrom(); @@ -111,6 +122,7 @@ public function getValidFrom(); /** *

    Date and time (UTC) until which the DiscountCode is effective. Must be later than validFrom.

    * + * @return null|DateTimeImmutable */ public function getValidUntil(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeDraftBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeDraftBuilder.php index 6443ac82221..7d583cc48ab 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeDraftBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeDraftBuilder.php @@ -27,61 +27,73 @@ final class DiscountCodeDraftBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?string */ private $code; /** + * @var ?CartDiscountResourceIdentifierCollection */ private $cartDiscounts; /** + * @var ?string */ private $cartPredicate; /** + * @var ?bool */ private $isActive; /** + * @var ?int */ private $maxApplications; /** + * @var ?int */ private $maxApplicationsPerCustomer; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var ?array */ private $groups; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; @@ -89,6 +101,7 @@ final class DiscountCodeDraftBuilder implements Builder /** *

    Name of the DiscountCode.

    * + * @return null|LocalizedString */ public function getName() @@ -99,6 +112,7 @@ public function getName() /** *

    Description of the DiscountCode.

    * + * @return null|LocalizedString */ public function getDescription() @@ -110,6 +124,7 @@ public function getDescription() *

    User-defined unique identifier for the DiscountCode that can be added to the Cart to apply the related CartDiscounts. * It cannot be modified after the DiscountCode is created.

    * + * @return null|string */ public function getCode() @@ -120,6 +135,7 @@ public function getCode() /** *

    Specify what CartDiscounts the API applies when you add the DiscountCode to the Cart.

    * + * @return null|CartDiscountResourceIdentifierCollection */ public function getCartDiscounts() @@ -130,6 +146,7 @@ public function getCartDiscounts() /** *

    DiscountCode can only be applied to Carts that match this predicate.

    * + * @return null|string */ public function getCartPredicate() @@ -140,6 +157,7 @@ public function getCartPredicate() /** *

    Only active DiscountCodes can be applied to the Cart.

    * + * @return null|bool */ public function getIsActive() @@ -150,6 +168,7 @@ public function getIsActive() /** *

    Number of times the DiscountCode can be applied.

    * + * @return null|int */ public function getMaxApplications() @@ -160,6 +179,7 @@ public function getMaxApplications() /** *

    Number of times the DiscountCode can be applied per Customer.

    * + * @return null|int */ public function getMaxApplicationsPerCustomer() @@ -170,6 +190,7 @@ public function getMaxApplicationsPerCustomer() /** *

    Custom Fields for the DiscountCode.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -180,6 +201,7 @@ public function getCustom() /** *

    Groups to which the DiscountCode will belong to.

    * + * @return null|array */ public function getGroups() @@ -190,6 +212,7 @@ public function getGroups() /** *

    Date and time (UTC) from which the DiscountCode is effective. Must be earlier than validUntil.

    * + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -200,6 +223,7 @@ public function getValidFrom() /** *

    Date and time (UTC) until which the DiscountCode is effective. Must be later than validFrom.

    * + * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeDraftModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeDraftModel.php index 612cb507f08..c92bb774cdb 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeDraftModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeDraftModel.php @@ -26,61 +26,73 @@ final class DiscountCodeDraftModel extends JsonObjectModel implements DiscountCodeDraft { /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?string */ protected $code; /** + * * @var ?CartDiscountResourceIdentifierCollection */ protected $cartDiscounts; /** + * * @var ?string */ protected $cartPredicate; /** + * * @var ?bool */ protected $isActive; /** + * * @var ?int */ protected $maxApplications; /** + * * @var ?int */ protected $maxApplicationsPerCustomer; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?array */ protected $groups; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; @@ -120,6 +132,7 @@ public function __construct( /** *

    Name of the DiscountCode.

    * + * * @return null|LocalizedString */ public function getName() @@ -140,6 +153,7 @@ public function getName() /** *

    Description of the DiscountCode.

    * + * * @return null|LocalizedString */ public function getDescription() @@ -161,6 +175,7 @@ public function getDescription() *

    User-defined unique identifier for the DiscountCode that can be added to the Cart to apply the related CartDiscounts. * It cannot be modified after the DiscountCode is created.

    * + * * @return null|string */ public function getCode() @@ -180,6 +195,7 @@ public function getCode() /** *

    Specify what CartDiscounts the API applies when you add the DiscountCode to the Cart.

    * + * * @return null|CartDiscountResourceIdentifierCollection */ public function getCartDiscounts() @@ -199,6 +215,7 @@ public function getCartDiscounts() /** *

    DiscountCode can only be applied to Carts that match this predicate.

    * + * * @return null|string */ public function getCartPredicate() @@ -218,6 +235,7 @@ public function getCartPredicate() /** *

    Only active DiscountCodes can be applied to the Cart.

    * + * * @return null|bool */ public function getIsActive() @@ -237,6 +255,7 @@ public function getIsActive() /** *

    Number of times the DiscountCode can be applied.

    * + * * @return null|int */ public function getMaxApplications() @@ -256,6 +275,7 @@ public function getMaxApplications() /** *

    Number of times the DiscountCode can be applied per Customer.

    * + * * @return null|int */ public function getMaxApplicationsPerCustomer() @@ -275,6 +295,7 @@ public function getMaxApplicationsPerCustomer() /** *

    Custom Fields for the DiscountCode.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -295,6 +316,7 @@ public function getCustom() /** *

    Groups to which the DiscountCode will belong to.

    * + * * @return null|array */ public function getGroups() @@ -314,6 +336,7 @@ public function getGroups() /** *

    Date and time (UTC) from which the DiscountCode is effective. Must be earlier than validUntil.

    * + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -337,6 +360,7 @@ public function getValidFrom() /** *

    Date and time (UTC) until which the DiscountCode is effective. Must be later than validFrom.

    * + * * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeModel.php index f603a788e89..d0492fcbe19 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeModel.php @@ -33,101 +33,121 @@ final class DiscountCodeModel extends JsonObjectModel implements DiscountCode { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?string */ protected $code; /** + * * @var ?CartDiscountReferenceCollection */ protected $cartDiscounts; /** + * * @var ?string */ protected $cartPredicate; /** + * * @var ?bool */ protected $isActive; /** + * * @var ?ReferenceCollection */ protected $references; /** + * * @var ?int */ protected $maxApplications; /** + * * @var ?int */ protected $maxApplicationsPerCustomer; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?array */ protected $groups; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; /** + * * @var ?int */ protected $applicationVersion; @@ -183,6 +203,7 @@ public function __construct( /** *

    Unique identifier of the DiscountCode.

    * + * * @return null|string */ public function getId() @@ -202,6 +223,7 @@ public function getId() /** *

    Current version of the DiscountCode.

    * + * * @return null|int */ public function getVersion() @@ -221,6 +243,7 @@ public function getVersion() /** *

    Date and time (UTC) the DiscountCode was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -244,6 +267,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the DiscountCode was last updated.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -267,6 +291,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -287,6 +312,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -307,6 +333,7 @@ public function getCreatedBy() /** *

    Name of the DiscountCode.

    * + * * @return null|LocalizedString */ public function getName() @@ -327,6 +354,7 @@ public function getName() /** *

    Description of the DiscountCode.

    * + * * @return null|LocalizedString */ public function getDescription() @@ -347,6 +375,7 @@ public function getDescription() /** *

    User-defined unique identifier of the DiscountCode added to the Cart to apply the related CartDiscounts.

    * + * * @return null|string */ public function getCode() @@ -366,6 +395,7 @@ public function getCode() /** *

    Reference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.

    * + * * @return null|CartDiscountReferenceCollection */ public function getCartDiscounts() @@ -385,6 +415,7 @@ public function getCartDiscounts() /** *

    DiscountCode can only be applied to Carts that match this predicate.

    * + * * @return null|string */ public function getCartPredicate() @@ -404,6 +435,7 @@ public function getCartPredicate() /** *

    Indicates if the DiscountCode is active and can be applied to the Cart.

    * + * * @return null|bool */ public function getIsActive() @@ -424,6 +456,7 @@ public function getIsActive() *

    Array generated from the Cart predicate. * It contains the references of all the resources that are addressed in the predicate.

    * + * * @return null|ReferenceCollection */ public function getReferences() @@ -444,6 +477,7 @@ public function getReferences() *

    Number of times the DiscountCode can be applied. * DiscountCode application is counted at the time of Order creation or edit. However, Order cancellation or deletion does not decrement the count.

    * + * * @return null|int */ public function getMaxApplications() @@ -464,6 +498,7 @@ public function getMaxApplications() *

    Number of times the DiscountCode can be applied per Customer (anonymous Carts are not supported). * DiscountCode application is counted at the time of Order creation or edit. However, Order cancellation or deletion does not decrement the count.

    * + * * @return null|int */ public function getMaxApplicationsPerCustomer() @@ -483,6 +518,7 @@ public function getMaxApplicationsPerCustomer() /** *

    Custom Fields of the DiscountCode.

    * + * * @return null|CustomFields */ public function getCustom() @@ -503,6 +539,7 @@ public function getCustom() /** *

    Groups to which the DiscountCode belongs to.

    * + * * @return null|array */ public function getGroups() @@ -522,6 +559,7 @@ public function getGroups() /** *

    Date and time (UTC) from which the DiscountCode is effective.

    * + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -545,6 +583,7 @@ public function getValidFrom() /** *

    Date and time (UTC) until which the DiscountCode is effective.

    * + * * @return null|DateTimeImmutable */ public function getValidUntil() @@ -569,6 +608,7 @@ public function getValidUntil() *

    Used and managed by the API and must not be used in customer logic. * The value can change at any time due to internal and external factors.

    * + * * @return null|int */ public function getApplicationVersion() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodePagedQueryResponse.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodePagedQueryResponse.php index 70de651b5ff..68b97b1bc9c 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodePagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodePagedQueryResponse.php @@ -22,6 +22,7 @@ interface DiscountCodePagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    DiscountCodes matching the query.

    * + * @return null|DiscountCodeCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodePagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodePagedQueryResponseBuilder.php index 9e9fbe8218a..ed7e7355127 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodePagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodePagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class DiscountCodePagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?DiscountCodeCollection */ private $results; @@ -48,6 +53,7 @@ final class DiscountCodePagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    DiscountCodes matching the query.

    * + * @return null|DiscountCodeCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodePagedQueryResponseModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodePagedQueryResponseModel.php index 980565c410c..b58ad1b1f93 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodePagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodePagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class DiscountCodePagedQueryResponseModel extends JsonObjectModel implements DiscountCodePagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?DiscountCodeCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    DiscountCodes matching the query.

    * + * * @return null|DiscountCodeCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeReference.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeReference.php index 2972bd3d83b..a203dd26b54 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeReference.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeReference.php @@ -19,6 +19,7 @@ interface DiscountCodeReference extends Reference /** *

    Contains the representation of the expanded DiscountCode. Only present in responses to requests with Reference Expansion for DiscountCodes.

    * + * @return null|DiscountCode */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

    Unique identifier of the referenced DiscountCode.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeReferenceBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeReferenceBuilder.php index a2be0c8c945..615962c688e 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeReferenceBuilder.php @@ -23,11 +23,13 @@ final class DiscountCodeReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|DiscountCode|DiscountCodeBuilder */ private $obj; @@ -35,6 +37,7 @@ final class DiscountCodeReferenceBuilder implements Builder /** *

    Unique identifier of the referenced DiscountCode.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded DiscountCode. Only present in responses to requests with Reference Expansion for DiscountCodes.

    * + * @return null|DiscountCode */ public function getObj() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeReferenceModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeReferenceModel.php index 0aefc09d70f..ec93f7ca5f9 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeReferenceModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeReferenceModel.php @@ -23,16 +23,19 @@ final class DiscountCodeReferenceModel extends JsonObjectModel implements Discou { public const DISCRIMINATOR_VALUE = 'discount-code'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?DiscountCode */ protected $obj; @@ -43,16 +46,18 @@ final class DiscountCodeReferenceModel extends JsonObjectModel implements Discou */ public function __construct( ?string $id = null, - ?DiscountCode $obj = null + ?DiscountCode $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced DiscountCode.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded DiscountCode. Only present in responses to requests with Reference Expansion for DiscountCodes.

    * + * * @return null|DiscountCode */ public function getObj() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeResourceIdentifier.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeResourceIdentifier.php index 73da87751a5..ae1785814c5 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeResourceIdentifier.php @@ -17,6 +17,7 @@ interface DiscountCodeResourceIdentifier extends ResourceIdentifier /** *

    Unique identifier of the referenced DiscountCode. Either id or key is required.

    * + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

    User-defined unique identifier of the referenced DiscountCode. Either id or key is required.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeResourceIdentifierBuilder.php index 02b2e71e1b0..a0e3f80587c 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class DiscountCodeResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class DiscountCodeResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced DiscountCode. Either id or key is required.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced DiscountCode. Either id or key is required.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeResourceIdentifierModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeResourceIdentifierModel.php index 630a0eb85bf..534613400c3 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class DiscountCodeResourceIdentifierModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'discount-code'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class DiscountCodeResourceIdentifierModel extends JsonObjectModel implemen */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced DiscountCode. Either id or key is required.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced DiscountCode. Either id or key is required.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCartPredicateAction.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCartPredicateAction.php index 461b43db582..f6540062ee5 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCartPredicateAction.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCartPredicateAction.php @@ -18,6 +18,7 @@ interface DiscountCodeSetCartPredicateAction extends DiscountCodeUpdateAction /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getCartPredicate(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCartPredicateActionBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCartPredicateActionBuilder.php index ca208303dff..196e6655259 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCartPredicateActionBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCartPredicateActionBuilder.php @@ -21,6 +21,7 @@ final class DiscountCodeSetCartPredicateActionBuilder implements Builder { /** + * @var ?string */ private $cartPredicate; @@ -28,6 +29,7 @@ final class DiscountCodeSetCartPredicateActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getCartPredicate() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCartPredicateActionModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCartPredicateActionModel.php index 0891cf9b433..eddbe787e2e 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCartPredicateActionModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCartPredicateActionModel.php @@ -21,11 +21,13 @@ final class DiscountCodeSetCartPredicateActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setCartPredicate'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $cartPredicate; @@ -35,13 +37,15 @@ final class DiscountCodeSetCartPredicateActionModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?string $cartPredicate = null + ?string $cartPredicate = null, + ?string $action = null ) { $this->cartPredicate = $cartPredicate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|string */ public function getCartPredicate() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomFieldAction.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomFieldAction.php index dea851be62d..16d0609a99a 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface DiscountCodeSetCustomFieldAction extends DiscountCodeUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomFieldActionBuilder.php index 1be64a6bd37..549c284011c 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class DiscountCodeSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class DiscountCodeSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomFieldActionModel.php index 83791036406..e3a6f15b645 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class DiscountCodeSetCustomFieldActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class DiscountCodeSetCustomFieldActionModel extends JsonObjectModel implem */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomTypeAction.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomTypeAction.php index 62df8209f0e..2e47b46d3be 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface DiscountCodeSetCustomTypeAction extends DiscountCodeUpdateAction *

    Defines the Type that extends the DiscountCode with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the DiscountCode.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the DiscountCode.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomTypeActionBuilder.php index f75f4b0e8a6..9be68d62106 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class DiscountCodeSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class DiscountCodeSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the DiscountCode with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the DiscountCode.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the DiscountCode.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomTypeActionModel.php index 1c64810a554..690862abde2 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class DiscountCodeSetCustomTypeActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class DiscountCodeSetCustomTypeActionModel extends JsonObjectModel impleme */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the DiscountCode with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the DiscountCode.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the DiscountCode.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetDescriptionAction.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetDescriptionAction.php index 679caeeed60..c4fddbd3a22 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetDescriptionAction.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetDescriptionAction.php @@ -19,6 +19,7 @@ interface DiscountCodeSetDescriptionAction extends DiscountCodeUpdateAction /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getDescription(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetDescriptionActionBuilder.php index 579319f6f36..9d7236a3a0f 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetDescriptionActionBuilder.php @@ -23,6 +23,7 @@ final class DiscountCodeSetDescriptionActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; @@ -30,6 +31,7 @@ final class DiscountCodeSetDescriptionActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetDescriptionActionModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetDescriptionActionModel.php index b262241ad32..43997a04ecc 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetDescriptionActionModel.php @@ -23,11 +23,13 @@ final class DiscountCodeSetDescriptionActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $description; @@ -37,13 +39,15 @@ final class DiscountCodeSetDescriptionActionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $description = null + ?LocalizedString $description = null, + ?string $action = null ) { $this->description = $description; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsAction.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsAction.php index cf0ce1c8029..68c2d34b405 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsAction.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsAction.php @@ -18,6 +18,7 @@ interface DiscountCodeSetMaxApplicationsAction extends DiscountCodeUpdateAction /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|int */ public function getMaxApplications(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsActionBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsActionBuilder.php index 89634c63e1d..e5926f300c3 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsActionBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsActionBuilder.php @@ -21,6 +21,7 @@ final class DiscountCodeSetMaxApplicationsActionBuilder implements Builder { /** + * @var ?int */ private $maxApplications; @@ -28,6 +29,7 @@ final class DiscountCodeSetMaxApplicationsActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|int */ public function getMaxApplications() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsActionModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsActionModel.php index 73d18dcfb23..9e4f0d34748 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsActionModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsActionModel.php @@ -21,11 +21,13 @@ final class DiscountCodeSetMaxApplicationsActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'setMaxApplications'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $maxApplications; @@ -35,13 +37,15 @@ final class DiscountCodeSetMaxApplicationsActionModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?int $maxApplications = null + ?int $maxApplications = null, + ?string $action = null ) { $this->maxApplications = $maxApplications; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|int */ public function getMaxApplications() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsPerCustomerAction.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsPerCustomerAction.php index 6f7a2b57091..1afb026a109 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsPerCustomerAction.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsPerCustomerAction.php @@ -18,6 +18,7 @@ interface DiscountCodeSetMaxApplicationsPerCustomerAction extends DiscountCodeUp /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|int */ public function getMaxApplicationsPerCustomer(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsPerCustomerActionBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsPerCustomerActionBuilder.php index 4a3f7a56143..78b4c7a2a14 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsPerCustomerActionBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsPerCustomerActionBuilder.php @@ -21,6 +21,7 @@ final class DiscountCodeSetMaxApplicationsPerCustomerActionBuilder implements Builder { /** + * @var ?int */ private $maxApplicationsPerCustomer; @@ -28,6 +29,7 @@ final class DiscountCodeSetMaxApplicationsPerCustomerActionBuilder implements Bu /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|int */ public function getMaxApplicationsPerCustomer() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsPerCustomerActionModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsPerCustomerActionModel.php index 20b988964fe..09b1f6dbee5 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsPerCustomerActionModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetMaxApplicationsPerCustomerActionModel.php @@ -21,11 +21,13 @@ final class DiscountCodeSetMaxApplicationsPerCustomerActionModel extends JsonObj { public const DISCRIMINATOR_VALUE = 'setMaxApplicationsPerCustomer'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $maxApplicationsPerCustomer; @@ -35,13 +37,15 @@ final class DiscountCodeSetMaxApplicationsPerCustomerActionModel extends JsonObj * @psalm-suppress MissingParamType */ public function __construct( - ?int $maxApplicationsPerCustomer = null + ?int $maxApplicationsPerCustomer = null, + ?string $action = null ) { $this->maxApplicationsPerCustomer = $maxApplicationsPerCustomer; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|int */ public function getMaxApplicationsPerCustomer() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetNameAction.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetNameAction.php index c1f248a613f..ae720b6e01c 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetNameAction.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetNameAction.php @@ -19,6 +19,7 @@ interface DiscountCodeSetNameAction extends DiscountCodeUpdateAction /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetNameActionBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetNameActionBuilder.php index 83d37ce6903..ff28d31a693 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetNameActionBuilder.php @@ -23,6 +23,7 @@ final class DiscountCodeSetNameActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; @@ -30,6 +31,7 @@ final class DiscountCodeSetNameActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetNameActionModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetNameActionModel.php index 84a07b82188..ed8d2be3a8f 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetNameActionModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetNameActionModel.php @@ -23,11 +23,13 @@ final class DiscountCodeSetNameActionModel extends JsonObjectModel implements Di { public const DISCRIMINATOR_VALUE = 'setName'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $name; @@ -37,13 +39,15 @@ final class DiscountCodeSetNameActionModel extends JsonObjectModel implements Di * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromAction.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromAction.php index 621d831fc3c..48605bbb156 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromAction.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromAction.php @@ -19,6 +19,7 @@ interface DiscountCodeSetValidFromAction extends DiscountCodeUpdateAction /** *

    Value to set that must be earlier than validUntil. If empty, any existing value will be removed.

    * + * @return null|DateTimeImmutable */ public function getValidFrom(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromActionBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromActionBuilder.php index 610d414fbe6..1692e4bde15 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromActionBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromActionBuilder.php @@ -22,6 +22,7 @@ final class DiscountCodeSetValidFromActionBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $validFrom; @@ -29,6 +30,7 @@ final class DiscountCodeSetValidFromActionBuilder implements Builder /** *

    Value to set that must be earlier than validUntil. If empty, any existing value will be removed.

    * + * @return null|DateTimeImmutable */ public function getValidFrom() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromActionModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromActionModel.php index b6a578a85d6..851f4c86b19 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromActionModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromActionModel.php @@ -22,11 +22,13 @@ final class DiscountCodeSetValidFromActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'setValidFrom'; /** + * * @var ?string */ protected $action; /** + * * @var ?DateTimeImmutable */ protected $validFrom; @@ -36,13 +38,15 @@ final class DiscountCodeSetValidFromActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutable $validFrom = null + ?DateTimeImmutable $validFrom = null, + ?string $action = null ) { $this->validFrom = $validFrom; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() /** *

    Value to set that must be earlier than validUntil. If empty, any existing value will be removed.

    * + * * @return null|DateTimeImmutable */ public function getValidFrom() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromAndUntilAction.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromAndUntilAction.php index 2730b9629d3..d9870c5f8a9 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromAndUntilAction.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromAndUntilAction.php @@ -20,6 +20,7 @@ interface DiscountCodeSetValidFromAndUntilAction extends DiscountCodeUpdateActio /** *

    Value to set that must be earlier than validUntil. If empty, any existing value will be removed.

    * + * @return null|DateTimeImmutable */ public function getValidFrom(); @@ -27,6 +28,7 @@ public function getValidFrom(); /** *

    Value to set that must be later than validFrom. If empty, any existing value will be removed.

    * + * @return null|DateTimeImmutable */ public function getValidUntil(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromAndUntilActionBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromAndUntilActionBuilder.php index 6440ed7368c..e80d22abe2e 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromAndUntilActionBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromAndUntilActionBuilder.php @@ -22,11 +22,13 @@ final class DiscountCodeSetValidFromAndUntilActionBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; @@ -34,6 +36,7 @@ final class DiscountCodeSetValidFromAndUntilActionBuilder implements Builder /** *

    Value to set that must be earlier than validUntil. If empty, any existing value will be removed.

    * + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -44,6 +47,7 @@ public function getValidFrom() /** *

    Value to set that must be later than validFrom. If empty, any existing value will be removed.

    * + * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromAndUntilActionModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromAndUntilActionModel.php index 480edfe22bb..f31d6c1fb0a 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromAndUntilActionModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidFromAndUntilActionModel.php @@ -22,16 +22,19 @@ final class DiscountCodeSetValidFromAndUntilActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setValidFromAndUntil'; /** + * * @var ?string */ protected $action; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; @@ -42,14 +45,16 @@ final class DiscountCodeSetValidFromAndUntilActionModel extends JsonObjectModel */ public function __construct( ?DateTimeImmutable $validFrom = null, - ?DateTimeImmutable $validUntil = null + ?DateTimeImmutable $validUntil = null, + ?string $action = null ) { $this->validFrom = $validFrom; $this->validUntil = $validUntil; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -69,6 +74,7 @@ public function getAction() /** *

    Value to set that must be earlier than validUntil. If empty, any existing value will be removed.

    * + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -92,6 +98,7 @@ public function getValidFrom() /** *

    Value to set that must be later than validFrom. If empty, any existing value will be removed.

    * + * * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidUntilAction.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidUntilAction.php index 97acc716a58..103eefdcae8 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidUntilAction.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidUntilAction.php @@ -19,6 +19,7 @@ interface DiscountCodeSetValidUntilAction extends DiscountCodeUpdateAction /** *

    Value to set that must be later than validFrom. If empty, any existing value will be removed.

    * + * @return null|DateTimeImmutable */ public function getValidUntil(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidUntilActionBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidUntilActionBuilder.php index b14a3d6820d..bf8c0dbb9a2 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidUntilActionBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidUntilActionBuilder.php @@ -22,6 +22,7 @@ final class DiscountCodeSetValidUntilActionBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $validUntil; @@ -29,6 +30,7 @@ final class DiscountCodeSetValidUntilActionBuilder implements Builder /** *

    Value to set that must be later than validFrom. If empty, any existing value will be removed.

    * + * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidUntilActionModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidUntilActionModel.php index bf8c580a1b0..1294d0918a6 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidUntilActionModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeSetValidUntilActionModel.php @@ -22,11 +22,13 @@ final class DiscountCodeSetValidUntilActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setValidUntil'; /** + * * @var ?string */ protected $action; /** + * * @var ?DateTimeImmutable */ protected $validUntil; @@ -36,13 +38,15 @@ final class DiscountCodeSetValidUntilActionModel extends JsonObjectModel impleme * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutable $validUntil = null + ?DateTimeImmutable $validUntil = null, + ?string $action = null ) { $this->validUntil = $validUntil; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() /** *

    Value to set that must be later than validFrom. If empty, any existing value will be removed.

    * + * * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdate.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdate.php index 3a2b28f310d..87ac5ba4411 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdate.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdate.php @@ -20,6 +20,7 @@ interface DiscountCodeUpdate extends JsonObject *

    Expected version of the DiscountCode on which the changes should be applied. * If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion(); @@ -27,6 +28,7 @@ public function getVersion(); /** *

    Update actions to be performed on the DiscountCode.

    * + * @return null|DiscountCodeUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdateAction.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdateAction.php index 782cc7e437b..9b77608f8af 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdateAction.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdateAction.php @@ -17,6 +17,7 @@ interface DiscountCodeUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdateActionModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdateActionModel.php index ae5ae743951..ad51d1d136f 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdateActionModel.php @@ -21,6 +21,7 @@ final class DiscountCodeUpdateActionModel extends JsonObjectModel implements Dis { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -49,11 +50,13 @@ final class DiscountCodeUpdateActionModel extends JsonObjectModel implements Dis * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdateBuilder.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdateBuilder.php index 164ac7b2f40..00c07f6c928 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdateBuilder.php @@ -21,11 +21,13 @@ final class DiscountCodeUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?DiscountCodeUpdateActionCollection */ private $actions; @@ -34,6 +36,7 @@ final class DiscountCodeUpdateBuilder implements Builder *

    Expected version of the DiscountCode on which the changes should be applied. * If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion() @@ -44,6 +47,7 @@ public function getVersion() /** *

    Update actions to be performed on the DiscountCode.

    * + * @return null|DiscountCodeUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdateModel.php b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdateModel.php index de562dd788b..4c22b1883a1 100644 --- a/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdateModel.php +++ b/lib/commercetools-api/src/Models/DiscountCode/DiscountCodeUpdateModel.php @@ -20,11 +20,13 @@ final class DiscountCodeUpdateModel extends JsonObjectModel implements DiscountCodeUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?DiscountCodeUpdateActionCollection */ protected $actions; @@ -45,6 +47,7 @@ public function __construct( *

    Expected version of the DiscountCode on which the changes should be applied. * If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * * @return null|int */ public function getVersion() @@ -64,6 +67,7 @@ public function getVersion() /** *

    Update actions to be performed on the DiscountCode.

    * + * * @return null|DiscountCodeUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Error/AccessDeniedErrorBuilder.php b/lib/commercetools-api/src/Models/Error/AccessDeniedErrorBuilder.php index 7a326ef6e0d..2a40b36d570 100644 --- a/lib/commercetools-api/src/Models/Error/AccessDeniedErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/AccessDeniedErrorBuilder.php @@ -21,11 +21,13 @@ final class AccessDeniedErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/AccessDeniedErrorModel.php b/lib/commercetools-api/src/Models/Error/AccessDeniedErrorModel.php index 97461be250e..053e14eaab2 100644 --- a/lib/commercetools-api/src/Models/Error/AccessDeniedErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/AccessDeniedErrorModel.php @@ -21,11 +21,13 @@ final class AccessDeniedErrorModel extends JsonObjectModel implements AccessDeni { public const DISCRIMINATOR_VALUE = 'access_denied'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class AccessDeniedErrorModel extends JsonObjectModel implements AccessDeni * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/AnonymousIdAlreadyInUseErrorBuilder.php b/lib/commercetools-api/src/Models/Error/AnonymousIdAlreadyInUseErrorBuilder.php index 38f65128363..c1e5d5b87d3 100644 --- a/lib/commercetools-api/src/Models/Error/AnonymousIdAlreadyInUseErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/AnonymousIdAlreadyInUseErrorBuilder.php @@ -21,11 +21,13 @@ final class AnonymousIdAlreadyInUseErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/AnonymousIdAlreadyInUseErrorModel.php b/lib/commercetools-api/src/Models/Error/AnonymousIdAlreadyInUseErrorModel.php index a11641cfe35..468f91265f0 100644 --- a/lib/commercetools-api/src/Models/Error/AnonymousIdAlreadyInUseErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/AnonymousIdAlreadyInUseErrorModel.php @@ -21,11 +21,13 @@ final class AnonymousIdAlreadyInUseErrorModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'AnonymousIdAlreadyInUse'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class AnonymousIdAlreadyInUseErrorModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/AttributeDefinitionAlreadyExistsError.php b/lib/commercetools-api/src/Models/Error/AttributeDefinitionAlreadyExistsError.php index 9af0159e411..d94bfa5e31f 100644 --- a/lib/commercetools-api/src/Models/Error/AttributeDefinitionAlreadyExistsError.php +++ b/lib/commercetools-api/src/Models/Error/AttributeDefinitionAlreadyExistsError.php @@ -18,16 +18,19 @@ interface AttributeDefinitionAlreadyExistsError extends ErrorObject public const FIELD_CONFLICTING_ATTRIBUTE_NAME = 'conflictingAttributeName'; /** + * @return null|string */ public function getConflictingProductTypeId(); /** + * @return null|string */ public function getConflictingProductTypeName(); /** + * @return null|string */ public function getConflictingAttributeName(); diff --git a/lib/commercetools-api/src/Models/Error/AttributeDefinitionAlreadyExistsErrorBuilder.php b/lib/commercetools-api/src/Models/Error/AttributeDefinitionAlreadyExistsErrorBuilder.php index bc7aba6fcb7..b18094ec858 100644 --- a/lib/commercetools-api/src/Models/Error/AttributeDefinitionAlreadyExistsErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/AttributeDefinitionAlreadyExistsErrorBuilder.php @@ -21,26 +21,31 @@ final class AttributeDefinitionAlreadyExistsErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $conflictingProductTypeId; /** + * @var ?string */ private $conflictingProductTypeName; /** + * @var ?string */ private $conflictingAttributeName; /** + * @return null|string */ public function getMessage() @@ -49,6 +54,7 @@ public function getMessage() } /** + * @return null|string */ public function getConflictingProductTypeId() @@ -57,6 +63,7 @@ public function getConflictingProductTypeId() } /** + * @return null|string */ public function getConflictingProductTypeName() @@ -65,6 +72,7 @@ public function getConflictingProductTypeName() } /** + * @return null|string */ public function getConflictingAttributeName() diff --git a/lib/commercetools-api/src/Models/Error/AttributeDefinitionAlreadyExistsErrorModel.php b/lib/commercetools-api/src/Models/Error/AttributeDefinitionAlreadyExistsErrorModel.php index 5bed8babaed..ad4818b2a91 100644 --- a/lib/commercetools-api/src/Models/Error/AttributeDefinitionAlreadyExistsErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/AttributeDefinitionAlreadyExistsErrorModel.php @@ -21,26 +21,31 @@ final class AttributeDefinitionAlreadyExistsErrorModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'AttributeDefinitionAlreadyExists'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $conflictingProductTypeId; /** + * * @var ?string */ protected $conflictingProductTypeName; /** + * * @var ?string */ protected $conflictingAttributeName; @@ -53,16 +58,18 @@ public function __construct( ?string $message = null, ?string $conflictingProductTypeId = null, ?string $conflictingProductTypeName = null, - ?string $conflictingAttributeName = null + ?string $conflictingAttributeName = null, + ?string $code = null ) { $this->message = $message; $this->conflictingProductTypeId = $conflictingProductTypeId; $this->conflictingProductTypeName = $conflictingProductTypeName; $this->conflictingAttributeName = $conflictingAttributeName; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -80,6 +87,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -97,6 +105,7 @@ public function getMessage() } /** + * * @return null|string */ public function getConflictingProductTypeId() @@ -114,6 +123,7 @@ public function getConflictingProductTypeId() } /** + * * @return null|string */ public function getConflictingProductTypeName() @@ -131,6 +141,7 @@ public function getConflictingProductTypeName() } /** + * * @return null|string */ public function getConflictingAttributeName() diff --git a/lib/commercetools-api/src/Models/Error/AttributeDefinitionTypeConflictError.php b/lib/commercetools-api/src/Models/Error/AttributeDefinitionTypeConflictError.php index e93999f7d8e..b669c86fad7 100644 --- a/lib/commercetools-api/src/Models/Error/AttributeDefinitionTypeConflictError.php +++ b/lib/commercetools-api/src/Models/Error/AttributeDefinitionTypeConflictError.php @@ -18,16 +18,19 @@ interface AttributeDefinitionTypeConflictError extends ErrorObject public const FIELD_CONFLICTING_ATTRIBUTE_NAME = 'conflictingAttributeName'; /** + * @return null|string */ public function getConflictingProductTypeId(); /** + * @return null|string */ public function getConflictingProductTypeName(); /** + * @return null|string */ public function getConflictingAttributeName(); diff --git a/lib/commercetools-api/src/Models/Error/AttributeDefinitionTypeConflictErrorBuilder.php b/lib/commercetools-api/src/Models/Error/AttributeDefinitionTypeConflictErrorBuilder.php index c95e2fc93c5..d3b8f4e73ff 100644 --- a/lib/commercetools-api/src/Models/Error/AttributeDefinitionTypeConflictErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/AttributeDefinitionTypeConflictErrorBuilder.php @@ -21,26 +21,31 @@ final class AttributeDefinitionTypeConflictErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $conflictingProductTypeId; /** + * @var ?string */ private $conflictingProductTypeName; /** + * @var ?string */ private $conflictingAttributeName; /** + * @return null|string */ public function getMessage() @@ -49,6 +54,7 @@ public function getMessage() } /** + * @return null|string */ public function getConflictingProductTypeId() @@ -57,6 +63,7 @@ public function getConflictingProductTypeId() } /** + * @return null|string */ public function getConflictingProductTypeName() @@ -65,6 +72,7 @@ public function getConflictingProductTypeName() } /** + * @return null|string */ public function getConflictingAttributeName() diff --git a/lib/commercetools-api/src/Models/Error/AttributeDefinitionTypeConflictErrorModel.php b/lib/commercetools-api/src/Models/Error/AttributeDefinitionTypeConflictErrorModel.php index 0b1d174ac93..c93883aa3fb 100644 --- a/lib/commercetools-api/src/Models/Error/AttributeDefinitionTypeConflictErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/AttributeDefinitionTypeConflictErrorModel.php @@ -21,26 +21,31 @@ final class AttributeDefinitionTypeConflictErrorModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'AttributeDefinitionTypeConflict'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $conflictingProductTypeId; /** + * * @var ?string */ protected $conflictingProductTypeName; /** + * * @var ?string */ protected $conflictingAttributeName; @@ -53,16 +58,18 @@ public function __construct( ?string $message = null, ?string $conflictingProductTypeId = null, ?string $conflictingProductTypeName = null, - ?string $conflictingAttributeName = null + ?string $conflictingAttributeName = null, + ?string $code = null ) { $this->message = $message; $this->conflictingProductTypeId = $conflictingProductTypeId; $this->conflictingProductTypeName = $conflictingProductTypeName; $this->conflictingAttributeName = $conflictingAttributeName; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -80,6 +87,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -97,6 +105,7 @@ public function getMessage() } /** + * * @return null|string */ public function getConflictingProductTypeId() @@ -114,6 +123,7 @@ public function getConflictingProductTypeId() } /** + * * @return null|string */ public function getConflictingProductTypeName() @@ -131,6 +141,7 @@ public function getConflictingProductTypeName() } /** + * * @return null|string */ public function getConflictingAttributeName() diff --git a/lib/commercetools-api/src/Models/Error/AttributeNameDoesNotExistError.php b/lib/commercetools-api/src/Models/Error/AttributeNameDoesNotExistError.php index 8d0beacf2b6..e089c37541f 100644 --- a/lib/commercetools-api/src/Models/Error/AttributeNameDoesNotExistError.php +++ b/lib/commercetools-api/src/Models/Error/AttributeNameDoesNotExistError.php @@ -16,6 +16,7 @@ interface AttributeNameDoesNotExistError extends ErrorObject public const FIELD_INVALID_ATTRIBUTE_NAME = 'invalidAttributeName'; /** + * @return null|string */ public function getInvalidAttributeName(); diff --git a/lib/commercetools-api/src/Models/Error/AttributeNameDoesNotExistErrorBuilder.php b/lib/commercetools-api/src/Models/Error/AttributeNameDoesNotExistErrorBuilder.php index 6ec2f1513f1..a4da49a4918 100644 --- a/lib/commercetools-api/src/Models/Error/AttributeNameDoesNotExistErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/AttributeNameDoesNotExistErrorBuilder.php @@ -21,16 +21,19 @@ final class AttributeNameDoesNotExistErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $invalidAttributeName; /** + * @return null|string */ public function getMessage() @@ -39,6 +42,7 @@ public function getMessage() } /** + * @return null|string */ public function getInvalidAttributeName() diff --git a/lib/commercetools-api/src/Models/Error/AttributeNameDoesNotExistErrorModel.php b/lib/commercetools-api/src/Models/Error/AttributeNameDoesNotExistErrorModel.php index 6e7a99aa238..46c39d61280 100644 --- a/lib/commercetools-api/src/Models/Error/AttributeNameDoesNotExistErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/AttributeNameDoesNotExistErrorModel.php @@ -21,16 +21,19 @@ final class AttributeNameDoesNotExistErrorModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'AttributeNameDoesNotExist'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $invalidAttributeName; @@ -41,14 +44,16 @@ final class AttributeNameDoesNotExistErrorModel extends JsonObjectModel implemen */ public function __construct( ?string $message = null, - ?string $invalidAttributeName = null + ?string $invalidAttributeName = null, + ?string $code = null ) { $this->message = $message; $this->invalidAttributeName = $invalidAttributeName; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -66,6 +71,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -83,6 +89,7 @@ public function getMessage() } /** + * * @return null|string */ public function getInvalidAttributeName() diff --git a/lib/commercetools-api/src/Models/Error/BadGatewayErrorBuilder.php b/lib/commercetools-api/src/Models/Error/BadGatewayErrorBuilder.php index b2e6b86fbf9..7cd21234969 100644 --- a/lib/commercetools-api/src/Models/Error/BadGatewayErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/BadGatewayErrorBuilder.php @@ -21,11 +21,13 @@ final class BadGatewayErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/BadGatewayErrorModel.php b/lib/commercetools-api/src/Models/Error/BadGatewayErrorModel.php index ebd4a6916ed..526f2c6ab49 100644 --- a/lib/commercetools-api/src/Models/Error/BadGatewayErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/BadGatewayErrorModel.php @@ -21,11 +21,13 @@ final class BadGatewayErrorModel extends JsonObjectModel implements BadGatewayEr { public const DISCRIMINATOR_VALUE = 'BadGateway'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class BadGatewayErrorModel extends JsonObjectModel implements BadGatewayEr * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/ConcurrentModificationError.php b/lib/commercetools-api/src/Models/Error/ConcurrentModificationError.php index 77128e2d264..3ff95863fe2 100644 --- a/lib/commercetools-api/src/Models/Error/ConcurrentModificationError.php +++ b/lib/commercetools-api/src/Models/Error/ConcurrentModificationError.php @@ -16,6 +16,7 @@ interface ConcurrentModificationError extends ErrorObject public const FIELD_CURRENT_VERSION = 'currentVersion'; /** + * @return null|int */ public function getCurrentVersion(); diff --git a/lib/commercetools-api/src/Models/Error/ConcurrentModificationErrorBuilder.php b/lib/commercetools-api/src/Models/Error/ConcurrentModificationErrorBuilder.php index afb1fd48f54..93bf1585c86 100644 --- a/lib/commercetools-api/src/Models/Error/ConcurrentModificationErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/ConcurrentModificationErrorBuilder.php @@ -21,16 +21,19 @@ final class ConcurrentModificationErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?int */ private $currentVersion; /** + * @return null|string */ public function getMessage() @@ -39,6 +42,7 @@ public function getMessage() } /** + * @return null|int */ public function getCurrentVersion() diff --git a/lib/commercetools-api/src/Models/Error/ConcurrentModificationErrorModel.php b/lib/commercetools-api/src/Models/Error/ConcurrentModificationErrorModel.php index 046518f2cb1..44202687f82 100644 --- a/lib/commercetools-api/src/Models/Error/ConcurrentModificationErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/ConcurrentModificationErrorModel.php @@ -21,16 +21,19 @@ final class ConcurrentModificationErrorModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'ConcurrentModification'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?int */ protected $currentVersion; @@ -41,14 +44,16 @@ final class ConcurrentModificationErrorModel extends JsonObjectModel implements */ public function __construct( ?string $message = null, - ?int $currentVersion = null + ?int $currentVersion = null, + ?string $code = null ) { $this->message = $message; $this->currentVersion = $currentVersion; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -66,6 +71,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -83,6 +89,7 @@ public function getMessage() } /** + * * @return null|int */ public function getCurrentVersion() diff --git a/lib/commercetools-api/src/Models/Error/DiscountCodeNonApplicableError.php b/lib/commercetools-api/src/Models/Error/DiscountCodeNonApplicableError.php index d9c05340311..aaa2bf230aa 100644 --- a/lib/commercetools-api/src/Models/Error/DiscountCodeNonApplicableError.php +++ b/lib/commercetools-api/src/Models/Error/DiscountCodeNonApplicableError.php @@ -22,31 +22,37 @@ interface DiscountCodeNonApplicableError extends ErrorObject public const FIELD_VALIDITY_CHECK_TIME = 'validityCheckTime'; /** + * @return null|string */ public function getDiscountCode(); /** + * @return null|string */ public function getReason(); /** + * @return null|string */ public function getDicountCodeId(); /** + * @return null|DateTimeImmutable */ public function getValidFrom(); /** + * @return null|DateTimeImmutable */ public function getValidUntil(); /** + * @return null|DateTimeImmutable */ public function getValidityCheckTime(); diff --git a/lib/commercetools-api/src/Models/Error/DiscountCodeNonApplicableErrorBuilder.php b/lib/commercetools-api/src/Models/Error/DiscountCodeNonApplicableErrorBuilder.php index e172ec26c0c..99117b0d328 100644 --- a/lib/commercetools-api/src/Models/Error/DiscountCodeNonApplicableErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/DiscountCodeNonApplicableErrorBuilder.php @@ -22,41 +22,49 @@ final class DiscountCodeNonApplicableErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $discountCode; /** + * @var ?string */ private $reason; /** + * @var ?string */ private $dicountCodeId; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; /** + * @var ?DateTimeImmutable */ private $validityCheckTime; /** + * @return null|string */ public function getMessage() @@ -65,6 +73,7 @@ public function getMessage() } /** + * @return null|string */ public function getDiscountCode() @@ -73,6 +82,7 @@ public function getDiscountCode() } /** + * @return null|string */ public function getReason() @@ -81,6 +91,7 @@ public function getReason() } /** + * @return null|string */ public function getDicountCodeId() @@ -89,6 +100,7 @@ public function getDicountCodeId() } /** + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -97,6 +109,7 @@ public function getValidFrom() } /** + * @return null|DateTimeImmutable */ public function getValidUntil() @@ -105,6 +118,7 @@ public function getValidUntil() } /** + * @return null|DateTimeImmutable */ public function getValidityCheckTime() diff --git a/lib/commercetools-api/src/Models/Error/DiscountCodeNonApplicableErrorModel.php b/lib/commercetools-api/src/Models/Error/DiscountCodeNonApplicableErrorModel.php index 2fc0adcdedb..540e9d1a19a 100644 --- a/lib/commercetools-api/src/Models/Error/DiscountCodeNonApplicableErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/DiscountCodeNonApplicableErrorModel.php @@ -22,41 +22,49 @@ final class DiscountCodeNonApplicableErrorModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'DiscountCodeNonApplicable'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $discountCode; /** + * * @var ?string */ protected $reason; /** + * * @var ?string */ protected $dicountCodeId; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; /** + * * @var ?DateTimeImmutable */ protected $validityCheckTime; @@ -72,7 +80,8 @@ public function __construct( ?string $dicountCodeId = null, ?DateTimeImmutable $validFrom = null, ?DateTimeImmutable $validUntil = null, - ?DateTimeImmutable $validityCheckTime = null + ?DateTimeImmutable $validityCheckTime = null, + ?string $code = null ) { $this->message = $message; $this->discountCode = $discountCode; @@ -81,10 +90,11 @@ public function __construct( $this->validFrom = $validFrom; $this->validUntil = $validUntil; $this->validityCheckTime = $validityCheckTime; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -102,6 +112,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -119,6 +130,7 @@ public function getMessage() } /** + * * @return null|string */ public function getDiscountCode() @@ -136,6 +148,7 @@ public function getDiscountCode() } /** + * * @return null|string */ public function getReason() @@ -153,6 +166,7 @@ public function getReason() } /** + * * @return null|string */ public function getDicountCodeId() @@ -170,6 +184,7 @@ public function getDicountCodeId() } /** + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -191,6 +206,7 @@ public function getValidFrom() } /** + * * @return null|DateTimeImmutable */ public function getValidUntil() @@ -212,6 +228,7 @@ public function getValidUntil() } /** + * * @return null|DateTimeImmutable */ public function getValidityCheckTime() diff --git a/lib/commercetools-api/src/Models/Error/DuplicateAttributeValueError.php b/lib/commercetools-api/src/Models/Error/DuplicateAttributeValueError.php index 3202435b70c..04f09faebbe 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateAttributeValueError.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateAttributeValueError.php @@ -17,6 +17,7 @@ interface DuplicateAttributeValueError extends ErrorObject public const FIELD_ATTRIBUTE = 'attribute'; /** + * @return null|Attribute */ public function getAttribute(); diff --git a/lib/commercetools-api/src/Models/Error/DuplicateAttributeValueErrorBuilder.php b/lib/commercetools-api/src/Models/Error/DuplicateAttributeValueErrorBuilder.php index 77606ab4ba1..edb972c6fa1 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateAttributeValueErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateAttributeValueErrorBuilder.php @@ -23,16 +23,19 @@ final class DuplicateAttributeValueErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var null|Attribute|AttributeBuilder */ private $attribute; /** + * @return null|string */ public function getMessage() @@ -41,6 +44,7 @@ public function getMessage() } /** + * @return null|Attribute */ public function getAttribute() diff --git a/lib/commercetools-api/src/Models/Error/DuplicateAttributeValueErrorModel.php b/lib/commercetools-api/src/Models/Error/DuplicateAttributeValueErrorModel.php index c5f904a47f6..082888b6248 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateAttributeValueErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateAttributeValueErrorModel.php @@ -23,16 +23,19 @@ final class DuplicateAttributeValueErrorModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'DuplicateAttributeValue'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?Attribute */ protected $attribute; @@ -43,14 +46,16 @@ final class DuplicateAttributeValueErrorModel extends JsonObjectModel implements */ public function __construct( ?string $message = null, - ?Attribute $attribute = null + ?Attribute $attribute = null, + ?string $code = null ) { $this->message = $message; $this->attribute = $attribute; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -68,6 +73,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -85,6 +91,7 @@ public function getMessage() } /** + * * @return null|Attribute */ public function getAttribute() diff --git a/lib/commercetools-api/src/Models/Error/DuplicateAttributeValuesError.php b/lib/commercetools-api/src/Models/Error/DuplicateAttributeValuesError.php index 113a811d5b0..70b26289f77 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateAttributeValuesError.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateAttributeValuesError.php @@ -17,6 +17,7 @@ interface DuplicateAttributeValuesError extends ErrorObject public const FIELD_ATTRIBUTES = 'attributes'; /** + * @return null|AttributeCollection */ public function getAttributes(); diff --git a/lib/commercetools-api/src/Models/Error/DuplicateAttributeValuesErrorBuilder.php b/lib/commercetools-api/src/Models/Error/DuplicateAttributeValuesErrorBuilder.php index 82ebe0f4528..a96aacab33a 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateAttributeValuesErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateAttributeValuesErrorBuilder.php @@ -22,16 +22,19 @@ final class DuplicateAttributeValuesErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?AttributeCollection */ private $attributes; /** + * @return null|string */ public function getMessage() @@ -40,6 +43,7 @@ public function getMessage() } /** + * @return null|AttributeCollection */ public function getAttributes() diff --git a/lib/commercetools-api/src/Models/Error/DuplicateAttributeValuesErrorModel.php b/lib/commercetools-api/src/Models/Error/DuplicateAttributeValuesErrorModel.php index 6cee172d820..78efb082886 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateAttributeValuesErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateAttributeValuesErrorModel.php @@ -22,16 +22,19 @@ final class DuplicateAttributeValuesErrorModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'DuplicateAttributeValues'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?AttributeCollection */ protected $attributes; @@ -42,14 +45,16 @@ final class DuplicateAttributeValuesErrorModel extends JsonObjectModel implement */ public function __construct( ?string $message = null, - ?AttributeCollection $attributes = null + ?AttributeCollection $attributes = null, + ?string $code = null ) { $this->message = $message; $this->attributes = $attributes; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -67,6 +72,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -84,6 +90,7 @@ public function getMessage() } /** + * * @return null|AttributeCollection */ public function getAttributes() diff --git a/lib/commercetools-api/src/Models/Error/DuplicateEnumValuesError.php b/lib/commercetools-api/src/Models/Error/DuplicateEnumValuesError.php index 30d1943c7c1..5333652d305 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateEnumValuesError.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateEnumValuesError.php @@ -16,6 +16,7 @@ interface DuplicateEnumValuesError extends ErrorObject public const FIELD_DUPLICATES = 'duplicates'; /** + * @return null|array */ public function getDuplicates(); diff --git a/lib/commercetools-api/src/Models/Error/DuplicateEnumValuesErrorBuilder.php b/lib/commercetools-api/src/Models/Error/DuplicateEnumValuesErrorBuilder.php index f3ec1bf975d..7bd15e87aa0 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateEnumValuesErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateEnumValuesErrorBuilder.php @@ -21,16 +21,19 @@ final class DuplicateEnumValuesErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?array */ private $duplicates; /** + * @return null|string */ public function getMessage() @@ -39,6 +42,7 @@ public function getMessage() } /** + * @return null|array */ public function getDuplicates() diff --git a/lib/commercetools-api/src/Models/Error/DuplicateEnumValuesErrorModel.php b/lib/commercetools-api/src/Models/Error/DuplicateEnumValuesErrorModel.php index 8eb2b451083..55ea4e8e8d0 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateEnumValuesErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateEnumValuesErrorModel.php @@ -21,16 +21,19 @@ final class DuplicateEnumValuesErrorModel extends JsonObjectModel implements Dup { public const DISCRIMINATOR_VALUE = 'DuplicateEnumValues'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?array */ protected $duplicates; @@ -41,14 +44,16 @@ final class DuplicateEnumValuesErrorModel extends JsonObjectModel implements Dup */ public function __construct( ?string $message = null, - ?array $duplicates = null + ?array $duplicates = null, + ?string $code = null ) { $this->message = $message; $this->duplicates = $duplicates; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -66,6 +71,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -83,6 +89,7 @@ public function getMessage() } /** + * * @return null|array */ public function getDuplicates() diff --git a/lib/commercetools-api/src/Models/Error/DuplicateFieldError.php b/lib/commercetools-api/src/Models/Error/DuplicateFieldError.php index b9761c4c8f6..7e0fa2c8ff5 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateFieldError.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateFieldError.php @@ -19,11 +19,13 @@ interface DuplicateFieldError extends ErrorObject public const FIELD_CONFLICTING_RESOURCE = 'conflictingResource'; /** + * @return null|string */ public function getField(); /** + * @return null|mixed */ public function getDuplicateValue(); @@ -31,6 +33,7 @@ public function getDuplicateValue(); /** *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    * + * @return null|Reference */ public function getConflictingResource(); diff --git a/lib/commercetools-api/src/Models/Error/DuplicateFieldErrorBuilder.php b/lib/commercetools-api/src/Models/Error/DuplicateFieldErrorBuilder.php index 75dcf2b01ff..1aa97396b4d 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateFieldErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateFieldErrorBuilder.php @@ -23,26 +23,31 @@ final class DuplicateFieldErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $field; /** + * @var null|mixed|mixed */ private $duplicateValue; /** + * @var null|Reference|ReferenceBuilder */ private $conflictingResource; /** + * @return null|string */ public function getMessage() @@ -51,6 +56,7 @@ public function getMessage() } /** + * @return null|string */ public function getField() @@ -59,6 +65,7 @@ public function getField() } /** + * @return null|mixed */ public function getDuplicateValue() @@ -69,6 +76,7 @@ public function getDuplicateValue() /** *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    * + * @return null|Reference */ public function getConflictingResource() diff --git a/lib/commercetools-api/src/Models/Error/DuplicateFieldErrorModel.php b/lib/commercetools-api/src/Models/Error/DuplicateFieldErrorModel.php index ec26c5d901e..21f1273ae4c 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateFieldErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateFieldErrorModel.php @@ -23,26 +23,31 @@ final class DuplicateFieldErrorModel extends JsonObjectModel implements Duplicat { public const DISCRIMINATOR_VALUE = 'DuplicateField'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $field; /** + * * @var ?mixed */ protected $duplicateValue; /** + * * @var ?Reference */ protected $conflictingResource; @@ -55,16 +60,18 @@ public function __construct( ?string $message = null, ?string $field = null, $duplicateValue = null, - ?Reference $conflictingResource = null + ?Reference $conflictingResource = null, + ?string $code = null ) { $this->message = $message; $this->field = $field; $this->duplicateValue = $duplicateValue; $this->conflictingResource = $conflictingResource; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -82,6 +89,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -99,6 +107,7 @@ public function getMessage() } /** + * * @return null|string */ public function getField() @@ -116,6 +125,7 @@ public function getField() } /** + * * @return null|mixed */ public function getDuplicateValue() @@ -135,6 +145,7 @@ public function getDuplicateValue() /** *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    * + * * @return null|Reference */ public function getConflictingResource() diff --git a/lib/commercetools-api/src/Models/Error/DuplicateFieldWithConflictingResourceError.php b/lib/commercetools-api/src/Models/Error/DuplicateFieldWithConflictingResourceError.php index d03c870d117..4530c98f849 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateFieldWithConflictingResourceError.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateFieldWithConflictingResourceError.php @@ -19,11 +19,13 @@ interface DuplicateFieldWithConflictingResourceError extends ErrorObject public const FIELD_CONFLICTING_RESOURCE = 'conflictingResource'; /** + * @return null|string */ public function getField(); /** + * @return null|mixed */ public function getDuplicateValue(); @@ -31,6 +33,7 @@ public function getDuplicateValue(); /** *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    * + * @return null|Reference */ public function getConflictingResource(); diff --git a/lib/commercetools-api/src/Models/Error/DuplicateFieldWithConflictingResourceErrorBuilder.php b/lib/commercetools-api/src/Models/Error/DuplicateFieldWithConflictingResourceErrorBuilder.php index ad4d29091ee..d776098e26b 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateFieldWithConflictingResourceErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateFieldWithConflictingResourceErrorBuilder.php @@ -23,26 +23,31 @@ final class DuplicateFieldWithConflictingResourceErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $field; /** + * @var null|mixed|mixed */ private $duplicateValue; /** + * @var null|Reference|ReferenceBuilder */ private $conflictingResource; /** + * @return null|string */ public function getMessage() @@ -51,6 +56,7 @@ public function getMessage() } /** + * @return null|string */ public function getField() @@ -59,6 +65,7 @@ public function getField() } /** + * @return null|mixed */ public function getDuplicateValue() @@ -69,6 +76,7 @@ public function getDuplicateValue() /** *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    * + * @return null|Reference */ public function getConflictingResource() diff --git a/lib/commercetools-api/src/Models/Error/DuplicateFieldWithConflictingResourceErrorModel.php b/lib/commercetools-api/src/Models/Error/DuplicateFieldWithConflictingResourceErrorModel.php index 6c94d33af65..d8b53da5ff0 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateFieldWithConflictingResourceErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateFieldWithConflictingResourceErrorModel.php @@ -23,26 +23,31 @@ final class DuplicateFieldWithConflictingResourceErrorModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'DuplicateFieldWithConflictingResource'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $field; /** + * * @var ?mixed */ protected $duplicateValue; /** + * * @var ?Reference */ protected $conflictingResource; @@ -55,16 +60,18 @@ public function __construct( ?string $message = null, ?string $field = null, $duplicateValue = null, - ?Reference $conflictingResource = null + ?Reference $conflictingResource = null, + ?string $code = null ) { $this->message = $message; $this->field = $field; $this->duplicateValue = $duplicateValue; $this->conflictingResource = $conflictingResource; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -82,6 +89,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -99,6 +107,7 @@ public function getMessage() } /** + * * @return null|string */ public function getField() @@ -116,6 +125,7 @@ public function getField() } /** + * * @return null|mixed */ public function getDuplicateValue() @@ -135,6 +145,7 @@ public function getDuplicateValue() /** *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    * + * * @return null|Reference */ public function getConflictingResource() diff --git a/lib/commercetools-api/src/Models/Error/DuplicatePriceScopeError.php b/lib/commercetools-api/src/Models/Error/DuplicatePriceScopeError.php index 238559a8aff..e9c75b5182a 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicatePriceScopeError.php +++ b/lib/commercetools-api/src/Models/Error/DuplicatePriceScopeError.php @@ -17,6 +17,7 @@ interface DuplicatePriceScopeError extends ErrorObject public const FIELD_CONFLICTING_PRICES = 'conflictingPrices'; /** + * @return null|PriceCollection */ public function getConflictingPrices(); diff --git a/lib/commercetools-api/src/Models/Error/DuplicatePriceScopeErrorBuilder.php b/lib/commercetools-api/src/Models/Error/DuplicatePriceScopeErrorBuilder.php index f824aad64c9..6a68c3a3607 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicatePriceScopeErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/DuplicatePriceScopeErrorBuilder.php @@ -22,16 +22,19 @@ final class DuplicatePriceScopeErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?PriceCollection */ private $conflictingPrices; /** + * @return null|string */ public function getMessage() @@ -40,6 +43,7 @@ public function getMessage() } /** + * @return null|PriceCollection */ public function getConflictingPrices() diff --git a/lib/commercetools-api/src/Models/Error/DuplicatePriceScopeErrorModel.php b/lib/commercetools-api/src/Models/Error/DuplicatePriceScopeErrorModel.php index a867def540d..95dd13e798c 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicatePriceScopeErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/DuplicatePriceScopeErrorModel.php @@ -22,16 +22,19 @@ final class DuplicatePriceScopeErrorModel extends JsonObjectModel implements Dup { public const DISCRIMINATOR_VALUE = 'DuplicatePriceScope'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?PriceCollection */ protected $conflictingPrices; @@ -42,14 +45,16 @@ final class DuplicatePriceScopeErrorModel extends JsonObjectModel implements Dup */ public function __construct( ?string $message = null, - ?PriceCollection $conflictingPrices = null + ?PriceCollection $conflictingPrices = null, + ?string $code = null ) { $this->message = $message; $this->conflictingPrices = $conflictingPrices; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -67,6 +72,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -84,6 +90,7 @@ public function getMessage() } /** + * * @return null|PriceCollection */ public function getConflictingPrices() diff --git a/lib/commercetools-api/src/Models/Error/DuplicateStandalonePriceScopeError.php b/lib/commercetools-api/src/Models/Error/DuplicateStandalonePriceScopeError.php index 337801f5f99..f718631fd8b 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateStandalonePriceScopeError.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateStandalonePriceScopeError.php @@ -29,21 +29,25 @@ interface DuplicateStandalonePriceScopeError extends ErrorObject /** *

    Reference to a StandalonePrice.

    * + * @return null|StandalonePriceReference */ public function getConflictingStandalonePrice(); /** + * @return null|string */ public function getSku(); /** + * @return null|string */ public function getCurrency(); /** + * @return null|string */ public function getCountry(); @@ -51,6 +55,7 @@ public function getCountry(); /** *

    ResourceIdentifier to a CustomerGroup.

    * + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup(); @@ -58,16 +63,19 @@ public function getCustomerGroup(); /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getChannel(); /** + * @return null|DateTimeImmutable */ public function getValidFrom(); /** + * @return null|DateTimeImmutable */ public function getValidUntil(); diff --git a/lib/commercetools-api/src/Models/Error/DuplicateStandalonePriceScopeErrorBuilder.php b/lib/commercetools-api/src/Models/Error/DuplicateStandalonePriceScopeErrorBuilder.php index c283aa9872f..b298a6b26d4 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateStandalonePriceScopeErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateStandalonePriceScopeErrorBuilder.php @@ -28,51 +28,61 @@ final class DuplicateStandalonePriceScopeErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var null|StandalonePriceReference|StandalonePriceReferenceBuilder */ private $conflictingStandalonePrice; /** + * @var ?string */ private $sku; /** + * @var ?string */ private $currency; /** + * @var ?string */ private $country; /** + * @var null|CustomerGroupResourceIdentifier|CustomerGroupResourceIdentifierBuilder */ private $customerGroup; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $channel; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; /** + * @return null|string */ public function getMessage() @@ -83,6 +93,7 @@ public function getMessage() /** *

    Reference to a StandalonePrice.

    * + * @return null|StandalonePriceReference */ public function getConflictingStandalonePrice() @@ -91,6 +102,7 @@ public function getConflictingStandalonePrice() } /** + * @return null|string */ public function getSku() @@ -99,6 +111,7 @@ public function getSku() } /** + * @return null|string */ public function getCurrency() @@ -107,6 +120,7 @@ public function getCurrency() } /** + * @return null|string */ public function getCountry() @@ -117,6 +131,7 @@ public function getCountry() /** *

    ResourceIdentifier to a CustomerGroup.

    * + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() @@ -127,6 +142,7 @@ public function getCustomerGroup() /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getChannel() @@ -135,6 +151,7 @@ public function getChannel() } /** + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -143,6 +160,7 @@ public function getValidFrom() } /** + * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/Error/DuplicateStandalonePriceScopeErrorModel.php b/lib/commercetools-api/src/Models/Error/DuplicateStandalonePriceScopeErrorModel.php index 3517f7a2c34..947b4ee3f1f 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateStandalonePriceScopeErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateStandalonePriceScopeErrorModel.php @@ -28,51 +28,61 @@ final class DuplicateStandalonePriceScopeErrorModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'DuplicateStandalonePriceScope'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?StandalonePriceReference */ protected $conflictingStandalonePrice; /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $currency; /** + * * @var ?string */ protected $country; /** + * * @var ?CustomerGroupResourceIdentifier */ protected $customerGroup; /** + * * @var ?ChannelResourceIdentifier */ protected $channel; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; @@ -90,7 +100,8 @@ public function __construct( ?CustomerGroupResourceIdentifier $customerGroup = null, ?ChannelResourceIdentifier $channel = null, ?DateTimeImmutable $validFrom = null, - ?DateTimeImmutable $validUntil = null + ?DateTimeImmutable $validUntil = null, + ?string $code = null ) { $this->message = $message; $this->conflictingStandalonePrice = $conflictingStandalonePrice; @@ -101,10 +112,11 @@ public function __construct( $this->channel = $channel; $this->validFrom = $validFrom; $this->validUntil = $validUntil; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -122,6 +134,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -141,6 +154,7 @@ public function getMessage() /** *

    Reference to a StandalonePrice.

    * + * * @return null|StandalonePriceReference */ public function getConflictingStandalonePrice() @@ -159,6 +173,7 @@ public function getConflictingStandalonePrice() } /** + * * @return null|string */ public function getSku() @@ -176,6 +191,7 @@ public function getSku() } /** + * * @return null|string */ public function getCurrency() @@ -193,6 +209,7 @@ public function getCurrency() } /** + * * @return null|string */ public function getCountry() @@ -212,6 +229,7 @@ public function getCountry() /** *

    ResourceIdentifier to a CustomerGroup.

    * + * * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() @@ -232,6 +250,7 @@ public function getCustomerGroup() /** *

    ResourceIdentifier to a Channel.

    * + * * @return null|ChannelResourceIdentifier */ public function getChannel() @@ -250,6 +269,7 @@ public function getChannel() } /** + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -271,6 +291,7 @@ public function getValidFrom() } /** + * * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/Error/DuplicateVariantValuesError.php b/lib/commercetools-api/src/Models/Error/DuplicateVariantValuesError.php index 78039422ff4..a03f96d987a 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateVariantValuesError.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateVariantValuesError.php @@ -16,6 +16,7 @@ interface DuplicateVariantValuesError extends ErrorObject public const FIELD_VARIANT_VALUES = 'variantValues'; /** + * @return null|VariantValues */ public function getVariantValues(); diff --git a/lib/commercetools-api/src/Models/Error/DuplicateVariantValuesErrorBuilder.php b/lib/commercetools-api/src/Models/Error/DuplicateVariantValuesErrorBuilder.php index 02524205819..bec5c96e7ba 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateVariantValuesErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateVariantValuesErrorBuilder.php @@ -21,16 +21,19 @@ final class DuplicateVariantValuesErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var null|VariantValues|VariantValuesBuilder */ private $variantValues; /** + * @return null|string */ public function getMessage() @@ -39,6 +42,7 @@ public function getMessage() } /** + * @return null|VariantValues */ public function getVariantValues() diff --git a/lib/commercetools-api/src/Models/Error/DuplicateVariantValuesErrorModel.php b/lib/commercetools-api/src/Models/Error/DuplicateVariantValuesErrorModel.php index b0dfbe8ea8e..ac04ee388b0 100644 --- a/lib/commercetools-api/src/Models/Error/DuplicateVariantValuesErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/DuplicateVariantValuesErrorModel.php @@ -21,16 +21,19 @@ final class DuplicateVariantValuesErrorModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'DuplicateVariantValues'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?VariantValues */ protected $variantValues; @@ -41,14 +44,16 @@ final class DuplicateVariantValuesErrorModel extends JsonObjectModel implements */ public function __construct( ?string $message = null, - ?VariantValues $variantValues = null + ?VariantValues $variantValues = null, + ?string $code = null ) { $this->message = $message; $this->variantValues = $variantValues; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -66,6 +71,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -83,6 +89,7 @@ public function getMessage() } /** + * * @return null|VariantValues */ public function getVariantValues() diff --git a/lib/commercetools-api/src/Models/Error/EditPreviewFailedError.php b/lib/commercetools-api/src/Models/Error/EditPreviewFailedError.php index bac8dcd45fa..309735ec96f 100644 --- a/lib/commercetools-api/src/Models/Error/EditPreviewFailedError.php +++ b/lib/commercetools-api/src/Models/Error/EditPreviewFailedError.php @@ -17,6 +17,7 @@ interface EditPreviewFailedError extends ErrorObject public const FIELD_RESULT = 'result'; /** + * @return null|OrderEditPreviewFailure */ public function getResult(); diff --git a/lib/commercetools-api/src/Models/Error/EditPreviewFailedErrorBuilder.php b/lib/commercetools-api/src/Models/Error/EditPreviewFailedErrorBuilder.php index 82881a65b5f..a2523d887db 100644 --- a/lib/commercetools-api/src/Models/Error/EditPreviewFailedErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/EditPreviewFailedErrorBuilder.php @@ -23,16 +23,19 @@ final class EditPreviewFailedErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var null|OrderEditPreviewFailure|OrderEditPreviewFailureBuilder */ private $result; /** + * @return null|string */ public function getMessage() @@ -41,6 +44,7 @@ public function getMessage() } /** + * @return null|OrderEditPreviewFailure */ public function getResult() diff --git a/lib/commercetools-api/src/Models/Error/EditPreviewFailedErrorModel.php b/lib/commercetools-api/src/Models/Error/EditPreviewFailedErrorModel.php index b7f75248ef0..aeb64acd465 100644 --- a/lib/commercetools-api/src/Models/Error/EditPreviewFailedErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/EditPreviewFailedErrorModel.php @@ -23,16 +23,19 @@ final class EditPreviewFailedErrorModel extends JsonObjectModel implements EditP { public const DISCRIMINATOR_VALUE = 'EditPreviewFailed'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?OrderEditPreviewFailure */ protected $result; @@ -43,14 +46,16 @@ final class EditPreviewFailedErrorModel extends JsonObjectModel implements EditP */ public function __construct( ?string $message = null, - ?OrderEditPreviewFailure $result = null + ?OrderEditPreviewFailure $result = null, + ?string $code = null ) { $this->message = $message; $this->result = $result; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -68,6 +73,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -85,6 +91,7 @@ public function getMessage() } /** + * * @return null|OrderEditPreviewFailure */ public function getResult() diff --git a/lib/commercetools-api/src/Models/Error/EnumKeyAlreadyExistsError.php b/lib/commercetools-api/src/Models/Error/EnumKeyAlreadyExistsError.php index af2f750baae..be527b415ec 100644 --- a/lib/commercetools-api/src/Models/Error/EnumKeyAlreadyExistsError.php +++ b/lib/commercetools-api/src/Models/Error/EnumKeyAlreadyExistsError.php @@ -17,11 +17,13 @@ interface EnumKeyAlreadyExistsError extends ErrorObject public const FIELD_CONFLICTING_ATTRIBUTE_NAME = 'conflictingAttributeName'; /** + * @return null|string */ public function getConflictingEnumKey(); /** + * @return null|string */ public function getConflictingAttributeName(); diff --git a/lib/commercetools-api/src/Models/Error/EnumKeyAlreadyExistsErrorBuilder.php b/lib/commercetools-api/src/Models/Error/EnumKeyAlreadyExistsErrorBuilder.php index 26d3da09623..01d10b1088f 100644 --- a/lib/commercetools-api/src/Models/Error/EnumKeyAlreadyExistsErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/EnumKeyAlreadyExistsErrorBuilder.php @@ -21,21 +21,25 @@ final class EnumKeyAlreadyExistsErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $conflictingEnumKey; /** + * @var ?string */ private $conflictingAttributeName; /** + * @return null|string */ public function getMessage() @@ -44,6 +48,7 @@ public function getMessage() } /** + * @return null|string */ public function getConflictingEnumKey() @@ -52,6 +57,7 @@ public function getConflictingEnumKey() } /** + * @return null|string */ public function getConflictingAttributeName() diff --git a/lib/commercetools-api/src/Models/Error/EnumKeyAlreadyExistsErrorModel.php b/lib/commercetools-api/src/Models/Error/EnumKeyAlreadyExistsErrorModel.php index 08214dbc79a..03b00022e7a 100644 --- a/lib/commercetools-api/src/Models/Error/EnumKeyAlreadyExistsErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/EnumKeyAlreadyExistsErrorModel.php @@ -21,21 +21,25 @@ final class EnumKeyAlreadyExistsErrorModel extends JsonObjectModel implements En { public const DISCRIMINATOR_VALUE = 'EnumKeyAlreadyExists'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $conflictingEnumKey; /** + * * @var ?string */ protected $conflictingAttributeName; @@ -47,15 +51,17 @@ final class EnumKeyAlreadyExistsErrorModel extends JsonObjectModel implements En public function __construct( ?string $message = null, ?string $conflictingEnumKey = null, - ?string $conflictingAttributeName = null + ?string $conflictingAttributeName = null, + ?string $code = null ) { $this->message = $message; $this->conflictingEnumKey = $conflictingEnumKey; $this->conflictingAttributeName = $conflictingAttributeName; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -73,6 +79,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -90,6 +97,7 @@ public function getMessage() } /** + * * @return null|string */ public function getConflictingEnumKey() @@ -107,6 +115,7 @@ public function getConflictingEnumKey() } /** + * * @return null|string */ public function getConflictingAttributeName() diff --git a/lib/commercetools-api/src/Models/Error/EnumKeyDoesNotExistError.php b/lib/commercetools-api/src/Models/Error/EnumKeyDoesNotExistError.php index d4346816e26..ccd02d54c0e 100644 --- a/lib/commercetools-api/src/Models/Error/EnumKeyDoesNotExistError.php +++ b/lib/commercetools-api/src/Models/Error/EnumKeyDoesNotExistError.php @@ -17,11 +17,13 @@ interface EnumKeyDoesNotExistError extends ErrorObject public const FIELD_CONFLICTING_ATTRIBUTE_NAME = 'conflictingAttributeName'; /** + * @return null|string */ public function getConflictingEnumKey(); /** + * @return null|string */ public function getConflictingAttributeName(); diff --git a/lib/commercetools-api/src/Models/Error/EnumKeyDoesNotExistErrorBuilder.php b/lib/commercetools-api/src/Models/Error/EnumKeyDoesNotExistErrorBuilder.php index 6fd4ad7ad1e..5d7f717fbd2 100644 --- a/lib/commercetools-api/src/Models/Error/EnumKeyDoesNotExistErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/EnumKeyDoesNotExistErrorBuilder.php @@ -21,21 +21,25 @@ final class EnumKeyDoesNotExistErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $conflictingEnumKey; /** + * @var ?string */ private $conflictingAttributeName; /** + * @return null|string */ public function getMessage() @@ -44,6 +48,7 @@ public function getMessage() } /** + * @return null|string */ public function getConflictingEnumKey() @@ -52,6 +57,7 @@ public function getConflictingEnumKey() } /** + * @return null|string */ public function getConflictingAttributeName() diff --git a/lib/commercetools-api/src/Models/Error/EnumKeyDoesNotExistErrorModel.php b/lib/commercetools-api/src/Models/Error/EnumKeyDoesNotExistErrorModel.php index f76006e26ed..14f562d783b 100644 --- a/lib/commercetools-api/src/Models/Error/EnumKeyDoesNotExistErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/EnumKeyDoesNotExistErrorModel.php @@ -21,21 +21,25 @@ final class EnumKeyDoesNotExistErrorModel extends JsonObjectModel implements Enu { public const DISCRIMINATOR_VALUE = 'EnumKeyDoesNotExist'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $conflictingEnumKey; /** + * * @var ?string */ protected $conflictingAttributeName; @@ -47,15 +51,17 @@ final class EnumKeyDoesNotExistErrorModel extends JsonObjectModel implements Enu public function __construct( ?string $message = null, ?string $conflictingEnumKey = null, - ?string $conflictingAttributeName = null + ?string $conflictingAttributeName = null, + ?string $code = null ) { $this->message = $message; $this->conflictingEnumKey = $conflictingEnumKey; $this->conflictingAttributeName = $conflictingAttributeName; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -73,6 +79,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -90,6 +97,7 @@ public function getMessage() } /** + * * @return null|string */ public function getConflictingEnumKey() @@ -107,6 +115,7 @@ public function getConflictingEnumKey() } /** + * * @return null|string */ public function getConflictingAttributeName() diff --git a/lib/commercetools-api/src/Models/Error/EnumValueIsUsedErrorBuilder.php b/lib/commercetools-api/src/Models/Error/EnumValueIsUsedErrorBuilder.php index 9531a26a459..04b01a9e318 100644 --- a/lib/commercetools-api/src/Models/Error/EnumValueIsUsedErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/EnumValueIsUsedErrorBuilder.php @@ -21,11 +21,13 @@ final class EnumValueIsUsedErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/EnumValueIsUsedErrorModel.php b/lib/commercetools-api/src/Models/Error/EnumValueIsUsedErrorModel.php index 1f06a202514..01cd21b00d9 100644 --- a/lib/commercetools-api/src/Models/Error/EnumValueIsUsedErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/EnumValueIsUsedErrorModel.php @@ -21,11 +21,13 @@ final class EnumValueIsUsedErrorModel extends JsonObjectModel implements EnumVal { public const DISCRIMINATOR_VALUE = 'EnumValueIsUsed'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class EnumValueIsUsedErrorModel extends JsonObjectModel implements EnumVal * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/EnumValuesMustMatchErrorBuilder.php b/lib/commercetools-api/src/Models/Error/EnumValuesMustMatchErrorBuilder.php index 1d6b45f9dcf..da64336a1f3 100644 --- a/lib/commercetools-api/src/Models/Error/EnumValuesMustMatchErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/EnumValuesMustMatchErrorBuilder.php @@ -21,11 +21,13 @@ final class EnumValuesMustMatchErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/EnumValuesMustMatchErrorModel.php b/lib/commercetools-api/src/Models/Error/EnumValuesMustMatchErrorModel.php index b986255ed83..19a544ce00b 100644 --- a/lib/commercetools-api/src/Models/Error/EnumValuesMustMatchErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/EnumValuesMustMatchErrorModel.php @@ -21,11 +21,13 @@ final class EnumValuesMustMatchErrorModel extends JsonObjectModel implements Enu { public const DISCRIMINATOR_VALUE = 'EnumValuesMustMatch'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class EnumValuesMustMatchErrorModel extends JsonObjectModel implements Enu * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/ErrorByExtension.php b/lib/commercetools-api/src/Models/Error/ErrorByExtension.php index 03280d34ea8..2b22c17770c 100644 --- a/lib/commercetools-api/src/Models/Error/ErrorByExtension.php +++ b/lib/commercetools-api/src/Models/Error/ErrorByExtension.php @@ -19,6 +19,7 @@ interface ErrorByExtension extends JsonObject /** *

    Unique identifier of the Extension.

    * + * @return null|string */ public function getId(); @@ -26,6 +27,7 @@ public function getId(); /** *

    User-defined unique identifier of the Extension.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Error/ErrorByExtensionBuilder.php b/lib/commercetools-api/src/Models/Error/ErrorByExtensionBuilder.php index b51f1fdd340..4182127ca3c 100644 --- a/lib/commercetools-api/src/Models/Error/ErrorByExtensionBuilder.php +++ b/lib/commercetools-api/src/Models/Error/ErrorByExtensionBuilder.php @@ -21,11 +21,13 @@ final class ErrorByExtensionBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -33,6 +35,7 @@ final class ErrorByExtensionBuilder implements Builder /** *

    Unique identifier of the Extension.

    * + * @return null|string */ public function getId() @@ -43,6 +46,7 @@ public function getId() /** *

    User-defined unique identifier of the Extension.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Error/ErrorByExtensionModel.php b/lib/commercetools-api/src/Models/Error/ErrorByExtensionModel.php index e21a9157818..ce68b700811 100644 --- a/lib/commercetools-api/src/Models/Error/ErrorByExtensionModel.php +++ b/lib/commercetools-api/src/Models/Error/ErrorByExtensionModel.php @@ -20,11 +20,13 @@ final class ErrorByExtensionModel extends JsonObjectModel implements ErrorByExtension { /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -44,6 +46,7 @@ public function __construct( /** *

    Unique identifier of the Extension.

    * + * * @return null|string */ public function getId() @@ -63,6 +66,7 @@ public function getId() /** *

    User-defined unique identifier of the Extension.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Error/ErrorObject.php b/lib/commercetools-api/src/Models/Error/ErrorObject.php index f9a11117ea9..355fc34de4c 100644 --- a/lib/commercetools-api/src/Models/Error/ErrorObject.php +++ b/lib/commercetools-api/src/Models/Error/ErrorObject.php @@ -19,11 +19,13 @@ interface ErrorObject extends JsonObject public const FIELD_PATTERN2 = '//'; /** + * @return null|string */ public function getCode(); /** + * @return null|string */ public function getMessage(); diff --git a/lib/commercetools-api/src/Models/Error/ErrorObjectBuilder.php b/lib/commercetools-api/src/Models/Error/ErrorObjectBuilder.php index daded5447f0..7bb7d7dc0ba 100644 --- a/lib/commercetools-api/src/Models/Error/ErrorObjectBuilder.php +++ b/lib/commercetools-api/src/Models/Error/ErrorObjectBuilder.php @@ -21,11 +21,13 @@ final class ErrorObjectBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php b/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php index 357b4d36eaf..57c2a6f5bef 100644 --- a/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php +++ b/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php @@ -21,11 +21,13 @@ final class ErrorObjectModel extends JsonObjectModel implements ErrorObject { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -108,13 +110,15 @@ final class ErrorObjectModel extends JsonObjectModel implements ErrorObject * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code; } /** + * * @return null|string */ public function getCode() @@ -132,6 +136,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/ErrorResponse.php b/lib/commercetools-api/src/Models/Error/ErrorResponse.php index b8d01aae07b..39f50bf299a 100644 --- a/lib/commercetools-api/src/Models/Error/ErrorResponse.php +++ b/lib/commercetools-api/src/Models/Error/ErrorResponse.php @@ -20,26 +20,31 @@ interface ErrorResponse extends JsonObject public const FIELD_ERRORS = 'errors'; /** + * @return null|int */ public function getStatusCode(); /** + * @return null|string */ public function getMessage(); /** + * @return null|string */ public function getError(); /** + * @return null|string */ public function getError_description(); /** + * @return null|ErrorObjectCollection */ public function getErrors(); diff --git a/lib/commercetools-api/src/Models/Error/ErrorResponseBuilder.php b/lib/commercetools-api/src/Models/Error/ErrorResponseBuilder.php index dd14e34afa9..173174af6e3 100644 --- a/lib/commercetools-api/src/Models/Error/ErrorResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Error/ErrorResponseBuilder.php @@ -21,31 +21,37 @@ final class ErrorResponseBuilder implements Builder { /** + * @var ?int */ private $statusCode; /** + * @var ?string */ private $message; /** + * @var ?string */ private $error; /** + * @var ?string */ private $error_description; /** + * @var ?ErrorObjectCollection */ private $errors; /** + * @return null|int */ public function getStatusCode() @@ -54,6 +60,7 @@ public function getStatusCode() } /** + * @return null|string */ public function getMessage() @@ -62,6 +69,7 @@ public function getMessage() } /** + * @return null|string */ public function getError() @@ -70,6 +78,7 @@ public function getError() } /** + * @return null|string */ public function getError_description() @@ -78,6 +87,7 @@ public function getError_description() } /** + * @return null|ErrorObjectCollection */ public function getErrors() diff --git a/lib/commercetools-api/src/Models/Error/ErrorResponseModel.php b/lib/commercetools-api/src/Models/Error/ErrorResponseModel.php index f8522a1828e..e1c03f73e69 100644 --- a/lib/commercetools-api/src/Models/Error/ErrorResponseModel.php +++ b/lib/commercetools-api/src/Models/Error/ErrorResponseModel.php @@ -20,26 +20,31 @@ final class ErrorResponseModel extends JsonObjectModel implements ErrorResponse { /** + * * @var ?int */ protected $statusCode; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $error; /** + * * @var ?string */ protected $error_description; /** + * * @var ?ErrorObjectCollection */ protected $errors; @@ -63,6 +68,7 @@ public function __construct( } /** + * * @return null|int */ public function getStatusCode() @@ -80,6 +86,7 @@ public function getStatusCode() } /** + * * @return null|string */ public function getMessage() @@ -97,6 +104,7 @@ public function getMessage() } /** + * * @return null|string */ public function getError() @@ -114,6 +122,7 @@ public function getError() } /** + * * @return null|string */ public function getError_description() @@ -131,6 +140,7 @@ public function getError_description() } /** + * * @return null|ErrorObjectCollection */ public function getErrors() diff --git a/lib/commercetools-api/src/Models/Error/ExtensionBadResponseError.php b/lib/commercetools-api/src/Models/Error/ExtensionBadResponseError.php index 0176e9153c1..2692269db81 100644 --- a/lib/commercetools-api/src/Models/Error/ExtensionBadResponseError.php +++ b/lib/commercetools-api/src/Models/Error/ExtensionBadResponseError.php @@ -21,16 +21,19 @@ interface ExtensionBadResponseError extends ErrorObject /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getLocalizedMessage(); /** + * @return null|mixed */ public function getExtensionExtraInfo(); /** + * @return null|ErrorByExtension */ public function getErrorByExtension(); diff --git a/lib/commercetools-api/src/Models/Error/ExtensionBadResponseErrorBuilder.php b/lib/commercetools-api/src/Models/Error/ExtensionBadResponseErrorBuilder.php index 8eb1bfad935..27db5472c67 100644 --- a/lib/commercetools-api/src/Models/Error/ExtensionBadResponseErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/ExtensionBadResponseErrorBuilder.php @@ -23,26 +23,31 @@ final class ExtensionBadResponseErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $localizedMessage; /** + * @var ?JsonObject */ private $extensionExtraInfo; /** + * @var null|ErrorByExtension|ErrorByExtensionBuilder */ private $errorByExtension; /** + * @return null|string */ public function getMessage() @@ -53,6 +58,7 @@ public function getMessage() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getLocalizedMessage() @@ -61,6 +67,7 @@ public function getLocalizedMessage() } /** + * @return null|JsonObject */ public function getExtensionExtraInfo() @@ -69,6 +76,7 @@ public function getExtensionExtraInfo() } /** + * @return null|ErrorByExtension */ public function getErrorByExtension() diff --git a/lib/commercetools-api/src/Models/Error/ExtensionBadResponseErrorModel.php b/lib/commercetools-api/src/Models/Error/ExtensionBadResponseErrorModel.php index b9f4b11755a..8d10872c666 100644 --- a/lib/commercetools-api/src/Models/Error/ExtensionBadResponseErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/ExtensionBadResponseErrorModel.php @@ -23,26 +23,31 @@ final class ExtensionBadResponseErrorModel extends JsonObjectModel implements Ex { public const DISCRIMINATOR_VALUE = 'ExtensionBadResponse'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?LocalizedString */ protected $localizedMessage; /** + * * @var ?mixed */ protected $extensionExtraInfo; /** + * * @var ?ErrorByExtension */ protected $errorByExtension; @@ -55,16 +60,18 @@ public function __construct( ?string $message = null, ?LocalizedString $localizedMessage = null, ?JsonObject $extensionExtraInfo = null, - ?ErrorByExtension $errorByExtension = null + ?ErrorByExtension $errorByExtension = null, + ?string $code = null ) { $this->message = $message; $this->localizedMessage = $localizedMessage; $this->extensionExtraInfo = $extensionExtraInfo; $this->errorByExtension = $errorByExtension; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -82,6 +89,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -101,6 +109,7 @@ public function getMessage() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * * @return null|LocalizedString */ public function getLocalizedMessage() @@ -119,6 +128,7 @@ public function getLocalizedMessage() } /** + * * @return null|mixed */ public function getExtensionExtraInfo() @@ -136,6 +146,7 @@ public function getExtensionExtraInfo() } /** + * * @return null|ErrorByExtension */ public function getErrorByExtension() diff --git a/lib/commercetools-api/src/Models/Error/ExtensionNoResponseError.php b/lib/commercetools-api/src/Models/Error/ExtensionNoResponseError.php index 766e4aab0b8..543f629070a 100644 --- a/lib/commercetools-api/src/Models/Error/ExtensionNoResponseError.php +++ b/lib/commercetools-api/src/Models/Error/ExtensionNoResponseError.php @@ -17,11 +17,13 @@ interface ExtensionNoResponseError extends ErrorObject public const FIELD_EXTENSION_KEY = 'extensionKey'; /** + * @return null|string */ public function getExtensionId(); /** + * @return null|string */ public function getExtensionKey(); diff --git a/lib/commercetools-api/src/Models/Error/ExtensionNoResponseErrorBuilder.php b/lib/commercetools-api/src/Models/Error/ExtensionNoResponseErrorBuilder.php index f3cf6ab39cc..d45761f5195 100644 --- a/lib/commercetools-api/src/Models/Error/ExtensionNoResponseErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/ExtensionNoResponseErrorBuilder.php @@ -21,21 +21,25 @@ final class ExtensionNoResponseErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $extensionId; /** + * @var ?string */ private $extensionKey; /** + * @return null|string */ public function getMessage() @@ -44,6 +48,7 @@ public function getMessage() } /** + * @return null|string */ public function getExtensionId() @@ -52,6 +57,7 @@ public function getExtensionId() } /** + * @return null|string */ public function getExtensionKey() diff --git a/lib/commercetools-api/src/Models/Error/ExtensionNoResponseErrorModel.php b/lib/commercetools-api/src/Models/Error/ExtensionNoResponseErrorModel.php index 646eb60be16..c04f3b38e41 100644 --- a/lib/commercetools-api/src/Models/Error/ExtensionNoResponseErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/ExtensionNoResponseErrorModel.php @@ -21,21 +21,25 @@ final class ExtensionNoResponseErrorModel extends JsonObjectModel implements Ext { public const DISCRIMINATOR_VALUE = 'ExtensionNoResponse'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $extensionId; /** + * * @var ?string */ protected $extensionKey; @@ -47,15 +51,17 @@ final class ExtensionNoResponseErrorModel extends JsonObjectModel implements Ext public function __construct( ?string $message = null, ?string $extensionId = null, - ?string $extensionKey = null + ?string $extensionKey = null, + ?string $code = null ) { $this->message = $message; $this->extensionId = $extensionId; $this->extensionKey = $extensionKey; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -73,6 +79,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -90,6 +97,7 @@ public function getMessage() } /** + * * @return null|string */ public function getExtensionId() @@ -107,6 +115,7 @@ public function getExtensionId() } /** + * * @return null|string */ public function getExtensionKey() diff --git a/lib/commercetools-api/src/Models/Error/ExtensionUpdateActionsFailedError.php b/lib/commercetools-api/src/Models/Error/ExtensionUpdateActionsFailedError.php index 78c26c1b863..109f1823824 100644 --- a/lib/commercetools-api/src/Models/Error/ExtensionUpdateActionsFailedError.php +++ b/lib/commercetools-api/src/Models/Error/ExtensionUpdateActionsFailedError.php @@ -21,16 +21,19 @@ interface ExtensionUpdateActionsFailedError extends ErrorObject /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getLocalizedMessage(); /** + * @return null|mixed */ public function getExtensionExtraInfo(); /** + * @return null|ErrorByExtension */ public function getErrorByExtension(); diff --git a/lib/commercetools-api/src/Models/Error/ExtensionUpdateActionsFailedErrorBuilder.php b/lib/commercetools-api/src/Models/Error/ExtensionUpdateActionsFailedErrorBuilder.php index 4b02742681a..4acd5092a8e 100644 --- a/lib/commercetools-api/src/Models/Error/ExtensionUpdateActionsFailedErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/ExtensionUpdateActionsFailedErrorBuilder.php @@ -23,26 +23,31 @@ final class ExtensionUpdateActionsFailedErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $localizedMessage; /** + * @var ?JsonObject */ private $extensionExtraInfo; /** + * @var null|ErrorByExtension|ErrorByExtensionBuilder */ private $errorByExtension; /** + * @return null|string */ public function getMessage() @@ -53,6 +58,7 @@ public function getMessage() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getLocalizedMessage() @@ -61,6 +67,7 @@ public function getLocalizedMessage() } /** + * @return null|JsonObject */ public function getExtensionExtraInfo() @@ -69,6 +76,7 @@ public function getExtensionExtraInfo() } /** + * @return null|ErrorByExtension */ public function getErrorByExtension() diff --git a/lib/commercetools-api/src/Models/Error/ExtensionUpdateActionsFailedErrorModel.php b/lib/commercetools-api/src/Models/Error/ExtensionUpdateActionsFailedErrorModel.php index f0ee192bfc7..41707e9ba52 100644 --- a/lib/commercetools-api/src/Models/Error/ExtensionUpdateActionsFailedErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/ExtensionUpdateActionsFailedErrorModel.php @@ -23,26 +23,31 @@ final class ExtensionUpdateActionsFailedErrorModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'ExtensionUpdateActionsFailed'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?LocalizedString */ protected $localizedMessage; /** + * * @var ?mixed */ protected $extensionExtraInfo; /** + * * @var ?ErrorByExtension */ protected $errorByExtension; @@ -55,16 +60,18 @@ public function __construct( ?string $message = null, ?LocalizedString $localizedMessage = null, ?JsonObject $extensionExtraInfo = null, - ?ErrorByExtension $errorByExtension = null + ?ErrorByExtension $errorByExtension = null, + ?string $code = null ) { $this->message = $message; $this->localizedMessage = $localizedMessage; $this->extensionExtraInfo = $extensionExtraInfo; $this->errorByExtension = $errorByExtension; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -82,6 +89,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -101,6 +109,7 @@ public function getMessage() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * * @return null|LocalizedString */ public function getLocalizedMessage() @@ -119,6 +128,7 @@ public function getLocalizedMessage() } /** + * * @return null|mixed */ public function getExtensionExtraInfo() @@ -136,6 +146,7 @@ public function getExtensionExtraInfo() } /** + * * @return null|ErrorByExtension */ public function getErrorByExtension() diff --git a/lib/commercetools-api/src/Models/Error/ExternalOAuthFailedErrorBuilder.php b/lib/commercetools-api/src/Models/Error/ExternalOAuthFailedErrorBuilder.php index 18f0344694d..250e34e6922 100644 --- a/lib/commercetools-api/src/Models/Error/ExternalOAuthFailedErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/ExternalOAuthFailedErrorBuilder.php @@ -21,11 +21,13 @@ final class ExternalOAuthFailedErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/ExternalOAuthFailedErrorModel.php b/lib/commercetools-api/src/Models/Error/ExternalOAuthFailedErrorModel.php index f8347b33481..9ef138daf82 100644 --- a/lib/commercetools-api/src/Models/Error/ExternalOAuthFailedErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/ExternalOAuthFailedErrorModel.php @@ -21,11 +21,13 @@ final class ExternalOAuthFailedErrorModel extends JsonObjectModel implements Ext { public const DISCRIMINATOR_VALUE = 'ExternalOAuthFailed'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class ExternalOAuthFailedErrorModel extends JsonObjectModel implements Ext * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/FeatureRemovedErrorBuilder.php b/lib/commercetools-api/src/Models/Error/FeatureRemovedErrorBuilder.php index 2f06f92ad7e..75e790e355c 100644 --- a/lib/commercetools-api/src/Models/Error/FeatureRemovedErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/FeatureRemovedErrorBuilder.php @@ -21,11 +21,13 @@ final class FeatureRemovedErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/FeatureRemovedErrorModel.php b/lib/commercetools-api/src/Models/Error/FeatureRemovedErrorModel.php index 38a127b7efd..9e416db3a7f 100644 --- a/lib/commercetools-api/src/Models/Error/FeatureRemovedErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/FeatureRemovedErrorModel.php @@ -21,11 +21,13 @@ final class FeatureRemovedErrorModel extends JsonObjectModel implements FeatureR { public const DISCRIMINATOR_VALUE = 'FeatureRemoved'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class FeatureRemovedErrorModel extends JsonObjectModel implements FeatureR * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/GeneralErrorBuilder.php b/lib/commercetools-api/src/Models/Error/GeneralErrorBuilder.php index 2610a2bcdb6..cc20c3ba387 100644 --- a/lib/commercetools-api/src/Models/Error/GeneralErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/GeneralErrorBuilder.php @@ -21,11 +21,13 @@ final class GeneralErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/GeneralErrorModel.php b/lib/commercetools-api/src/Models/Error/GeneralErrorModel.php index ae14d1445fa..4396097962b 100644 --- a/lib/commercetools-api/src/Models/Error/GeneralErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/GeneralErrorModel.php @@ -21,11 +21,13 @@ final class GeneralErrorModel extends JsonObjectModel implements GeneralError { public const DISCRIMINATOR_VALUE = 'General'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class GeneralErrorModel extends JsonObjectModel implements GeneralError * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InsufficientScopeErrorBuilder.php b/lib/commercetools-api/src/Models/Error/InsufficientScopeErrorBuilder.php index 172d07b5f2d..73649657612 100644 --- a/lib/commercetools-api/src/Models/Error/InsufficientScopeErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/InsufficientScopeErrorBuilder.php @@ -21,11 +21,13 @@ final class InsufficientScopeErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InsufficientScopeErrorModel.php b/lib/commercetools-api/src/Models/Error/InsufficientScopeErrorModel.php index 6e72fc2a1c6..a5f29971edd 100644 --- a/lib/commercetools-api/src/Models/Error/InsufficientScopeErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/InsufficientScopeErrorModel.php @@ -21,11 +21,13 @@ final class InsufficientScopeErrorModel extends JsonObjectModel implements Insuf { public const DISCRIMINATOR_VALUE = 'insufficient_scope'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class InsufficientScopeErrorModel extends JsonObjectModel implements Insuf * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InternalConstraintViolatedErrorBuilder.php b/lib/commercetools-api/src/Models/Error/InternalConstraintViolatedErrorBuilder.php index 636389ee6bc..0d980c6e0e5 100644 --- a/lib/commercetools-api/src/Models/Error/InternalConstraintViolatedErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/InternalConstraintViolatedErrorBuilder.php @@ -21,11 +21,13 @@ final class InternalConstraintViolatedErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InternalConstraintViolatedErrorModel.php b/lib/commercetools-api/src/Models/Error/InternalConstraintViolatedErrorModel.php index c713aaa2bf0..28089864ad6 100644 --- a/lib/commercetools-api/src/Models/Error/InternalConstraintViolatedErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/InternalConstraintViolatedErrorModel.php @@ -21,11 +21,13 @@ final class InternalConstraintViolatedErrorModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'InternalConstraintViolated'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class InternalConstraintViolatedErrorModel extends JsonObjectModel impleme * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InvalidCredentialsErrorBuilder.php b/lib/commercetools-api/src/Models/Error/InvalidCredentialsErrorBuilder.php index 2703c1e704e..667ed173368 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidCredentialsErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/InvalidCredentialsErrorBuilder.php @@ -21,11 +21,13 @@ final class InvalidCredentialsErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InvalidCredentialsErrorModel.php b/lib/commercetools-api/src/Models/Error/InvalidCredentialsErrorModel.php index d30775abc1e..0cee486fb01 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidCredentialsErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/InvalidCredentialsErrorModel.php @@ -21,11 +21,13 @@ final class InvalidCredentialsErrorModel extends JsonObjectModel implements Inva { public const DISCRIMINATOR_VALUE = 'InvalidCredentials'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class InvalidCredentialsErrorModel extends JsonObjectModel implements Inva * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InvalidCurrentPasswordErrorBuilder.php b/lib/commercetools-api/src/Models/Error/InvalidCurrentPasswordErrorBuilder.php index 3fdf9bf642f..5bc39d34d8a 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidCurrentPasswordErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/InvalidCurrentPasswordErrorBuilder.php @@ -21,11 +21,13 @@ final class InvalidCurrentPasswordErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InvalidCurrentPasswordErrorModel.php b/lib/commercetools-api/src/Models/Error/InvalidCurrentPasswordErrorModel.php index 23c34a29249..755cfab02ad 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidCurrentPasswordErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/InvalidCurrentPasswordErrorModel.php @@ -21,11 +21,13 @@ final class InvalidCurrentPasswordErrorModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'InvalidCurrentPassword'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class InvalidCurrentPasswordErrorModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InvalidFieldError.php b/lib/commercetools-api/src/Models/Error/InvalidFieldError.php index 22b43633b64..a9959e0d4f3 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidFieldError.php +++ b/lib/commercetools-api/src/Models/Error/InvalidFieldError.php @@ -18,16 +18,19 @@ interface InvalidFieldError extends ErrorObject public const FIELD_ALLOWED_VALUES = 'allowedValues'; /** + * @return null|string */ public function getField(); /** + * @return null|mixed */ public function getInvalidValue(); /** + * @return null|array */ public function getAllowedValues(); diff --git a/lib/commercetools-api/src/Models/Error/InvalidFieldErrorBuilder.php b/lib/commercetools-api/src/Models/Error/InvalidFieldErrorBuilder.php index 07b06bdca11..4b8673177b2 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidFieldErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/InvalidFieldErrorBuilder.php @@ -21,26 +21,31 @@ final class InvalidFieldErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $field; /** + * @var null|mixed|mixed */ private $invalidValue; /** + * @var ?array */ private $allowedValues; /** + * @return null|string */ public function getMessage() @@ -49,6 +54,7 @@ public function getMessage() } /** + * @return null|string */ public function getField() @@ -57,6 +63,7 @@ public function getField() } /** + * @return null|mixed */ public function getInvalidValue() @@ -65,6 +72,7 @@ public function getInvalidValue() } /** + * @return null|array */ public function getAllowedValues() diff --git a/lib/commercetools-api/src/Models/Error/InvalidFieldErrorModel.php b/lib/commercetools-api/src/Models/Error/InvalidFieldErrorModel.php index 7241ecfb8fd..386400cac8b 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidFieldErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/InvalidFieldErrorModel.php @@ -21,26 +21,31 @@ final class InvalidFieldErrorModel extends JsonObjectModel implements InvalidFie { public const DISCRIMINATOR_VALUE = 'InvalidField'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $field; /** + * * @var ?mixed */ protected $invalidValue; /** + * * @var ?array */ protected $allowedValues; @@ -53,16 +58,18 @@ public function __construct( ?string $message = null, ?string $field = null, $invalidValue = null, - ?array $allowedValues = null + ?array $allowedValues = null, + ?string $code = null ) { $this->message = $message; $this->field = $field; $this->invalidValue = $invalidValue; $this->allowedValues = $allowedValues; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -80,6 +87,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -97,6 +105,7 @@ public function getMessage() } /** + * * @return null|string */ public function getField() @@ -114,6 +123,7 @@ public function getField() } /** + * * @return null|mixed */ public function getInvalidValue() @@ -131,6 +141,7 @@ public function getInvalidValue() } /** + * * @return null|array */ public function getAllowedValues() diff --git a/lib/commercetools-api/src/Models/Error/InvalidInputErrorBuilder.php b/lib/commercetools-api/src/Models/Error/InvalidInputErrorBuilder.php index 6087b8c1ae4..3bf8360ce24 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidInputErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/InvalidInputErrorBuilder.php @@ -21,11 +21,13 @@ final class InvalidInputErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InvalidInputErrorModel.php b/lib/commercetools-api/src/Models/Error/InvalidInputErrorModel.php index 8719b8d8908..baf76122d9e 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidInputErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/InvalidInputErrorModel.php @@ -21,11 +21,13 @@ final class InvalidInputErrorModel extends JsonObjectModel implements InvalidInp { public const DISCRIMINATOR_VALUE = 'InvalidInput'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class InvalidInputErrorModel extends JsonObjectModel implements InvalidInp * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InvalidItemShippingDetailsError.php b/lib/commercetools-api/src/Models/Error/InvalidItemShippingDetailsError.php index 4a961b5df8c..677459fb1fc 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidItemShippingDetailsError.php +++ b/lib/commercetools-api/src/Models/Error/InvalidItemShippingDetailsError.php @@ -17,11 +17,13 @@ interface InvalidItemShippingDetailsError extends ErrorObject public const FIELD_ITEM_ID = 'itemId'; /** + * @return null|string */ public function getSubject(); /** + * @return null|string */ public function getItemId(); diff --git a/lib/commercetools-api/src/Models/Error/InvalidItemShippingDetailsErrorBuilder.php b/lib/commercetools-api/src/Models/Error/InvalidItemShippingDetailsErrorBuilder.php index 3ccd6d64f8d..0101391e796 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidItemShippingDetailsErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/InvalidItemShippingDetailsErrorBuilder.php @@ -21,21 +21,25 @@ final class InvalidItemShippingDetailsErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $subject; /** + * @var ?string */ private $itemId; /** + * @return null|string */ public function getMessage() @@ -44,6 +48,7 @@ public function getMessage() } /** + * @return null|string */ public function getSubject() @@ -52,6 +57,7 @@ public function getSubject() } /** + * @return null|string */ public function getItemId() diff --git a/lib/commercetools-api/src/Models/Error/InvalidItemShippingDetailsErrorModel.php b/lib/commercetools-api/src/Models/Error/InvalidItemShippingDetailsErrorModel.php index e3b620c4723..3a3dbe7e546 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidItemShippingDetailsErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/InvalidItemShippingDetailsErrorModel.php @@ -21,21 +21,25 @@ final class InvalidItemShippingDetailsErrorModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'InvalidItemShippingDetails'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $subject; /** + * * @var ?string */ protected $itemId; @@ -47,15 +51,17 @@ final class InvalidItemShippingDetailsErrorModel extends JsonObjectModel impleme public function __construct( ?string $message = null, ?string $subject = null, - ?string $itemId = null + ?string $itemId = null, + ?string $code = null ) { $this->message = $message; $this->subject = $subject; $this->itemId = $itemId; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -73,6 +79,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -90,6 +97,7 @@ public function getMessage() } /** + * * @return null|string */ public function getSubject() @@ -107,6 +115,7 @@ public function getSubject() } /** + * * @return null|string */ public function getItemId() diff --git a/lib/commercetools-api/src/Models/Error/InvalidJsonInputErrorBuilder.php b/lib/commercetools-api/src/Models/Error/InvalidJsonInputErrorBuilder.php index 96c28b1ab76..061ac3dcc2b 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidJsonInputErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/InvalidJsonInputErrorBuilder.php @@ -21,11 +21,13 @@ final class InvalidJsonInputErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InvalidJsonInputErrorModel.php b/lib/commercetools-api/src/Models/Error/InvalidJsonInputErrorModel.php index f7fa9ae822d..0cd710e5be2 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidJsonInputErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/InvalidJsonInputErrorModel.php @@ -21,11 +21,13 @@ final class InvalidJsonInputErrorModel extends JsonObjectModel implements Invali { public const DISCRIMINATOR_VALUE = 'InvalidJsonInput'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class InvalidJsonInputErrorModel extends JsonObjectModel implements Invali * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InvalidOperationErrorBuilder.php b/lib/commercetools-api/src/Models/Error/InvalidOperationErrorBuilder.php index e9b66f99c03..14a6f1b9c76 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidOperationErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/InvalidOperationErrorBuilder.php @@ -21,11 +21,13 @@ final class InvalidOperationErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InvalidOperationErrorModel.php b/lib/commercetools-api/src/Models/Error/InvalidOperationErrorModel.php index b1702c6cb68..7bbc222cf04 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidOperationErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/InvalidOperationErrorModel.php @@ -21,11 +21,13 @@ final class InvalidOperationErrorModel extends JsonObjectModel implements Invali { public const DISCRIMINATOR_VALUE = 'InvalidOperation'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class InvalidOperationErrorModel extends JsonObjectModel implements Invali * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InvalidSubjectErrorBuilder.php b/lib/commercetools-api/src/Models/Error/InvalidSubjectErrorBuilder.php index d441a262ae8..8c2c7f66d55 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidSubjectErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/InvalidSubjectErrorBuilder.php @@ -21,11 +21,13 @@ final class InvalidSubjectErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InvalidSubjectErrorModel.php b/lib/commercetools-api/src/Models/Error/InvalidSubjectErrorModel.php index 1049a57b301..3f52f16b0c8 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidSubjectErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/InvalidSubjectErrorModel.php @@ -21,11 +21,13 @@ final class InvalidSubjectErrorModel extends JsonObjectModel implements InvalidS { public const DISCRIMINATOR_VALUE = 'InvalidSubject'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class InvalidSubjectErrorModel extends JsonObjectModel implements InvalidS * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InvalidTokenErrorBuilder.php b/lib/commercetools-api/src/Models/Error/InvalidTokenErrorBuilder.php index 87d388c50ce..76cecc1d158 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidTokenErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/InvalidTokenErrorBuilder.php @@ -21,11 +21,13 @@ final class InvalidTokenErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/InvalidTokenErrorModel.php b/lib/commercetools-api/src/Models/Error/InvalidTokenErrorModel.php index 2f44c6990f5..6b83c2ffb0d 100644 --- a/lib/commercetools-api/src/Models/Error/InvalidTokenErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/InvalidTokenErrorModel.php @@ -21,11 +21,13 @@ final class InvalidTokenErrorModel extends JsonObjectModel implements InvalidTok { public const DISCRIMINATOR_VALUE = 'invalid_token'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class InvalidTokenErrorModel extends JsonObjectModel implements InvalidTok * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/LanguageUsedInStoresErrorBuilder.php b/lib/commercetools-api/src/Models/Error/LanguageUsedInStoresErrorBuilder.php index cb69a15b684..7f01faacb99 100644 --- a/lib/commercetools-api/src/Models/Error/LanguageUsedInStoresErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/LanguageUsedInStoresErrorBuilder.php @@ -21,11 +21,13 @@ final class LanguageUsedInStoresErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/LanguageUsedInStoresErrorModel.php b/lib/commercetools-api/src/Models/Error/LanguageUsedInStoresErrorModel.php index 21755172d3a..0a8989f68c3 100644 --- a/lib/commercetools-api/src/Models/Error/LanguageUsedInStoresErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/LanguageUsedInStoresErrorModel.php @@ -21,11 +21,13 @@ final class LanguageUsedInStoresErrorModel extends JsonObjectModel implements La { public const DISCRIMINATOR_VALUE = 'LanguageUsedInStores'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class LanguageUsedInStoresErrorModel extends JsonObjectModel implements La * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/MatchingPriceNotFoundError.php b/lib/commercetools-api/src/Models/Error/MatchingPriceNotFoundError.php index fd2a0684944..cda715471be 100644 --- a/lib/commercetools-api/src/Models/Error/MatchingPriceNotFoundError.php +++ b/lib/commercetools-api/src/Models/Error/MatchingPriceNotFoundError.php @@ -23,21 +23,25 @@ interface MatchingPriceNotFoundError extends ErrorObject public const FIELD_CHANNEL = 'channel'; /** + * @return null|string */ public function getProductId(); /** + * @return null|int */ public function getVariantId(); /** + * @return null|string */ public function getCurrency(); /** + * @return null|string */ public function getCountry(); @@ -45,6 +49,7 @@ public function getCountry(); /** *

    Reference to a CustomerGroup.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup(); @@ -52,6 +57,7 @@ public function getCustomerGroup(); /** *

    Reference to a Channel.

    * + * @return null|ChannelReference */ public function getChannel(); diff --git a/lib/commercetools-api/src/Models/Error/MatchingPriceNotFoundErrorBuilder.php b/lib/commercetools-api/src/Models/Error/MatchingPriceNotFoundErrorBuilder.php index a001fae4c0b..54e1bdc2602 100644 --- a/lib/commercetools-api/src/Models/Error/MatchingPriceNotFoundErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/MatchingPriceNotFoundErrorBuilder.php @@ -25,41 +25,49 @@ final class MatchingPriceNotFoundErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $productId; /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $currency; /** + * @var ?string */ private $country; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $customerGroup; /** + * @var null|ChannelReference|ChannelReferenceBuilder */ private $channel; /** + * @return null|string */ public function getMessage() @@ -68,6 +76,7 @@ public function getMessage() } /** + * @return null|string */ public function getProductId() @@ -76,6 +85,7 @@ public function getProductId() } /** + * @return null|int */ public function getVariantId() @@ -84,6 +94,7 @@ public function getVariantId() } /** + * @return null|string */ public function getCurrency() @@ -92,6 +103,7 @@ public function getCurrency() } /** + * @return null|string */ public function getCountry() @@ -102,6 +114,7 @@ public function getCountry() /** *

    Reference to a CustomerGroup.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -112,6 +125,7 @@ public function getCustomerGroup() /** *

    Reference to a Channel.

    * + * @return null|ChannelReference */ public function getChannel() diff --git a/lib/commercetools-api/src/Models/Error/MatchingPriceNotFoundErrorModel.php b/lib/commercetools-api/src/Models/Error/MatchingPriceNotFoundErrorModel.php index 7b457d78a1c..f169aa0f9a3 100644 --- a/lib/commercetools-api/src/Models/Error/MatchingPriceNotFoundErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/MatchingPriceNotFoundErrorModel.php @@ -25,41 +25,49 @@ final class MatchingPriceNotFoundErrorModel extends JsonObjectModel implements M { public const DISCRIMINATOR_VALUE = 'MatchingPriceNotFound'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $productId; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $currency; /** + * * @var ?string */ protected $country; /** + * * @var ?CustomerGroupReference */ protected $customerGroup; /** + * * @var ?ChannelReference */ protected $channel; @@ -75,7 +83,8 @@ public function __construct( ?string $currency = null, ?string $country = null, ?CustomerGroupReference $customerGroup = null, - ?ChannelReference $channel = null + ?ChannelReference $channel = null, + ?string $code = null ) { $this->message = $message; $this->productId = $productId; @@ -84,10 +93,11 @@ public function __construct( $this->country = $country; $this->customerGroup = $customerGroup; $this->channel = $channel; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -105,6 +115,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -122,6 +133,7 @@ public function getMessage() } /** + * * @return null|string */ public function getProductId() @@ -139,6 +151,7 @@ public function getProductId() } /** + * * @return null|int */ public function getVariantId() @@ -156,6 +169,7 @@ public function getVariantId() } /** + * * @return null|string */ public function getCurrency() @@ -173,6 +187,7 @@ public function getCurrency() } /** + * * @return null|string */ public function getCountry() @@ -192,6 +207,7 @@ public function getCountry() /** *

    Reference to a CustomerGroup.

    * + * * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -212,6 +228,7 @@ public function getCustomerGroup() /** *

    Reference to a Channel.

    * + * * @return null|ChannelReference */ public function getChannel() diff --git a/lib/commercetools-api/src/Models/Error/MaxResourceLimitExceededError.php b/lib/commercetools-api/src/Models/Error/MaxResourceLimitExceededError.php index ea338d21856..e4cca676711 100644 --- a/lib/commercetools-api/src/Models/Error/MaxResourceLimitExceededError.php +++ b/lib/commercetools-api/src/Models/Error/MaxResourceLimitExceededError.php @@ -18,6 +18,7 @@ interface MaxResourceLimitExceededError extends ErrorObject /** *

    Type of resource the value should reference. Supported resource type identifiers are:

    * + * @return null|string */ public function getExceededResource(); diff --git a/lib/commercetools-api/src/Models/Error/MaxResourceLimitExceededErrorBuilder.php b/lib/commercetools-api/src/Models/Error/MaxResourceLimitExceededErrorBuilder.php index f30c29f96b7..14c6c9831c0 100644 --- a/lib/commercetools-api/src/Models/Error/MaxResourceLimitExceededErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/MaxResourceLimitExceededErrorBuilder.php @@ -21,16 +21,19 @@ final class MaxResourceLimitExceededErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $exceededResource; /** + * @return null|string */ public function getMessage() @@ -41,6 +44,7 @@ public function getMessage() /** *

    Type of resource the value should reference. Supported resource type identifiers are:

    * + * @return null|string */ public function getExceededResource() diff --git a/lib/commercetools-api/src/Models/Error/MaxResourceLimitExceededErrorModel.php b/lib/commercetools-api/src/Models/Error/MaxResourceLimitExceededErrorModel.php index 314f9c4d82c..0c514fa63ef 100644 --- a/lib/commercetools-api/src/Models/Error/MaxResourceLimitExceededErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/MaxResourceLimitExceededErrorModel.php @@ -21,16 +21,19 @@ final class MaxResourceLimitExceededErrorModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'MaxResourceLimitExceeded'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $exceededResource; @@ -41,14 +44,16 @@ final class MaxResourceLimitExceededErrorModel extends JsonObjectModel implement */ public function __construct( ?string $message = null, - ?string $exceededResource = null + ?string $exceededResource = null, + ?string $code = null ) { $this->message = $message; $this->exceededResource = $exceededResource; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -66,6 +71,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -85,6 +91,7 @@ public function getMessage() /** *

    Type of resource the value should reference. Supported resource type identifiers are:

    * + * * @return null|string */ public function getExceededResource() diff --git a/lib/commercetools-api/src/Models/Error/MissingRoleOnChannelError.php b/lib/commercetools-api/src/Models/Error/MissingRoleOnChannelError.php index 5f22defeba7..b6e307c8a34 100644 --- a/lib/commercetools-api/src/Models/Error/MissingRoleOnChannelError.php +++ b/lib/commercetools-api/src/Models/Error/MissingRoleOnChannelError.php @@ -20,6 +20,7 @@ interface MissingRoleOnChannelError extends ErrorObject /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getChannel(); @@ -27,6 +28,7 @@ public function getChannel(); /** *

    Describes the purpose and type of the Channel. A Channel can have one or more roles.

    * + * @return null|string */ public function getMissingRole(); diff --git a/lib/commercetools-api/src/Models/Error/MissingRoleOnChannelErrorBuilder.php b/lib/commercetools-api/src/Models/Error/MissingRoleOnChannelErrorBuilder.php index c36209208da..e8d5f58589d 100644 --- a/lib/commercetools-api/src/Models/Error/MissingRoleOnChannelErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/MissingRoleOnChannelErrorBuilder.php @@ -23,21 +23,25 @@ final class MissingRoleOnChannelErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $channel; /** + * @var ?string */ private $missingRole; /** + * @return null|string */ public function getMessage() @@ -48,6 +52,7 @@ public function getMessage() /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getChannel() @@ -58,6 +63,7 @@ public function getChannel() /** *

    Describes the purpose and type of the Channel. A Channel can have one or more roles.

    * + * @return null|string */ public function getMissingRole() diff --git a/lib/commercetools-api/src/Models/Error/MissingRoleOnChannelErrorModel.php b/lib/commercetools-api/src/Models/Error/MissingRoleOnChannelErrorModel.php index 5d52a14f7ff..ff2fb427543 100644 --- a/lib/commercetools-api/src/Models/Error/MissingRoleOnChannelErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/MissingRoleOnChannelErrorModel.php @@ -23,21 +23,25 @@ final class MissingRoleOnChannelErrorModel extends JsonObjectModel implements Mi { public const DISCRIMINATOR_VALUE = 'MissingRoleOnChannel'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?ChannelResourceIdentifier */ protected $channel; /** + * * @var ?string */ protected $missingRole; @@ -49,15 +53,17 @@ final class MissingRoleOnChannelErrorModel extends JsonObjectModel implements Mi public function __construct( ?string $message = null, ?ChannelResourceIdentifier $channel = null, - ?string $missingRole = null + ?string $missingRole = null, + ?string $code = null ) { $this->message = $message; $this->channel = $channel; $this->missingRole = $missingRole; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -75,6 +81,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -94,6 +101,7 @@ public function getMessage() /** *

    ResourceIdentifier to a Channel.

    * + * * @return null|ChannelResourceIdentifier */ public function getChannel() @@ -114,6 +122,7 @@ public function getChannel() /** *

    Describes the purpose and type of the Channel. A Channel can have one or more roles.

    * + * * @return null|string */ public function getMissingRole() diff --git a/lib/commercetools-api/src/Models/Error/MissingTaxRateForCountryError.php b/lib/commercetools-api/src/Models/Error/MissingTaxRateForCountryError.php index 7faf220daee..eba593a4df4 100644 --- a/lib/commercetools-api/src/Models/Error/MissingTaxRateForCountryError.php +++ b/lib/commercetools-api/src/Models/Error/MissingTaxRateForCountryError.php @@ -18,16 +18,19 @@ interface MissingTaxRateForCountryError extends ErrorObject public const FIELD_STATE = 'state'; /** + * @return null|string */ public function getTaxCategoryId(); /** + * @return null|string */ public function getCountry(); /** + * @return null|string */ public function getState(); diff --git a/lib/commercetools-api/src/Models/Error/MissingTaxRateForCountryErrorBuilder.php b/lib/commercetools-api/src/Models/Error/MissingTaxRateForCountryErrorBuilder.php index 528ba737b55..39e142562d4 100644 --- a/lib/commercetools-api/src/Models/Error/MissingTaxRateForCountryErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/MissingTaxRateForCountryErrorBuilder.php @@ -21,26 +21,31 @@ final class MissingTaxRateForCountryErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $taxCategoryId; /** + * @var ?string */ private $country; /** + * @var ?string */ private $state; /** + * @return null|string */ public function getMessage() @@ -49,6 +54,7 @@ public function getMessage() } /** + * @return null|string */ public function getTaxCategoryId() @@ -57,6 +63,7 @@ public function getTaxCategoryId() } /** + * @return null|string */ public function getCountry() @@ -65,6 +72,7 @@ public function getCountry() } /** + * @return null|string */ public function getState() diff --git a/lib/commercetools-api/src/Models/Error/MissingTaxRateForCountryErrorModel.php b/lib/commercetools-api/src/Models/Error/MissingTaxRateForCountryErrorModel.php index 9a541770a18..918a899c92f 100644 --- a/lib/commercetools-api/src/Models/Error/MissingTaxRateForCountryErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/MissingTaxRateForCountryErrorModel.php @@ -21,26 +21,31 @@ final class MissingTaxRateForCountryErrorModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'MissingTaxRateForCountry'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $taxCategoryId; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $state; @@ -53,16 +58,18 @@ public function __construct( ?string $message = null, ?string $taxCategoryId = null, ?string $country = null, - ?string $state = null + ?string $state = null, + ?string $code = null ) { $this->message = $message; $this->taxCategoryId = $taxCategoryId; $this->country = $country; $this->state = $state; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -80,6 +87,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -97,6 +105,7 @@ public function getMessage() } /** + * * @return null|string */ public function getTaxCategoryId() @@ -114,6 +123,7 @@ public function getTaxCategoryId() } /** + * * @return null|string */ public function getCountry() @@ -131,6 +141,7 @@ public function getCountry() } /** + * * @return null|string */ public function getState() diff --git a/lib/commercetools-api/src/Models/Error/NoMatchingProductDiscountFoundErrorBuilder.php b/lib/commercetools-api/src/Models/Error/NoMatchingProductDiscountFoundErrorBuilder.php index 159e3e95b12..30ce1c8f584 100644 --- a/lib/commercetools-api/src/Models/Error/NoMatchingProductDiscountFoundErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/NoMatchingProductDiscountFoundErrorBuilder.php @@ -21,11 +21,13 @@ final class NoMatchingProductDiscountFoundErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/NoMatchingProductDiscountFoundErrorModel.php b/lib/commercetools-api/src/Models/Error/NoMatchingProductDiscountFoundErrorModel.php index da6a44e6558..c08da3f95ad 100644 --- a/lib/commercetools-api/src/Models/Error/NoMatchingProductDiscountFoundErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/NoMatchingProductDiscountFoundErrorModel.php @@ -21,11 +21,13 @@ final class NoMatchingProductDiscountFoundErrorModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'NoMatchingProductDiscountFound'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class NoMatchingProductDiscountFoundErrorModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/NotEnabledErrorBuilder.php b/lib/commercetools-api/src/Models/Error/NotEnabledErrorBuilder.php index 39af2e1632c..fc1e083939c 100644 --- a/lib/commercetools-api/src/Models/Error/NotEnabledErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/NotEnabledErrorBuilder.php @@ -21,11 +21,13 @@ final class NotEnabledErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/NotEnabledErrorModel.php b/lib/commercetools-api/src/Models/Error/NotEnabledErrorModel.php index 2aa703aaf5f..5eaa8df34ba 100644 --- a/lib/commercetools-api/src/Models/Error/NotEnabledErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/NotEnabledErrorModel.php @@ -21,11 +21,13 @@ final class NotEnabledErrorModel extends JsonObjectModel implements NotEnabledEr { public const DISCRIMINATOR_VALUE = 'NotEnabled'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class NotEnabledErrorModel extends JsonObjectModel implements NotEnabledEr * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/ObjectNotFoundErrorBuilder.php b/lib/commercetools-api/src/Models/Error/ObjectNotFoundErrorBuilder.php index 1b17e2e4749..02933975ba8 100644 --- a/lib/commercetools-api/src/Models/Error/ObjectNotFoundErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/ObjectNotFoundErrorBuilder.php @@ -21,11 +21,13 @@ final class ObjectNotFoundErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/ObjectNotFoundErrorModel.php b/lib/commercetools-api/src/Models/Error/ObjectNotFoundErrorModel.php index ab346daf65b..97a411a775b 100644 --- a/lib/commercetools-api/src/Models/Error/ObjectNotFoundErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/ObjectNotFoundErrorModel.php @@ -21,11 +21,13 @@ final class ObjectNotFoundErrorModel extends JsonObjectModel implements ObjectNo { public const DISCRIMINATOR_VALUE = 'ObjectNotFound'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class ObjectNotFoundErrorModel extends JsonObjectModel implements ObjectNo * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/OutOfStockError.php b/lib/commercetools-api/src/Models/Error/OutOfStockError.php index d60868b1ce5..b0b39624d21 100644 --- a/lib/commercetools-api/src/Models/Error/OutOfStockError.php +++ b/lib/commercetools-api/src/Models/Error/OutOfStockError.php @@ -17,11 +17,13 @@ interface OutOfStockError extends ErrorObject public const FIELD_SKUS = 'skus'; /** + * @return null|array */ public function getLineItems(); /** + * @return null|array */ public function getSkus(); diff --git a/lib/commercetools-api/src/Models/Error/OutOfStockErrorBuilder.php b/lib/commercetools-api/src/Models/Error/OutOfStockErrorBuilder.php index 43f0fb65d33..02219558a3e 100644 --- a/lib/commercetools-api/src/Models/Error/OutOfStockErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/OutOfStockErrorBuilder.php @@ -21,21 +21,25 @@ final class OutOfStockErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?array */ private $lineItems; /** + * @var ?array */ private $skus; /** + * @return null|string */ public function getMessage() @@ -44,6 +48,7 @@ public function getMessage() } /** + * @return null|array */ public function getLineItems() @@ -52,6 +57,7 @@ public function getLineItems() } /** + * @return null|array */ public function getSkus() diff --git a/lib/commercetools-api/src/Models/Error/OutOfStockErrorModel.php b/lib/commercetools-api/src/Models/Error/OutOfStockErrorModel.php index 62e94ff7a61..0d9b18bd342 100644 --- a/lib/commercetools-api/src/Models/Error/OutOfStockErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/OutOfStockErrorModel.php @@ -21,21 +21,25 @@ final class OutOfStockErrorModel extends JsonObjectModel implements OutOfStockEr { public const DISCRIMINATOR_VALUE = 'OutOfStock'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?array */ protected $lineItems; /** + * * @var ?array */ protected $skus; @@ -47,15 +51,17 @@ final class OutOfStockErrorModel extends JsonObjectModel implements OutOfStockEr public function __construct( ?string $message = null, ?array $lineItems = null, - ?array $skus = null + ?array $skus = null, + ?string $code = null ) { $this->message = $message; $this->lineItems = $lineItems; $this->skus = $skus; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -73,6 +79,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -90,6 +97,7 @@ public function getMessage() } /** + * * @return null|array */ public function getLineItems() @@ -107,6 +115,7 @@ public function getLineItems() } /** + * * @return null|array */ public function getSkus() diff --git a/lib/commercetools-api/src/Models/Error/OverCapacityErrorBuilder.php b/lib/commercetools-api/src/Models/Error/OverCapacityErrorBuilder.php index 8b4d797cd7d..74959f62464 100644 --- a/lib/commercetools-api/src/Models/Error/OverCapacityErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/OverCapacityErrorBuilder.php @@ -21,11 +21,13 @@ final class OverCapacityErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/OverCapacityErrorModel.php b/lib/commercetools-api/src/Models/Error/OverCapacityErrorModel.php index 07e0a071932..2a8434797a0 100644 --- a/lib/commercetools-api/src/Models/Error/OverCapacityErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/OverCapacityErrorModel.php @@ -21,11 +21,13 @@ final class OverCapacityErrorModel extends JsonObjectModel implements OverCapaci { public const DISCRIMINATOR_VALUE = 'OverCapacity'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class OverCapacityErrorModel extends JsonObjectModel implements OverCapaci * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/OverlappingStandalonePriceValidityError.php b/lib/commercetools-api/src/Models/Error/OverlappingStandalonePriceValidityError.php index a05056b3fc7..46614e79e01 100644 --- a/lib/commercetools-api/src/Models/Error/OverlappingStandalonePriceValidityError.php +++ b/lib/commercetools-api/src/Models/Error/OverlappingStandalonePriceValidityError.php @@ -31,21 +31,25 @@ interface OverlappingStandalonePriceValidityError extends ErrorObject /** *

    Reference to a StandalonePrice.

    * + * @return null|StandalonePriceReference */ public function getConflictingStandalonePrice(); /** + * @return null|string */ public function getSku(); /** + * @return null|string */ public function getCurrency(); /** + * @return null|string */ public function getCountry(); @@ -53,6 +57,7 @@ public function getCountry(); /** *

    ResourceIdentifier to a CustomerGroup.

    * + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup(); @@ -60,26 +65,31 @@ public function getCustomerGroup(); /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getChannel(); /** + * @return null|DateTimeImmutable */ public function getValidFrom(); /** + * @return null|DateTimeImmutable */ public function getValidUntil(); /** + * @return null|DateTimeImmutable */ public function getConflictingValidFrom(); /** + * @return null|DateTimeImmutable */ public function getConflictingValidUntil(); diff --git a/lib/commercetools-api/src/Models/Error/OverlappingStandalonePriceValidityErrorBuilder.php b/lib/commercetools-api/src/Models/Error/OverlappingStandalonePriceValidityErrorBuilder.php index 5ba9ed04f28..d347dbeba7a 100644 --- a/lib/commercetools-api/src/Models/Error/OverlappingStandalonePriceValidityErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/OverlappingStandalonePriceValidityErrorBuilder.php @@ -28,61 +28,73 @@ final class OverlappingStandalonePriceValidityErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var null|StandalonePriceReference|StandalonePriceReferenceBuilder */ private $conflictingStandalonePrice; /** + * @var ?string */ private $sku; /** + * @var ?string */ private $currency; /** + * @var ?string */ private $country; /** + * @var null|CustomerGroupResourceIdentifier|CustomerGroupResourceIdentifierBuilder */ private $customerGroup; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $channel; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; /** + * @var ?DateTimeImmutable */ private $conflictingValidFrom; /** + * @var ?DateTimeImmutable */ private $conflictingValidUntil; /** + * @return null|string */ public function getMessage() @@ -93,6 +105,7 @@ public function getMessage() /** *

    Reference to a StandalonePrice.

    * + * @return null|StandalonePriceReference */ public function getConflictingStandalonePrice() @@ -101,6 +114,7 @@ public function getConflictingStandalonePrice() } /** + * @return null|string */ public function getSku() @@ -109,6 +123,7 @@ public function getSku() } /** + * @return null|string */ public function getCurrency() @@ -117,6 +132,7 @@ public function getCurrency() } /** + * @return null|string */ public function getCountry() @@ -127,6 +143,7 @@ public function getCountry() /** *

    ResourceIdentifier to a CustomerGroup.

    * + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() @@ -137,6 +154,7 @@ public function getCustomerGroup() /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getChannel() @@ -145,6 +163,7 @@ public function getChannel() } /** + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -153,6 +172,7 @@ public function getValidFrom() } /** + * @return null|DateTimeImmutable */ public function getValidUntil() @@ -161,6 +181,7 @@ public function getValidUntil() } /** + * @return null|DateTimeImmutable */ public function getConflictingValidFrom() @@ -169,6 +190,7 @@ public function getConflictingValidFrom() } /** + * @return null|DateTimeImmutable */ public function getConflictingValidUntil() diff --git a/lib/commercetools-api/src/Models/Error/OverlappingStandalonePriceValidityErrorModel.php b/lib/commercetools-api/src/Models/Error/OverlappingStandalonePriceValidityErrorModel.php index d0375ba1213..181cef82f67 100644 --- a/lib/commercetools-api/src/Models/Error/OverlappingStandalonePriceValidityErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/OverlappingStandalonePriceValidityErrorModel.php @@ -28,61 +28,73 @@ final class OverlappingStandalonePriceValidityErrorModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'OverlappingStandalonePriceValidity'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?StandalonePriceReference */ protected $conflictingStandalonePrice; /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $currency; /** + * * @var ?string */ protected $country; /** + * * @var ?CustomerGroupResourceIdentifier */ protected $customerGroup; /** + * * @var ?ChannelResourceIdentifier */ protected $channel; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; /** + * * @var ?DateTimeImmutable */ protected $conflictingValidFrom; /** + * * @var ?DateTimeImmutable */ protected $conflictingValidUntil; @@ -102,7 +114,8 @@ public function __construct( ?DateTimeImmutable $validFrom = null, ?DateTimeImmutable $validUntil = null, ?DateTimeImmutable $conflictingValidFrom = null, - ?DateTimeImmutable $conflictingValidUntil = null + ?DateTimeImmutable $conflictingValidUntil = null, + ?string $code = null ) { $this->message = $message; $this->conflictingStandalonePrice = $conflictingStandalonePrice; @@ -115,10 +128,11 @@ public function __construct( $this->validUntil = $validUntil; $this->conflictingValidFrom = $conflictingValidFrom; $this->conflictingValidUntil = $conflictingValidUntil; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -136,6 +150,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -155,6 +170,7 @@ public function getMessage() /** *

    Reference to a StandalonePrice.

    * + * * @return null|StandalonePriceReference */ public function getConflictingStandalonePrice() @@ -173,6 +189,7 @@ public function getConflictingStandalonePrice() } /** + * * @return null|string */ public function getSku() @@ -190,6 +207,7 @@ public function getSku() } /** + * * @return null|string */ public function getCurrency() @@ -207,6 +225,7 @@ public function getCurrency() } /** + * * @return null|string */ public function getCountry() @@ -226,6 +245,7 @@ public function getCountry() /** *

    ResourceIdentifier to a CustomerGroup.

    * + * * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() @@ -246,6 +266,7 @@ public function getCustomerGroup() /** *

    ResourceIdentifier to a Channel.

    * + * * @return null|ChannelResourceIdentifier */ public function getChannel() @@ -264,6 +285,7 @@ public function getChannel() } /** + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -285,6 +307,7 @@ public function getValidFrom() } /** + * * @return null|DateTimeImmutable */ public function getValidUntil() @@ -306,6 +329,7 @@ public function getValidUntil() } /** + * * @return null|DateTimeImmutable */ public function getConflictingValidFrom() @@ -327,6 +351,7 @@ public function getConflictingValidFrom() } /** + * * @return null|DateTimeImmutable */ public function getConflictingValidUntil() diff --git a/lib/commercetools-api/src/Models/Error/PendingOperationErrorBuilder.php b/lib/commercetools-api/src/Models/Error/PendingOperationErrorBuilder.php index 1e1582ce3c6..a21425ba4b1 100644 --- a/lib/commercetools-api/src/Models/Error/PendingOperationErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/PendingOperationErrorBuilder.php @@ -21,11 +21,13 @@ final class PendingOperationErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/PendingOperationErrorModel.php b/lib/commercetools-api/src/Models/Error/PendingOperationErrorModel.php index e315efbb964..9321ccd4468 100644 --- a/lib/commercetools-api/src/Models/Error/PendingOperationErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/PendingOperationErrorModel.php @@ -21,11 +21,13 @@ final class PendingOperationErrorModel extends JsonObjectModel implements Pendin { public const DISCRIMINATOR_VALUE = 'PendingOperation'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class PendingOperationErrorModel extends JsonObjectModel implements Pendin * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/PriceChangedError.php b/lib/commercetools-api/src/Models/Error/PriceChangedError.php index 70ddb2b3327..dcf1c9a09aa 100644 --- a/lib/commercetools-api/src/Models/Error/PriceChangedError.php +++ b/lib/commercetools-api/src/Models/Error/PriceChangedError.php @@ -17,11 +17,13 @@ interface PriceChangedError extends ErrorObject public const FIELD_SHIPPING = 'shipping'; /** + * @return null|array */ public function getLineItems(); /** + * @return null|bool */ public function getShipping(); diff --git a/lib/commercetools-api/src/Models/Error/PriceChangedErrorBuilder.php b/lib/commercetools-api/src/Models/Error/PriceChangedErrorBuilder.php index 661918bf7aa..8cda8d282d0 100644 --- a/lib/commercetools-api/src/Models/Error/PriceChangedErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/PriceChangedErrorBuilder.php @@ -21,21 +21,25 @@ final class PriceChangedErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?array */ private $lineItems; /** + * @var ?bool */ private $shipping; /** + * @return null|string */ public function getMessage() @@ -44,6 +48,7 @@ public function getMessage() } /** + * @return null|array */ public function getLineItems() @@ -52,6 +57,7 @@ public function getLineItems() } /** + * @return null|bool */ public function getShipping() diff --git a/lib/commercetools-api/src/Models/Error/PriceChangedErrorModel.php b/lib/commercetools-api/src/Models/Error/PriceChangedErrorModel.php index 5cd6737ba28..f00e01e5012 100644 --- a/lib/commercetools-api/src/Models/Error/PriceChangedErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/PriceChangedErrorModel.php @@ -21,21 +21,25 @@ final class PriceChangedErrorModel extends JsonObjectModel implements PriceChang { public const DISCRIMINATOR_VALUE = 'PriceChanged'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?array */ protected $lineItems; /** + * * @var ?bool */ protected $shipping; @@ -47,15 +51,17 @@ final class PriceChangedErrorModel extends JsonObjectModel implements PriceChang public function __construct( ?string $message = null, ?array $lineItems = null, - ?bool $shipping = null + ?bool $shipping = null, + ?string $code = null ) { $this->message = $message; $this->lineItems = $lineItems; $this->shipping = $shipping; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -73,6 +79,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -90,6 +97,7 @@ public function getMessage() } /** + * * @return null|array */ public function getLineItems() @@ -107,6 +115,7 @@ public function getLineItems() } /** + * * @return null|bool */ public function getShipping() diff --git a/lib/commercetools-api/src/Models/Error/ProjectNotConfiguredForLanguagesError.php b/lib/commercetools-api/src/Models/Error/ProjectNotConfiguredForLanguagesError.php index 8ff1512d082..20b7bb143b8 100644 --- a/lib/commercetools-api/src/Models/Error/ProjectNotConfiguredForLanguagesError.php +++ b/lib/commercetools-api/src/Models/Error/ProjectNotConfiguredForLanguagesError.php @@ -16,6 +16,7 @@ interface ProjectNotConfiguredForLanguagesError extends ErrorObject public const FIELD_LANGUAGES = 'languages'; /** + * @return null|array */ public function getLanguages(); diff --git a/lib/commercetools-api/src/Models/Error/ProjectNotConfiguredForLanguagesErrorBuilder.php b/lib/commercetools-api/src/Models/Error/ProjectNotConfiguredForLanguagesErrorBuilder.php index 4ba6c84d1fa..8baed851b10 100644 --- a/lib/commercetools-api/src/Models/Error/ProjectNotConfiguredForLanguagesErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/ProjectNotConfiguredForLanguagesErrorBuilder.php @@ -21,16 +21,19 @@ final class ProjectNotConfiguredForLanguagesErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?array */ private $languages; /** + * @return null|string */ public function getMessage() @@ -39,6 +42,7 @@ public function getMessage() } /** + * @return null|array */ public function getLanguages() diff --git a/lib/commercetools-api/src/Models/Error/ProjectNotConfiguredForLanguagesErrorModel.php b/lib/commercetools-api/src/Models/Error/ProjectNotConfiguredForLanguagesErrorModel.php index 17d7ad06a61..e1171439798 100644 --- a/lib/commercetools-api/src/Models/Error/ProjectNotConfiguredForLanguagesErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/ProjectNotConfiguredForLanguagesErrorModel.php @@ -21,16 +21,19 @@ final class ProjectNotConfiguredForLanguagesErrorModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'ProjectNotConfiguredForLanguages'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?array */ protected $languages; @@ -41,14 +44,16 @@ final class ProjectNotConfiguredForLanguagesErrorModel extends JsonObjectModel i */ public function __construct( ?string $message = null, - ?array $languages = null + ?array $languages = null, + ?string $code = null ) { $this->message = $message; $this->languages = $languages; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -66,6 +71,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -83,6 +89,7 @@ public function getMessage() } /** + * * @return null|array */ public function getLanguages() diff --git a/lib/commercetools-api/src/Models/Error/QueryComplexityLimitExceededErrorBuilder.php b/lib/commercetools-api/src/Models/Error/QueryComplexityLimitExceededErrorBuilder.php index b2c0f2b774e..6b881403af9 100644 --- a/lib/commercetools-api/src/Models/Error/QueryComplexityLimitExceededErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/QueryComplexityLimitExceededErrorBuilder.php @@ -21,11 +21,13 @@ final class QueryComplexityLimitExceededErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/QueryComplexityLimitExceededErrorModel.php b/lib/commercetools-api/src/Models/Error/QueryComplexityLimitExceededErrorModel.php index 8af584a6334..5a5f2d15336 100644 --- a/lib/commercetools-api/src/Models/Error/QueryComplexityLimitExceededErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/QueryComplexityLimitExceededErrorModel.php @@ -21,11 +21,13 @@ final class QueryComplexityLimitExceededErrorModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'QueryComplexityLimitExceeded'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class QueryComplexityLimitExceededErrorModel extends JsonObjectModel imple * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/QueryTimedOutErrorBuilder.php b/lib/commercetools-api/src/Models/Error/QueryTimedOutErrorBuilder.php index 8e04dd6a607..7870dd54098 100644 --- a/lib/commercetools-api/src/Models/Error/QueryTimedOutErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/QueryTimedOutErrorBuilder.php @@ -21,11 +21,13 @@ final class QueryTimedOutErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/QueryTimedOutErrorModel.php b/lib/commercetools-api/src/Models/Error/QueryTimedOutErrorModel.php index b0439323236..f77713d1c66 100644 --- a/lib/commercetools-api/src/Models/Error/QueryTimedOutErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/QueryTimedOutErrorModel.php @@ -21,11 +21,13 @@ final class QueryTimedOutErrorModel extends JsonObjectModel implements QueryTime { public const DISCRIMINATOR_VALUE = 'QueryTimedOut'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class QueryTimedOutErrorModel extends JsonObjectModel implements QueryTime * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/ReferenceExistsError.php b/lib/commercetools-api/src/Models/Error/ReferenceExistsError.php index 08aa6e9fed5..6f2f568ec2d 100644 --- a/lib/commercetools-api/src/Models/Error/ReferenceExistsError.php +++ b/lib/commercetools-api/src/Models/Error/ReferenceExistsError.php @@ -18,6 +18,7 @@ interface ReferenceExistsError extends ErrorObject /** *

    Type of resource the value should reference. Supported resource type identifiers are:

    * + * @return null|string */ public function getReferencedBy(); diff --git a/lib/commercetools-api/src/Models/Error/ReferenceExistsErrorBuilder.php b/lib/commercetools-api/src/Models/Error/ReferenceExistsErrorBuilder.php index 83695490a3b..86ada46fd35 100644 --- a/lib/commercetools-api/src/Models/Error/ReferenceExistsErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/ReferenceExistsErrorBuilder.php @@ -21,16 +21,19 @@ final class ReferenceExistsErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $referencedBy; /** + * @return null|string */ public function getMessage() @@ -41,6 +44,7 @@ public function getMessage() /** *

    Type of resource the value should reference. Supported resource type identifiers are:

    * + * @return null|string */ public function getReferencedBy() diff --git a/lib/commercetools-api/src/Models/Error/ReferenceExistsErrorModel.php b/lib/commercetools-api/src/Models/Error/ReferenceExistsErrorModel.php index 0ae4e2b8ab9..920894dad06 100644 --- a/lib/commercetools-api/src/Models/Error/ReferenceExistsErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/ReferenceExistsErrorModel.php @@ -21,16 +21,19 @@ final class ReferenceExistsErrorModel extends JsonObjectModel implements Referen { public const DISCRIMINATOR_VALUE = 'ReferenceExists'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $referencedBy; @@ -41,14 +44,16 @@ final class ReferenceExistsErrorModel extends JsonObjectModel implements Referen */ public function __construct( ?string $message = null, - ?string $referencedBy = null + ?string $referencedBy = null, + ?string $code = null ) { $this->message = $message; $this->referencedBy = $referencedBy; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -66,6 +71,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -85,6 +91,7 @@ public function getMessage() /** *

    Type of resource the value should reference. Supported resource type identifiers are:

    * + * * @return null|string */ public function getReferencedBy() diff --git a/lib/commercetools-api/src/Models/Error/ReferencedResourceNotFoundError.php b/lib/commercetools-api/src/Models/Error/ReferencedResourceNotFoundError.php index 4f0608e9e84..41511118241 100644 --- a/lib/commercetools-api/src/Models/Error/ReferencedResourceNotFoundError.php +++ b/lib/commercetools-api/src/Models/Error/ReferencedResourceNotFoundError.php @@ -20,16 +20,19 @@ interface ReferencedResourceNotFoundError extends ErrorObject /** *

    Type of resource the value should reference. Supported resource type identifiers are:

    * + * @return null|string */ public function getTypeId(); /** + * @return null|string */ public function getId(); /** + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Error/ReferencedResourceNotFoundErrorBuilder.php b/lib/commercetools-api/src/Models/Error/ReferencedResourceNotFoundErrorBuilder.php index 919068e6abd..711ce4aed9a 100644 --- a/lib/commercetools-api/src/Models/Error/ReferencedResourceNotFoundErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/ReferencedResourceNotFoundErrorBuilder.php @@ -21,26 +21,31 @@ final class ReferencedResourceNotFoundErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $typeId; /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; /** + * @return null|string */ public function getMessage() @@ -51,6 +56,7 @@ public function getMessage() /** *

    Type of resource the value should reference. Supported resource type identifiers are:

    * + * @return null|string */ public function getTypeId() @@ -59,6 +65,7 @@ public function getTypeId() } /** + * @return null|string */ public function getId() @@ -67,6 +74,7 @@ public function getId() } /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Error/ReferencedResourceNotFoundErrorModel.php b/lib/commercetools-api/src/Models/Error/ReferencedResourceNotFoundErrorModel.php index 2d9b9d1693d..b1526e34b05 100644 --- a/lib/commercetools-api/src/Models/Error/ReferencedResourceNotFoundErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/ReferencedResourceNotFoundErrorModel.php @@ -21,26 +21,31 @@ final class ReferencedResourceNotFoundErrorModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'ReferencedResourceNotFound'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -53,16 +58,18 @@ public function __construct( ?string $message = null, ?string $typeId = null, ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $code = null ) { $this->message = $message; $this->typeId = $typeId; $this->id = $id; $this->key = $key; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -80,6 +87,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -99,6 +107,7 @@ public function getMessage() /** *

    Type of resource the value should reference. Supported resource type identifiers are:

    * + * * @return null|string */ public function getTypeId() @@ -116,6 +125,7 @@ public function getTypeId() } /** + * * @return null|string */ public function getId() @@ -133,6 +143,7 @@ public function getId() } /** + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Error/RequiredFieldError.php b/lib/commercetools-api/src/Models/Error/RequiredFieldError.php index cb570c230db..bcbd031ca58 100644 --- a/lib/commercetools-api/src/Models/Error/RequiredFieldError.php +++ b/lib/commercetools-api/src/Models/Error/RequiredFieldError.php @@ -16,6 +16,7 @@ interface RequiredFieldError extends ErrorObject public const FIELD_FIELD = 'field'; /** + * @return null|string */ public function getField(); diff --git a/lib/commercetools-api/src/Models/Error/RequiredFieldErrorBuilder.php b/lib/commercetools-api/src/Models/Error/RequiredFieldErrorBuilder.php index e04ca1d9228..7bdd41d784e 100644 --- a/lib/commercetools-api/src/Models/Error/RequiredFieldErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/RequiredFieldErrorBuilder.php @@ -21,16 +21,19 @@ final class RequiredFieldErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $field; /** + * @return null|string */ public function getMessage() @@ -39,6 +42,7 @@ public function getMessage() } /** + * @return null|string */ public function getField() diff --git a/lib/commercetools-api/src/Models/Error/RequiredFieldErrorModel.php b/lib/commercetools-api/src/Models/Error/RequiredFieldErrorModel.php index 5a38f3e7fca..4190c095cd4 100644 --- a/lib/commercetools-api/src/Models/Error/RequiredFieldErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/RequiredFieldErrorModel.php @@ -21,16 +21,19 @@ final class RequiredFieldErrorModel extends JsonObjectModel implements RequiredF { public const DISCRIMINATOR_VALUE = 'RequiredField'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $field; @@ -41,14 +44,16 @@ final class RequiredFieldErrorModel extends JsonObjectModel implements RequiredF */ public function __construct( ?string $message = null, - ?string $field = null + ?string $field = null, + ?string $code = null ) { $this->message = $message; $this->field = $field; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -66,6 +71,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -83,6 +89,7 @@ public function getMessage() } /** + * * @return null|string */ public function getField() diff --git a/lib/commercetools-api/src/Models/Error/ResourceNotFoundErrorBuilder.php b/lib/commercetools-api/src/Models/Error/ResourceNotFoundErrorBuilder.php index 20dee54cc6c..1fc4c242b9b 100644 --- a/lib/commercetools-api/src/Models/Error/ResourceNotFoundErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/ResourceNotFoundErrorBuilder.php @@ -21,11 +21,13 @@ final class ResourceNotFoundErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/ResourceNotFoundErrorModel.php b/lib/commercetools-api/src/Models/Error/ResourceNotFoundErrorModel.php index 951b8d6ff64..de84e821ee7 100644 --- a/lib/commercetools-api/src/Models/Error/ResourceNotFoundErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/ResourceNotFoundErrorModel.php @@ -21,11 +21,13 @@ final class ResourceNotFoundErrorModel extends JsonObjectModel implements Resour { public const DISCRIMINATOR_VALUE = 'ResourceNotFound'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class ResourceNotFoundErrorModel extends JsonObjectModel implements Resour * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/ResourceSizeLimitExceededErrorBuilder.php b/lib/commercetools-api/src/Models/Error/ResourceSizeLimitExceededErrorBuilder.php index b0197c9887a..e9e374cb837 100644 --- a/lib/commercetools-api/src/Models/Error/ResourceSizeLimitExceededErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/ResourceSizeLimitExceededErrorBuilder.php @@ -21,11 +21,13 @@ final class ResourceSizeLimitExceededErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/ResourceSizeLimitExceededErrorModel.php b/lib/commercetools-api/src/Models/Error/ResourceSizeLimitExceededErrorModel.php index 7b8c74c2528..4b33aa2cb1b 100644 --- a/lib/commercetools-api/src/Models/Error/ResourceSizeLimitExceededErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/ResourceSizeLimitExceededErrorModel.php @@ -21,11 +21,13 @@ final class ResourceSizeLimitExceededErrorModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'ResourceSizeLimitExceeded'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class ResourceSizeLimitExceededErrorModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/SearchDeactivatedErrorBuilder.php b/lib/commercetools-api/src/Models/Error/SearchDeactivatedErrorBuilder.php index 51bfff4b812..7656fe5999f 100644 --- a/lib/commercetools-api/src/Models/Error/SearchDeactivatedErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/SearchDeactivatedErrorBuilder.php @@ -21,11 +21,13 @@ final class SearchDeactivatedErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/SearchDeactivatedErrorModel.php b/lib/commercetools-api/src/Models/Error/SearchDeactivatedErrorModel.php index 6780515ca48..f717e37ffd1 100644 --- a/lib/commercetools-api/src/Models/Error/SearchDeactivatedErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/SearchDeactivatedErrorModel.php @@ -21,11 +21,13 @@ final class SearchDeactivatedErrorModel extends JsonObjectModel implements Searc { public const DISCRIMINATOR_VALUE = 'SearchDeactivated'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class SearchDeactivatedErrorModel extends JsonObjectModel implements Searc * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/SearchExecutionFailureErrorBuilder.php b/lib/commercetools-api/src/Models/Error/SearchExecutionFailureErrorBuilder.php index 5ae8da8d631..e210b96cd58 100644 --- a/lib/commercetools-api/src/Models/Error/SearchExecutionFailureErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/SearchExecutionFailureErrorBuilder.php @@ -21,11 +21,13 @@ final class SearchExecutionFailureErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/SearchExecutionFailureErrorModel.php b/lib/commercetools-api/src/Models/Error/SearchExecutionFailureErrorModel.php index 3486022a432..0259f1b0e74 100644 --- a/lib/commercetools-api/src/Models/Error/SearchExecutionFailureErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/SearchExecutionFailureErrorModel.php @@ -21,11 +21,13 @@ final class SearchExecutionFailureErrorModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'SearchExecutionFailure'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class SearchExecutionFailureErrorModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/SearchFacetPathNotFoundErrorBuilder.php b/lib/commercetools-api/src/Models/Error/SearchFacetPathNotFoundErrorBuilder.php index 2df17344cef..b3809df5e80 100644 --- a/lib/commercetools-api/src/Models/Error/SearchFacetPathNotFoundErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/SearchFacetPathNotFoundErrorBuilder.php @@ -21,11 +21,13 @@ final class SearchFacetPathNotFoundErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/SearchFacetPathNotFoundErrorModel.php b/lib/commercetools-api/src/Models/Error/SearchFacetPathNotFoundErrorModel.php index d6110b7b5ce..aa04f97a788 100644 --- a/lib/commercetools-api/src/Models/Error/SearchFacetPathNotFoundErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/SearchFacetPathNotFoundErrorModel.php @@ -21,11 +21,13 @@ final class SearchFacetPathNotFoundErrorModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'SearchFacetPathNotFound'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class SearchFacetPathNotFoundErrorModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/SearchIndexingInProgressErrorBuilder.php b/lib/commercetools-api/src/Models/Error/SearchIndexingInProgressErrorBuilder.php index b0718b0d3e8..3e9c81d91eb 100644 --- a/lib/commercetools-api/src/Models/Error/SearchIndexingInProgressErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/SearchIndexingInProgressErrorBuilder.php @@ -21,11 +21,13 @@ final class SearchIndexingInProgressErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/SearchIndexingInProgressErrorModel.php b/lib/commercetools-api/src/Models/Error/SearchIndexingInProgressErrorModel.php index 35e0f76e579..89c5ab58d0f 100644 --- a/lib/commercetools-api/src/Models/Error/SearchIndexingInProgressErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/SearchIndexingInProgressErrorModel.php @@ -21,11 +21,13 @@ final class SearchIndexingInProgressErrorModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'SearchIndexingInProgress'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class SearchIndexingInProgressErrorModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/SemanticErrorErrorBuilder.php b/lib/commercetools-api/src/Models/Error/SemanticErrorErrorBuilder.php index 2536500c22e..08bee928318 100644 --- a/lib/commercetools-api/src/Models/Error/SemanticErrorErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/SemanticErrorErrorBuilder.php @@ -21,11 +21,13 @@ final class SemanticErrorErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/SemanticErrorErrorModel.php b/lib/commercetools-api/src/Models/Error/SemanticErrorErrorModel.php index 38b9e8b2454..68e7479db25 100644 --- a/lib/commercetools-api/src/Models/Error/SemanticErrorErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/SemanticErrorErrorModel.php @@ -21,11 +21,13 @@ final class SemanticErrorErrorModel extends JsonObjectModel implements SemanticE { public const DISCRIMINATOR_VALUE = 'SemanticError'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class SemanticErrorErrorModel extends JsonObjectModel implements SemanticE * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/ShippingMethodDoesNotMatchCartErrorBuilder.php b/lib/commercetools-api/src/Models/Error/ShippingMethodDoesNotMatchCartErrorBuilder.php index 6656bb8eb15..a95f114e5ef 100644 --- a/lib/commercetools-api/src/Models/Error/ShippingMethodDoesNotMatchCartErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/ShippingMethodDoesNotMatchCartErrorBuilder.php @@ -21,11 +21,13 @@ final class ShippingMethodDoesNotMatchCartErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/ShippingMethodDoesNotMatchCartErrorModel.php b/lib/commercetools-api/src/Models/Error/ShippingMethodDoesNotMatchCartErrorModel.php index 7a8285e5bdd..4d5231d0111 100644 --- a/lib/commercetools-api/src/Models/Error/ShippingMethodDoesNotMatchCartErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/ShippingMethodDoesNotMatchCartErrorModel.php @@ -21,11 +21,13 @@ final class ShippingMethodDoesNotMatchCartErrorModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'ShippingMethodDoesNotMatchCart'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class ShippingMethodDoesNotMatchCartErrorModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/SyntaxErrorErrorBuilder.php b/lib/commercetools-api/src/Models/Error/SyntaxErrorErrorBuilder.php index b313bece68d..bc925987edb 100644 --- a/lib/commercetools-api/src/Models/Error/SyntaxErrorErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/SyntaxErrorErrorBuilder.php @@ -21,11 +21,13 @@ final class SyntaxErrorErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/SyntaxErrorErrorModel.php b/lib/commercetools-api/src/Models/Error/SyntaxErrorErrorModel.php index 30801efffab..869f5b730e1 100644 --- a/lib/commercetools-api/src/Models/Error/SyntaxErrorErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/SyntaxErrorErrorModel.php @@ -21,11 +21,13 @@ final class SyntaxErrorErrorModel extends JsonObjectModel implements SyntaxError { public const DISCRIMINATOR_VALUE = 'SyntaxError'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class SyntaxErrorErrorModel extends JsonObjectModel implements SyntaxError * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/VariantValues.php b/lib/commercetools-api/src/Models/Error/VariantValues.php index 1137e0793e1..2d9057a4ed5 100644 --- a/lib/commercetools-api/src/Models/Error/VariantValues.php +++ b/lib/commercetools-api/src/Models/Error/VariantValues.php @@ -20,16 +20,19 @@ interface VariantValues extends JsonObject public const FIELD_ATTRIBUTES = 'attributes'; /** + * @return null|string */ public function getSku(); /** + * @return null|PriceDraftCollection */ public function getPrices(); /** + * @return null|AttributeCollection */ public function getAttributes(); diff --git a/lib/commercetools-api/src/Models/Error/VariantValuesBuilder.php b/lib/commercetools-api/src/Models/Error/VariantValuesBuilder.php index 6cadced4910..27c01fff0fe 100644 --- a/lib/commercetools-api/src/Models/Error/VariantValuesBuilder.php +++ b/lib/commercetools-api/src/Models/Error/VariantValuesBuilder.php @@ -23,21 +23,25 @@ final class VariantValuesBuilder implements Builder { /** + * @var ?string */ private $sku; /** + * @var ?PriceDraftCollection */ private $prices; /** + * @var ?AttributeCollection */ private $attributes; /** + * @return null|string */ public function getSku() @@ -46,6 +50,7 @@ public function getSku() } /** + * @return null|PriceDraftCollection */ public function getPrices() @@ -54,6 +59,7 @@ public function getPrices() } /** + * @return null|AttributeCollection */ public function getAttributes() diff --git a/lib/commercetools-api/src/Models/Error/VariantValuesModel.php b/lib/commercetools-api/src/Models/Error/VariantValuesModel.php index bbb820ff496..569b5d43641 100644 --- a/lib/commercetools-api/src/Models/Error/VariantValuesModel.php +++ b/lib/commercetools-api/src/Models/Error/VariantValuesModel.php @@ -22,16 +22,19 @@ final class VariantValuesModel extends JsonObjectModel implements VariantValues { /** + * * @var ?string */ protected $sku; /** + * * @var ?PriceDraftCollection */ protected $prices; /** + * * @var ?AttributeCollection */ protected $attributes; @@ -51,6 +54,7 @@ public function __construct( } /** + * * @return null|string */ public function getSku() @@ -68,6 +72,7 @@ public function getSku() } /** + * * @return null|PriceDraftCollection */ public function getPrices() @@ -85,6 +90,7 @@ public function getPrices() } /** + * * @return null|AttributeCollection */ public function getAttributes() diff --git a/lib/commercetools-api/src/Models/Error/WeakPasswordErrorBuilder.php b/lib/commercetools-api/src/Models/Error/WeakPasswordErrorBuilder.php index b91887181f1..14bc92d336b 100644 --- a/lib/commercetools-api/src/Models/Error/WeakPasswordErrorBuilder.php +++ b/lib/commercetools-api/src/Models/Error/WeakPasswordErrorBuilder.php @@ -21,11 +21,13 @@ final class WeakPasswordErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Error/WeakPasswordErrorModel.php b/lib/commercetools-api/src/Models/Error/WeakPasswordErrorModel.php index 453dc777424..fdd3f577200 100644 --- a/lib/commercetools-api/src/Models/Error/WeakPasswordErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/WeakPasswordErrorModel.php @@ -21,11 +21,13 @@ final class WeakPasswordErrorModel extends JsonObjectModel implements WeakPasswo { public const DISCRIMINATOR_VALUE = 'WeakPassword'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class WeakPasswordErrorModel extends JsonObjectModel implements WeakPasswo * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-api/src/Models/Extension/AWSLambdaDestination.php b/lib/commercetools-api/src/Models/Extension/AWSLambdaDestination.php index d984fcb2bcd..2c222c256f1 100644 --- a/lib/commercetools-api/src/Models/Extension/AWSLambdaDestination.php +++ b/lib/commercetools-api/src/Models/Extension/AWSLambdaDestination.php @@ -20,6 +20,7 @@ interface AWSLambdaDestination extends ExtensionDestination /** *

    Amazon Resource Name (ARN) of the Lambda function in the format arn:aws:lambda:<region>:<accountid>:function:<functionName>.

    * + * @return null|string */ public function getArn(); @@ -27,6 +28,7 @@ public function getArn(); /** *

    Partially hidden on retrieval for security reasons.

    * + * @return null|string */ public function getAccessKey(); @@ -34,6 +36,7 @@ public function getAccessKey(); /** *

    Partially hidden on retrieval for security reasons.

    * + * @return null|string */ public function getAccessSecret(); diff --git a/lib/commercetools-api/src/Models/Extension/AWSLambdaDestinationBuilder.php b/lib/commercetools-api/src/Models/Extension/AWSLambdaDestinationBuilder.php index 0ecfc14504e..0d63f06df43 100644 --- a/lib/commercetools-api/src/Models/Extension/AWSLambdaDestinationBuilder.php +++ b/lib/commercetools-api/src/Models/Extension/AWSLambdaDestinationBuilder.php @@ -21,16 +21,19 @@ final class AWSLambdaDestinationBuilder implements Builder { /** + * @var ?string */ private $arn; /** + * @var ?string */ private $accessKey; /** + * @var ?string */ private $accessSecret; @@ -38,6 +41,7 @@ final class AWSLambdaDestinationBuilder implements Builder /** *

    Amazon Resource Name (ARN) of the Lambda function in the format arn:aws:lambda:<region>:<accountid>:function:<functionName>.

    * + * @return null|string */ public function getArn() @@ -48,6 +52,7 @@ public function getArn() /** *

    Partially hidden on retrieval for security reasons.

    * + * @return null|string */ public function getAccessKey() @@ -58,6 +63,7 @@ public function getAccessKey() /** *

    Partially hidden on retrieval for security reasons.

    * + * @return null|string */ public function getAccessSecret() diff --git a/lib/commercetools-api/src/Models/Extension/AWSLambdaDestinationModel.php b/lib/commercetools-api/src/Models/Extension/AWSLambdaDestinationModel.php index 452da4162a6..fba8e2dee04 100644 --- a/lib/commercetools-api/src/Models/Extension/AWSLambdaDestinationModel.php +++ b/lib/commercetools-api/src/Models/Extension/AWSLambdaDestinationModel.php @@ -21,21 +21,25 @@ final class AWSLambdaDestinationModel extends JsonObjectModel implements AWSLamb { public const DISCRIMINATOR_VALUE = 'AWSLambda'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $arn; /** + * * @var ?string */ protected $accessKey; /** + * * @var ?string */ protected $accessSecret; @@ -47,15 +51,17 @@ final class AWSLambdaDestinationModel extends JsonObjectModel implements AWSLamb public function __construct( ?string $arn = null, ?string $accessKey = null, - ?string $accessSecret = null + ?string $accessSecret = null, + ?string $type = null ) { $this->arn = $arn; $this->accessKey = $accessKey; $this->accessSecret = $accessSecret; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -75,6 +81,7 @@ public function getType() /** *

    Amazon Resource Name (ARN) of the Lambda function in the format arn:aws:lambda:<region>:<accountid>:function:<functionName>.

    * + * * @return null|string */ public function getArn() @@ -94,6 +101,7 @@ public function getArn() /** *

    Partially hidden on retrieval for security reasons.

    * + * * @return null|string */ public function getAccessKey() @@ -113,6 +121,7 @@ public function getAccessKey() /** *

    Partially hidden on retrieval for security reasons.

    * + * * @return null|string */ public function getAccessSecret() diff --git a/lib/commercetools-api/src/Models/Extension/AuthorizationHeaderAuthentication.php b/lib/commercetools-api/src/Models/Extension/AuthorizationHeaderAuthentication.php index b5226204cdc..ef0bacca022 100644 --- a/lib/commercetools-api/src/Models/Extension/AuthorizationHeaderAuthentication.php +++ b/lib/commercetools-api/src/Models/Extension/AuthorizationHeaderAuthentication.php @@ -18,6 +18,7 @@ interface AuthorizationHeaderAuthentication extends HttpDestinationAuthenticatio /** *

    Partially hidden on retrieval for security reasons.

    * + * @return null|string */ public function getHeaderValue(); diff --git a/lib/commercetools-api/src/Models/Extension/AuthorizationHeaderAuthenticationBuilder.php b/lib/commercetools-api/src/Models/Extension/AuthorizationHeaderAuthenticationBuilder.php index 485c43d503d..23ddaf1e40e 100644 --- a/lib/commercetools-api/src/Models/Extension/AuthorizationHeaderAuthenticationBuilder.php +++ b/lib/commercetools-api/src/Models/Extension/AuthorizationHeaderAuthenticationBuilder.php @@ -21,6 +21,7 @@ final class AuthorizationHeaderAuthenticationBuilder implements Builder { /** + * @var ?string */ private $headerValue; @@ -28,6 +29,7 @@ final class AuthorizationHeaderAuthenticationBuilder implements Builder /** *

    Partially hidden on retrieval for security reasons.

    * + * @return null|string */ public function getHeaderValue() diff --git a/lib/commercetools-api/src/Models/Extension/AuthorizationHeaderAuthenticationModel.php b/lib/commercetools-api/src/Models/Extension/AuthorizationHeaderAuthenticationModel.php index 6b10c7af570..b90313f927d 100644 --- a/lib/commercetools-api/src/Models/Extension/AuthorizationHeaderAuthenticationModel.php +++ b/lib/commercetools-api/src/Models/Extension/AuthorizationHeaderAuthenticationModel.php @@ -21,11 +21,13 @@ final class AuthorizationHeaderAuthenticationModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'AuthorizationHeader'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $headerValue; @@ -35,13 +37,15 @@ final class AuthorizationHeaderAuthenticationModel extends JsonObjectModel imple * @psalm-suppress MissingParamType */ public function __construct( - ?string $headerValue = null + ?string $headerValue = null, + ?string $type = null ) { $this->headerValue = $headerValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() /** *

    Partially hidden on retrieval for security reasons.

    * + * * @return null|string */ public function getHeaderValue() diff --git a/lib/commercetools-api/src/Models/Extension/AzureFunctionsAuthentication.php b/lib/commercetools-api/src/Models/Extension/AzureFunctionsAuthentication.php index 24cd0aa219b..30ed881afa1 100644 --- a/lib/commercetools-api/src/Models/Extension/AzureFunctionsAuthentication.php +++ b/lib/commercetools-api/src/Models/Extension/AzureFunctionsAuthentication.php @@ -18,6 +18,7 @@ interface AzureFunctionsAuthentication extends HttpDestinationAuthentication /** *

    Partially hidden on retrieval for security reasons.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Extension/AzureFunctionsAuthenticationBuilder.php b/lib/commercetools-api/src/Models/Extension/AzureFunctionsAuthenticationBuilder.php index a6eb38f21d6..1cb50a2a666 100644 --- a/lib/commercetools-api/src/Models/Extension/AzureFunctionsAuthenticationBuilder.php +++ b/lib/commercetools-api/src/Models/Extension/AzureFunctionsAuthenticationBuilder.php @@ -21,6 +21,7 @@ final class AzureFunctionsAuthenticationBuilder implements Builder { /** + * @var ?string */ private $key; @@ -28,6 +29,7 @@ final class AzureFunctionsAuthenticationBuilder implements Builder /** *

    Partially hidden on retrieval for security reasons.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Extension/AzureFunctionsAuthenticationModel.php b/lib/commercetools-api/src/Models/Extension/AzureFunctionsAuthenticationModel.php index 9570c7d4648..aeab18d3dae 100644 --- a/lib/commercetools-api/src/Models/Extension/AzureFunctionsAuthenticationModel.php +++ b/lib/commercetools-api/src/Models/Extension/AzureFunctionsAuthenticationModel.php @@ -21,11 +21,13 @@ final class AzureFunctionsAuthenticationModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'AzureFunctions'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class AzureFunctionsAuthenticationModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $type = null ) { $this->key = $key; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() /** *

    Partially hidden on retrieval for security reasons.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Extension/Extension.php b/lib/commercetools-api/src/Models/Extension/Extension.php index 724c5e77772..df5079ff1cb 100644 --- a/lib/commercetools-api/src/Models/Extension/Extension.php +++ b/lib/commercetools-api/src/Models/Extension/Extension.php @@ -27,6 +27,7 @@ interface Extension extends BaseResource /** *

    Unique identifier of the Extension.

    * + * @return null|string */ public function getId(); @@ -34,6 +35,7 @@ public function getId(); /** *

    Current version of the Extension.

    * + * @return null|int */ public function getVersion(); @@ -41,6 +43,7 @@ public function getVersion(); /** *

    Date and time (UTC) the Extension was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -48,6 +51,7 @@ public function getCreatedAt(); /** *

    Date and time (UTC) the Extension was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -55,6 +59,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -62,6 +67,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -69,6 +75,7 @@ public function getCreatedBy(); /** *

    User-defined unique identifier of the Extension.

    * + * @return null|string */ public function getKey(); @@ -76,6 +83,7 @@ public function getKey(); /** *

    The configuration for the Extension, including its type, location and authentication details.

    * + * @return null|ExtensionDestination */ public function getDestination(); @@ -83,6 +91,7 @@ public function getDestination(); /** *

    Describes what triggers the Extension.

    * + * @return null|ExtensionTriggerCollection */ public function getTriggers(); @@ -92,6 +101,7 @@ public function getTriggers(); * If no timeout is provided, the default value is used for all types of Extensions. * The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.

    * + * @return null|int */ public function getTimeoutInMs(); diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionBuilder.php b/lib/commercetools-api/src/Models/Extension/ExtensionBuilder.php index c8117931a59..02dbcbaf83a 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionBuilder.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionBuilder.php @@ -28,51 +28,61 @@ final class ExtensionBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $key; /** + * @var null|ExtensionDestination|ExtensionDestinationBuilder */ private $destination; /** + * @var ?ExtensionTriggerCollection */ private $triggers; /** + * @var ?int */ private $timeoutInMs; @@ -80,6 +90,7 @@ final class ExtensionBuilder implements Builder /** *

    Unique identifier of the Extension.

    * + * @return null|string */ public function getId() @@ -90,6 +101,7 @@ public function getId() /** *

    Current version of the Extension.

    * + * @return null|int */ public function getVersion() @@ -100,6 +112,7 @@ public function getVersion() /** *

    Date and time (UTC) the Extension was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -110,6 +123,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the Extension was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -120,6 +134,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -130,6 +145,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -140,6 +156,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the Extension.

    * + * @return null|string */ public function getKey() @@ -150,6 +167,7 @@ public function getKey() /** *

    The configuration for the Extension, including its type, location and authentication details.

    * + * @return null|ExtensionDestination */ public function getDestination() @@ -160,6 +178,7 @@ public function getDestination() /** *

    Describes what triggers the Extension.

    * + * @return null|ExtensionTriggerCollection */ public function getTriggers() @@ -172,6 +191,7 @@ public function getTriggers() * If no timeout is provided, the default value is used for all types of Extensions. * The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.

    * + * @return null|int */ public function getTimeoutInMs() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionChangeDestinationAction.php b/lib/commercetools-api/src/Models/Extension/ExtensionChangeDestinationAction.php index 129d2a1a365..6e83d196380 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionChangeDestinationAction.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionChangeDestinationAction.php @@ -18,6 +18,7 @@ interface ExtensionChangeDestinationAction extends ExtensionUpdateAction /** *

    New value to set. Must not be empty.

    * + * @return null|ExtensionDestination */ public function getDestination(); diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionChangeDestinationActionBuilder.php b/lib/commercetools-api/src/Models/Extension/ExtensionChangeDestinationActionBuilder.php index 04e0c15c565..10bccbef506 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionChangeDestinationActionBuilder.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionChangeDestinationActionBuilder.php @@ -21,6 +21,7 @@ final class ExtensionChangeDestinationActionBuilder implements Builder { /** + * @var null|ExtensionDestination|ExtensionDestinationBuilder */ private $destination; @@ -28,6 +29,7 @@ final class ExtensionChangeDestinationActionBuilder implements Builder /** *

    New value to set. Must not be empty.

    * + * @return null|ExtensionDestination */ public function getDestination() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionChangeDestinationActionModel.php b/lib/commercetools-api/src/Models/Extension/ExtensionChangeDestinationActionModel.php index 9230f1a2d04..b70437f1189 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionChangeDestinationActionModel.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionChangeDestinationActionModel.php @@ -21,11 +21,13 @@ final class ExtensionChangeDestinationActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'changeDestination'; /** + * * @var ?string */ protected $action; /** + * * @var ?ExtensionDestination */ protected $destination; @@ -35,13 +37,15 @@ final class ExtensionChangeDestinationActionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?ExtensionDestination $destination = null + ?ExtensionDestination $destination = null, + ?string $action = null ) { $this->destination = $destination; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    New value to set. Must not be empty.

    * + * * @return null|ExtensionDestination */ public function getDestination() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionChangeTriggersAction.php b/lib/commercetools-api/src/Models/Extension/ExtensionChangeTriggersAction.php index 071e6e0c209..720d053254e 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionChangeTriggersAction.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionChangeTriggersAction.php @@ -18,6 +18,7 @@ interface ExtensionChangeTriggersAction extends ExtensionUpdateAction /** *

    New value to set. Must not be empty.

    * + * @return null|ExtensionTriggerCollection */ public function getTriggers(); diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionChangeTriggersActionBuilder.php b/lib/commercetools-api/src/Models/Extension/ExtensionChangeTriggersActionBuilder.php index 347718fd982..3d5218a1678 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionChangeTriggersActionBuilder.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionChangeTriggersActionBuilder.php @@ -21,6 +21,7 @@ final class ExtensionChangeTriggersActionBuilder implements Builder { /** + * @var ?ExtensionTriggerCollection */ private $triggers; @@ -28,6 +29,7 @@ final class ExtensionChangeTriggersActionBuilder implements Builder /** *

    New value to set. Must not be empty.

    * + * @return null|ExtensionTriggerCollection */ public function getTriggers() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionChangeTriggersActionModel.php b/lib/commercetools-api/src/Models/Extension/ExtensionChangeTriggersActionModel.php index e04d70f7253..729af97e7e2 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionChangeTriggersActionModel.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionChangeTriggersActionModel.php @@ -21,11 +21,13 @@ final class ExtensionChangeTriggersActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'changeTriggers'; /** + * * @var ?string */ protected $action; /** + * * @var ?ExtensionTriggerCollection */ protected $triggers; @@ -35,13 +37,15 @@ final class ExtensionChangeTriggersActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?ExtensionTriggerCollection $triggers = null + ?ExtensionTriggerCollection $triggers = null, + ?string $action = null ) { $this->triggers = $triggers; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    New value to set. Must not be empty.

    * + * * @return null|ExtensionTriggerCollection */ public function getTriggers() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionDestination.php b/lib/commercetools-api/src/Models/Extension/ExtensionDestination.php index 3b978594fdd..dd4d9223558 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionDestination.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionDestination.php @@ -17,6 +17,7 @@ interface ExtensionDestination extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionDestinationModel.php b/lib/commercetools-api/src/Models/Extension/ExtensionDestinationModel.php index 081ea212498..f966d24934d 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionDestinationModel.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionDestinationModel.php @@ -21,6 +21,7 @@ final class ExtensionDestinationModel extends JsonObjectModel implements Extensi { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -38,11 +39,13 @@ final class ExtensionDestinationModel extends JsonObjectModel implements Extensi * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionDraft.php b/lib/commercetools-api/src/Models/Extension/ExtensionDraft.php index 837c5bb92d5..4e3cf45eb3b 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionDraft.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionDraft.php @@ -21,6 +21,7 @@ interface ExtensionDraft extends JsonObject /** *

    User-defined unique identifier for the Extension.

    * + * @return null|string */ public function getKey(); @@ -28,6 +29,7 @@ public function getKey(); /** *

    Defines where the Extension can be reached.

    * + * @return null|ExtensionDestination */ public function getDestination(); @@ -35,6 +37,7 @@ public function getDestination(); /** *

    Describes what triggers the Extension.

    * + * @return null|ExtensionTriggerCollection */ public function getTriggers(); @@ -46,6 +49,7 @@ public function getTriggers(); *

    This limit can be increased per Project after we review the performance impact. * Please contact our support via the Support Portal and provide the Region, Project key, and use case.

    * + * @return null|int */ public function getTimeoutInMs(); diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionDraftBuilder.php b/lib/commercetools-api/src/Models/Extension/ExtensionDraftBuilder.php index f9f41415914..4205bc5657e 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionDraftBuilder.php @@ -21,21 +21,25 @@ final class ExtensionDraftBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var null|ExtensionDestination|ExtensionDestinationBuilder */ private $destination; /** + * @var ?ExtensionTriggerCollection */ private $triggers; /** + * @var ?int */ private $timeoutInMs; @@ -43,6 +47,7 @@ final class ExtensionDraftBuilder implements Builder /** *

    User-defined unique identifier for the Extension.

    * + * @return null|string */ public function getKey() @@ -53,6 +58,7 @@ public function getKey() /** *

    Defines where the Extension can be reached.

    * + * @return null|ExtensionDestination */ public function getDestination() @@ -63,6 +69,7 @@ public function getDestination() /** *

    Describes what triggers the Extension.

    * + * @return null|ExtensionTriggerCollection */ public function getTriggers() @@ -77,6 +84,7 @@ public function getTriggers() *

    This limit can be increased per Project after we review the performance impact. * Please contact our support via the Support Portal and provide the Region, Project key, and use case.

    * + * @return null|int */ public function getTimeoutInMs() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionDraftModel.php b/lib/commercetools-api/src/Models/Extension/ExtensionDraftModel.php index 9bc03c6a5e7..b98e046c491 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionDraftModel.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionDraftModel.php @@ -20,21 +20,25 @@ final class ExtensionDraftModel extends JsonObjectModel implements ExtensionDraft { /** + * * @var ?string */ protected $key; /** + * * @var ?ExtensionDestination */ protected $destination; /** + * * @var ?ExtensionTriggerCollection */ protected $triggers; /** + * * @var ?int */ protected $timeoutInMs; @@ -58,6 +62,7 @@ public function __construct( /** *

    User-defined unique identifier for the Extension.

    * + * * @return null|string */ public function getKey() @@ -77,6 +82,7 @@ public function getKey() /** *

    Defines where the Extension can be reached.

    * + * * @return null|ExtensionDestination */ public function getDestination() @@ -97,6 +103,7 @@ public function getDestination() /** *

    Describes what triggers the Extension.

    * + * * @return null|ExtensionTriggerCollection */ public function getTriggers() @@ -120,6 +127,7 @@ public function getTriggers() *

    This limit can be increased per Project after we review the performance impact. * Please contact our support via the Support Portal and provide the Region, Project key, and use case.

    * + * * @return null|int */ public function getTimeoutInMs() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionInput.php b/lib/commercetools-api/src/Models/Extension/ExtensionInput.php index f267d236843..2d4377ed03b 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionInput.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionInput.php @@ -20,6 +20,7 @@ interface ExtensionInput extends JsonObject /** *

    Create or Update request.

    * + * @return null|string */ public function getAction(); @@ -27,6 +28,7 @@ public function getAction(); /** *

    Expanded reference to the resource that triggered the Extension.

    * + * @return null|Reference */ public function getResource(); diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionInputBuilder.php b/lib/commercetools-api/src/Models/Extension/ExtensionInputBuilder.php index 1f45f7d1211..663ed8d1e6d 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionInputBuilder.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionInputBuilder.php @@ -23,11 +23,13 @@ final class ExtensionInputBuilder implements Builder { /** + * @var ?string */ private $action; /** + * @var null|Reference|ReferenceBuilder */ private $resource; @@ -35,6 +37,7 @@ final class ExtensionInputBuilder implements Builder /** *

    Create or Update request.

    * + * @return null|string */ public function getAction() @@ -45,6 +48,7 @@ public function getAction() /** *

    Expanded reference to the resource that triggered the Extension.

    * + * @return null|Reference */ public function getResource() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionInputModel.php b/lib/commercetools-api/src/Models/Extension/ExtensionInputModel.php index db7b683ec07..139b1efcb88 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionInputModel.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionInputModel.php @@ -22,11 +22,13 @@ final class ExtensionInputModel extends JsonObjectModel implements ExtensionInput { /** + * * @var ?string */ protected $action; /** + * * @var ?Reference */ protected $resource; @@ -46,6 +48,7 @@ public function __construct( /** *

    Create or Update request.

    * + * * @return null|string */ public function getAction() @@ -65,6 +68,7 @@ public function getAction() /** *

    Expanded reference to the resource that triggered the Extension.

    * + * * @return null|Reference */ public function getResource() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionModel.php b/lib/commercetools-api/src/Models/Extension/ExtensionModel.php index 5e2e78edb37..15d9f357d59 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionModel.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionModel.php @@ -27,51 +27,61 @@ final class ExtensionModel extends JsonObjectModel implements Extension { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $key; /** + * * @var ?ExtensionDestination */ protected $destination; /** + * * @var ?ExtensionTriggerCollection */ protected $triggers; /** + * * @var ?int */ protected $timeoutInMs; @@ -107,6 +117,7 @@ public function __construct( /** *

    Unique identifier of the Extension.

    * + * * @return null|string */ public function getId() @@ -126,6 +137,7 @@ public function getId() /** *

    Current version of the Extension.

    * + * * @return null|int */ public function getVersion() @@ -145,6 +157,7 @@ public function getVersion() /** *

    Date and time (UTC) the Extension was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -168,6 +181,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the Extension was last updated.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -191,6 +205,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -211,6 +226,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -231,6 +247,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the Extension.

    * + * * @return null|string */ public function getKey() @@ -250,6 +267,7 @@ public function getKey() /** *

    The configuration for the Extension, including its type, location and authentication details.

    * + * * @return null|ExtensionDestination */ public function getDestination() @@ -270,6 +288,7 @@ public function getDestination() /** *

    Describes what triggers the Extension.

    * + * * @return null|ExtensionTriggerCollection */ public function getTriggers() @@ -291,6 +310,7 @@ public function getTriggers() * If no timeout is provided, the default value is used for all types of Extensions. * The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.

    * + * * @return null|int */ public function getTimeoutInMs() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionPagedQueryResponse.php b/lib/commercetools-api/src/Models/Extension/ExtensionPagedQueryResponse.php index 5937564125e..8307119b107 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionPagedQueryResponse.php @@ -22,6 +22,7 @@ interface ExtensionPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    Extensions matching the query.

    * + * @return null|ExtensionCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Extension/ExtensionPagedQueryResponseBuilder.php index b6d3bb92328..d27defe42f9 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class ExtensionPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?ExtensionCollection */ private $results; @@ -48,6 +53,7 @@ final class ExtensionPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    Extensions matching the query.

    * + * @return null|ExtensionCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Extension/ExtensionPagedQueryResponseModel.php index 9fcd1d30594..3bc1e031a06 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class ExtensionPagedQueryResponseModel extends JsonObjectModel implements ExtensionPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?ExtensionCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    Extensions matching the query.

    * + * * @return null|ExtensionCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionSetKeyAction.php b/lib/commercetools-api/src/Models/Extension/ExtensionSetKeyAction.php index 2ce30c64bfc..d01fee5df70 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionSetKeyAction.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionSetKeyAction.php @@ -18,6 +18,7 @@ interface ExtensionSetKeyAction extends ExtensionUpdateAction /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/Extension/ExtensionSetKeyActionBuilder.php index d2b64e44a7c..2ef03db24bd 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionSetKeyActionBuilder.php @@ -21,6 +21,7 @@ final class ExtensionSetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; @@ -28,6 +29,7 @@ final class ExtensionSetKeyActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionSetKeyActionModel.php b/lib/commercetools-api/src/Models/Extension/ExtensionSetKeyActionModel.php index ccbae8f6b71..66761e661c2 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionSetKeyActionModel.php @@ -21,11 +21,13 @@ final class ExtensionSetKeyActionModel extends JsonObjectModel implements Extens { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class ExtensionSetKeyActionModel extends JsonObjectModel implements Extens * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionSetTimeoutInMsAction.php b/lib/commercetools-api/src/Models/Extension/ExtensionSetTimeoutInMsAction.php index b180f094a10..c7f91969b17 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionSetTimeoutInMsAction.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionSetTimeoutInMsAction.php @@ -22,6 +22,7 @@ interface ExtensionSetTimeoutInMsAction extends ExtensionUpdateAction *

    This limit can be increased per Project after we review the performance impact. * Please contact our support via the Support Portal and provide the Region, Project key, and use case.

    * + * @return null|int */ public function getTimeoutInMs(); diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionSetTimeoutInMsActionBuilder.php b/lib/commercetools-api/src/Models/Extension/ExtensionSetTimeoutInMsActionBuilder.php index 93743707ffc..8c510594620 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionSetTimeoutInMsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionSetTimeoutInMsActionBuilder.php @@ -21,6 +21,7 @@ final class ExtensionSetTimeoutInMsActionBuilder implements Builder { /** + * @var ?int */ private $timeoutInMs; @@ -32,6 +33,7 @@ final class ExtensionSetTimeoutInMsActionBuilder implements Builder *

    This limit can be increased per Project after we review the performance impact. * Please contact our support via the Support Portal and provide the Region, Project key, and use case.

    * + * @return null|int */ public function getTimeoutInMs() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionSetTimeoutInMsActionModel.php b/lib/commercetools-api/src/Models/Extension/ExtensionSetTimeoutInMsActionModel.php index fb5a512a288..51b408fcf65 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionSetTimeoutInMsActionModel.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionSetTimeoutInMsActionModel.php @@ -21,11 +21,13 @@ final class ExtensionSetTimeoutInMsActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'setTimeoutInMs'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $timeoutInMs; @@ -35,13 +37,15 @@ final class ExtensionSetTimeoutInMsActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?int $timeoutInMs = null + ?int $timeoutInMs = null, + ?string $action = null ) { $this->timeoutInMs = $timeoutInMs; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -65,6 +69,7 @@ public function getAction() *

    This limit can be increased per Project after we review the performance impact. * Please contact our support via the Support Portal and provide the Region, Project key, and use case.

    * + * * @return null|int */ public function getTimeoutInMs() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionTrigger.php b/lib/commercetools-api/src/Models/Extension/ExtensionTrigger.php index 9b740b943f6..76be518ace2 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionTrigger.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionTrigger.php @@ -18,8 +18,9 @@ interface ExtensionTrigger extends JsonObject public const FIELD_CONDITION = 'condition'; /** - *

    cart, order, payment, and customer are supported.

    + *

    cart, order, payment, customer, quote-request, staged-quote, quote, and business-unit are supported.

    * + * @return null|string */ public function getResourceTypeId(); @@ -27,6 +28,7 @@ public function getResourceTypeId(); /** *

    Create and Update requests are supported.

    * + * @return null|array */ public function getActions(); @@ -34,6 +36,7 @@ public function getActions(); /** *

    Valid predicate that controls the conditions under which the API Extension is called. The Extension is not triggered when the specified condition is not fulfilled.

    * + * @return null|string */ public function getCondition(); diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionTriggerBuilder.php b/lib/commercetools-api/src/Models/Extension/ExtensionTriggerBuilder.php index edc8c3b9130..42ade2a83da 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionTriggerBuilder.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionTriggerBuilder.php @@ -21,23 +21,27 @@ final class ExtensionTriggerBuilder implements Builder { /** + * @var ?string */ private $resourceTypeId; /** + * @var ?array */ private $actions; /** + * @var ?string */ private $condition; /** - *

    cart, order, payment, and customer are supported.

    + *

    cart, order, payment, customer, quote-request, staged-quote, quote, and business-unit are supported.

    * + * @return null|string */ public function getResourceTypeId() @@ -48,6 +52,7 @@ public function getResourceTypeId() /** *

    Create and Update requests are supported.

    * + * @return null|array */ public function getActions() @@ -58,6 +63,7 @@ public function getActions() /** *

    Valid predicate that controls the conditions under which the API Extension is called. The Extension is not triggered when the specified condition is not fulfilled.

    * + * @return null|string */ public function getCondition() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionTriggerModel.php b/lib/commercetools-api/src/Models/Extension/ExtensionTriggerModel.php index f1e879df488..64de2101294 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionTriggerModel.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionTriggerModel.php @@ -20,16 +20,19 @@ final class ExtensionTriggerModel extends JsonObjectModel implements ExtensionTrigger { /** + * * @var ?string */ protected $resourceTypeId; /** + * * @var ?array */ protected $actions; /** + * * @var ?string */ protected $condition; @@ -49,7 +52,8 @@ public function __construct( } /** - *

    cart, order, payment, and customer are supported.

    + *

    cart, order, payment, customer, quote-request, staged-quote, quote, and business-unit are supported.

    + * * * @return null|string */ @@ -70,6 +74,7 @@ public function getResourceTypeId() /** *

    Create and Update requests are supported.

    * + * * @return null|array */ public function getActions() @@ -89,6 +94,7 @@ public function getActions() /** *

    Valid predicate that controls the conditions under which the API Extension is called. The Extension is not triggered when the specified condition is not fulfilled.

    * + * * @return null|string */ public function getCondition() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionUpdate.php b/lib/commercetools-api/src/Models/Extension/ExtensionUpdate.php index e717f84d429..7f3530d2fdc 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionUpdate.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionUpdate.php @@ -19,6 +19,7 @@ interface ExtensionUpdate extends JsonObject /** *

    Expected version of the Extension on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion(); @@ -26,6 +27,7 @@ public function getVersion(); /** *

    Update actions to be performed on the Extension.

    * + * @return null|ExtensionUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionUpdateAction.php b/lib/commercetools-api/src/Models/Extension/ExtensionUpdateAction.php index f193ee3284c..ac64abff0cc 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionUpdateAction.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionUpdateAction.php @@ -17,6 +17,7 @@ interface ExtensionUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionUpdateActionModel.php b/lib/commercetools-api/src/Models/Extension/ExtensionUpdateActionModel.php index 0fd000ad07a..a94c676f81a 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionUpdateActionModel.php @@ -21,6 +21,7 @@ final class ExtensionUpdateActionModel extends JsonObjectModel implements Extens { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -40,11 +41,13 @@ final class ExtensionUpdateActionModel extends JsonObjectModel implements Extens * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionUpdateBuilder.php b/lib/commercetools-api/src/Models/Extension/ExtensionUpdateBuilder.php index 52a712f7b04..e6c49608edc 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionUpdateBuilder.php @@ -21,11 +21,13 @@ final class ExtensionUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?ExtensionUpdateActionCollection */ private $actions; @@ -33,6 +35,7 @@ final class ExtensionUpdateBuilder implements Builder /** *

    Expected version of the Extension on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion() @@ -43,6 +46,7 @@ public function getVersion() /** *

    Update actions to be performed on the Extension.

    * + * @return null|ExtensionUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionUpdateModel.php b/lib/commercetools-api/src/Models/Extension/ExtensionUpdateModel.php index 2b9a7b42a66..e43f45df4d4 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionUpdateModel.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionUpdateModel.php @@ -20,11 +20,13 @@ final class ExtensionUpdateModel extends JsonObjectModel implements ExtensionUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?ExtensionUpdateActionCollection */ protected $actions; @@ -44,6 +46,7 @@ public function __construct( /** *

    Expected version of the Extension on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * * @return null|int */ public function getVersion() @@ -63,6 +66,7 @@ public function getVersion() /** *

    Update actions to be performed on the Extension.

    * + * * @return null|ExtensionUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Extension/HttpDestination.php b/lib/commercetools-api/src/Models/Extension/HttpDestination.php index 64a57c8d334..bcd4c7bc234 100644 --- a/lib/commercetools-api/src/Models/Extension/HttpDestination.php +++ b/lib/commercetools-api/src/Models/Extension/HttpDestination.php @@ -19,6 +19,7 @@ interface HttpDestination extends ExtensionDestination /** *

    URL to the target destination.

    * + * @return null|string */ public function getUrl(); @@ -26,6 +27,7 @@ public function getUrl(); /** *

    Authentication methods (such as Basic or Bearer).

    * + * @return null|HttpDestinationAuthentication */ public function getAuthentication(); diff --git a/lib/commercetools-api/src/Models/Extension/HttpDestinationAuthentication.php b/lib/commercetools-api/src/Models/Extension/HttpDestinationAuthentication.php index ab103894416..680325c5d88 100644 --- a/lib/commercetools-api/src/Models/Extension/HttpDestinationAuthentication.php +++ b/lib/commercetools-api/src/Models/Extension/HttpDestinationAuthentication.php @@ -17,6 +17,7 @@ interface HttpDestinationAuthentication extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/Extension/HttpDestinationAuthenticationModel.php b/lib/commercetools-api/src/Models/Extension/HttpDestinationAuthenticationModel.php index 73bef9804b5..61473816381 100644 --- a/lib/commercetools-api/src/Models/Extension/HttpDestinationAuthenticationModel.php +++ b/lib/commercetools-api/src/Models/Extension/HttpDestinationAuthenticationModel.php @@ -21,6 +21,7 @@ final class HttpDestinationAuthenticationModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -38,11 +39,13 @@ final class HttpDestinationAuthenticationModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Extension/HttpDestinationBuilder.php b/lib/commercetools-api/src/Models/Extension/HttpDestinationBuilder.php index 6bc4c5884d1..6d1d6b22044 100644 --- a/lib/commercetools-api/src/Models/Extension/HttpDestinationBuilder.php +++ b/lib/commercetools-api/src/Models/Extension/HttpDestinationBuilder.php @@ -21,11 +21,13 @@ final class HttpDestinationBuilder implements Builder { /** + * @var ?string */ private $url; /** + * @var null|HttpDestinationAuthentication|HttpDestinationAuthenticationBuilder */ private $authentication; @@ -33,6 +35,7 @@ final class HttpDestinationBuilder implements Builder /** *

    URL to the target destination.

    * + * @return null|string */ public function getUrl() @@ -43,6 +46,7 @@ public function getUrl() /** *

    Authentication methods (such as Basic or Bearer).

    * + * @return null|HttpDestinationAuthentication */ public function getAuthentication() diff --git a/lib/commercetools-api/src/Models/Extension/HttpDestinationModel.php b/lib/commercetools-api/src/Models/Extension/HttpDestinationModel.php index 26d2b2a47a9..0720726461f 100644 --- a/lib/commercetools-api/src/Models/Extension/HttpDestinationModel.php +++ b/lib/commercetools-api/src/Models/Extension/HttpDestinationModel.php @@ -21,16 +21,19 @@ final class HttpDestinationModel extends JsonObjectModel implements HttpDestinat { public const DISCRIMINATOR_VALUE = 'HTTP'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $url; /** + * * @var ?HttpDestinationAuthentication */ protected $authentication; @@ -41,14 +44,16 @@ final class HttpDestinationModel extends JsonObjectModel implements HttpDestinat */ public function __construct( ?string $url = null, - ?HttpDestinationAuthentication $authentication = null + ?HttpDestinationAuthentication $authentication = null, + ?string $type = null ) { $this->url = $url; $this->authentication = $authentication; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,6 +73,7 @@ public function getType() /** *

    URL to the target destination.

    * + * * @return null|string */ public function getUrl() @@ -87,6 +93,7 @@ public function getUrl() /** *

    Authentication methods (such as Basic or Bearer).

    * + * * @return null|HttpDestinationAuthentication */ public function getAuthentication() diff --git a/lib/commercetools-api/src/Models/GraphQl/GraphQLError.php b/lib/commercetools-api/src/Models/GraphQl/GraphQLError.php index de96be66b65..c79548e4d5a 100644 --- a/lib/commercetools-api/src/Models/GraphQl/GraphQLError.php +++ b/lib/commercetools-api/src/Models/GraphQl/GraphQLError.php @@ -18,16 +18,19 @@ interface GraphQLError extends JsonObject public const FIELD_PATH = 'path'; /** + * @return null|string */ public function getMessage(); /** + * @return null|GraphQLErrorLocationCollection */ public function getLocations(); /** + * @return null|array */ public function getPath(); diff --git a/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorBuilder.php b/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorBuilder.php index fe58693ea5c..c4283a32a0d 100644 --- a/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorBuilder.php +++ b/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorBuilder.php @@ -21,21 +21,25 @@ final class GraphQLErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?GraphQLErrorLocationCollection */ private $locations; /** + * @var ?array */ private $path; /** + * @return null|string */ public function getMessage() @@ -44,6 +48,7 @@ public function getMessage() } /** + * @return null|GraphQLErrorLocationCollection */ public function getLocations() @@ -52,6 +57,7 @@ public function getLocations() } /** + * @return null|array */ public function getPath() diff --git a/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorLocation.php b/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorLocation.php index bf41c227042..5d302b0c470 100644 --- a/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorLocation.php +++ b/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorLocation.php @@ -17,11 +17,13 @@ interface GraphQLErrorLocation extends JsonObject public const FIELD_COLUMN = 'column'; /** + * @return null|int */ public function getLine(); /** + * @return null|int */ public function getColumn(); diff --git a/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorLocationBuilder.php b/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorLocationBuilder.php index 98f0e478da1..e5bcbace28f 100644 --- a/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorLocationBuilder.php +++ b/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorLocationBuilder.php @@ -21,16 +21,19 @@ final class GraphQLErrorLocationBuilder implements Builder { /** + * @var ?int */ private $line; /** + * @var ?int */ private $column; /** + * @return null|int */ public function getLine() @@ -39,6 +42,7 @@ public function getLine() } /** + * @return null|int */ public function getColumn() diff --git a/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorLocationModel.php b/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorLocationModel.php index 767c7f421c1..37d9c17125a 100644 --- a/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorLocationModel.php +++ b/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorLocationModel.php @@ -20,11 +20,13 @@ final class GraphQLErrorLocationModel extends JsonObjectModel implements GraphQLErrorLocation { /** + * * @var ?int */ protected $line; /** + * * @var ?int */ protected $column; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|int */ public function getLine() @@ -59,6 +62,7 @@ public function getLine() } /** + * * @return null|int */ public function getColumn() diff --git a/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorModel.php b/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorModel.php index 29ae49a5652..7b69505e525 100644 --- a/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorModel.php +++ b/lib/commercetools-api/src/Models/GraphQl/GraphQLErrorModel.php @@ -20,16 +20,19 @@ final class GraphQLErrorModel extends JsonObjectModel implements GraphQLError { /** + * * @var ?string */ protected $message; /** + * * @var ?GraphQLErrorLocationCollection */ protected $locations; /** + * * @var ?array */ protected $path; @@ -49,6 +52,7 @@ public function __construct( } /** + * * @return null|string */ public function getMessage() @@ -66,6 +70,7 @@ public function getMessage() } /** + * * @return null|GraphQLErrorLocationCollection */ public function getLocations() @@ -83,6 +88,7 @@ public function getLocations() } /** + * * @return null|array */ public function getPath() diff --git a/lib/commercetools-api/src/Models/GraphQl/GraphQLRequest.php b/lib/commercetools-api/src/Models/GraphQl/GraphQLRequest.php index ee82dcb861c..6238d5650e7 100644 --- a/lib/commercetools-api/src/Models/GraphQl/GraphQLRequest.php +++ b/lib/commercetools-api/src/Models/GraphQl/GraphQLRequest.php @@ -18,16 +18,19 @@ interface GraphQLRequest extends JsonObject public const FIELD_VARIABLES = 'variables'; /** + * @return null|string */ public function getQuery(); /** + * @return null|string */ public function getOperationName(); /** + * @return null|GraphQLVariablesMap */ public function getVariables(); diff --git a/lib/commercetools-api/src/Models/GraphQl/GraphQLRequestBuilder.php b/lib/commercetools-api/src/Models/GraphQl/GraphQLRequestBuilder.php index 6719b8af0de..99b2d96e5e0 100644 --- a/lib/commercetools-api/src/Models/GraphQl/GraphQLRequestBuilder.php +++ b/lib/commercetools-api/src/Models/GraphQl/GraphQLRequestBuilder.php @@ -21,21 +21,25 @@ final class GraphQLRequestBuilder implements Builder { /** + * @var ?string */ private $query; /** + * @var ?string */ private $operationName; /** + * @var null|GraphQLVariablesMap|GraphQLVariablesMapBuilder */ private $variables; /** + * @return null|string */ public function getQuery() @@ -44,6 +48,7 @@ public function getQuery() } /** + * @return null|string */ public function getOperationName() @@ -52,6 +57,7 @@ public function getOperationName() } /** + * @return null|GraphQLVariablesMap */ public function getVariables() diff --git a/lib/commercetools-api/src/Models/GraphQl/GraphQLRequestModel.php b/lib/commercetools-api/src/Models/GraphQl/GraphQLRequestModel.php index 67e65ccc7f1..11af37b4d96 100644 --- a/lib/commercetools-api/src/Models/GraphQl/GraphQLRequestModel.php +++ b/lib/commercetools-api/src/Models/GraphQl/GraphQLRequestModel.php @@ -20,16 +20,19 @@ final class GraphQLRequestModel extends JsonObjectModel implements GraphQLRequest { /** + * * @var ?string */ protected $query; /** + * * @var ?string */ protected $operationName; /** + * * @var ?GraphQLVariablesMap */ protected $variables; @@ -49,6 +52,7 @@ public function __construct( } /** + * * @return null|string */ public function getQuery() @@ -66,6 +70,7 @@ public function getQuery() } /** + * * @return null|string */ public function getOperationName() @@ -83,6 +88,7 @@ public function getOperationName() } /** + * * @return null|GraphQLVariablesMap */ public function getVariables() diff --git a/lib/commercetools-api/src/Models/GraphQl/GraphQLResponse.php b/lib/commercetools-api/src/Models/GraphQl/GraphQLResponse.php index 5d49ae4ccae..76fcaeb112f 100644 --- a/lib/commercetools-api/src/Models/GraphQl/GraphQLResponse.php +++ b/lib/commercetools-api/src/Models/GraphQl/GraphQLResponse.php @@ -17,11 +17,13 @@ interface GraphQLResponse extends JsonObject public const FIELD_ERRORS = 'errors'; /** + * @return null|mixed */ public function getData(); /** + * @return null|GraphQLErrorCollection */ public function getErrors(); diff --git a/lib/commercetools-api/src/Models/GraphQl/GraphQLResponseBuilder.php b/lib/commercetools-api/src/Models/GraphQl/GraphQLResponseBuilder.php index 865ad409250..735c233c5f4 100644 --- a/lib/commercetools-api/src/Models/GraphQl/GraphQLResponseBuilder.php +++ b/lib/commercetools-api/src/Models/GraphQl/GraphQLResponseBuilder.php @@ -21,16 +21,19 @@ final class GraphQLResponseBuilder implements Builder { /** + * @var null|mixed|mixed */ private $data; /** + * @var ?GraphQLErrorCollection */ private $errors; /** + * @return null|mixed */ public function getData() @@ -39,6 +42,7 @@ public function getData() } /** + * @return null|GraphQLErrorCollection */ public function getErrors() diff --git a/lib/commercetools-api/src/Models/GraphQl/GraphQLResponseModel.php b/lib/commercetools-api/src/Models/GraphQl/GraphQLResponseModel.php index 832cb3ef7dd..1765d6e2bf0 100644 --- a/lib/commercetools-api/src/Models/GraphQl/GraphQLResponseModel.php +++ b/lib/commercetools-api/src/Models/GraphQl/GraphQLResponseModel.php @@ -20,11 +20,13 @@ final class GraphQLResponseModel extends JsonObjectModel implements GraphQLResponse { /** + * * @var ?mixed */ protected $data; /** + * * @var ?GraphQLErrorCollection */ protected $errors; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|mixed */ public function getData() @@ -59,6 +62,7 @@ public function getData() } /** + * * @return null|GraphQLErrorCollection */ public function getErrors() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntry.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntry.php index d718e9bdcc5..df280e4e48a 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntry.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntry.php @@ -33,6 +33,7 @@ interface InventoryEntry extends BaseResource /** *

    Unique identifier of the InventoryEntry.

    * + * @return null|string */ public function getId(); @@ -40,6 +41,7 @@ public function getId(); /** *

    Current version of the InventoryEntry.

    * + * @return null|int */ public function getVersion(); @@ -47,6 +49,7 @@ public function getVersion(); /** *

    Date and time (UTC) the InventoryEntry was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -54,6 +57,7 @@ public function getCreatedAt(); /** *

    Date and time (UTC) the InventoryEntry was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -61,6 +65,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -68,6 +73,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -75,6 +81,7 @@ public function getCreatedBy(); /** *

    User-defined unique identifier of the InventoryEntry.

    * + * @return null|string */ public function getKey(); @@ -82,6 +89,7 @@ public function getKey(); /** *

    ProductVariant sku of the InventoryEntry.

    * + * @return null|string */ public function getSku(); @@ -89,6 +97,7 @@ public function getSku(); /** *

    Channel that supplies this InventoryEntry.

    * + * @return null|ChannelReference */ public function getSupplyChannel(); @@ -96,6 +105,7 @@ public function getSupplyChannel(); /** *

    Overall amount of stock (availableQuantity + reserved).

    * + * @return null|int */ public function getQuantityOnStock(); @@ -103,6 +113,7 @@ public function getQuantityOnStock(); /** *

    Available amount of stock (quantityOnStock - reserved).

    * + * @return null|int */ public function getAvailableQuantity(); @@ -110,6 +121,7 @@ public function getAvailableQuantity(); /** *

    How often the InventoryEntry is restocked (in days).

    * + * @return null|int */ public function getRestockableInDays(); @@ -117,6 +129,7 @@ public function getRestockableInDays(); /** *

    Date and time of the next restock.

    * + * @return null|DateTimeImmutable */ public function getExpectedDelivery(); @@ -124,6 +137,7 @@ public function getExpectedDelivery(); /** *

    Custom Fields of the InventoryEntry.

    * + * @return null|CustomFields */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryAddQuantityAction.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryAddQuantityAction.php index b7ca5cccc98..d76f81f3354 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryAddQuantityAction.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryAddQuantityAction.php @@ -18,6 +18,7 @@ interface InventoryEntryAddQuantityAction extends InventoryEntryUpdateAction /** *

    Value to add to quantityOnStock.

    * + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryAddQuantityActionBuilder.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryAddQuantityActionBuilder.php index 595af6aaa3b..4c09af57ee0 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryAddQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryAddQuantityActionBuilder.php @@ -21,6 +21,7 @@ final class InventoryEntryAddQuantityActionBuilder implements Builder { /** + * @var ?int */ private $quantity; @@ -28,6 +29,7 @@ final class InventoryEntryAddQuantityActionBuilder implements Builder /** *

    Value to add to quantityOnStock.

    * + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryAddQuantityActionModel.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryAddQuantityActionModel.php index d97d1a53e18..f560dfbaf57 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryAddQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryAddQuantityActionModel.php @@ -21,11 +21,13 @@ final class InventoryEntryAddQuantityActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'addQuantity'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $quantity; @@ -35,13 +37,15 @@ final class InventoryEntryAddQuantityActionModel extends JsonObjectModel impleme * @psalm-suppress MissingParamType */ public function __construct( - ?int $quantity = null + ?int $quantity = null, + ?string $action = null ) { $this->quantity = $quantity; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to add to quantityOnStock.

    * + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryBuilder.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryBuilder.php index ac20144ccb6..a4af2108644 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryBuilder.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryBuilder.php @@ -32,71 +32,85 @@ final class InventoryEntryBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $key; /** + * @var ?string */ private $sku; /** + * @var null|ChannelReference|ChannelReferenceBuilder */ private $supplyChannel; /** + * @var ?int */ private $quantityOnStock; /** + * @var ?int */ private $availableQuantity; /** + * @var ?int */ private $restockableInDays; /** + * @var ?DateTimeImmutable */ private $expectedDelivery; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; @@ -104,6 +118,7 @@ final class InventoryEntryBuilder implements Builder /** *

    Unique identifier of the InventoryEntry.

    * + * @return null|string */ public function getId() @@ -114,6 +129,7 @@ public function getId() /** *

    Current version of the InventoryEntry.

    * + * @return null|int */ public function getVersion() @@ -124,6 +140,7 @@ public function getVersion() /** *

    Date and time (UTC) the InventoryEntry was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -134,6 +151,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the InventoryEntry was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -144,6 +162,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -154,6 +173,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -164,6 +184,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the InventoryEntry.

    * + * @return null|string */ public function getKey() @@ -174,6 +195,7 @@ public function getKey() /** *

    ProductVariant sku of the InventoryEntry.

    * + * @return null|string */ public function getSku() @@ -184,6 +206,7 @@ public function getSku() /** *

    Channel that supplies this InventoryEntry.

    * + * @return null|ChannelReference */ public function getSupplyChannel() @@ -194,6 +217,7 @@ public function getSupplyChannel() /** *

    Overall amount of stock (availableQuantity + reserved).

    * + * @return null|int */ public function getQuantityOnStock() @@ -204,6 +228,7 @@ public function getQuantityOnStock() /** *

    Available amount of stock (quantityOnStock - reserved).

    * + * @return null|int */ public function getAvailableQuantity() @@ -214,6 +239,7 @@ public function getAvailableQuantity() /** *

    How often the InventoryEntry is restocked (in days).

    * + * @return null|int */ public function getRestockableInDays() @@ -224,6 +250,7 @@ public function getRestockableInDays() /** *

    Date and time of the next restock.

    * + * @return null|DateTimeImmutable */ public function getExpectedDelivery() @@ -234,6 +261,7 @@ public function getExpectedDelivery() /** *

    Custom Fields of the InventoryEntry.

    * + * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryChangeQuantityAction.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryChangeQuantityAction.php index bb9a07f52af..954cd71c5fa 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryChangeQuantityAction.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryChangeQuantityAction.php @@ -18,6 +18,7 @@ interface InventoryEntryChangeQuantityAction extends InventoryEntryUpdateAction /** *

    Value to set for quantityOnStock.

    * + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryChangeQuantityActionBuilder.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryChangeQuantityActionBuilder.php index 89d996d315c..2bdcc674595 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryChangeQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryChangeQuantityActionBuilder.php @@ -21,6 +21,7 @@ final class InventoryEntryChangeQuantityActionBuilder implements Builder { /** + * @var ?int */ private $quantity; @@ -28,6 +29,7 @@ final class InventoryEntryChangeQuantityActionBuilder implements Builder /** *

    Value to set for quantityOnStock.

    * + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryChangeQuantityActionModel.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryChangeQuantityActionModel.php index 28a141076e0..37019042cb5 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryChangeQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryChangeQuantityActionModel.php @@ -21,11 +21,13 @@ final class InventoryEntryChangeQuantityActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'changeQuantity'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $quantity; @@ -35,13 +37,15 @@ final class InventoryEntryChangeQuantityActionModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?int $quantity = null + ?int $quantity = null, + ?string $action = null ) { $this->quantity = $quantity; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to set for quantityOnStock.

    * + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryDraft.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryDraft.php index b7b1e0c4be5..640600cd90b 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryDraft.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryDraft.php @@ -27,6 +27,7 @@ interface InventoryEntryDraft extends JsonObject /** *

    ProductVariant sku of the InventoryEntry.

    * + * @return null|string */ public function getSku(); @@ -34,6 +35,7 @@ public function getSku(); /** *

    User-defined unique identifier for the InventoryEntry.

    * + * @return null|string */ public function getKey(); @@ -41,6 +43,7 @@ public function getKey(); /** *

    Channel that supplies this InventoryEntry.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel(); @@ -48,6 +51,7 @@ public function getSupplyChannel(); /** *

    Overall amount of stock.

    * + * @return null|int */ public function getQuantityOnStock(); @@ -55,6 +59,7 @@ public function getQuantityOnStock(); /** *

    How often the InventoryEntry is restocked (in days).

    * + * @return null|int */ public function getRestockableInDays(); @@ -62,6 +67,7 @@ public function getRestockableInDays(); /** *

    Date and time of the next restock.

    * + * @return null|DateTimeImmutable */ public function getExpectedDelivery(); @@ -69,6 +75,7 @@ public function getExpectedDelivery(); /** *

    Custom Fields of the InventoryEntry.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryDraftBuilder.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryDraftBuilder.php index a83431a1a1c..0b4bf91f6a0 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryDraftBuilder.php @@ -26,36 +26,43 @@ final class InventoryEntryDraftBuilder implements Builder { /** + * @var ?string */ private $sku; /** + * @var ?string */ private $key; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $supplyChannel; /** + * @var ?int */ private $quantityOnStock; /** + * @var ?int */ private $restockableInDays; /** + * @var ?DateTimeImmutable */ private $expectedDelivery; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; @@ -63,6 +70,7 @@ final class InventoryEntryDraftBuilder implements Builder /** *

    ProductVariant sku of the InventoryEntry.

    * + * @return null|string */ public function getSku() @@ -73,6 +81,7 @@ public function getSku() /** *

    User-defined unique identifier for the InventoryEntry.

    * + * @return null|string */ public function getKey() @@ -83,6 +92,7 @@ public function getKey() /** *

    Channel that supplies this InventoryEntry.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -93,6 +103,7 @@ public function getSupplyChannel() /** *

    Overall amount of stock.

    * + * @return null|int */ public function getQuantityOnStock() @@ -103,6 +114,7 @@ public function getQuantityOnStock() /** *

    How often the InventoryEntry is restocked (in days).

    * + * @return null|int */ public function getRestockableInDays() @@ -113,6 +125,7 @@ public function getRestockableInDays() /** *

    Date and time of the next restock.

    * + * @return null|DateTimeImmutable */ public function getExpectedDelivery() @@ -123,6 +136,7 @@ public function getExpectedDelivery() /** *

    Custom Fields of the InventoryEntry.

    * + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryDraftModel.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryDraftModel.php index 92791d89919..b6d817a3046 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryDraftModel.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryDraftModel.php @@ -25,36 +25,43 @@ final class InventoryEntryDraftModel extends JsonObjectModel implements InventoryEntryDraft { /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $key; /** + * * @var ?ChannelResourceIdentifier */ protected $supplyChannel; /** + * * @var ?int */ protected $quantityOnStock; /** + * * @var ?int */ protected $restockableInDays; /** + * * @var ?DateTimeImmutable */ protected $expectedDelivery; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -84,6 +91,7 @@ public function __construct( /** *

    ProductVariant sku of the InventoryEntry.

    * + * * @return null|string */ public function getSku() @@ -103,6 +111,7 @@ public function getSku() /** *

    User-defined unique identifier for the InventoryEntry.

    * + * * @return null|string */ public function getKey() @@ -122,6 +131,7 @@ public function getKey() /** *

    Channel that supplies this InventoryEntry.

    * + * * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -142,6 +152,7 @@ public function getSupplyChannel() /** *

    Overall amount of stock.

    * + * * @return null|int */ public function getQuantityOnStock() @@ -161,6 +172,7 @@ public function getQuantityOnStock() /** *

    How often the InventoryEntry is restocked (in days).

    * + * * @return null|int */ public function getRestockableInDays() @@ -180,6 +192,7 @@ public function getRestockableInDays() /** *

    Date and time of the next restock.

    * + * * @return null|DateTimeImmutable */ public function getExpectedDelivery() @@ -203,6 +216,7 @@ public function getExpectedDelivery() /** *

    Custom Fields of the InventoryEntry.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryModel.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryModel.php index 68a8f228363..039f787deb5 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryModel.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryModel.php @@ -31,71 +31,85 @@ final class InventoryEntryModel extends JsonObjectModel implements InventoryEntry { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $sku; /** + * * @var ?ChannelReference */ protected $supplyChannel; /** + * * @var ?int */ protected $quantityOnStock; /** + * * @var ?int */ protected $availableQuantity; /** + * * @var ?int */ protected $restockableInDays; /** + * * @var ?DateTimeImmutable */ protected $expectedDelivery; /** + * * @var ?CustomFields */ protected $custom; @@ -139,6 +153,7 @@ public function __construct( /** *

    Unique identifier of the InventoryEntry.

    * + * * @return null|string */ public function getId() @@ -158,6 +173,7 @@ public function getId() /** *

    Current version of the InventoryEntry.

    * + * * @return null|int */ public function getVersion() @@ -177,6 +193,7 @@ public function getVersion() /** *

    Date and time (UTC) the InventoryEntry was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -200,6 +217,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the InventoryEntry was last updated.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -223,6 +241,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -243,6 +262,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -263,6 +283,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the InventoryEntry.

    * + * * @return null|string */ public function getKey() @@ -282,6 +303,7 @@ public function getKey() /** *

    ProductVariant sku of the InventoryEntry.

    * + * * @return null|string */ public function getSku() @@ -301,6 +323,7 @@ public function getSku() /** *

    Channel that supplies this InventoryEntry.

    * + * * @return null|ChannelReference */ public function getSupplyChannel() @@ -321,6 +344,7 @@ public function getSupplyChannel() /** *

    Overall amount of stock (availableQuantity + reserved).

    * + * * @return null|int */ public function getQuantityOnStock() @@ -340,6 +364,7 @@ public function getQuantityOnStock() /** *

    Available amount of stock (quantityOnStock - reserved).

    * + * * @return null|int */ public function getAvailableQuantity() @@ -359,6 +384,7 @@ public function getAvailableQuantity() /** *

    How often the InventoryEntry is restocked (in days).

    * + * * @return null|int */ public function getRestockableInDays() @@ -378,6 +404,7 @@ public function getRestockableInDays() /** *

    Date and time of the next restock.

    * + * * @return null|DateTimeImmutable */ public function getExpectedDelivery() @@ -401,6 +428,7 @@ public function getExpectedDelivery() /** *

    Custom Fields of the InventoryEntry.

    * + * * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryReference.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryReference.php index 34a3e0e0d1c..4acb2281b21 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryReference.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryReference.php @@ -19,6 +19,7 @@ interface InventoryEntryReference extends Reference /** *

    Contains the representation of the expanded InventoryEntry. Only present in responses to requests with Reference Expansion for InventoryEntries.

    * + * @return null|InventoryEntry */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

    Unique identifier of the referenced InventoryEntry.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryReferenceBuilder.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryReferenceBuilder.php index 826f2cf984c..12b09d40f7d 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryReferenceBuilder.php @@ -23,11 +23,13 @@ final class InventoryEntryReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|InventoryEntry|InventoryEntryBuilder */ private $obj; @@ -35,6 +37,7 @@ final class InventoryEntryReferenceBuilder implements Builder /** *

    Unique identifier of the referenced InventoryEntry.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded InventoryEntry. Only present in responses to requests with Reference Expansion for InventoryEntries.

    * + * @return null|InventoryEntry */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryReferenceModel.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryReferenceModel.php index b38731192b0..63af3dcdd81 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryReferenceModel.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryReferenceModel.php @@ -23,16 +23,19 @@ final class InventoryEntryReferenceModel extends JsonObjectModel implements Inve { public const DISCRIMINATOR_VALUE = 'inventory-entry'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?InventoryEntry */ protected $obj; @@ -43,16 +46,18 @@ final class InventoryEntryReferenceModel extends JsonObjectModel implements Inve */ public function __construct( ?string $id = null, - ?InventoryEntry $obj = null + ?InventoryEntry $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced InventoryEntry.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded InventoryEntry. Only present in responses to requests with Reference Expansion for InventoryEntries.

    * + * * @return null|InventoryEntry */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryRemoveQuantityAction.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryRemoveQuantityAction.php index 93a89e78de5..3c1b0179504 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryRemoveQuantityAction.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryRemoveQuantityAction.php @@ -18,6 +18,7 @@ interface InventoryEntryRemoveQuantityAction extends InventoryEntryUpdateAction /** *

    Value to remove from quantityOnStock.

    * + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryRemoveQuantityActionBuilder.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryRemoveQuantityActionBuilder.php index 7469341d6b1..d182b6b752d 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryRemoveQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryRemoveQuantityActionBuilder.php @@ -21,6 +21,7 @@ final class InventoryEntryRemoveQuantityActionBuilder implements Builder { /** + * @var ?int */ private $quantity; @@ -28,6 +29,7 @@ final class InventoryEntryRemoveQuantityActionBuilder implements Builder /** *

    Value to remove from quantityOnStock.

    * + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryRemoveQuantityActionModel.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryRemoveQuantityActionModel.php index 318683c3e32..89997c3a058 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryRemoveQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryRemoveQuantityActionModel.php @@ -21,11 +21,13 @@ final class InventoryEntryRemoveQuantityActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'removeQuantity'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $quantity; @@ -35,13 +37,15 @@ final class InventoryEntryRemoveQuantityActionModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?int $quantity = null + ?int $quantity = null, + ?string $action = null ) { $this->quantity = $quantity; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to remove from quantityOnStock.

    * + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryResourceIdentifier.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryResourceIdentifier.php index c616e591b37..208e5a6c63c 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryResourceIdentifier.php @@ -17,6 +17,7 @@ interface InventoryEntryResourceIdentifier extends ResourceIdentifier /** *

    Unique identifier of the referenced InventoryEntry. Either id or key is required.

    * + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

    User-defined unique identifier of the referenced InventoryEntry. Either id or key is required.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryResourceIdentifierBuilder.php index 59d7ae21475..1f02ed579c9 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class InventoryEntryResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class InventoryEntryResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced InventoryEntry. Either id or key is required.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced InventoryEntry. Either id or key is required.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryResourceIdentifierModel.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryResourceIdentifierModel.php index da751eecb81..2ed936826f1 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class InventoryEntryResourceIdentifierModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'inventory-entry'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class InventoryEntryResourceIdentifierModel extends JsonObjectModel implem */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced InventoryEntry. Either id or key is required.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced InventoryEntry. Either id or key is required.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomFieldAction.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomFieldAction.php index 0da4e4fc0c4..6ba640e58fe 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomFieldAction.php @@ -19,6 +19,7 @@ interface InventoryEntrySetCustomFieldAction extends InventoryEntryUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomFieldActionBuilder.php index 1156a3349ae..fe43d23fb17 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class InventoryEntrySetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class InventoryEntrySetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomFieldActionModel.php index 4c619d7d54a..798a978da71 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class InventoryEntrySetCustomFieldActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class InventoryEntrySetCustomFieldActionModel extends JsonObjectModel impl */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomTypeAction.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomTypeAction.php index 4f2a5373e71..b7d0b0cff14 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomTypeAction.php @@ -22,6 +22,7 @@ interface InventoryEntrySetCustomTypeAction extends InventoryEntryUpdateAction *

    Defines the Type that extends the InventoryEntry with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the InventoryEntry.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the InventoryEntry.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomTypeActionBuilder.php index 87842cf9c3c..68e6f584b3f 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class InventoryEntrySetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class InventoryEntrySetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the InventoryEntry with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the InventoryEntry.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the InventoryEntry.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomTypeActionModel.php index 9ab07a08754..cc7263af167 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class InventoryEntrySetCustomTypeActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class InventoryEntrySetCustomTypeActionModel extends JsonObjectModel imple */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the InventoryEntry with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the InventoryEntry.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the InventoryEntry.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetExpectedDeliveryAction.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetExpectedDeliveryAction.php index 602bc1124d2..04b405f6278 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetExpectedDeliveryAction.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetExpectedDeliveryAction.php @@ -19,6 +19,7 @@ interface InventoryEntrySetExpectedDeliveryAction extends InventoryEntryUpdateAc /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|DateTimeImmutable */ public function getExpectedDelivery(); diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetExpectedDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetExpectedDeliveryActionBuilder.php index 27ddfdfd59b..ede0b3f6d37 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetExpectedDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetExpectedDeliveryActionBuilder.php @@ -22,6 +22,7 @@ final class InventoryEntrySetExpectedDeliveryActionBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $expectedDelivery; @@ -29,6 +30,7 @@ final class InventoryEntrySetExpectedDeliveryActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|DateTimeImmutable */ public function getExpectedDelivery() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetExpectedDeliveryActionModel.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetExpectedDeliveryActionModel.php index 68df3f41bcb..c4a0f9a76a2 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetExpectedDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetExpectedDeliveryActionModel.php @@ -22,11 +22,13 @@ final class InventoryEntrySetExpectedDeliveryActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setExpectedDelivery'; /** + * * @var ?string */ protected $action; /** + * * @var ?DateTimeImmutable */ protected $expectedDelivery; @@ -36,13 +38,15 @@ final class InventoryEntrySetExpectedDeliveryActionModel extends JsonObjectModel * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutable $expectedDelivery = null + ?DateTimeImmutable $expectedDelivery = null, + ?string $action = null ) { $this->expectedDelivery = $expectedDelivery; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|DateTimeImmutable */ public function getExpectedDelivery() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetKeyAction.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetKeyAction.php index ab6e8eb1410..c7750055a84 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetKeyAction.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetKeyAction.php @@ -18,6 +18,7 @@ interface InventoryEntrySetKeyAction extends InventoryEntryUpdateAction /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetKeyActionBuilder.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetKeyActionBuilder.php index 6524c0d744c..61f4d33a7c2 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetKeyActionBuilder.php @@ -21,6 +21,7 @@ final class InventoryEntrySetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; @@ -28,6 +29,7 @@ final class InventoryEntrySetKeyActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetKeyActionModel.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetKeyActionModel.php index f97fb3f6cc9..17c142c2680 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetKeyActionModel.php @@ -21,11 +21,13 @@ final class InventoryEntrySetKeyActionModel extends JsonObjectModel implements I { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class InventoryEntrySetKeyActionModel extends JsonObjectModel implements I * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetRestockableInDaysAction.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetRestockableInDaysAction.php index b3ba16d3908..dd647ed96c9 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetRestockableInDaysAction.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetRestockableInDaysAction.php @@ -18,6 +18,7 @@ interface InventoryEntrySetRestockableInDaysAction extends InventoryEntryUpdateA /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|int */ public function getRestockableInDays(); diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetRestockableInDaysActionBuilder.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetRestockableInDaysActionBuilder.php index e246af6d682..37b9e37fcd8 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetRestockableInDaysActionBuilder.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetRestockableInDaysActionBuilder.php @@ -21,6 +21,7 @@ final class InventoryEntrySetRestockableInDaysActionBuilder implements Builder { /** + * @var ?int */ private $restockableInDays; @@ -28,6 +29,7 @@ final class InventoryEntrySetRestockableInDaysActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|int */ public function getRestockableInDays() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetRestockableInDaysActionModel.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetRestockableInDaysActionModel.php index c8fe86159df..5c0f07dbcbf 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetRestockableInDaysActionModel.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetRestockableInDaysActionModel.php @@ -21,11 +21,13 @@ final class InventoryEntrySetRestockableInDaysActionModel extends JsonObjectMode { public const DISCRIMINATOR_VALUE = 'setRestockableInDays'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $restockableInDays; @@ -35,13 +37,15 @@ final class InventoryEntrySetRestockableInDaysActionModel extends JsonObjectMode * @psalm-suppress MissingParamType */ public function __construct( - ?int $restockableInDays = null + ?int $restockableInDays = null, + ?string $action = null ) { $this->restockableInDays = $restockableInDays; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|int */ public function getRestockableInDays() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetSupplyChannelAction.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetSupplyChannelAction.php index 145cb73ebb0..9e45b062c76 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetSupplyChannelAction.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetSupplyChannelAction.php @@ -19,6 +19,7 @@ interface InventoryEntrySetSupplyChannelAction extends InventoryEntryUpdateActio /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel(); diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetSupplyChannelActionBuilder.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetSupplyChannelActionBuilder.php index 840a06f638e..13761176e5b 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetSupplyChannelActionBuilder.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetSupplyChannelActionBuilder.php @@ -23,6 +23,7 @@ final class InventoryEntrySetSupplyChannelActionBuilder implements Builder { /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $supplyChannel; @@ -30,6 +31,7 @@ final class InventoryEntrySetSupplyChannelActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetSupplyChannelActionModel.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetSupplyChannelActionModel.php index 2012b332361..2d1af32e46b 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetSupplyChannelActionModel.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntrySetSupplyChannelActionModel.php @@ -23,11 +23,13 @@ final class InventoryEntrySetSupplyChannelActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'setSupplyChannel'; /** + * * @var ?string */ protected $action; /** + * * @var ?ChannelResourceIdentifier */ protected $supplyChannel; @@ -37,13 +39,15 @@ final class InventoryEntrySetSupplyChannelActionModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?ChannelResourceIdentifier $supplyChannel = null + ?ChannelResourceIdentifier $supplyChannel = null, + ?string $action = null ) { $this->supplyChannel = $supplyChannel; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdate.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdate.php index 8a5486be256..aa6f082021a 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdate.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdate.php @@ -19,6 +19,7 @@ interface InventoryEntryUpdate extends JsonObject /** *

    Expected version of the InventoryEntry on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

    * + * @return null|int */ public function getVersion(); @@ -26,6 +27,7 @@ public function getVersion(); /** *

    Update actions to be performed on the InventoryEntry.

    * + * @return null|InventoryEntryUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdateAction.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdateAction.php index c248ec411d1..801a76b7de5 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdateAction.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdateAction.php @@ -17,6 +17,7 @@ interface InventoryEntryUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdateActionModel.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdateActionModel.php index 1ca9faee6c5..582d0f862c2 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdateActionModel.php @@ -21,6 +21,7 @@ final class InventoryEntryUpdateActionModel extends JsonObjectModel implements I { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -45,11 +46,13 @@ final class InventoryEntryUpdateActionModel extends JsonObjectModel implements I * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdateBuilder.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdateBuilder.php index f1fb6e43742..8019bf65d19 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdateBuilder.php @@ -21,11 +21,13 @@ final class InventoryEntryUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?InventoryEntryUpdateActionCollection */ private $actions; @@ -33,6 +35,7 @@ final class InventoryEntryUpdateBuilder implements Builder /** *

    Expected version of the InventoryEntry on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

    * + * @return null|int */ public function getVersion() @@ -43,6 +46,7 @@ public function getVersion() /** *

    Update actions to be performed on the InventoryEntry.

    * + * @return null|InventoryEntryUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdateModel.php b/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdateModel.php index 943786ba9c5..9b607fedeee 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdateModel.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryEntryUpdateModel.php @@ -20,11 +20,13 @@ final class InventoryEntryUpdateModel extends JsonObjectModel implements InventoryEntryUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?InventoryEntryUpdateActionCollection */ protected $actions; @@ -44,6 +46,7 @@ public function __construct( /** *

    Expected version of the InventoryEntry on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

    * + * * @return null|int */ public function getVersion() @@ -63,6 +66,7 @@ public function getVersion() /** *

    Update actions to be performed on the InventoryEntry.

    * + * * @return null|InventoryEntryUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryPagedQueryResponse.php b/lib/commercetools-api/src/Models/Inventory/InventoryPagedQueryResponse.php index 76f102d7249..59d54bccc66 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryPagedQueryResponse.php @@ -22,6 +22,7 @@ interface InventoryPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    Inventory entries matching the query.

    * + * @return null|InventoryEntryCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Inventory/InventoryPagedQueryResponseBuilder.php index baa38272faf..2c7e2cd8b44 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class InventoryPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?InventoryEntryCollection */ private $results; @@ -48,6 +53,7 @@ final class InventoryPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    Inventory entries matching the query.

    * + * @return null|InventoryEntryCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Inventory/InventoryPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Inventory/InventoryPagedQueryResponseModel.php index c65397395c3..c9c117d830b 100644 --- a/lib/commercetools-api/src/Models/Inventory/InventoryPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Inventory/InventoryPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class InventoryPagedQueryResponseModel extends JsonObjectModel implements InventoryPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?InventoryEntryCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    Inventory entries matching the query.

    * + * * @return null|InventoryEntryCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddAddressAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddAddressAction.php new file mode 100644 index 00000000000..c76cf4946aa --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddAddressAction.php @@ -0,0 +1,31 @@ +The address to add to addresses.

    + * + + * @return null|BaseAddress + */ + public function getAddress(); + + /** + * @param ?BaseAddress $address + */ + public function setAddress(?BaseAddress $address): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddAddressActionBuilder.php new file mode 100644 index 00000000000..ab642a103bf --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddAddressActionBuilder.php @@ -0,0 +1,75 @@ + + */ +final class MyBusinessUnitAddAddressActionBuilder implements Builder +{ + /** + + * @var null|BaseAddress|BaseAddressBuilder + */ + private $address; + + /** + *

    The address to add to addresses.

    + * + + * @return null|BaseAddress + */ + public function getAddress() + { + return $this->address instanceof BaseAddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?BaseAddress $address + * @return $this + */ + public function withAddress(?BaseAddress $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?BaseAddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): MyBusinessUnitAddAddressAction + { + return new MyBusinessUnitAddAddressActionModel( + $this->address instanceof BaseAddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): MyBusinessUnitAddAddressActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddAddressActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddAddressActionCollection.php new file mode 100644 index 00000000000..1ce3ffdf412 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddAddressActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitAddAddressAction current() + * @method MyBusinessUnitAddAddressAction end() + * @method MyBusinessUnitAddAddressAction at($offset) + */ +class MyBusinessUnitAddAddressActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitAddAddressAction $value + * @psalm-param MyBusinessUnitAddAddressAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitAddAddressActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitAddAddressAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitAddAddressAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitAddAddressAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitAddAddressAction $data */ + $data = MyBusinessUnitAddAddressActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddAddressActionModel.php new file mode 100644 index 00000000000..330e2017302 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddAddressActionModel.php @@ -0,0 +1,96 @@ +address = $address; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    The address to add to addresses.

    + * + * + * @return null|BaseAddress + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = BaseAddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?BaseAddress $address + */ + public function setAddress(?BaseAddress $address): void + { + $this->address = $address; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddBillingAddressIdAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddBillingAddressIdAction.php new file mode 100644 index 00000000000..68d25f49950 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddBillingAddressIdAction.php @@ -0,0 +1,44 @@ +ID of the address to add as a billing address. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressId(); + + /** + *

    Key of the address to add as a billing address. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressKey(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddBillingAddressIdActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddBillingAddressIdActionBuilder.php new file mode 100644 index 00000000000..4e864641180 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddBillingAddressIdActionBuilder.php @@ -0,0 +1,92 @@ + + */ +final class MyBusinessUnitAddBillingAddressIdActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $addressKey; + + /** + *

    ID of the address to add as a billing address. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

    Key of the address to add as a billing address. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressKey() + { + return $this->addressKey; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $addressKey + * @return $this + */ + public function withAddressKey(?string $addressKey) + { + $this->addressKey = $addressKey; + + return $this; + } + + + public function build(): MyBusinessUnitAddBillingAddressIdAction + { + return new MyBusinessUnitAddBillingAddressIdActionModel( + $this->addressId, + $this->addressKey + ); + } + + public static function of(): MyBusinessUnitAddBillingAddressIdActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddBillingAddressIdActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddBillingAddressIdActionCollection.php new file mode 100644 index 00000000000..83f281ed129 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddBillingAddressIdActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitAddBillingAddressIdAction current() + * @method MyBusinessUnitAddBillingAddressIdAction end() + * @method MyBusinessUnitAddBillingAddressIdAction at($offset) + */ +class MyBusinessUnitAddBillingAddressIdActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitAddBillingAddressIdAction $value + * @psalm-param MyBusinessUnitAddBillingAddressIdAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitAddBillingAddressIdActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitAddBillingAddressIdAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitAddBillingAddressIdAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitAddBillingAddressIdAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitAddBillingAddressIdAction $data */ + $data = MyBusinessUnitAddBillingAddressIdActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddBillingAddressIdActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddBillingAddressIdActionModel.php new file mode 100644 index 00000000000..4e00f8e4e89 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddBillingAddressIdActionModel.php @@ -0,0 +1,129 @@ +addressId = $addressId; + $this->addressKey = $addressKey; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    ID of the address to add as a billing address. Either addressId or addressKey is required.

    + * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

    Key of the address to add as a billing address. Either addressId or addressKey is required.

    + * + * + * @return null|string + */ + public function getAddressKey() + { + if (is_null($this->addressKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_KEY); + if (is_null($data)) { + return null; + } + $this->addressKey = (string) $data; + } + + return $this->addressKey; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void + { + $this->addressKey = $addressKey; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddShippingAddressIdAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddShippingAddressIdAction.php new file mode 100644 index 00000000000..99a90b60d5e --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddShippingAddressIdAction.php @@ -0,0 +1,44 @@ +ID of the address to add as a shipping address. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressId(); + + /** + *

    Key of the address to add as a shipping address. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressKey(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddShippingAddressIdActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddShippingAddressIdActionBuilder.php new file mode 100644 index 00000000000..295441bf8e7 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddShippingAddressIdActionBuilder.php @@ -0,0 +1,92 @@ + + */ +final class MyBusinessUnitAddShippingAddressIdActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $addressKey; + + /** + *

    ID of the address to add as a shipping address. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

    Key of the address to add as a shipping address. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressKey() + { + return $this->addressKey; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $addressKey + * @return $this + */ + public function withAddressKey(?string $addressKey) + { + $this->addressKey = $addressKey; + + return $this; + } + + + public function build(): MyBusinessUnitAddShippingAddressIdAction + { + return new MyBusinessUnitAddShippingAddressIdActionModel( + $this->addressId, + $this->addressKey + ); + } + + public static function of(): MyBusinessUnitAddShippingAddressIdActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddShippingAddressIdActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddShippingAddressIdActionCollection.php new file mode 100644 index 00000000000..f58ef50bb82 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddShippingAddressIdActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitAddShippingAddressIdAction current() + * @method MyBusinessUnitAddShippingAddressIdAction end() + * @method MyBusinessUnitAddShippingAddressIdAction at($offset) + */ +class MyBusinessUnitAddShippingAddressIdActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitAddShippingAddressIdAction $value + * @psalm-param MyBusinessUnitAddShippingAddressIdAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitAddShippingAddressIdActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitAddShippingAddressIdAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitAddShippingAddressIdAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitAddShippingAddressIdAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitAddShippingAddressIdAction $data */ + $data = MyBusinessUnitAddShippingAddressIdActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddShippingAddressIdActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddShippingAddressIdActionModel.php new file mode 100644 index 00000000000..f9433c21ea5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAddShippingAddressIdActionModel.php @@ -0,0 +1,129 @@ +addressId = $addressId; + $this->addressKey = $addressKey; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    ID of the address to add as a shipping address. Either addressId or addressKey is required.

    + * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

    Key of the address to add as a shipping address. Either addressId or addressKey is required.

    + * + * + * @return null|string + */ + public function getAddressKey() + { + if (is_null($this->addressKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_KEY); + if (is_null($data)) { + return null; + } + $this->addressKey = (string) $data; + } + + return $this->addressKey; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void + { + $this->addressKey = $addressKey; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraft.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraft.php new file mode 100644 index 00000000000..eb22adbabd1 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraft.php @@ -0,0 +1,44 @@ +Expected version of the BusinessUnit on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + + * @return null|int + */ + public function getVersion(); + + /** + *

    Customer to create and assign to the Business Unit.

    + * + + * @return null|MyCustomerDraft + */ + public function getCustomer(); + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void; + + /** + * @param ?MyCustomerDraft $customer + */ + public function setCustomer(?MyCustomerDraft $customer): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraftBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraftBuilder.php new file mode 100644 index 00000000000..d9aa99f46ef --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraftBuilder.php @@ -0,0 +1,102 @@ + + */ +final class MyBusinessUnitAssociateDraftBuilder implements Builder +{ + /** + + * @var ?int + */ + private $version; + + /** + + * @var null|MyCustomerDraft|MyCustomerDraftBuilder + */ + private $customer; + + /** + *

    Expected version of the BusinessUnit on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Customer to create and assign to the Business Unit.

    + * + + * @return null|MyCustomerDraft + */ + public function getCustomer() + { + return $this->customer instanceof MyCustomerDraftBuilder ? $this->customer->build() : $this->customer; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?MyCustomerDraft $customer + * @return $this + */ + public function withCustomer(?MyCustomerDraft $customer) + { + $this->customer = $customer; + + return $this; + } + + /** + * @deprecated use withCustomer() instead + * @return $this + */ + public function withCustomerBuilder(?MyCustomerDraftBuilder $customer) + { + $this->customer = $customer; + + return $this; + } + + public function build(): MyBusinessUnitAssociateDraft + { + return new MyBusinessUnitAssociateDraftModel( + $this->version, + $this->customer instanceof MyCustomerDraftBuilder ? $this->customer->build() : $this->customer + ); + } + + public static function of(): MyBusinessUnitAssociateDraftBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraftCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraftCollection.php new file mode 100644 index 00000000000..ad3f98adc81 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraftCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitAssociateDraft current() + * @method MyBusinessUnitAssociateDraft end() + * @method MyBusinessUnitAssociateDraft at($offset) + */ +class MyBusinessUnitAssociateDraftCollection extends MapperSequence +{ + /** + * @psalm-assert MyBusinessUnitAssociateDraft $value + * @psalm-param MyBusinessUnitAssociateDraft|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitAssociateDraftCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitAssociateDraft) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitAssociateDraft + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitAssociateDraft { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitAssociateDraft $data */ + $data = MyBusinessUnitAssociateDraftModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraftModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraftModel.php new file mode 100644 index 00000000000..2f515cb5962 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraftModel.php @@ -0,0 +1,103 @@ +version = $version; + $this->customer = $customer; + } + + /** + *

    Expected version of the BusinessUnit on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Customer to create and assign to the Business Unit.

    + * + * + * @return null|MyCustomerDraft + */ + public function getCustomer() + { + if (is_null($this->customer)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER); + if (is_null($data)) { + return null; + } + + $this->customer = MyCustomerDraftModel::of($data); + } + + return $this->customer; + } + + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?MyCustomerDraft $customer + */ + public function setCustomer(?MyCustomerDraft $customer): void + { + $this->customer = $customer; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAddressAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAddressAction.php new file mode 100644 index 00000000000..516d364f688 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAddressAction.php @@ -0,0 +1,59 @@ +ID of the address to change. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressId(); + + /** + *

    Key of the address to change. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressKey(); + + /** + *

    New address to set.

    + * + + * @return null|BaseAddress + */ + public function getAddress(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void; + + /** + * @param ?BaseAddress $address + */ + public function setAddress(?BaseAddress $address): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAddressActionBuilder.php new file mode 100644 index 00000000000..84aa3b40b12 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAddressActionBuilder.php @@ -0,0 +1,133 @@ + + */ +final class MyBusinessUnitChangeAddressActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $addressKey; + + /** + + * @var null|BaseAddress|BaseAddressBuilder + */ + private $address; + + /** + *

    ID of the address to change. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

    Key of the address to change. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressKey() + { + return $this->addressKey; + } + + /** + *

    New address to set.

    + * + + * @return null|BaseAddress + */ + public function getAddress() + { + return $this->address instanceof BaseAddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $addressKey + * @return $this + */ + public function withAddressKey(?string $addressKey) + { + $this->addressKey = $addressKey; + + return $this; + } + + /** + * @param ?BaseAddress $address + * @return $this + */ + public function withAddress(?BaseAddress $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?BaseAddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): MyBusinessUnitChangeAddressAction + { + return new MyBusinessUnitChangeAddressActionModel( + $this->addressId, + $this->addressKey, + $this->address instanceof BaseAddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): MyBusinessUnitChangeAddressActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAddressActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAddressActionCollection.php new file mode 100644 index 00000000000..11e9e720a08 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAddressActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitChangeAddressAction current() + * @method MyBusinessUnitChangeAddressAction end() + * @method MyBusinessUnitChangeAddressAction at($offset) + */ +class MyBusinessUnitChangeAddressActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitChangeAddressAction $value + * @psalm-param MyBusinessUnitChangeAddressAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitChangeAddressActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitChangeAddressAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitChangeAddressAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitChangeAddressAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitChangeAddressAction $data */ + $data = MyBusinessUnitChangeAddressActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAddressActionModel.php new file mode 100644 index 00000000000..77010f6cc76 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAddressActionModel.php @@ -0,0 +1,168 @@ +addressId = $addressId; + $this->addressKey = $addressKey; + $this->address = $address; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    ID of the address to change. Either addressId or addressKey is required.

    + * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

    Key of the address to change. Either addressId or addressKey is required.

    + * + * + * @return null|string + */ + public function getAddressKey() + { + if (is_null($this->addressKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_KEY); + if (is_null($data)) { + return null; + } + $this->addressKey = (string) $data; + } + + return $this->addressKey; + } + + /** + *

    New address to set.

    + * + * + * @return null|BaseAddress + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = BaseAddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void + { + $this->addressKey = $addressKey; + } + + /** + * @param ?BaseAddress $address + */ + public function setAddress(?BaseAddress $address): void + { + $this->address = $address; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAssociateAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAssociateAction.php new file mode 100644 index 00000000000..5dbda642780 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAssociateAction.php @@ -0,0 +1,31 @@ +The Associate to add.

    + * + + * @return null|AssociateDraft + */ + public function getAssociate(); + + /** + * @param ?AssociateDraft $associate + */ + public function setAssociate(?AssociateDraft $associate): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAssociateActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAssociateActionBuilder.php new file mode 100644 index 00000000000..1db1d98985c --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAssociateActionBuilder.php @@ -0,0 +1,75 @@ + + */ +final class MyBusinessUnitChangeAssociateActionBuilder implements Builder +{ + /** + + * @var null|AssociateDraft|AssociateDraftBuilder + */ + private $associate; + + /** + *

    The Associate to add.

    + * + + * @return null|AssociateDraft + */ + public function getAssociate() + { + return $this->associate instanceof AssociateDraftBuilder ? $this->associate->build() : $this->associate; + } + + /** + * @param ?AssociateDraft $associate + * @return $this + */ + public function withAssociate(?AssociateDraft $associate) + { + $this->associate = $associate; + + return $this; + } + + /** + * @deprecated use withAssociate() instead + * @return $this + */ + public function withAssociateBuilder(?AssociateDraftBuilder $associate) + { + $this->associate = $associate; + + return $this; + } + + public function build(): MyBusinessUnitChangeAssociateAction + { + return new MyBusinessUnitChangeAssociateActionModel( + $this->associate instanceof AssociateDraftBuilder ? $this->associate->build() : $this->associate + ); + } + + public static function of(): MyBusinessUnitChangeAssociateActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAssociateActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAssociateActionCollection.php new file mode 100644 index 00000000000..c47e866b4d1 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAssociateActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitChangeAssociateAction current() + * @method MyBusinessUnitChangeAssociateAction end() + * @method MyBusinessUnitChangeAssociateAction at($offset) + */ +class MyBusinessUnitChangeAssociateActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitChangeAssociateAction $value + * @psalm-param MyBusinessUnitChangeAssociateAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitChangeAssociateActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitChangeAssociateAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitChangeAssociateAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitChangeAssociateAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitChangeAssociateAction $data */ + $data = MyBusinessUnitChangeAssociateActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAssociateActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAssociateActionModel.php new file mode 100644 index 00000000000..04f16835dad --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeAssociateActionModel.php @@ -0,0 +1,96 @@ +associate = $associate; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    The Associate to add.

    + * + * + * @return null|AssociateDraft + */ + public function getAssociate() + { + if (is_null($this->associate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ASSOCIATE); + if (is_null($data)) { + return null; + } + + $this->associate = AssociateDraftModel::of($data); + } + + return $this->associate; + } + + + /** + * @param ?AssociateDraft $associate + */ + public function setAssociate(?AssociateDraft $associate): void + { + $this->associate = $associate; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeNameAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeNameAction.php new file mode 100644 index 00000000000..ea8ce70441f --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeNameAction.php @@ -0,0 +1,30 @@ +New name to set.

    + * + + * @return null|string + */ + public function getName(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeNameActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeNameActionBuilder.php new file mode 100644 index 00000000000..a8100717bd3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeNameActionBuilder.php @@ -0,0 +1,63 @@ + + */ +final class MyBusinessUnitChangeNameActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $name; + + /** + *

    New name to set.

    + * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + + public function build(): MyBusinessUnitChangeNameAction + { + return new MyBusinessUnitChangeNameActionModel( + $this->name + ); + } + + public static function of(): MyBusinessUnitChangeNameActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeNameActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeNameActionCollection.php new file mode 100644 index 00000000000..6c72977166f --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeNameActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitChangeNameAction current() + * @method MyBusinessUnitChangeNameAction end() + * @method MyBusinessUnitChangeNameAction at($offset) + */ +class MyBusinessUnitChangeNameActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitChangeNameAction $value + * @psalm-param MyBusinessUnitChangeNameAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitChangeNameActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitChangeNameAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitChangeNameAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitChangeNameAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitChangeNameAction $data */ + $data = MyBusinessUnitChangeNameActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeNameActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeNameActionModel.php new file mode 100644 index 00000000000..c9e38367cb8 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeNameActionModel.php @@ -0,0 +1,93 @@ +name = $name; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    New name to set.

    + * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeParentUnitAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeParentUnitAction.php new file mode 100644 index 00000000000..6ad978b9795 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeParentUnitAction.php @@ -0,0 +1,31 @@ +New parent unit of the Business Unit.

    + * + + * @return null|BusinessUnitResourceIdentifier + */ + public function getParentUnit(); + + /** + * @param ?BusinessUnitResourceIdentifier $parentUnit + */ + public function setParentUnit(?BusinessUnitResourceIdentifier $parentUnit): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeParentUnitActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeParentUnitActionBuilder.php new file mode 100644 index 00000000000..21ddb8e6ac1 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeParentUnitActionBuilder.php @@ -0,0 +1,75 @@ + + */ +final class MyBusinessUnitChangeParentUnitActionBuilder implements Builder +{ + /** + + * @var null|BusinessUnitResourceIdentifier|BusinessUnitResourceIdentifierBuilder + */ + private $parentUnit; + + /** + *

    New parent unit of the Business Unit.

    + * + + * @return null|BusinessUnitResourceIdentifier + */ + public function getParentUnit() + { + return $this->parentUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->parentUnit->build() : $this->parentUnit; + } + + /** + * @param ?BusinessUnitResourceIdentifier $parentUnit + * @return $this + */ + public function withParentUnit(?BusinessUnitResourceIdentifier $parentUnit) + { + $this->parentUnit = $parentUnit; + + return $this; + } + + /** + * @deprecated use withParentUnit() instead + * @return $this + */ + public function withParentUnitBuilder(?BusinessUnitResourceIdentifierBuilder $parentUnit) + { + $this->parentUnit = $parentUnit; + + return $this; + } + + public function build(): MyBusinessUnitChangeParentUnitAction + { + return new MyBusinessUnitChangeParentUnitActionModel( + $this->parentUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->parentUnit->build() : $this->parentUnit + ); + } + + public static function of(): MyBusinessUnitChangeParentUnitActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeParentUnitActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeParentUnitActionCollection.php new file mode 100644 index 00000000000..596b3bb0c43 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeParentUnitActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitChangeParentUnitAction current() + * @method MyBusinessUnitChangeParentUnitAction end() + * @method MyBusinessUnitChangeParentUnitAction at($offset) + */ +class MyBusinessUnitChangeParentUnitActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitChangeParentUnitAction $value + * @psalm-param MyBusinessUnitChangeParentUnitAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitChangeParentUnitActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitChangeParentUnitAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitChangeParentUnitAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitChangeParentUnitAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitChangeParentUnitAction $data */ + $data = MyBusinessUnitChangeParentUnitActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeParentUnitActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeParentUnitActionModel.php new file mode 100644 index 00000000000..a537b9d7cc0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitChangeParentUnitActionModel.php @@ -0,0 +1,96 @@ +parentUnit = $parentUnit; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    New parent unit of the Business Unit.

    + * + * + * @return null|BusinessUnitResourceIdentifier + */ + public function getParentUnit() + { + if (is_null($this->parentUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_PARENT_UNIT); + if (is_null($data)) { + return null; + } + + $this->parentUnit = BusinessUnitResourceIdentifierModel::of($data); + } + + return $this->parentUnit; + } + + + /** + * @param ?BusinessUnitResourceIdentifier $parentUnit + */ + public function setParentUnit(?BusinessUnitResourceIdentifier $parentUnit): void + { + $this->parentUnit = $parentUnit; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitDraft.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitDraft.php new file mode 100644 index 00000000000..9df12038715 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitDraft.php @@ -0,0 +1,156 @@ +User-defined unique identifier for the BusinessUnit.

    + * + + * @return null|string + */ + public function getKey(); + + /** + *

    Type of the Business Unit indicating its position in a hierarchy.

    + * + + * @return null|string + */ + public function getUnitType(); + + /** + *

    Name of the Business Unit.

    + * + + * @return null|string + */ + public function getName(); + + /** + *

    Email address of the Business Unit.

    + * + + * @return null|string + */ + public function getContactEmail(); + + /** + *

    Custom Fields for the Business Unit.

    + * + + * @return null|CustomFields + */ + public function getCustom(); + + /** + *

    Addresses used by the Business Unit.

    + * + + * @return null|BaseAddressCollection + */ + public function getAddresses(); + + /** + *

    Indexes of entries in addresses to set as shipping addresses. + * The shippingAddressIds of the Customer will be replaced by these addresses.

    + * + + * @return null|array + */ + public function getShippingAddresses(); + + /** + *

    Index of the entry in addresses to set as the default shipping address.

    + * + + * @return null|int + */ + public function getDefaultShipingAddress(); + + /** + *

    Indexes of entries in addresses to set as billing addresses. + * The billingAddressIds of the Customer will be replaced by these addresses.

    + * + + * @return null|array + */ + public function getBillingAddresses(); + + /** + *

    Index of the entry in addresses to set as the default billing address.

    + * + + * @return null|int + */ + public function getDefaultBillingAddress(); + + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void; + + /** + * @param ?CustomFields $custom + */ + public function setCustom(?CustomFields $custom): void; + + /** + * @param ?BaseAddressCollection $addresses + */ + public function setAddresses(?BaseAddressCollection $addresses): void; + + /** + * @param ?array $shippingAddresses + */ + public function setShippingAddresses(?array $shippingAddresses): void; + + /** + * @param ?int $defaultShipingAddress + */ + public function setDefaultShipingAddress(?int $defaultShipingAddress): void; + + /** + * @param ?array $billingAddresses + */ + public function setBillingAddresses(?array $billingAddresses): void; + + /** + * @param ?int $defaultBillingAddress + */ + public function setDefaultBillingAddress(?int $defaultBillingAddress): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitDraftBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitDraftBuilder.php new file mode 100644 index 00000000000..2ae80a744bf --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitDraftBuilder.php @@ -0,0 +1,310 @@ + + */ +final class MyBusinessUnitDraftBuilder implements Builder +{ + /** + + * @var ?string + */ + private $key; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var ?string + */ + private $contactEmail; + + /** + + * @var null|CustomFields|CustomFieldsBuilder + */ + private $custom; + + /** + + * @var ?BaseAddressCollection + */ + private $addresses; + + /** + + * @var ?array + */ + private $shippingAddresses; + + /** + + * @var ?int + */ + private $defaultShipingAddress; + + /** + + * @var ?array + */ + private $billingAddresses; + + /** + + * @var ?int + */ + private $defaultBillingAddress; + + /** + *

    User-defined unique identifier for the BusinessUnit.

    + * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + *

    Name of the Business Unit.

    + * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

    Email address of the Business Unit.

    + * + + * @return null|string + */ + public function getContactEmail() + { + return $this->contactEmail; + } + + /** + *

    Custom Fields for the Business Unit.

    + * + + * @return null|CustomFields + */ + public function getCustom() + { + return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; + } + + /** + *

    Addresses used by the Business Unit.

    + * + + * @return null|BaseAddressCollection + */ + public function getAddresses() + { + return $this->addresses; + } + + /** + *

    Indexes of entries in addresses to set as shipping addresses. + * The shippingAddressIds of the Customer will be replaced by these addresses.

    + * + + * @return null|array + */ + public function getShippingAddresses() + { + return $this->shippingAddresses; + } + + /** + *

    Index of the entry in addresses to set as the default shipping address.

    + * + + * @return null|int + */ + public function getDefaultShipingAddress() + { + return $this->defaultShipingAddress; + } + + /** + *

    Indexes of entries in addresses to set as billing addresses. + * The billingAddressIds of the Customer will be replaced by these addresses.

    + * + + * @return null|array + */ + public function getBillingAddresses() + { + return $this->billingAddresses; + } + + /** + *

    Index of the entry in addresses to set as the default billing address.

    + * + + * @return null|int + */ + public function getDefaultBillingAddress() + { + return $this->defaultBillingAddress; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param ?string $contactEmail + * @return $this + */ + public function withContactEmail(?string $contactEmail) + { + $this->contactEmail = $contactEmail; + + return $this; + } + + /** + * @param ?CustomFields $custom + * @return $this + */ + public function withCustom(?CustomFields $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @param ?BaseAddressCollection $addresses + * @return $this + */ + public function withAddresses(?BaseAddressCollection $addresses) + { + $this->addresses = $addresses; + + return $this; + } + + /** + * @param ?array $shippingAddresses + * @return $this + */ + public function withShippingAddresses(?array $shippingAddresses) + { + $this->shippingAddresses = $shippingAddresses; + + return $this; + } + + /** + * @param ?int $defaultShipingAddress + * @return $this + */ + public function withDefaultShipingAddress(?int $defaultShipingAddress) + { + $this->defaultShipingAddress = $defaultShipingAddress; + + return $this; + } + + /** + * @param ?array $billingAddresses + * @return $this + */ + public function withBillingAddresses(?array $billingAddresses) + { + $this->billingAddresses = $billingAddresses; + + return $this; + } + + /** + * @param ?int $defaultBillingAddress + * @return $this + */ + public function withDefaultBillingAddress(?int $defaultBillingAddress) + { + $this->defaultBillingAddress = $defaultBillingAddress; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + + public function build(): MyBusinessUnitDraft + { + return new MyBusinessUnitDraftModel( + $this->key, + $this->name, + $this->contactEmail, + $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, + $this->addresses, + $this->shippingAddresses, + $this->defaultShipingAddress, + $this->billingAddresses, + $this->defaultBillingAddress + ); + } + + public static function of(): MyBusinessUnitDraftBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitDraftCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitDraftCollection.php new file mode 100644 index 00000000000..b5c2f83a0e9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitDraftCollection.php @@ -0,0 +1,60 @@ + + * @psalm-method T current() + * @psalm-method T end() + * @psalm-method T at($offset) + * @method MyBusinessUnitDraft current() + * @method MyBusinessUnitDraft end() + * @method MyBusinessUnitDraft at($offset) + */ +class MyBusinessUnitDraftCollection extends MapperSequence +{ + /** + * @psalm-assert T $value + * @psalm-param T|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitDraftCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitDraft) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?T + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitDraft { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var T $data */ + $data = MyBusinessUnitDraftModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitDraftModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitDraftModel.php new file mode 100644 index 00000000000..6f9cb9dd89f --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitDraftModel.php @@ -0,0 +1,426 @@ + > + * + */ + private static $discriminatorClasses = [ + 'Company' => MyCompanyDraftModel::class, + 'Division' => MyDivisionDraftModel::class, + ]; + + /** + * @psalm-suppress MissingParamType + */ + public function __construct( + ?string $key = null, + ?string $name = null, + ?string $contactEmail = null, + ?CustomFields $custom = null, + ?BaseAddressCollection $addresses = null, + ?array $shippingAddresses = null, + ?int $defaultShipingAddress = null, + ?array $billingAddresses = null, + ?int $defaultBillingAddress = null, + ?string $unitType = null + ) { + $this->key = $key; + $this->name = $name; + $this->contactEmail = $contactEmail; + $this->custom = $custom; + $this->addresses = $addresses; + $this->shippingAddresses = $shippingAddresses; + $this->defaultShipingAddress = $defaultShipingAddress; + $this->billingAddresses = $billingAddresses; + $this->defaultBillingAddress = $defaultBillingAddress; + $this->unitType = $unitType; + } + + /** + *

    User-defined unique identifier for the BusinessUnit.

    + * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + *

    Type of the Business Unit indicating its position in a hierarchy.

    + * + * + * @return null|string + */ + public function getUnitType() + { + if (is_null($this->unitType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_UNIT_TYPE); + if (is_null($data)) { + return null; + } + $this->unitType = (string) $data; + } + + return $this->unitType; + } + + /** + *

    Name of the Business Unit.

    + * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

    Email address of the Business Unit.

    + * + * + * @return null|string + */ + public function getContactEmail() + { + if (is_null($this->contactEmail)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CONTACT_EMAIL); + if (is_null($data)) { + return null; + } + $this->contactEmail = (string) $data; + } + + return $this->contactEmail; + } + + /** + *

    Custom Fields for the Business Unit.

    + * + * + * @return null|CustomFields + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomFieldsModel::of($data); + } + + return $this->custom; + } + + /** + *

    Addresses used by the Business Unit.

    + * + * + * @return null|BaseAddressCollection + */ + public function getAddresses() + { + if (is_null($this->addresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->addresses = BaseAddressCollection::fromArray($data); + } + + return $this->addresses; + } + + /** + *

    Indexes of entries in addresses to set as shipping addresses. + * The shippingAddressIds of the Customer will be replaced by these addresses.

    + * + * + * @return null|array + */ + public function getShippingAddresses() + { + if (is_null($this->shippingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SHIPPING_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->shippingAddresses = $data; + } + + return $this->shippingAddresses; + } + + /** + *

    Index of the entry in addresses to set as the default shipping address.

    + * + * + * @return null|int + */ + public function getDefaultShipingAddress() + { + if (is_null($this->defaultShipingAddress)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_DEFAULT_SHIPING_ADDRESS); + if (is_null($data)) { + return null; + } + $this->defaultShipingAddress = (int) $data; + } + + return $this->defaultShipingAddress; + } + + /** + *

    Indexes of entries in addresses to set as billing addresses. + * The billingAddressIds of the Customer will be replaced by these addresses.

    + * + * + * @return null|array + */ + public function getBillingAddresses() + { + if (is_null($this->billingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_BILLING_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->billingAddresses = $data; + } + + return $this->billingAddresses; + } + + /** + *

    Index of the entry in addresses to set as the default billing address.

    + * + * + * @return null|int + */ + public function getDefaultBillingAddress() + { + if (is_null($this->defaultBillingAddress)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_DEFAULT_BILLING_ADDRESS); + if (is_null($data)) { + return null; + } + $this->defaultBillingAddress = (int) $data; + } + + return $this->defaultBillingAddress; + } + + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void + { + $this->contactEmail = $contactEmail; + } + + /** + * @param ?CustomFields $custom + */ + public function setCustom(?CustomFields $custom): void + { + $this->custom = $custom; + } + + /** + * @param ?BaseAddressCollection $addresses + */ + public function setAddresses(?BaseAddressCollection $addresses): void + { + $this->addresses = $addresses; + } + + /** + * @param ?array $shippingAddresses + */ + public function setShippingAddresses(?array $shippingAddresses): void + { + $this->shippingAddresses = $shippingAddresses; + } + + /** + * @param ?int $defaultShipingAddress + */ + public function setDefaultShipingAddress(?int $defaultShipingAddress): void + { + $this->defaultShipingAddress = $defaultShipingAddress; + } + + /** + * @param ?array $billingAddresses + */ + public function setBillingAddresses(?array $billingAddresses): void + { + $this->billingAddresses = $billingAddresses; + } + + /** + * @param ?int $defaultBillingAddress + */ + public function setDefaultBillingAddress(?int $defaultBillingAddress): void + { + $this->defaultBillingAddress = $defaultBillingAddress; + } + + + + /** + * @psalm-param stdClass|array $value + * @psalm-return class-string + */ + public static function resolveDiscriminatorClass($value): string + { + $fieldName = MyBusinessUnitDraft::DISCRIMINATOR_FIELD; + if (is_object($value) && isset($value->$fieldName)) { + /** @psalm-var string $discriminatorValue */ + $discriminatorValue = $value->$fieldName; + if (isset(self::$discriminatorClasses[$discriminatorValue])) { + return self::$discriminatorClasses[$discriminatorValue]; + } + } + if (is_array($value) && isset($value[$fieldName])) { + /** @psalm-var string $discriminatorValue */ + $discriminatorValue = $value[$fieldName]; + if (isset(self::$discriminatorClasses[$discriminatorValue])) { + return self::$discriminatorClasses[$discriminatorValue]; + } + } + + /** @psalm-var class-string */ + $type = MyBusinessUnitDraftModel::class; + return $type; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAddressAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAddressAction.php new file mode 100644 index 00000000000..0ca65bd56be --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAddressAction.php @@ -0,0 +1,44 @@ +ID of the address to be removed. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressId(); + + /** + *

    Key of the address to be removed. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressKey(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAddressActionBuilder.php new file mode 100644 index 00000000000..4cace296715 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAddressActionBuilder.php @@ -0,0 +1,92 @@ + + */ +final class MyBusinessUnitRemoveAddressActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $addressKey; + + /** + *

    ID of the address to be removed. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

    Key of the address to be removed. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressKey() + { + return $this->addressKey; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $addressKey + * @return $this + */ + public function withAddressKey(?string $addressKey) + { + $this->addressKey = $addressKey; + + return $this; + } + + + public function build(): MyBusinessUnitRemoveAddressAction + { + return new MyBusinessUnitRemoveAddressActionModel( + $this->addressId, + $this->addressKey + ); + } + + public static function of(): MyBusinessUnitRemoveAddressActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAddressActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAddressActionCollection.php new file mode 100644 index 00000000000..bc47fe6ccd1 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAddressActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitRemoveAddressAction current() + * @method MyBusinessUnitRemoveAddressAction end() + * @method MyBusinessUnitRemoveAddressAction at($offset) + */ +class MyBusinessUnitRemoveAddressActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitRemoveAddressAction $value + * @psalm-param MyBusinessUnitRemoveAddressAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitRemoveAddressActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitRemoveAddressAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitRemoveAddressAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitRemoveAddressAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitRemoveAddressAction $data */ + $data = MyBusinessUnitRemoveAddressActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAddressActionModel.php new file mode 100644 index 00000000000..223acfae3b9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAddressActionModel.php @@ -0,0 +1,129 @@ +addressId = $addressId; + $this->addressKey = $addressKey; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    ID of the address to be removed. Either addressId or addressKey is required.

    + * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

    Key of the address to be removed. Either addressId or addressKey is required.

    + * + * + * @return null|string + */ + public function getAddressKey() + { + if (is_null($this->addressKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_KEY); + if (is_null($data)) { + return null; + } + $this->addressKey = (string) $data; + } + + return $this->addressKey; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void + { + $this->addressKey = $addressKey; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAssociateAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAssociateAction.php new file mode 100644 index 00000000000..2e5d5651097 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAssociateAction.php @@ -0,0 +1,31 @@ +Associate to remove.

    + * + + * @return null|CustomerResourceIdentifier + */ + public function getCustomer(); + + /** + * @param ?CustomerResourceIdentifier $customer + */ + public function setCustomer(?CustomerResourceIdentifier $customer): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAssociateActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAssociateActionBuilder.php new file mode 100644 index 00000000000..231ceba7538 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAssociateActionBuilder.php @@ -0,0 +1,75 @@ + + */ +final class MyBusinessUnitRemoveAssociateActionBuilder implements Builder +{ + /** + + * @var null|CustomerResourceIdentifier|CustomerResourceIdentifierBuilder + */ + private $customer; + + /** + *

    Associate to remove.

    + * + + * @return null|CustomerResourceIdentifier + */ + public function getCustomer() + { + return $this->customer instanceof CustomerResourceIdentifierBuilder ? $this->customer->build() : $this->customer; + } + + /** + * @param ?CustomerResourceIdentifier $customer + * @return $this + */ + public function withCustomer(?CustomerResourceIdentifier $customer) + { + $this->customer = $customer; + + return $this; + } + + /** + * @deprecated use withCustomer() instead + * @return $this + */ + public function withCustomerBuilder(?CustomerResourceIdentifierBuilder $customer) + { + $this->customer = $customer; + + return $this; + } + + public function build(): MyBusinessUnitRemoveAssociateAction + { + return new MyBusinessUnitRemoveAssociateActionModel( + $this->customer instanceof CustomerResourceIdentifierBuilder ? $this->customer->build() : $this->customer + ); + } + + public static function of(): MyBusinessUnitRemoveAssociateActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAssociateActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAssociateActionCollection.php new file mode 100644 index 00000000000..3b0cee4be8c --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAssociateActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitRemoveAssociateAction current() + * @method MyBusinessUnitRemoveAssociateAction end() + * @method MyBusinessUnitRemoveAssociateAction at($offset) + */ +class MyBusinessUnitRemoveAssociateActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitRemoveAssociateAction $value + * @psalm-param MyBusinessUnitRemoveAssociateAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitRemoveAssociateActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitRemoveAssociateAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitRemoveAssociateAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitRemoveAssociateAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitRemoveAssociateAction $data */ + $data = MyBusinessUnitRemoveAssociateActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAssociateActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAssociateActionModel.php new file mode 100644 index 00000000000..45b4d3ea906 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveAssociateActionModel.php @@ -0,0 +1,96 @@ +customer = $customer; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    Associate to remove.

    + * + * + * @return null|CustomerResourceIdentifier + */ + public function getCustomer() + { + if (is_null($this->customer)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER); + if (is_null($data)) { + return null; + } + + $this->customer = CustomerResourceIdentifierModel::of($data); + } + + return $this->customer; + } + + + /** + * @param ?CustomerResourceIdentifier $customer + */ + public function setCustomer(?CustomerResourceIdentifier $customer): void + { + $this->customer = $customer; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveBillingAddressIdAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveBillingAddressIdAction.php new file mode 100644 index 00000000000..16080c4691d --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveBillingAddressIdAction.php @@ -0,0 +1,44 @@ +ID of the billing address to be removed. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressId(); + + /** + *

    Key of the billing address to be removed. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressKey(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveBillingAddressIdActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveBillingAddressIdActionBuilder.php new file mode 100644 index 00000000000..748d7f9be63 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveBillingAddressIdActionBuilder.php @@ -0,0 +1,92 @@ + + */ +final class MyBusinessUnitRemoveBillingAddressIdActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $addressKey; + + /** + *

    ID of the billing address to be removed. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

    Key of the billing address to be removed. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressKey() + { + return $this->addressKey; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $addressKey + * @return $this + */ + public function withAddressKey(?string $addressKey) + { + $this->addressKey = $addressKey; + + return $this; + } + + + public function build(): MyBusinessUnitRemoveBillingAddressIdAction + { + return new MyBusinessUnitRemoveBillingAddressIdActionModel( + $this->addressId, + $this->addressKey + ); + } + + public static function of(): MyBusinessUnitRemoveBillingAddressIdActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveBillingAddressIdActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveBillingAddressIdActionCollection.php new file mode 100644 index 00000000000..a8cfc84628d --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveBillingAddressIdActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitRemoveBillingAddressIdAction current() + * @method MyBusinessUnitRemoveBillingAddressIdAction end() + * @method MyBusinessUnitRemoveBillingAddressIdAction at($offset) + */ +class MyBusinessUnitRemoveBillingAddressIdActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitRemoveBillingAddressIdAction $value + * @psalm-param MyBusinessUnitRemoveBillingAddressIdAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitRemoveBillingAddressIdActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitRemoveBillingAddressIdAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitRemoveBillingAddressIdAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitRemoveBillingAddressIdAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitRemoveBillingAddressIdAction $data */ + $data = MyBusinessUnitRemoveBillingAddressIdActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveBillingAddressIdActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveBillingAddressIdActionModel.php new file mode 100644 index 00000000000..8e311f3654b --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveBillingAddressIdActionModel.php @@ -0,0 +1,129 @@ +addressId = $addressId; + $this->addressKey = $addressKey; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    ID of the billing address to be removed. Either addressId or addressKey is required.

    + * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

    Key of the billing address to be removed. Either addressId or addressKey is required.

    + * + * + * @return null|string + */ + public function getAddressKey() + { + if (is_null($this->addressKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_KEY); + if (is_null($data)) { + return null; + } + $this->addressKey = (string) $data; + } + + return $this->addressKey; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void + { + $this->addressKey = $addressKey; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveShippingAddressIdAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveShippingAddressIdAction.php new file mode 100644 index 00000000000..77287adaf1d --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveShippingAddressIdAction.php @@ -0,0 +1,44 @@ +ID of the shipping address to be removed. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressId(); + + /** + *

    Key of the shipping address to be removed. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressKey(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveShippingAddressIdActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveShippingAddressIdActionBuilder.php new file mode 100644 index 00000000000..da5ef3440b2 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveShippingAddressIdActionBuilder.php @@ -0,0 +1,92 @@ + + */ +final class MyBusinessUnitRemoveShippingAddressIdActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $addressKey; + + /** + *

    ID of the shipping address to be removed. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

    Key of the shipping address to be removed. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressKey() + { + return $this->addressKey; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $addressKey + * @return $this + */ + public function withAddressKey(?string $addressKey) + { + $this->addressKey = $addressKey; + + return $this; + } + + + public function build(): MyBusinessUnitRemoveShippingAddressIdAction + { + return new MyBusinessUnitRemoveShippingAddressIdActionModel( + $this->addressId, + $this->addressKey + ); + } + + public static function of(): MyBusinessUnitRemoveShippingAddressIdActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveShippingAddressIdActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveShippingAddressIdActionCollection.php new file mode 100644 index 00000000000..7c279cb242b --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveShippingAddressIdActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitRemoveShippingAddressIdAction current() + * @method MyBusinessUnitRemoveShippingAddressIdAction end() + * @method MyBusinessUnitRemoveShippingAddressIdAction at($offset) + */ +class MyBusinessUnitRemoveShippingAddressIdActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitRemoveShippingAddressIdAction $value + * @psalm-param MyBusinessUnitRemoveShippingAddressIdAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitRemoveShippingAddressIdActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitRemoveShippingAddressIdAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitRemoveShippingAddressIdAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitRemoveShippingAddressIdAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitRemoveShippingAddressIdAction $data */ + $data = MyBusinessUnitRemoveShippingAddressIdActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveShippingAddressIdActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveShippingAddressIdActionModel.php new file mode 100644 index 00000000000..6c0f27d1b7d --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitRemoveShippingAddressIdActionModel.php @@ -0,0 +1,129 @@ +addressId = $addressId; + $this->addressKey = $addressKey; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    ID of the shipping address to be removed. Either addressId or addressKey is required.

    + * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

    Key of the shipping address to be removed. Either addressId or addressKey is required.

    + * + * + * @return null|string + */ + public function getAddressKey() + { + if (is_null($this->addressKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_KEY); + if (is_null($data)) { + return null; + } + $this->addressKey = (string) $data; + } + + return $this->addressKey; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void + { + $this->addressKey = $addressKey; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomFieldAction.php new file mode 100644 index 00000000000..1f2b94f1908 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomFieldAction.php @@ -0,0 +1,60 @@ +ID of the address to be extended.

    + * + + * @return null|string + */ + public function getAddressId(); + + /** + *

    Name of the Custom Field.

    + * + + * @return null|string + */ + public function getName(); + + /** + *

    If value is absent or null, this field will be removed if it exists. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * If value is provided, it is set for the field defined by name.

    + * + + * @return null|mixed + */ + public function getValue(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param mixed $value + */ + public function setValue($value): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomFieldActionBuilder.php new file mode 100644 index 00000000000..8a175a32f40 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomFieldActionBuilder.php @@ -0,0 +1,123 @@ + + */ +final class MyBusinessUnitSetAddressCustomFieldActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + *

    ID of the address to be extended.

    + * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

    Name of the Custom Field.

    + * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

    If value is absent or null, this field will be removed if it exists. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * If value is provided, it is set for the field defined by name.

    + * + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + + public function build(): MyBusinessUnitSetAddressCustomFieldAction + { + return new MyBusinessUnitSetAddressCustomFieldActionModel( + $this->addressId, + $this->name, + $this->value + ); + } + + public static function of(): MyBusinessUnitSetAddressCustomFieldActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomFieldActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomFieldActionCollection.php new file mode 100644 index 00000000000..41c5c73480e --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomFieldActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitSetAddressCustomFieldAction current() + * @method MyBusinessUnitSetAddressCustomFieldAction end() + * @method MyBusinessUnitSetAddressCustomFieldAction at($offset) + */ +class MyBusinessUnitSetAddressCustomFieldActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitSetAddressCustomFieldAction $value + * @psalm-param MyBusinessUnitSetAddressCustomFieldAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitSetAddressCustomFieldActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitSetAddressCustomFieldAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitSetAddressCustomFieldAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitSetAddressCustomFieldAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitSetAddressCustomFieldAction $data */ + $data = MyBusinessUnitSetAddressCustomFieldActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomFieldActionModel.php new file mode 100644 index 00000000000..6871fe35bec --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomFieldActionModel.php @@ -0,0 +1,167 @@ +addressId = $addressId; + $this->name = $name; + $this->value = $value; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    ID of the address to be extended.

    + * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

    Name of the Custom Field.

    + * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

    If value is absent or null, this field will be removed if it exists. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * If value is provided, it is set for the field defined by name.

    + * + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomTypeAction.php new file mode 100644 index 00000000000..e7e49b8a4ae --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomTypeAction.php @@ -0,0 +1,61 @@ +Defines the Type that extends the address with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the address.

    + * + + * @return null|TypeResourceIdentifier + */ + public function getType(); + + /** + *

    Sets the Custom Fields fields for the address.

    + * + + * @return null|FieldContainer + */ + public function getFields(); + + /** + *

    ID of the address to be extended.

    + * + + * @return null|string + */ + public function getAddressId(); + + /** + * @param ?TypeResourceIdentifier $type + */ + public function setType(?TypeResourceIdentifier $type): void; + + /** + * @param ?FieldContainer $fields + */ + public function setFields(?FieldContainer $fields): void; + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomTypeActionBuilder.php new file mode 100644 index 00000000000..31b009989e5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomTypeActionBuilder.php @@ -0,0 +1,147 @@ + + */ +final class MyBusinessUnitSetAddressCustomTypeActionBuilder implements Builder +{ + /** + + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder + */ + private $type; + + /** + + * @var null|FieldContainer|FieldContainerBuilder + */ + private $fields; + + /** + + * @var ?string + */ + private $addressId; + + /** + *

    Defines the Type that extends the address with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the address.

    + * + + * @return null|TypeResourceIdentifier + */ + public function getType() + { + return $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type; + } + + /** + *

    Sets the Custom Fields fields for the address.

    + * + + * @return null|FieldContainer + */ + public function getFields() + { + return $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields; + } + + /** + *

    ID of the address to be extended.

    + * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + * @param ?TypeResourceIdentifier $type + * @return $this + */ + public function withType(?TypeResourceIdentifier $type) + { + $this->type = $type; + + return $this; + } + + /** + * @param ?FieldContainer $fields + * @return $this + */ + public function withFields(?FieldContainer $fields) + { + $this->fields = $fields; + + return $this; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @deprecated use withType() instead + * @return $this + */ + public function withTypeBuilder(?TypeResourceIdentifierBuilder $type) + { + $this->type = $type; + + return $this; + } + + /** + * @deprecated use withFields() instead + * @return $this + */ + public function withFieldsBuilder(?FieldContainerBuilder $fields) + { + $this->fields = $fields; + + return $this; + } + + public function build(): MyBusinessUnitSetAddressCustomTypeAction + { + return new MyBusinessUnitSetAddressCustomTypeActionModel( + $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type, + $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields, + $this->addressId + ); + } + + public static function of(): MyBusinessUnitSetAddressCustomTypeActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomTypeActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomTypeActionCollection.php new file mode 100644 index 00000000000..6e0afeecc7e --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomTypeActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitSetAddressCustomTypeAction current() + * @method MyBusinessUnitSetAddressCustomTypeAction end() + * @method MyBusinessUnitSetAddressCustomTypeAction at($offset) + */ +class MyBusinessUnitSetAddressCustomTypeActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitSetAddressCustomTypeAction $value + * @psalm-param MyBusinessUnitSetAddressCustomTypeAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitSetAddressCustomTypeActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitSetAddressCustomTypeAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitSetAddressCustomTypeAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitSetAddressCustomTypeAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitSetAddressCustomTypeAction $data */ + $data = MyBusinessUnitSetAddressCustomTypeActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomTypeActionModel.php new file mode 100644 index 00000000000..48362ea1b76 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetAddressCustomTypeActionModel.php @@ -0,0 +1,172 @@ +type = $type; + $this->fields = $fields; + $this->addressId = $addressId; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    Defines the Type that extends the address with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the address.

    + * + * + * @return null|TypeResourceIdentifier + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + + $this->type = TypeResourceIdentifierModel::of($data); + } + + return $this->type; + } + + /** + *

    Sets the Custom Fields fields for the address.

    + * + * + * @return null|FieldContainer + */ + public function getFields() + { + if (is_null($this->fields)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_FIELDS); + if (is_null($data)) { + return null; + } + + $this->fields = FieldContainerModel::of($data); + } + + return $this->fields; + } + + /** + *

    ID of the address to be extended.

    + * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + + /** + * @param ?TypeResourceIdentifier $type + */ + public function setType(?TypeResourceIdentifier $type): void + { + $this->type = $type; + } + + /** + * @param ?FieldContainer $fields + */ + public function setFields(?FieldContainer $fields): void + { + $this->fields = $fields; + } + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetContactEmailAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetContactEmailAction.php new file mode 100644 index 00000000000..6b55c39e67f --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetContactEmailAction.php @@ -0,0 +1,31 @@ +Email to set. + * If contactEmail is absent or null, the existing contact email, if any, will be removed.

    + * + + * @return null|string + */ + public function getContactEmail(); + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetContactEmailActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetContactEmailActionBuilder.php new file mode 100644 index 00000000000..a0b9b4e35d2 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetContactEmailActionBuilder.php @@ -0,0 +1,64 @@ + + */ +final class MyBusinessUnitSetContactEmailActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $contactEmail; + + /** + *

    Email to set. + * If contactEmail is absent or null, the existing contact email, if any, will be removed.

    + * + + * @return null|string + */ + public function getContactEmail() + { + return $this->contactEmail; + } + + /** + * @param ?string $contactEmail + * @return $this + */ + public function withContactEmail(?string $contactEmail) + { + $this->contactEmail = $contactEmail; + + return $this; + } + + + public function build(): MyBusinessUnitSetContactEmailAction + { + return new MyBusinessUnitSetContactEmailActionModel( + $this->contactEmail + ); + } + + public static function of(): MyBusinessUnitSetContactEmailActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetContactEmailActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetContactEmailActionCollection.php new file mode 100644 index 00000000000..70c51ab700c --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetContactEmailActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitSetContactEmailAction current() + * @method MyBusinessUnitSetContactEmailAction end() + * @method MyBusinessUnitSetContactEmailAction at($offset) + */ +class MyBusinessUnitSetContactEmailActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitSetContactEmailAction $value + * @psalm-param MyBusinessUnitSetContactEmailAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitSetContactEmailActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitSetContactEmailAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitSetContactEmailAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitSetContactEmailAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitSetContactEmailAction $data */ + $data = MyBusinessUnitSetContactEmailActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetContactEmailActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetContactEmailActionModel.php new file mode 100644 index 00000000000..dd59bf076c0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetContactEmailActionModel.php @@ -0,0 +1,94 @@ +contactEmail = $contactEmail; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    Email to set. + * If contactEmail is absent or null, the existing contact email, if any, will be removed.

    + * + * + * @return null|string + */ + public function getContactEmail() + { + if (is_null($this->contactEmail)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CONTACT_EMAIL); + if (is_null($data)) { + return null; + } + $this->contactEmail = (string) $data; + } + + return $this->contactEmail; + } + + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void + { + $this->contactEmail = $contactEmail; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomFieldAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomFieldAction.php new file mode 100644 index 00000000000..d0013e4e853 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomFieldAction.php @@ -0,0 +1,46 @@ +Name of the Custom Field.

    + * + + * @return null|string + */ + public function getName(); + + /** + *

    If value is absent or null, this field will be removed if it exists. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * If value is provided, it is set for the field defined by name.

    + * + + * @return null|mixed + */ + public function getValue(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param mixed $value + */ + public function setValue($value): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomFieldActionBuilder.php new file mode 100644 index 00000000000..ebd7910514f --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomFieldActionBuilder.php @@ -0,0 +1,94 @@ + + */ +final class MyBusinessUnitSetCustomFieldActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + *

    Name of the Custom Field.

    + * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

    If value is absent or null, this field will be removed if it exists. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * If value is provided, it is set for the field defined by name.

    + * + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + + public function build(): MyBusinessUnitSetCustomFieldAction + { + return new MyBusinessUnitSetCustomFieldActionModel( + $this->name, + $this->value + ); + } + + public static function of(): MyBusinessUnitSetCustomFieldActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomFieldActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomFieldActionCollection.php new file mode 100644 index 00000000000..35c97b9636c --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomFieldActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitSetCustomFieldAction current() + * @method MyBusinessUnitSetCustomFieldAction end() + * @method MyBusinessUnitSetCustomFieldAction at($offset) + */ +class MyBusinessUnitSetCustomFieldActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitSetCustomFieldAction $value + * @psalm-param MyBusinessUnitSetCustomFieldAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitSetCustomFieldActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitSetCustomFieldAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitSetCustomFieldAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitSetCustomFieldAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitSetCustomFieldAction $data */ + $data = MyBusinessUnitSetCustomFieldActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomFieldActionModel.php new file mode 100644 index 00000000000..00a8431aa70 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomFieldActionModel.php @@ -0,0 +1,131 @@ +name = $name; + $this->value = $value; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    Name of the Custom Field.

    + * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

    If value is absent or null, this field will be removed if it exists. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * If value is provided, it is set for the field defined by name.

    + * + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomTypeAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomTypeAction.php new file mode 100644 index 00000000000..e96e887aed9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomTypeAction.php @@ -0,0 +1,47 @@ +Defines the Type that extends the BusinessUnit with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the BusinessUnit.

    + * + + * @return null|TypeResourceIdentifier + */ + public function getType(); + + /** + *

    Sets the Custom Fields for the BusinessUnit.

    + * + + * @return null|FieldContainer + */ + public function getFields(); + + /** + * @param ?TypeResourceIdentifier $type + */ + public function setType(?TypeResourceIdentifier $type): void; + + /** + * @param ?FieldContainer $fields + */ + public function setFields(?FieldContainer $fields): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomTypeActionBuilder.php new file mode 100644 index 00000000000..d0ef373c5d5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomTypeActionBuilder.php @@ -0,0 +1,118 @@ + + */ +final class MyBusinessUnitSetCustomTypeActionBuilder implements Builder +{ + /** + + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder + */ + private $type; + + /** + + * @var null|FieldContainer|FieldContainerBuilder + */ + private $fields; + + /** + *

    Defines the Type that extends the BusinessUnit with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the BusinessUnit.

    + * + + * @return null|TypeResourceIdentifier + */ + public function getType() + { + return $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type; + } + + /** + *

    Sets the Custom Fields for the BusinessUnit.

    + * + + * @return null|FieldContainer + */ + public function getFields() + { + return $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields; + } + + /** + * @param ?TypeResourceIdentifier $type + * @return $this + */ + public function withType(?TypeResourceIdentifier $type) + { + $this->type = $type; + + return $this; + } + + /** + * @param ?FieldContainer $fields + * @return $this + */ + public function withFields(?FieldContainer $fields) + { + $this->fields = $fields; + + return $this; + } + + /** + * @deprecated use withType() instead + * @return $this + */ + public function withTypeBuilder(?TypeResourceIdentifierBuilder $type) + { + $this->type = $type; + + return $this; + } + + /** + * @deprecated use withFields() instead + * @return $this + */ + public function withFieldsBuilder(?FieldContainerBuilder $fields) + { + $this->fields = $fields; + + return $this; + } + + public function build(): MyBusinessUnitSetCustomTypeAction + { + return new MyBusinessUnitSetCustomTypeActionModel( + $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type, + $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields + ); + } + + public static function of(): MyBusinessUnitSetCustomTypeActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomTypeActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomTypeActionCollection.php new file mode 100644 index 00000000000..fa0f54c59ee --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomTypeActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitSetCustomTypeAction current() + * @method MyBusinessUnitSetCustomTypeAction end() + * @method MyBusinessUnitSetCustomTypeAction at($offset) + */ +class MyBusinessUnitSetCustomTypeActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitSetCustomTypeAction $value + * @psalm-param MyBusinessUnitSetCustomTypeAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitSetCustomTypeActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitSetCustomTypeAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitSetCustomTypeAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitSetCustomTypeAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitSetCustomTypeAction $data */ + $data = MyBusinessUnitSetCustomTypeActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomTypeActionModel.php new file mode 100644 index 00000000000..2a7c2d220ca --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetCustomTypeActionModel.php @@ -0,0 +1,136 @@ +type = $type; + $this->fields = $fields; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    Defines the Type that extends the BusinessUnit with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the BusinessUnit.

    + * + * + * @return null|TypeResourceIdentifier + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + + $this->type = TypeResourceIdentifierModel::of($data); + } + + return $this->type; + } + + /** + *

    Sets the Custom Fields for the BusinessUnit.

    + * + * + * @return null|FieldContainer + */ + public function getFields() + { + if (is_null($this->fields)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_FIELDS); + if (is_null($data)) { + return null; + } + + $this->fields = FieldContainerModel::of($data); + } + + return $this->fields; + } + + + /** + * @param ?TypeResourceIdentifier $type + */ + public function setType(?TypeResourceIdentifier $type): void + { + $this->type = $type; + } + + /** + * @param ?FieldContainer $fields + */ + public function setFields(?FieldContainer $fields): void + { + $this->fields = $fields; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultBillingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultBillingAddressAction.php new file mode 100644 index 00000000000..8d2a6142e1d --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultBillingAddressAction.php @@ -0,0 +1,44 @@ +ID of the address to add as a billing address. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressId(); + + /** + *

    Key of the address to add as a billing address. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressKey(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultBillingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultBillingAddressActionBuilder.php new file mode 100644 index 00000000000..e362cb14d9a --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultBillingAddressActionBuilder.php @@ -0,0 +1,92 @@ + + */ +final class MyBusinessUnitSetDefaultBillingAddressActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $addressKey; + + /** + *

    ID of the address to add as a billing address. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

    Key of the address to add as a billing address. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressKey() + { + return $this->addressKey; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $addressKey + * @return $this + */ + public function withAddressKey(?string $addressKey) + { + $this->addressKey = $addressKey; + + return $this; + } + + + public function build(): MyBusinessUnitSetDefaultBillingAddressAction + { + return new MyBusinessUnitSetDefaultBillingAddressActionModel( + $this->addressId, + $this->addressKey + ); + } + + public static function of(): MyBusinessUnitSetDefaultBillingAddressActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultBillingAddressActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultBillingAddressActionCollection.php new file mode 100644 index 00000000000..858cf9f102b --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultBillingAddressActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitSetDefaultBillingAddressAction current() + * @method MyBusinessUnitSetDefaultBillingAddressAction end() + * @method MyBusinessUnitSetDefaultBillingAddressAction at($offset) + */ +class MyBusinessUnitSetDefaultBillingAddressActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitSetDefaultBillingAddressAction $value + * @psalm-param MyBusinessUnitSetDefaultBillingAddressAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitSetDefaultBillingAddressActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitSetDefaultBillingAddressAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitSetDefaultBillingAddressAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitSetDefaultBillingAddressAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitSetDefaultBillingAddressAction $data */ + $data = MyBusinessUnitSetDefaultBillingAddressActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultBillingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultBillingAddressActionModel.php new file mode 100644 index 00000000000..71d57c1c6e6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultBillingAddressActionModel.php @@ -0,0 +1,129 @@ +addressId = $addressId; + $this->addressKey = $addressKey; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    ID of the address to add as a billing address. Either addressId or addressKey is required.

    + * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

    Key of the address to add as a billing address. Either addressId or addressKey is required.

    + * + * + * @return null|string + */ + public function getAddressKey() + { + if (is_null($this->addressKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_KEY); + if (is_null($data)) { + return null; + } + $this->addressKey = (string) $data; + } + + return $this->addressKey; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void + { + $this->addressKey = $addressKey; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultShippingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultShippingAddressAction.php new file mode 100644 index 00000000000..c29c1630251 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultShippingAddressAction.php @@ -0,0 +1,44 @@ +ID of the address to add as a shipping address. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressId(); + + /** + *

    Key of the address to add as a shipping address. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressKey(); + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void; + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultShippingAddressActionBuilder.php new file mode 100644 index 00000000000..5bde6982468 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultShippingAddressActionBuilder.php @@ -0,0 +1,92 @@ + + */ +final class MyBusinessUnitSetDefaultShippingAddressActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $addressId; + + /** + + * @var ?string + */ + private $addressKey; + + /** + *

    ID of the address to add as a shipping address. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressId() + { + return $this->addressId; + } + + /** + *

    Key of the address to add as a shipping address. Either addressId or addressKey is required.

    + * + + * @return null|string + */ + public function getAddressKey() + { + return $this->addressKey; + } + + /** + * @param ?string $addressId + * @return $this + */ + public function withAddressId(?string $addressId) + { + $this->addressId = $addressId; + + return $this; + } + + /** + * @param ?string $addressKey + * @return $this + */ + public function withAddressKey(?string $addressKey) + { + $this->addressKey = $addressKey; + + return $this; + } + + + public function build(): MyBusinessUnitSetDefaultShippingAddressAction + { + return new MyBusinessUnitSetDefaultShippingAddressActionModel( + $this->addressId, + $this->addressKey + ); + } + + public static function of(): MyBusinessUnitSetDefaultShippingAddressActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultShippingAddressActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultShippingAddressActionCollection.php new file mode 100644 index 00000000000..9f00bc0d258 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultShippingAddressActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitSetDefaultShippingAddressAction current() + * @method MyBusinessUnitSetDefaultShippingAddressAction end() + * @method MyBusinessUnitSetDefaultShippingAddressAction at($offset) + */ +class MyBusinessUnitSetDefaultShippingAddressActionCollection extends MyBusinessUnitUpdateActionCollection +{ + /** + * @psalm-assert MyBusinessUnitSetDefaultShippingAddressAction $value + * @psalm-param MyBusinessUnitSetDefaultShippingAddressAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitSetDefaultShippingAddressActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitSetDefaultShippingAddressAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitSetDefaultShippingAddressAction + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitSetDefaultShippingAddressAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitSetDefaultShippingAddressAction $data */ + $data = MyBusinessUnitSetDefaultShippingAddressActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultShippingAddressActionModel.php new file mode 100644 index 00000000000..688fbe8297a --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitSetDefaultShippingAddressActionModel.php @@ -0,0 +1,129 @@ +addressId = $addressId; + $this->addressKey = $addressKey; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    ID of the address to add as a shipping address. Either addressId or addressKey is required.

    + * + * + * @return null|string + */ + public function getAddressId() + { + if (is_null($this->addressId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_ID); + if (is_null($data)) { + return null; + } + $this->addressId = (string) $data; + } + + return $this->addressId; + } + + /** + *

    Key of the address to add as a shipping address. Either addressId or addressKey is required.

    + * + * + * @return null|string + */ + public function getAddressKey() + { + if (is_null($this->addressKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ADDRESS_KEY); + if (is_null($data)) { + return null; + } + $this->addressKey = (string) $data; + } + + return $this->addressKey; + } + + + /** + * @param ?string $addressId + */ + public function setAddressId(?string $addressId): void + { + $this->addressId = $addressId; + } + + /** + * @param ?string $addressKey + */ + public function setAddressKey(?string $addressKey): void + { + $this->addressKey = $addressKey; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdate.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdate.php new file mode 100644 index 00000000000..1596b7842fe --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdate.php @@ -0,0 +1,46 @@ +Expected version of the BusinessUnit on which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + + * @return null|int + */ + public function getVersion(); + + /** + *

    Update actions to be performed on the BusinessUnit.

    + * + + * @return null|BusinessUnitUpdateActionCollection + */ + public function getActions(); + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void; + + /** + * @param ?BusinessUnitUpdateActionCollection $actions + */ + public function setActions(?BusinessUnitUpdateActionCollection $actions): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateAction.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateAction.php new file mode 100644 index 00000000000..deeaa7854f9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateAction.php @@ -0,0 +1,24 @@ + + */ +final class MyBusinessUnitUpdateActionBuilder implements Builder +{ + public function build(): MyBusinessUnitUpdateAction + { + return new MyBusinessUnitUpdateActionModel( + ); + } + + public static function of(): MyBusinessUnitUpdateActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateActionCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateActionCollection.php new file mode 100644 index 00000000000..93407bfbb5f --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateActionCollection.php @@ -0,0 +1,60 @@ + + * @psalm-method T current() + * @psalm-method T end() + * @psalm-method T at($offset) + * @method MyBusinessUnitUpdateAction current() + * @method MyBusinessUnitUpdateAction end() + * @method MyBusinessUnitUpdateAction at($offset) + */ +class MyBusinessUnitUpdateActionCollection extends MapperSequence +{ + /** + * @psalm-assert T $value + * @psalm-param T|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitUpdateActionCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitUpdateAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?T + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitUpdateAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var T $data */ + $data = MyBusinessUnitUpdateActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateActionModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateActionModel.php new file mode 100644 index 00000000000..2e0346edcdc --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateActionModel.php @@ -0,0 +1,111 @@ + > + * + */ + private static $discriminatorClasses = [ + 'addAddress' => MyBusinessUnitAddAddressActionModel::class, + 'addBillingAddressId' => MyBusinessUnitAddBillingAddressIdActionModel::class, + 'addShippingAddressId' => MyBusinessUnitAddShippingAddressIdActionModel::class, + 'changeAddress' => MyBusinessUnitChangeAddressActionModel::class, + 'changeAssociate' => MyBusinessUnitChangeAssociateActionModel::class, + 'changeName' => MyBusinessUnitChangeNameActionModel::class, + 'changeParentUnit' => MyBusinessUnitChangeParentUnitActionModel::class, + 'removeAddress' => MyBusinessUnitRemoveAddressActionModel::class, + 'removeAssociate' => MyBusinessUnitRemoveAssociateActionModel::class, + 'removeBillingAddressId' => MyBusinessUnitRemoveBillingAddressIdActionModel::class, + 'removeShippingAddressId' => MyBusinessUnitRemoveShippingAddressIdActionModel::class, + 'setAddressCustomField' => MyBusinessUnitSetAddressCustomFieldActionModel::class, + 'setAddressCustomType' => MyBusinessUnitSetAddressCustomTypeActionModel::class, + 'setContactEmail' => MyBusinessUnitSetContactEmailActionModel::class, + 'setCustomField' => MyBusinessUnitSetCustomFieldActionModel::class, + 'setCustomType' => MyBusinessUnitSetCustomTypeActionModel::class, + 'setDefaultBillingAddress' => MyBusinessUnitSetDefaultBillingAddressActionModel::class, + 'setDefaultShippingAddress' => MyBusinessUnitSetDefaultShippingAddressActionModel::class, + ]; + + /** + * @psalm-suppress MissingParamType + */ + public function __construct( + ?string $action = null + ) { + $this->action = $action; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + + + + + /** + * @psalm-param stdClass|array $value + * @psalm-return class-string + */ + public static function resolveDiscriminatorClass($value): string + { + $fieldName = MyBusinessUnitUpdateAction::DISCRIMINATOR_FIELD; + if (is_object($value) && isset($value->$fieldName)) { + /** @psalm-var string $discriminatorValue */ + $discriminatorValue = $value->$fieldName; + if (isset(self::$discriminatorClasses[$discriminatorValue])) { + return self::$discriminatorClasses[$discriminatorValue]; + } + } + if (is_array($value) && isset($value[$fieldName])) { + /** @psalm-var string $discriminatorValue */ + $discriminatorValue = $value[$fieldName]; + if (isset(self::$discriminatorClasses[$discriminatorValue])) { + return self::$discriminatorClasses[$discriminatorValue]; + } + } + + /** @psalm-var class-string */ + $type = MyBusinessUnitUpdateActionModel::class; + return $type; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateBuilder.php new file mode 100644 index 00000000000..6cea516e5bd --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateBuilder.php @@ -0,0 +1,94 @@ + + */ +final class MyBusinessUnitUpdateBuilder implements Builder +{ + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?BusinessUnitUpdateActionCollection + */ + private $actions; + + /** + *

    Expected version of the BusinessUnit on which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Update actions to be performed on the BusinessUnit.

    + * + + * @return null|BusinessUnitUpdateActionCollection + */ + public function getActions() + { + return $this->actions; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?BusinessUnitUpdateActionCollection $actions + * @return $this + */ + public function withActions(?BusinessUnitUpdateActionCollection $actions) + { + $this->actions = $actions; + + return $this; + } + + + public function build(): MyBusinessUnitUpdate + { + return new MyBusinessUnitUpdateModel( + $this->version, + $this->actions + ); + } + + public static function of(): MyBusinessUnitUpdateBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateCollection.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateCollection.php new file mode 100644 index 00000000000..94c9445f2bb --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateCollection.php @@ -0,0 +1,56 @@ + + * @method MyBusinessUnitUpdate current() + * @method MyBusinessUnitUpdate end() + * @method MyBusinessUnitUpdate at($offset) + */ +class MyBusinessUnitUpdateCollection extends MapperSequence +{ + /** + * @psalm-assert MyBusinessUnitUpdate $value + * @psalm-param MyBusinessUnitUpdate|stdClass $value + * @throws InvalidArgumentException + * + * @return MyBusinessUnitUpdateCollection + */ + public function add($value) + { + if (!$value instanceof MyBusinessUnitUpdate) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyBusinessUnitUpdate + */ + protected function mapper() + { + return function (?int $index): ?MyBusinessUnitUpdate { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyBusinessUnitUpdate $data */ + $data = MyBusinessUnitUpdateModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateModel.php new file mode 100644 index 00000000000..6e352ddbe52 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitUpdateModel.php @@ -0,0 +1,104 @@ +version = $version; + $this->actions = $actions; + } + + /** + *

    Expected version of the BusinessUnit on which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Update actions to be performed on the BusinessUnit.

    + * + * + * @return null|BusinessUnitUpdateActionCollection + */ + public function getActions() + { + if (is_null($this->actions)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ACTIONS); + if (is_null($data)) { + return null; + } + $this->actions = BusinessUnitUpdateActionCollection::fromArray($data); + } + + return $this->actions; + } + + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?BusinessUnitUpdateActionCollection $actions + */ + public function setActions(?BusinessUnitUpdateActionCollection $actions): void + { + $this->actions = $actions; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeAction.php b/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeAction.php index 0af36670fd2..e74f9d94c22 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeAction.php @@ -16,6 +16,7 @@ interface MyCartAddDiscountCodeAction extends MyCartUpdateAction public const FIELD_CODE = 'code'; /** + * @return null|string */ public function getCode(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeActionBuilder.php index 66dfb819671..19d6bbc4025 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeActionBuilder.php @@ -21,11 +21,13 @@ final class MyCartAddDiscountCodeActionBuilder implements Builder { /** + * @var ?string */ private $code; /** + * @return null|string */ public function getCode() diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeActionModel.php index 7b4c7f6332f..237c5b3a96c 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddDiscountCodeActionModel.php @@ -21,11 +21,13 @@ final class MyCartAddDiscountCodeActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'addDiscountCode'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $code; @@ -35,13 +37,15 @@ final class MyCartAddDiscountCodeActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $code = null + ?string $code = null, + ?string $action = null ) { $this->code = $code; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getCode() diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressAction.php index a1d928477b6..662844964a4 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressAction.php @@ -17,6 +17,7 @@ interface MyCartAddItemShippingAddressAction extends MyCartUpdateAction public const FIELD_ADDRESS = 'address'; /** + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionBuilder.php index 61f2148f54d..8accc65d2ba 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionBuilder.php @@ -23,11 +23,13 @@ final class MyCartAddItemShippingAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionModel.php index 42fc527a3cc..111f9edfa1a 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddItemShippingAddressActionModel.php @@ -23,11 +23,13 @@ final class MyCartAddItemShippingAddressActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'addItemShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -37,13 +39,15 @@ final class MyCartAddItemShippingAddressActionModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemAction.php b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemAction.php index c2f7e741fb9..f617c4457c5 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemAction.php @@ -36,6 +36,7 @@ interface MyCartAddLineItemAction extends MyCartUpdateAction /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -43,31 +44,37 @@ public function getCustom(); /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel(); /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); /** + * @return null|string */ public function getProductId(); /** + * @return null|int */ public function getVariantId(); /** + * @return null|string */ public function getSku(); /** + * @return null|int */ public function getQuantity(); @@ -75,6 +82,7 @@ public function getQuantity(); /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel(); @@ -83,21 +91,25 @@ public function getSupplyChannel(); *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getExternalPrice(); /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); /** + * @return null|DateTimeImmutable */ public function getAddedAt(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionBuilder.php index 79e13dc4071..0b3d0247b6d 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionBuilder.php @@ -34,61 +34,73 @@ final class MyCartAddLineItemActionBuilder implements Builder { /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $distributionChannel; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** + * @var ?string */ private $productId; /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?int */ private $quantity; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $supplyChannel; /** + * @var null|Money|MoneyBuilder */ private $externalPrice; /** + * @var null|ExternalLineItemTotalPrice|ExternalLineItemTotalPriceBuilder */ private $externalTotalPrice; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetails; /** + * @var ?DateTimeImmutable */ private $addedAt; @@ -96,6 +108,7 @@ final class MyCartAddLineItemActionBuilder implements Builder /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -106,6 +119,7 @@ public function getCustom() /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() @@ -114,6 +128,7 @@ public function getDistributionChannel() } /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() @@ -122,6 +137,7 @@ public function getExternalTaxRate() } /** + * @return null|string */ public function getProductId() @@ -130,6 +146,7 @@ public function getProductId() } /** + * @return null|int */ public function getVariantId() @@ -138,6 +155,7 @@ public function getVariantId() } /** + * @return null|string */ public function getSku() @@ -146,6 +164,7 @@ public function getSku() } /** + * @return null|int */ public function getQuantity() @@ -156,6 +175,7 @@ public function getQuantity() /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -167,6 +187,7 @@ public function getSupplyChannel() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getExternalPrice() @@ -175,6 +196,7 @@ public function getExternalPrice() } /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() @@ -183,6 +205,7 @@ public function getExternalTotalPrice() } /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() @@ -191,6 +214,7 @@ public function getShippingDetails() } /** + * @return null|DateTimeImmutable */ public function getAddedAt() diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionModel.php index e94afe9140a..541551466ad 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddLineItemActionModel.php @@ -34,66 +34,79 @@ final class MyCartAddLineItemActionModel extends JsonObjectModel implements MyCa { public const DISCRIMINATOR_VALUE = 'addLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?ChannelResourceIdentifier */ protected $distributionChannel; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; /** + * * @var ?string */ protected $productId; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?int */ protected $quantity; /** + * * @var ?ChannelResourceIdentifier */ protected $supplyChannel; /** + * * @var ?Money */ protected $externalPrice; /** + * * @var ?ExternalLineItemTotalPrice */ protected $externalTotalPrice; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; /** + * * @var ?DateTimeImmutable */ protected $addedAt; @@ -114,7 +127,8 @@ public function __construct( ?Money $externalPrice = null, ?ExternalLineItemTotalPrice $externalTotalPrice = null, ?ItemShippingDetailsDraft $shippingDetails = null, - ?DateTimeImmutable $addedAt = null + ?DateTimeImmutable $addedAt = null, + ?string $action = null ) { $this->custom = $custom; $this->distributionChannel = $distributionChannel; @@ -128,10 +142,11 @@ public function __construct( $this->externalTotalPrice = $externalTotalPrice; $this->shippingDetails = $shippingDetails; $this->addedAt = $addedAt; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -151,6 +166,7 @@ public function getAction() /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -171,6 +187,7 @@ public function getCustom() /** *

    ResourceIdentifier to a Channel.

    * + * * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() @@ -189,6 +206,7 @@ public function getDistributionChannel() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() @@ -207,6 +225,7 @@ public function getExternalTaxRate() } /** + * * @return null|string */ public function getProductId() @@ -224,6 +243,7 @@ public function getProductId() } /** + * * @return null|int */ public function getVariantId() @@ -241,6 +261,7 @@ public function getVariantId() } /** + * * @return null|string */ public function getSku() @@ -258,6 +279,7 @@ public function getSku() } /** + * * @return null|int */ public function getQuantity() @@ -277,6 +299,7 @@ public function getQuantity() /** *

    ResourceIdentifier to a Channel.

    * + * * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -298,6 +321,7 @@ public function getSupplyChannel() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * * @return null|Money */ public function getExternalPrice() @@ -316,6 +340,7 @@ public function getExternalPrice() } /** + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() @@ -334,6 +359,7 @@ public function getExternalTotalPrice() } /** + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() @@ -352,6 +378,7 @@ public function getShippingDetails() } /** + * * @return null|DateTimeImmutable */ public function getAddedAt() diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddPaymentAction.php b/lib/commercetools-api/src/Models/Me/MyCartAddPaymentAction.php index 48f3bf349b5..44a433ce34c 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddPaymentAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddPaymentAction.php @@ -19,6 +19,7 @@ interface MyCartAddPaymentAction extends MyCartUpdateAction /** *

    ResourceIdentifier to a Payment.

    * + * @return null|PaymentResourceIdentifier */ public function getPayment(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddPaymentActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartAddPaymentActionBuilder.php index ed690794f70..5802a295b62 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddPaymentActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddPaymentActionBuilder.php @@ -23,6 +23,7 @@ final class MyCartAddPaymentActionBuilder implements Builder { /** + * @var null|PaymentResourceIdentifier|PaymentResourceIdentifierBuilder */ private $payment; @@ -30,6 +31,7 @@ final class MyCartAddPaymentActionBuilder implements Builder /** *

    ResourceIdentifier to a Payment.

    * + * @return null|PaymentResourceIdentifier */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Me/MyCartAddPaymentActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartAddPaymentActionModel.php index 2d1ed15274f..ac1e30cc9f1 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartAddPaymentActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartAddPaymentActionModel.php @@ -23,11 +23,13 @@ final class MyCartAddPaymentActionModel extends JsonObjectModel implements MyCar { public const DISCRIMINATOR_VALUE = 'addPayment'; /** + * * @var ?string */ protected $action; /** + * * @var ?PaymentResourceIdentifier */ protected $payment; @@ -37,13 +39,15 @@ final class MyCartAddPaymentActionModel extends JsonObjectModel implements MyCar * @psalm-suppress MissingParamType */ public function __construct( - ?PaymentResourceIdentifier $payment = null + ?PaymentResourceIdentifier $payment = null, + ?string $action = null ) { $this->payment = $payment; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    ResourceIdentifier to a Payment.

    * + * * @return null|PaymentResourceIdentifier */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsAction.php b/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsAction.php index 6b44c478e94..2d91178a78d 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsAction.php @@ -18,11 +18,13 @@ interface MyCartApplyDeltaToLineItemShippingDetailsTargetsAction extends MyCartU public const FIELD_TARGETS_DELTA = 'targetsDelta'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|ItemShippingTargetCollection */ public function getTargetsDelta(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder.php index bb7cef29685..2323de34bbc 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder.php @@ -22,16 +22,19 @@ final class MyCartApplyDeltaToLineItemShippingDetailsTargetsActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?ItemShippingTargetCollection */ private $targetsDelta; /** + * @return null|string */ public function getLineItemId() @@ -40,6 +43,7 @@ public function getLineItemId() } /** + * @return null|ItemShippingTargetCollection */ public function getTargetsDelta() diff --git a/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsActionModel.php index 11203447d11..5090bd93773 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartApplyDeltaToLineItemShippingDetailsTargetsActionModel.php @@ -22,16 +22,19 @@ final class MyCartApplyDeltaToLineItemShippingDetailsTargetsActionModel extends { public const DISCRIMINATOR_VALUE = 'applyDeltaToLineItemShippingDetailsTargets'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ItemShippingTargetCollection */ protected $targetsDelta; @@ -42,14 +45,16 @@ final class MyCartApplyDeltaToLineItemShippingDetailsTargetsActionModel extends */ public function __construct( ?string $lineItemId = null, - ?ItemShippingTargetCollection $targetsDelta = null + ?ItemShippingTargetCollection $targetsDelta = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->targetsDelta = $targetsDelta; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -67,6 +72,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -84,6 +90,7 @@ public function getLineItemId() } /** + * * @return null|ItemShippingTargetCollection */ public function getTargetsDelta() diff --git a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityAction.php b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityAction.php index 1419c948cde..c633cf04725 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityAction.php @@ -21,11 +21,13 @@ interface MyCartChangeLineItemQuantityAction extends MyCartUpdateAction public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|int */ public function getQuantity(); @@ -34,11 +36,13 @@ public function getQuantity(); *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getExternalPrice(); /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionBuilder.php index 97f28d248f7..6bf5ab656cf 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionBuilder.php @@ -25,26 +25,31 @@ final class MyCartChangeLineItemQuantityActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?int */ private $quantity; /** + * @var null|Money|MoneyBuilder */ private $externalPrice; /** + * @var null|ExternalLineItemTotalPrice|ExternalLineItemTotalPriceBuilder */ private $externalTotalPrice; /** + * @return null|string */ public function getLineItemId() @@ -53,6 +58,7 @@ public function getLineItemId() } /** + * @return null|int */ public function getQuantity() @@ -64,6 +70,7 @@ public function getQuantity() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getExternalPrice() @@ -72,6 +79,7 @@ public function getExternalPrice() } /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() diff --git a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionModel.php index af4a49d89e8..4ead2c52220 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionModel.php @@ -25,26 +25,31 @@ final class MyCartChangeLineItemQuantityActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'changeLineItemQuantity'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?int */ protected $quantity; /** + * * @var ?Money */ protected $externalPrice; /** + * * @var ?ExternalLineItemTotalPrice */ protected $externalTotalPrice; @@ -57,16 +62,18 @@ public function __construct( ?string $lineItemId = null, ?int $quantity = null, ?Money $externalPrice = null, - ?ExternalLineItemTotalPrice $externalTotalPrice = null + ?ExternalLineItemTotalPrice $externalTotalPrice = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->quantity = $quantity; $this->externalPrice = $externalPrice; $this->externalTotalPrice = $externalTotalPrice; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -84,6 +91,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -101,6 +109,7 @@ public function getLineItemId() } /** + * * @return null|int */ public function getQuantity() @@ -121,6 +130,7 @@ public function getQuantity() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * * @return null|Money */ public function getExternalPrice() @@ -139,6 +149,7 @@ public function getExternalPrice() } /** + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() diff --git a/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeAction.php b/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeAction.php index 528a8343662..4840ce16b89 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeAction.php @@ -16,6 +16,7 @@ interface MyCartChangeTaxModeAction extends MyCartUpdateAction public const FIELD_TAX_MODE = 'taxMode'; /** + * @return null|string */ public function getTaxMode(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeActionBuilder.php index f1744196e35..481ad75da3e 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeActionBuilder.php @@ -21,11 +21,13 @@ final class MyCartChangeTaxModeActionBuilder implements Builder { /** + * @var ?string */ private $taxMode; /** + * @return null|string */ public function getTaxMode() diff --git a/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeActionModel.php index 19ea9e3d88f..f567c1ef2c8 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartChangeTaxModeActionModel.php @@ -21,11 +21,13 @@ final class MyCartChangeTaxModeActionModel extends JsonObjectModel implements My { public const DISCRIMINATOR_VALUE = 'changeTaxMode'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $taxMode; @@ -35,13 +37,15 @@ final class MyCartChangeTaxModeActionModel extends JsonObjectModel implements My * @psalm-suppress MissingParamType */ public function __construct( - ?string $taxMode = null + ?string $taxMode = null, + ?string $action = null ) { $this->taxMode = $taxMode; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getTaxMode() diff --git a/lib/commercetools-api/src/Models/Me/MyCartDraft.php b/lib/commercetools-api/src/Models/Me/MyCartDraft.php index 41196aeb641..76019d58d8c 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartDraft.php +++ b/lib/commercetools-api/src/Models/Me/MyCartDraft.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\Me; -use Commercetools\Api\Models\Cart\DiscountCodeInfoCollection; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressCollection; use Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifier; @@ -32,17 +32,20 @@ interface MyCartDraft extends JsonObject public const FIELD_TAX_MODE = 'taxMode'; public const FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION = 'deleteDaysAfterLastModification'; public const FIELD_ITEM_SHIPPING_ADDRESSES = 'itemShippingAddresses'; + public const FIELD_BUSINESS_UNIT = 'businessUnit'; public const FIELD_STORE = 'store'; public const FIELD_DISCOUNT_CODES = 'discountCodes'; /** *

    A three-digit currency code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCurrency(); /** + * @return null|string */ public function getCustomerEmail(); @@ -50,6 +53,7 @@ public function getCustomerEmail(); /** *

    A two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry(); @@ -57,26 +61,31 @@ public function getCountry(); /** *

    Default inventory mode is None.

    * + * @return null|string */ public function getInventoryMode(); /** + * @return null|MyLineItemDraftCollection */ public function getLineItems(); /** + * @return null|BaseAddress */ public function getShippingAddress(); /** + * @return null|BaseAddress */ public function getBillingAddress(); /** + * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod(); @@ -84,11 +93,13 @@ public function getShippingMethod(); /** *

    The custom fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); /** + * @return null|string */ public function getLocale(); @@ -96,6 +107,7 @@ public function getLocale(); /** *

    The TaxMode Disabled can not be set on the My Carts endpoint.

    * + * @return null|string */ public function getTaxMode(); @@ -104,6 +116,7 @@ public function getTaxMode(); *

    The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState. * If a ChangeSubscription for carts exists, a ResourceDeleted notification will be sent.

    * + * @return null|int */ public function getDeleteDaysAfterLastModification(); @@ -112,19 +125,32 @@ public function getDeleteDaysAfterLastModification(); *

    Contains addresses for orders with multiple shipping addresses. * Each address must contain a key which is unique in this cart.

    * + * @return null|BaseAddressCollection */ public function getItemShippingAddresses(); + /** + *

    The BusinessUnit the cart will belong to.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit(); + /** *

    Reference to a Store by its key.

    * + * @return null|StoreKeyReference */ public function getStore(); /** - * @return null|DiscountCodeInfoCollection + *

    The code of existing DiscountCodes.

    + * + + * @return null|array */ public function getDiscountCodes(); @@ -193,13 +219,18 @@ public function setDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModi */ public function setItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses): void; + /** + * @param ?BusinessUnitKeyReference $businessUnit + */ + public function setBusinessUnit(?BusinessUnitKeyReference $businessUnit): void; + /** * @param ?StoreKeyReference $store */ public function setStore(?StoreKeyReference $store): void; /** - * @param ?DiscountCodeInfoCollection $discountCodes + * @param ?array $discountCodes */ - public function setDiscountCodes(?DiscountCodeInfoCollection $discountCodes): void; + public function setDiscountCodes(?array $discountCodes): void; } diff --git a/lib/commercetools-api/src/Models/Me/MyCartDraftBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartDraftBuilder.php index 7d6051e1f60..8ece2de7952 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartDraftBuilder.php @@ -8,7 +8,8 @@ namespace Commercetools\Api\Models\Me; -use Commercetools\Api\Models\Cart\DiscountCodeInfoCollection; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceBuilder; use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressBuilder; use Commercetools\Api\Models\Common\BaseAddressCollection; @@ -31,83 +32,105 @@ final class MyCartDraftBuilder implements Builder { /** + * @var ?string */ private $currency; /** + * @var ?string */ private $customerEmail; /** + * @var ?string */ private $country; /** + * @var ?string */ private $inventoryMode; /** + * @var ?MyLineItemDraftCollection */ private $lineItems; /** + * @var null|BaseAddress|BaseAddressBuilder */ private $shippingAddress; /** + * @var null|BaseAddress|BaseAddressBuilder */ private $billingAddress; /** + * @var null|ShippingMethodResourceIdentifier|ShippingMethodResourceIdentifierBuilder */ private $shippingMethod; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var ?string */ private $locale; /** + * @var ?string */ private $taxMode; /** + * @var ?int */ private $deleteDaysAfterLastModification; /** + * @var ?BaseAddressCollection */ private $itemShippingAddresses; /** + + * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + */ + private $businessUnit; + + /** + * @var null|StoreKeyReference|StoreKeyReferenceBuilder */ private $store; /** - * @var ?DiscountCodeInfoCollection + + * @var ?array */ private $discountCodes; /** *

    A three-digit currency code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCurrency() @@ -116,6 +139,7 @@ public function getCurrency() } /** + * @return null|string */ public function getCustomerEmail() @@ -126,6 +150,7 @@ public function getCustomerEmail() /** *

    A two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry() @@ -136,6 +161,7 @@ public function getCountry() /** *

    Default inventory mode is None.

    * + * @return null|string */ public function getInventoryMode() @@ -144,6 +170,7 @@ public function getInventoryMode() } /** + * @return null|MyLineItemDraftCollection */ public function getLineItems() @@ -152,6 +179,7 @@ public function getLineItems() } /** + * @return null|BaseAddress */ public function getShippingAddress() @@ -160,6 +188,7 @@ public function getShippingAddress() } /** + * @return null|BaseAddress */ public function getBillingAddress() @@ -168,6 +197,7 @@ public function getBillingAddress() } /** + * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod() @@ -178,6 +208,7 @@ public function getShippingMethod() /** *

    The custom fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -186,6 +217,7 @@ public function getCustom() } /** + * @return null|string */ public function getLocale() @@ -196,6 +228,7 @@ public function getLocale() /** *

    The TaxMode Disabled can not be set on the My Carts endpoint.

    * + * @return null|string */ public function getTaxMode() @@ -207,6 +240,7 @@ public function getTaxMode() *

    The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState. * If a ChangeSubscription for carts exists, a ResourceDeleted notification will be sent.

    * + * @return null|int */ public function getDeleteDaysAfterLastModification() @@ -218,6 +252,7 @@ public function getDeleteDaysAfterLastModification() *

    Contains addresses for orders with multiple shipping addresses. * Each address must contain a key which is unique in this cart.

    * + * @return null|BaseAddressCollection */ public function getItemShippingAddresses() @@ -225,9 +260,21 @@ public function getItemShippingAddresses() return $this->itemShippingAddresses; } + /** + *

    The BusinessUnit the cart will belong to.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit() + { + return $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit; + } + /** *

    Reference to a Store by its key.

    * + * @return null|StoreKeyReference */ public function getStore() @@ -236,7 +283,10 @@ public function getStore() } /** - * @return null|DiscountCodeInfoCollection + *

    The code of existing DiscountCodes.

    + * + + * @return null|array */ public function getDiscountCodes() { @@ -386,6 +436,17 @@ public function withItemShippingAddresses(?BaseAddressCollection $itemShippingAd return $this; } + /** + * @param ?BusinessUnitKeyReference $businessUnit + * @return $this + */ + public function withBusinessUnit(?BusinessUnitKeyReference $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + /** * @param ?StoreKeyReference $store * @return $this @@ -398,10 +459,10 @@ public function withStore(?StoreKeyReference $store) } /** - * @param ?DiscountCodeInfoCollection $discountCodes + * @param ?array $discountCodes * @return $this */ - public function withDiscountCodes(?DiscountCodeInfoCollection $discountCodes) + public function withDiscountCodes(?array $discountCodes) { $this->discountCodes = $discountCodes; @@ -452,6 +513,17 @@ public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) return $this; } + /** + * @deprecated use withBusinessUnit() instead + * @return $this + */ + public function withBusinessUnitBuilder(?BusinessUnitKeyReferenceBuilder $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + /** * @deprecated use withStore() instead * @return $this @@ -479,6 +551,7 @@ public function build(): MyCartDraft $this->taxMode, $this->deleteDaysAfterLastModification, $this->itemShippingAddresses, + $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit, $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store, $this->discountCodes ); diff --git a/lib/commercetools-api/src/Models/Me/MyCartDraftModel.php b/lib/commercetools-api/src/Models/Me/MyCartDraftModel.php index c74e19a9387..a79a488fd74 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartDraftModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartDraftModel.php @@ -8,7 +8,8 @@ namespace Commercetools\Api\Models\Me; -use Commercetools\Api\Models\Cart\DiscountCodeInfoCollection; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceModel; use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressCollection; use Commercetools\Api\Models\Common\BaseAddressModel; @@ -30,77 +31,98 @@ final class MyCartDraftModel extends JsonObjectModel implements MyCartDraft { /** + * * @var ?string */ protected $currency; /** + * * @var ?string */ protected $customerEmail; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $inventoryMode; /** + * * @var ?MyLineItemDraftCollection */ protected $lineItems; /** + * * @var ?BaseAddress */ protected $shippingAddress; /** + * * @var ?BaseAddress */ protected $billingAddress; /** + * * @var ?ShippingMethodResourceIdentifier */ protected $shippingMethod; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?string */ protected $locale; /** + * * @var ?string */ protected $taxMode; /** + * * @var ?int */ protected $deleteDaysAfterLastModification; /** + * * @var ?BaseAddressCollection */ protected $itemShippingAddresses; /** + * + * @var ?BusinessUnitKeyReference + */ + protected $businessUnit; + + /** + * * @var ?StoreKeyReference */ protected $store; /** - * @var ?DiscountCodeInfoCollection + * + * @var ?array */ protected $discountCodes; @@ -122,8 +144,9 @@ public function __construct( ?string $taxMode = null, ?int $deleteDaysAfterLastModification = null, ?BaseAddressCollection $itemShippingAddresses = null, + ?BusinessUnitKeyReference $businessUnit = null, ?StoreKeyReference $store = null, - ?DiscountCodeInfoCollection $discountCodes = null + ?array $discountCodes = null ) { $this->currency = $currency; $this->customerEmail = $customerEmail; @@ -138,6 +161,7 @@ public function __construct( $this->taxMode = $taxMode; $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; $this->itemShippingAddresses = $itemShippingAddresses; + $this->businessUnit = $businessUnit; $this->store = $store; $this->discountCodes = $discountCodes; } @@ -145,6 +169,7 @@ public function __construct( /** *

    A three-digit currency code as per ISO 3166-1 alpha-2.

    * + * * @return null|string */ public function getCurrency() @@ -162,6 +187,7 @@ public function getCurrency() } /** + * * @return null|string */ public function getCustomerEmail() @@ -181,6 +207,7 @@ public function getCustomerEmail() /** *

    A two-digit country code as per ISO 3166-1 alpha-2.

    * + * * @return null|string */ public function getCountry() @@ -200,6 +227,7 @@ public function getCountry() /** *

    Default inventory mode is None.

    * + * * @return null|string */ public function getInventoryMode() @@ -217,6 +245,7 @@ public function getInventoryMode() } /** + * * @return null|MyLineItemDraftCollection */ public function getLineItems() @@ -234,6 +263,7 @@ public function getLineItems() } /** + * * @return null|BaseAddress */ public function getShippingAddress() @@ -252,6 +282,7 @@ public function getShippingAddress() } /** + * * @return null|BaseAddress */ public function getBillingAddress() @@ -270,6 +301,7 @@ public function getBillingAddress() } /** + * * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod() @@ -290,6 +322,7 @@ public function getShippingMethod() /** *

    The custom fields.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -308,6 +341,7 @@ public function getCustom() } /** + * * @return null|string */ public function getLocale() @@ -327,6 +361,7 @@ public function getLocale() /** *

    The TaxMode Disabled can not be set on the My Carts endpoint.

    * + * * @return null|string */ public function getTaxMode() @@ -347,6 +382,7 @@ public function getTaxMode() *

    The cart will be deleted automatically if it hasn't been modified for the specified amount of days and it is in the Active CartState. * If a ChangeSubscription for carts exists, a ResourceDeleted notification will be sent.

    * + * * @return null|int */ public function getDeleteDaysAfterLastModification() @@ -367,6 +403,7 @@ public function getDeleteDaysAfterLastModification() *

    Contains addresses for orders with multiple shipping addresses. * Each address must contain a key which is unique in this cart.

    * + * * @return null|BaseAddressCollection */ public function getItemShippingAddresses() @@ -383,9 +420,31 @@ public function getItemShippingAddresses() return $this->itemShippingAddresses; } + /** + *

    The BusinessUnit the cart will belong to.

    + * + * + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit() + { + if (is_null($this->businessUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BUSINESS_UNIT); + if (is_null($data)) { + return null; + } + + $this->businessUnit = BusinessUnitKeyReferenceModel::of($data); + } + + return $this->businessUnit; + } + /** *

    Reference to a Store by its key.

    * + * * @return null|StoreKeyReference */ public function getStore() @@ -404,17 +463,20 @@ public function getStore() } /** - * @return null|DiscountCodeInfoCollection + *

    The code of existing DiscountCodes.

    + * + * + * @return null|array */ public function getDiscountCodes() { if (is_null($this->discountCodes)) { - /** @psalm-var ?list $data */ + /** @psalm-var ?list $data */ $data = $this->raw(self::FIELD_DISCOUNT_CODES); if (is_null($data)) { return null; } - $this->discountCodes = DiscountCodeInfoCollection::fromArray($data); + $this->discountCodes = $data; } return $this->discountCodes; @@ -525,6 +587,14 @@ public function setItemShippingAddresses(?BaseAddressCollection $itemShippingAdd $this->itemShippingAddresses = $itemShippingAddresses; } + /** + * @param ?BusinessUnitKeyReference $businessUnit + */ + public function setBusinessUnit(?BusinessUnitKeyReference $businessUnit): void + { + $this->businessUnit = $businessUnit; + } + /** * @param ?StoreKeyReference $store */ @@ -534,9 +604,9 @@ public function setStore(?StoreKeyReference $store): void } /** - * @param ?DiscountCodeInfoCollection $discountCodes + * @param ?array $discountCodes */ - public function setDiscountCodes(?DiscountCodeInfoCollection $discountCodes): void + public function setDiscountCodes(?array $discountCodes): void { $this->discountCodes = $discountCodes; } diff --git a/lib/commercetools-api/src/Models/Me/MyCartRecalculateAction.php b/lib/commercetools-api/src/Models/Me/MyCartRecalculateAction.php index 2a40763bbf7..b21d6b6f5c0 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRecalculateAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRecalculateAction.php @@ -16,6 +16,7 @@ interface MyCartRecalculateAction extends MyCartUpdateAction public const FIELD_UPDATE_PRODUCT_DATA = 'updateProductData'; /** + * @return null|bool */ public function getUpdateProductData(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartRecalculateActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartRecalculateActionBuilder.php index 27e7f7b5be0..4aeb2ea6ef9 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRecalculateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRecalculateActionBuilder.php @@ -21,11 +21,13 @@ final class MyCartRecalculateActionBuilder implements Builder { /** + * @var ?bool */ private $updateProductData; /** + * @return null|bool */ public function getUpdateProductData() diff --git a/lib/commercetools-api/src/Models/Me/MyCartRecalculateActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartRecalculateActionModel.php index 1aa3c268d7a..99a90078215 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRecalculateActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRecalculateActionModel.php @@ -21,11 +21,13 @@ final class MyCartRecalculateActionModel extends JsonObjectModel implements MyCa { public const DISCRIMINATOR_VALUE = 'recalculate'; /** + * * @var ?string */ protected $action; /** + * * @var ?bool */ protected $updateProductData; @@ -35,13 +37,15 @@ final class MyCartRecalculateActionModel extends JsonObjectModel implements MyCa * @psalm-suppress MissingParamType */ public function __construct( - ?bool $updateProductData = null + ?bool $updateProductData = null, + ?string $action = null ) { $this->updateProductData = $updateProductData; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|bool */ public function getUpdateProductData() diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeAction.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeAction.php index 9243b42a5f3..c9e5a1978de 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeAction.php @@ -19,6 +19,7 @@ interface MyCartRemoveDiscountCodeAction extends MyCartUpdateAction /** *

    Reference to a DiscountCode.

    * + * @return null|DiscountCodeReference */ public function getDiscountCode(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeActionBuilder.php index 5cc1d8c55af..7eab60a608b 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeActionBuilder.php @@ -23,6 +23,7 @@ final class MyCartRemoveDiscountCodeActionBuilder implements Builder { /** + * @var null|DiscountCodeReference|DiscountCodeReferenceBuilder */ private $discountCode; @@ -30,6 +31,7 @@ final class MyCartRemoveDiscountCodeActionBuilder implements Builder /** *

    Reference to a DiscountCode.

    * + * @return null|DiscountCodeReference */ public function getDiscountCode() diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeActionModel.php index 121ae1d7fcf..58eabe3f7b6 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveDiscountCodeActionModel.php @@ -23,11 +23,13 @@ final class MyCartRemoveDiscountCodeActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'removeDiscountCode'; /** + * * @var ?string */ protected $action; /** + * * @var ?DiscountCodeReference */ protected $discountCode; @@ -37,13 +39,15 @@ final class MyCartRemoveDiscountCodeActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?DiscountCodeReference $discountCode = null + ?DiscountCodeReference $discountCode = null, + ?string $action = null ) { $this->discountCode = $discountCode; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Reference to a DiscountCode.

    * + * * @return null|DiscountCodeReference */ public function getDiscountCode() diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressAction.php index ab9672a330f..f47f1ba1af9 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressAction.php @@ -16,6 +16,7 @@ interface MyCartRemoveItemShippingAddressAction extends MyCartUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressActionBuilder.php index 804ca3b16f8..503b86c73b5 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressActionBuilder.php @@ -21,11 +21,13 @@ final class MyCartRemoveItemShippingAddressActionBuilder implements Builder { /** + * @var ?string */ private $addressKey; /** + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressActionModel.php index 6947794ec84..5295ce5e0c6 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveItemShippingAddressActionModel.php @@ -21,11 +21,13 @@ final class MyCartRemoveItemShippingAddressActionModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'removeItemShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressKey; @@ -35,13 +37,15 @@ final class MyCartRemoveItemShippingAddressActionModel extends JsonObjectModel i * @psalm-suppress MissingParamType */ public function __construct( - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemAction.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemAction.php index a801e12c468..a7687340fc3 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemAction.php @@ -23,11 +23,13 @@ interface MyCartRemoveLineItemAction extends MyCartUpdateAction public const FIELD_SHIPPING_DETAILS_TO_REMOVE = 'shippingDetailsToRemove'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|int */ public function getQuantity(); @@ -36,16 +38,19 @@ public function getQuantity(); *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getExternalPrice(); /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetailsToRemove(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemActionBuilder.php index 2f4b04c3bdd..9b5dde43a11 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemActionBuilder.php @@ -27,31 +27,37 @@ final class MyCartRemoveLineItemActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?int */ private $quantity; /** + * @var null|Money|MoneyBuilder */ private $externalPrice; /** + * @var null|ExternalLineItemTotalPrice|ExternalLineItemTotalPriceBuilder */ private $externalTotalPrice; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetailsToRemove; /** + * @return null|string */ public function getLineItemId() @@ -60,6 +66,7 @@ public function getLineItemId() } /** + * @return null|int */ public function getQuantity() @@ -71,6 +78,7 @@ public function getQuantity() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getExternalPrice() @@ -79,6 +87,7 @@ public function getExternalPrice() } /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() @@ -87,6 +96,7 @@ public function getExternalTotalPrice() } /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetailsToRemove() diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemActionModel.php index d5717a165d7..3491e7f1b65 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemoveLineItemActionModel.php @@ -27,31 +27,37 @@ final class MyCartRemoveLineItemActionModel extends JsonObjectModel implements M { public const DISCRIMINATOR_VALUE = 'removeLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?int */ protected $quantity; /** + * * @var ?Money */ protected $externalPrice; /** + * * @var ?ExternalLineItemTotalPrice */ protected $externalTotalPrice; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetailsToRemove; @@ -65,17 +71,19 @@ public function __construct( ?int $quantity = null, ?Money $externalPrice = null, ?ExternalLineItemTotalPrice $externalTotalPrice = null, - ?ItemShippingDetailsDraft $shippingDetailsToRemove = null + ?ItemShippingDetailsDraft $shippingDetailsToRemove = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->quantity = $quantity; $this->externalPrice = $externalPrice; $this->externalTotalPrice = $externalTotalPrice; $this->shippingDetailsToRemove = $shippingDetailsToRemove; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -93,6 +101,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -110,6 +119,7 @@ public function getLineItemId() } /** + * * @return null|int */ public function getQuantity() @@ -130,6 +140,7 @@ public function getQuantity() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * * @return null|Money */ public function getExternalPrice() @@ -148,6 +159,7 @@ public function getExternalPrice() } /** + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() @@ -166,6 +178,7 @@ public function getExternalTotalPrice() } /** + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetailsToRemove() diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentAction.php b/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentAction.php index 22432ef4a87..e2dcf9d5a5b 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentAction.php @@ -19,6 +19,7 @@ interface MyCartRemovePaymentAction extends MyCartUpdateAction /** *

    ResourceIdentifier to a Payment.

    * + * @return null|PaymentResourceIdentifier */ public function getPayment(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentActionBuilder.php index 049277b8929..be39f45ba60 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentActionBuilder.php @@ -23,6 +23,7 @@ final class MyCartRemovePaymentActionBuilder implements Builder { /** + * @var null|PaymentResourceIdentifier|PaymentResourceIdentifierBuilder */ private $payment; @@ -30,6 +31,7 @@ final class MyCartRemovePaymentActionBuilder implements Builder /** *

    ResourceIdentifier to a Payment.

    * + * @return null|PaymentResourceIdentifier */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentActionModel.php index 0822d2cedb4..64525d0e16f 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartRemovePaymentActionModel.php @@ -23,11 +23,13 @@ final class MyCartRemovePaymentActionModel extends JsonObjectModel implements My { public const DISCRIMINATOR_VALUE = 'removePayment'; /** + * * @var ?string */ protected $action; /** + * * @var ?PaymentResourceIdentifier */ protected $payment; @@ -37,13 +39,15 @@ final class MyCartRemovePaymentActionModel extends JsonObjectModel implements My * @psalm-suppress MissingParamType */ public function __construct( - ?PaymentResourceIdentifier $payment = null + ?PaymentResourceIdentifier $payment = null, + ?string $action = null ) { $this->payment = $payment; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    ResourceIdentifier to a Payment.

    * + * * @return null|PaymentResourceIdentifier */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressAction.php index cc8a5857553..82e6ddb1b51 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressAction.php @@ -17,6 +17,7 @@ interface MyCartSetBillingAddressAction extends MyCartUpdateAction public const FIELD_ADDRESS = 'address'; /** + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionBuilder.php index a7ed360ce76..d1b2d7768be 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionBuilder.php @@ -23,11 +23,13 @@ final class MyCartSetBillingAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionModel.php index 437dc7a42b8..50d510ee3f9 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetBillingAddressActionModel.php @@ -23,11 +23,13 @@ final class MyCartSetBillingAddressActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'setBillingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -37,13 +39,15 @@ final class MyCartSetBillingAddressActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCountryAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetCountryAction.php index 8b33c8d94b9..09d9e715d93 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCountryAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCountryAction.php @@ -18,6 +18,7 @@ interface MyCartSetCountryAction extends MyCartUpdateAction /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCountryActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetCountryActionBuilder.php index 28e95fab3cd..591f0d3be47 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCountryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCountryActionBuilder.php @@ -21,6 +21,7 @@ final class MyCartSetCountryActionBuilder implements Builder { /** + * @var ?string */ private $country; @@ -28,6 +29,7 @@ final class MyCartSetCountryActionBuilder implements Builder /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCountryActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetCountryActionModel.php index 1c60492b8e5..44ddfe423ba 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCountryActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCountryActionModel.php @@ -21,11 +21,13 @@ final class MyCartSetCountryActionModel extends JsonObjectModel implements MyCar { public const DISCRIMINATOR_VALUE = 'setCountry'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $country; @@ -35,13 +37,15 @@ final class MyCartSetCountryActionModel extends JsonObjectModel implements MyCar * @psalm-suppress MissingParamType */ public function __construct( - ?string $country = null + ?string $country = null, + ?string $action = null ) { $this->country = $country; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * * @return null|string */ public function getCountry() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCustomFieldAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetCustomFieldAction.php index 1ba7cca075c..3c356341070 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface MyCartSetCustomFieldAction extends MyCartUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetCustomFieldActionBuilder.php index b9fcb14a86c..070ac7af0b0 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class MyCartSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class MyCartSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetCustomFieldActionModel.php index 99de19b9abb..21c5ccbe6c2 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class MyCartSetCustomFieldActionModel extends JsonObjectModel implements M { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class MyCartSetCustomFieldActionModel extends JsonObjectModel implements M */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeAction.php index 8f587415384..e52799b887c 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface MyCartSetCustomTypeAction extends MyCartUpdateAction *

    Defines the Type that extends the MyCart with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the MyCart.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the MyCart.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeActionBuilder.php index 511e19e9d4f..333ef2068f6 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class MyCartSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class MyCartSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the MyCart with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the MyCart.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the MyCart.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeActionModel.php index 16a2bd7ca7b..45a84f226b2 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class MyCartSetCustomTypeActionModel extends JsonObjectModel implements My { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class MyCartSetCustomTypeActionModel extends JsonObjectModel implements My */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the MyCart with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the MyCart.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the MyCart.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailAction.php index 1e839b741f6..ff7efd284c7 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailAction.php @@ -16,6 +16,7 @@ interface MyCartSetCustomerEmailAction extends MyCartUpdateAction public const FIELD_EMAIL = 'email'; /** + * @return null|string */ public function getEmail(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailActionBuilder.php index 0a4e4ab1a58..1abbff87064 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailActionBuilder.php @@ -21,11 +21,13 @@ final class MyCartSetCustomerEmailActionBuilder implements Builder { /** + * @var ?string */ private $email; /** + * @return null|string */ public function getEmail() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailActionModel.php index 78d1561dd6c..e4b720f13ff 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetCustomerEmailActionModel.php @@ -21,11 +21,13 @@ final class MyCartSetCustomerEmailActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setCustomerEmail'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $email; @@ -35,13 +37,15 @@ final class MyCartSetCustomerEmailActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $email = null + ?string $email = null, + ?string $action = null ) { $this->email = $email; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getEmail() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationAction.php index fd3beea52c3..c31d6c95644 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationAction.php @@ -16,6 +16,7 @@ interface MyCartSetDeleteDaysAfterLastModificationAction extends MyCartUpdateAct public const FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION = 'deleteDaysAfterLastModification'; /** + * @return null|int */ public function getDeleteDaysAfterLastModification(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationActionBuilder.php index 8948b884c5c..2e856d4c629 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationActionBuilder.php @@ -21,11 +21,13 @@ final class MyCartSetDeleteDaysAfterLastModificationActionBuilder implements Builder { /** + * @var ?int */ private $deleteDaysAfterLastModification; /** + * @return null|int */ public function getDeleteDaysAfterLastModification() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationActionModel.php index 2bb3f6039aa..b09bfc03304 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetDeleteDaysAfterLastModificationActionModel.php @@ -21,11 +21,13 @@ final class MyCartSetDeleteDaysAfterLastModificationActionModel extends JsonObje { public const DISCRIMINATOR_VALUE = 'setDeleteDaysAfterLastModification'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $deleteDaysAfterLastModification; @@ -35,13 +37,15 @@ final class MyCartSetDeleteDaysAfterLastModificationActionModel extends JsonObje * @psalm-suppress MissingParamType */ public function __construct( - ?int $deleteDaysAfterLastModification = null + ?int $deleteDaysAfterLastModification = null, + ?string $action = null ) { $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|int */ public function getDeleteDaysAfterLastModification() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldAction.php index 53f0107ca71..86b6e1e98ee 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldAction.php @@ -18,6 +18,7 @@ interface MyCartSetLineItemCustomFieldAction extends MyCartUpdateAction public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getLineItemId(); @@ -25,6 +26,7 @@ public function getLineItemId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -34,6 +36,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldActionBuilder.php index c965bf7b1cd..91dd9c35b4a 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class MyCartSetLineItemCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getLineItemId() @@ -46,6 +50,7 @@ public function getLineItemId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -58,6 +63,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldActionModel.php index 5a5d0462708..7d3849479e3 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class MyCartSetLineItemCustomFieldActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setLineItemCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class MyCartSetLineItemCustomFieldActionModel extends JsonObjectModel impl public function __construct( ?string $lineItemId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -92,6 +99,7 @@ public function getLineItemId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -113,6 +121,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeAction.php index 4b5ab83ebd5..0e7d84a6bf9 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeAction.php @@ -20,6 +20,7 @@ interface MyCartSetLineItemCustomTypeAction extends MyCartUpdateAction public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getLineItemId(); @@ -28,6 +29,7 @@ public function getLineItemId(); *

    Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -35,6 +37,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the LineItem.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeActionBuilder.php index 04beeceb715..f07e13a7953 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class MyCartSetLineItemCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getLineItemId() @@ -51,6 +55,7 @@ public function getLineItemId() *

    Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -61,6 +66,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the LineItem.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeActionModel.php index 0a90b060df2..b1b088bd92f 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemCustomTypeActionModel.php @@ -25,21 +25,25 @@ final class MyCartSetLineItemCustomTypeActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setLineItemCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -51,15 +55,17 @@ final class MyCartSetLineItemCustomTypeActionModel extends JsonObjectModel imple public function __construct( ?string $lineItemId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -97,6 +104,7 @@ public function getLineItemId() *

    Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the LineItem.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelAction.php index ce330a4751b..db0215a9a87 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelAction.php @@ -18,6 +18,7 @@ interface MyCartSetLineItemDistributionChannelAction extends MyCartUpdateAction public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; /** + * @return null|string */ public function getLineItemId(); @@ -25,6 +26,7 @@ public function getLineItemId(); /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelActionBuilder.php index 3fdde1eb6cf..205152bf2a9 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelActionBuilder.php @@ -23,16 +23,19 @@ final class MyCartSetLineItemDistributionChannelActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $distributionChannel; /** + * @return null|string */ public function getLineItemId() @@ -43,6 +46,7 @@ public function getLineItemId() /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelActionModel.php index 8d0ad4a8b24..a1110b7b220 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemDistributionChannelActionModel.php @@ -23,16 +23,19 @@ final class MyCartSetLineItemDistributionChannelActionModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'setLineItemDistributionChannel'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ChannelResourceIdentifier */ protected $distributionChannel; @@ -43,14 +46,16 @@ final class MyCartSetLineItemDistributionChannelActionModel extends JsonObjectMo */ public function __construct( ?string $lineItemId = null, - ?ChannelResourceIdentifier $distributionChannel = null + ?ChannelResourceIdentifier $distributionChannel = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->distributionChannel = $distributionChannel; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -87,6 +93,7 @@ public function getLineItemId() /** *

    ResourceIdentifier to a Channel.

    * + * * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsAction.php index a48405e2873..d95908de315 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsAction.php @@ -18,11 +18,13 @@ interface MyCartSetLineItemShippingDetailsAction extends MyCartUpdateAction public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsActionBuilder.php index 26060970e89..f2df0770070 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsActionBuilder.php @@ -23,16 +23,19 @@ final class MyCartSetLineItemShippingDetailsActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetails; /** + * @return null|string */ public function getLineItemId() @@ -41,6 +44,7 @@ public function getLineItemId() } /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsActionModel.php index 6611f396ff1..91f754f7b32 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemShippingDetailsActionModel.php @@ -23,16 +23,19 @@ final class MyCartSetLineItemShippingDetailsActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setLineItemShippingDetails'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; @@ -43,14 +46,16 @@ final class MyCartSetLineItemShippingDetailsActionModel extends JsonObjectModel */ public function __construct( ?string $lineItemId = null, - ?ItemShippingDetailsDraft $shippingDetails = null + ?ItemShippingDetailsDraft $shippingDetails = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->shippingDetails = $shippingDetails; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -85,6 +91,7 @@ public function getLineItemId() } /** + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelAction.php index cd7e982e70c..5f2d65d0811 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelAction.php @@ -18,6 +18,7 @@ interface MyCartSetLineItemSupplyChannelAction extends MyCartUpdateAction public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; /** + * @return null|string */ public function getLineItemId(); @@ -25,6 +26,7 @@ public function getLineItemId(); /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelActionBuilder.php index ff5f5e5adbe..8dbfdd0eacc 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelActionBuilder.php @@ -23,16 +23,19 @@ final class MyCartSetLineItemSupplyChannelActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $supplyChannel; /** + * @return null|string */ public function getLineItemId() @@ -43,6 +46,7 @@ public function getLineItemId() /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelActionModel.php index 8398bc6b6c5..91c22991bf9 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLineItemSupplyChannelActionModel.php @@ -23,16 +23,19 @@ final class MyCartSetLineItemSupplyChannelActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'setLineItemSupplyChannel'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ChannelResourceIdentifier */ protected $supplyChannel; @@ -43,14 +46,16 @@ final class MyCartSetLineItemSupplyChannelActionModel extends JsonObjectModel im */ public function __construct( ?string $lineItemId = null, - ?ChannelResourceIdentifier $supplyChannel = null + ?ChannelResourceIdentifier $supplyChannel = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->supplyChannel = $supplyChannel; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -87,6 +93,7 @@ public function getLineItemId() /** *

    ResourceIdentifier to a Channel.

    * + * * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLocaleAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetLocaleAction.php index c6facc2eba7..478c2948133 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLocaleAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLocaleAction.php @@ -16,6 +16,7 @@ interface MyCartSetLocaleAction extends MyCartUpdateAction public const FIELD_LOCALE = 'locale'; /** + * @return null|string */ public function getLocale(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLocaleActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetLocaleActionBuilder.php index 07be158df28..4a68a561ddb 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLocaleActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLocaleActionBuilder.php @@ -21,11 +21,13 @@ final class MyCartSetLocaleActionBuilder implements Builder { /** + * @var ?string */ private $locale; /** + * @return null|string */ public function getLocale() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetLocaleActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetLocaleActionModel.php index d871ba82138..23bbab7ec8d 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetLocaleActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetLocaleActionModel.php @@ -21,11 +21,13 @@ final class MyCartSetLocaleActionModel extends JsonObjectModel implements MyCart { public const DISCRIMINATOR_VALUE = 'setLocale'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $locale; @@ -35,13 +37,15 @@ final class MyCartSetLocaleActionModel extends JsonObjectModel implements MyCart * @psalm-suppress MissingParamType */ public function __construct( - ?string $locale = null + ?string $locale = null, + ?string $action = null ) { $this->locale = $locale; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getLocale() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressAction.php index b3b1fb49b86..fc10f4ec40a 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressAction.php @@ -17,6 +17,7 @@ interface MyCartSetShippingAddressAction extends MyCartUpdateAction public const FIELD_ADDRESS = 'address'; /** + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionBuilder.php index beca61c9289..ffe1ac59781 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionBuilder.php @@ -23,11 +23,13 @@ final class MyCartSetShippingAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionModel.php index 07c30db022c..28d22c8845e 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetShippingAddressActionModel.php @@ -23,11 +23,13 @@ final class MyCartSetShippingAddressActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'setShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -37,13 +39,15 @@ final class MyCartSetShippingAddressActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodAction.php b/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodAction.php index c5088600359..f534d969137 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodAction.php @@ -21,11 +21,13 @@ interface MyCartSetShippingMethodAction extends MyCartUpdateAction /** *

    ResourceIdentifier to a ShippingMethod.

    * + * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod(); /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodActionBuilder.php index 59dad04e57c..e09c164fb98 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodActionBuilder.php @@ -25,11 +25,13 @@ final class MyCartSetShippingMethodActionBuilder implements Builder { /** + * @var null|ShippingMethodResourceIdentifier|ShippingMethodResourceIdentifierBuilder */ private $shippingMethod; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; @@ -37,6 +39,7 @@ final class MyCartSetShippingMethodActionBuilder implements Builder /** *

    ResourceIdentifier to a ShippingMethod.

    * + * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod() @@ -45,6 +48,7 @@ public function getShippingMethod() } /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodActionModel.php index 18a52b6e87c..47254b24d19 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartSetShippingMethodActionModel.php @@ -25,16 +25,19 @@ final class MyCartSetShippingMethodActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'setShippingMethod'; /** + * * @var ?string */ protected $action; /** + * * @var ?ShippingMethodResourceIdentifier */ protected $shippingMethod; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; @@ -45,14 +48,16 @@ final class MyCartSetShippingMethodActionModel extends JsonObjectModel implement */ public function __construct( ?ShippingMethodResourceIdentifier $shippingMethod = null, - ?ExternalTaxRateDraft $externalTaxRate = null + ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $action = null ) { $this->shippingMethod = $shippingMethod; $this->externalTaxRate = $externalTaxRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -72,6 +77,7 @@ public function getAction() /** *

    ResourceIdentifier to a ShippingMethod.

    * + * * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod() @@ -90,6 +96,7 @@ public function getShippingMethod() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdate.php b/lib/commercetools-api/src/Models/Me/MyCartUpdate.php index 0c8f6e15677..41fc903e3b8 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdate.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdate.php @@ -17,11 +17,13 @@ interface MyCartUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + * @return null|int */ public function getVersion(); /** + * @return null|MyCartUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdateAction.php b/lib/commercetools-api/src/Models/Me/MyCartUpdateAction.php index 85f65cc3d38..502016e2c4d 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdateAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdateAction.php @@ -17,6 +17,7 @@ interface MyCartUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdateActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartUpdateActionModel.php index 54f0362f7c5..d1ee2a8e256 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdateActionModel.php @@ -21,6 +21,7 @@ final class MyCartUpdateActionModel extends JsonObjectModel implements MyCartUpd { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -63,11 +64,13 @@ final class MyCartUpdateActionModel extends JsonObjectModel implements MyCartUpd * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdateBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartUpdateBuilder.php index dd530fdbe1f..834929576f0 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdateBuilder.php @@ -21,16 +21,19 @@ final class MyCartUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?MyCartUpdateActionCollection */ private $actions; /** + * @return null|int */ public function getVersion() @@ -39,6 +42,7 @@ public function getVersion() } /** + * @return null|MyCartUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressAction.php index bc4f30676a4..cba027812e8 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressAction.php @@ -17,6 +17,7 @@ interface MyCartUpdateItemShippingAddressAction extends MyCartUpdateAction public const FIELD_ADDRESS = 'address'; /** + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionBuilder.php index c58b9b2f21e..fe378251dc4 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionBuilder.php @@ -23,11 +23,13 @@ final class MyCartUpdateItemShippingAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionModel.php index 5f8106e03a7..cc0855d394e 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdateItemShippingAddressActionModel.php @@ -23,11 +23,13 @@ final class MyCartUpdateItemShippingAddressActionModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'updateItemShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -37,13 +39,15 @@ final class MyCartUpdateItemShippingAddressActionModel extends JsonObjectModel i * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Me/MyCartUpdateModel.php b/lib/commercetools-api/src/Models/Me/MyCartUpdateModel.php index 7e0dc747e72..68b62136636 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartUpdateModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartUpdateModel.php @@ -20,11 +20,13 @@ final class MyCartUpdateModel extends JsonObjectModel implements MyCartUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?MyCartUpdateActionCollection */ protected $actions; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|int */ public function getVersion() @@ -59,6 +62,7 @@ public function getVersion() } /** + * * @return null|MyCartUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Me/MyCompanyDraft.php b/lib/commercetools-api/src/Models/Me/MyCompanyDraft.php new file mode 100644 index 00000000000..acf05278bcb --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyCompanyDraft.php @@ -0,0 +1,16 @@ + + */ +final class MyCompanyDraftBuilder implements Builder +{ + /** + + * @var ?string + */ + private $key; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var ?string + */ + private $contactEmail; + + /** + + * @var null|CustomFields|CustomFieldsBuilder + */ + private $custom; + + /** + + * @var ?BaseAddressCollection + */ + private $addresses; + + /** + + * @var ?array + */ + private $shippingAddresses; + + /** + + * @var ?int + */ + private $defaultShipingAddress; + + /** + + * @var ?array + */ + private $billingAddresses; + + /** + + * @var ?int + */ + private $defaultBillingAddress; + + /** + *

    User-defined unique identifier for the BusinessUnit.

    + * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + *

    Name of the Business Unit.

    + * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

    Email address of the Business Unit.

    + * + + * @return null|string + */ + public function getContactEmail() + { + return $this->contactEmail; + } + + /** + *

    Custom Fields for the Business Unit.

    + * + + * @return null|CustomFields + */ + public function getCustom() + { + return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; + } + + /** + *

    Addresses used by the Business Unit.

    + * + + * @return null|BaseAddressCollection + */ + public function getAddresses() + { + return $this->addresses; + } + + /** + *

    Indexes of entries in addresses to set as shipping addresses. + * The shippingAddressIds of the Customer will be replaced by these addresses.

    + * + + * @return null|array + */ + public function getShippingAddresses() + { + return $this->shippingAddresses; + } + + /** + *

    Index of the entry in addresses to set as the default shipping address.

    + * + + * @return null|int + */ + public function getDefaultShipingAddress() + { + return $this->defaultShipingAddress; + } + + /** + *

    Indexes of entries in addresses to set as billing addresses. + * The billingAddressIds of the Customer will be replaced by these addresses.

    + * + + * @return null|array + */ + public function getBillingAddresses() + { + return $this->billingAddresses; + } + + /** + *

    Index of the entry in addresses to set as the default billing address.

    + * + + * @return null|int + */ + public function getDefaultBillingAddress() + { + return $this->defaultBillingAddress; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param ?string $contactEmail + * @return $this + */ + public function withContactEmail(?string $contactEmail) + { + $this->contactEmail = $contactEmail; + + return $this; + } + + /** + * @param ?CustomFields $custom + * @return $this + */ + public function withCustom(?CustomFields $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @param ?BaseAddressCollection $addresses + * @return $this + */ + public function withAddresses(?BaseAddressCollection $addresses) + { + $this->addresses = $addresses; + + return $this; + } + + /** + * @param ?array $shippingAddresses + * @return $this + */ + public function withShippingAddresses(?array $shippingAddresses) + { + $this->shippingAddresses = $shippingAddresses; + + return $this; + } + + /** + * @param ?int $defaultShipingAddress + * @return $this + */ + public function withDefaultShipingAddress(?int $defaultShipingAddress) + { + $this->defaultShipingAddress = $defaultShipingAddress; + + return $this; + } + + /** + * @param ?array $billingAddresses + * @return $this + */ + public function withBillingAddresses(?array $billingAddresses) + { + $this->billingAddresses = $billingAddresses; + + return $this; + } + + /** + * @param ?int $defaultBillingAddress + * @return $this + */ + public function withDefaultBillingAddress(?int $defaultBillingAddress) + { + $this->defaultBillingAddress = $defaultBillingAddress; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + + public function build(): MyCompanyDraft + { + return new MyCompanyDraftModel( + $this->key, + $this->name, + $this->contactEmail, + $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, + $this->addresses, + $this->shippingAddresses, + $this->defaultShipingAddress, + $this->billingAddresses, + $this->defaultBillingAddress + ); + } + + public static function of(): MyCompanyDraftBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyCompanyDraftCollection.php b/lib/commercetools-api/src/Models/Me/MyCompanyDraftCollection.php new file mode 100644 index 00000000000..633c6d66db4 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyCompanyDraftCollection.php @@ -0,0 +1,56 @@ + + * @method MyCompanyDraft current() + * @method MyCompanyDraft end() + * @method MyCompanyDraft at($offset) + */ +class MyCompanyDraftCollection extends MyBusinessUnitDraftCollection +{ + /** + * @psalm-assert MyCompanyDraft $value + * @psalm-param MyCompanyDraft|stdClass $value + * @throws InvalidArgumentException + * + * @return MyCompanyDraftCollection + */ + public function add($value) + { + if (!$value instanceof MyCompanyDraft) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyCompanyDraft + */ + protected function mapper() + { + return function (?int $index): ?MyCompanyDraft { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyCompanyDraft $data */ + $data = MyCompanyDraftModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyCompanyDraftModel.php b/lib/commercetools-api/src/Models/Me/MyCompanyDraftModel.php new file mode 100644 index 00000000000..877aec15cda --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyCompanyDraftModel.php @@ -0,0 +1,389 @@ +key = $key; + $this->name = $name; + $this->contactEmail = $contactEmail; + $this->custom = $custom; + $this->addresses = $addresses; + $this->shippingAddresses = $shippingAddresses; + $this->defaultShipingAddress = $defaultShipingAddress; + $this->billingAddresses = $billingAddresses; + $this->defaultBillingAddress = $defaultBillingAddress; + $this->unitType = $unitType ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    User-defined unique identifier for the BusinessUnit.

    + * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + *

    Type of the Business Unit indicating its position in a hierarchy.

    + * + * + * @return null|string + */ + public function getUnitType() + { + if (is_null($this->unitType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_UNIT_TYPE); + if (is_null($data)) { + return null; + } + $this->unitType = (string) $data; + } + + return $this->unitType; + } + + /** + *

    Name of the Business Unit.

    + * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

    Email address of the Business Unit.

    + * + * + * @return null|string + */ + public function getContactEmail() + { + if (is_null($this->contactEmail)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CONTACT_EMAIL); + if (is_null($data)) { + return null; + } + $this->contactEmail = (string) $data; + } + + return $this->contactEmail; + } + + /** + *

    Custom Fields for the Business Unit.

    + * + * + * @return null|CustomFields + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomFieldsModel::of($data); + } + + return $this->custom; + } + + /** + *

    Addresses used by the Business Unit.

    + * + * + * @return null|BaseAddressCollection + */ + public function getAddresses() + { + if (is_null($this->addresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->addresses = BaseAddressCollection::fromArray($data); + } + + return $this->addresses; + } + + /** + *

    Indexes of entries in addresses to set as shipping addresses. + * The shippingAddressIds of the Customer will be replaced by these addresses.

    + * + * + * @return null|array + */ + public function getShippingAddresses() + { + if (is_null($this->shippingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SHIPPING_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->shippingAddresses = $data; + } + + return $this->shippingAddresses; + } + + /** + *

    Index of the entry in addresses to set as the default shipping address.

    + * + * + * @return null|int + */ + public function getDefaultShipingAddress() + { + if (is_null($this->defaultShipingAddress)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_DEFAULT_SHIPING_ADDRESS); + if (is_null($data)) { + return null; + } + $this->defaultShipingAddress = (int) $data; + } + + return $this->defaultShipingAddress; + } + + /** + *

    Indexes of entries in addresses to set as billing addresses. + * The billingAddressIds of the Customer will be replaced by these addresses.

    + * + * + * @return null|array + */ + public function getBillingAddresses() + { + if (is_null($this->billingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_BILLING_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->billingAddresses = $data; + } + + return $this->billingAddresses; + } + + /** + *

    Index of the entry in addresses to set as the default billing address.

    + * + * + * @return null|int + */ + public function getDefaultBillingAddress() + { + if (is_null($this->defaultBillingAddress)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_DEFAULT_BILLING_ADDRESS); + if (is_null($data)) { + return null; + } + $this->defaultBillingAddress = (int) $data; + } + + return $this->defaultBillingAddress; + } + + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void + { + $this->contactEmail = $contactEmail; + } + + /** + * @param ?CustomFields $custom + */ + public function setCustom(?CustomFields $custom): void + { + $this->custom = $custom; + } + + /** + * @param ?BaseAddressCollection $addresses + */ + public function setAddresses(?BaseAddressCollection $addresses): void + { + $this->addresses = $addresses; + } + + /** + * @param ?array $shippingAddresses + */ + public function setShippingAddresses(?array $shippingAddresses): void + { + $this->shippingAddresses = $shippingAddresses; + } + + /** + * @param ?int $defaultShipingAddress + */ + public function setDefaultShipingAddress(?int $defaultShipingAddress): void + { + $this->defaultShipingAddress = $defaultShipingAddress; + } + + /** + * @param ?array $billingAddresses + */ + public function setBillingAddresses(?array $billingAddresses): void + { + $this->billingAddresses = $billingAddresses; + } + + /** + * @param ?int $defaultBillingAddress + */ + public function setDefaultBillingAddress(?int $defaultBillingAddress): void + { + $this->defaultBillingAddress = $defaultBillingAddress; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerAddAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerAddAddressAction.php index a81cab00f00..241ad13d765 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerAddAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerAddAddressAction.php @@ -17,6 +17,9 @@ interface MyCustomerAddAddressAction extends MyCustomerUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

    Value to append to the addresses array.

    + * + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerAddAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerAddAddressActionBuilder.php index ecab3bc9014..f6a72515595 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerAddAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerAddAddressActionBuilder.php @@ -23,11 +23,15 @@ final class MyCustomerAddAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + *

    Value to append to the addresses array.

    + * + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerAddAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerAddAddressActionModel.php index eacce85c4fd..40d76ccddb0 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerAddAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerAddAddressActionModel.php @@ -23,11 +23,13 @@ final class MyCustomerAddAddressActionModel extends JsonObjectModel implements M { public const DISCRIMINATOR_VALUE = 'addAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -37,13 +39,15 @@ final class MyCustomerAddAddressActionModel extends JsonObjectModel implements M * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,9 @@ public function getAction() } /** + *

    Value to append to the addresses array.

    + * + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerAddBillingAddressIdAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerAddBillingAddressIdAction.php index e45c1e1329f..42ffcd5e756 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerAddBillingAddressIdAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerAddBillingAddressIdAction.php @@ -17,11 +17,17 @@ interface MyCustomerAddBillingAddressIdAction extends MyCustomerUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** + *

    id of the Address to become a billing address.

    + * + * @return null|string */ public function getAddressId(); /** + *

    key of the Address to become a billing address.

    + * + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerAddBillingAddressIdActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerAddBillingAddressIdActionBuilder.php index 04f32d9266f..7805e0eda3f 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerAddBillingAddressIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerAddBillingAddressIdActionBuilder.php @@ -21,16 +21,21 @@ final class MyCustomerAddBillingAddressIdActionBuilder implements Builder { /** + * @var ?string */ private $addressId; /** + * @var ?string */ private $addressKey; /** + *

    id of the Address to become a billing address.

    + * + * @return null|string */ public function getAddressId() @@ -39,6 +44,9 @@ public function getAddressId() } /** + *

    key of the Address to become a billing address.

    + * + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerAddBillingAddressIdActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerAddBillingAddressIdActionModel.php index af06e03e7a4..2826cf0ff41 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerAddBillingAddressIdActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerAddBillingAddressIdActionModel.php @@ -21,16 +21,19 @@ final class MyCustomerAddBillingAddressIdActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'addBillingAddressId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressId; /** + * * @var ?string */ protected $addressKey; @@ -41,14 +44,16 @@ final class MyCustomerAddBillingAddressIdActionModel extends JsonObjectModel imp */ public function __construct( ?string $addressId = null, - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressId = $addressId; $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,9 @@ public function getAction() } /** + *

    id of the Address to become a billing address.

    + * + * * @return null|string */ public function getAddressId() @@ -83,6 +91,9 @@ public function getAddressId() } /** + *

    key of the Address to become a billing address.

    + * + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerAddShippingAddressIdAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerAddShippingAddressIdAction.php index f238be1dbd5..ec5fc07d9de 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerAddShippingAddressIdAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerAddShippingAddressIdAction.php @@ -17,11 +17,17 @@ interface MyCustomerAddShippingAddressIdAction extends MyCustomerUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** + *

    id of the Address to become a shipping address.

    + * + * @return null|string */ public function getAddressId(); /** + *

    key of the Address to become a shipping address.

    + * + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerAddShippingAddressIdActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerAddShippingAddressIdActionBuilder.php index 1b9075c82e9..011b5b34744 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerAddShippingAddressIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerAddShippingAddressIdActionBuilder.php @@ -21,16 +21,21 @@ final class MyCustomerAddShippingAddressIdActionBuilder implements Builder { /** + * @var ?string */ private $addressId; /** + * @var ?string */ private $addressKey; /** + *

    id of the Address to become a shipping address.

    + * + * @return null|string */ public function getAddressId() @@ -39,6 +44,9 @@ public function getAddressId() } /** + *

    key of the Address to become a shipping address.

    + * + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerAddShippingAddressIdActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerAddShippingAddressIdActionModel.php index eceba08a943..6c1909e3a00 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerAddShippingAddressIdActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerAddShippingAddressIdActionModel.php @@ -21,16 +21,19 @@ final class MyCustomerAddShippingAddressIdActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'addShippingAddressId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressId; /** + * * @var ?string */ protected $addressKey; @@ -41,14 +44,16 @@ final class MyCustomerAddShippingAddressIdActionModel extends JsonObjectModel im */ public function __construct( ?string $addressId = null, - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressId = $addressId; $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,9 @@ public function getAction() } /** + *

    id of the Address to become a shipping address.

    + * + * * @return null|string */ public function getAddressId() @@ -83,6 +91,9 @@ public function getAddressId() } /** + *

    key of the Address to become a shipping address.

    + * + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerChangeAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerChangeAddressAction.php index de90205dc0b..47034e9825f 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerChangeAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerChangeAddressAction.php @@ -19,16 +19,25 @@ interface MyCustomerChangeAddressAction extends MyCustomerUpdateAction public const FIELD_ADDRESS = 'address'; /** + *

    id of the Address to change.

    + * + * @return null|string */ public function getAddressId(); /** + *

    key of the Address to change.

    + * + * @return null|string */ public function getAddressKey(); /** + *

    Value to set.

    + * + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerChangeAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerChangeAddressActionBuilder.php index bddae4f4f8a..12563391105 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerChangeAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerChangeAddressActionBuilder.php @@ -23,21 +23,27 @@ final class MyCustomerChangeAddressActionBuilder implements Builder { /** + * @var ?string */ private $addressId; /** + * @var ?string */ private $addressKey; /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + *

    id of the Address to change.

    + * + * @return null|string */ public function getAddressId() @@ -46,6 +52,9 @@ public function getAddressId() } /** + *

    key of the Address to change.

    + * + * @return null|string */ public function getAddressKey() @@ -54,6 +63,9 @@ public function getAddressKey() } /** + *

    Value to set.

    + * + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerChangeAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerChangeAddressActionModel.php index b8c4c73206c..256f2149ab0 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerChangeAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerChangeAddressActionModel.php @@ -23,21 +23,25 @@ final class MyCustomerChangeAddressActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'changeAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressId; /** + * * @var ?string */ protected $addressKey; /** + * * @var ?BaseAddress */ protected $address; @@ -49,15 +53,17 @@ final class MyCustomerChangeAddressActionModel extends JsonObjectModel implement public function __construct( ?string $addressId = null, ?string $addressKey = null, - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->addressId = $addressId; $this->addressKey = $addressKey; $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -75,6 +81,9 @@ public function getAction() } /** + *

    id of the Address to change.

    + * + * * @return null|string */ public function getAddressId() @@ -92,6 +101,9 @@ public function getAddressId() } /** + *

    key of the Address to change.

    + * + * * @return null|string */ public function getAddressKey() @@ -109,6 +121,9 @@ public function getAddressKey() } /** + *

    Value to set.

    + * + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerChangeEmailAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerChangeEmailAction.php index 6c37c3ba634..b4f19e475cf 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerChangeEmailAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerChangeEmailAction.php @@ -16,6 +16,9 @@ interface MyCustomerChangeEmailAction extends MyCustomerUpdateAction public const FIELD_EMAIL = 'email'; /** + *

    New value to set.

    + * + * @return null|string */ public function getEmail(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerChangeEmailActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerChangeEmailActionBuilder.php index 169b15592ae..360d31f273c 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerChangeEmailActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerChangeEmailActionBuilder.php @@ -21,11 +21,15 @@ final class MyCustomerChangeEmailActionBuilder implements Builder { /** + * @var ?string */ private $email; /** + *

    New value to set.

    + * + * @return null|string */ public function getEmail() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerChangeEmailActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerChangeEmailActionModel.php index 7a0a553d4fc..bf41f663778 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerChangeEmailActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerChangeEmailActionModel.php @@ -21,11 +21,13 @@ final class MyCustomerChangeEmailActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'changeEmail'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $email; @@ -35,13 +37,15 @@ final class MyCustomerChangeEmailActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $email = null + ?string $email = null, + ?string $action = null ) { $this->email = $email; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,9 @@ public function getAction() } /** + *

    New value to set.

    + * + * * @return null|string */ public function getEmail() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerDraft.php b/lib/commercetools-api/src/Models/Me/MyCustomerDraft.php index 9798731219a..225db5b380f 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerDraft.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerDraft.php @@ -23,6 +23,7 @@ interface MyCustomerDraft extends JsonObject public const FIELD_LAST_NAME = 'lastName'; public const FIELD_MIDDLE_NAME = 'middleName'; public const FIELD_TITLE = 'title'; + public const FIELD_SALUTATION = 'salutation'; public const FIELD_DATE_OF_BIRTH = 'dateOfBirth'; public const FIELD_COMPANY_NAME = 'companyName'; public const FIELD_VAT_ID = 'vatId'; @@ -34,86 +35,132 @@ interface MyCustomerDraft extends JsonObject public const FIELD_STORES = 'stores'; /** + *

    Email address of the Customer that is unique for an entire Project or Store the Customer is assigned to. + * It is the mandatory unique identifier of a Customer.

    + * + * @return null|string */ public function getEmail(); /** + *

    Password of the Customer.

    + * + * @return null|string */ public function getPassword(); /** + *

    Given name (first name) of the Customer.

    + * + * @return null|string */ public function getFirstName(); /** + *

    Family name (last name) of the Customer.

    + * + * @return null|string */ public function getLastName(); /** + *

    Middle name of the Customer.

    + * + * @return null|string */ public function getMiddleName(); /** + *

    Title of the Customer, for example, 'Dr.'.

    + * + * @return null|string */ public function getTitle(); /** + *

    Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.

    + * + + * @return null|string + */ + public function getSalutation(); + + /** + *

    Date of birth of the Customer.

    + * + * @return null|DateTimeImmutable */ public function getDateOfBirth(); /** + *

    Company name of the Customer.

    + * + * @return null|string */ public function getCompanyName(); /** + *

    Unique VAT ID of the Customer.

    + * + * @return null|string */ public function getVatId(); /** - *

    Sets the ID of each address to be unique in the addresses list.

    + *

    Addresses of the Customer.

    * + * @return null|BaseAddressCollection */ public function getAddresses(); /** - *

    The index of the address in the addresses array. - * The defaultShippingAddressId of the customer will be set to the ID of that address.

    + *

    Index of the address in the addresses array to use as the default shipping address. + * The defaultShippingAddressId of the Customer will be set to the id of that address.

    * + * @return null|int */ public function getDefaultShippingAddress(); /** - *

    The index of the address in the addresses array. - * The defaultBillingAddressId of the customer will be set to the ID of that address.

    + *

    Index of the address in the addresses array to use as the default billing address. + * The defaultBillingAddressId of the Customer will be set to the id of that address.

    * + * @return null|int */ public function getDefaultBillingAddress(); /** - *

    The custom fields.

    + *

    Custom Fields for the Customer.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); /** + *

    Preferred language of the Customer. Must be one of the languages supported by the Project.

    + * + * @return null|string */ public function getLocale(); /** + *

    Sets the Stores for the Customer.

    + * + * @return null|StoreResourceIdentifierCollection */ public function getStores(); @@ -148,6 +195,11 @@ public function setMiddleName(?string $middleName): void; */ public function setTitle(?string $title): void; + /** + * @param ?string $salutation + */ + public function setSalutation(?string $salutation): void; + /** * @param ?DateTimeImmutable $dateOfBirth */ diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerDraftBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerDraftBuilder.php index 39332581fbe..0221f49c42c 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerDraftBuilder.php @@ -26,81 +26,106 @@ final class MyCustomerDraftBuilder implements Builder { /** + * @var ?string */ private $email; /** + * @var ?string */ private $password; /** + * @var ?string */ private $firstName; /** + * @var ?string */ private $lastName; /** + * @var ?string */ private $middleName; /** + * @var ?string */ private $title; /** + + * @var ?string + */ + private $salutation; + + /** + * @var ?DateTimeImmutable */ private $dateOfBirth; /** + * @var ?string */ private $companyName; /** + * @var ?string */ private $vatId; /** + * @var ?BaseAddressCollection */ private $addresses; /** + * @var ?int */ private $defaultShippingAddress; /** + * @var ?int */ private $defaultBillingAddress; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var ?string */ private $locale; /** + * @var ?StoreResourceIdentifierCollection */ private $stores; /** + *

    Email address of the Customer that is unique for an entire Project or Store the Customer is assigned to. + * It is the mandatory unique identifier of a Customer.

    + * + * @return null|string */ public function getEmail() @@ -109,6 +134,9 @@ public function getEmail() } /** + *

    Password of the Customer.

    + * + * @return null|string */ public function getPassword() @@ -117,6 +145,9 @@ public function getPassword() } /** + *

    Given name (first name) of the Customer.

    + * + * @return null|string */ public function getFirstName() @@ -125,6 +156,9 @@ public function getFirstName() } /** + *

    Family name (last name) of the Customer.

    + * + * @return null|string */ public function getLastName() @@ -133,6 +167,9 @@ public function getLastName() } /** + *

    Middle name of the Customer.

    + * + * @return null|string */ public function getMiddleName() @@ -141,6 +178,9 @@ public function getMiddleName() } /** + *

    Title of the Customer, for example, 'Dr.'.

    + * + * @return null|string */ public function getTitle() @@ -149,6 +189,20 @@ public function getTitle() } /** + *

    Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.

    + * + + * @return null|string + */ + public function getSalutation() + { + return $this->salutation; + } + + /** + *

    Date of birth of the Customer.

    + * + * @return null|DateTimeImmutable */ public function getDateOfBirth() @@ -157,6 +211,9 @@ public function getDateOfBirth() } /** + *

    Company name of the Customer.

    + * + * @return null|string */ public function getCompanyName() @@ -165,6 +222,9 @@ public function getCompanyName() } /** + *

    Unique VAT ID of the Customer.

    + * + * @return null|string */ public function getVatId() @@ -173,8 +233,9 @@ public function getVatId() } /** - *

    Sets the ID of each address to be unique in the addresses list.

    + *

    Addresses of the Customer.

    * + * @return null|BaseAddressCollection */ public function getAddresses() @@ -183,9 +244,10 @@ public function getAddresses() } /** - *

    The index of the address in the addresses array. - * The defaultShippingAddressId of the customer will be set to the ID of that address.

    + *

    Index of the address in the addresses array to use as the default shipping address. + * The defaultShippingAddressId of the Customer will be set to the id of that address.

    * + * @return null|int */ public function getDefaultShippingAddress() @@ -194,9 +256,10 @@ public function getDefaultShippingAddress() } /** - *

    The index of the address in the addresses array. - * The defaultBillingAddressId of the customer will be set to the ID of that address.

    + *

    Index of the address in the addresses array to use as the default billing address. + * The defaultBillingAddressId of the Customer will be set to the id of that address.

    * + * @return null|int */ public function getDefaultBillingAddress() @@ -205,8 +268,9 @@ public function getDefaultBillingAddress() } /** - *

    The custom fields.

    + *

    Custom Fields for the Customer.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -215,6 +279,9 @@ public function getCustom() } /** + *

    Preferred language of the Customer. Must be one of the languages supported by the Project.

    + * + * @return null|string */ public function getLocale() @@ -223,6 +290,9 @@ public function getLocale() } /** + *

    Sets the Stores for the Customer.

    + * + * @return null|StoreResourceIdentifierCollection */ public function getStores() @@ -296,6 +366,17 @@ public function withTitle(?string $title) return $this; } + /** + * @param ?string $salutation + * @return $this + */ + public function withSalutation(?string $salutation) + { + $this->salutation = $salutation; + + return $this; + } + /** * @param ?DateTimeImmutable $dateOfBirth * @return $this @@ -415,6 +496,7 @@ public function build(): MyCustomerDraft $this->lastName, $this->middleName, $this->title, + $this->salutation, $this->dateOfBirth, $this->companyName, $this->vatId, diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerDraftModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerDraftModel.php index 2dc1ddeda64..d72f5094a4e 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerDraftModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerDraftModel.php @@ -25,76 +25,97 @@ final class MyCustomerDraftModel extends JsonObjectModel implements MyCustomerDraft { /** + * * @var ?string */ protected $email; /** + * * @var ?string */ protected $password; /** + * * @var ?string */ protected $firstName; /** + * * @var ?string */ protected $lastName; /** + * * @var ?string */ protected $middleName; /** + * * @var ?string */ protected $title; /** + * + * @var ?string + */ + protected $salutation; + + /** + * * @var ?DateTimeImmutable */ protected $dateOfBirth; /** + * * @var ?string */ protected $companyName; /** + * * @var ?string */ protected $vatId; /** + * * @var ?BaseAddressCollection */ protected $addresses; /** + * * @var ?int */ protected $defaultShippingAddress; /** + * * @var ?int */ protected $defaultBillingAddress; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?string */ protected $locale; /** + * * @var ?StoreResourceIdentifierCollection */ protected $stores; @@ -110,6 +131,7 @@ public function __construct( ?string $lastName = null, ?string $middleName = null, ?string $title = null, + ?string $salutation = null, ?DateTimeImmutable $dateOfBirth = null, ?string $companyName = null, ?string $vatId = null, @@ -126,6 +148,7 @@ public function __construct( $this->lastName = $lastName; $this->middleName = $middleName; $this->title = $title; + $this->salutation = $salutation; $this->dateOfBirth = $dateOfBirth; $this->companyName = $companyName; $this->vatId = $vatId; @@ -138,6 +161,10 @@ public function __construct( } /** + *

    Email address of the Customer that is unique for an entire Project or Store the Customer is assigned to. + * It is the mandatory unique identifier of a Customer.

    + * + * * @return null|string */ public function getEmail() @@ -155,6 +182,9 @@ public function getEmail() } /** + *

    Password of the Customer.

    + * + * * @return null|string */ public function getPassword() @@ -172,6 +202,9 @@ public function getPassword() } /** + *

    Given name (first name) of the Customer.

    + * + * * @return null|string */ public function getFirstName() @@ -189,6 +222,9 @@ public function getFirstName() } /** + *

    Family name (last name) of the Customer.

    + * + * * @return null|string */ public function getLastName() @@ -206,6 +242,9 @@ public function getLastName() } /** + *

    Middle name of the Customer.

    + * + * * @return null|string */ public function getMiddleName() @@ -223,6 +262,9 @@ public function getMiddleName() } /** + *

    Title of the Customer, for example, 'Dr.'.

    + * + * * @return null|string */ public function getTitle() @@ -240,6 +282,29 @@ public function getTitle() } /** + *

    Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.

    + * + * + * @return null|string + */ + public function getSalutation() + { + if (is_null($this->salutation)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SALUTATION); + if (is_null($data)) { + return null; + } + $this->salutation = (string) $data; + } + + return $this->salutation; + } + + /** + *

    Date of birth of the Customer.

    + * + * * @return null|DateTimeImmutable */ public function getDateOfBirth() @@ -261,6 +326,9 @@ public function getDateOfBirth() } /** + *

    Company name of the Customer.

    + * + * * @return null|string */ public function getCompanyName() @@ -278,6 +346,9 @@ public function getCompanyName() } /** + *

    Unique VAT ID of the Customer.

    + * + * * @return null|string */ public function getVatId() @@ -295,7 +366,8 @@ public function getVatId() } /** - *

    Sets the ID of each address to be unique in the addresses list.

    + *

    Addresses of the Customer.

    + * * * @return null|BaseAddressCollection */ @@ -314,8 +386,9 @@ public function getAddresses() } /** - *

    The index of the address in the addresses array. - * The defaultShippingAddressId of the customer will be set to the ID of that address.

    + *

    Index of the address in the addresses array to use as the default shipping address. + * The defaultShippingAddressId of the Customer will be set to the id of that address.

    + * * * @return null|int */ @@ -334,8 +407,9 @@ public function getDefaultShippingAddress() } /** - *

    The index of the address in the addresses array. - * The defaultBillingAddressId of the customer will be set to the ID of that address.

    + *

    Index of the address in the addresses array to use as the default billing address. + * The defaultBillingAddressId of the Customer will be set to the id of that address.

    + * * * @return null|int */ @@ -354,7 +428,8 @@ public function getDefaultBillingAddress() } /** - *

    The custom fields.

    + *

    Custom Fields for the Customer.

    + * * * @return null|CustomFieldsDraft */ @@ -374,6 +449,9 @@ public function getCustom() } /** + *

    Preferred language of the Customer. Must be one of the languages supported by the Project.

    + * + * * @return null|string */ public function getLocale() @@ -391,6 +469,9 @@ public function getLocale() } /** + *

    Sets the Stores for the Customer.

    + * + * * @return null|StoreResourceIdentifierCollection */ public function getStores() @@ -456,6 +537,14 @@ public function setTitle(?string $title): void $this->title = $title; } + /** + * @param ?string $salutation + */ + public function setSalutation(?string $salutation): void + { + $this->salutation = $salutation; + } + /** * @param ?DateTimeImmutable $dateOfBirth */ diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveAddressAction.php index 8552e23274b..d0a11156725 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveAddressAction.php @@ -17,11 +17,17 @@ interface MyCustomerRemoveAddressAction extends MyCustomerUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** + *

    id of the Address to remove.

    + * + * @return null|string */ public function getAddressId(); /** + *

    key of the Address to remove.

    + * + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveAddressActionBuilder.php index c8cfe066f55..959f3eb00b7 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveAddressActionBuilder.php @@ -21,16 +21,21 @@ final class MyCustomerRemoveAddressActionBuilder implements Builder { /** + * @var ?string */ private $addressId; /** + * @var ?string */ private $addressKey; /** + *

    id of the Address to remove.

    + * + * @return null|string */ public function getAddressId() @@ -39,6 +44,9 @@ public function getAddressId() } /** + *

    key of the Address to remove.

    + * + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveAddressActionModel.php index 859042582ef..9c5b9e80bdf 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveAddressActionModel.php @@ -21,16 +21,19 @@ final class MyCustomerRemoveAddressActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'removeAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressId; /** + * * @var ?string */ protected $addressKey; @@ -41,14 +44,16 @@ final class MyCustomerRemoveAddressActionModel extends JsonObjectModel implement */ public function __construct( ?string $addressId = null, - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressId = $addressId; $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,9 @@ public function getAction() } /** + *

    id of the Address to remove.

    + * + * * @return null|string */ public function getAddressId() @@ -83,6 +91,9 @@ public function getAddressId() } /** + *

    key of the Address to remove.

    + * + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveBillingAddressIdAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveBillingAddressIdAction.php index 55ab081d161..f12116301bc 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveBillingAddressIdAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveBillingAddressIdAction.php @@ -17,11 +17,17 @@ interface MyCustomerRemoveBillingAddressIdAction extends MyCustomerUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** + *

    id of the Address to remove from billingAddressesIds.

    + * + * @return null|string */ public function getAddressId(); /** + *

    key of the Address to remove from billingAddressesIds.

    + * + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveBillingAddressIdActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveBillingAddressIdActionBuilder.php index 71fbfd8427a..7239031436c 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveBillingAddressIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveBillingAddressIdActionBuilder.php @@ -21,16 +21,21 @@ final class MyCustomerRemoveBillingAddressIdActionBuilder implements Builder { /** + * @var ?string */ private $addressId; /** + * @var ?string */ private $addressKey; /** + *

    id of the Address to remove from billingAddressesIds.

    + * + * @return null|string */ public function getAddressId() @@ -39,6 +44,9 @@ public function getAddressId() } /** + *

    key of the Address to remove from billingAddressesIds.

    + * + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveBillingAddressIdActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveBillingAddressIdActionModel.php index 9a21e185d06..770405313b1 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveBillingAddressIdActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveBillingAddressIdActionModel.php @@ -21,16 +21,19 @@ final class MyCustomerRemoveBillingAddressIdActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'removeBillingAddressId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressId; /** + * * @var ?string */ protected $addressKey; @@ -41,14 +44,16 @@ final class MyCustomerRemoveBillingAddressIdActionModel extends JsonObjectModel */ public function __construct( ?string $addressId = null, - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressId = $addressId; $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,9 @@ public function getAction() } /** + *

    id of the Address to remove from billingAddressesIds.

    + * + * * @return null|string */ public function getAddressId() @@ -83,6 +91,9 @@ public function getAddressId() } /** + *

    key of the Address to remove from billingAddressesIds.

    + * + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveShippingAddressIdAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveShippingAddressIdAction.php index 806b7524b19..56f3154239c 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveShippingAddressIdAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveShippingAddressIdAction.php @@ -17,11 +17,17 @@ interface MyCustomerRemoveShippingAddressIdAction extends MyCustomerUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** + *

    id of the Address to remove from shippingAddressesIds.

    + * + * @return null|string */ public function getAddressId(); /** + *

    key of the Address to remove from shippingAddressesIds.

    + * + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveShippingAddressIdActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveShippingAddressIdActionBuilder.php index e476ba3de8a..fa9edc72b87 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveShippingAddressIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveShippingAddressIdActionBuilder.php @@ -21,16 +21,21 @@ final class MyCustomerRemoveShippingAddressIdActionBuilder implements Builder { /** + * @var ?string */ private $addressId; /** + * @var ?string */ private $addressKey; /** + *

    id of the Address to remove from shippingAddressesIds.

    + * + * @return null|string */ public function getAddressId() @@ -39,6 +44,9 @@ public function getAddressId() } /** + *

    key of the Address to remove from shippingAddressesIds.

    + * + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveShippingAddressIdActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveShippingAddressIdActionModel.php index a1070173fa9..e05ca08045e 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerRemoveShippingAddressIdActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerRemoveShippingAddressIdActionModel.php @@ -21,16 +21,19 @@ final class MyCustomerRemoveShippingAddressIdActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'removeShippingAddressId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressId; /** + * * @var ?string */ protected $addressKey; @@ -41,14 +44,16 @@ final class MyCustomerRemoveShippingAddressIdActionModel extends JsonObjectModel */ public function __construct( ?string $addressId = null, - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressId = $addressId; $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,9 @@ public function getAction() } /** + *

    id of the Address to remove from shippingAddressesIds.

    + * + * * @return null|string */ public function getAddressId() @@ -83,6 +91,9 @@ public function getAddressId() } /** + *

    key of the Address to remove from shippingAddressesIds.

    + * + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetCompanyNameAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetCompanyNameAction.php index a88f261f787..79902b8b31a 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetCompanyNameAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetCompanyNameAction.php @@ -16,6 +16,10 @@ interface MyCustomerSetCompanyNameAction extends MyCustomerUpdateAction public const FIELD_COMPANY_NAME = 'companyName'; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * @return null|string */ public function getCompanyName(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetCompanyNameActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetCompanyNameActionBuilder.php index 2f7ea3e7578..45728046fe6 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetCompanyNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetCompanyNameActionBuilder.php @@ -21,11 +21,16 @@ final class MyCustomerSetCompanyNameActionBuilder implements Builder { /** + * @var ?string */ private $companyName; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * @return null|string */ public function getCompanyName() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetCompanyNameActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetCompanyNameActionModel.php index 3b2d4bfe1da..ad35c780bb5 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetCompanyNameActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetCompanyNameActionModel.php @@ -21,11 +21,13 @@ final class MyCustomerSetCompanyNameActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'setCompanyName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $companyName; @@ -35,13 +37,15 @@ final class MyCustomerSetCompanyNameActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?string $companyName = null + ?string $companyName = null, + ?string $action = null ) { $this->companyName = $companyName; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,10 @@ public function getAction() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * * @return null|string */ public function getCompanyName() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomFieldAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomFieldAction.php index 84966a462b4..c398b769596 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomFieldAction.php @@ -19,15 +19,17 @@ interface MyCustomerSetCustomFieldAction extends MyCustomerUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); /** *

    If value is absent or null, this field will be removed if it exists. - * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomFieldActionBuilder.php index ef2d0caad29..92a0af743fc 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class MyCustomerSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class MyCustomerSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -42,9 +45,10 @@ public function getName() /** *

    If value is absent or null, this field will be removed if it exists. - * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomFieldActionModel.php index 1ba29e28937..08780810cc5 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class MyCustomerSetCustomFieldActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class MyCustomerSetCustomFieldActionModel extends JsonObjectModel implemen */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -86,9 +92,10 @@ public function getName() /** *

    If value is absent or null, this field will be removed if it exists. - * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomTypeAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomTypeAction.php index d7e7536337d..15a7ba0d3a5 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface MyCustomerSetCustomTypeAction extends MyCustomerUpdateAction *

    Defines the Type that extends the MyCustomer with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the MyCustomer.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the MyCustomer.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomTypeActionBuilder.php index 6fb661a6488..c2e565a2f75 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class MyCustomerSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class MyCustomerSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the MyCustomer with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the MyCustomer.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the MyCustomer.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomTypeActionModel.php index 9285fe8f82b..8f3c5f8ea19 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class MyCustomerSetCustomTypeActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class MyCustomerSetCustomTypeActionModel extends JsonObjectModel implement */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the MyCustomer with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the MyCustomer.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the MyCustomer.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetDateOfBirthAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetDateOfBirthAction.php index fe2bd2ddb95..3b5fdf495c1 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetDateOfBirthAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetDateOfBirthAction.php @@ -17,6 +17,10 @@ interface MyCustomerSetDateOfBirthAction extends MyCustomerUpdateAction public const FIELD_DATE_OF_BIRTH = 'dateOfBirth'; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * @return null|DateTimeImmutable */ public function getDateOfBirth(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetDateOfBirthActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetDateOfBirthActionBuilder.php index f649db47e72..370aaf8aa25 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetDateOfBirthActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetDateOfBirthActionBuilder.php @@ -22,11 +22,16 @@ final class MyCustomerSetDateOfBirthActionBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $dateOfBirth; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * @return null|DateTimeImmutable */ public function getDateOfBirth() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetDateOfBirthActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetDateOfBirthActionModel.php index 9e13aa93179..d8053050144 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetDateOfBirthActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetDateOfBirthActionModel.php @@ -22,11 +22,13 @@ final class MyCustomerSetDateOfBirthActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'setDateOfBirth'; /** + * * @var ?string */ protected $action; /** + * * @var ?DateTimeImmutable */ protected $dateOfBirth; @@ -36,13 +38,15 @@ final class MyCustomerSetDateOfBirthActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutable $dateOfBirth = null + ?DateTimeImmutable $dateOfBirth = null, + ?string $action = null ) { $this->dateOfBirth = $dateOfBirth; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -60,6 +64,10 @@ public function getAction() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * * @return null|DateTimeImmutable */ public function getDateOfBirth() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultBillingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultBillingAddressAction.php index c232c0815ba..bb3df3e6714 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultBillingAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultBillingAddressAction.php @@ -17,11 +17,17 @@ interface MyCustomerSetDefaultBillingAddressAction extends MyCustomerUpdateActio public const FIELD_ADDRESS_KEY = 'addressKey'; /** + *

    id of the Address to become the default billing address.

    + * + * @return null|string */ public function getAddressId(); /** + *

    key of the Address to become the default billing address.

    + * + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultBillingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultBillingAddressActionBuilder.php index c8cea6edf70..067dad4e132 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultBillingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultBillingAddressActionBuilder.php @@ -21,16 +21,21 @@ final class MyCustomerSetDefaultBillingAddressActionBuilder implements Builder { /** + * @var ?string */ private $addressId; /** + * @var ?string */ private $addressKey; /** + *

    id of the Address to become the default billing address.

    + * + * @return null|string */ public function getAddressId() @@ -39,6 +44,9 @@ public function getAddressId() } /** + *

    key of the Address to become the default billing address.

    + * + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultBillingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultBillingAddressActionModel.php index 594038d6425..81fb0ff5014 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultBillingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultBillingAddressActionModel.php @@ -21,16 +21,19 @@ final class MyCustomerSetDefaultBillingAddressActionModel extends JsonObjectMode { public const DISCRIMINATOR_VALUE = 'setDefaultBillingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressId; /** + * * @var ?string */ protected $addressKey; @@ -41,14 +44,16 @@ final class MyCustomerSetDefaultBillingAddressActionModel extends JsonObjectMode */ public function __construct( ?string $addressId = null, - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressId = $addressId; $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,9 @@ public function getAction() } /** + *

    id of the Address to become the default billing address.

    + * + * * @return null|string */ public function getAddressId() @@ -83,6 +91,9 @@ public function getAddressId() } /** + *

    key of the Address to become the default billing address.

    + * + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultShippingAddressAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultShippingAddressAction.php index 25396e2fc7e..e74d523f4be 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultShippingAddressAction.php @@ -17,11 +17,17 @@ interface MyCustomerSetDefaultShippingAddressAction extends MyCustomerUpdateActi public const FIELD_ADDRESS_KEY = 'addressKey'; /** + *

    id of the Address to become the default shipping address.

    + * + * @return null|string */ public function getAddressId(); /** + *

    key of the Address to become the default shipping address.

    + * + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultShippingAddressActionBuilder.php index 3350271c073..86e6f89a3db 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultShippingAddressActionBuilder.php @@ -21,16 +21,21 @@ final class MyCustomerSetDefaultShippingAddressActionBuilder implements Builder { /** + * @var ?string */ private $addressId; /** + * @var ?string */ private $addressKey; /** + *

    id of the Address to become the default shipping address.

    + * + * @return null|string */ public function getAddressId() @@ -39,6 +44,9 @@ public function getAddressId() } /** + *

    key of the Address to become the default shipping address.

    + * + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultShippingAddressActionModel.php index cfe66af678a..78c9038e06d 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetDefaultShippingAddressActionModel.php @@ -21,16 +21,19 @@ final class MyCustomerSetDefaultShippingAddressActionModel extends JsonObjectMod { public const DISCRIMINATOR_VALUE = 'setDefaultShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressId; /** + * * @var ?string */ protected $addressKey; @@ -41,14 +44,16 @@ final class MyCustomerSetDefaultShippingAddressActionModel extends JsonObjectMod */ public function __construct( ?string $addressId = null, - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressId = $addressId; $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,9 @@ public function getAction() } /** + *

    id of the Address to become the default shipping address.

    + * + * * @return null|string */ public function getAddressId() @@ -83,6 +91,9 @@ public function getAddressId() } /** + *

    key of the Address to become the default shipping address.

    + * + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetFirstNameAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetFirstNameAction.php index 8627ed18c2b..75b09af450c 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetFirstNameAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetFirstNameAction.php @@ -16,6 +16,10 @@ interface MyCustomerSetFirstNameAction extends MyCustomerUpdateAction public const FIELD_FIRST_NAME = 'firstName'; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * @return null|string */ public function getFirstName(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetFirstNameActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetFirstNameActionBuilder.php index 6c0729c693d..19bcabda0a2 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetFirstNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetFirstNameActionBuilder.php @@ -21,11 +21,16 @@ final class MyCustomerSetFirstNameActionBuilder implements Builder { /** + * @var ?string */ private $firstName; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * @return null|string */ public function getFirstName() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetFirstNameActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetFirstNameActionModel.php index 6485d26728d..889758ac281 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetFirstNameActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetFirstNameActionModel.php @@ -21,11 +21,13 @@ final class MyCustomerSetFirstNameActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setFirstName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $firstName; @@ -35,13 +37,15 @@ final class MyCustomerSetFirstNameActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $firstName = null + ?string $firstName = null, + ?string $action = null ) { $this->firstName = $firstName; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,10 @@ public function getAction() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * * @return null|string */ public function getFirstName() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetLastNameAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetLastNameAction.php index d1ad0a8dabe..fbb4207d98b 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetLastNameAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetLastNameAction.php @@ -16,6 +16,10 @@ interface MyCustomerSetLastNameAction extends MyCustomerUpdateAction public const FIELD_LAST_NAME = 'lastName'; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * @return null|string */ public function getLastName(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetLastNameActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetLastNameActionBuilder.php index 9f87f97fb79..a4511fa0650 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetLastNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetLastNameActionBuilder.php @@ -21,11 +21,16 @@ final class MyCustomerSetLastNameActionBuilder implements Builder { /** + * @var ?string */ private $lastName; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * @return null|string */ public function getLastName() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetLastNameActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetLastNameActionModel.php index af4f3bbff46..e0e5a3c5218 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetLastNameActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetLastNameActionModel.php @@ -21,11 +21,13 @@ final class MyCustomerSetLastNameActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setLastName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lastName; @@ -35,13 +37,15 @@ final class MyCustomerSetLastNameActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $lastName = null + ?string $lastName = null, + ?string $action = null ) { $this->lastName = $lastName; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,10 @@ public function getAction() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * * @return null|string */ public function getLastName() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetLocaleAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetLocaleAction.php index 76ff964e0f8..57a019dd461 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetLocaleAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetLocaleAction.php @@ -16,6 +16,10 @@ interface MyCustomerSetLocaleAction extends MyCustomerUpdateAction public const FIELD_LOCALE = 'locale'; /** + *

    Value to set. + * Must be one of the languages supported by the Project.

    + * + * @return null|string */ public function getLocale(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetLocaleActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetLocaleActionBuilder.php index 1efb1fe0bdd..d9411566764 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetLocaleActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetLocaleActionBuilder.php @@ -21,11 +21,16 @@ final class MyCustomerSetLocaleActionBuilder implements Builder { /** + * @var ?string */ private $locale; /** + *

    Value to set. + * Must be one of the languages supported by the Project.

    + * + * @return null|string */ public function getLocale() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetLocaleActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetLocaleActionModel.php index 372c45b3bcc..3cc0ac1a43e 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetLocaleActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetLocaleActionModel.php @@ -21,11 +21,13 @@ final class MyCustomerSetLocaleActionModel extends JsonObjectModel implements My { public const DISCRIMINATOR_VALUE = 'setLocale'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $locale; @@ -35,13 +37,15 @@ final class MyCustomerSetLocaleActionModel extends JsonObjectModel implements My * @psalm-suppress MissingParamType */ public function __construct( - ?string $locale = null + ?string $locale = null, + ?string $action = null ) { $this->locale = $locale; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,10 @@ public function getAction() } /** + *

    Value to set. + * Must be one of the languages supported by the Project.

    + * + * * @return null|string */ public function getLocale() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetMiddleNameAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetMiddleNameAction.php index 3fd47e30868..249b88adc70 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetMiddleNameAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetMiddleNameAction.php @@ -16,6 +16,10 @@ interface MyCustomerSetMiddleNameAction extends MyCustomerUpdateAction public const FIELD_MIDDLE_NAME = 'middleName'; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * @return null|string */ public function getMiddleName(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetMiddleNameActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetMiddleNameActionBuilder.php index 92e0bb44f2d..22c8033d7ad 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetMiddleNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetMiddleNameActionBuilder.php @@ -21,11 +21,16 @@ final class MyCustomerSetMiddleNameActionBuilder implements Builder { /** + * @var ?string */ private $middleName; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * @return null|string */ public function getMiddleName() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetMiddleNameActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetMiddleNameActionModel.php index 5bb6269ba2b..57af8f91531 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetMiddleNameActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetMiddleNameActionModel.php @@ -21,11 +21,13 @@ final class MyCustomerSetMiddleNameActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'setMiddleName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $middleName; @@ -35,13 +37,15 @@ final class MyCustomerSetMiddleNameActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?string $middleName = null + ?string $middleName = null, + ?string $action = null ) { $this->middleName = $middleName; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,10 @@ public function getAction() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * * @return null|string */ public function getMiddleName() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetSalutationAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetSalutationAction.php index 854d266ce49..2836c98a782 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetSalutationAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetSalutationAction.php @@ -16,6 +16,10 @@ interface MyCustomerSetSalutationAction extends MyCustomerUpdateAction public const FIELD_SALUTATION = 'salutation'; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * @return null|string */ public function getSalutation(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetSalutationActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetSalutationActionBuilder.php index 3381545b221..7c5d8a5a091 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetSalutationActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetSalutationActionBuilder.php @@ -21,11 +21,16 @@ final class MyCustomerSetSalutationActionBuilder implements Builder { /** + * @var ?string */ private $salutation; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * @return null|string */ public function getSalutation() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetSalutationActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetSalutationActionModel.php index b847eff883f..2302f3889fb 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetSalutationActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetSalutationActionModel.php @@ -21,11 +21,13 @@ final class MyCustomerSetSalutationActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'setSalutation'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $salutation; @@ -35,13 +37,15 @@ final class MyCustomerSetSalutationActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?string $salutation = null + ?string $salutation = null, + ?string $action = null ) { $this->salutation = $salutation; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,10 @@ public function getAction() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * * @return null|string */ public function getSalutation() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetTitleAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetTitleAction.php index e478c7f7409..30d528b449e 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetTitleAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetTitleAction.php @@ -16,6 +16,10 @@ interface MyCustomerSetTitleAction extends MyCustomerUpdateAction public const FIELD_TITLE = 'title'; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * @return null|string */ public function getTitle(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetTitleActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetTitleActionBuilder.php index d18fc62ba95..03e7e6714ea 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetTitleActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetTitleActionBuilder.php @@ -21,11 +21,16 @@ final class MyCustomerSetTitleActionBuilder implements Builder { /** + * @var ?string */ private $title; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * @return null|string */ public function getTitle() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetTitleActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetTitleActionModel.php index 6d31d375c72..039a727aaf7 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetTitleActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetTitleActionModel.php @@ -21,11 +21,13 @@ final class MyCustomerSetTitleActionModel extends JsonObjectModel implements MyC { public const DISCRIMINATOR_VALUE = 'setTitle'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $title; @@ -35,13 +37,15 @@ final class MyCustomerSetTitleActionModel extends JsonObjectModel implements MyC * @psalm-suppress MissingParamType */ public function __construct( - ?string $title = null + ?string $title = null, + ?string $action = null ) { $this->title = $title; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,10 @@ public function getAction() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * * @return null|string */ public function getTitle() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetVatIdAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetVatIdAction.php index d3479ae38a0..6bfb42ef776 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetVatIdAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetVatIdAction.php @@ -16,6 +16,10 @@ interface MyCustomerSetVatIdAction extends MyCustomerUpdateAction public const FIELD_VAT_ID = 'vatId'; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * @return null|string */ public function getVatId(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetVatIdActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetVatIdActionBuilder.php index 674b4febedd..d893eb7a17d 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetVatIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetVatIdActionBuilder.php @@ -21,11 +21,16 @@ final class MyCustomerSetVatIdActionBuilder implements Builder { /** + * @var ?string */ private $vatId; /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * @return null|string */ public function getVatId() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerSetVatIdActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerSetVatIdActionModel.php index 3978f86a5f1..21f4ee7c039 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerSetVatIdActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerSetVatIdActionModel.php @@ -21,11 +21,13 @@ final class MyCustomerSetVatIdActionModel extends JsonObjectModel implements MyC { public const DISCRIMINATOR_VALUE = 'setVatId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $vatId; @@ -35,13 +37,15 @@ final class MyCustomerSetVatIdActionModel extends JsonObjectModel implements MyC * @psalm-suppress MissingParamType */ public function __construct( - ?string $vatId = null + ?string $vatId = null, + ?string $action = null ) { $this->vatId = $vatId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,10 @@ public function getAction() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * + * * @return null|string */ public function getVatId() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerUpdate.php b/lib/commercetools-api/src/Models/Me/MyCustomerUpdate.php index 2047600c461..0da4737365f 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerUpdate.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerUpdate.php @@ -17,11 +17,17 @@ interface MyCustomerUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + *

    Expected version of the Customer on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * @return null|int */ public function getVersion(); /** + *

    Update actions to be performed on the Customer.

    + * + * @return null|MyCustomerUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerUpdateAction.php b/lib/commercetools-api/src/Models/Me/MyCustomerUpdateAction.php index 7b464743e17..30e06bae0b4 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerUpdateAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerUpdateAction.php @@ -17,6 +17,7 @@ interface MyCustomerUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerUpdateActionModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerUpdateActionModel.php index 7280d9a4440..955451aa960 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerUpdateActionModel.php @@ -21,6 +21,7 @@ final class MyCustomerUpdateActionModel extends JsonObjectModel implements MyCus { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -57,11 +58,13 @@ final class MyCustomerUpdateActionModel extends JsonObjectModel implements MyCus * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerUpdateBuilder.php b/lib/commercetools-api/src/Models/Me/MyCustomerUpdateBuilder.php index b43ea44e57b..d52dc9b5c41 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerUpdateBuilder.php @@ -21,16 +21,21 @@ final class MyCustomerUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?MyCustomerUpdateActionCollection */ private $actions; /** + *

    Expected version of the Customer on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * @return null|int */ public function getVersion() @@ -39,6 +44,9 @@ public function getVersion() } /** + *

    Update actions to be performed on the Customer.

    + * + * @return null|MyCustomerUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Me/MyCustomerUpdateModel.php b/lib/commercetools-api/src/Models/Me/MyCustomerUpdateModel.php index f4c9d023f62..1c39263fd0c 100644 --- a/lib/commercetools-api/src/Models/Me/MyCustomerUpdateModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCustomerUpdateModel.php @@ -20,11 +20,13 @@ final class MyCustomerUpdateModel extends JsonObjectModel implements MyCustomerUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?MyCustomerUpdateActionCollection */ protected $actions; @@ -42,6 +44,9 @@ public function __construct( } /** + *

    Expected version of the Customer on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * * @return null|int */ public function getVersion() @@ -59,6 +64,9 @@ public function getVersion() } /** + *

    Update actions to be performed on the Customer.

    + * + * * @return null|MyCustomerUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Me/MyDivisionDraft.php b/lib/commercetools-api/src/Models/Me/MyDivisionDraft.php new file mode 100644 index 00000000000..2d8c3eb3a31 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyDivisionDraft.php @@ -0,0 +1,31 @@ +The parent unit of this Division. Can be a Company or a Division.

    + * + + * @return null|BusinessUnitResourceIdentifier + */ + public function getParentUnit(); + + /** + * @param ?BusinessUnitResourceIdentifier $parentUnit + */ + public function setParentUnit(?BusinessUnitResourceIdentifier $parentUnit): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyDivisionDraftBuilder.php b/lib/commercetools-api/src/Models/Me/MyDivisionDraftBuilder.php new file mode 100644 index 00000000000..6bfcb5ea488 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyDivisionDraftBuilder.php @@ -0,0 +1,352 @@ + + */ +final class MyDivisionDraftBuilder implements Builder +{ + /** + + * @var ?string + */ + private $key; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var ?string + */ + private $contactEmail; + + /** + + * @var null|CustomFields|CustomFieldsBuilder + */ + private $custom; + + /** + + * @var ?BaseAddressCollection + */ + private $addresses; + + /** + + * @var ?array + */ + private $shippingAddresses; + + /** + + * @var ?int + */ + private $defaultShipingAddress; + + /** + + * @var ?array + */ + private $billingAddresses; + + /** + + * @var ?int + */ + private $defaultBillingAddress; + + /** + + * @var null|BusinessUnitResourceIdentifier|BusinessUnitResourceIdentifierBuilder + */ + private $parentUnit; + + /** + *

    User-defined unique identifier for the BusinessUnit.

    + * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + *

    Name of the Business Unit.

    + * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

    Email address of the Business Unit.

    + * + + * @return null|string + */ + public function getContactEmail() + { + return $this->contactEmail; + } + + /** + *

    Custom Fields for the Business Unit.

    + * + + * @return null|CustomFields + */ + public function getCustom() + { + return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; + } + + /** + *

    Addresses used by the Business Unit.

    + * + + * @return null|BaseAddressCollection + */ + public function getAddresses() + { + return $this->addresses; + } + + /** + *

    Indexes of entries in addresses to set as shipping addresses. + * The shippingAddressIds of the Customer will be replaced by these addresses.

    + * + + * @return null|array + */ + public function getShippingAddresses() + { + return $this->shippingAddresses; + } + + /** + *

    Index of the entry in addresses to set as the default shipping address.

    + * + + * @return null|int + */ + public function getDefaultShipingAddress() + { + return $this->defaultShipingAddress; + } + + /** + *

    Indexes of entries in addresses to set as billing addresses. + * The billingAddressIds of the Customer will be replaced by these addresses.

    + * + + * @return null|array + */ + public function getBillingAddresses() + { + return $this->billingAddresses; + } + + /** + *

    Index of the entry in addresses to set as the default billing address.

    + * + + * @return null|int + */ + public function getDefaultBillingAddress() + { + return $this->defaultBillingAddress; + } + + /** + *

    The parent unit of this Division. Can be a Company or a Division.

    + * + + * @return null|BusinessUnitResourceIdentifier + */ + public function getParentUnit() + { + return $this->parentUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->parentUnit->build() : $this->parentUnit; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param ?string $contactEmail + * @return $this + */ + public function withContactEmail(?string $contactEmail) + { + $this->contactEmail = $contactEmail; + + return $this; + } + + /** + * @param ?CustomFields $custom + * @return $this + */ + public function withCustom(?CustomFields $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @param ?BaseAddressCollection $addresses + * @return $this + */ + public function withAddresses(?BaseAddressCollection $addresses) + { + $this->addresses = $addresses; + + return $this; + } + + /** + * @param ?array $shippingAddresses + * @return $this + */ + public function withShippingAddresses(?array $shippingAddresses) + { + $this->shippingAddresses = $shippingAddresses; + + return $this; + } + + /** + * @param ?int $defaultShipingAddress + * @return $this + */ + public function withDefaultShipingAddress(?int $defaultShipingAddress) + { + $this->defaultShipingAddress = $defaultShipingAddress; + + return $this; + } + + /** + * @param ?array $billingAddresses + * @return $this + */ + public function withBillingAddresses(?array $billingAddresses) + { + $this->billingAddresses = $billingAddresses; + + return $this; + } + + /** + * @param ?int $defaultBillingAddress + * @return $this + */ + public function withDefaultBillingAddress(?int $defaultBillingAddress) + { + $this->defaultBillingAddress = $defaultBillingAddress; + + return $this; + } + + /** + * @param ?BusinessUnitResourceIdentifier $parentUnit + * @return $this + */ + public function withParentUnit(?BusinessUnitResourceIdentifier $parentUnit) + { + $this->parentUnit = $parentUnit; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @deprecated use withParentUnit() instead + * @return $this + */ + public function withParentUnitBuilder(?BusinessUnitResourceIdentifierBuilder $parentUnit) + { + $this->parentUnit = $parentUnit; + + return $this; + } + + public function build(): MyDivisionDraft + { + return new MyDivisionDraftModel( + $this->key, + $this->name, + $this->contactEmail, + $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, + $this->addresses, + $this->shippingAddresses, + $this->defaultShipingAddress, + $this->billingAddresses, + $this->defaultBillingAddress, + $this->parentUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->parentUnit->build() : $this->parentUnit + ); + } + + public static function of(): MyDivisionDraftBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyDivisionDraftCollection.php b/lib/commercetools-api/src/Models/Me/MyDivisionDraftCollection.php new file mode 100644 index 00000000000..719e98b9cae --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyDivisionDraftCollection.php @@ -0,0 +1,56 @@ + + * @method MyDivisionDraft current() + * @method MyDivisionDraft end() + * @method MyDivisionDraft at($offset) + */ +class MyDivisionDraftCollection extends MyBusinessUnitDraftCollection +{ + /** + * @psalm-assert MyDivisionDraft $value + * @psalm-param MyDivisionDraft|stdClass $value + * @throws InvalidArgumentException + * + * @return MyDivisionDraftCollection + */ + public function add($value) + { + if (!$value instanceof MyDivisionDraft) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyDivisionDraft + */ + protected function mapper() + { + return function (?int $index): ?MyDivisionDraft { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyDivisionDraft $data */ + $data = MyDivisionDraftModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyDivisionDraftModel.php b/lib/commercetools-api/src/Models/Me/MyDivisionDraftModel.php new file mode 100644 index 00000000000..4dbdd96b33e --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyDivisionDraftModel.php @@ -0,0 +1,428 @@ +key = $key; + $this->name = $name; + $this->contactEmail = $contactEmail; + $this->custom = $custom; + $this->addresses = $addresses; + $this->shippingAddresses = $shippingAddresses; + $this->defaultShipingAddress = $defaultShipingAddress; + $this->billingAddresses = $billingAddresses; + $this->defaultBillingAddress = $defaultBillingAddress; + $this->parentUnit = $parentUnit; + $this->unitType = $unitType ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    User-defined unique identifier for the BusinessUnit.

    + * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + *

    Type of the Business Unit indicating its position in a hierarchy.

    + * + * + * @return null|string + */ + public function getUnitType() + { + if (is_null($this->unitType)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_UNIT_TYPE); + if (is_null($data)) { + return null; + } + $this->unitType = (string) $data; + } + + return $this->unitType; + } + + /** + *

    Name of the Business Unit.

    + * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

    Email address of the Business Unit.

    + * + * + * @return null|string + */ + public function getContactEmail() + { + if (is_null($this->contactEmail)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CONTACT_EMAIL); + if (is_null($data)) { + return null; + } + $this->contactEmail = (string) $data; + } + + return $this->contactEmail; + } + + /** + *

    Custom Fields for the Business Unit.

    + * + * + * @return null|CustomFields + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomFieldsModel::of($data); + } + + return $this->custom; + } + + /** + *

    Addresses used by the Business Unit.

    + * + * + * @return null|BaseAddressCollection + */ + public function getAddresses() + { + if (is_null($this->addresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->addresses = BaseAddressCollection::fromArray($data); + } + + return $this->addresses; + } + + /** + *

    Indexes of entries in addresses to set as shipping addresses. + * The shippingAddressIds of the Customer will be replaced by these addresses.

    + * + * + * @return null|array + */ + public function getShippingAddresses() + { + if (is_null($this->shippingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SHIPPING_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->shippingAddresses = $data; + } + + return $this->shippingAddresses; + } + + /** + *

    Index of the entry in addresses to set as the default shipping address.

    + * + * + * @return null|int + */ + public function getDefaultShipingAddress() + { + if (is_null($this->defaultShipingAddress)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_DEFAULT_SHIPING_ADDRESS); + if (is_null($data)) { + return null; + } + $this->defaultShipingAddress = (int) $data; + } + + return $this->defaultShipingAddress; + } + + /** + *

    Indexes of entries in addresses to set as billing addresses. + * The billingAddressIds of the Customer will be replaced by these addresses.

    + * + * + * @return null|array + */ + public function getBillingAddresses() + { + if (is_null($this->billingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_BILLING_ADDRESSES); + if (is_null($data)) { + return null; + } + $this->billingAddresses = $data; + } + + return $this->billingAddresses; + } + + /** + *

    Index of the entry in addresses to set as the default billing address.

    + * + * + * @return null|int + */ + public function getDefaultBillingAddress() + { + if (is_null($this->defaultBillingAddress)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_DEFAULT_BILLING_ADDRESS); + if (is_null($data)) { + return null; + } + $this->defaultBillingAddress = (int) $data; + } + + return $this->defaultBillingAddress; + } + + /** + *

    The parent unit of this Division. Can be a Company or a Division.

    + * + * + * @return null|BusinessUnitResourceIdentifier + */ + public function getParentUnit() + { + if (is_null($this->parentUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_PARENT_UNIT); + if (is_null($data)) { + return null; + } + + $this->parentUnit = BusinessUnitResourceIdentifierModel::of($data); + } + + return $this->parentUnit; + } + + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void + { + $this->contactEmail = $contactEmail; + } + + /** + * @param ?CustomFields $custom + */ + public function setCustom(?CustomFields $custom): void + { + $this->custom = $custom; + } + + /** + * @param ?BaseAddressCollection $addresses + */ + public function setAddresses(?BaseAddressCollection $addresses): void + { + $this->addresses = $addresses; + } + + /** + * @param ?array $shippingAddresses + */ + public function setShippingAddresses(?array $shippingAddresses): void + { + $this->shippingAddresses = $shippingAddresses; + } + + /** + * @param ?int $defaultShipingAddress + */ + public function setDefaultShipingAddress(?int $defaultShipingAddress): void + { + $this->defaultShipingAddress = $defaultShipingAddress; + } + + /** + * @param ?array $billingAddresses + */ + public function setBillingAddresses(?array $billingAddresses): void + { + $this->billingAddresses = $billingAddresses; + } + + /** + * @param ?int $defaultBillingAddress + */ + public function setDefaultBillingAddress(?int $defaultBillingAddress): void + { + $this->defaultBillingAddress = $defaultBillingAddress; + } + + /** + * @param ?BusinessUnitResourceIdentifier $parentUnit + */ + public function setParentUnit(?BusinessUnitResourceIdentifier $parentUnit): void + { + $this->parentUnit = $parentUnit; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyLineItemDraft.php b/lib/commercetools-api/src/Models/Me/MyLineItemDraft.php index fa5f41c12a5..551f31c0f94 100644 --- a/lib/commercetools-api/src/Models/Me/MyLineItemDraft.php +++ b/lib/commercetools-api/src/Models/Me/MyLineItemDraft.php @@ -28,16 +28,19 @@ interface MyLineItemDraft extends JsonObject public const FIELD_SKU = 'sku'; /** + * @return null|string */ public function getProductId(); /** + * @return null|int */ public function getVariantId(); /** + * @return null|int */ public function getQuantity(); @@ -46,6 +49,7 @@ public function getQuantity(); *

    When the line item was added to the cart. Optional for backwards * compatibility reasons only.

    * + * @return null|DateTimeImmutable */ public function getAddedAt(); @@ -55,6 +59,7 @@ public function getAddedAt(); * inventory entries that should be reserved. * The provided channel should have the InventorySupply role.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel(); @@ -63,6 +68,7 @@ public function getSupplyChannel(); *

    The channel is used to select a ProductPrice. * The provided channel should have the ProductDistribution role.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel(); @@ -70,6 +76,7 @@ public function getDistributionChannel(); /** *

    The custom fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -77,11 +84,13 @@ public function getCustom(); /** *

    Container for line item specific address(es).

    * + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); /** + * @return null|string */ public function getSku(); diff --git a/lib/commercetools-api/src/Models/Me/MyLineItemDraftBuilder.php b/lib/commercetools-api/src/Models/Me/MyLineItemDraftBuilder.php index 905993aa531..4cef978700d 100644 --- a/lib/commercetools-api/src/Models/Me/MyLineItemDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyLineItemDraftBuilder.php @@ -28,51 +28,61 @@ final class MyLineItemDraftBuilder implements Builder { /** + * @var ?string */ private $productId; /** + * @var ?int */ private $variantId; /** + * @var ?int */ private $quantity; /** + * @var ?DateTimeImmutable */ private $addedAt; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $supplyChannel; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $distributionChannel; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetails; /** + * @var ?string */ private $sku; /** + * @return null|string */ public function getProductId() @@ -81,6 +91,7 @@ public function getProductId() } /** + * @return null|int */ public function getVariantId() @@ -89,6 +100,7 @@ public function getVariantId() } /** + * @return null|int */ public function getQuantity() @@ -100,6 +112,7 @@ public function getQuantity() *

    When the line item was added to the cart. Optional for backwards * compatibility reasons only.

    * + * @return null|DateTimeImmutable */ public function getAddedAt() @@ -112,6 +125,7 @@ public function getAddedAt() * inventory entries that should be reserved. * The provided channel should have the InventorySupply role.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -123,6 +137,7 @@ public function getSupplyChannel() *

    The channel is used to select a ProductPrice. * The provided channel should have the ProductDistribution role.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() @@ -133,6 +148,7 @@ public function getDistributionChannel() /** *

    The custom fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -143,6 +159,7 @@ public function getCustom() /** *

    Container for line item specific address(es).

    * + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() @@ -151,6 +168,7 @@ public function getShippingDetails() } /** + * @return null|string */ public function getSku() diff --git a/lib/commercetools-api/src/Models/Me/MyLineItemDraftModel.php b/lib/commercetools-api/src/Models/Me/MyLineItemDraftModel.php index 778bd53661b..816d21a3b86 100644 --- a/lib/commercetools-api/src/Models/Me/MyLineItemDraftModel.php +++ b/lib/commercetools-api/src/Models/Me/MyLineItemDraftModel.php @@ -27,46 +27,55 @@ final class MyLineItemDraftModel extends JsonObjectModel implements MyLineItemDraft { /** + * * @var ?string */ protected $productId; /** + * * @var ?int */ protected $variantId; /** + * * @var ?int */ protected $quantity; /** + * * @var ?DateTimeImmutable */ protected $addedAt; /** + * * @var ?ChannelResourceIdentifier */ protected $supplyChannel; /** + * * @var ?ChannelResourceIdentifier */ protected $distributionChannel; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; /** + * * @var ?string */ protected $sku; @@ -98,6 +107,7 @@ public function __construct( } /** + * * @return null|string */ public function getProductId() @@ -115,6 +125,7 @@ public function getProductId() } /** + * * @return null|int */ public function getVariantId() @@ -132,6 +143,7 @@ public function getVariantId() } /** + * * @return null|int */ public function getQuantity() @@ -152,6 +164,7 @@ public function getQuantity() *

    When the line item was added to the cart. Optional for backwards * compatibility reasons only.

    * + * * @return null|DateTimeImmutable */ public function getAddedAt() @@ -177,6 +190,7 @@ public function getAddedAt() * inventory entries that should be reserved. * The provided channel should have the InventorySupply role.

    * + * * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -198,6 +212,7 @@ public function getSupplyChannel() *

    The channel is used to select a ProductPrice. * The provided channel should have the ProductDistribution role.

    * + * * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() @@ -218,6 +233,7 @@ public function getDistributionChannel() /** *

    The custom fields.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -238,6 +254,7 @@ public function getCustom() /** *

    Container for line item specific address(es).

    * + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() @@ -256,6 +273,7 @@ public function getShippingDetails() } /** + * * @return null|string */ public function getSku() diff --git a/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraft.php b/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraft.php index 2fd7e52c5f3..6e9eefa552c 100644 --- a/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraft.php +++ b/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraft.php @@ -19,11 +19,13 @@ interface MyOrderFromCartDraft extends JsonObject /** *

    Unique identifier of the Cart that initiates an Order creation.

    * + * @return null|string */ public function getId(); /** + * @return null|int */ public function getVersion(); diff --git a/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraftBuilder.php b/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraftBuilder.php index b081fd293b6..404a57907b6 100644 --- a/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraftBuilder.php @@ -21,11 +21,13 @@ final class MyOrderFromCartDraftBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; @@ -33,6 +35,7 @@ final class MyOrderFromCartDraftBuilder implements Builder /** *

    Unique identifier of the Cart that initiates an Order creation.

    * + * @return null|string */ public function getId() @@ -41,6 +44,7 @@ public function getId() } /** + * @return null|int */ public function getVersion() diff --git a/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraftModel.php b/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraftModel.php index 5d3eb171953..b525a102331 100644 --- a/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraftModel.php +++ b/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraftModel.php @@ -20,11 +20,13 @@ final class MyOrderFromCartDraftModel extends JsonObjectModel implements MyOrderFromCartDraft { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; @@ -44,6 +46,7 @@ public function __construct( /** *

    Unique identifier of the Cart that initiates an Order creation.

    * + * * @return null|string */ public function getId() @@ -61,6 +64,7 @@ public function getId() } /** + * * @return null|int */ public function getVersion() diff --git a/lib/commercetools-api/src/Models/Me/MyPayment.php b/lib/commercetools-api/src/Models/Me/MyPayment.php index 051cbe926fa..a1e6339938c 100644 --- a/lib/commercetools-api/src/Models/Me/MyPayment.php +++ b/lib/commercetools-api/src/Models/Me/MyPayment.php @@ -30,11 +30,13 @@ interface MyPayment extends JsonObject /** *

    Unique identifier of the MyPayment.

    * + * @return null|string */ public function getId(); /** + * @return null|int */ public function getVersion(); @@ -42,6 +44,7 @@ public function getVersion(); /** *

    A reference to the customer this payment belongs to.

    * + * @return null|CustomerReference */ public function getCustomer(); @@ -49,6 +52,7 @@ public function getCustomer(); /** *

    Identifies payments belonging to an anonymous session (the customer has not signed up/in yet).

    * + * @return null|string */ public function getAnonymousId(); @@ -57,11 +61,13 @@ public function getAnonymousId(); *

    How much money this payment intends to receive from the customer. * The value usually matches the cart or order gross total.

    * + * @return null|TypedMoney */ public function getAmountPlanned(); /** + * @return null|PaymentMethodInfo */ public function getPaymentMethodInfo(); @@ -70,11 +76,13 @@ public function getPaymentMethodInfo(); *

    A list of financial transactions of different TransactionTypes * with different TransactionStates.

    * + * @return null|TransactionCollection */ public function getTransactions(); /** + * @return null|CustomFields */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentAddTransactionAction.php b/lib/commercetools-api/src/Models/Me/MyPaymentAddTransactionAction.php index 986b170cb35..6208683e18a 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentAddTransactionAction.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentAddTransactionAction.php @@ -17,6 +17,7 @@ interface MyPaymentAddTransactionAction extends MyPaymentUpdateAction public const FIELD_TRANSACTION = 'transaction'; /** + * @return null|TransactionDraft */ public function getTransaction(); diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentAddTransactionActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyPaymentAddTransactionActionBuilder.php index 6b1605bfe20..3f8964e4969 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentAddTransactionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentAddTransactionActionBuilder.php @@ -23,11 +23,13 @@ final class MyPaymentAddTransactionActionBuilder implements Builder { /** + * @var null|TransactionDraft|TransactionDraftBuilder */ private $transaction; /** + * @return null|TransactionDraft */ public function getTransaction() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentAddTransactionActionModel.php b/lib/commercetools-api/src/Models/Me/MyPaymentAddTransactionActionModel.php index e195d9781f7..effcb267e66 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentAddTransactionActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentAddTransactionActionModel.php @@ -23,11 +23,13 @@ final class MyPaymentAddTransactionActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'addTransaction'; /** + * * @var ?string */ protected $action; /** + * * @var ?TransactionDraft */ protected $transaction; @@ -37,13 +39,15 @@ final class MyPaymentAddTransactionActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?TransactionDraft $transaction = null + ?TransactionDraft $transaction = null, + ?string $action = null ) { $this->transaction = $transaction; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|TransactionDraft */ public function getTransaction() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentBuilder.php b/lib/commercetools-api/src/Models/Me/MyPaymentBuilder.php index 6555887c142..f95ac4a8ec8 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentBuilder.php @@ -30,41 +30,49 @@ final class MyPaymentBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var null|CustomerReference|CustomerReferenceBuilder */ private $customer; /** + * @var ?string */ private $anonymousId; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $amountPlanned; /** + * @var null|PaymentMethodInfo|PaymentMethodInfoBuilder */ private $paymentMethodInfo; /** + * @var ?TransactionCollection */ private $transactions; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; @@ -72,6 +80,7 @@ final class MyPaymentBuilder implements Builder /** *

    Unique identifier of the MyPayment.

    * + * @return null|string */ public function getId() @@ -80,6 +89,7 @@ public function getId() } /** + * @return null|int */ public function getVersion() @@ -90,6 +100,7 @@ public function getVersion() /** *

    A reference to the customer this payment belongs to.

    * + * @return null|CustomerReference */ public function getCustomer() @@ -100,6 +111,7 @@ public function getCustomer() /** *

    Identifies payments belonging to an anonymous session (the customer has not signed up/in yet).

    * + * @return null|string */ public function getAnonymousId() @@ -111,6 +123,7 @@ public function getAnonymousId() *

    How much money this payment intends to receive from the customer. * The value usually matches the cart or order gross total.

    * + * @return null|TypedMoney */ public function getAmountPlanned() @@ -119,6 +132,7 @@ public function getAmountPlanned() } /** + * @return null|PaymentMethodInfo */ public function getPaymentMethodInfo() @@ -130,6 +144,7 @@ public function getPaymentMethodInfo() *

    A list of financial transactions of different TransactionTypes * with different TransactionStates.

    * + * @return null|TransactionCollection */ public function getTransactions() @@ -138,6 +153,7 @@ public function getTransactions() } /** + * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentChangeAmountPlannedAction.php b/lib/commercetools-api/src/Models/Me/MyPaymentChangeAmountPlannedAction.php index ced28759cb7..447e35502d2 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentChangeAmountPlannedAction.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentChangeAmountPlannedAction.php @@ -20,6 +20,7 @@ interface MyPaymentChangeAmountPlannedAction extends MyPaymentUpdateAction *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getAmount(); diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentChangeAmountPlannedActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyPaymentChangeAmountPlannedActionBuilder.php index 50636cccf7f..61aedbe41ef 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentChangeAmountPlannedActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentChangeAmountPlannedActionBuilder.php @@ -23,6 +23,7 @@ final class MyPaymentChangeAmountPlannedActionBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $amount; @@ -31,6 +32,7 @@ final class MyPaymentChangeAmountPlannedActionBuilder implements Builder *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getAmount() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentChangeAmountPlannedActionModel.php b/lib/commercetools-api/src/Models/Me/MyPaymentChangeAmountPlannedActionModel.php index 79456347a4b..02640174a82 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentChangeAmountPlannedActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentChangeAmountPlannedActionModel.php @@ -23,11 +23,13 @@ final class MyPaymentChangeAmountPlannedActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'changeAmountPlanned'; /** + * * @var ?string */ protected $action; /** + * * @var ?Money */ protected $amount; @@ -37,13 +39,15 @@ final class MyPaymentChangeAmountPlannedActionModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?Money $amount = null + ?Money $amount = null, + ?string $action = null ) { $this->amount = $amount; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -64,6 +68,7 @@ public function getAction() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * * @return null|Money */ public function getAmount() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentDraft.php b/lib/commercetools-api/src/Models/Me/MyPaymentDraft.php index 4978a88a33d..8e581734a35 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentDraft.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentDraft.php @@ -25,16 +25,19 @@ interface MyPaymentDraft extends JsonObject *

    How much money this payment intends to receive from the customer. * The value usually matches the cart or order gross total.

    * + * @return null|Money */ public function getAmountPlanned(); /** + * @return null|PaymentMethodInfo */ public function getPaymentMethodInfo(); /** + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -43,6 +46,7 @@ public function getCustom(); *

    A list of financial transactions of the Authorization or Charge * TransactionTypes.

    * + * @return null|MyTransactionDraft */ public function getTransaction(); diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentDraftBuilder.php b/lib/commercetools-api/src/Models/Me/MyPaymentDraftBuilder.php index 344447b3f26..cbfedbf4486 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentDraftBuilder.php @@ -27,21 +27,25 @@ final class MyPaymentDraftBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $amountPlanned; /** + * @var null|PaymentMethodInfo|PaymentMethodInfoBuilder */ private $paymentMethodInfo; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var null|MyTransactionDraft|MyTransactionDraftBuilder */ private $transaction; @@ -50,6 +54,7 @@ final class MyPaymentDraftBuilder implements Builder *

    How much money this payment intends to receive from the customer. * The value usually matches the cart or order gross total.

    * + * @return null|Money */ public function getAmountPlanned() @@ -58,6 +63,7 @@ public function getAmountPlanned() } /** + * @return null|PaymentMethodInfo */ public function getPaymentMethodInfo() @@ -66,6 +72,7 @@ public function getPaymentMethodInfo() } /** + * @return null|CustomFieldsDraft */ public function getCustom() @@ -77,6 +84,7 @@ public function getCustom() *

    A list of financial transactions of the Authorization or Charge * TransactionTypes.

    * + * @return null|MyTransactionDraft */ public function getTransaction() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentDraftModel.php b/lib/commercetools-api/src/Models/Me/MyPaymentDraftModel.php index 02e154a12f2..817dcc6dbd1 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentDraftModel.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentDraftModel.php @@ -26,21 +26,25 @@ final class MyPaymentDraftModel extends JsonObjectModel implements MyPaymentDraft { /** + * * @var ?Money */ protected $amountPlanned; /** + * * @var ?PaymentMethodInfo */ protected $paymentMethodInfo; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?MyTransactionDraft */ protected $transaction; @@ -65,6 +69,7 @@ public function __construct( *

    How much money this payment intends to receive from the customer. * The value usually matches the cart or order gross total.

    * + * * @return null|Money */ public function getAmountPlanned() @@ -83,6 +88,7 @@ public function getAmountPlanned() } /** + * * @return null|PaymentMethodInfo */ public function getPaymentMethodInfo() @@ -101,6 +107,7 @@ public function getPaymentMethodInfo() } /** + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -122,6 +129,7 @@ public function getCustom() *

    A list of financial transactions of the Authorization or Charge * TransactionTypes.

    * + * * @return null|MyTransactionDraft */ public function getTransaction() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentModel.php b/lib/commercetools-api/src/Models/Me/MyPaymentModel.php index b72874857f7..c8d4870796c 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentModel.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentModel.php @@ -29,41 +29,49 @@ final class MyPaymentModel extends JsonObjectModel implements MyPayment { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?CustomerReference */ protected $customer; /** + * * @var ?string */ protected $anonymousId; /** + * * @var ?TypedMoney */ protected $amountPlanned; /** + * * @var ?PaymentMethodInfo */ protected $paymentMethodInfo; /** + * * @var ?TransactionCollection */ protected $transactions; /** + * * @var ?CustomFields */ protected $custom; @@ -95,6 +103,7 @@ public function __construct( /** *

    Unique identifier of the MyPayment.

    * + * * @return null|string */ public function getId() @@ -112,6 +121,7 @@ public function getId() } /** + * * @return null|int */ public function getVersion() @@ -131,6 +141,7 @@ public function getVersion() /** *

    A reference to the customer this payment belongs to.

    * + * * @return null|CustomerReference */ public function getCustomer() @@ -151,6 +162,7 @@ public function getCustomer() /** *

    Identifies payments belonging to an anonymous session (the customer has not signed up/in yet).

    * + * * @return null|string */ public function getAnonymousId() @@ -171,6 +183,7 @@ public function getAnonymousId() *

    How much money this payment intends to receive from the customer. * The value usually matches the cart or order gross total.

    * + * * @return null|TypedMoney */ public function getAmountPlanned() @@ -189,6 +202,7 @@ public function getAmountPlanned() } /** + * * @return null|PaymentMethodInfo */ public function getPaymentMethodInfo() @@ -210,6 +224,7 @@ public function getPaymentMethodInfo() *

    A list of financial transactions of different TransactionTypes * with different TransactionStates.

    * + * * @return null|TransactionCollection */ public function getTransactions() @@ -227,6 +242,7 @@ public function getTransactions() } /** + * * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentPagedQueryResponse.php b/lib/commercetools-api/src/Models/Me/MyPaymentPagedQueryResponse.php index 8b10e500847..edc273ed927 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentPagedQueryResponse.php @@ -22,16 +22,19 @@ interface MyPaymentPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); /** + * @return null|int */ public function getCount(); /** + * @return null|int */ public function getTotal(); @@ -39,11 +42,13 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); /** + * @return null|MyPaymentCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Me/MyPaymentPagedQueryResponseBuilder.php index ee36acca663..fc44e783e26 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class MyPaymentPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?MyPaymentCollection */ private $results; @@ -48,6 +53,7 @@ final class MyPaymentPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -56,6 +62,7 @@ public function getLimit() } /** + * @return null|int */ public function getCount() @@ -64,6 +71,7 @@ public function getCount() } /** + * @return null|int */ public function getTotal() @@ -74,6 +82,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -82,6 +91,7 @@ public function getOffset() } /** + * @return null|MyPaymentCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Me/MyPaymentPagedQueryResponseModel.php index b3f63c706e0..ae7a86343c4 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class MyPaymentPagedQueryResponseModel extends JsonObjectModel implements MyPaymentPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?MyPaymentCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -82,6 +88,7 @@ public function getLimit() } /** + * * @return null|int */ public function getCount() @@ -99,6 +106,7 @@ public function getCount() } /** + * * @return null|int */ public function getTotal() @@ -118,6 +126,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -135,6 +144,7 @@ public function getOffset() } /** + * * @return null|MyPaymentCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentSetCustomFieldAction.php b/lib/commercetools-api/src/Models/Me/MyPaymentSetCustomFieldAction.php index d4848863c54..7bc0a7a8d93 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface MyPaymentSetCustomFieldAction extends MyPaymentUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyPaymentSetCustomFieldActionBuilder.php index f53127c8fea..c6d857d82b4 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class MyPaymentSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class MyPaymentSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Me/MyPaymentSetCustomFieldActionModel.php index 0f970c7465d..1ac0390a039 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class MyPaymentSetCustomFieldActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class MyPaymentSetCustomFieldActionModel extends JsonObjectModel implement */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoInterfaceAction.php b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoInterfaceAction.php index 969eafbdc61..18484df1178 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoInterfaceAction.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoInterfaceAction.php @@ -16,6 +16,7 @@ interface MyPaymentSetMethodInfoInterfaceAction extends MyPaymentUpdateAction public const FIELD_INTERFACE = 'interface'; /** + * @return null|string */ public function getInterface(); diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoInterfaceActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoInterfaceActionBuilder.php index 18e2ab14655..59d04db3ee8 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoInterfaceActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoInterfaceActionBuilder.php @@ -21,11 +21,13 @@ final class MyPaymentSetMethodInfoInterfaceActionBuilder implements Builder { /** + * @var ?string */ private $interface; /** + * @return null|string */ public function getInterface() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoInterfaceActionModel.php b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoInterfaceActionModel.php index c8970281028..3165a550e7e 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoInterfaceActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoInterfaceActionModel.php @@ -21,11 +21,13 @@ final class MyPaymentSetMethodInfoInterfaceActionModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'setMethodInfoInterface'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $interface; @@ -35,13 +37,15 @@ final class MyPaymentSetMethodInfoInterfaceActionModel extends JsonObjectModel i * @psalm-suppress MissingParamType */ public function __construct( - ?string $interface = null + ?string $interface = null, + ?string $action = null ) { $this->interface = $interface; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getInterface() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoMethodAction.php b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoMethodAction.php index 70bc6a388af..e837fa31c32 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoMethodAction.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoMethodAction.php @@ -16,6 +16,7 @@ interface MyPaymentSetMethodInfoMethodAction extends MyPaymentUpdateAction public const FIELD_METHOD = 'method'; /** + * @return null|string */ public function getMethod(); diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoMethodActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoMethodActionBuilder.php index 9b653382380..7c9fc24cb76 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoMethodActionBuilder.php @@ -21,11 +21,13 @@ final class MyPaymentSetMethodInfoMethodActionBuilder implements Builder { /** + * @var ?string */ private $method; /** + * @return null|string */ public function getMethod() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoMethodActionModel.php b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoMethodActionModel.php index 5839b95bf05..9682040d7f1 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoMethodActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoMethodActionModel.php @@ -21,11 +21,13 @@ final class MyPaymentSetMethodInfoMethodActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setMethodInfoMethod'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $method; @@ -35,13 +37,15 @@ final class MyPaymentSetMethodInfoMethodActionModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?string $method = null + ?string $method = null, + ?string $action = null ) { $this->method = $method; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getMethod() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoNameAction.php b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoNameAction.php index cbe6158e774..e99f2923859 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoNameAction.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoNameAction.php @@ -19,6 +19,7 @@ interface MyPaymentSetMethodInfoNameAction extends MyPaymentUpdateAction /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoNameActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoNameActionBuilder.php index 3f5954f75db..3cff75d5ed8 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoNameActionBuilder.php @@ -23,6 +23,7 @@ final class MyPaymentSetMethodInfoNameActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; @@ -30,6 +31,7 @@ final class MyPaymentSetMethodInfoNameActionBuilder implements Builder /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoNameActionModel.php b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoNameActionModel.php index f97a204a7a0..8cc1f478d0b 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoNameActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentSetMethodInfoNameActionModel.php @@ -23,11 +23,13 @@ final class MyPaymentSetMethodInfoNameActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setMethodInfoName'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $name; @@ -37,13 +39,15 @@ final class MyPaymentSetMethodInfoNameActionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentSetTransactionCustomFieldAction.php b/lib/commercetools-api/src/Models/Me/MyPaymentSetTransactionCustomFieldAction.php index 02658d04753..a9334d7c275 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentSetTransactionCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentSetTransactionCustomFieldAction.php @@ -19,6 +19,7 @@ interface MyPaymentSetTransactionCustomFieldAction extends MyPaymentUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentSetTransactionCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyPaymentSetTransactionCustomFieldActionBuilder.php index e15aab178df..12a3dc9c998 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentSetTransactionCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentSetTransactionCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class MyPaymentSetTransactionCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class MyPaymentSetTransactionCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentSetTransactionCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Me/MyPaymentSetTransactionCustomFieldActionModel.php index a31c157496e..d7b4391a38f 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentSetTransactionCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentSetTransactionCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class MyPaymentSetTransactionCustomFieldActionModel extends JsonObjectMode { public const DISCRIMINATOR_VALUE = 'setTransactionCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class MyPaymentSetTransactionCustomFieldActionModel extends JsonObjectMode */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentUpdate.php b/lib/commercetools-api/src/Models/Me/MyPaymentUpdate.php index 1bb814e48d8..47f5619f1f9 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentUpdate.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentUpdate.php @@ -17,11 +17,13 @@ interface MyPaymentUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + * @return null|int */ public function getVersion(); /** + * @return null|MyPaymentUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentUpdateAction.php b/lib/commercetools-api/src/Models/Me/MyPaymentUpdateAction.php index caa5b1c1a6e..d7588617ccf 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentUpdateAction.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentUpdateAction.php @@ -17,6 +17,7 @@ interface MyPaymentUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentUpdateActionModel.php b/lib/commercetools-api/src/Models/Me/MyPaymentUpdateActionModel.php index 2ded63f7852..676953a9df2 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentUpdateActionModel.php @@ -21,6 +21,7 @@ final class MyPaymentUpdateActionModel extends JsonObjectModel implements MyPaym { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -43,11 +44,13 @@ final class MyPaymentUpdateActionModel extends JsonObjectModel implements MyPaym * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentUpdateBuilder.php b/lib/commercetools-api/src/Models/Me/MyPaymentUpdateBuilder.php index 7ac208f4235..cdbcd981f18 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentUpdateBuilder.php @@ -21,16 +21,19 @@ final class MyPaymentUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?MyPaymentUpdateActionCollection */ private $actions; /** + * @return null|int */ public function getVersion() @@ -39,6 +42,7 @@ public function getVersion() } /** + * @return null|MyPaymentUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Me/MyPaymentUpdateModel.php b/lib/commercetools-api/src/Models/Me/MyPaymentUpdateModel.php index 3e3e0c154ea..9f7e4611d88 100644 --- a/lib/commercetools-api/src/Models/Me/MyPaymentUpdateModel.php +++ b/lib/commercetools-api/src/Models/Me/MyPaymentUpdateModel.php @@ -20,11 +20,13 @@ final class MyPaymentUpdateModel extends JsonObjectModel implements MyPaymentUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?MyPaymentUpdateActionCollection */ protected $actions; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|int */ public function getVersion() @@ -59,6 +62,7 @@ public function getVersion() } /** + * * @return null|MyPaymentUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteChangeMyQuoteStateAction.php b/lib/commercetools-api/src/Models/Me/MyQuoteChangeMyQuoteStateAction.php new file mode 100644 index 00000000000..35f75328851 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyQuoteChangeMyQuoteStateAction.php @@ -0,0 +1,30 @@ +New state to be set for the Quote.

    + * + + * @return null|string + */ + public function getQuoteState(); + + /** + * @param ?string $quoteState + */ + public function setQuoteState(?string $quoteState): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteChangeMyQuoteStateActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyQuoteChangeMyQuoteStateActionBuilder.php new file mode 100644 index 00000000000..a738dc540b7 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyQuoteChangeMyQuoteStateActionBuilder.php @@ -0,0 +1,63 @@ + + */ +final class MyQuoteChangeMyQuoteStateActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $quoteState; + + /** + *

    New state to be set for the Quote.

    + * + + * @return null|string + */ + public function getQuoteState() + { + return $this->quoteState; + } + + /** + * @param ?string $quoteState + * @return $this + */ + public function withQuoteState(?string $quoteState) + { + $this->quoteState = $quoteState; + + return $this; + } + + + public function build(): MyQuoteChangeMyQuoteStateAction + { + return new MyQuoteChangeMyQuoteStateActionModel( + $this->quoteState + ); + } + + public static function of(): MyQuoteChangeMyQuoteStateActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteChangeMyQuoteStateActionCollection.php b/lib/commercetools-api/src/Models/Me/MyQuoteChangeMyQuoteStateActionCollection.php new file mode 100644 index 00000000000..a79df760b8d --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyQuoteChangeMyQuoteStateActionCollection.php @@ -0,0 +1,56 @@ + + * @method MyQuoteChangeMyQuoteStateAction current() + * @method MyQuoteChangeMyQuoteStateAction end() + * @method MyQuoteChangeMyQuoteStateAction at($offset) + */ +class MyQuoteChangeMyQuoteStateActionCollection extends MyQuoteUpdateActionCollection +{ + /** + * @psalm-assert MyQuoteChangeMyQuoteStateAction $value + * @psalm-param MyQuoteChangeMyQuoteStateAction|stdClass $value + * @throws InvalidArgumentException + * + * @return MyQuoteChangeMyQuoteStateActionCollection + */ + public function add($value) + { + if (!$value instanceof MyQuoteChangeMyQuoteStateAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyQuoteChangeMyQuoteStateAction + */ + protected function mapper() + { + return function (?int $index): ?MyQuoteChangeMyQuoteStateAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyQuoteChangeMyQuoteStateAction $data */ + $data = MyQuoteChangeMyQuoteStateActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteChangeMyQuoteStateActionModel.php b/lib/commercetools-api/src/Models/Me/MyQuoteChangeMyQuoteStateActionModel.php new file mode 100644 index 00000000000..d6e16bf2755 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyQuoteChangeMyQuoteStateActionModel.php @@ -0,0 +1,93 @@ +quoteState = $quoteState; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    New state to be set for the Quote.

    + * + * + * @return null|string + */ + public function getQuoteState() + { + if (is_null($this->quoteState)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_QUOTE_STATE); + if (is_null($data)) { + return null; + } + $this->quoteState = (string) $data; + } + + return $this->quoteState; + } + + + /** + * @param ?string $quoteState + */ + public function setQuoteState(?string $quoteState): void + { + $this->quoteState = $quoteState; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteRequestCancelActionModel.php b/lib/commercetools-api/src/Models/Me/MyQuoteRequestCancelActionModel.php index db5614723c5..b398e79b061 100644 --- a/lib/commercetools-api/src/Models/Me/MyQuoteRequestCancelActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyQuoteRequestCancelActionModel.php @@ -21,6 +21,7 @@ final class MyQuoteRequestCancelActionModel extends JsonObjectModel implements M { public const DISCRIMINATOR_VALUE = 'cancelQuoteRequest'; /** + * * @var ?string */ protected $action; @@ -30,11 +31,13 @@ final class MyQuoteRequestCancelActionModel extends JsonObjectModel implements M * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteRequestDraft.php b/lib/commercetools-api/src/Models/Me/MyQuoteRequestDraft.php index eb7c320bb66..0e72fa4e4e3 100644 --- a/lib/commercetools-api/src/Models/Me/MyQuoteRequestDraft.php +++ b/lib/commercetools-api/src/Models/Me/MyQuoteRequestDraft.php @@ -19,8 +19,9 @@ interface MyQuoteRequestDraft extends JsonObject public const FIELD_COMMENT = 'comment'; /** - *

    ResourceIdentifier to the Cart from which this quote request is created.

    + *

    ResourceIdentifier of the Cart from which the Quote Request is created.

    * + * @return null|CartResourceIdentifier */ public function getCart(); @@ -28,13 +29,15 @@ public function getCart(); /** *

    Current version of the Cart.

    * + * @return null|int */ public function getVersion(); /** - *

    Text message included in the request.

    + *

    Message from the Buyer included in the Quote Request.

    * + * @return null|string */ public function getComment(); diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteRequestDraftBuilder.php b/lib/commercetools-api/src/Models/Me/MyQuoteRequestDraftBuilder.php index 95156d33041..e5d07af966a 100644 --- a/lib/commercetools-api/src/Models/Me/MyQuoteRequestDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyQuoteRequestDraftBuilder.php @@ -23,23 +23,27 @@ final class MyQuoteRequestDraftBuilder implements Builder { /** + * @var null|CartResourceIdentifier|CartResourceIdentifierBuilder */ private $cart; /** + * @var ?int */ private $version; /** + * @var ?string */ private $comment; /** - *

    ResourceIdentifier to the Cart from which this quote request is created.

    + *

    ResourceIdentifier of the Cart from which the Quote Request is created.

    * + * @return null|CartResourceIdentifier */ public function getCart() @@ -50,6 +54,7 @@ public function getCart() /** *

    Current version of the Cart.

    * + * @return null|int */ public function getVersion() @@ -58,8 +63,9 @@ public function getVersion() } /** - *

    Text message included in the request.

    + *

    Message from the Buyer included in the Quote Request.

    * + * @return null|string */ public function getComment() diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteRequestDraftModel.php b/lib/commercetools-api/src/Models/Me/MyQuoteRequestDraftModel.php index 2aeb5f1061b..aa2f0ace036 100644 --- a/lib/commercetools-api/src/Models/Me/MyQuoteRequestDraftModel.php +++ b/lib/commercetools-api/src/Models/Me/MyQuoteRequestDraftModel.php @@ -22,16 +22,19 @@ final class MyQuoteRequestDraftModel extends JsonObjectModel implements MyQuoteRequestDraft { /** + * * @var ?CartResourceIdentifier */ protected $cart; /** + * * @var ?int */ protected $version; /** + * * @var ?string */ protected $comment; @@ -51,7 +54,8 @@ public function __construct( } /** - *

    ResourceIdentifier to the Cart from which this quote request is created.

    + *

    ResourceIdentifier of the Cart from which the Quote Request is created.

    + * * * @return null|CartResourceIdentifier */ @@ -73,6 +77,7 @@ public function getCart() /** *

    Current version of the Cart.

    * + * * @return null|int */ public function getVersion() @@ -90,7 +95,8 @@ public function getVersion() } /** - *

    Text message included in the request.

    + *

    Message from the Buyer included in the Quote Request.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdate.php b/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdate.php index 8acf79e40ec..cc44ddd883a 100644 --- a/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdate.php +++ b/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdate.php @@ -17,11 +17,13 @@ interface MyQuoteRequestUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + * @return null|int */ public function getVersion(); /** + * @return null|MyQuoteRequestUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdateAction.php b/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdateAction.php index 962a3d84e8d..95962b2fea1 100644 --- a/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdateAction.php +++ b/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdateAction.php @@ -17,6 +17,7 @@ interface MyQuoteRequestUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdateActionModel.php b/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdateActionModel.php index 2dee973cb77..c12477a2993 100644 --- a/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdateActionModel.php @@ -21,6 +21,7 @@ final class MyQuoteRequestUpdateActionModel extends JsonObjectModel implements M { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -37,11 +38,13 @@ final class MyQuoteRequestUpdateActionModel extends JsonObjectModel implements M * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdateBuilder.php b/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdateBuilder.php index dc4e6e38f8d..40f72b984fc 100644 --- a/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdateBuilder.php @@ -21,16 +21,19 @@ final class MyQuoteRequestUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?MyQuoteRequestUpdateActionCollection */ private $actions; /** + * @return null|int */ public function getVersion() @@ -39,6 +42,7 @@ public function getVersion() } /** + * @return null|MyQuoteRequestUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdateModel.php b/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdateModel.php index f5a7eb8d4a1..6aa3cb58322 100644 --- a/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdateModel.php +++ b/lib/commercetools-api/src/Models/Me/MyQuoteRequestUpdateModel.php @@ -20,11 +20,13 @@ final class MyQuoteRequestUpdateModel extends JsonObjectModel implements MyQuoteRequestUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?MyQuoteRequestUpdateActionCollection */ protected $actions; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|int */ public function getVersion() @@ -59,6 +62,7 @@ public function getVersion() } /** + * * @return null|MyQuoteRequestUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteUpdate.php b/lib/commercetools-api/src/Models/Me/MyQuoteUpdate.php new file mode 100644 index 00000000000..0e74eec443a --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyQuoteUpdate.php @@ -0,0 +1,45 @@ +Expected version of the Quote to which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + + * @return null|int + */ + public function getVersion(); + + /** + *

    Update actions to be performed on the Quote.

    + * + + * @return null|MyQuoteUpdateActionCollection + */ + public function getActions(); + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void; + + /** + * @param ?MyQuoteUpdateActionCollection $actions + */ + public function setActions(?MyQuoteUpdateActionCollection $actions): void; +} diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteUpdateAction.php b/lib/commercetools-api/src/Models/Me/MyQuoteUpdateAction.php new file mode 100644 index 00000000000..dedb3d235cb --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyQuoteUpdateAction.php @@ -0,0 +1,24 @@ + + */ +final class MyQuoteUpdateActionBuilder implements Builder +{ + public function build(): MyQuoteUpdateAction + { + return new MyQuoteUpdateActionModel( + ); + } + + public static function of(): MyQuoteUpdateActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteUpdateActionCollection.php b/lib/commercetools-api/src/Models/Me/MyQuoteUpdateActionCollection.php new file mode 100644 index 00000000000..3db6183541a --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyQuoteUpdateActionCollection.php @@ -0,0 +1,60 @@ + + * @psalm-method T current() + * @psalm-method T end() + * @psalm-method T at($offset) + * @method MyQuoteUpdateAction current() + * @method MyQuoteUpdateAction end() + * @method MyQuoteUpdateAction at($offset) + */ +class MyQuoteUpdateActionCollection extends MapperSequence +{ + /** + * @psalm-assert T $value + * @psalm-param T|stdClass $value + * @throws InvalidArgumentException + * + * @return MyQuoteUpdateActionCollection + */ + public function add($value) + { + if (!$value instanceof MyQuoteUpdateAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?T + */ + protected function mapper() + { + return function (?int $index): ?MyQuoteUpdateAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var T $data */ + $data = MyQuoteUpdateActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteUpdateActionModel.php b/lib/commercetools-api/src/Models/Me/MyQuoteUpdateActionModel.php new file mode 100644 index 00000000000..167dc30b07e --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyQuoteUpdateActionModel.php @@ -0,0 +1,94 @@ + > + * + */ + private static $discriminatorClasses = [ + 'changeMyQuoteState' => MyQuoteChangeMyQuoteStateActionModel::class, + ]; + + /** + * @psalm-suppress MissingParamType + */ + public function __construct( + ?string $action = null + ) { + $this->action = $action; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + + + + + /** + * @psalm-param stdClass|array $value + * @psalm-return class-string + */ + public static function resolveDiscriminatorClass($value): string + { + $fieldName = MyQuoteUpdateAction::DISCRIMINATOR_FIELD; + if (is_object($value) && isset($value->$fieldName)) { + /** @psalm-var string $discriminatorValue */ + $discriminatorValue = $value->$fieldName; + if (isset(self::$discriminatorClasses[$discriminatorValue])) { + return self::$discriminatorClasses[$discriminatorValue]; + } + } + if (is_array($value) && isset($value[$fieldName])) { + /** @psalm-var string $discriminatorValue */ + $discriminatorValue = $value[$fieldName]; + if (isset(self::$discriminatorClasses[$discriminatorValue])) { + return self::$discriminatorClasses[$discriminatorValue]; + } + } + + /** @psalm-var class-string */ + $type = MyQuoteUpdateActionModel::class; + return $type; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteUpdateBuilder.php b/lib/commercetools-api/src/Models/Me/MyQuoteUpdateBuilder.php new file mode 100644 index 00000000000..c609ef20422 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyQuoteUpdateBuilder.php @@ -0,0 +1,93 @@ + + */ +final class MyQuoteUpdateBuilder implements Builder +{ + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?MyQuoteUpdateActionCollection + */ + private $actions; + + /** + *

    Expected version of the Quote to which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Update actions to be performed on the Quote.

    + * + + * @return null|MyQuoteUpdateActionCollection + */ + public function getActions() + { + return $this->actions; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?MyQuoteUpdateActionCollection $actions + * @return $this + */ + public function withActions(?MyQuoteUpdateActionCollection $actions) + { + $this->actions = $actions; + + return $this; + } + + + public function build(): MyQuoteUpdate + { + return new MyQuoteUpdateModel( + $this->version, + $this->actions + ); + } + + public static function of(): MyQuoteUpdateBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteUpdateCollection.php b/lib/commercetools-api/src/Models/Me/MyQuoteUpdateCollection.php new file mode 100644 index 00000000000..9d0cef91375 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyQuoteUpdateCollection.php @@ -0,0 +1,56 @@ + + * @method MyQuoteUpdate current() + * @method MyQuoteUpdate end() + * @method MyQuoteUpdate at($offset) + */ +class MyQuoteUpdateCollection extends MapperSequence +{ + /** + * @psalm-assert MyQuoteUpdate $value + * @psalm-param MyQuoteUpdate|stdClass $value + * @throws InvalidArgumentException + * + * @return MyQuoteUpdateCollection + */ + public function add($value) + { + if (!$value instanceof MyQuoteUpdate) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MyQuoteUpdate + */ + protected function mapper() + { + return function (?int $index): ?MyQuoteUpdate { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MyQuoteUpdate $data */ + $data = MyQuoteUpdateModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyQuoteUpdateModel.php b/lib/commercetools-api/src/Models/Me/MyQuoteUpdateModel.php new file mode 100644 index 00000000000..a360f6c9793 --- /dev/null +++ b/lib/commercetools-api/src/Models/Me/MyQuoteUpdateModel.php @@ -0,0 +1,103 @@ +version = $version; + $this->actions = $actions; + } + + /** + *

    Expected version of the Quote to which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Update actions to be performed on the Quote.

    + * + * + * @return null|MyQuoteUpdateActionCollection + */ + public function getActions() + { + if (is_null($this->actions)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ACTIONS); + if (is_null($data)) { + return null; + } + $this->actions = MyQuoteUpdateActionCollection::fromArray($data); + } + + return $this->actions; + } + + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?MyQuoteUpdateActionCollection $actions + */ + public function setActions(?MyQuoteUpdateActionCollection $actions): void + { + $this->actions = $actions; + } +} diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemAction.php index 7792f7bbcbd..eaea2a6ea22 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemAction.php @@ -23,26 +23,31 @@ interface MyShoppingListAddLineItemAction extends MyShoppingListUpdateAction public const FIELD_CUSTOM = 'custom'; /** + * @return null|string */ public function getSku(); /** + * @return null|string */ public function getProductId(); /** + * @return null|int */ public function getVariantId(); /** + * @return null|int */ public function getQuantity(); /** + * @return null|DateTimeImmutable */ public function getAddedAt(); @@ -50,6 +55,7 @@ public function getAddedAt(); /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemActionBuilder.php index 5780d59f865..cc1069ad9d6 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemActionBuilder.php @@ -24,36 +24,43 @@ final class MyShoppingListAddLineItemActionBuilder implements Builder { /** + * @var ?string */ private $sku; /** + * @var ?string */ private $productId; /** + * @var ?int */ private $variantId; /** + * @var ?int */ private $quantity; /** + * @var ?DateTimeImmutable */ private $addedAt; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @return null|string */ public function getSku() @@ -62,6 +69,7 @@ public function getSku() } /** + * @return null|string */ public function getProductId() @@ -70,6 +78,7 @@ public function getProductId() } /** + * @return null|int */ public function getVariantId() @@ -78,6 +87,7 @@ public function getVariantId() } /** + * @return null|int */ public function getQuantity() @@ -86,6 +96,7 @@ public function getQuantity() } /** + * @return null|DateTimeImmutable */ public function getAddedAt() @@ -96,6 +107,7 @@ public function getAddedAt() /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemActionModel.php index 1861ec8d2dc..d6ac7a814f2 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemActionModel.php @@ -24,36 +24,43 @@ final class MyShoppingListAddLineItemActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'addLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $productId; /** + * * @var ?int */ protected $variantId; /** + * * @var ?int */ protected $quantity; /** + * * @var ?DateTimeImmutable */ protected $addedAt; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -68,7 +75,8 @@ public function __construct( ?int $variantId = null, ?int $quantity = null, ?DateTimeImmutable $addedAt = null, - ?CustomFieldsDraft $custom = null + ?CustomFieldsDraft $custom = null, + ?string $action = null ) { $this->sku = $sku; $this->productId = $productId; @@ -76,10 +84,11 @@ public function __construct( $this->quantity = $quantity; $this->addedAt = $addedAt; $this->custom = $custom; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -97,6 +106,7 @@ public function getAction() } /** + * * @return null|string */ public function getSku() @@ -114,6 +124,7 @@ public function getSku() } /** + * * @return null|string */ public function getProductId() @@ -131,6 +142,7 @@ public function getProductId() } /** + * * @return null|int */ public function getVariantId() @@ -148,6 +160,7 @@ public function getVariantId() } /** + * * @return null|int */ public function getQuantity() @@ -165,6 +178,7 @@ public function getQuantity() } /** + * * @return null|DateTimeImmutable */ public function getAddedAt() @@ -188,6 +202,7 @@ public function getAddedAt() /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemAction.php index e1559b86b9e..f134b1f64c9 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemAction.php @@ -25,6 +25,7 @@ interface MyShoppingListAddTextLineItemAction extends MyShoppingListUpdateAction /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getName(); @@ -32,16 +33,19 @@ public function getName(); /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getDescription(); /** + * @return null|int */ public function getQuantity(); /** + * @return null|DateTimeImmutable */ public function getAddedAt(); @@ -49,6 +53,7 @@ public function getAddedAt(); /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemActionBuilder.php index 2705e01e0d1..4b7335885e2 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemActionBuilder.php @@ -26,26 +26,31 @@ final class MyShoppingListAddTextLineItemActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?int */ private $quantity; /** + * @var ?DateTimeImmutable */ private $addedAt; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; @@ -53,6 +58,7 @@ final class MyShoppingListAddTextLineItemActionBuilder implements Builder /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getName() @@ -63,6 +69,7 @@ public function getName() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getDescription() @@ -71,6 +78,7 @@ public function getDescription() } /** + * @return null|int */ public function getQuantity() @@ -79,6 +87,7 @@ public function getQuantity() } /** + * @return null|DateTimeImmutable */ public function getAddedAt() @@ -89,6 +98,7 @@ public function getAddedAt() /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemActionModel.php index bdf60830881..fb897190a75 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemActionModel.php @@ -26,31 +26,37 @@ final class MyShoppingListAddTextLineItemActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'addTextLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?int */ protected $quantity; /** + * * @var ?DateTimeImmutable */ protected $addedAt; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -64,17 +70,19 @@ public function __construct( ?LocalizedString $description = null, ?int $quantity = null, ?DateTimeImmutable $addedAt = null, - ?CustomFieldsDraft $custom = null + ?CustomFieldsDraft $custom = null, + ?string $action = null ) { $this->name = $name; $this->description = $description; $this->quantity = $quantity; $this->addedAt = $addedAt; $this->custom = $custom; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -94,6 +102,7 @@ public function getAction() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * * @return null|LocalizedString */ public function getName() @@ -114,6 +123,7 @@ public function getName() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * * @return null|LocalizedString */ public function getDescription() @@ -132,6 +142,7 @@ public function getDescription() } /** + * * @return null|int */ public function getQuantity() @@ -149,6 +160,7 @@ public function getQuantity() } /** + * * @return null|DateTimeImmutable */ public function getAddedAt() @@ -172,6 +184,7 @@ public function getAddedAt() /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityAction.php index a0e8dbfdab3..2141b6cc77d 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityAction.php @@ -17,11 +17,13 @@ interface MyShoppingListChangeLineItemQuantityAction extends MyShoppingListUpdat public const FIELD_QUANTITY = 'quantity'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityActionBuilder.php index e61a55ba052..a43b198d083 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityActionBuilder.php @@ -21,16 +21,19 @@ final class MyShoppingListChangeLineItemQuantityActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?int */ private $quantity; /** + * @return null|string */ public function getLineItemId() @@ -39,6 +42,7 @@ public function getLineItemId() } /** + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityActionModel.php index 6c488988bb4..13adc0f74e1 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityActionModel.php @@ -21,16 +21,19 @@ final class MyShoppingListChangeLineItemQuantityActionModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'changeLineItemQuantity'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?int */ protected $quantity; @@ -41,14 +44,16 @@ final class MyShoppingListChangeLineItemQuantityActionModel extends JsonObjectMo */ public function __construct( ?string $lineItemId = null, - ?int $quantity = null + ?int $quantity = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->quantity = $quantity; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -83,6 +89,7 @@ public function getLineItemId() } /** + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemsOrderAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemsOrderAction.php index 10645e79cb8..a2ce28049d5 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemsOrderAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemsOrderAction.php @@ -16,6 +16,7 @@ interface MyShoppingListChangeLineItemsOrderAction extends MyShoppingListUpdateA public const FIELD_LINE_ITEM_ORDER = 'lineItemOrder'; /** + * @return null|array */ public function getLineItemOrder(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemsOrderActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemsOrderActionBuilder.php index 4ef306d8433..affb44fc6c4 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemsOrderActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemsOrderActionBuilder.php @@ -21,11 +21,13 @@ final class MyShoppingListChangeLineItemsOrderActionBuilder implements Builder { /** + * @var ?array */ private $lineItemOrder; /** + * @return null|array */ public function getLineItemOrder() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemsOrderActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemsOrderActionModel.php index 7c7d74454dd..a7daa51b7c8 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemsOrderActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemsOrderActionModel.php @@ -21,11 +21,13 @@ final class MyShoppingListChangeLineItemsOrderActionModel extends JsonObjectMode { public const DISCRIMINATOR_VALUE = 'changeLineItemsOrder'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $lineItemOrder; @@ -35,13 +37,15 @@ final class MyShoppingListChangeLineItemsOrderActionModel extends JsonObjectMode * @psalm-suppress MissingParamType */ public function __construct( - ?array $lineItemOrder = null + ?array $lineItemOrder = null, + ?string $action = null ) { $this->lineItemOrder = $lineItemOrder; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|array */ public function getLineItemOrder() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeNameAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeNameAction.php index 2c0a8fd11dc..abc226ef70c 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeNameAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeNameAction.php @@ -19,6 +19,7 @@ interface MyShoppingListChangeNameAction extends MyShoppingListUpdateAction /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeNameActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeNameActionBuilder.php index 2e7391d8eac..fce2bf23a23 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeNameActionBuilder.php @@ -23,6 +23,7 @@ final class MyShoppingListChangeNameActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; @@ -30,6 +31,7 @@ final class MyShoppingListChangeNameActionBuilder implements Builder /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeNameActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeNameActionModel.php index 7b472e0c423..578b52f4f8e 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeNameActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeNameActionModel.php @@ -23,11 +23,13 @@ final class MyShoppingListChangeNameActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'changeName'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $name; @@ -37,13 +39,15 @@ final class MyShoppingListChangeNameActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameAction.php index 6cda6026947..331ad0c4b85 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameAction.php @@ -18,6 +18,7 @@ interface MyShoppingListChangeTextLineItemNameAction extends MyShoppingListUpdat public const FIELD_NAME = 'name'; /** + * @return null|string */ public function getTextLineItemId(); @@ -25,6 +26,7 @@ public function getTextLineItemId(); /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameActionBuilder.php index 1bd62447a66..7994e038f0f 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameActionBuilder.php @@ -23,16 +23,19 @@ final class MyShoppingListChangeTextLineItemNameActionBuilder implements Builder { /** + * @var ?string */ private $textLineItemId; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @return null|string */ public function getTextLineItemId() @@ -43,6 +46,7 @@ public function getTextLineItemId() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameActionModel.php index 53946d4815c..5df7e2dd8d1 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameActionModel.php @@ -23,16 +23,19 @@ final class MyShoppingListChangeTextLineItemNameActionModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'changeTextLineItemName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $textLineItemId; /** + * * @var ?LocalizedString */ protected $name; @@ -43,14 +46,16 @@ final class MyShoppingListChangeTextLineItemNameActionModel extends JsonObjectMo */ public function __construct( ?string $textLineItemId = null, - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $action = null ) { $this->textLineItemId = $textLineItemId; $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|string */ public function getTextLineItemId() @@ -87,6 +93,7 @@ public function getTextLineItemId() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityAction.php index f26dc7b74b3..74377d88800 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityAction.php @@ -17,11 +17,13 @@ interface MyShoppingListChangeTextLineItemQuantityAction extends MyShoppingListU public const FIELD_QUANTITY = 'quantity'; /** + * @return null|string */ public function getTextLineItemId(); /** + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityActionBuilder.php index 1f56edc5422..93d57343cb2 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityActionBuilder.php @@ -21,16 +21,19 @@ final class MyShoppingListChangeTextLineItemQuantityActionBuilder implements Builder { /** + * @var ?string */ private $textLineItemId; /** + * @var ?int */ private $quantity; /** + * @return null|string */ public function getTextLineItemId() @@ -39,6 +42,7 @@ public function getTextLineItemId() } /** + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityActionModel.php index 55582eba9f1..ca675a2f614 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityActionModel.php @@ -21,16 +21,19 @@ final class MyShoppingListChangeTextLineItemQuantityActionModel extends JsonObje { public const DISCRIMINATOR_VALUE = 'changeTextLineItemQuantity'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $textLineItemId; /** + * * @var ?int */ protected $quantity; @@ -41,14 +44,16 @@ final class MyShoppingListChangeTextLineItemQuantityActionModel extends JsonObje */ public function __construct( ?string $textLineItemId = null, - ?int $quantity = null + ?int $quantity = null, + ?string $action = null ) { $this->textLineItemId = $textLineItemId; $this->quantity = $quantity; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getTextLineItemId() @@ -83,6 +89,7 @@ public function getTextLineItemId() } /** + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemsOrderAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemsOrderAction.php index 538f1a9a825..6361316e78b 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemsOrderAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemsOrderAction.php @@ -16,6 +16,7 @@ interface MyShoppingListChangeTextLineItemsOrderAction extends MyShoppingListUpd public const FIELD_TEXT_LINE_ITEM_ORDER = 'textLineItemOrder'; /** + * @return null|array */ public function getTextLineItemOrder(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemsOrderActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemsOrderActionBuilder.php index 0484072e185..1af04336886 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemsOrderActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemsOrderActionBuilder.php @@ -21,11 +21,13 @@ final class MyShoppingListChangeTextLineItemsOrderActionBuilder implements Builder { /** + * @var ?array */ private $textLineItemOrder; /** + * @return null|array */ public function getTextLineItemOrder() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemsOrderActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemsOrderActionModel.php index 5c7a5772117..056c488694d 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemsOrderActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemsOrderActionModel.php @@ -21,11 +21,13 @@ final class MyShoppingListChangeTextLineItemsOrderActionModel extends JsonObject { public const DISCRIMINATOR_VALUE = 'changeTextLineItemsOrder'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $textLineItemOrder; @@ -35,13 +37,15 @@ final class MyShoppingListChangeTextLineItemsOrderActionModel extends JsonObject * @psalm-suppress MissingParamType */ public function __construct( - ?array $textLineItemOrder = null + ?array $textLineItemOrder = null, + ?string $action = null ) { $this->textLineItemOrder = $textLineItemOrder; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|array */ public function getTextLineItemOrder() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListDraft.php b/lib/commercetools-api/src/Models/Me/MyShoppingListDraft.php index 2be3a2a8f3c..ff8f3a95ea7 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListDraft.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListDraft.php @@ -27,21 +27,25 @@ interface MyShoppingListDraft extends JsonObject public const FIELD_STORE = 'store'; /** + * @return null|LocalizedString */ public function getName(); /** + * @return null|LocalizedString */ public function getDescription(); /** + * @return null|ShoppingListLineItemDraftCollection */ public function getLineItems(); /** + * @return null|TextLineItemDraftCollection */ public function getTextLineItems(); @@ -49,6 +53,7 @@ public function getTextLineItems(); /** *

    The custom fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -56,11 +61,13 @@ public function getCustom(); /** *

    The shopping list will be deleted automatically if it hasn't been modified for the specified amount of days.

    * + * @return null|int */ public function getDeleteDaysAfterLastModification(); /** + * @return null|StoreResourceIdentifier */ public function getStore(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListDraftBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListDraftBuilder.php index 7494f5ed584..c630ca310fb 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListDraftBuilder.php @@ -29,41 +29,49 @@ final class MyShoppingListDraftBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?ShoppingListLineItemDraftCollection */ private $lineItems; /** + * @var ?TextLineItemDraftCollection */ private $textLineItems; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var ?int */ private $deleteDaysAfterLastModification; /** + * @var null|StoreResourceIdentifier|StoreResourceIdentifierBuilder */ private $store; /** + * @return null|LocalizedString */ public function getName() @@ -72,6 +80,7 @@ public function getName() } /** + * @return null|LocalizedString */ public function getDescription() @@ -80,6 +89,7 @@ public function getDescription() } /** + * @return null|ShoppingListLineItemDraftCollection */ public function getLineItems() @@ -88,6 +98,7 @@ public function getLineItems() } /** + * @return null|TextLineItemDraftCollection */ public function getTextLineItems() @@ -98,6 +109,7 @@ public function getTextLineItems() /** *

    The custom fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -108,6 +120,7 @@ public function getCustom() /** *

    The shopping list will be deleted automatically if it hasn't been modified for the specified amount of days.

    * + * @return null|int */ public function getDeleteDaysAfterLastModification() @@ -116,6 +129,7 @@ public function getDeleteDaysAfterLastModification() } /** + * @return null|StoreResourceIdentifier */ public function getStore() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListDraftModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListDraftModel.php index a27d08333cf..1d9b285dbb6 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListDraftModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListDraftModel.php @@ -28,36 +28,43 @@ final class MyShoppingListDraftModel extends JsonObjectModel implements MyShoppingListDraft { /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?ShoppingListLineItemDraftCollection */ protected $lineItems; /** + * * @var ?TextLineItemDraftCollection */ protected $textLineItems; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?int */ protected $deleteDaysAfterLastModification; /** + * * @var ?StoreResourceIdentifier */ protected $store; @@ -85,6 +92,7 @@ public function __construct( } /** + * * @return null|LocalizedString */ public function getName() @@ -103,6 +111,7 @@ public function getName() } /** + * * @return null|LocalizedString */ public function getDescription() @@ -121,6 +130,7 @@ public function getDescription() } /** + * * @return null|ShoppingListLineItemDraftCollection */ public function getLineItems() @@ -138,6 +148,7 @@ public function getLineItems() } /** + * * @return null|TextLineItemDraftCollection */ public function getTextLineItems() @@ -157,6 +168,7 @@ public function getTextLineItems() /** *

    The custom fields.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -177,6 +189,7 @@ public function getCustom() /** *

    The shopping list will be deleted automatically if it hasn't been modified for the specified amount of days.

    * + * * @return null|int */ public function getDeleteDaysAfterLastModification() @@ -194,6 +207,7 @@ public function getDeleteDaysAfterLastModification() } /** + * * @return null|StoreResourceIdentifier */ public function getStore() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemAction.php index 21fc94c3d5f..b4fe834e390 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemAction.php @@ -17,11 +17,13 @@ interface MyShoppingListRemoveLineItemAction extends MyShoppingListUpdateAction public const FIELD_QUANTITY = 'quantity'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemActionBuilder.php index 5d72db8419a..178ef68c9e8 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemActionBuilder.php @@ -21,16 +21,19 @@ final class MyShoppingListRemoveLineItemActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?int */ private $quantity; /** + * @return null|string */ public function getLineItemId() @@ -39,6 +42,7 @@ public function getLineItemId() } /** + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemActionModel.php index c2d73183f72..a620e90dbcf 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemActionModel.php @@ -21,16 +21,19 @@ final class MyShoppingListRemoveLineItemActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'removeLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?int */ protected $quantity; @@ -41,14 +44,16 @@ final class MyShoppingListRemoveLineItemActionModel extends JsonObjectModel impl */ public function __construct( ?string $lineItemId = null, - ?int $quantity = null + ?int $quantity = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->quantity = $quantity; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -83,6 +89,7 @@ public function getLineItemId() } /** + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemAction.php index 6214a3b880f..195cd47d206 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemAction.php @@ -17,11 +17,13 @@ interface MyShoppingListRemoveTextLineItemAction extends MyShoppingListUpdateAct public const FIELD_QUANTITY = 'quantity'; /** + * @return null|string */ public function getTextLineItemId(); /** + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemActionBuilder.php index 476daace063..fc5c3b28455 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemActionBuilder.php @@ -21,16 +21,19 @@ final class MyShoppingListRemoveTextLineItemActionBuilder implements Builder { /** + * @var ?string */ private $textLineItemId; /** + * @var ?int */ private $quantity; /** + * @return null|string */ public function getTextLineItemId() @@ -39,6 +42,7 @@ public function getTextLineItemId() } /** + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemActionModel.php index 4dfdecfae03..9b555994ab4 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemActionModel.php @@ -21,16 +21,19 @@ final class MyShoppingListRemoveTextLineItemActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'removeTextLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $textLineItemId; /** + * * @var ?int */ protected $quantity; @@ -41,14 +44,16 @@ final class MyShoppingListRemoveTextLineItemActionModel extends JsonObjectModel */ public function __construct( ?string $textLineItemId = null, - ?int $quantity = null + ?int $quantity = null, + ?string $action = null ) { $this->textLineItemId = $textLineItemId; $this->quantity = $quantity; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getTextLineItemId() @@ -83,6 +89,7 @@ public function getTextLineItemId() } /** + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomFieldAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomFieldAction.php index 2a8196532dc..c60f3422ca0 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface MyShoppingListSetCustomFieldAction extends MyShoppingListUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomFieldActionBuilder.php index 8b6f55c6a6c..1bf0f166625 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class MyShoppingListSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class MyShoppingListSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomFieldActionModel.php index faa023f9785..72439d9289a 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class MyShoppingListSetCustomFieldActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class MyShoppingListSetCustomFieldActionModel extends JsonObjectModel impl */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomTypeAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomTypeAction.php index c2038b21cb7..53499ab1085 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface MyShoppingListSetCustomTypeAction extends MyShoppingListUpdateAction *

    Defines the Type that extends the MyShoppingList with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the MyShoppingList.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the MyShoppingList.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomTypeActionBuilder.php index 6ba9ca40e32..ab8a0a52871 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class MyShoppingListSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class MyShoppingListSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the MyShoppingList with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the MyShoppingList.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the MyShoppingList.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomTypeActionModel.php index af2b2d64306..b8793e40826 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class MyShoppingListSetCustomTypeActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class MyShoppingListSetCustomTypeActionModel extends JsonObjectModel imple */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the MyShoppingList with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the MyShoppingList.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the MyShoppingList.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetDeleteDaysAfterLastModificationAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetDeleteDaysAfterLastModificationAction.php index 7740cf7cfc4..63e6c025704 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetDeleteDaysAfterLastModificationAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetDeleteDaysAfterLastModificationAction.php @@ -16,6 +16,7 @@ interface MyShoppingListSetDeleteDaysAfterLastModificationAction extends MyShopp public const FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION = 'deleteDaysAfterLastModification'; /** + * @return null|int */ public function getDeleteDaysAfterLastModification(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetDeleteDaysAfterLastModificationActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetDeleteDaysAfterLastModificationActionBuilder.php index 05a4f100e6e..7a08c56f24c 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetDeleteDaysAfterLastModificationActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetDeleteDaysAfterLastModificationActionBuilder.php @@ -21,11 +21,13 @@ final class MyShoppingListSetDeleteDaysAfterLastModificationActionBuilder implements Builder { /** + * @var ?int */ private $deleteDaysAfterLastModification; /** + * @return null|int */ public function getDeleteDaysAfterLastModification() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetDeleteDaysAfterLastModificationActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetDeleteDaysAfterLastModificationActionModel.php index 75fc4f0de89..f035245077e 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetDeleteDaysAfterLastModificationActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetDeleteDaysAfterLastModificationActionModel.php @@ -21,11 +21,13 @@ final class MyShoppingListSetDeleteDaysAfterLastModificationActionModel extends { public const DISCRIMINATOR_VALUE = 'setDeleteDaysAfterLastModification'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $deleteDaysAfterLastModification; @@ -35,13 +37,15 @@ final class MyShoppingListSetDeleteDaysAfterLastModificationActionModel extends * @psalm-suppress MissingParamType */ public function __construct( - ?int $deleteDaysAfterLastModification = null + ?int $deleteDaysAfterLastModification = null, + ?string $action = null ) { $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|int */ public function getDeleteDaysAfterLastModification() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetDescriptionAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetDescriptionAction.php index 25508ce59a9..e094bfaf19e 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetDescriptionAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetDescriptionAction.php @@ -19,6 +19,7 @@ interface MyShoppingListSetDescriptionAction extends MyShoppingListUpdateAction /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getDescription(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetDescriptionActionBuilder.php index 077fddb124c..13bdf8c04ec 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetDescriptionActionBuilder.php @@ -23,6 +23,7 @@ final class MyShoppingListSetDescriptionActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; @@ -30,6 +31,7 @@ final class MyShoppingListSetDescriptionActionBuilder implements Builder /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetDescriptionActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetDescriptionActionModel.php index bba26e3bc58..bfdc7436067 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetDescriptionActionModel.php @@ -23,11 +23,13 @@ final class MyShoppingListSetDescriptionActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $description; @@ -37,13 +39,15 @@ final class MyShoppingListSetDescriptionActionModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $description = null + ?LocalizedString $description = null, + ?string $action = null ) { $this->description = $description; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldAction.php index 62e36a71b47..7c6ed157491 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldAction.php @@ -18,6 +18,7 @@ interface MyShoppingListSetLineItemCustomFieldAction extends MyShoppingListUpdat public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getLineItemId(); @@ -25,6 +26,7 @@ public function getLineItemId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -34,6 +36,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldActionBuilder.php index 4a02363e943..18490f0f601 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class MyShoppingListSetLineItemCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getLineItemId() @@ -46,6 +50,7 @@ public function getLineItemId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -58,6 +63,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldActionModel.php index 7e6465838e3..1b2fc9dc79c 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class MyShoppingListSetLineItemCustomFieldActionModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'setLineItemCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class MyShoppingListSetLineItemCustomFieldActionModel extends JsonObjectMo public function __construct( ?string $lineItemId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -92,6 +99,7 @@ public function getLineItemId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -113,6 +121,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomTypeAction.php index c3423ceb479..defca6b1a5f 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomTypeAction.php @@ -20,6 +20,7 @@ interface MyShoppingListSetLineItemCustomTypeAction extends MyShoppingListUpdate public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getLineItemId(); @@ -28,6 +29,7 @@ public function getLineItemId(); *

    Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -35,6 +37,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the LineItem.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomTypeActionBuilder.php index cd1a40db59b..ee1da5bceb7 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class MyShoppingListSetLineItemCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getLineItemId() @@ -51,6 +55,7 @@ public function getLineItemId() *

    Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -61,6 +66,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the LineItem.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomTypeActionModel.php index 8f384f9c0f0..75375d6b9b1 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomTypeActionModel.php @@ -25,21 +25,25 @@ final class MyShoppingListSetLineItemCustomTypeActionModel extends JsonObjectMod { public const DISCRIMINATOR_VALUE = 'setLineItemCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -51,15 +55,17 @@ final class MyShoppingListSetLineItemCustomTypeActionModel extends JsonObjectMod public function __construct( ?string $lineItemId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -97,6 +104,7 @@ public function getLineItemId() *

    Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the LineItem.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldAction.php index fdcb8e022c2..3fe8e3e06a6 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldAction.php @@ -18,6 +18,7 @@ interface MyShoppingListSetTextLineItemCustomFieldAction extends MyShoppingListU public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getTextLineItemId(); @@ -25,6 +26,7 @@ public function getTextLineItemId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -34,6 +36,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldActionBuilder.php index e76e17222e4..50ca1742023 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class MyShoppingListSetTextLineItemCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $textLineItemId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getTextLineItemId() @@ -46,6 +50,7 @@ public function getTextLineItemId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -58,6 +63,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldActionModel.php index 864a2419a37..1dbd5c033ad 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class MyShoppingListSetTextLineItemCustomFieldActionModel extends JsonObje { public const DISCRIMINATOR_VALUE = 'setTextLineItemCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $textLineItemId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class MyShoppingListSetTextLineItemCustomFieldActionModel extends JsonObje public function __construct( ?string $textLineItemId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->textLineItemId = $textLineItemId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,7 @@ public function getAction() } /** + * * @return null|string */ public function getTextLineItemId() @@ -92,6 +99,7 @@ public function getTextLineItemId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -113,6 +121,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeAction.php index c10cd7d2112..26d50bf2cf8 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeAction.php @@ -20,6 +20,7 @@ interface MyShoppingListSetTextLineItemCustomTypeAction extends MyShoppingListUp public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getTextLineItemId(); @@ -28,6 +29,7 @@ public function getTextLineItemId(); *

    Defines the Type that extends the TextLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the TextLineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -35,6 +37,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the TextLineItem.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeActionBuilder.php index 78c3da5e7d3..499f70b280a 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class MyShoppingListSetTextLineItemCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $textLineItemId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getTextLineItemId() @@ -51,6 +55,7 @@ public function getTextLineItemId() *

    Defines the Type that extends the TextLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the TextLineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -61,6 +66,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the TextLineItem.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeActionModel.php index 528d3e51b51..21cd5dbc0f4 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeActionModel.php @@ -25,21 +25,25 @@ final class MyShoppingListSetTextLineItemCustomTypeActionModel extends JsonObjec { public const DISCRIMINATOR_VALUE = 'setTextLineItemCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $textLineItemId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -51,15 +55,17 @@ final class MyShoppingListSetTextLineItemCustomTypeActionModel extends JsonObjec public function __construct( ?string $textLineItemId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->textLineItemId = $textLineItemId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getTextLineItemId() @@ -97,6 +104,7 @@ public function getTextLineItemId() *

    Defines the Type that extends the TextLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the TextLineItem.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the TextLineItem.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionAction.php index bc05a42cf21..1cb9455571a 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionAction.php @@ -18,6 +18,7 @@ interface MyShoppingListSetTextLineItemDescriptionAction extends MyShoppingListU public const FIELD_DESCRIPTION = 'description'; /** + * @return null|string */ public function getTextLineItemId(); @@ -25,6 +26,7 @@ public function getTextLineItemId(); /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getDescription(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionActionBuilder.php index 595ac10e130..ed4101bbe7c 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionActionBuilder.php @@ -23,16 +23,19 @@ final class MyShoppingListSetTextLineItemDescriptionActionBuilder implements Builder { /** + * @var ?string */ private $textLineItemId; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @return null|string */ public function getTextLineItemId() @@ -43,6 +46,7 @@ public function getTextLineItemId() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionActionModel.php index ec29519b6e8..2c5baefaef6 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionActionModel.php @@ -23,16 +23,19 @@ final class MyShoppingListSetTextLineItemDescriptionActionModel extends JsonObje { public const DISCRIMINATOR_VALUE = 'setTextLineItemDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $textLineItemId; /** + * * @var ?LocalizedString */ protected $description; @@ -43,14 +46,16 @@ final class MyShoppingListSetTextLineItemDescriptionActionModel extends JsonObje */ public function __construct( ?string $textLineItemId = null, - ?LocalizedString $description = null + ?LocalizedString $description = null, + ?string $action = null ) { $this->textLineItemId = $textLineItemId; $this->description = $description; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|string */ public function getTextLineItemId() @@ -87,6 +93,7 @@ public function getTextLineItemId() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListUpdate.php b/lib/commercetools-api/src/Models/Me/MyShoppingListUpdate.php index 7a1a5a93b25..ae58ea51a40 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListUpdate.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListUpdate.php @@ -17,11 +17,13 @@ interface MyShoppingListUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + * @return null|int */ public function getVersion(); /** + * @return null|MyShoppingListUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListUpdateAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListUpdateAction.php index 6bb05732d79..12971074721 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListUpdateAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListUpdateAction.php @@ -17,6 +17,7 @@ interface MyShoppingListUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListUpdateActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListUpdateActionModel.php index 28fdaacc01d..38b2d45c1a4 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListUpdateActionModel.php @@ -21,6 +21,7 @@ final class MyShoppingListUpdateActionModel extends JsonObjectModel implements M { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -55,11 +56,13 @@ final class MyShoppingListUpdateActionModel extends JsonObjectModel implements M * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListUpdateBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListUpdateBuilder.php index 5bd1d8a1d89..858bef0eedd 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListUpdateBuilder.php @@ -21,16 +21,19 @@ final class MyShoppingListUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?MyShoppingListUpdateActionCollection */ private $actions; /** + * @return null|int */ public function getVersion() @@ -39,6 +42,7 @@ public function getVersion() } /** + * @return null|MyShoppingListUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListUpdateModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListUpdateModel.php index 336e7705550..ac99836e5d7 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListUpdateModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListUpdateModel.php @@ -20,11 +20,13 @@ final class MyShoppingListUpdateModel extends JsonObjectModel implements MyShoppingListUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?MyShoppingListUpdateActionCollection */ protected $actions; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|int */ public function getVersion() @@ -59,6 +62,7 @@ public function getVersion() } /** + * * @return null|MyShoppingListUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Me/MyTransactionDraft.php b/lib/commercetools-api/src/Models/Me/MyTransactionDraft.php index 932212f10cd..6534c4dd2ca 100644 --- a/lib/commercetools-api/src/Models/Me/MyTransactionDraft.php +++ b/lib/commercetools-api/src/Models/Me/MyTransactionDraft.php @@ -25,6 +25,7 @@ interface MyTransactionDraft extends JsonObject /** *

    The time at which the transaction took place.

    * + * @return null|DateTimeImmutable */ public function getTimestamp(); @@ -34,11 +35,13 @@ public function getTimestamp(); * Only the Authorization or Charge * TransactionTypes are allowed here.

    * + * @return null|string */ public function getType(); /** + * @return null|Money */ public function getAmount(); @@ -49,6 +52,7 @@ public function getAmount(); * the corresponding interaction should be findable with this ID. * The state is set to the Initial TransactionState.

    * + * @return null|string */ public function getInteractionId(); @@ -56,6 +60,7 @@ public function getInteractionId(); /** *

    Custom Fields for the Transaction.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Me/MyTransactionDraftBuilder.php b/lib/commercetools-api/src/Models/Me/MyTransactionDraftBuilder.php index 475a872e5d5..9f99f3834a7 100644 --- a/lib/commercetools-api/src/Models/Me/MyTransactionDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyTransactionDraftBuilder.php @@ -26,26 +26,31 @@ final class MyTransactionDraftBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $timestamp; /** + * @var ?string */ private $type; /** + * @var null|Money|MoneyBuilder */ private $amount; /** + * @var ?string */ private $interactionId; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; @@ -53,6 +58,7 @@ final class MyTransactionDraftBuilder implements Builder /** *

    The time at which the transaction took place.

    * + * @return null|DateTimeImmutable */ public function getTimestamp() @@ -65,6 +71,7 @@ public function getTimestamp() * Only the Authorization or Charge * TransactionTypes are allowed here.

    * + * @return null|string */ public function getType() @@ -73,6 +80,7 @@ public function getType() } /** + * @return null|Money */ public function getAmount() @@ -86,6 +94,7 @@ public function getAmount() * the corresponding interaction should be findable with this ID. * The state is set to the Initial TransactionState.

    * + * @return null|string */ public function getInteractionId() @@ -96,6 +105,7 @@ public function getInteractionId() /** *

    Custom Fields for the Transaction.

    * + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Me/MyTransactionDraftModel.php b/lib/commercetools-api/src/Models/Me/MyTransactionDraftModel.php index 0a51e9a7c2c..a18d5e05b32 100644 --- a/lib/commercetools-api/src/Models/Me/MyTransactionDraftModel.php +++ b/lib/commercetools-api/src/Models/Me/MyTransactionDraftModel.php @@ -25,26 +25,31 @@ final class MyTransactionDraftModel extends JsonObjectModel implements MyTransactionDraft { /** + * * @var ?DateTimeImmutable */ protected $timestamp; /** + * * @var ?string */ protected $type; /** + * * @var ?Money */ protected $amount; /** + * * @var ?string */ protected $interactionId; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -70,6 +75,7 @@ public function __construct( /** *

    The time at which the transaction took place.

    * + * * @return null|DateTimeImmutable */ public function getTimestamp() @@ -95,6 +101,7 @@ public function getTimestamp() * Only the Authorization or Charge * TransactionTypes are allowed here.

    * + * * @return null|string */ public function getType() @@ -112,6 +119,7 @@ public function getType() } /** + * * @return null|Money */ public function getAmount() @@ -135,6 +143,7 @@ public function getAmount() * the corresponding interaction should be findable with this ID. * The state is set to the Initial TransactionState.

    * + * * @return null|string */ public function getInteractionId() @@ -154,6 +163,7 @@ public function getInteractionId() /** *

    Custom Fields for the Transaction.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraft.php b/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraft.php index e301e67a437..f7e4fe26d1d 100644 --- a/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraft.php +++ b/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraft.php @@ -18,6 +18,7 @@ interface ReplicaMyCartDraft extends JsonObject public const FIELD_REFERENCE = 'reference'; /** + * @return null|mixed */ public function getReference(); diff --git a/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraftBuilder.php b/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraftBuilder.php index 4a42d4f2446..e65a70fedd7 100644 --- a/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraftBuilder.php @@ -21,11 +21,13 @@ final class ReplicaMyCartDraftBuilder implements Builder { /** + * @var ?JsonObject */ private $reference; /** + * @return null|JsonObject */ public function getReference() diff --git a/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraftModel.php b/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraftModel.php index 9c2bc51d8d4..0ba6da88eab 100644 --- a/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraftModel.php +++ b/lib/commercetools-api/src/Models/Me/ReplicaMyCartDraftModel.php @@ -24,6 +24,7 @@ final class ReplicaMyCartDraftModel extends JsonObjectModel implements ReplicaMyCartDraft { /** + * * @var ?mixed */ protected $reference; @@ -39,6 +40,7 @@ public function __construct( } /** + * * @return ?mixed */ public function getReference() diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessage.php new file mode 100644 index 00000000000..e89dcfb3ba6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessage.php @@ -0,0 +1,31 @@ +The address that was added to the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessageBuilder.php new file mode 100644 index 00000000000..efebe09dd50 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class BusinessUnitAddressAddedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The address that was added to the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitAddressAddedMessage + { + return new BusinessUnitAddressAddedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitAddressAddedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessageCollection.php new file mode 100644 index 00000000000..66112d1c00e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAddressAddedMessage current() + * @method BusinessUnitAddressAddedMessage end() + * @method BusinessUnitAddressAddedMessage at($offset) + */ +class BusinessUnitAddressAddedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitAddressAddedMessage $value + * @psalm-param BusinessUnitAddressAddedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAddressAddedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAddressAddedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAddressAddedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAddressAddedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAddressAddedMessage $data */ + $data = BusinessUnitAddressAddedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessageModel.php new file mode 100644 index 00000000000..1b5a281469a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The address that was added to the Business Unit.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessagePayload.php new file mode 100644 index 00000000000..8cb10c07e78 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessagePayload.php @@ -0,0 +1,31 @@ +The address that was added to the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessagePayloadBuilder.php new file mode 100644 index 00000000000..46d99c923ef --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitAddressAddedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    The address that was added to the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitAddressAddedMessagePayload + { + return new BusinessUnitAddressAddedMessagePayloadModel( + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitAddressAddedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessagePayloadCollection.php new file mode 100644 index 00000000000..3907a696296 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAddressAddedMessagePayload current() + * @method BusinessUnitAddressAddedMessagePayload end() + * @method BusinessUnitAddressAddedMessagePayload at($offset) + */ +class BusinessUnitAddressAddedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitAddressAddedMessagePayload $value + * @psalm-param BusinessUnitAddressAddedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAddressAddedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAddressAddedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAddressAddedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAddressAddedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAddressAddedMessagePayload $data */ + $data = BusinessUnitAddressAddedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessagePayloadModel.php new file mode 100644 index 00000000000..4b263522b42 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressAddedMessagePayloadModel.php @@ -0,0 +1,96 @@ +address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The address that was added to the Business Unit.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessage.php new file mode 100644 index 00000000000..686be6ff2ba --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessage.php @@ -0,0 +1,31 @@ +Updated address of the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessageBuilder.php new file mode 100644 index 00000000000..243079659a0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class BusinessUnitAddressChangedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Updated address of the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitAddressChangedMessage + { + return new BusinessUnitAddressChangedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitAddressChangedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessageCollection.php new file mode 100644 index 00000000000..30606d35189 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAddressChangedMessage current() + * @method BusinessUnitAddressChangedMessage end() + * @method BusinessUnitAddressChangedMessage at($offset) + */ +class BusinessUnitAddressChangedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitAddressChangedMessage $value + * @psalm-param BusinessUnitAddressChangedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAddressChangedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAddressChangedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAddressChangedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAddressChangedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAddressChangedMessage $data */ + $data = BusinessUnitAddressChangedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessageModel.php new file mode 100644 index 00000000000..fd4701d5d28 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Updated address of the Business Unit.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessagePayload.php new file mode 100644 index 00000000000..f7e94fef5b0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessagePayload.php @@ -0,0 +1,31 @@ +Updated address of the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessagePayloadBuilder.php new file mode 100644 index 00000000000..8770f0d871e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitAddressChangedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    Updated address of the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitAddressChangedMessagePayload + { + return new BusinessUnitAddressChangedMessagePayloadModel( + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitAddressChangedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessagePayloadCollection.php new file mode 100644 index 00000000000..05c0d9c5c7e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAddressChangedMessagePayload current() + * @method BusinessUnitAddressChangedMessagePayload end() + * @method BusinessUnitAddressChangedMessagePayload at($offset) + */ +class BusinessUnitAddressChangedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitAddressChangedMessagePayload $value + * @psalm-param BusinessUnitAddressChangedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAddressChangedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAddressChangedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAddressChangedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAddressChangedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAddressChangedMessagePayload $data */ + $data = BusinessUnitAddressChangedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessagePayloadModel.php new file mode 100644 index 00000000000..723c3ec9385 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressChangedMessagePayloadModel.php @@ -0,0 +1,96 @@ +address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Updated address of the Business Unit.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessage.php new file mode 100644 index 00000000000..5eb70918aeb --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessage.php @@ -0,0 +1,31 @@ +The address that was removed from the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessageBuilder.php new file mode 100644 index 00000000000..845da9a965b --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class BusinessUnitAddressRemovedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The address that was removed from the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitAddressRemovedMessage + { + return new BusinessUnitAddressRemovedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitAddressRemovedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessageCollection.php new file mode 100644 index 00000000000..b3fc0c416c3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAddressRemovedMessage current() + * @method BusinessUnitAddressRemovedMessage end() + * @method BusinessUnitAddressRemovedMessage at($offset) + */ +class BusinessUnitAddressRemovedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitAddressRemovedMessage $value + * @psalm-param BusinessUnitAddressRemovedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAddressRemovedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAddressRemovedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAddressRemovedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAddressRemovedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAddressRemovedMessage $data */ + $data = BusinessUnitAddressRemovedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessageModel.php new file mode 100644 index 00000000000..895f665628e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The address that was removed from the Business Unit.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessagePayload.php new file mode 100644 index 00000000000..127fc9ed590 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessagePayload.php @@ -0,0 +1,31 @@ +The address that was removed from the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessagePayloadBuilder.php new file mode 100644 index 00000000000..fd1507b49af --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitAddressRemovedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    The address that was removed from the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitAddressRemovedMessagePayload + { + return new BusinessUnitAddressRemovedMessagePayloadModel( + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitAddressRemovedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessagePayloadCollection.php new file mode 100644 index 00000000000..f92be905de4 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAddressRemovedMessagePayload current() + * @method BusinessUnitAddressRemovedMessagePayload end() + * @method BusinessUnitAddressRemovedMessagePayload at($offset) + */ +class BusinessUnitAddressRemovedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitAddressRemovedMessagePayload $value + * @psalm-param BusinessUnitAddressRemovedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAddressRemovedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAddressRemovedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAddressRemovedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAddressRemovedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAddressRemovedMessagePayload $data */ + $data = BusinessUnitAddressRemovedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessagePayloadModel.php new file mode 100644 index 00000000000..28dd635e1da --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAddressRemovedMessagePayloadModel.php @@ -0,0 +1,96 @@ +address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The address that was removed from the Business Unit.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessage.php new file mode 100644 index 00000000000..f44ecd0bc4b --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessage.php @@ -0,0 +1,31 @@ +The Associate that was added to the Business Unit.

    + * + + * @return null|Associate + */ + public function getAssociate(); + + /** + * @param ?Associate $associate + */ + public function setAssociate(?Associate $associate): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessageBuilder.php new file mode 100644 index 00000000000..94770e676c6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class BusinessUnitAssociateAddedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|Associate|AssociateBuilder + */ + private $associate; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The Associate that was added to the Business Unit.

    + * + + * @return null|Associate + */ + public function getAssociate() + { + return $this->associate instanceof AssociateBuilder ? $this->associate->build() : $this->associate; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?Associate $associate + * @return $this + */ + public function withAssociate(?Associate $associate) + { + $this->associate = $associate; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withAssociate() instead + * @return $this + */ + public function withAssociateBuilder(?AssociateBuilder $associate) + { + $this->associate = $associate; + + return $this; + } + + public function build(): BusinessUnitAssociateAddedMessage + { + return new BusinessUnitAssociateAddedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->associate instanceof AssociateBuilder ? $this->associate->build() : $this->associate + ); + } + + public static function of(): BusinessUnitAssociateAddedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessageCollection.php new file mode 100644 index 00000000000..74f2cf76ca3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAssociateAddedMessage current() + * @method BusinessUnitAssociateAddedMessage end() + * @method BusinessUnitAssociateAddedMessage at($offset) + */ +class BusinessUnitAssociateAddedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitAssociateAddedMessage $value + * @psalm-param BusinessUnitAssociateAddedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAssociateAddedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAssociateAddedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAssociateAddedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAssociateAddedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAssociateAddedMessage $data */ + $data = BusinessUnitAssociateAddedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessageModel.php new file mode 100644 index 00000000000..27f551ce40e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->associate = $associate; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The Associate that was added to the Business Unit.

    + * + * + * @return null|Associate + */ + public function getAssociate() + { + if (is_null($this->associate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ASSOCIATE); + if (is_null($data)) { + return null; + } + + $this->associate = AssociateModel::of($data); + } + + return $this->associate; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?Associate $associate + */ + public function setAssociate(?Associate $associate): void + { + $this->associate = $associate; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessagePayload.php new file mode 100644 index 00000000000..50fd84a7bc3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessagePayload.php @@ -0,0 +1,31 @@ +The Associate that was added to the Business Unit.

    + * + + * @return null|Associate + */ + public function getAssociate(); + + /** + * @param ?Associate $associate + */ + public function setAssociate(?Associate $associate): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessagePayloadBuilder.php new file mode 100644 index 00000000000..ab9d3895430 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitAssociateAddedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|Associate|AssociateBuilder + */ + private $associate; + + /** + *

    The Associate that was added to the Business Unit.

    + * + + * @return null|Associate + */ + public function getAssociate() + { + return $this->associate instanceof AssociateBuilder ? $this->associate->build() : $this->associate; + } + + /** + * @param ?Associate $associate + * @return $this + */ + public function withAssociate(?Associate $associate) + { + $this->associate = $associate; + + return $this; + } + + /** + * @deprecated use withAssociate() instead + * @return $this + */ + public function withAssociateBuilder(?AssociateBuilder $associate) + { + $this->associate = $associate; + + return $this; + } + + public function build(): BusinessUnitAssociateAddedMessagePayload + { + return new BusinessUnitAssociateAddedMessagePayloadModel( + $this->associate instanceof AssociateBuilder ? $this->associate->build() : $this->associate + ); + } + + public static function of(): BusinessUnitAssociateAddedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessagePayloadCollection.php new file mode 100644 index 00000000000..15a68abbdc9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAssociateAddedMessagePayload current() + * @method BusinessUnitAssociateAddedMessagePayload end() + * @method BusinessUnitAssociateAddedMessagePayload at($offset) + */ +class BusinessUnitAssociateAddedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitAssociateAddedMessagePayload $value + * @psalm-param BusinessUnitAssociateAddedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAssociateAddedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAssociateAddedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAssociateAddedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAssociateAddedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAssociateAddedMessagePayload $data */ + $data = BusinessUnitAssociateAddedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessagePayloadModel.php new file mode 100644 index 00000000000..0801880046e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateAddedMessagePayloadModel.php @@ -0,0 +1,96 @@ +associate = $associate; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The Associate that was added to the Business Unit.

    + * + * + * @return null|Associate + */ + public function getAssociate() + { + if (is_null($this->associate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ASSOCIATE); + if (is_null($data)) { + return null; + } + + $this->associate = AssociateModel::of($data); + } + + return $this->associate; + } + + + /** + * @param ?Associate $associate + */ + public function setAssociate(?Associate $associate): void + { + $this->associate = $associate; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessage.php new file mode 100644 index 00000000000..7062bc533e2 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessage.php @@ -0,0 +1,31 @@ +The Associate that was updated.

    + * + + * @return null|Associate + */ + public function getAssociate(); + + /** + * @param ?Associate $associate + */ + public function setAssociate(?Associate $associate): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessageBuilder.php new file mode 100644 index 00000000000..24da77566c3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class BusinessUnitAssociateChangedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|Associate|AssociateBuilder + */ + private $associate; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The Associate that was updated.

    + * + + * @return null|Associate + */ + public function getAssociate() + { + return $this->associate instanceof AssociateBuilder ? $this->associate->build() : $this->associate; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?Associate $associate + * @return $this + */ + public function withAssociate(?Associate $associate) + { + $this->associate = $associate; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withAssociate() instead + * @return $this + */ + public function withAssociateBuilder(?AssociateBuilder $associate) + { + $this->associate = $associate; + + return $this; + } + + public function build(): BusinessUnitAssociateChangedMessage + { + return new BusinessUnitAssociateChangedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->associate instanceof AssociateBuilder ? $this->associate->build() : $this->associate + ); + } + + public static function of(): BusinessUnitAssociateChangedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessageCollection.php new file mode 100644 index 00000000000..0b9529d8e75 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAssociateChangedMessage current() + * @method BusinessUnitAssociateChangedMessage end() + * @method BusinessUnitAssociateChangedMessage at($offset) + */ +class BusinessUnitAssociateChangedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitAssociateChangedMessage $value + * @psalm-param BusinessUnitAssociateChangedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAssociateChangedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAssociateChangedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAssociateChangedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAssociateChangedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAssociateChangedMessage $data */ + $data = BusinessUnitAssociateChangedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessageModel.php new file mode 100644 index 00000000000..01d6a0001cc --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->associate = $associate; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The Associate that was updated.

    + * + * + * @return null|Associate + */ + public function getAssociate() + { + if (is_null($this->associate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ASSOCIATE); + if (is_null($data)) { + return null; + } + + $this->associate = AssociateModel::of($data); + } + + return $this->associate; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?Associate $associate + */ + public function setAssociate(?Associate $associate): void + { + $this->associate = $associate; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessagePayload.php new file mode 100644 index 00000000000..48c012bc8c1 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessagePayload.php @@ -0,0 +1,31 @@ +The Associate that was updated.

    + * + + * @return null|Associate + */ + public function getAssociate(); + + /** + * @param ?Associate $associate + */ + public function setAssociate(?Associate $associate): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessagePayloadBuilder.php new file mode 100644 index 00000000000..a8a85685f48 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitAssociateChangedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|Associate|AssociateBuilder + */ + private $associate; + + /** + *

    The Associate that was updated.

    + * + + * @return null|Associate + */ + public function getAssociate() + { + return $this->associate instanceof AssociateBuilder ? $this->associate->build() : $this->associate; + } + + /** + * @param ?Associate $associate + * @return $this + */ + public function withAssociate(?Associate $associate) + { + $this->associate = $associate; + + return $this; + } + + /** + * @deprecated use withAssociate() instead + * @return $this + */ + public function withAssociateBuilder(?AssociateBuilder $associate) + { + $this->associate = $associate; + + return $this; + } + + public function build(): BusinessUnitAssociateChangedMessagePayload + { + return new BusinessUnitAssociateChangedMessagePayloadModel( + $this->associate instanceof AssociateBuilder ? $this->associate->build() : $this->associate + ); + } + + public static function of(): BusinessUnitAssociateChangedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessagePayloadCollection.php new file mode 100644 index 00000000000..77ba0353439 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAssociateChangedMessagePayload current() + * @method BusinessUnitAssociateChangedMessagePayload end() + * @method BusinessUnitAssociateChangedMessagePayload at($offset) + */ +class BusinessUnitAssociateChangedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitAssociateChangedMessagePayload $value + * @psalm-param BusinessUnitAssociateChangedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAssociateChangedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAssociateChangedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAssociateChangedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAssociateChangedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAssociateChangedMessagePayload $data */ + $data = BusinessUnitAssociateChangedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessagePayloadModel.php new file mode 100644 index 00000000000..fec27f46e41 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateChangedMessagePayloadModel.php @@ -0,0 +1,96 @@ +associate = $associate; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The Associate that was updated.

    + * + * + * @return null|Associate + */ + public function getAssociate() + { + if (is_null($this->associate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ASSOCIATE); + if (is_null($data)) { + return null; + } + + $this->associate = AssociateModel::of($data); + } + + return $this->associate; + } + + + /** + * @param ?Associate $associate + */ + public function setAssociate(?Associate $associate): void + { + $this->associate = $associate; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessage.php new file mode 100644 index 00000000000..2d1f05e4d69 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessage.php @@ -0,0 +1,31 @@ +The Associate that was removed from the Business Unit.

    + * + + * @return null|Associate + */ + public function getAssociate(); + + /** + * @param ?Associate $associate + */ + public function setAssociate(?Associate $associate): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessageBuilder.php new file mode 100644 index 00000000000..431eefe9a2d --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class BusinessUnitAssociateRemovedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|Associate|AssociateBuilder + */ + private $associate; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The Associate that was removed from the Business Unit.

    + * + + * @return null|Associate + */ + public function getAssociate() + { + return $this->associate instanceof AssociateBuilder ? $this->associate->build() : $this->associate; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?Associate $associate + * @return $this + */ + public function withAssociate(?Associate $associate) + { + $this->associate = $associate; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withAssociate() instead + * @return $this + */ + public function withAssociateBuilder(?AssociateBuilder $associate) + { + $this->associate = $associate; + + return $this; + } + + public function build(): BusinessUnitAssociateRemovedMessage + { + return new BusinessUnitAssociateRemovedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->associate instanceof AssociateBuilder ? $this->associate->build() : $this->associate + ); + } + + public static function of(): BusinessUnitAssociateRemovedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessageCollection.php new file mode 100644 index 00000000000..f9b1f8ed619 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAssociateRemovedMessage current() + * @method BusinessUnitAssociateRemovedMessage end() + * @method BusinessUnitAssociateRemovedMessage at($offset) + */ +class BusinessUnitAssociateRemovedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitAssociateRemovedMessage $value + * @psalm-param BusinessUnitAssociateRemovedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAssociateRemovedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAssociateRemovedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAssociateRemovedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAssociateRemovedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAssociateRemovedMessage $data */ + $data = BusinessUnitAssociateRemovedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessageModel.php new file mode 100644 index 00000000000..a9aa8e8707f --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->associate = $associate; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The Associate that was removed from the Business Unit.

    + * + * + * @return null|Associate + */ + public function getAssociate() + { + if (is_null($this->associate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ASSOCIATE); + if (is_null($data)) { + return null; + } + + $this->associate = AssociateModel::of($data); + } + + return $this->associate; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?Associate $associate + */ + public function setAssociate(?Associate $associate): void + { + $this->associate = $associate; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessagePayload.php new file mode 100644 index 00000000000..8a16f0bc8d5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessagePayload.php @@ -0,0 +1,31 @@ +The Associate that was removed from the Business Unit.

    + * + + * @return null|Associate + */ + public function getAssociate(); + + /** + * @param ?Associate $associate + */ + public function setAssociate(?Associate $associate): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessagePayloadBuilder.php new file mode 100644 index 00000000000..e334546e23e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitAssociateRemovedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|Associate|AssociateBuilder + */ + private $associate; + + /** + *

    The Associate that was removed from the Business Unit.

    + * + + * @return null|Associate + */ + public function getAssociate() + { + return $this->associate instanceof AssociateBuilder ? $this->associate->build() : $this->associate; + } + + /** + * @param ?Associate $associate + * @return $this + */ + public function withAssociate(?Associate $associate) + { + $this->associate = $associate; + + return $this; + } + + /** + * @deprecated use withAssociate() instead + * @return $this + */ + public function withAssociateBuilder(?AssociateBuilder $associate) + { + $this->associate = $associate; + + return $this; + } + + public function build(): BusinessUnitAssociateRemovedMessagePayload + { + return new BusinessUnitAssociateRemovedMessagePayloadModel( + $this->associate instanceof AssociateBuilder ? $this->associate->build() : $this->associate + ); + } + + public static function of(): BusinessUnitAssociateRemovedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessagePayloadCollection.php new file mode 100644 index 00000000000..5c53d28e63c --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAssociateRemovedMessagePayload current() + * @method BusinessUnitAssociateRemovedMessagePayload end() + * @method BusinessUnitAssociateRemovedMessagePayload at($offset) + */ +class BusinessUnitAssociateRemovedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitAssociateRemovedMessagePayload $value + * @psalm-param BusinessUnitAssociateRemovedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAssociateRemovedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAssociateRemovedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAssociateRemovedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAssociateRemovedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAssociateRemovedMessagePayload $data */ + $data = BusinessUnitAssociateRemovedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessagePayloadModel.php new file mode 100644 index 00000000000..14c7b9972df --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociateRemovedMessagePayloadModel.php @@ -0,0 +1,96 @@ +associate = $associate; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The Associate that was removed from the Business Unit.

    + * + * + * @return null|Associate + */ + public function getAssociate() + { + if (is_null($this->associate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ASSOCIATE); + if (is_null($data)) { + return null; + } + + $this->associate = AssociateModel::of($data); + } + + return $this->associate; + } + + + /** + * @param ?Associate $associate + */ + public function setAssociate(?Associate $associate): void + { + $this->associate = $associate; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessage.php new file mode 100644 index 00000000000..1fe4f9e0371 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessage.php @@ -0,0 +1,31 @@ +The list of Associates that was updated on the Business Unit.

    + * + + * @return null|AssociateCollection + */ + public function getAssociates(); + + /** + * @param ?AssociateCollection $associates + */ + public function setAssociates(?AssociateCollection $associates): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessageBuilder.php new file mode 100644 index 00000000000..ff89c3b5c92 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessageBuilder.php @@ -0,0 +1,405 @@ + + */ +final class BusinessUnitAssociatesSetMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?AssociateCollection + */ + private $associates; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The list of Associates that was updated on the Business Unit.

    + * + + * @return null|AssociateCollection + */ + public function getAssociates() + { + return $this->associates; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?AssociateCollection $associates + * @return $this + */ + public function withAssociates(?AssociateCollection $associates) + { + $this->associates = $associates; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): BusinessUnitAssociatesSetMessage + { + return new BusinessUnitAssociatesSetMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->associates + ); + } + + public static function of(): BusinessUnitAssociatesSetMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessageCollection.php new file mode 100644 index 00000000000..742dc963e72 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAssociatesSetMessage current() + * @method BusinessUnitAssociatesSetMessage end() + * @method BusinessUnitAssociatesSetMessage at($offset) + */ +class BusinessUnitAssociatesSetMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitAssociatesSetMessage $value + * @psalm-param BusinessUnitAssociatesSetMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAssociatesSetMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAssociatesSetMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAssociatesSetMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAssociatesSetMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAssociatesSetMessage $data */ + $data = BusinessUnitAssociatesSetMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessageModel.php new file mode 100644 index 00000000000..1b3f65c65f6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessageModel.php @@ -0,0 +1,491 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->associates = $associates; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The list of Associates that was updated on the Business Unit.

    + * + * + * @return null|AssociateCollection + */ + public function getAssociates() + { + if (is_null($this->associates)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ASSOCIATES); + if (is_null($data)) { + return null; + } + $this->associates = AssociateCollection::fromArray($data); + } + + return $this->associates; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?AssociateCollection $associates + */ + public function setAssociates(?AssociateCollection $associates): void + { + $this->associates = $associates; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessagePayload.php new file mode 100644 index 00000000000..b7027ee8510 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessagePayload.php @@ -0,0 +1,31 @@ +The list of Associates that was updated on the Business Unit.

    + * + + * @return null|AssociateCollection + */ + public function getAssociates(); + + /** + * @param ?AssociateCollection $associates + */ + public function setAssociates(?AssociateCollection $associates): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessagePayloadBuilder.php new file mode 100644 index 00000000000..4116546cb57 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessagePayloadBuilder.php @@ -0,0 +1,64 @@ + + */ +final class BusinessUnitAssociatesSetMessagePayloadBuilder implements Builder +{ + /** + + * @var ?AssociateCollection + */ + private $associates; + + /** + *

    The list of Associates that was updated on the Business Unit.

    + * + + * @return null|AssociateCollection + */ + public function getAssociates() + { + return $this->associates; + } + + /** + * @param ?AssociateCollection $associates + * @return $this + */ + public function withAssociates(?AssociateCollection $associates) + { + $this->associates = $associates; + + return $this; + } + + + public function build(): BusinessUnitAssociatesSetMessagePayload + { + return new BusinessUnitAssociatesSetMessagePayloadModel( + $this->associates + ); + } + + public static function of(): BusinessUnitAssociatesSetMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessagePayloadCollection.php new file mode 100644 index 00000000000..34817aa562b --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitAssociatesSetMessagePayload current() + * @method BusinessUnitAssociatesSetMessagePayload end() + * @method BusinessUnitAssociatesSetMessagePayload at($offset) + */ +class BusinessUnitAssociatesSetMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitAssociatesSetMessagePayload $value + * @psalm-param BusinessUnitAssociatesSetMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitAssociatesSetMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitAssociatesSetMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitAssociatesSetMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitAssociatesSetMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitAssociatesSetMessagePayload $data */ + $data = BusinessUnitAssociatesSetMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessagePayloadModel.php new file mode 100644 index 00000000000..b660c9720d4 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitAssociatesSetMessagePayloadModel.php @@ -0,0 +1,94 @@ +associates = $associates; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The list of Associates that was updated on the Business Unit.

    + * + * + * @return null|AssociateCollection + */ + public function getAssociates() + { + if (is_null($this->associates)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ASSOCIATES); + if (is_null($data)) { + return null; + } + $this->associates = AssociateCollection::fromArray($data); + } + + return $this->associates; + } + + + /** + * @param ?AssociateCollection $associates + */ + public function setAssociates(?AssociateCollection $associates): void + { + $this->associates = $associates; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessage.php new file mode 100644 index 00000000000..c9089f20a79 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessage.php @@ -0,0 +1,31 @@ +The address that was added to the Business Unit as billing address.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessageBuilder.php new file mode 100644 index 00000000000..666fc831741 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class BusinessUnitBillingAddressAddedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The address that was added to the Business Unit as billing address.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitBillingAddressAddedMessage + { + return new BusinessUnitBillingAddressAddedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitBillingAddressAddedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessageCollection.php new file mode 100644 index 00000000000..53f6fcc499b --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitBillingAddressAddedMessage current() + * @method BusinessUnitBillingAddressAddedMessage end() + * @method BusinessUnitBillingAddressAddedMessage at($offset) + */ +class BusinessUnitBillingAddressAddedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitBillingAddressAddedMessage $value + * @psalm-param BusinessUnitBillingAddressAddedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitBillingAddressAddedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitBillingAddressAddedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitBillingAddressAddedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitBillingAddressAddedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitBillingAddressAddedMessage $data */ + $data = BusinessUnitBillingAddressAddedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessageModel.php new file mode 100644 index 00000000000..0b2cd4e88c9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The address that was added to the Business Unit as billing address.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessagePayload.php new file mode 100644 index 00000000000..35f82dd8c65 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessagePayload.php @@ -0,0 +1,31 @@ +The address that was added to the Business Unit as billing address.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessagePayloadBuilder.php new file mode 100644 index 00000000000..41e8450bfce --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitBillingAddressAddedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    The address that was added to the Business Unit as billing address.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitBillingAddressAddedMessagePayload + { + return new BusinessUnitBillingAddressAddedMessagePayloadModel( + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitBillingAddressAddedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessagePayloadCollection.php new file mode 100644 index 00000000000..102c580be01 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitBillingAddressAddedMessagePayload current() + * @method BusinessUnitBillingAddressAddedMessagePayload end() + * @method BusinessUnitBillingAddressAddedMessagePayload at($offset) + */ +class BusinessUnitBillingAddressAddedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitBillingAddressAddedMessagePayload $value + * @psalm-param BusinessUnitBillingAddressAddedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitBillingAddressAddedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitBillingAddressAddedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitBillingAddressAddedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitBillingAddressAddedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitBillingAddressAddedMessagePayload $data */ + $data = BusinessUnitBillingAddressAddedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessagePayloadModel.php new file mode 100644 index 00000000000..c6cd5765e22 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressAddedMessagePayloadModel.php @@ -0,0 +1,96 @@ +address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The address that was added to the Business Unit as billing address.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessage.php new file mode 100644 index 00000000000..898b5185e36 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessage.php @@ -0,0 +1,31 @@ +The address that was removed from the billing addresses of the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessageBuilder.php new file mode 100644 index 00000000000..9703da7046a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class BusinessUnitBillingAddressRemovedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The address that was removed from the billing addresses of the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitBillingAddressRemovedMessage + { + return new BusinessUnitBillingAddressRemovedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitBillingAddressRemovedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessageCollection.php new file mode 100644 index 00000000000..51abb831c23 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitBillingAddressRemovedMessage current() + * @method BusinessUnitBillingAddressRemovedMessage end() + * @method BusinessUnitBillingAddressRemovedMessage at($offset) + */ +class BusinessUnitBillingAddressRemovedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitBillingAddressRemovedMessage $value + * @psalm-param BusinessUnitBillingAddressRemovedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitBillingAddressRemovedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitBillingAddressRemovedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitBillingAddressRemovedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitBillingAddressRemovedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitBillingAddressRemovedMessage $data */ + $data = BusinessUnitBillingAddressRemovedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessageModel.php new file mode 100644 index 00000000000..b50324248c8 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The address that was removed from the billing addresses of the Business Unit.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessagePayload.php new file mode 100644 index 00000000000..a9f93fc9b84 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessagePayload.php @@ -0,0 +1,31 @@ +The address that was removed from the billing addresses of the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessagePayloadBuilder.php new file mode 100644 index 00000000000..c56023f9581 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitBillingAddressRemovedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    The address that was removed from the billing addresses of the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitBillingAddressRemovedMessagePayload + { + return new BusinessUnitBillingAddressRemovedMessagePayloadModel( + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitBillingAddressRemovedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessagePayloadCollection.php new file mode 100644 index 00000000000..41b6b5f67ae --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitBillingAddressRemovedMessagePayload current() + * @method BusinessUnitBillingAddressRemovedMessagePayload end() + * @method BusinessUnitBillingAddressRemovedMessagePayload at($offset) + */ +class BusinessUnitBillingAddressRemovedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitBillingAddressRemovedMessagePayload $value + * @psalm-param BusinessUnitBillingAddressRemovedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitBillingAddressRemovedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitBillingAddressRemovedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitBillingAddressRemovedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitBillingAddressRemovedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitBillingAddressRemovedMessagePayload $data */ + $data = BusinessUnitBillingAddressRemovedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessagePayloadModel.php new file mode 100644 index 00000000000..b9a2028de1b --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitBillingAddressRemovedMessagePayloadModel.php @@ -0,0 +1,96 @@ +address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The address that was removed from the billing addresses of the Business Unit.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessage.php new file mode 100644 index 00000000000..eba7d14b069 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessage.php @@ -0,0 +1,30 @@ +The contact email that was updated on the Business Unit.

    + * + + * @return null|string + */ + public function getContactEmail(); + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessageBuilder.php new file mode 100644 index 00000000000..4f834824314 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessageBuilder.php @@ -0,0 +1,404 @@ + + */ +final class BusinessUnitContactEmailSetMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $contactEmail; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The contact email that was updated on the Business Unit.

    + * + + * @return null|string + */ + public function getContactEmail() + { + return $this->contactEmail; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $contactEmail + * @return $this + */ + public function withContactEmail(?string $contactEmail) + { + $this->contactEmail = $contactEmail; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): BusinessUnitContactEmailSetMessage + { + return new BusinessUnitContactEmailSetMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->contactEmail + ); + } + + public static function of(): BusinessUnitContactEmailSetMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessageCollection.php new file mode 100644 index 00000000000..791363a2867 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitContactEmailSetMessage current() + * @method BusinessUnitContactEmailSetMessage end() + * @method BusinessUnitContactEmailSetMessage at($offset) + */ +class BusinessUnitContactEmailSetMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitContactEmailSetMessage $value + * @psalm-param BusinessUnitContactEmailSetMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitContactEmailSetMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitContactEmailSetMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitContactEmailSetMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitContactEmailSetMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitContactEmailSetMessage $data */ + $data = BusinessUnitContactEmailSetMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessageModel.php new file mode 100644 index 00000000000..03a01685ea8 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessageModel.php @@ -0,0 +1,490 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->contactEmail = $contactEmail; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The contact email that was updated on the Business Unit.

    + * + * + * @return null|string + */ + public function getContactEmail() + { + if (is_null($this->contactEmail)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CONTACT_EMAIL); + if (is_null($data)) { + return null; + } + $this->contactEmail = (string) $data; + } + + return $this->contactEmail; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void + { + $this->contactEmail = $contactEmail; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessagePayload.php new file mode 100644 index 00000000000..f0011e28bd4 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessagePayload.php @@ -0,0 +1,30 @@ +The contact email that was updated on the Business Unit.

    + * + + * @return null|string + */ + public function getContactEmail(); + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessagePayloadBuilder.php new file mode 100644 index 00000000000..51e84121238 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessagePayloadBuilder.php @@ -0,0 +1,63 @@ + + */ +final class BusinessUnitContactEmailSetMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $contactEmail; + + /** + *

    The contact email that was updated on the Business Unit.

    + * + + * @return null|string + */ + public function getContactEmail() + { + return $this->contactEmail; + } + + /** + * @param ?string $contactEmail + * @return $this + */ + public function withContactEmail(?string $contactEmail) + { + $this->contactEmail = $contactEmail; + + return $this; + } + + + public function build(): BusinessUnitContactEmailSetMessagePayload + { + return new BusinessUnitContactEmailSetMessagePayloadModel( + $this->contactEmail + ); + } + + public static function of(): BusinessUnitContactEmailSetMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessagePayloadCollection.php new file mode 100644 index 00000000000..4dc9ff3f8fd --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitContactEmailSetMessagePayload current() + * @method BusinessUnitContactEmailSetMessagePayload end() + * @method BusinessUnitContactEmailSetMessagePayload at($offset) + */ +class BusinessUnitContactEmailSetMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitContactEmailSetMessagePayload $value + * @psalm-param BusinessUnitContactEmailSetMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitContactEmailSetMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitContactEmailSetMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitContactEmailSetMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitContactEmailSetMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitContactEmailSetMessagePayload $data */ + $data = BusinessUnitContactEmailSetMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessagePayloadModel.php new file mode 100644 index 00000000000..c74b447447a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitContactEmailSetMessagePayloadModel.php @@ -0,0 +1,93 @@ +contactEmail = $contactEmail; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The contact email that was updated on the Business Unit.

    + * + * + * @return null|string + */ + public function getContactEmail() + { + if (is_null($this->contactEmail)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CONTACT_EMAIL); + if (is_null($data)) { + return null; + } + $this->contactEmail = (string) $data; + } + + return $this->contactEmail; + } + + + /** + * @param ?string $contactEmail + */ + public function setContactEmail(?string $contactEmail): void + { + $this->contactEmail = $contactEmail; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessage.php new file mode 100644 index 00000000000..b4208973a19 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessage.php @@ -0,0 +1,31 @@ +The Business Unit that was created.

    + * + + * @return null|BusinessUnit + */ + public function getBusinessUnit(); + + /** + * @param ?BusinessUnit $businessUnit + */ + public function setBusinessUnit(?BusinessUnit $businessUnit): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessageBuilder.php new file mode 100644 index 00000000000..1125cfbef25 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class BusinessUnitCreatedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|BusinessUnit|BusinessUnitBuilder + */ + private $businessUnit; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The Business Unit that was created.

    + * + + * @return null|BusinessUnit + */ + public function getBusinessUnit() + { + return $this->businessUnit instanceof BusinessUnitBuilder ? $this->businessUnit->build() : $this->businessUnit; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?BusinessUnit $businessUnit + * @return $this + */ + public function withBusinessUnit(?BusinessUnit $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withBusinessUnit() instead + * @return $this + */ + public function withBusinessUnitBuilder(?BusinessUnitBuilder $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + + public function build(): BusinessUnitCreatedMessage + { + return new BusinessUnitCreatedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->businessUnit instanceof BusinessUnitBuilder ? $this->businessUnit->build() : $this->businessUnit + ); + } + + public static function of(): BusinessUnitCreatedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessageCollection.php new file mode 100644 index 00000000000..d84e5e2bfbb --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitCreatedMessage current() + * @method BusinessUnitCreatedMessage end() + * @method BusinessUnitCreatedMessage at($offset) + */ +class BusinessUnitCreatedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitCreatedMessage $value + * @psalm-param BusinessUnitCreatedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitCreatedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitCreatedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitCreatedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitCreatedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitCreatedMessage $data */ + $data = BusinessUnitCreatedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessageModel.php new file mode 100644 index 00000000000..96c2ba244d1 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->businessUnit = $businessUnit; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The Business Unit that was created.

    + * + * + * @return null|BusinessUnit + */ + public function getBusinessUnit() + { + if (is_null($this->businessUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BUSINESS_UNIT); + if (is_null($data)) { + return null; + } + $className = BusinessUnitModel::resolveDiscriminatorClass($data); + $this->businessUnit = $className::of($data); + } + + return $this->businessUnit; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?BusinessUnit $businessUnit + */ + public function setBusinessUnit(?BusinessUnit $businessUnit): void + { + $this->businessUnit = $businessUnit; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessagePayload.php new file mode 100644 index 00000000000..818b1fd54ad --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessagePayload.php @@ -0,0 +1,31 @@ +The Business Unit that was created.

    + * + + * @return null|BusinessUnit + */ + public function getBusinessUnit(); + + /** + * @param ?BusinessUnit $businessUnit + */ + public function setBusinessUnit(?BusinessUnit $businessUnit): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessagePayloadBuilder.php new file mode 100644 index 00000000000..5c06d08ed34 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitCreatedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|BusinessUnit|BusinessUnitBuilder + */ + private $businessUnit; + + /** + *

    The Business Unit that was created.

    + * + + * @return null|BusinessUnit + */ + public function getBusinessUnit() + { + return $this->businessUnit instanceof BusinessUnitBuilder ? $this->businessUnit->build() : $this->businessUnit; + } + + /** + * @param ?BusinessUnit $businessUnit + * @return $this + */ + public function withBusinessUnit(?BusinessUnit $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + + /** + * @deprecated use withBusinessUnit() instead + * @return $this + */ + public function withBusinessUnitBuilder(?BusinessUnitBuilder $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + + public function build(): BusinessUnitCreatedMessagePayload + { + return new BusinessUnitCreatedMessagePayloadModel( + $this->businessUnit instanceof BusinessUnitBuilder ? $this->businessUnit->build() : $this->businessUnit + ); + } + + public static function of(): BusinessUnitCreatedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessagePayloadCollection.php new file mode 100644 index 00000000000..05e7433177a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitCreatedMessagePayload current() + * @method BusinessUnitCreatedMessagePayload end() + * @method BusinessUnitCreatedMessagePayload at($offset) + */ +class BusinessUnitCreatedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitCreatedMessagePayload $value + * @psalm-param BusinessUnitCreatedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitCreatedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitCreatedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitCreatedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitCreatedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitCreatedMessagePayload $data */ + $data = BusinessUnitCreatedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessagePayloadModel.php new file mode 100644 index 00000000000..afc0811c23e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitCreatedMessagePayloadModel.php @@ -0,0 +1,96 @@ +businessUnit = $businessUnit; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The Business Unit that was created.

    + * + * + * @return null|BusinessUnit + */ + public function getBusinessUnit() + { + if (is_null($this->businessUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BUSINESS_UNIT); + if (is_null($data)) { + return null; + } + $className = BusinessUnitModel::resolveDiscriminatorClass($data); + $this->businessUnit = $className::of($data); + } + + return $this->businessUnit; + } + + + /** + * @param ?BusinessUnit $businessUnit + */ + public function setBusinessUnit(?BusinessUnit $businessUnit): void + { + $this->businessUnit = $businessUnit; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessage.php new file mode 100644 index 00000000000..6832b827615 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessage.php @@ -0,0 +1,31 @@ +The address that was set as the default billing address.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessageBuilder.php new file mode 100644 index 00000000000..4fab75d95c3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class BusinessUnitDefaultBillingAddressSetMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The address that was set as the default billing address.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitDefaultBillingAddressSetMessage + { + return new BusinessUnitDefaultBillingAddressSetMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitDefaultBillingAddressSetMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessageCollection.php new file mode 100644 index 00000000000..d2428a1c508 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitDefaultBillingAddressSetMessage current() + * @method BusinessUnitDefaultBillingAddressSetMessage end() + * @method BusinessUnitDefaultBillingAddressSetMessage at($offset) + */ +class BusinessUnitDefaultBillingAddressSetMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitDefaultBillingAddressSetMessage $value + * @psalm-param BusinessUnitDefaultBillingAddressSetMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitDefaultBillingAddressSetMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitDefaultBillingAddressSetMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitDefaultBillingAddressSetMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitDefaultBillingAddressSetMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitDefaultBillingAddressSetMessage $data */ + $data = BusinessUnitDefaultBillingAddressSetMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessageModel.php new file mode 100644 index 00000000000..42cc4129b81 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The address that was set as the default billing address.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessagePayload.php new file mode 100644 index 00000000000..40718d79f55 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessagePayload.php @@ -0,0 +1,31 @@ +The address that was set as the default billing address.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessagePayloadBuilder.php new file mode 100644 index 00000000000..bb6ba0fc6e1 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitDefaultBillingAddressSetMessagePayloadBuilder implements Builder +{ + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    The address that was set as the default billing address.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitDefaultBillingAddressSetMessagePayload + { + return new BusinessUnitDefaultBillingAddressSetMessagePayloadModel( + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitDefaultBillingAddressSetMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessagePayloadCollection.php new file mode 100644 index 00000000000..c44af19652d --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitDefaultBillingAddressSetMessagePayload current() + * @method BusinessUnitDefaultBillingAddressSetMessagePayload end() + * @method BusinessUnitDefaultBillingAddressSetMessagePayload at($offset) + */ +class BusinessUnitDefaultBillingAddressSetMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitDefaultBillingAddressSetMessagePayload $value + * @psalm-param BusinessUnitDefaultBillingAddressSetMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitDefaultBillingAddressSetMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitDefaultBillingAddressSetMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitDefaultBillingAddressSetMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitDefaultBillingAddressSetMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitDefaultBillingAddressSetMessagePayload $data */ + $data = BusinessUnitDefaultBillingAddressSetMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessagePayloadModel.php new file mode 100644 index 00000000000..d66bd96d605 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultBillingAddressSetMessagePayloadModel.php @@ -0,0 +1,96 @@ +address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The address that was set as the default billing address.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessage.php new file mode 100644 index 00000000000..6a1d36fcb21 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessage.php @@ -0,0 +1,31 @@ +The address that was set as the default shipping address.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessageBuilder.php new file mode 100644 index 00000000000..b16ea0353e5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class BusinessUnitDefaultShippingAddressSetMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The address that was set as the default shipping address.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitDefaultShippingAddressSetMessage + { + return new BusinessUnitDefaultShippingAddressSetMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitDefaultShippingAddressSetMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessageCollection.php new file mode 100644 index 00000000000..ba86b52703f --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitDefaultShippingAddressSetMessage current() + * @method BusinessUnitDefaultShippingAddressSetMessage end() + * @method BusinessUnitDefaultShippingAddressSetMessage at($offset) + */ +class BusinessUnitDefaultShippingAddressSetMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitDefaultShippingAddressSetMessage $value + * @psalm-param BusinessUnitDefaultShippingAddressSetMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitDefaultShippingAddressSetMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitDefaultShippingAddressSetMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitDefaultShippingAddressSetMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitDefaultShippingAddressSetMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitDefaultShippingAddressSetMessage $data */ + $data = BusinessUnitDefaultShippingAddressSetMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessageModel.php new file mode 100644 index 00000000000..7c04dd6a191 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The address that was set as the default shipping address.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessagePayload.php new file mode 100644 index 00000000000..96021bd4bf7 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessagePayload.php @@ -0,0 +1,31 @@ +The address that was set as the default shipping address.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessagePayloadBuilder.php new file mode 100644 index 00000000000..79b4f803303 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitDefaultShippingAddressSetMessagePayloadBuilder implements Builder +{ + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    The address that was set as the default shipping address.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitDefaultShippingAddressSetMessagePayload + { + return new BusinessUnitDefaultShippingAddressSetMessagePayloadModel( + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitDefaultShippingAddressSetMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessagePayloadCollection.php new file mode 100644 index 00000000000..ae8f8dc8d9a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitDefaultShippingAddressSetMessagePayload current() + * @method BusinessUnitDefaultShippingAddressSetMessagePayload end() + * @method BusinessUnitDefaultShippingAddressSetMessagePayload at($offset) + */ +class BusinessUnitDefaultShippingAddressSetMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitDefaultShippingAddressSetMessagePayload $value + * @psalm-param BusinessUnitDefaultShippingAddressSetMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitDefaultShippingAddressSetMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitDefaultShippingAddressSetMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitDefaultShippingAddressSetMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitDefaultShippingAddressSetMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitDefaultShippingAddressSetMessagePayload $data */ + $data = BusinessUnitDefaultShippingAddressSetMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessagePayloadModel.php new file mode 100644 index 00000000000..7da663743e0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDefaultShippingAddressSetMessagePayloadModel.php @@ -0,0 +1,96 @@ +address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The address that was set as the default shipping address.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessage.php new file mode 100644 index 00000000000..65e3fb17eae --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessage.php @@ -0,0 +1,16 @@ + + */ +final class BusinessUnitDeletedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): BusinessUnitDeletedMessage + { + return new BusinessUnitDeletedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers + ); + } + + public static function of(): BusinessUnitDeletedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessageCollection.php new file mode 100644 index 00000000000..69b85420209 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitDeletedMessage current() + * @method BusinessUnitDeletedMessage end() + * @method BusinessUnitDeletedMessage at($offset) + */ +class BusinessUnitDeletedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitDeletedMessage $value + * @psalm-param BusinessUnitDeletedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitDeletedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitDeletedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitDeletedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitDeletedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitDeletedMessage $data */ + $data = BusinessUnitDeletedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessageModel.php new file mode 100644 index 00000000000..9d9d431d426 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessageModel.php @@ -0,0 +1,454 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessagePayload.php new file mode 100644 index 00000000000..76538b44ba1 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessagePayload.php @@ -0,0 +1,16 @@ + + */ +final class BusinessUnitDeletedMessagePayloadBuilder implements Builder +{ + public function build(): BusinessUnitDeletedMessagePayload + { + return new BusinessUnitDeletedMessagePayloadModel( + ); + } + + public static function of(): BusinessUnitDeletedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessagePayloadCollection.php new file mode 100644 index 00000000000..47b5831ff9d --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitDeletedMessagePayload current() + * @method BusinessUnitDeletedMessagePayload end() + * @method BusinessUnitDeletedMessagePayload at($offset) + */ +class BusinessUnitDeletedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitDeletedMessagePayload $value + * @psalm-param BusinessUnitDeletedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitDeletedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitDeletedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitDeletedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitDeletedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitDeletedMessagePayload $data */ + $data = BusinessUnitDeletedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessagePayloadModel.php new file mode 100644 index 00000000000..5dfb9b5208c --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitDeletedMessagePayloadModel.php @@ -0,0 +1,56 @@ +type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessage.php new file mode 100644 index 00000000000..0e68e8a3a51 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessage.php @@ -0,0 +1,30 @@ +Updated name of the Business Unit.

    + * + + * @return null|string + */ + public function getName(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessageBuilder.php new file mode 100644 index 00000000000..bcd334a277d --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessageBuilder.php @@ -0,0 +1,404 @@ + + */ +final class BusinessUnitNameChangedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $name; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Updated name of the Business Unit.

    + * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): BusinessUnitNameChangedMessage + { + return new BusinessUnitNameChangedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->name + ); + } + + public static function of(): BusinessUnitNameChangedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessageCollection.php new file mode 100644 index 00000000000..68f18f03cc0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitNameChangedMessage current() + * @method BusinessUnitNameChangedMessage end() + * @method BusinessUnitNameChangedMessage at($offset) + */ +class BusinessUnitNameChangedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitNameChangedMessage $value + * @psalm-param BusinessUnitNameChangedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitNameChangedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitNameChangedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitNameChangedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitNameChangedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitNameChangedMessage $data */ + $data = BusinessUnitNameChangedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessageModel.php new file mode 100644 index 00000000000..3e28a5533b1 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessageModel.php @@ -0,0 +1,490 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->name = $name; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Updated name of the Business Unit.

    + * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessagePayload.php new file mode 100644 index 00000000000..e48d17f717a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessagePayload.php @@ -0,0 +1,30 @@ +Updated name of the Business Unit.

    + * + + * @return null|string + */ + public function getName(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessagePayloadBuilder.php new file mode 100644 index 00000000000..6674ee95104 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessagePayloadBuilder.php @@ -0,0 +1,63 @@ + + */ +final class BusinessUnitNameChangedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $name; + + /** + *

    Updated name of the Business Unit.

    + * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + + public function build(): BusinessUnitNameChangedMessagePayload + { + return new BusinessUnitNameChangedMessagePayloadModel( + $this->name + ); + } + + public static function of(): BusinessUnitNameChangedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessagePayloadCollection.php new file mode 100644 index 00000000000..95d64ae5c2a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitNameChangedMessagePayload current() + * @method BusinessUnitNameChangedMessagePayload end() + * @method BusinessUnitNameChangedMessagePayload at($offset) + */ +class BusinessUnitNameChangedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitNameChangedMessagePayload $value + * @psalm-param BusinessUnitNameChangedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitNameChangedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitNameChangedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitNameChangedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitNameChangedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitNameChangedMessagePayload $data */ + $data = BusinessUnitNameChangedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessagePayloadModel.php new file mode 100644 index 00000000000..d41c4b92b86 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitNameChangedMessagePayloadModel.php @@ -0,0 +1,93 @@ +name = $name; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Updated name of the Business Unit.

    + * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessage.php new file mode 100644 index 00000000000..96b403e84bf --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessage.php @@ -0,0 +1,45 @@ +Parent unit of the Business Unit before the Change Parent Unit update action.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getOldParentUnit(); + + /** + *

    Parent unit of the Business Unit after the Change Parent Unit update action.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getNewParentUnit(); + + /** + * @param ?BusinessUnitKeyReference $oldParentUnit + */ + public function setOldParentUnit(?BusinessUnitKeyReference $oldParentUnit): void; + + /** + * @param ?BusinessUnitKeyReference $newParentUnit + */ + public function setNewParentUnit(?BusinessUnitKeyReference $newParentUnit): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageBuilder.php new file mode 100644 index 00000000000..7fccd063742 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageBuilder.php @@ -0,0 +1,457 @@ + + */ +final class BusinessUnitParentUnitChangedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + */ + private $oldParentUnit; + + /** + + * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + */ + private $newParentUnit; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Parent unit of the Business Unit before the Change Parent Unit update action.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getOldParentUnit() + { + return $this->oldParentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->oldParentUnit->build() : $this->oldParentUnit; + } + + /** + *

    Parent unit of the Business Unit after the Change Parent Unit update action.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getNewParentUnit() + { + return $this->newParentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->newParentUnit->build() : $this->newParentUnit; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?BusinessUnitKeyReference $oldParentUnit + * @return $this + */ + public function withOldParentUnit(?BusinessUnitKeyReference $oldParentUnit) + { + $this->oldParentUnit = $oldParentUnit; + + return $this; + } + + /** + * @param ?BusinessUnitKeyReference $newParentUnit + * @return $this + */ + public function withNewParentUnit(?BusinessUnitKeyReference $newParentUnit) + { + $this->newParentUnit = $newParentUnit; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withOldParentUnit() instead + * @return $this + */ + public function withOldParentUnitBuilder(?BusinessUnitKeyReferenceBuilder $oldParentUnit) + { + $this->oldParentUnit = $oldParentUnit; + + return $this; + } + + /** + * @deprecated use withNewParentUnit() instead + * @return $this + */ + public function withNewParentUnitBuilder(?BusinessUnitKeyReferenceBuilder $newParentUnit) + { + $this->newParentUnit = $newParentUnit; + + return $this; + } + + public function build(): BusinessUnitParentUnitChangedMessage + { + return new BusinessUnitParentUnitChangedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->oldParentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->oldParentUnit->build() : $this->oldParentUnit, + $this->newParentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->newParentUnit->build() : $this->newParentUnit + ); + } + + public static function of(): BusinessUnitParentUnitChangedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageCollection.php new file mode 100644 index 00000000000..14422e36f2b --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitParentUnitChangedMessage current() + * @method BusinessUnitParentUnitChangedMessage end() + * @method BusinessUnitParentUnitChangedMessage at($offset) + */ +class BusinessUnitParentUnitChangedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitParentUnitChangedMessage $value + * @psalm-param BusinessUnitParentUnitChangedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitParentUnitChangedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitParentUnitChangedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitParentUnitChangedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitParentUnitChangedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitParentUnitChangedMessage $data */ + $data = BusinessUnitParentUnitChangedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageModel.php new file mode 100644 index 00000000000..954c92a02ee --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageModel.php @@ -0,0 +1,530 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->oldParentUnit = $oldParentUnit; + $this->newParentUnit = $newParentUnit; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Parent unit of the Business Unit before the Change Parent Unit update action.

    + * + * + * @return null|BusinessUnitKeyReference + */ + public function getOldParentUnit() + { + if (is_null($this->oldParentUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_OLD_PARENT_UNIT); + if (is_null($data)) { + return null; + } + + $this->oldParentUnit = BusinessUnitKeyReferenceModel::of($data); + } + + return $this->oldParentUnit; + } + + /** + *

    Parent unit of the Business Unit after the Change Parent Unit update action.

    + * + * + * @return null|BusinessUnitKeyReference + */ + public function getNewParentUnit() + { + if (is_null($this->newParentUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_NEW_PARENT_UNIT); + if (is_null($data)) { + return null; + } + + $this->newParentUnit = BusinessUnitKeyReferenceModel::of($data); + } + + return $this->newParentUnit; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?BusinessUnitKeyReference $oldParentUnit + */ + public function setOldParentUnit(?BusinessUnitKeyReference $oldParentUnit): void + { + $this->oldParentUnit = $oldParentUnit; + } + + /** + * @param ?BusinessUnitKeyReference $newParentUnit + */ + public function setNewParentUnit(?BusinessUnitKeyReference $newParentUnit): void + { + $this->newParentUnit = $newParentUnit; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayload.php new file mode 100644 index 00000000000..2b506e66f3a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayload.php @@ -0,0 +1,45 @@ +Parent unit of the Business Unit before the Change Parent Unit update action.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getOldParentUnit(); + + /** + *

    Parent unit of the Business Unit after the Change Parent Unit update action.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getNewParentUnit(); + + /** + * @param ?BusinessUnitKeyReference $oldParentUnit + */ + public function setOldParentUnit(?BusinessUnitKeyReference $oldParentUnit): void; + + /** + * @param ?BusinessUnitKeyReference $newParentUnit + */ + public function setNewParentUnit(?BusinessUnitKeyReference $newParentUnit): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadBuilder.php new file mode 100644 index 00000000000..98c2694666a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadBuilder.php @@ -0,0 +1,115 @@ + + */ +final class BusinessUnitParentUnitChangedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + */ + private $oldParentUnit; + + /** + + * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + */ + private $newParentUnit; + + /** + *

    Parent unit of the Business Unit before the Change Parent Unit update action.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getOldParentUnit() + { + return $this->oldParentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->oldParentUnit->build() : $this->oldParentUnit; + } + + /** + *

    Parent unit of the Business Unit after the Change Parent Unit update action.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getNewParentUnit() + { + return $this->newParentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->newParentUnit->build() : $this->newParentUnit; + } + + /** + * @param ?BusinessUnitKeyReference $oldParentUnit + * @return $this + */ + public function withOldParentUnit(?BusinessUnitKeyReference $oldParentUnit) + { + $this->oldParentUnit = $oldParentUnit; + + return $this; + } + + /** + * @param ?BusinessUnitKeyReference $newParentUnit + * @return $this + */ + public function withNewParentUnit(?BusinessUnitKeyReference $newParentUnit) + { + $this->newParentUnit = $newParentUnit; + + return $this; + } + + /** + * @deprecated use withOldParentUnit() instead + * @return $this + */ + public function withOldParentUnitBuilder(?BusinessUnitKeyReferenceBuilder $oldParentUnit) + { + $this->oldParentUnit = $oldParentUnit; + + return $this; + } + + /** + * @deprecated use withNewParentUnit() instead + * @return $this + */ + public function withNewParentUnitBuilder(?BusinessUnitKeyReferenceBuilder $newParentUnit) + { + $this->newParentUnit = $newParentUnit; + + return $this; + } + + public function build(): BusinessUnitParentUnitChangedMessagePayload + { + return new BusinessUnitParentUnitChangedMessagePayloadModel( + $this->oldParentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->oldParentUnit->build() : $this->oldParentUnit, + $this->newParentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->newParentUnit->build() : $this->newParentUnit + ); + } + + public static function of(): BusinessUnitParentUnitChangedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadCollection.php new file mode 100644 index 00000000000..8400d879de3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitParentUnitChangedMessagePayload current() + * @method BusinessUnitParentUnitChangedMessagePayload end() + * @method BusinessUnitParentUnitChangedMessagePayload at($offset) + */ +class BusinessUnitParentUnitChangedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitParentUnitChangedMessagePayload $value + * @psalm-param BusinessUnitParentUnitChangedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitParentUnitChangedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitParentUnitChangedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitParentUnitChangedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitParentUnitChangedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitParentUnitChangedMessagePayload $data */ + $data = BusinessUnitParentUnitChangedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadModel.php new file mode 100644 index 00000000000..5310c3b11cd --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadModel.php @@ -0,0 +1,133 @@ +oldParentUnit = $oldParentUnit; + $this->newParentUnit = $newParentUnit; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Parent unit of the Business Unit before the Change Parent Unit update action.

    + * + * + * @return null|BusinessUnitKeyReference + */ + public function getOldParentUnit() + { + if (is_null($this->oldParentUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_OLD_PARENT_UNIT); + if (is_null($data)) { + return null; + } + + $this->oldParentUnit = BusinessUnitKeyReferenceModel::of($data); + } + + return $this->oldParentUnit; + } + + /** + *

    Parent unit of the Business Unit after the Change Parent Unit update action.

    + * + * + * @return null|BusinessUnitKeyReference + */ + public function getNewParentUnit() + { + if (is_null($this->newParentUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_NEW_PARENT_UNIT); + if (is_null($data)) { + return null; + } + + $this->newParentUnit = BusinessUnitKeyReferenceModel::of($data); + } + + return $this->newParentUnit; + } + + + /** + * @param ?BusinessUnitKeyReference $oldParentUnit + */ + public function setOldParentUnit(?BusinessUnitKeyReference $oldParentUnit): void + { + $this->oldParentUnit = $oldParentUnit; + } + + /** + * @param ?BusinessUnitKeyReference $newParentUnit + */ + public function setNewParentUnit(?BusinessUnitKeyReference $newParentUnit): void + { + $this->newParentUnit = $newParentUnit; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessage.php new file mode 100644 index 00000000000..5a6590d264a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessage.php @@ -0,0 +1,31 @@ +The address that was added to the Business Unit as shipping address.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessageBuilder.php new file mode 100644 index 00000000000..0d31d8aa33b --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class BusinessUnitShippingAddressAddedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The address that was added to the Business Unit as shipping address.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitShippingAddressAddedMessage + { + return new BusinessUnitShippingAddressAddedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitShippingAddressAddedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessageCollection.php new file mode 100644 index 00000000000..9a82c790573 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitShippingAddressAddedMessage current() + * @method BusinessUnitShippingAddressAddedMessage end() + * @method BusinessUnitShippingAddressAddedMessage at($offset) + */ +class BusinessUnitShippingAddressAddedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitShippingAddressAddedMessage $value + * @psalm-param BusinessUnitShippingAddressAddedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitShippingAddressAddedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitShippingAddressAddedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitShippingAddressAddedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitShippingAddressAddedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitShippingAddressAddedMessage $data */ + $data = BusinessUnitShippingAddressAddedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessageModel.php new file mode 100644 index 00000000000..2b48767227e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The address that was added to the Business Unit as shipping address.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessagePayload.php new file mode 100644 index 00000000000..9f00843d56c --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessagePayload.php @@ -0,0 +1,31 @@ +The address that was added to the Business Unit as shipping address.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessagePayloadBuilder.php new file mode 100644 index 00000000000..2605b2465b5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitShippingAddressAddedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    The address that was added to the Business Unit as shipping address.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitShippingAddressAddedMessagePayload + { + return new BusinessUnitShippingAddressAddedMessagePayloadModel( + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitShippingAddressAddedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessagePayloadCollection.php new file mode 100644 index 00000000000..da1c520805b --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitShippingAddressAddedMessagePayload current() + * @method BusinessUnitShippingAddressAddedMessagePayload end() + * @method BusinessUnitShippingAddressAddedMessagePayload at($offset) + */ +class BusinessUnitShippingAddressAddedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitShippingAddressAddedMessagePayload $value + * @psalm-param BusinessUnitShippingAddressAddedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitShippingAddressAddedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitShippingAddressAddedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitShippingAddressAddedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitShippingAddressAddedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitShippingAddressAddedMessagePayload $data */ + $data = BusinessUnitShippingAddressAddedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessagePayloadModel.php new file mode 100644 index 00000000000..4572cdf6c1d --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressAddedMessagePayloadModel.php @@ -0,0 +1,96 @@ +address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The address that was added to the Business Unit as shipping address.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessage.php new file mode 100644 index 00000000000..ed0d3b9608c --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessage.php @@ -0,0 +1,31 @@ +The address that was removed from shipping addresses of the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessageBuilder.php new file mode 100644 index 00000000000..3c2961b63e3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class BusinessUnitShippingAddressRemovedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The address that was removed from shipping addresses of the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitShippingAddressRemovedMessage + { + return new BusinessUnitShippingAddressRemovedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitShippingAddressRemovedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessageCollection.php new file mode 100644 index 00000000000..2a74a6d2894 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitShippingAddressRemovedMessage current() + * @method BusinessUnitShippingAddressRemovedMessage end() + * @method BusinessUnitShippingAddressRemovedMessage at($offset) + */ +class BusinessUnitShippingAddressRemovedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitShippingAddressRemovedMessage $value + * @psalm-param BusinessUnitShippingAddressRemovedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitShippingAddressRemovedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitShippingAddressRemovedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitShippingAddressRemovedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitShippingAddressRemovedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitShippingAddressRemovedMessage $data */ + $data = BusinessUnitShippingAddressRemovedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessageModel.php new file mode 100644 index 00000000000..c55e872f5a7 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The address that was removed from shipping addresses of the Business Unit.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessagePayload.php new file mode 100644 index 00000000000..257295ac748 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessagePayload.php @@ -0,0 +1,31 @@ +The address that was removed from shipping addresses of the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress(); + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessagePayloadBuilder.php new file mode 100644 index 00000000000..7756d2cffa3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitShippingAddressRemovedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|Address|AddressBuilder + */ + private $address; + + /** + *

    The address that was removed from shipping addresses of the Business Unit.

    + * + + * @return null|Address + */ + public function getAddress() + { + return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address; + } + + /** + * @param ?Address $address + * @return $this + */ + public function withAddress(?Address $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressBuilder $address) + { + $this->address = $address; + + return $this; + } + + public function build(): BusinessUnitShippingAddressRemovedMessagePayload + { + return new BusinessUnitShippingAddressRemovedMessagePayloadModel( + $this->address instanceof AddressBuilder ? $this->address->build() : $this->address + ); + } + + public static function of(): BusinessUnitShippingAddressRemovedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessagePayloadCollection.php new file mode 100644 index 00000000000..1a2cde6d46c --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitShippingAddressRemovedMessagePayload current() + * @method BusinessUnitShippingAddressRemovedMessagePayload end() + * @method BusinessUnitShippingAddressRemovedMessagePayload at($offset) + */ +class BusinessUnitShippingAddressRemovedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitShippingAddressRemovedMessagePayload $value + * @psalm-param BusinessUnitShippingAddressRemovedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitShippingAddressRemovedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitShippingAddressRemovedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitShippingAddressRemovedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitShippingAddressRemovedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitShippingAddressRemovedMessagePayload $data */ + $data = BusinessUnitShippingAddressRemovedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessagePayloadModel.php new file mode 100644 index 00000000000..de83fab03bc --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitShippingAddressRemovedMessagePayloadModel.php @@ -0,0 +1,96 @@ +address = $address; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The address that was removed from shipping addresses of the Business Unit.

    + * + * + * @return null|Address + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressModel::of($data); + } + + return $this->address; + } + + + /** + * @param ?Address $address + */ + public function setAddress(?Address $address): void + { + $this->address = $address; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessage.php new file mode 100644 index 00000000000..54f5aaa5842 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessage.php @@ -0,0 +1,30 @@ +Updated status of the Business Unit.

    + * + + * @return null|string + */ + public function getActive(); + + /** + * @param ?string $active + */ + public function setActive(?string $active): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessageBuilder.php new file mode 100644 index 00000000000..cbf37ef0194 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessageBuilder.php @@ -0,0 +1,404 @@ + + */ +final class BusinessUnitStatusChangedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $active; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Updated status of the Business Unit.

    + * + + * @return null|string + */ + public function getActive() + { + return $this->active; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $active + * @return $this + */ + public function withActive(?string $active) + { + $this->active = $active; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): BusinessUnitStatusChangedMessage + { + return new BusinessUnitStatusChangedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->active + ); + } + + public static function of(): BusinessUnitStatusChangedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessageCollection.php new file mode 100644 index 00000000000..a9ef6ee05c2 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitStatusChangedMessage current() + * @method BusinessUnitStatusChangedMessage end() + * @method BusinessUnitStatusChangedMessage at($offset) + */ +class BusinessUnitStatusChangedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitStatusChangedMessage $value + * @psalm-param BusinessUnitStatusChangedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitStatusChangedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitStatusChangedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitStatusChangedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitStatusChangedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitStatusChangedMessage $data */ + $data = BusinessUnitStatusChangedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessageModel.php new file mode 100644 index 00000000000..71fcd5eb348 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessageModel.php @@ -0,0 +1,490 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->active = $active; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Updated status of the Business Unit.

    + * + * + * @return null|string + */ + public function getActive() + { + if (is_null($this->active)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTIVE); + if (is_null($data)) { + return null; + } + $this->active = (string) $data; + } + + return $this->active; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $active + */ + public function setActive(?string $active): void + { + $this->active = $active; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessagePayload.php new file mode 100644 index 00000000000..28b4e9cd55e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessagePayload.php @@ -0,0 +1,30 @@ +Updated status of the Business Unit.

    + * + + * @return null|string + */ + public function getActive(); + + /** + * @param ?string $active + */ + public function setActive(?string $active): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessagePayloadBuilder.php new file mode 100644 index 00000000000..f99ce9e2de5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessagePayloadBuilder.php @@ -0,0 +1,63 @@ + + */ +final class BusinessUnitStatusChangedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $active; + + /** + *

    Updated status of the Business Unit.

    + * + + * @return null|string + */ + public function getActive() + { + return $this->active; + } + + /** + * @param ?string $active + * @return $this + */ + public function withActive(?string $active) + { + $this->active = $active; + + return $this; + } + + + public function build(): BusinessUnitStatusChangedMessagePayload + { + return new BusinessUnitStatusChangedMessagePayloadModel( + $this->active + ); + } + + public static function of(): BusinessUnitStatusChangedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessagePayloadCollection.php new file mode 100644 index 00000000000..7fdeb4beac3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitStatusChangedMessagePayload current() + * @method BusinessUnitStatusChangedMessagePayload end() + * @method BusinessUnitStatusChangedMessagePayload at($offset) + */ +class BusinessUnitStatusChangedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitStatusChangedMessagePayload $value + * @psalm-param BusinessUnitStatusChangedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitStatusChangedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitStatusChangedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitStatusChangedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitStatusChangedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitStatusChangedMessagePayload $data */ + $data = BusinessUnitStatusChangedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessagePayloadModel.php new file mode 100644 index 00000000000..9730f1ab52c --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStatusChangedMessagePayloadModel.php @@ -0,0 +1,93 @@ +active = $active; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Updated status of the Business Unit.

    + * + * + * @return null|string + */ + public function getActive() + { + if (is_null($this->active)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTIVE); + if (is_null($data)) { + return null; + } + $this->active = (string) $data; + } + + return $this->active; + } + + + /** + * @param ?string $active + */ + public function setActive(?string $active): void + { + $this->active = $active; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessage.php new file mode 100644 index 00000000000..1a76144d5ec --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessage.php @@ -0,0 +1,31 @@ +The Store that was added to the Business Unit.

    + * + + * @return null|StoreKeyReference + */ + public function getStore(); + + /** + * @param ?StoreKeyReference $store + */ + public function setStore(?StoreKeyReference $store): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessageBuilder.php new file mode 100644 index 00000000000..d66829a57a3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class BusinessUnitStoreAddedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|StoreKeyReference|StoreKeyReferenceBuilder + */ + private $store; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The Store that was added to the Business Unit.

    + * + + * @return null|StoreKeyReference + */ + public function getStore() + { + return $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?StoreKeyReference $store + * @return $this + */ + public function withStore(?StoreKeyReference $store) + { + $this->store = $store; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withStore() instead + * @return $this + */ + public function withStoreBuilder(?StoreKeyReferenceBuilder $store) + { + $this->store = $store; + + return $this; + } + + public function build(): BusinessUnitStoreAddedMessage + { + return new BusinessUnitStoreAddedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store + ); + } + + public static function of(): BusinessUnitStoreAddedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessageCollection.php new file mode 100644 index 00000000000..388bb22671f --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitStoreAddedMessage current() + * @method BusinessUnitStoreAddedMessage end() + * @method BusinessUnitStoreAddedMessage at($offset) + */ +class BusinessUnitStoreAddedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitStoreAddedMessage $value + * @psalm-param BusinessUnitStoreAddedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitStoreAddedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitStoreAddedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitStoreAddedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitStoreAddedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitStoreAddedMessage $data */ + $data = BusinessUnitStoreAddedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessageModel.php new file mode 100644 index 00000000000..edd6da8c405 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->store = $store; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The Store that was added to the Business Unit.

    + * + * + * @return null|StoreKeyReference + */ + public function getStore() + { + if (is_null($this->store)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STORE); + if (is_null($data)) { + return null; + } + + $this->store = StoreKeyReferenceModel::of($data); + } + + return $this->store; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?StoreKeyReference $store + */ + public function setStore(?StoreKeyReference $store): void + { + $this->store = $store; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessagePayload.php new file mode 100644 index 00000000000..9e0c60b7b57 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessagePayload.php @@ -0,0 +1,31 @@ +The Store that was added to the Business Unit.

    + * + + * @return null|StoreKeyReference + */ + public function getStore(); + + /** + * @param ?StoreKeyReference $store + */ + public function setStore(?StoreKeyReference $store): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessagePayloadBuilder.php new file mode 100644 index 00000000000..5b6eda7274e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitStoreAddedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|StoreKeyReference|StoreKeyReferenceBuilder + */ + private $store; + + /** + *

    The Store that was added to the Business Unit.

    + * + + * @return null|StoreKeyReference + */ + public function getStore() + { + return $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store; + } + + /** + * @param ?StoreKeyReference $store + * @return $this + */ + public function withStore(?StoreKeyReference $store) + { + $this->store = $store; + + return $this; + } + + /** + * @deprecated use withStore() instead + * @return $this + */ + public function withStoreBuilder(?StoreKeyReferenceBuilder $store) + { + $this->store = $store; + + return $this; + } + + public function build(): BusinessUnitStoreAddedMessagePayload + { + return new BusinessUnitStoreAddedMessagePayloadModel( + $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store + ); + } + + public static function of(): BusinessUnitStoreAddedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessagePayloadCollection.php new file mode 100644 index 00000000000..1bb1ab750a9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitStoreAddedMessagePayload current() + * @method BusinessUnitStoreAddedMessagePayload end() + * @method BusinessUnitStoreAddedMessagePayload at($offset) + */ +class BusinessUnitStoreAddedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitStoreAddedMessagePayload $value + * @psalm-param BusinessUnitStoreAddedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitStoreAddedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitStoreAddedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitStoreAddedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitStoreAddedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitStoreAddedMessagePayload $data */ + $data = BusinessUnitStoreAddedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessagePayloadModel.php new file mode 100644 index 00000000000..d78b6a2698e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreAddedMessagePayloadModel.php @@ -0,0 +1,96 @@ +store = $store; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The Store that was added to the Business Unit.

    + * + * + * @return null|StoreKeyReference + */ + public function getStore() + { + if (is_null($this->store)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STORE); + if (is_null($data)) { + return null; + } + + $this->store = StoreKeyReferenceModel::of($data); + } + + return $this->store; + } + + + /** + * @param ?StoreKeyReference $store + */ + public function setStore(?StoreKeyReference $store): void + { + $this->store = $store; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessage.php new file mode 100644 index 00000000000..eb4a9008d13 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessage.php @@ -0,0 +1,73 @@ +Stores of the Business Unit after the Set Store Mode update action.

    + * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores(); + + /** + *

    BusinessUnitStoreMode of the Business Unit after the Set Store Mode update action.

    + * + + * @return null|string + */ + public function getStoreMode(); + + /** + *

    Stores of the Business Unit before the Set Store Mode update action.

    + * + + * @return null|StoreKeyReferenceCollection + */ + public function getOldStores(); + + /** + *

    BusinessUnitStoreMode of the Business Unit before the Set Store Mode update action.

    + * + + * @return null|string + */ + public function getOldStoreMode(); + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void; + + /** + * @param ?string $storeMode + */ + public function setStoreMode(?string $storeMode): void; + + /** + * @param ?StoreKeyReferenceCollection $oldStores + */ + public function setOldStores(?StoreKeyReferenceCollection $oldStores): void; + + /** + * @param ?string $oldStoreMode + */ + public function setOldStoreMode(?string $oldStoreMode): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessageBuilder.php new file mode 100644 index 00000000000..7f217b4eb2e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessageBuilder.php @@ -0,0 +1,492 @@ + + */ +final class BusinessUnitStoreModeChangedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?StoreKeyReferenceCollection + */ + private $stores; + + /** + + * @var ?string + */ + private $storeMode; + + /** + + * @var ?StoreKeyReferenceCollection + */ + private $oldStores; + + /** + + * @var ?string + */ + private $oldStoreMode; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Stores of the Business Unit after the Set Store Mode update action.

    + * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + *

    BusinessUnitStoreMode of the Business Unit after the Set Store Mode update action.

    + * + + * @return null|string + */ + public function getStoreMode() + { + return $this->storeMode; + } + + /** + *

    Stores of the Business Unit before the Set Store Mode update action.

    + * + + * @return null|StoreKeyReferenceCollection + */ + public function getOldStores() + { + return $this->oldStores; + } + + /** + *

    BusinessUnitStoreMode of the Business Unit before the Set Store Mode update action.

    + * + + * @return null|string + */ + public function getOldStoreMode() + { + return $this->oldStoreMode; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + * @return $this + */ + public function withStores(?StoreKeyReferenceCollection $stores) + { + $this->stores = $stores; + + return $this; + } + + /** + * @param ?string $storeMode + * @return $this + */ + public function withStoreMode(?string $storeMode) + { + $this->storeMode = $storeMode; + + return $this; + } + + /** + * @param ?StoreKeyReferenceCollection $oldStores + * @return $this + */ + public function withOldStores(?StoreKeyReferenceCollection $oldStores) + { + $this->oldStores = $oldStores; + + return $this; + } + + /** + * @param ?string $oldStoreMode + * @return $this + */ + public function withOldStoreMode(?string $oldStoreMode) + { + $this->oldStoreMode = $oldStoreMode; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): BusinessUnitStoreModeChangedMessage + { + return new BusinessUnitStoreModeChangedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->stores, + $this->storeMode, + $this->oldStores, + $this->oldStoreMode + ); + } + + public static function of(): BusinessUnitStoreModeChangedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessageCollection.php new file mode 100644 index 00000000000..5632bba3731 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitStoreModeChangedMessage current() + * @method BusinessUnitStoreModeChangedMessage end() + * @method BusinessUnitStoreModeChangedMessage at($offset) + */ +class BusinessUnitStoreModeChangedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitStoreModeChangedMessage $value + * @psalm-param BusinessUnitStoreModeChangedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitStoreModeChangedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitStoreModeChangedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitStoreModeChangedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitStoreModeChangedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitStoreModeChangedMessage $data */ + $data = BusinessUnitStoreModeChangedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessageModel.php new file mode 100644 index 00000000000..bd4d1b1f25e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessageModel.php @@ -0,0 +1,599 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->stores = $stores; + $this->storeMode = $storeMode; + $this->oldStores = $oldStores; + $this->oldStoreMode = $oldStoreMode; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Stores of the Business Unit after the Set Store Mode update action.

    + * + * + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STORES); + if (is_null($data)) { + return null; + } + $this->stores = StoreKeyReferenceCollection::fromArray($data); + } + + return $this->stores; + } + + /** + *

    BusinessUnitStoreMode of the Business Unit after the Set Store Mode update action.

    + * + * + * @return null|string + */ + public function getStoreMode() + { + if (is_null($this->storeMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STORE_MODE); + if (is_null($data)) { + return null; + } + $this->storeMode = (string) $data; + } + + return $this->storeMode; + } + + /** + *

    Stores of the Business Unit before the Set Store Mode update action.

    + * + * + * @return null|StoreKeyReferenceCollection + */ + public function getOldStores() + { + if (is_null($this->oldStores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_OLD_STORES); + if (is_null($data)) { + return null; + } + $this->oldStores = StoreKeyReferenceCollection::fromArray($data); + } + + return $this->oldStores; + } + + /** + *

    BusinessUnitStoreMode of the Business Unit before the Set Store Mode update action.

    + * + * + * @return null|string + */ + public function getOldStoreMode() + { + if (is_null($this->oldStoreMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_OLD_STORE_MODE); + if (is_null($data)) { + return null; + } + $this->oldStoreMode = (string) $data; + } + + return $this->oldStoreMode; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void + { + $this->stores = $stores; + } + + /** + * @param ?string $storeMode + */ + public function setStoreMode(?string $storeMode): void + { + $this->storeMode = $storeMode; + } + + /** + * @param ?StoreKeyReferenceCollection $oldStores + */ + public function setOldStores(?StoreKeyReferenceCollection $oldStores): void + { + $this->oldStores = $oldStores; + } + + /** + * @param ?string $oldStoreMode + */ + public function setOldStoreMode(?string $oldStoreMode): void + { + $this->oldStoreMode = $oldStoreMode; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessagePayload.php new file mode 100644 index 00000000000..e40c7e8c0aa --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessagePayload.php @@ -0,0 +1,73 @@ +Stores of the Business Unit after the Set Store Mode update action.

    + * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores(); + + /** + *

    BusinessUnitStoreMode of the Business Unit after the Set Store Mode update action.

    + * + + * @return null|string + */ + public function getStoreMode(); + + /** + *

    Stores of the Business Unit before the Set Store Mode update action.

    + * + + * @return null|StoreKeyReferenceCollection + */ + public function getOldStores(); + + /** + *

    BusinessUnitStoreMode of the Business Unit before the Set Store Mode update action.

    + * + + * @return null|string + */ + public function getOldStoreMode(); + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void; + + /** + * @param ?string $storeMode + */ + public function setStoreMode(?string $storeMode): void; + + /** + * @param ?StoreKeyReferenceCollection $oldStores + */ + public function setOldStores(?StoreKeyReferenceCollection $oldStores): void; + + /** + * @param ?string $oldStoreMode + */ + public function setOldStoreMode(?string $oldStoreMode): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessagePayloadBuilder.php new file mode 100644 index 00000000000..c8e3e40231d --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessagePayloadBuilder.php @@ -0,0 +1,151 @@ + + */ +final class BusinessUnitStoreModeChangedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?StoreKeyReferenceCollection + */ + private $stores; + + /** + + * @var ?string + */ + private $storeMode; + + /** + + * @var ?StoreKeyReferenceCollection + */ + private $oldStores; + + /** + + * @var ?string + */ + private $oldStoreMode; + + /** + *

    Stores of the Business Unit after the Set Store Mode update action.

    + * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + *

    BusinessUnitStoreMode of the Business Unit after the Set Store Mode update action.

    + * + + * @return null|string + */ + public function getStoreMode() + { + return $this->storeMode; + } + + /** + *

    Stores of the Business Unit before the Set Store Mode update action.

    + * + + * @return null|StoreKeyReferenceCollection + */ + public function getOldStores() + { + return $this->oldStores; + } + + /** + *

    BusinessUnitStoreMode of the Business Unit before the Set Store Mode update action.

    + * + + * @return null|string + */ + public function getOldStoreMode() + { + return $this->oldStoreMode; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + * @return $this + */ + public function withStores(?StoreKeyReferenceCollection $stores) + { + $this->stores = $stores; + + return $this; + } + + /** + * @param ?string $storeMode + * @return $this + */ + public function withStoreMode(?string $storeMode) + { + $this->storeMode = $storeMode; + + return $this; + } + + /** + * @param ?StoreKeyReferenceCollection $oldStores + * @return $this + */ + public function withOldStores(?StoreKeyReferenceCollection $oldStores) + { + $this->oldStores = $oldStores; + + return $this; + } + + /** + * @param ?string $oldStoreMode + * @return $this + */ + public function withOldStoreMode(?string $oldStoreMode) + { + $this->oldStoreMode = $oldStoreMode; + + return $this; + } + + + public function build(): BusinessUnitStoreModeChangedMessagePayload + { + return new BusinessUnitStoreModeChangedMessagePayloadModel( + $this->stores, + $this->storeMode, + $this->oldStores, + $this->oldStoreMode + ); + } + + public static function of(): BusinessUnitStoreModeChangedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessagePayloadCollection.php new file mode 100644 index 00000000000..834c9072675 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitStoreModeChangedMessagePayload current() + * @method BusinessUnitStoreModeChangedMessagePayload end() + * @method BusinessUnitStoreModeChangedMessagePayload at($offset) + */ +class BusinessUnitStoreModeChangedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitStoreModeChangedMessagePayload $value + * @psalm-param BusinessUnitStoreModeChangedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitStoreModeChangedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitStoreModeChangedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitStoreModeChangedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitStoreModeChangedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitStoreModeChangedMessagePayload $data */ + $data = BusinessUnitStoreModeChangedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessagePayloadModel.php new file mode 100644 index 00000000000..d23a4d83f38 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreModeChangedMessagePayloadModel.php @@ -0,0 +1,202 @@ +stores = $stores; + $this->storeMode = $storeMode; + $this->oldStores = $oldStores; + $this->oldStoreMode = $oldStoreMode; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Stores of the Business Unit after the Set Store Mode update action.

    + * + * + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STORES); + if (is_null($data)) { + return null; + } + $this->stores = StoreKeyReferenceCollection::fromArray($data); + } + + return $this->stores; + } + + /** + *

    BusinessUnitStoreMode of the Business Unit after the Set Store Mode update action.

    + * + * + * @return null|string + */ + public function getStoreMode() + { + if (is_null($this->storeMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STORE_MODE); + if (is_null($data)) { + return null; + } + $this->storeMode = (string) $data; + } + + return $this->storeMode; + } + + /** + *

    Stores of the Business Unit before the Set Store Mode update action.

    + * + * + * @return null|StoreKeyReferenceCollection + */ + public function getOldStores() + { + if (is_null($this->oldStores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_OLD_STORES); + if (is_null($data)) { + return null; + } + $this->oldStores = StoreKeyReferenceCollection::fromArray($data); + } + + return $this->oldStores; + } + + /** + *

    BusinessUnitStoreMode of the Business Unit before the Set Store Mode update action.

    + * + * + * @return null|string + */ + public function getOldStoreMode() + { + if (is_null($this->oldStoreMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_OLD_STORE_MODE); + if (is_null($data)) { + return null; + } + $this->oldStoreMode = (string) $data; + } + + return $this->oldStoreMode; + } + + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void + { + $this->stores = $stores; + } + + /** + * @param ?string $storeMode + */ + public function setStoreMode(?string $storeMode): void + { + $this->storeMode = $storeMode; + } + + /** + * @param ?StoreKeyReferenceCollection $oldStores + */ + public function setOldStores(?StoreKeyReferenceCollection $oldStores): void + { + $this->oldStores = $oldStores; + } + + /** + * @param ?string $oldStoreMode + */ + public function setOldStoreMode(?string $oldStoreMode): void + { + $this->oldStoreMode = $oldStoreMode; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessage.php new file mode 100644 index 00000000000..529497680d6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessage.php @@ -0,0 +1,31 @@ +The Store that was removed from the Business Unit.

    + * + + * @return null|StoreKeyReference + */ + public function getStore(); + + /** + * @param ?StoreKeyReference $store + */ + public function setStore(?StoreKeyReference $store): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessageBuilder.php new file mode 100644 index 00000000000..714b98f9c92 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class BusinessUnitStoreRemovedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|StoreKeyReference|StoreKeyReferenceBuilder + */ + private $store; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The Store that was removed from the Business Unit.

    + * + + * @return null|StoreKeyReference + */ + public function getStore() + { + return $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?StoreKeyReference $store + * @return $this + */ + public function withStore(?StoreKeyReference $store) + { + $this->store = $store; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withStore() instead + * @return $this + */ + public function withStoreBuilder(?StoreKeyReferenceBuilder $store) + { + $this->store = $store; + + return $this; + } + + public function build(): BusinessUnitStoreRemovedMessage + { + return new BusinessUnitStoreRemovedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store + ); + } + + public static function of(): BusinessUnitStoreRemovedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessageCollection.php new file mode 100644 index 00000000000..5dfc7fe7862 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitStoreRemovedMessage current() + * @method BusinessUnitStoreRemovedMessage end() + * @method BusinessUnitStoreRemovedMessage at($offset) + */ +class BusinessUnitStoreRemovedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitStoreRemovedMessage $value + * @psalm-param BusinessUnitStoreRemovedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitStoreRemovedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitStoreRemovedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitStoreRemovedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitStoreRemovedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitStoreRemovedMessage $data */ + $data = BusinessUnitStoreRemovedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessageModel.php new file mode 100644 index 00000000000..a2c27461769 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->store = $store; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    The Store that was removed from the Business Unit.

    + * + * + * @return null|StoreKeyReference + */ + public function getStore() + { + if (is_null($this->store)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STORE); + if (is_null($data)) { + return null; + } + + $this->store = StoreKeyReferenceModel::of($data); + } + + return $this->store; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?StoreKeyReference $store + */ + public function setStore(?StoreKeyReference $store): void + { + $this->store = $store; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessagePayload.php new file mode 100644 index 00000000000..1c0337fd491 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessagePayload.php @@ -0,0 +1,31 @@ +The Store that was removed from the Business Unit.

    + * + + * @return null|StoreKeyReference + */ + public function getStore(); + + /** + * @param ?StoreKeyReference $store + */ + public function setStore(?StoreKeyReference $store): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessagePayloadBuilder.php new file mode 100644 index 00000000000..f7b2b9fd394 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class BusinessUnitStoreRemovedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|StoreKeyReference|StoreKeyReferenceBuilder + */ + private $store; + + /** + *

    The Store that was removed from the Business Unit.

    + * + + * @return null|StoreKeyReference + */ + public function getStore() + { + return $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store; + } + + /** + * @param ?StoreKeyReference $store + * @return $this + */ + public function withStore(?StoreKeyReference $store) + { + $this->store = $store; + + return $this; + } + + /** + * @deprecated use withStore() instead + * @return $this + */ + public function withStoreBuilder(?StoreKeyReferenceBuilder $store) + { + $this->store = $store; + + return $this; + } + + public function build(): BusinessUnitStoreRemovedMessagePayload + { + return new BusinessUnitStoreRemovedMessagePayloadModel( + $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store + ); + } + + public static function of(): BusinessUnitStoreRemovedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessagePayloadCollection.php new file mode 100644 index 00000000000..0a9bfaea377 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitStoreRemovedMessagePayload current() + * @method BusinessUnitStoreRemovedMessagePayload end() + * @method BusinessUnitStoreRemovedMessagePayload at($offset) + */ +class BusinessUnitStoreRemovedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitStoreRemovedMessagePayload $value + * @psalm-param BusinessUnitStoreRemovedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitStoreRemovedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitStoreRemovedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitStoreRemovedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitStoreRemovedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitStoreRemovedMessagePayload $data */ + $data = BusinessUnitStoreRemovedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessagePayloadModel.php new file mode 100644 index 00000000000..f332f2d96d5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoreRemovedMessagePayloadModel.php @@ -0,0 +1,96 @@ +store = $store; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The Store that was removed from the Business Unit.

    + * + * + * @return null|StoreKeyReference + */ + public function getStore() + { + if (is_null($this->store)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STORE); + if (is_null($data)) { + return null; + } + + $this->store = StoreKeyReferenceModel::of($data); + } + + return $this->store; + } + + + /** + * @param ?StoreKeyReference $store + */ + public function setStore(?StoreKeyReference $store): void + { + $this->store = $store; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessage.php new file mode 100644 index 00000000000..4cb29118a79 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessage.php @@ -0,0 +1,31 @@ +Stores of the Business Unit after the Set Stores update action.

    + * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores(); + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessageBuilder.php new file mode 100644 index 00000000000..76e0aebe3e6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessageBuilder.php @@ -0,0 +1,405 @@ + + */ +final class BusinessUnitStoresSetMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?StoreKeyReferenceCollection + */ + private $stores; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Stores of the Business Unit after the Set Stores update action.

    + * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + * @return $this + */ + public function withStores(?StoreKeyReferenceCollection $stores) + { + $this->stores = $stores; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): BusinessUnitStoresSetMessage + { + return new BusinessUnitStoresSetMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->stores + ); + } + + public static function of(): BusinessUnitStoresSetMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessageCollection.php new file mode 100644 index 00000000000..20c98e46314 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitStoresSetMessage current() + * @method BusinessUnitStoresSetMessage end() + * @method BusinessUnitStoresSetMessage at($offset) + */ +class BusinessUnitStoresSetMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitStoresSetMessage $value + * @psalm-param BusinessUnitStoresSetMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitStoresSetMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitStoresSetMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitStoresSetMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitStoresSetMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitStoresSetMessage $data */ + $data = BusinessUnitStoresSetMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessageModel.php new file mode 100644 index 00000000000..e9c749749ae --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessageModel.php @@ -0,0 +1,491 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->stores = $stores; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Stores of the Business Unit after the Set Stores update action.

    + * + * + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STORES); + if (is_null($data)) { + return null; + } + $this->stores = StoreKeyReferenceCollection::fromArray($data); + } + + return $this->stores; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void + { + $this->stores = $stores; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessagePayload.php new file mode 100644 index 00000000000..e36fb9843f5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessagePayload.php @@ -0,0 +1,31 @@ +Stores of the Business Unit after the Set Stores update action.

    + * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores(); + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void; +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessagePayloadBuilder.php new file mode 100644 index 00000000000..ed34c881e81 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessagePayloadBuilder.php @@ -0,0 +1,64 @@ + + */ +final class BusinessUnitStoresSetMessagePayloadBuilder implements Builder +{ + /** + + * @var ?StoreKeyReferenceCollection + */ + private $stores; + + /** + *

    Stores of the Business Unit after the Set Stores update action.

    + * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + * @return $this + */ + public function withStores(?StoreKeyReferenceCollection $stores) + { + $this->stores = $stores; + + return $this; + } + + + public function build(): BusinessUnitStoresSetMessagePayload + { + return new BusinessUnitStoresSetMessagePayloadModel( + $this->stores + ); + } + + public static function of(): BusinessUnitStoresSetMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessagePayloadCollection.php new file mode 100644 index 00000000000..b1fb5eaba0b --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitStoresSetMessagePayload current() + * @method BusinessUnitStoresSetMessagePayload end() + * @method BusinessUnitStoresSetMessagePayload at($offset) + */ +class BusinessUnitStoresSetMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitStoresSetMessagePayload $value + * @psalm-param BusinessUnitStoresSetMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitStoresSetMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitStoresSetMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitStoresSetMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitStoresSetMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitStoresSetMessagePayload $data */ + $data = BusinessUnitStoresSetMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessagePayloadModel.php new file mode 100644 index 00000000000..2ea46d9f61e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitStoresSetMessagePayloadModel.php @@ -0,0 +1,94 @@ +stores = $stores; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Stores of the Business Unit after the Set Stores update action.

    + * + * + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STORES); + if (is_null($data)) { + return null; + } + $this->stores = StoreKeyReferenceCollection::fromArray($data); + } + + return $this->stores; + } + + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void + { + $this->stores = $stores; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CategoryCreatedMessage.php b/lib/commercetools-api/src/Models/Message/CategoryCreatedMessage.php index fd54277b04f..8064b6edc27 100644 --- a/lib/commercetools-api/src/Models/Message/CategoryCreatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/CategoryCreatedMessage.php @@ -17,6 +17,9 @@ interface CategoryCreatedMessage extends Message public const FIELD_CATEGORY = 'category'; /** + *

    Category that was created.

    + * + * @return null|Category */ public function getCategory(); diff --git a/lib/commercetools-api/src/Models/Message/CategoryCreatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CategoryCreatedMessageBuilder.php index a06cda376d3..01fdd02af72 100644 --- a/lib/commercetools-api/src/Models/Message/CategoryCreatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CategoryCreatedMessageBuilder.php @@ -30,63 +30,75 @@ final class CategoryCreatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|Category|CategoryBuilder */ private $category; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,6 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Category that was created.

    + * + * @return null|Category */ public function getCategory() diff --git a/lib/commercetools-api/src/Models/Message/CategoryCreatedMessageModel.php b/lib/commercetools-api/src/Models/Message/CategoryCreatedMessageModel.php index d85b1f9390a..7685ed4a120 100644 --- a/lib/commercetools-api/src/Models/Message/CategoryCreatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CategoryCreatedMessageModel.php @@ -30,61 +30,73 @@ final class CategoryCreatedMessageModel extends JsonObjectModel implements Categ { public const DISCRIMINATOR_VALUE = 'CategoryCreated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?Category */ protected $category; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?Category $category = null + ?Category $category = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->category = $category; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,6 +367,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Category that was created.

    + * + * * @return null|Category */ public function getCategory() diff --git a/lib/commercetools-api/src/Models/Message/CategoryCreatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CategoryCreatedMessagePayload.php index 98bd4125bc2..327ba172372 100644 --- a/lib/commercetools-api/src/Models/Message/CategoryCreatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CategoryCreatedMessagePayload.php @@ -17,6 +17,9 @@ interface CategoryCreatedMessagePayload extends MessagePayload public const FIELD_CATEGORY = 'category'; /** + *

    Category that was created.

    + * + * @return null|Category */ public function getCategory(); diff --git a/lib/commercetools-api/src/Models/Message/CategoryCreatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CategoryCreatedMessagePayloadBuilder.php index 5b32b08bc3c..b2d7904f28e 100644 --- a/lib/commercetools-api/src/Models/Message/CategoryCreatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CategoryCreatedMessagePayloadBuilder.php @@ -23,11 +23,15 @@ final class CategoryCreatedMessagePayloadBuilder implements Builder { /** + * @var null|Category|CategoryBuilder */ private $category; /** + *

    Category that was created.

    + * + * @return null|Category */ public function getCategory() diff --git a/lib/commercetools-api/src/Models/Message/CategoryCreatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CategoryCreatedMessagePayloadModel.php index cf17346851a..699619e3718 100644 --- a/lib/commercetools-api/src/Models/Message/CategoryCreatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CategoryCreatedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class CategoryCreatedMessagePayloadModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'CategoryCreated'; /** + * * @var ?string */ protected $type; /** + * * @var ?Category */ protected $category; @@ -37,13 +39,15 @@ final class CategoryCreatedMessagePayloadModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?Category $category = null + ?Category $category = null, + ?string $type = null ) { $this->category = $category; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,9 @@ public function getType() } /** + *

    Category that was created.

    + * + * * @return null|Category */ public function getCategory() diff --git a/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessage.php b/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessage.php index 2b1326bfba3..e6ba30e6458 100644 --- a/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessage.php +++ b/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessage.php @@ -18,15 +18,17 @@ interface CategorySlugChangedMessage extends Message public const FIELD_OLD_SLUG = 'oldSlug'; /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Category after the Change Slug update action.

    * + * @return null|LocalizedString */ public function getSlug(); /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Category before the Change Slug update action.

    * + * @return null|LocalizedString */ public function getOldSlug(); diff --git a/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessageBuilder.php index 0858c02a5af..10c8351d00c 100644 --- a/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessageBuilder.php @@ -30,68 +30,81 @@ final class CategorySlugChangedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $oldSlug; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,8 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Category after the Change Slug update action.

    * + * @return null|LocalizedString */ public function getSlug() @@ -188,8 +224,9 @@ public function getSlug() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Category before the Change Slug update action.

    * + * @return null|LocalizedString */ public function getOldSlug() diff --git a/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessageModel.php index 19919e8fc13..066146f500c 100644 --- a/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessageModel.php @@ -30,66 +30,79 @@ final class CategorySlugChangedMessageModel extends JsonObjectModel implements C { public const DISCRIMINATOR_VALUE = 'CategorySlugChanged'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?LocalizedString */ protected $slug; /** + * * @var ?LocalizedString */ protected $oldSlug; @@ -110,7 +123,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?LocalizedString $slug = null, - ?LocalizedString $oldSlug = null + ?LocalizedString $oldSlug = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +138,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->slug = $slug; $this->oldSlug = $oldSlug; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,7 +375,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Category after the Change Slug update action.

    + * * * @return null|LocalizedString */ @@ -355,7 +396,8 @@ public function getSlug() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Category before the Change Slug update action.

    + * * * @return null|LocalizedString */ diff --git a/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessagePayload.php index 89cedccbbdd..85e96635ff9 100644 --- a/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessagePayload.php @@ -18,15 +18,17 @@ interface CategorySlugChangedMessagePayload extends MessagePayload public const FIELD_OLD_SLUG = 'oldSlug'; /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Category after the Change Slug update action.

    * + * @return null|LocalizedString */ public function getSlug(); /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Category before the Change Slug update action.

    * + * @return null|LocalizedString */ public function getOldSlug(); diff --git a/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessagePayloadBuilder.php index 6222b40f881..efc6ce6885a 100644 --- a/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessagePayloadBuilder.php @@ -23,18 +23,21 @@ final class CategorySlugChangedMessagePayloadBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $oldSlug; /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Category after the Change Slug update action.

    * + * @return null|LocalizedString */ public function getSlug() @@ -43,8 +46,9 @@ public function getSlug() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Category before the Change Slug update action.

    * + * @return null|LocalizedString */ public function getOldSlug() diff --git a/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessagePayloadModel.php index 0003bf7c904..a2a828f89a7 100644 --- a/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CategorySlugChangedMessagePayloadModel.php @@ -23,16 +23,19 @@ final class CategorySlugChangedMessagePayloadModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'CategorySlugChanged'; /** + * * @var ?string */ protected $type; /** + * * @var ?LocalizedString */ protected $slug; /** + * * @var ?LocalizedString */ protected $oldSlug; @@ -43,14 +46,16 @@ final class CategorySlugChangedMessagePayloadModel extends JsonObjectModel imple */ public function __construct( ?LocalizedString $slug = null, - ?LocalizedString $oldSlug = null + ?LocalizedString $oldSlug = null, + ?string $type = null ) { $this->slug = $slug; $this->oldSlug = $oldSlug; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,7 +73,8 @@ public function getType() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Category after the Change Slug update action.

    + * * * @return null|LocalizedString */ @@ -88,7 +94,8 @@ public function getSlug() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Category before the Change Slug update action.

    + * * * @return null|LocalizedString */ diff --git a/lib/commercetools-api/src/Models/Message/ContainerAndKey.php b/lib/commercetools-api/src/Models/Message/ContainerAndKey.php index cf6529a329e..a556c01beec 100644 --- a/lib/commercetools-api/src/Models/Message/ContainerAndKey.php +++ b/lib/commercetools-api/src/Models/Message/ContainerAndKey.php @@ -19,13 +19,15 @@ interface ContainerAndKey extends JsonObject /** *

    User-defined identifier that is unique within the given container.

    * + * @return null|string */ public function getKey(); /** - *

    Namespace to group Custom Objects.

    + *

    Namespace to group Custom Objects.

    * + * @return null|string */ public function getContainer(); diff --git a/lib/commercetools-api/src/Models/Message/ContainerAndKeyBuilder.php b/lib/commercetools-api/src/Models/Message/ContainerAndKeyBuilder.php index 24b9ecdf940..bad136312b2 100644 --- a/lib/commercetools-api/src/Models/Message/ContainerAndKeyBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ContainerAndKeyBuilder.php @@ -21,11 +21,13 @@ final class ContainerAndKeyBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $container; @@ -33,6 +35,7 @@ final class ContainerAndKeyBuilder implements Builder /** *

    User-defined identifier that is unique within the given container.

    * + * @return null|string */ public function getKey() @@ -41,8 +44,9 @@ public function getKey() } /** - *

    Namespace to group Custom Objects.

    + *

    Namespace to group Custom Objects.

    * + * @return null|string */ public function getContainer() diff --git a/lib/commercetools-api/src/Models/Message/ContainerAndKeyModel.php b/lib/commercetools-api/src/Models/Message/ContainerAndKeyModel.php index 46c92f2b3fd..f0b7d0f7a0b 100644 --- a/lib/commercetools-api/src/Models/Message/ContainerAndKeyModel.php +++ b/lib/commercetools-api/src/Models/Message/ContainerAndKeyModel.php @@ -20,11 +20,13 @@ final class ContainerAndKeyModel extends JsonObjectModel implements ContainerAndKey { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $container; @@ -44,6 +46,7 @@ public function __construct( /** *

    User-defined identifier that is unique within the given container.

    * + * * @return null|string */ public function getKey() @@ -61,7 +64,8 @@ public function getKey() } /** - *

    Namespace to group Custom Objects.

    + *

    Namespace to group Custom Objects.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessage.php b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessage.php index be5191bf7f7..48a46026bfa 100644 --- a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessage.php +++ b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessage.php @@ -22,30 +22,41 @@ interface CustomLineItemStateTransitionMessage extends OrderMessage public const FIELD_TO_STATE = 'toState'; /** + *

    Unique identifier of the Custom Line Item.

    + * + * @return null|string */ public function getCustomLineItemId(); /** + *

    Date and time (UTC) when the transition of the Custom Line Item State was performed.

    + * + * @return null|DateTimeImmutable */ public function getTransitionDate(); /** + *

    Number of Custom Line Items for which the State was transitioned.

    + * + * @return null|int */ public function getQuantity(); /** - *

    Reference to a State.

    + *

    State the Custom Line Item was transitioned from.

    * + * @return null|StateReference */ public function getFromState(); /** - *

    Reference to a State.

    + *

    State the Custom Line Item was transitioned to.

    * + * @return null|StateReference */ public function getToState(); diff --git a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessageBuilder.php index 2700af20aa0..e86499624a8 100644 --- a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessageBuilder.php @@ -30,83 +30,99 @@ final class CustomLineItemStateTransitionMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $customLineItemId; /** + * @var ?DateTimeImmutable */ private $transitionDate; /** + * @var ?int */ private $quantity; /** + * @var null|StateReference|StateReferenceBuilder */ private $fromState; /** + * @var null|StateReference|StateReferenceBuilder */ private $toState; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -115,6 +131,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -123,6 +142,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -131,6 +153,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -139,8 +164,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -151,6 +177,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -159,6 +186,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -167,8 +198,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -177,6 +209,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -185,6 +220,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -193,6 +231,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Custom Line Item.

    + * + * @return null|string */ public function getCustomLineItemId() @@ -201,6 +242,9 @@ public function getCustomLineItemId() } /** + *

    Date and time (UTC) when the transition of the Custom Line Item State was performed.

    + * + * @return null|DateTimeImmutable */ public function getTransitionDate() @@ -209,6 +253,9 @@ public function getTransitionDate() } /** + *

    Number of Custom Line Items for which the State was transitioned.

    + * + * @return null|int */ public function getQuantity() @@ -217,8 +264,9 @@ public function getQuantity() } /** - *

    Reference to a State.

    + *

    State the Custom Line Item was transitioned from.

    * + * @return null|StateReference */ public function getFromState() @@ -227,8 +275,9 @@ public function getFromState() } /** - *

    Reference to a State.

    + *

    State the Custom Line Item was transitioned to.

    * + * @return null|StateReference */ public function getToState() diff --git a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessageModel.php index ddd31fdbc59..8250c178ea8 100644 --- a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessageModel.php @@ -30,81 +30,97 @@ final class CustomLineItemStateTransitionMessageModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'CustomLineItemStateTransition'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?DateTimeImmutable */ protected $transitionDate; /** + * * @var ?int */ protected $quantity; /** + * * @var ?StateReference */ protected $fromState; /** + * * @var ?StateReference */ protected $toState; @@ -128,7 +144,8 @@ public function __construct( ?DateTimeImmutable $transitionDate = null, ?int $quantity = null, ?StateReference $fromState = null, - ?StateReference $toState = null + ?StateReference $toState = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -145,11 +162,12 @@ public function __construct( $this->quantity = $quantity; $this->fromState = $fromState; $this->toState = $toState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -168,6 +186,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -185,6 +206,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -206,6 +230,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -227,7 +254,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -249,6 +277,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -267,6 +296,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -284,7 +317,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -304,6 +338,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -321,6 +358,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -338,6 +378,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -356,6 +399,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Custom Line Item.

    + * + * * @return null|string */ public function getCustomLineItemId() @@ -373,6 +419,9 @@ public function getCustomLineItemId() } /** + *

    Date and time (UTC) when the transition of the Custom Line Item State was performed.

    + * + * * @return null|DateTimeImmutable */ public function getTransitionDate() @@ -394,6 +443,9 @@ public function getTransitionDate() } /** + *

    Number of Custom Line Items for which the State was transitioned.

    + * + * * @return null|int */ public function getQuantity() @@ -411,7 +463,8 @@ public function getQuantity() } /** - *

    Reference to a State.

    + *

    State the Custom Line Item was transitioned from.

    + * * * @return null|StateReference */ @@ -431,7 +484,8 @@ public function getFromState() } /** - *

    Reference to a State.

    + *

    State the Custom Line Item was transitioned to.

    + * * * @return null|StateReference */ diff --git a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayload.php index 6b984811a9d..90f156668ec 100644 --- a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayload.php @@ -22,30 +22,41 @@ interface CustomLineItemStateTransitionMessagePayload extends OrderMessagePayloa public const FIELD_TO_STATE = 'toState'; /** + *

    Unique identifier of the Custom Line Item.

    + * + * @return null|string */ public function getCustomLineItemId(); /** + *

    Date and time (UTC) when the transition of the Custom Line Item State was performed.

    + * + * @return null|DateTimeImmutable */ public function getTransitionDate(); /** + *

    Number of Custom Line Items for which the State was transitioned.

    + * + * @return null|int */ public function getQuantity(); /** - *

    Reference to a State.

    + *

    State the Custom Line Item was transitioned from.

    * + * @return null|StateReference */ public function getFromState(); /** - *

    Reference to a State.

    + *

    State the Custom Line Item was transitioned to.

    * + * @return null|StateReference */ public function getToState(); diff --git a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayloadBuilder.php index 87634e872a5..f428f767b15 100644 --- a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayloadBuilder.php @@ -24,31 +24,39 @@ final class CustomLineItemStateTransitionMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var ?DateTimeImmutable */ private $transitionDate; /** + * @var ?int */ private $quantity; /** + * @var null|StateReference|StateReferenceBuilder */ private $fromState; /** + * @var null|StateReference|StateReferenceBuilder */ private $toState; /** + *

    Unique identifier of the Custom Line Item.

    + * + * @return null|string */ public function getCustomLineItemId() @@ -57,6 +65,9 @@ public function getCustomLineItemId() } /** + *

    Date and time (UTC) when the transition of the Custom Line Item State was performed.

    + * + * @return null|DateTimeImmutable */ public function getTransitionDate() @@ -65,6 +76,9 @@ public function getTransitionDate() } /** + *

    Number of Custom Line Items for which the State was transitioned.

    + * + * @return null|int */ public function getQuantity() @@ -73,8 +87,9 @@ public function getQuantity() } /** - *

    Reference to a State.

    + *

    State the Custom Line Item was transitioned from.

    * + * @return null|StateReference */ public function getFromState() @@ -83,8 +98,9 @@ public function getFromState() } /** - *

    Reference to a State.

    + *

    State the Custom Line Item was transitioned to.

    * + * @return null|StateReference */ public function getToState() diff --git a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayloadModel.php index 4e5007ed223..bf4756f1594 100644 --- a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayloadModel.php @@ -24,31 +24,37 @@ final class CustomLineItemStateTransitionMessagePayloadModel extends JsonObjectM { public const DISCRIMINATOR_VALUE = 'CustomLineItemStateTransition'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?DateTimeImmutable */ protected $transitionDate; /** + * * @var ?int */ protected $quantity; /** + * * @var ?StateReference */ protected $fromState; /** + * * @var ?StateReference */ protected $toState; @@ -62,17 +68,19 @@ public function __construct( ?DateTimeImmutable $transitionDate = null, ?int $quantity = null, ?StateReference $fromState = null, - ?StateReference $toState = null + ?StateReference $toState = null, + ?string $type = null ) { $this->customLineItemId = $customLineItemId; $this->transitionDate = $transitionDate; $this->quantity = $quantity; $this->fromState = $fromState; $this->toState = $toState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -90,6 +98,9 @@ public function getType() } /** + *

    Unique identifier of the Custom Line Item.

    + * + * * @return null|string */ public function getCustomLineItemId() @@ -107,6 +118,9 @@ public function getCustomLineItemId() } /** + *

    Date and time (UTC) when the transition of the Custom Line Item State was performed.

    + * + * * @return null|DateTimeImmutable */ public function getTransitionDate() @@ -128,6 +142,9 @@ public function getTransitionDate() } /** + *

    Number of Custom Line Items for which the State was transitioned.

    + * + * * @return null|int */ public function getQuantity() @@ -145,7 +162,8 @@ public function getQuantity() } /** - *

    Reference to a State.

    + *

    State the Custom Line Item was transitioned from.

    + * * * @return null|StateReference */ @@ -165,7 +183,8 @@ public function getFromState() } /** - *

    Reference to a State.

    + *

    State the Custom Line Item was transitioned to.

    + * * * @return null|StateReference */ diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessage.php index 172bda08e9c..5ddb0046b8f 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessage.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessage.php @@ -17,6 +17,9 @@ interface CustomerAddressAddedMessage extends Message public const FIELD_ADDRESS = 'address'; /** + *

    Address that was added during the Add Address update action.

    + * + * @return null|Address */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessageBuilder.php index f7550c8e0ad..d3ba646749e 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessageBuilder.php @@ -30,63 +30,75 @@ final class CustomerAddressAddedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|Address|AddressBuilder */ private $address; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,6 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Address that was added during the Add Address update action.

    + * + * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessageModel.php index ad28baa3f7f..41fa21dfb3a 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessageModel.php @@ -30,61 +30,73 @@ final class CustomerAddressAddedMessageModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'CustomerAddressAdded'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?Address */ protected $address; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?Address $address = null + ?Address $address = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->address = $address; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,6 +367,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Address that was added during the Add Address update action.

    + * + * * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessagePayload.php index 14cf8884dfc..66974f19bfa 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessagePayload.php @@ -17,6 +17,9 @@ interface CustomerAddressAddedMessagePayload extends MessagePayload public const FIELD_ADDRESS = 'address'; /** + *

    Address that was added during the Add Address update action.

    + * + * @return null|Address */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessagePayloadBuilder.php index 3f77891877e..dcb81040bae 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessagePayloadBuilder.php @@ -23,11 +23,15 @@ final class CustomerAddressAddedMessagePayloadBuilder implements Builder { /** + * @var null|Address|AddressBuilder */ private $address; /** + *

    Address that was added during the Add Address update action.

    + * + * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessagePayloadModel.php index 5514ee69bdc..c475415c71e 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressAddedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class CustomerAddressAddedMessagePayloadModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'CustomerAddressAdded'; /** + * * @var ?string */ protected $type; /** + * * @var ?Address */ protected $address; @@ -37,13 +39,15 @@ final class CustomerAddressAddedMessagePayloadModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?Address $address = null + ?Address $address = null, + ?string $type = null ) { $this->address = $address; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,9 @@ public function getType() } /** + *

    Address that was added during the Add Address update action.

    + * + * * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessage.php index 2fa3c3596c1..4ec772046d3 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessage.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessage.php @@ -17,6 +17,9 @@ interface CustomerAddressChangedMessage extends Message public const FIELD_ADDRESS = 'address'; /** + *

    Address that was set during the Change Address update action.

    + * + * @return null|Address */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessageBuilder.php index 727ae963d46..d833db8f611 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessageBuilder.php @@ -30,63 +30,75 @@ final class CustomerAddressChangedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|Address|AddressBuilder */ private $address; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,6 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Address that was set during the Change Address update action.

    + * + * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessageModel.php index aecb6998a51..da90c923c58 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessageModel.php @@ -30,61 +30,73 @@ final class CustomerAddressChangedMessageModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'CustomerAddressChanged'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?Address */ protected $address; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?Address $address = null + ?Address $address = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->address = $address; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,6 +367,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Address that was set during the Change Address update action.

    + * + * * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessagePayload.php index e0d597aea01..91868899166 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessagePayload.php @@ -17,6 +17,9 @@ interface CustomerAddressChangedMessagePayload extends MessagePayload public const FIELD_ADDRESS = 'address'; /** + *

    Address that was set during the Change Address update action.

    + * + * @return null|Address */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessagePayloadBuilder.php index e988e2d3ca1..299c8b01ece 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessagePayloadBuilder.php @@ -23,11 +23,15 @@ final class CustomerAddressChangedMessagePayloadBuilder implements Builder { /** + * @var null|Address|AddressBuilder */ private $address; /** + *

    Address that was set during the Change Address update action.

    + * + * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessagePayloadModel.php index 5be55730557..59b2d75401f 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressChangedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class CustomerAddressChangedMessagePayloadModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'CustomerAddressChanged'; /** + * * @var ?string */ protected $type; /** + * * @var ?Address */ protected $address; @@ -37,13 +39,15 @@ final class CustomerAddressChangedMessagePayloadModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?Address $address = null + ?Address $address = null, + ?string $type = null ) { $this->address = $address; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,9 @@ public function getType() } /** + *

    Address that was set during the Change Address update action.

    + * + * * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessage.php index 343ceb6926f..de69daa237b 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessage.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessage.php @@ -17,6 +17,9 @@ interface CustomerAddressRemovedMessage extends Message public const FIELD_ADDRESS = 'address'; /** + *

    Address that was removed during the Remove Address update action.

    + * + * @return null|Address */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessageBuilder.php index df9eaf64de4..8f2d11f63b5 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessageBuilder.php @@ -30,63 +30,75 @@ final class CustomerAddressRemovedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|Address|AddressBuilder */ private $address; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,6 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Address that was removed during the Remove Address update action.

    + * + * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessageModel.php index 212a3ab6796..6cdaae9891b 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessageModel.php @@ -30,61 +30,73 @@ final class CustomerAddressRemovedMessageModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'CustomerAddressRemoved'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?Address */ protected $address; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?Address $address = null + ?Address $address = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->address = $address; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,6 +367,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Address that was removed during the Remove Address update action.

    + * + * * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessagePayload.php index 865f6835456..557a6ecbaf7 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessagePayload.php @@ -17,6 +17,9 @@ interface CustomerAddressRemovedMessagePayload extends MessagePayload public const FIELD_ADDRESS = 'address'; /** + *

    Address that was removed during the Remove Address update action.

    + * + * @return null|Address */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessagePayloadBuilder.php index ad2f3351dd4..b91b0164f62 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessagePayloadBuilder.php @@ -23,11 +23,15 @@ final class CustomerAddressRemovedMessagePayloadBuilder implements Builder { /** + * @var null|Address|AddressBuilder */ private $address; /** + *

    Address that was removed during the Remove Address update action.

    + * + * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessagePayloadModel.php index 5ee937bdd51..7f109792d8e 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressRemovedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class CustomerAddressRemovedMessagePayloadModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'CustomerAddressRemoved'; /** + * * @var ?string */ protected $type; /** + * * @var ?Address */ protected $address; @@ -37,13 +39,15 @@ final class CustomerAddressRemovedMessagePayloadModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?Address $address = null + ?Address $address = null, + ?string $type = null ) { $this->address = $address; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,9 @@ public function getType() } /** + *

    Address that was removed during the Remove Address update action.

    + * + * * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessage.php b/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessage.php index caab3cc5db6..54549f9234f 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessage.php @@ -16,6 +16,9 @@ interface CustomerCompanyNameSetMessage extends Message public const FIELD_COMPANY_NAME = 'companyName'; /** + *

    The companyName that was set during the Set Company Name update action.

    + * + * @return null|string */ public function getCompanyName(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessageBuilder.php index 2e893f6542d..4197054ebff 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessageBuilder.php @@ -28,63 +28,75 @@ final class CustomerCompanyNameSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $companyName; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -93,6 +105,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -101,6 +116,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -109,6 +127,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -117,8 +138,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -129,6 +151,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -137,6 +160,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -145,8 +172,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -155,6 +183,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -163,6 +194,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -171,6 +205,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The companyName that was set during the Set Company Name update action.

    + * + * @return null|string */ public function getCompanyName() diff --git a/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessageModel.php index 23420b4611d..ea4628d7a07 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessageModel.php @@ -28,61 +28,73 @@ final class CustomerCompanyNameSetMessageModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'CustomerCompanyNameSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $companyName; @@ -102,7 +114,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?string $companyName = null + ?string $companyName = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -115,11 +128,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->companyName = $companyName; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -138,6 +152,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -155,6 +172,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -176,6 +196,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -197,7 +220,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -219,6 +243,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -237,6 +262,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -254,7 +283,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -274,6 +304,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -291,6 +324,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -308,6 +344,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -326,6 +365,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The companyName that was set during the Set Company Name update action.

    + * + * * @return null|string */ public function getCompanyName() diff --git a/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessagePayload.php index b99f252abf3..c0dfa0190cd 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessagePayload.php @@ -16,6 +16,9 @@ interface CustomerCompanyNameSetMessagePayload extends MessagePayload public const FIELD_COMPANY_NAME = 'companyName'; /** + *

    The companyName that was set during the Set Company Name update action.

    + * + * @return null|string */ public function getCompanyName(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessagePayloadBuilder.php index cef8f671b51..302d53dc021 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessagePayloadBuilder.php @@ -21,11 +21,15 @@ final class CustomerCompanyNameSetMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $companyName; /** + *

    The companyName that was set during the Set Company Name update action.

    + * + * @return null|string */ public function getCompanyName() diff --git a/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessagePayloadModel.php index 25a5fc3f25d..94643799eb9 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerCompanyNameSetMessagePayloadModel.php @@ -21,11 +21,13 @@ final class CustomerCompanyNameSetMessagePayloadModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'CustomerCompanyNameSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $companyName; @@ -35,13 +37,15 @@ final class CustomerCompanyNameSetMessagePayloadModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?string $companyName = null + ?string $companyName = null, + ?string $type = null ) { $this->companyName = $companyName; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,6 +63,9 @@ public function getType() } /** + *

    The companyName that was set during the Set Company Name update action.

    + * + * * @return null|string */ public function getCompanyName() diff --git a/lib/commercetools-api/src/Models/Message/CustomerCreatedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerCreatedMessage.php index 84b6d8c8b61..76bd7b585ae 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerCreatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/CustomerCreatedMessage.php @@ -17,6 +17,9 @@ interface CustomerCreatedMessage extends Message public const FIELD_CUSTOMER = 'customer'; /** + *

    Customer that was created.

    + * + * @return null|Customer */ public function getCustomer(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerCreatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerCreatedMessageBuilder.php index b0b4761d0a7..19f0d0766cd 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerCreatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerCreatedMessageBuilder.php @@ -30,63 +30,75 @@ final class CustomerCreatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|Customer|CustomerBuilder */ private $customer; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,6 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Customer that was created.

    + * + * @return null|Customer */ public function getCustomer() diff --git a/lib/commercetools-api/src/Models/Message/CustomerCreatedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerCreatedMessageModel.php index d8c0596a442..542742b79e6 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerCreatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerCreatedMessageModel.php @@ -30,61 +30,73 @@ final class CustomerCreatedMessageModel extends JsonObjectModel implements Custo { public const DISCRIMINATOR_VALUE = 'CustomerCreated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?Customer */ protected $customer; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?Customer $customer = null + ?Customer $customer = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->customer = $customer; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,6 +367,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Customer that was created.

    + * + * * @return null|Customer */ public function getCustomer() diff --git a/lib/commercetools-api/src/Models/Message/CustomerCreatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerCreatedMessagePayload.php index 829938bd78a..a31dfea8bd4 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerCreatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CustomerCreatedMessagePayload.php @@ -17,6 +17,9 @@ interface CustomerCreatedMessagePayload extends MessagePayload public const FIELD_CUSTOMER = 'customer'; /** + *

    Customer that was created.

    + * + * @return null|Customer */ public function getCustomer(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerCreatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerCreatedMessagePayloadBuilder.php index 0441bb0b90a..ead929ab6da 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerCreatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerCreatedMessagePayloadBuilder.php @@ -23,11 +23,15 @@ final class CustomerCreatedMessagePayloadBuilder implements Builder { /** + * @var null|Customer|CustomerBuilder */ private $customer; /** + *

    Customer that was created.

    + * + * @return null|Customer */ public function getCustomer() diff --git a/lib/commercetools-api/src/Models/Message/CustomerCreatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerCreatedMessagePayloadModel.php index 83d24f42b7c..66777cbe68c 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerCreatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerCreatedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class CustomerCreatedMessagePayloadModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'CustomerCreated'; /** + * * @var ?string */ protected $type; /** + * * @var ?Customer */ protected $customer; @@ -37,13 +39,15 @@ final class CustomerCreatedMessagePayloadModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?Customer $customer = null + ?Customer $customer = null, + ?string $type = null ) { $this->customer = $customer; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,9 @@ public function getType() } /** + *

    Customer that was created.

    + * + * * @return null|Customer */ public function getCustomer() diff --git a/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessage.php b/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessage.php index 274adf65479..ef883cf4468 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessage.php @@ -17,6 +17,9 @@ interface CustomerDateOfBirthSetMessage extends Message public const FIELD_DATE_OF_BIRTH = 'dateOfBirth'; /** + *

    The dateOfBirth that was set during the Set Date of Birth update action.

    + * + * @return null|DateTimeImmutable */ public function getDateOfBirth(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessageBuilder.php index 2fb84e729ef..969393c9740 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessageBuilder.php @@ -28,63 +28,75 @@ final class CustomerDateOfBirthSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?DateTimeImmutable */ private $dateOfBirth; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -93,6 +105,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -101,6 +116,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -109,6 +127,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -117,8 +138,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -129,6 +151,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -137,6 +160,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -145,8 +172,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -155,6 +183,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -163,6 +194,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -171,6 +205,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The dateOfBirth that was set during the Set Date of Birth update action.

    + * + * @return null|DateTimeImmutable */ public function getDateOfBirth() diff --git a/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessageModel.php index 817e8bfa248..9acd89d900d 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessageModel.php @@ -28,61 +28,73 @@ final class CustomerDateOfBirthSetMessageModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'CustomerDateOfBirthSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?DateTimeImmutable */ protected $dateOfBirth; @@ -102,7 +114,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?DateTimeImmutable $dateOfBirth = null + ?DateTimeImmutable $dateOfBirth = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -115,11 +128,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->dateOfBirth = $dateOfBirth; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -138,6 +152,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -155,6 +172,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -176,6 +196,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -197,7 +220,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -219,6 +243,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -237,6 +262,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -254,7 +283,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -274,6 +304,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -291,6 +324,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -308,6 +344,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -326,6 +365,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The dateOfBirth that was set during the Set Date of Birth update action.

    + * + * * @return null|DateTimeImmutable */ public function getDateOfBirth() diff --git a/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessagePayload.php index fbe6a1b81fb..2b4a4cb8e3c 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessagePayload.php @@ -17,6 +17,9 @@ interface CustomerDateOfBirthSetMessagePayload extends MessagePayload public const FIELD_DATE_OF_BIRTH = 'dateOfBirth'; /** + *

    The dateOfBirth that was set during the Set Date of Birth update action.

    + * + * @return null|DateTimeImmutable */ public function getDateOfBirth(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessagePayloadBuilder.php index b1e276034c7..ef447adefe6 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessagePayloadBuilder.php @@ -22,11 +22,15 @@ final class CustomerDateOfBirthSetMessagePayloadBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $dateOfBirth; /** + *

    The dateOfBirth that was set during the Set Date of Birth update action.

    + * + * @return null|DateTimeImmutable */ public function getDateOfBirth() diff --git a/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessagePayloadModel.php index 6f166c2a6bd..1a49b892306 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerDateOfBirthSetMessagePayloadModel.php @@ -22,11 +22,13 @@ final class CustomerDateOfBirthSetMessagePayloadModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'CustomerDateOfBirthSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?DateTimeImmutable */ protected $dateOfBirth; @@ -36,13 +38,15 @@ final class CustomerDateOfBirthSetMessagePayloadModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutable $dateOfBirth = null + ?DateTimeImmutable $dateOfBirth = null, + ?string $type = null ) { $this->dateOfBirth = $dateOfBirth; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -60,6 +64,9 @@ public function getType() } /** + *

    The dateOfBirth that was set during the Set Date of Birth update action.

    + * + * * @return null|DateTimeImmutable */ public function getDateOfBirth() diff --git a/lib/commercetools-api/src/Models/Message/CustomerDeletedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerDeletedMessageBuilder.php index 383b9e9623f..4e486a816bf 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerDeletedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerDeletedMessageBuilder.php @@ -28,58 +28,69 @@ final class CustomerDeletedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -88,6 +99,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -96,6 +110,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -104,6 +121,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -112,8 +132,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -124,6 +145,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -132,6 +154,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -140,8 +166,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -150,6 +177,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -158,6 +188,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/CustomerDeletedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerDeletedMessageModel.php index 873e244ae25..1f7d3c48df0 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerDeletedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerDeletedMessageModel.php @@ -28,56 +28,67 @@ final class CustomerDeletedMessageModel extends JsonObjectModel implements Custo { public const DISCRIMINATOR_VALUE = 'CustomerDeleted'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; @@ -96,7 +107,8 @@ public function __construct( ?int $sequenceNumber = null, ?Reference $resource = null, ?int $resourceVersion = null, - ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null + ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -108,11 +120,12 @@ public function __construct( $this->resource = $resource; $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -131,6 +144,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -148,6 +164,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -169,6 +188,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -190,7 +212,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -212,6 +235,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -230,6 +254,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -247,7 +275,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -267,6 +296,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -284,6 +316,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -301,6 +336,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/CustomerDeletedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerDeletedMessagePayloadModel.php index dbe6045af3c..456c1bcf57b 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerDeletedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerDeletedMessagePayloadModel.php @@ -21,6 +21,7 @@ final class CustomerDeletedMessagePayloadModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'CustomerDeleted'; /** + * * @var ?string */ protected $type; @@ -30,11 +31,13 @@ final class CustomerDeletedMessagePayloadModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessage.php index 29eea731231..58442d82202 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessage.php +++ b/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessage.php @@ -16,6 +16,9 @@ interface CustomerEmailChangedMessage extends Message public const FIELD_EMAIL = 'email'; /** + *

    The email that was set during the Change Email update action.

    + * + * @return null|string */ public function getEmail(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessageBuilder.php index 76154479de4..661555191df 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessageBuilder.php @@ -28,63 +28,75 @@ final class CustomerEmailChangedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $email; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -93,6 +105,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -101,6 +116,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -109,6 +127,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -117,8 +138,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -129,6 +151,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -137,6 +160,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -145,8 +172,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -155,6 +183,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -163,6 +194,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -171,6 +205,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The email that was set during the Change Email update action.

    + * + * @return null|string */ public function getEmail() diff --git a/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessageModel.php index 8bec65e8b60..1b9317f8f81 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessageModel.php @@ -28,61 +28,73 @@ final class CustomerEmailChangedMessageModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'CustomerEmailChanged'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $email; @@ -102,7 +114,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?string $email = null + ?string $email = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -115,11 +128,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->email = $email; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -138,6 +152,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -155,6 +172,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -176,6 +196,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -197,7 +220,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -219,6 +243,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -237,6 +262,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -254,7 +283,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -274,6 +304,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -291,6 +324,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -308,6 +344,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -326,6 +365,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The email that was set during the Change Email update action.

    + * + * * @return null|string */ public function getEmail() diff --git a/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessagePayload.php index d9ce461b1cd..139b91d6b8c 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessagePayload.php @@ -16,6 +16,9 @@ interface CustomerEmailChangedMessagePayload extends MessagePayload public const FIELD_EMAIL = 'email'; /** + *

    The email that was set during the Change Email update action.

    + * + * @return null|string */ public function getEmail(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessagePayloadBuilder.php index 54297d1fd41..f1359b45b9c 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessagePayloadBuilder.php @@ -21,11 +21,15 @@ final class CustomerEmailChangedMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $email; /** + *

    The email that was set during the Change Email update action.

    + * + * @return null|string */ public function getEmail() diff --git a/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessagePayloadModel.php index f5f37383faa..a2af8f95029 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerEmailChangedMessagePayloadModel.php @@ -21,11 +21,13 @@ final class CustomerEmailChangedMessagePayloadModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'CustomerEmailChanged'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $email; @@ -35,13 +37,15 @@ final class CustomerEmailChangedMessagePayloadModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?string $email = null + ?string $email = null, + ?string $type = null ) { $this->email = $email; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,6 +63,9 @@ public function getType() } /** + *

    The email that was set during the Change Email update action.

    + * + * * @return null|string */ public function getEmail() diff --git a/lib/commercetools-api/src/Models/Message/CustomerEmailVerifiedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerEmailVerifiedMessageBuilder.php index 0a4671dec5a..f2b31536eed 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerEmailVerifiedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerEmailVerifiedMessageBuilder.php @@ -28,58 +28,69 @@ final class CustomerEmailVerifiedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -88,6 +99,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -96,6 +110,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -104,6 +121,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -112,8 +132,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -124,6 +145,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -132,6 +154,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -140,8 +166,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -150,6 +177,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -158,6 +188,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/CustomerEmailVerifiedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerEmailVerifiedMessageModel.php index 427a32bbf8c..56f38188159 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerEmailVerifiedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerEmailVerifiedMessageModel.php @@ -28,56 +28,67 @@ final class CustomerEmailVerifiedMessageModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'CustomerEmailVerified'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; @@ -96,7 +107,8 @@ public function __construct( ?int $sequenceNumber = null, ?Reference $resource = null, ?int $resourceVersion = null, - ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null + ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -108,11 +120,12 @@ public function __construct( $this->resource = $resource; $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -131,6 +144,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -148,6 +164,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -169,6 +188,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -190,7 +212,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -212,6 +235,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -230,6 +254,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -247,7 +275,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -267,6 +296,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -284,6 +316,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -301,6 +336,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/CustomerEmailVerifiedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerEmailVerifiedMessagePayloadModel.php index eed32d3fd87..95c7ee0422c 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerEmailVerifiedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerEmailVerifiedMessagePayloadModel.php @@ -21,6 +21,7 @@ final class CustomerEmailVerifiedMessagePayloadModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'CustomerEmailVerified'; /** + * * @var ?string */ protected $type; @@ -30,11 +31,13 @@ final class CustomerEmailVerifiedMessagePayloadModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessage.php b/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessage.php index e709c55a18d..11320ba2ffd 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessage.php @@ -16,6 +16,9 @@ interface CustomerFirstNameSetMessage extends Message public const FIELD_FIRST_NAME = 'firstName'; /** + *

    The firstName that was set during the Set First Name update action.

    + * + * @return null|string */ public function getFirstName(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessageBuilder.php index 056a542d25c..be0ccb81afd 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessageBuilder.php @@ -28,63 +28,75 @@ final class CustomerFirstNameSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $firstName; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -93,6 +105,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -101,6 +116,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -109,6 +127,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -117,8 +138,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -129,6 +151,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -137,6 +160,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -145,8 +172,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -155,6 +183,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -163,6 +194,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -171,6 +205,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The firstName that was set during the Set First Name update action.

    + * + * @return null|string */ public function getFirstName() diff --git a/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessageModel.php index 0255f235abe..5f9ad0ba49c 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessageModel.php @@ -28,61 +28,73 @@ final class CustomerFirstNameSetMessageModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'CustomerFirstNameSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $firstName; @@ -102,7 +114,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?string $firstName = null + ?string $firstName = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -115,11 +128,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->firstName = $firstName; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -138,6 +152,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -155,6 +172,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -176,6 +196,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -197,7 +220,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -219,6 +243,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -237,6 +262,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -254,7 +283,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -274,6 +304,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -291,6 +324,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -308,6 +344,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -326,6 +365,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The firstName that was set during the Set First Name update action.

    + * + * * @return null|string */ public function getFirstName() diff --git a/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessagePayload.php index 93f38981197..063c0d512e5 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessagePayload.php @@ -16,6 +16,9 @@ interface CustomerFirstNameSetMessagePayload extends MessagePayload public const FIELD_FIRST_NAME = 'firstName'; /** + *

    The firstName that was set during the Set First Name update action.

    + * + * @return null|string */ public function getFirstName(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessagePayloadBuilder.php index c37d2249b30..aa41863cae1 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessagePayloadBuilder.php @@ -21,11 +21,15 @@ final class CustomerFirstNameSetMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $firstName; /** + *

    The firstName that was set during the Set First Name update action.

    + * + * @return null|string */ public function getFirstName() diff --git a/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessagePayloadModel.php index 1175eba9604..841f01ae6ab 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerFirstNameSetMessagePayloadModel.php @@ -21,11 +21,13 @@ final class CustomerFirstNameSetMessagePayloadModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'CustomerFirstNameSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $firstName; @@ -35,13 +37,15 @@ final class CustomerFirstNameSetMessagePayloadModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?string $firstName = null + ?string $firstName = null, + ?string $type = null ) { $this->firstName = $firstName; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,6 +63,9 @@ public function getType() } /** + *

    The firstName that was set during the Set First Name update action.

    + * + * * @return null|string */ public function getFirstName() diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessage.php b/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessage.php index 953f05083fd..356a87e27a0 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessage.php @@ -17,8 +17,9 @@ interface CustomerGroupSetMessage extends Message public const FIELD_CUSTOMER_GROUP = 'customerGroup'; /** - *

    Reference to a CustomerGroup.

    + *

    Customer Group that was set during the Set Customer Group update action.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessageBuilder.php index 20481f0bbfb..db73835b54c 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessageBuilder.php @@ -30,63 +30,75 @@ final class CustomerGroupSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $customerGroup; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,8 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a CustomerGroup.

    + *

    Customer Group that was set during the Set Customer Group update action.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup() diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessageModel.php index 16f2f57605d..5281ad51c01 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessageModel.php @@ -30,61 +30,73 @@ final class CustomerGroupSetMessageModel extends JsonObjectModel implements Cust { public const DISCRIMINATOR_VALUE = 'CustomerGroupSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?CustomerGroupReference */ protected $customerGroup; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?CustomerGroupReference $customerGroup = null + ?CustomerGroupReference $customerGroup = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->customerGroup = $customerGroup; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,7 +367,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a CustomerGroup.

    + *

    Customer Group that was set during the Set Customer Group update action.

    + * * * @return null|CustomerGroupReference */ diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessagePayload.php index b7c6a3bbb5e..a0e0c987756 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessagePayload.php @@ -17,8 +17,9 @@ interface CustomerGroupSetMessagePayload extends MessagePayload public const FIELD_CUSTOMER_GROUP = 'customerGroup'; /** - *

    Reference to a CustomerGroup.

    + *

    Customer Group that was set during the Set Customer Group update action.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessagePayloadBuilder.php index ac0cb5f7ac8..3c79e946d84 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessagePayloadBuilder.php @@ -23,13 +23,15 @@ final class CustomerGroupSetMessagePayloadBuilder implements Builder { /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $customerGroup; /** - *

    Reference to a CustomerGroup.

    + *

    Customer Group that was set during the Set Customer Group update action.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup() diff --git a/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessagePayloadModel.php index 1f2e5a393e1..5ad0e1f3f73 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerGroupSetMessagePayloadModel.php @@ -23,11 +23,13 @@ final class CustomerGroupSetMessagePayloadModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'CustomerGroupSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?CustomerGroupReference */ protected $customerGroup; @@ -37,13 +39,15 @@ final class CustomerGroupSetMessagePayloadModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?CustomerGroupReference $customerGroup = null + ?CustomerGroupReference $customerGroup = null, + ?string $type = null ) { $this->customerGroup = $customerGroup; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,7 +65,8 @@ public function getType() } /** - *

    Reference to a CustomerGroup.

    + *

    Customer Group that was set during the Set Customer Group update action.

    + * * * @return null|CustomerGroupReference */ diff --git a/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessage.php b/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessage.php index 5ab325acba7..1d8867abfb6 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessage.php @@ -16,6 +16,9 @@ interface CustomerLastNameSetMessage extends Message public const FIELD_LAST_NAME = 'lastName'; /** + *

    The lastName that was set during the Set Last Name update action.

    + * + * @return null|string */ public function getLastName(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessageBuilder.php index 075c6c85865..e68ca22f378 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessageBuilder.php @@ -28,63 +28,75 @@ final class CustomerLastNameSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $lastName; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -93,6 +105,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -101,6 +116,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -109,6 +127,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -117,8 +138,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -129,6 +151,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -137,6 +160,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -145,8 +172,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -155,6 +183,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -163,6 +194,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -171,6 +205,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The lastName that was set during the Set Last Name update action.

    + * + * @return null|string */ public function getLastName() diff --git a/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessageModel.php index d2178811e55..b4812b2ad3e 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessageModel.php @@ -28,61 +28,73 @@ final class CustomerLastNameSetMessageModel extends JsonObjectModel implements C { public const DISCRIMINATOR_VALUE = 'CustomerLastNameSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $lastName; @@ -102,7 +114,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?string $lastName = null + ?string $lastName = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -115,11 +128,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->lastName = $lastName; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -138,6 +152,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -155,6 +172,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -176,6 +196,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -197,7 +220,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -219,6 +243,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -237,6 +262,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -254,7 +283,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -274,6 +304,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -291,6 +324,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -308,6 +344,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -326,6 +365,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The lastName that was set during the Set Last Name update action.

    + * + * * @return null|string */ public function getLastName() diff --git a/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessagePayload.php index 733aae27a06..245c407a754 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessagePayload.php @@ -16,6 +16,9 @@ interface CustomerLastNameSetMessagePayload extends MessagePayload public const FIELD_LAST_NAME = 'lastName'; /** + *

    The lastName that was set during the Set Last Name update action.

    + * + * @return null|string */ public function getLastName(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessagePayloadBuilder.php index 89413be737f..954927e0a40 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessagePayloadBuilder.php @@ -21,11 +21,15 @@ final class CustomerLastNameSetMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $lastName; /** + *

    The lastName that was set during the Set Last Name update action.

    + * + * @return null|string */ public function getLastName() diff --git a/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessagePayloadModel.php index 0dcbeb638e7..5a11b229254 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerLastNameSetMessagePayloadModel.php @@ -21,11 +21,13 @@ final class CustomerLastNameSetMessagePayloadModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'CustomerLastNameSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $lastName; @@ -35,13 +37,15 @@ final class CustomerLastNameSetMessagePayloadModel extends JsonObjectModel imple * @psalm-suppress MissingParamType */ public function __construct( - ?string $lastName = null + ?string $lastName = null, + ?string $type = null ) { $this->lastName = $lastName; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,6 +63,9 @@ public function getType() } /** + *

    The lastName that was set during the Set Last Name update action.

    + * + * * @return null|string */ public function getLastName() diff --git a/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessage.php index 87f9f7da6cf..fdf5f00b92c 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessage.php @@ -16,8 +16,9 @@ interface CustomerPasswordUpdatedMessage extends Message public const FIELD_RESET = 'reset'; /** - *

    true, if password has been updated during Customer's Password Reset workflow.

    + *

    Whether the Customer's password was updated during the Reset password or Change password flow.

    * + * @return null|bool */ public function getReset(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessageBuilder.php index 0eee2176c2f..4facdab30b0 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessageBuilder.php @@ -28,63 +28,75 @@ final class CustomerPasswordUpdatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?bool */ private $reset; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -93,6 +105,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -101,6 +116,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -109,6 +127,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -117,8 +138,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -129,6 +151,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -137,6 +160,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -145,8 +172,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -155,6 +183,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -163,6 +194,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -171,8 +205,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    true, if password has been updated during Customer's Password Reset workflow.

    + *

    Whether the Customer's password was updated during the Reset password or Change password flow.

    * + * @return null|bool */ public function getReset() diff --git a/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessageModel.php index cd4a7c837fa..697a2a967d6 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessageModel.php @@ -28,61 +28,73 @@ final class CustomerPasswordUpdatedMessageModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'CustomerPasswordUpdated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?bool */ protected $reset; @@ -102,7 +114,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?bool $reset = null + ?bool $reset = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -115,11 +128,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->reset = $reset; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -138,6 +152,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -155,6 +172,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -176,6 +196,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -197,7 +220,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -219,6 +243,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -237,6 +262,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -254,7 +283,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -274,6 +304,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -291,6 +324,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -308,6 +344,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -326,7 +365,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    true, if password has been updated during Customer's Password Reset workflow.

    + *

    Whether the Customer's password was updated during the Reset password or Change password flow.

    + * * * @return null|bool */ diff --git a/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessagePayload.php index 205f17cafa4..3604893d729 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessagePayload.php @@ -16,8 +16,9 @@ interface CustomerPasswordUpdatedMessagePayload extends MessagePayload public const FIELD_RESET = 'reset'; /** - *

    true, if password has been updated during Customer's Password Reset workflow.

    + *

    Whether the Customer's password was updated during the Reset password or Change password flow.

    * + * @return null|bool */ public function getReset(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessagePayloadBuilder.php index a53c1d01830..357e241345a 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessagePayloadBuilder.php @@ -21,13 +21,15 @@ final class CustomerPasswordUpdatedMessagePayloadBuilder implements Builder { /** + * @var ?bool */ private $reset; /** - *

    true, if password has been updated during Customer's Password Reset workflow.

    + *

    Whether the Customer's password was updated during the Reset password or Change password flow.

    * + * @return null|bool */ public function getReset() diff --git a/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessagePayloadModel.php index 655c5524276..b48b54f5a90 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerPasswordUpdatedMessagePayloadModel.php @@ -21,11 +21,13 @@ final class CustomerPasswordUpdatedMessagePayloadModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'CustomerPasswordUpdated'; /** + * * @var ?string */ protected $type; /** + * * @var ?bool */ protected $reset; @@ -35,13 +37,15 @@ final class CustomerPasswordUpdatedMessagePayloadModel extends JsonObjectModel i * @psalm-suppress MissingParamType */ public function __construct( - ?bool $reset = null + ?bool $reset = null, + ?string $type = null ) { $this->reset = $reset; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,7 +63,8 @@ public function getType() } /** - *

    true, if password has been updated during Customer's Password Reset workflow.

    + *

    Whether the Customer's password was updated during the Reset password or Change password flow.

    + * * * @return null|bool */ diff --git a/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessage.php b/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessage.php index 69b941161bf..216770b0f41 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessage.php @@ -16,6 +16,9 @@ interface CustomerTitleSetMessage extends Message public const FIELD_TITLE = 'title'; /** + *

    The title that was set during the Set Title update action.

    + * + * @return null|string */ public function getTitle(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessageBuilder.php index 562dfef3580..e2a2f678c4e 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessageBuilder.php @@ -28,63 +28,75 @@ final class CustomerTitleSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $title; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -93,6 +105,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -101,6 +116,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -109,6 +127,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -117,8 +138,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -129,6 +151,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -137,6 +160,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -145,8 +172,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -155,6 +183,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -163,6 +194,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -171,6 +205,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The title that was set during the Set Title update action.

    + * + * @return null|string */ public function getTitle() diff --git a/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessageModel.php index c5b06151ad6..92cc5d443f1 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessageModel.php @@ -28,61 +28,73 @@ final class CustomerTitleSetMessageModel extends JsonObjectModel implements Cust { public const DISCRIMINATOR_VALUE = 'CustomerTitleSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $title; @@ -102,7 +114,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?string $title = null + ?string $title = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -115,11 +128,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->title = $title; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -138,6 +152,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -155,6 +172,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -176,6 +196,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -197,7 +220,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -219,6 +243,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -237,6 +262,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -254,7 +283,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -274,6 +304,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -291,6 +324,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -308,6 +344,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -326,6 +365,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The title that was set during the Set Title update action.

    + * + * * @return null|string */ public function getTitle() diff --git a/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessagePayload.php index 9a9f5fb8734..992d118e11d 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessagePayload.php @@ -16,6 +16,9 @@ interface CustomerTitleSetMessagePayload extends MessagePayload public const FIELD_TITLE = 'title'; /** + *

    The title that was set during the Set Title update action.

    + * + * @return null|string */ public function getTitle(); diff --git a/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessagePayloadBuilder.php index c4e19658306..55ebe6faed2 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessagePayloadBuilder.php @@ -21,11 +21,15 @@ final class CustomerTitleSetMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $title; /** + *

    The title that was set during the Set Title update action.

    + * + * @return null|string */ public function getTitle() diff --git a/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessagePayloadModel.php index 6c8e61fbdcc..86c5d51bbb9 100644 --- a/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomerTitleSetMessagePayloadModel.php @@ -21,11 +21,13 @@ final class CustomerTitleSetMessagePayloadModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'CustomerTitleSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $title; @@ -35,13 +37,15 @@ final class CustomerTitleSetMessagePayloadModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?string $title = null + ?string $title = null, + ?string $type = null ) { $this->title = $title; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,6 +63,9 @@ public function getType() } /** + *

    The title that was set during the Set Title update action.

    + * + * * @return null|string */ public function getTitle() diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessage.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessage.php index a09905b7a8b..2978a332a5f 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessage.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessage.php @@ -15,14 +15,31 @@ interface DeliveryAddedMessage extends OrderMessage { public const FIELD_DELIVERY = 'delivery'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional ParcelAddedToDelivery Message containing information about the Parcels.

    + * + * @return null|Delivery */ public function getDelivery(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?Delivery $delivery */ public function setDelivery(?Delivery $delivery): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageBuilder.php index f0887214798..02b2caa81c2 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageBuilder.php @@ -30,63 +30,81 @@ final class DeliveryAddedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|Delivery|DeliveryBuilder */ private $delivery; /** - *

    Unique identifier of the Message.

    + + * @var ?string + */ + private $shippingKey; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,6 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional ParcelAddedToDelivery Message containing information about the Parcels.

    + * + * @return null|Delivery */ public function getDelivery() @@ -180,6 +223,17 @@ public function getDelivery() return $this->delivery instanceof DeliveryBuilder ? $this->delivery->build() : $this->delivery; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $id * @return $this @@ -301,6 +355,17 @@ public function withDelivery(?Delivery $delivery) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -369,7 +434,8 @@ public function build(): DeliveryAddedMessage $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, - $this->delivery instanceof DeliveryBuilder ? $this->delivery->build() : $this->delivery + $this->delivery instanceof DeliveryBuilder ? $this->delivery->build() : $this->delivery, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageModel.php index 33194a51ad5..49f03940d72 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageModel.php @@ -30,65 +30,83 @@ final class DeliveryAddedMessageModel extends JsonObjectModel implements Deliver { public const DISCRIMINATOR_VALUE = 'DeliveryAdded'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?Delivery */ protected $delivery; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -104,7 +122,9 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?Delivery $delivery = null + ?Delivery $delivery = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +137,13 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->delivery = $delivery; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,6 +375,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional ParcelAddedToDelivery Message containing information about the Parcels.

    + * + * * @return null|Delivery */ public function getDelivery() @@ -345,6 +395,26 @@ public function getDelivery() return $this->delivery; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $id @@ -434,6 +504,14 @@ public function setDelivery(?Delivery $delivery): void $this->delivery = $delivery; } + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayload.php index a3f469fb40b..8c3327ca8ee 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayload.php @@ -15,14 +15,31 @@ interface DeliveryAddedMessagePayload extends OrderMessagePayload { public const FIELD_DELIVERY = 'delivery'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional ParcelAddedToDelivery Message containing information about the Parcels.

    + * + * @return null|Delivery */ public function getDelivery(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?Delivery $delivery */ public function setDelivery(?Delivery $delivery): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadBuilder.php index 88b44cbe20e..3f7f6398396 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadBuilder.php @@ -23,11 +23,21 @@ final class DeliveryAddedMessagePayloadBuilder implements Builder { /** + * @var null|Delivery|DeliveryBuilder */ private $delivery; /** + + * @var ?string + */ + private $shippingKey; + + /** + *

    Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional ParcelAddedToDelivery Message containing information about the Parcels.

    + * + * @return null|Delivery */ public function getDelivery() @@ -35,6 +45,17 @@ public function getDelivery() return $this->delivery instanceof DeliveryBuilder ? $this->delivery->build() : $this->delivery; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?Delivery $delivery * @return $this @@ -46,6 +67,17 @@ public function withDelivery(?Delivery $delivery) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withDelivery() instead * @return $this @@ -60,7 +92,8 @@ public function withDeliveryBuilder(?DeliveryBuilder $delivery) public function build(): DeliveryAddedMessagePayload { return new DeliveryAddedMessagePayloadModel( - $this->delivery instanceof DeliveryBuilder ? $this->delivery->build() : $this->delivery + $this->delivery instanceof DeliveryBuilder ? $this->delivery->build() : $this->delivery, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadModel.php index bbfbf4c3046..437f9f3901e 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadModel.php @@ -23,27 +23,39 @@ final class DeliveryAddedMessagePayloadModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'DeliveryAdded'; /** + * * @var ?string */ protected $type; /** + * * @var ?Delivery */ protected $delivery; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType */ public function __construct( - ?Delivery $delivery = null + ?Delivery $delivery = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->delivery = $delivery; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +73,9 @@ public function getType() } /** + *

    Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional ParcelAddedToDelivery Message containing information about the Parcels.

    + * + * * @return null|Delivery */ public function getDelivery() @@ -78,6 +93,26 @@ public function getDelivery() return $this->delivery; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?Delivery $delivery @@ -86,4 +121,12 @@ public function setDelivery(?Delivery $delivery): void { $this->delivery = $delivery; } + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessage.php b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessage.php index 4213c272bed..024aa1c7dff 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessage.php @@ -17,22 +17,40 @@ interface DeliveryAddressSetMessage extends OrderMessage public const FIELD_DELIVERY_ID = 'deliveryId'; public const FIELD_ADDRESS = 'address'; public const FIELD_OLD_ADDRESS = 'oldAddress'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    Unique identifier of the Parcel.

    + * + * @return null|string */ public function getDeliveryId(); /** + *

    Address after the Set Delivery Address update action.

    + * + * @return null|Address */ public function getAddress(); /** + *

    Address before the Set Delivery Address update action.

    + * + * @return null|Address */ public function getOldAddress(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?string $deliveryId */ @@ -47,4 +65,9 @@ public function setAddress(?Address $address): void; * @param ?Address $oldAddress */ public function setOldAddress(?Address $oldAddress): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessageBuilder.php index d7379af4b6a..4849b1433c0 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessageBuilder.php @@ -30,73 +30,93 @@ final class DeliveryAddressSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $deliveryId; /** + * @var null|Address|AddressBuilder */ private $address; /** + * @var null|Address|AddressBuilder */ private $oldAddress; /** - *

    Unique identifier of the Message.

    + + * @var ?string + */ + private $shippingKey; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -105,6 +125,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -113,6 +136,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -121,6 +147,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -129,8 +158,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -141,6 +171,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -149,6 +180,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -157,8 +192,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -167,6 +203,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -175,6 +214,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -183,6 +225,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Parcel.

    + * + * @return null|string */ public function getDeliveryId() @@ -191,6 +236,9 @@ public function getDeliveryId() } /** + *

    Address after the Set Delivery Address update action.

    + * + * @return null|Address */ public function getAddress() @@ -199,6 +247,9 @@ public function getAddress() } /** + *

    Address before the Set Delivery Address update action.

    + * + * @return null|Address */ public function getOldAddress() @@ -206,6 +257,17 @@ public function getOldAddress() return $this->oldAddress instanceof AddressBuilder ? $this->oldAddress->build() : $this->oldAddress; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $id * @return $this @@ -349,6 +411,17 @@ public function withOldAddress(?Address $oldAddress) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -430,7 +503,8 @@ public function build(): DeliveryAddressSetMessage $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, $this->deliveryId, $this->address instanceof AddressBuilder ? $this->address->build() : $this->address, - $this->oldAddress instanceof AddressBuilder ? $this->oldAddress->build() : $this->oldAddress + $this->oldAddress instanceof AddressBuilder ? $this->oldAddress->build() : $this->oldAddress, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessageModel.php b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessageModel.php index 51f92eea500..c8100d3897d 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessageModel.php @@ -30,75 +30,95 @@ final class DeliveryAddressSetMessageModel extends JsonObjectModel implements De { public const DISCRIMINATOR_VALUE = 'DeliveryAddressSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?Address */ protected $address; /** + * * @var ?Address */ protected $oldAddress; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -116,7 +136,9 @@ public function __construct( ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $deliveryId = null, ?Address $address = null, - ?Address $oldAddress = null + ?Address $oldAddress = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -131,11 +153,13 @@ public function __construct( $this->deliveryId = $deliveryId; $this->address = $address; $this->oldAddress = $oldAddress; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -154,6 +178,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -171,6 +198,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -192,6 +222,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -213,7 +246,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -235,6 +269,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -253,6 +288,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -270,7 +309,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -290,6 +330,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -307,6 +350,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -324,6 +370,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -342,6 +391,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Parcel.

    + * + * * @return null|string */ public function getDeliveryId() @@ -359,6 +411,9 @@ public function getDeliveryId() } /** + *

    Address after the Set Delivery Address update action.

    + * + * * @return null|Address */ public function getAddress() @@ -377,6 +432,9 @@ public function getAddress() } /** + *

    Address before the Set Delivery Address update action.

    + * + * * @return null|Address */ public function getOldAddress() @@ -394,6 +452,26 @@ public function getOldAddress() return $this->oldAddress; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $id @@ -499,6 +577,14 @@ public function setOldAddress(?Address $oldAddress): void $this->oldAddress = $oldAddress; } + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayload.php index 96e535661df..6be09a19380 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayload.php @@ -17,22 +17,40 @@ interface DeliveryAddressSetMessagePayload extends OrderMessagePayload public const FIELD_DELIVERY_ID = 'deliveryId'; public const FIELD_ADDRESS = 'address'; public const FIELD_OLD_ADDRESS = 'oldAddress'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    Unique identifier of the Parcel.

    + * + * @return null|string */ public function getDeliveryId(); /** + *

    Address after the Set Delivery Address update action.

    + * + * @return null|Address */ public function getAddress(); /** + *

    Address before the Set Delivery Address update action.

    + * + * @return null|Address */ public function getOldAddress(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?string $deliveryId */ @@ -47,4 +65,9 @@ public function setAddress(?Address $address): void; * @param ?Address $oldAddress */ public function setOldAddress(?Address $oldAddress): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayloadBuilder.php index ac08f668730..85a9e699c04 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayloadBuilder.php @@ -23,21 +23,33 @@ final class DeliveryAddressSetMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var null|Address|AddressBuilder */ private $address; /** + * @var null|Address|AddressBuilder */ private $oldAddress; /** + + * @var ?string + */ + private $shippingKey; + + /** + *

    Unique identifier of the Parcel.

    + * + * @return null|string */ public function getDeliveryId() @@ -46,6 +58,9 @@ public function getDeliveryId() } /** + *

    Address after the Set Delivery Address update action.

    + * + * @return null|Address */ public function getAddress() @@ -54,6 +69,9 @@ public function getAddress() } /** + *

    Address before the Set Delivery Address update action.

    + * + * @return null|Address */ public function getOldAddress() @@ -61,6 +79,17 @@ public function getOldAddress() return $this->oldAddress instanceof AddressBuilder ? $this->oldAddress->build() : $this->oldAddress; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $deliveryId * @return $this @@ -94,6 +123,17 @@ public function withOldAddress(?Address $oldAddress) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withAddress() instead * @return $this @@ -121,7 +161,8 @@ public function build(): DeliveryAddressSetMessagePayload return new DeliveryAddressSetMessagePayloadModel( $this->deliveryId, $this->address instanceof AddressBuilder ? $this->address->build() : $this->address, - $this->oldAddress instanceof AddressBuilder ? $this->oldAddress->build() : $this->oldAddress + $this->oldAddress instanceof AddressBuilder ? $this->oldAddress->build() : $this->oldAddress, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayloadModel.php index fb583f9fb63..8add65f815f 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayloadModel.php @@ -23,25 +23,35 @@ final class DeliveryAddressSetMessagePayloadModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'DeliveryAddressSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?Address */ protected $address; /** + * * @var ?Address */ protected $oldAddress; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -49,15 +59,19 @@ final class DeliveryAddressSetMessagePayloadModel extends JsonObjectModel implem public function __construct( ?string $deliveryId = null, ?Address $address = null, - ?Address $oldAddress = null + ?Address $oldAddress = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->deliveryId = $deliveryId; $this->address = $address; $this->oldAddress = $oldAddress; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -75,6 +89,9 @@ public function getType() } /** + *

    Unique identifier of the Parcel.

    + * + * * @return null|string */ public function getDeliveryId() @@ -92,6 +109,9 @@ public function getDeliveryId() } /** + *

    Address after the Set Delivery Address update action.

    + * + * * @return null|Address */ public function getAddress() @@ -110,6 +130,9 @@ public function getAddress() } /** + *

    Address before the Set Delivery Address update action.

    + * + * * @return null|Address */ public function getOldAddress() @@ -127,6 +150,26 @@ public function getOldAddress() return $this->oldAddress; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $deliveryId @@ -151,4 +194,12 @@ public function setOldAddress(?Address $oldAddress): void { $this->oldAddress = $oldAddress; } + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessage.php b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessage.php index ab06e877cdd..d7b7edf1be9 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessage.php @@ -17,22 +17,40 @@ interface DeliveryItemsUpdatedMessage extends OrderMessage public const FIELD_DELIVERY_ID = 'deliveryId'; public const FIELD_ITEMS = 'items'; public const FIELD_OLD_ITEMS = 'oldItems'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId(); /** + *

    Delivery Items after the Set Delivery Items update action.

    + * + * @return null|DeliveryItemCollection */ public function getItems(); /** + *

    Delivery Items before the Set Delivery Items update action.

    + * + * @return null|DeliveryItemCollection */ public function getOldItems(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?string $deliveryId */ @@ -47,4 +65,9 @@ public function setItems(?DeliveryItemCollection $items): void; * @param ?DeliveryItemCollection $oldItems */ public function setOldItems(?DeliveryItemCollection $oldItems): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessageBuilder.php index 5e4e346551a..67975b7997e 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessageBuilder.php @@ -29,73 +29,93 @@ final class DeliveryItemsUpdatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $deliveryId; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @var ?DeliveryItemCollection */ private $oldItems; /** - *

    Unique identifier of the Message.

    + + * @var ?string + */ + private $shippingKey; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -104,6 +124,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -112,6 +135,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -120,6 +146,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -128,8 +157,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -140,6 +170,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -148,6 +179,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -156,8 +191,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -166,6 +202,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -174,6 +213,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -182,6 +224,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId() @@ -190,6 +235,9 @@ public function getDeliveryId() } /** + *

    Delivery Items after the Set Delivery Items update action.

    + * + * @return null|DeliveryItemCollection */ public function getItems() @@ -198,6 +246,9 @@ public function getItems() } /** + *

    Delivery Items before the Set Delivery Items update action.

    + * + * @return null|DeliveryItemCollection */ public function getOldItems() @@ -205,6 +256,17 @@ public function getOldItems() return $this->oldItems; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $id * @return $this @@ -348,6 +410,17 @@ public function withOldItems(?DeliveryItemCollection $oldItems) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -407,7 +480,8 @@ public function build(): DeliveryItemsUpdatedMessage $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, $this->deliveryId, $this->items, - $this->oldItems + $this->oldItems, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessageModel.php b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessageModel.php index 8191bc5204b..aab980f629a 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessageModel.php @@ -29,75 +29,95 @@ final class DeliveryItemsUpdatedMessageModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'DeliveryItemsUpdated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?DeliveryItemCollection */ protected $items; /** + * * @var ?DeliveryItemCollection */ protected $oldItems; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -115,7 +135,9 @@ public function __construct( ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $deliveryId = null, ?DeliveryItemCollection $items = null, - ?DeliveryItemCollection $oldItems = null + ?DeliveryItemCollection $oldItems = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -130,11 +152,13 @@ public function __construct( $this->deliveryId = $deliveryId; $this->items = $items; $this->oldItems = $oldItems; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -153,6 +177,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -170,6 +197,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -191,6 +221,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -212,7 +245,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -234,6 +268,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -252,6 +287,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -269,7 +308,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -289,6 +329,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -306,6 +349,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -323,6 +369,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -341,6 +390,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Delivery.

    + * + * * @return null|string */ public function getDeliveryId() @@ -358,6 +410,9 @@ public function getDeliveryId() } /** + *

    Delivery Items after the Set Delivery Items update action.

    + * + * * @return null|DeliveryItemCollection */ public function getItems() @@ -375,6 +430,9 @@ public function getItems() } /** + *

    Delivery Items before the Set Delivery Items update action.

    + * + * * @return null|DeliveryItemCollection */ public function getOldItems() @@ -391,6 +449,26 @@ public function getOldItems() return $this->oldItems; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $id @@ -496,6 +574,14 @@ public function setOldItems(?DeliveryItemCollection $oldItems): void $this->oldItems = $oldItems; } + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayload.php index 099f9db3418..99159545692 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayload.php @@ -17,22 +17,40 @@ interface DeliveryItemsUpdatedMessagePayload extends OrderMessagePayload public const FIELD_DELIVERY_ID = 'deliveryId'; public const FIELD_ITEMS = 'items'; public const FIELD_OLD_ITEMS = 'oldItems'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId(); /** + *

    Delivery Items after the Set Delivery Items update action.

    + * + * @return null|DeliveryItemCollection */ public function getItems(); /** + *

    Delivery Items before the Set Delivery Items update action.

    + * + * @return null|DeliveryItemCollection */ public function getOldItems(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?string $deliveryId */ @@ -47,4 +65,9 @@ public function setItems(?DeliveryItemCollection $items): void; * @param ?DeliveryItemCollection $oldItems */ public function setOldItems(?DeliveryItemCollection $oldItems): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayloadBuilder.php index 221aee4c53f..1fb21efa634 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayloadBuilder.php @@ -22,21 +22,33 @@ final class DeliveryItemsUpdatedMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @var ?DeliveryItemCollection */ private $oldItems; /** + + * @var ?string + */ + private $shippingKey; + + /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId() @@ -45,6 +57,9 @@ public function getDeliveryId() } /** + *

    Delivery Items after the Set Delivery Items update action.

    + * + * @return null|DeliveryItemCollection */ public function getItems() @@ -53,6 +68,9 @@ public function getItems() } /** + *

    Delivery Items before the Set Delivery Items update action.

    + * + * @return null|DeliveryItemCollection */ public function getOldItems() @@ -60,6 +78,17 @@ public function getOldItems() return $this->oldItems; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $deliveryId * @return $this @@ -93,13 +122,25 @@ public function withOldItems(?DeliveryItemCollection $oldItems) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + public function build(): DeliveryItemsUpdatedMessagePayload { return new DeliveryItemsUpdatedMessagePayloadModel( $this->deliveryId, $this->items, - $this->oldItems + $this->oldItems, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayloadModel.php index 919d71e34e6..93c120d5341 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayloadModel.php @@ -22,25 +22,35 @@ final class DeliveryItemsUpdatedMessagePayloadModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'DeliveryItemsUpdated'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?DeliveryItemCollection */ protected $items; /** + * * @var ?DeliveryItemCollection */ protected $oldItems; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -48,15 +58,19 @@ final class DeliveryItemsUpdatedMessagePayloadModel extends JsonObjectModel impl public function __construct( ?string $deliveryId = null, ?DeliveryItemCollection $items = null, - ?DeliveryItemCollection $oldItems = null + ?DeliveryItemCollection $oldItems = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->deliveryId = $deliveryId; $this->items = $items; $this->oldItems = $oldItems; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -74,6 +88,9 @@ public function getType() } /** + *

    Unique identifier of the Delivery.

    + * + * * @return null|string */ public function getDeliveryId() @@ -91,6 +108,9 @@ public function getDeliveryId() } /** + *

    Delivery Items after the Set Delivery Items update action.

    + * + * * @return null|DeliveryItemCollection */ public function getItems() @@ -108,6 +128,9 @@ public function getItems() } /** + *

    Delivery Items before the Set Delivery Items update action.

    + * + * * @return null|DeliveryItemCollection */ public function getOldItems() @@ -124,6 +147,26 @@ public function getOldItems() return $this->oldItems; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $deliveryId @@ -148,4 +191,12 @@ public function setOldItems(?DeliveryItemCollection $oldItems): void { $this->oldItems = $oldItems; } + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessage.php b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessage.php index d98a5a0386a..c5866003801 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessage.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessage.php @@ -15,14 +15,31 @@ interface DeliveryRemovedMessage extends OrderMessage { public const FIELD_DELIVERY = 'delivery'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    The Delivery that was removed from the Order.

    + * + * @return null|Delivery */ public function getDelivery(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?Delivery $delivery */ public function setDelivery(?Delivery $delivery): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessageBuilder.php index 208929747d0..a7f08979fd0 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessageBuilder.php @@ -30,63 +30,81 @@ final class DeliveryRemovedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|Delivery|DeliveryBuilder */ private $delivery; /** - *

    Unique identifier of the Message.

    + + * @var ?string + */ + private $shippingKey; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,6 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The Delivery that was removed from the Order.

    + * + * @return null|Delivery */ public function getDelivery() @@ -180,6 +223,17 @@ public function getDelivery() return $this->delivery instanceof DeliveryBuilder ? $this->delivery->build() : $this->delivery; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $id * @return $this @@ -301,6 +355,17 @@ public function withDelivery(?Delivery $delivery) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -369,7 +434,8 @@ public function build(): DeliveryRemovedMessage $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, - $this->delivery instanceof DeliveryBuilder ? $this->delivery->build() : $this->delivery + $this->delivery instanceof DeliveryBuilder ? $this->delivery->build() : $this->delivery, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessageModel.php index f5700961f64..2495d4a2a57 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessageModel.php @@ -30,65 +30,83 @@ final class DeliveryRemovedMessageModel extends JsonObjectModel implements Deliv { public const DISCRIMINATOR_VALUE = 'DeliveryRemoved'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?Delivery */ protected $delivery; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -104,7 +122,9 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?Delivery $delivery = null + ?Delivery $delivery = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +137,13 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->delivery = $delivery; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,6 +375,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The Delivery that was removed from the Order.

    + * + * * @return null|Delivery */ public function getDelivery() @@ -345,6 +395,26 @@ public function getDelivery() return $this->delivery; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $id @@ -434,6 +504,14 @@ public function setDelivery(?Delivery $delivery): void $this->delivery = $delivery; } + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayload.php index 9e7a8f283bb..8c627a1d49a 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayload.php @@ -15,14 +15,31 @@ interface DeliveryRemovedMessagePayload extends OrderMessagePayload { public const FIELD_DELIVERY = 'delivery'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    The Delivery that was removed from the Order.

    + * + * @return null|Delivery */ public function getDelivery(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?Delivery $delivery */ public function setDelivery(?Delivery $delivery): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayloadBuilder.php index 5051bf57242..323cf171eb9 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayloadBuilder.php @@ -23,11 +23,21 @@ final class DeliveryRemovedMessagePayloadBuilder implements Builder { /** + * @var null|Delivery|DeliveryBuilder */ private $delivery; /** + + * @var ?string + */ + private $shippingKey; + + /** + *

    The Delivery that was removed from the Order.

    + * + * @return null|Delivery */ public function getDelivery() @@ -35,6 +45,17 @@ public function getDelivery() return $this->delivery instanceof DeliveryBuilder ? $this->delivery->build() : $this->delivery; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?Delivery $delivery * @return $this @@ -46,6 +67,17 @@ public function withDelivery(?Delivery $delivery) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withDelivery() instead * @return $this @@ -60,7 +92,8 @@ public function withDeliveryBuilder(?DeliveryBuilder $delivery) public function build(): DeliveryRemovedMessagePayload { return new DeliveryRemovedMessagePayloadModel( - $this->delivery instanceof DeliveryBuilder ? $this->delivery->build() : $this->delivery + $this->delivery instanceof DeliveryBuilder ? $this->delivery->build() : $this->delivery, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayloadModel.php index c2405e8b2b9..11712a8cb9f 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayloadModel.php @@ -23,27 +23,39 @@ final class DeliveryRemovedMessagePayloadModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'DeliveryRemoved'; /** + * * @var ?string */ protected $type; /** + * * @var ?Delivery */ protected $delivery; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType */ public function __construct( - ?Delivery $delivery = null + ?Delivery $delivery = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->delivery = $delivery; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +73,9 @@ public function getType() } /** + *

    The Delivery that was removed from the Order.

    + * + * * @return null|Delivery */ public function getDelivery() @@ -78,6 +93,26 @@ public function getDelivery() return $this->delivery; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?Delivery $delivery @@ -86,4 +121,12 @@ public function setDelivery(?Delivery $delivery): void { $this->delivery = $delivery; } + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } } diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessage.php b/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessage.php index ec64e03cb98..98112118142 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessage.php @@ -17,6 +17,9 @@ interface InventoryEntryCreatedMessage extends Message public const FIELD_INVENTORY_ENTRY = 'inventoryEntry'; /** + *

    InventoryEntry that was created.

    + * + * @return null|InventoryEntry */ public function getInventoryEntry(); diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessageBuilder.php index 60ff1cde9d4..d714578fc53 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessageBuilder.php @@ -30,63 +30,75 @@ final class InventoryEntryCreatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|InventoryEntry|InventoryEntryBuilder */ private $inventoryEntry; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,6 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    InventoryEntry that was created.

    + * + * @return null|InventoryEntry */ public function getInventoryEntry() diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessageModel.php b/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessageModel.php index 2e556972027..f455e3eb728 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessageModel.php @@ -30,61 +30,73 @@ final class InventoryEntryCreatedMessageModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'InventoryEntryCreated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?InventoryEntry */ protected $inventoryEntry; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?InventoryEntry $inventoryEntry = null + ?InventoryEntry $inventoryEntry = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->inventoryEntry = $inventoryEntry; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,6 +367,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    InventoryEntry that was created.

    + * + * * @return null|InventoryEntry */ public function getInventoryEntry() diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessagePayload.php index 72ea49fa696..9ca2982b388 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessagePayload.php @@ -17,6 +17,9 @@ interface InventoryEntryCreatedMessagePayload extends MessagePayload public const FIELD_INVENTORY_ENTRY = 'inventoryEntry'; /** + *

    InventoryEntry that was created.

    + * + * @return null|InventoryEntry */ public function getInventoryEntry(); diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessagePayloadBuilder.php index a3544769b58..e34e410262c 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessagePayloadBuilder.php @@ -23,11 +23,15 @@ final class InventoryEntryCreatedMessagePayloadBuilder implements Builder { /** + * @var null|InventoryEntry|InventoryEntryBuilder */ private $inventoryEntry; /** + *

    InventoryEntry that was created.

    + * + * @return null|InventoryEntry */ public function getInventoryEntry() diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessagePayloadModel.php index f8f3d650e7d..5dd930d4637 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryCreatedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class InventoryEntryCreatedMessagePayloadModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'InventoryEntryCreated'; /** + * * @var ?string */ protected $type; /** + * * @var ?InventoryEntry */ protected $inventoryEntry; @@ -37,13 +39,15 @@ final class InventoryEntryCreatedMessagePayloadModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?InventoryEntry $inventoryEntry = null + ?InventoryEntry $inventoryEntry = null, + ?string $type = null ) { $this->inventoryEntry = $inventoryEntry; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,9 @@ public function getType() } /** + *

    InventoryEntry that was created.

    + * + * * @return null|InventoryEntry */ public function getInventoryEntry() diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessage.php b/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessage.php index 8c13c62b178..d027b6dd64b 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessage.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessage.php @@ -18,13 +18,17 @@ interface InventoryEntryDeletedMessage extends Message public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; /** + *

    The sku of the InventoryEntry that was deleted.

    + * + * @return null|string */ public function getSku(); /** - *

    Reference to a Channel.

    + *

    Reference to the Channel where the InventoryEntry was deleted.

    * + * @return null|ChannelReference */ public function getSupplyChannel(); diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessageBuilder.php index 93c9747a665..76c81c0794f 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessageBuilder.php @@ -30,68 +30,81 @@ final class InventoryEntryDeletedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $sku; /** + * @var null|ChannelReference|ChannelReferenceBuilder */ private $supplyChannel; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,6 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The sku of the InventoryEntry that was deleted.

    + * + * @return null|string */ public function getSku() @@ -186,8 +224,9 @@ public function getSku() } /** - *

    Reference to a Channel.

    + *

    Reference to the Channel where the InventoryEntry was deleted.

    * + * @return null|ChannelReference */ public function getSupplyChannel() diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessageModel.php b/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessageModel.php index 87242ed12d7..bdd20f0a6d0 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessageModel.php @@ -30,66 +30,79 @@ final class InventoryEntryDeletedMessageModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'InventoryEntryDeleted'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $sku; /** + * * @var ?ChannelReference */ protected $supplyChannel; @@ -110,7 +123,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $sku = null, - ?ChannelReference $supplyChannel = null + ?ChannelReference $supplyChannel = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +138,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->sku = $sku; $this->supplyChannel = $supplyChannel; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,6 +375,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The sku of the InventoryEntry that was deleted.

    + * + * * @return null|string */ public function getSku() @@ -352,7 +395,8 @@ public function getSku() } /** - *

    Reference to a Channel.

    + *

    Reference to the Channel where the InventoryEntry was deleted.

    + * * * @return null|ChannelReference */ diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessagePayload.php b/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessagePayload.php index 0a0b34398ba..fd5dc400e81 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessagePayload.php @@ -18,13 +18,17 @@ interface InventoryEntryDeletedMessagePayload extends MessagePayload public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; /** + *

    The sku of the InventoryEntry that was deleted.

    + * + * @return null|string */ public function getSku(); /** - *

    Reference to a Channel.

    + *

    Reference to the Channel where the InventoryEntry was deleted.

    * + * @return null|ChannelReference */ public function getSupplyChannel(); diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessagePayloadBuilder.php index 10a98a66552..d292b1824b5 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessagePayloadBuilder.php @@ -23,16 +23,21 @@ final class InventoryEntryDeletedMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $sku; /** + * @var null|ChannelReference|ChannelReferenceBuilder */ private $supplyChannel; /** + *

    The sku of the InventoryEntry that was deleted.

    + * + * @return null|string */ public function getSku() @@ -41,8 +46,9 @@ public function getSku() } /** - *

    Reference to a Channel.

    + *

    Reference to the Channel where the InventoryEntry was deleted.

    * + * @return null|ChannelReference */ public function getSupplyChannel() diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessagePayloadModel.php index a1b0317671e..4a6170ad1ba 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryDeletedMessagePayloadModel.php @@ -23,16 +23,19 @@ final class InventoryEntryDeletedMessagePayloadModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'InventoryEntryDeleted'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $sku; /** + * * @var ?ChannelReference */ protected $supplyChannel; @@ -43,14 +46,16 @@ final class InventoryEntryDeletedMessagePayloadModel extends JsonObjectModel imp */ public function __construct( ?string $sku = null, - ?ChannelReference $supplyChannel = null + ?ChannelReference $supplyChannel = null, + ?string $type = null ) { $this->sku = $sku; $this->supplyChannel = $supplyChannel; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,6 +73,9 @@ public function getType() } /** + *

    The sku of the InventoryEntry that was deleted.

    + * + * * @return null|string */ public function getSku() @@ -85,7 +93,8 @@ public function getSku() } /** - *

    Reference to a Channel.

    + *

    Reference to the Channel where the InventoryEntry was deleted.

    + * * * @return null|ChannelReference */ diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessage.php b/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessage.php index 1986d1a969a..b8766f92ab7 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessage.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessage.php @@ -21,28 +21,41 @@ interface InventoryEntryQuantitySetMessage extends Message public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; /** + *

    Quantity on stock for the InventoryEntry before the quantity was updated.

    + * + * @return null|int */ public function getOldQuantityOnStock(); /** + *

    Quantity on stock for the InventoryEntry after the quantity was updated.

    + * + * @return null|int */ public function getNewQuantityOnStock(); /** + *

    Available quantity for the InventoryEntry before the quantity was updated.

    + * + * @return null|int */ public function getOldAvailableQuantity(); /** + *

    Available quantity for the InventoryEntry after the quantity was updated.

    + * + * @return null|int */ public function getNewAvailableQuantity(); /** - *

    Reference to a Channel.

    + *

    Reference to the Channel where the InventoryEntry quantity was set.

    * + * @return null|ChannelReference */ public function getSupplyChannel(); diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessageBuilder.php index af969f42165..078e49b9c4e 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessageBuilder.php @@ -30,83 +30,99 @@ final class InventoryEntryQuantitySetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?int */ private $oldQuantityOnStock; /** + * @var ?int */ private $newQuantityOnStock; /** + * @var ?int */ private $oldAvailableQuantity; /** + * @var ?int */ private $newAvailableQuantity; /** + * @var null|ChannelReference|ChannelReferenceBuilder */ private $supplyChannel; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -115,6 +131,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -123,6 +142,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -131,6 +153,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -139,8 +164,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -151,6 +177,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -159,6 +186,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -167,8 +198,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -177,6 +209,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -185,6 +220,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -193,6 +231,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Quantity on stock for the InventoryEntry before the quantity was updated.

    + * + * @return null|int */ public function getOldQuantityOnStock() @@ -201,6 +242,9 @@ public function getOldQuantityOnStock() } /** + *

    Quantity on stock for the InventoryEntry after the quantity was updated.

    + * + * @return null|int */ public function getNewQuantityOnStock() @@ -209,6 +253,9 @@ public function getNewQuantityOnStock() } /** + *

    Available quantity for the InventoryEntry before the quantity was updated.

    + * + * @return null|int */ public function getOldAvailableQuantity() @@ -217,6 +264,9 @@ public function getOldAvailableQuantity() } /** + *

    Available quantity for the InventoryEntry after the quantity was updated.

    + * + * @return null|int */ public function getNewAvailableQuantity() @@ -225,8 +275,9 @@ public function getNewAvailableQuantity() } /** - *

    Reference to a Channel.

    + *

    Reference to the Channel where the InventoryEntry quantity was set.

    * + * @return null|ChannelReference */ public function getSupplyChannel() diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessageModel.php b/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessageModel.php index b6f61af3c84..72680ca5116 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessageModel.php @@ -30,81 +30,97 @@ final class InventoryEntryQuantitySetMessageModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'InventoryEntryQuantitySet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?int */ protected $oldQuantityOnStock; /** + * * @var ?int */ protected $newQuantityOnStock; /** + * * @var ?int */ protected $oldAvailableQuantity; /** + * * @var ?int */ protected $newAvailableQuantity; /** + * * @var ?ChannelReference */ protected $supplyChannel; @@ -128,7 +144,8 @@ public function __construct( ?int $newQuantityOnStock = null, ?int $oldAvailableQuantity = null, ?int $newAvailableQuantity = null, - ?ChannelReference $supplyChannel = null + ?ChannelReference $supplyChannel = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -145,11 +162,12 @@ public function __construct( $this->oldAvailableQuantity = $oldAvailableQuantity; $this->newAvailableQuantity = $newAvailableQuantity; $this->supplyChannel = $supplyChannel; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -168,6 +186,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -185,6 +206,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -206,6 +230,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -227,7 +254,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -249,6 +277,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -267,6 +296,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -284,7 +317,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -304,6 +338,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -321,6 +358,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -338,6 +378,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -356,6 +399,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Quantity on stock for the InventoryEntry before the quantity was updated.

    + * + * * @return null|int */ public function getOldQuantityOnStock() @@ -373,6 +419,9 @@ public function getOldQuantityOnStock() } /** + *

    Quantity on stock for the InventoryEntry after the quantity was updated.

    + * + * * @return null|int */ public function getNewQuantityOnStock() @@ -390,6 +439,9 @@ public function getNewQuantityOnStock() } /** + *

    Available quantity for the InventoryEntry before the quantity was updated.

    + * + * * @return null|int */ public function getOldAvailableQuantity() @@ -407,6 +459,9 @@ public function getOldAvailableQuantity() } /** + *

    Available quantity for the InventoryEntry after the quantity was updated.

    + * + * * @return null|int */ public function getNewAvailableQuantity() @@ -424,7 +479,8 @@ public function getNewAvailableQuantity() } /** - *

    Reference to a Channel.

    + *

    Reference to the Channel where the InventoryEntry quantity was set.

    + * * * @return null|ChannelReference */ diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessagePayload.php b/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessagePayload.php index 8480d252b0f..9c5569ea6cf 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessagePayload.php @@ -21,28 +21,41 @@ interface InventoryEntryQuantitySetMessagePayload extends MessagePayload public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; /** + *

    Quantity on stock for the InventoryEntry before the quantity was updated.

    + * + * @return null|int */ public function getOldQuantityOnStock(); /** + *

    Quantity on stock for the InventoryEntry after the quantity was updated.

    + * + * @return null|int */ public function getNewQuantityOnStock(); /** + *

    Available quantity for the InventoryEntry before the quantity was updated.

    + * + * @return null|int */ public function getOldAvailableQuantity(); /** + *

    Available quantity for the InventoryEntry after the quantity was updated.

    + * + * @return null|int */ public function getNewAvailableQuantity(); /** - *

    Reference to a Channel.

    + *

    Reference to the Channel where the InventoryEntry quantity was set.

    * + * @return null|ChannelReference */ public function getSupplyChannel(); diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessagePayloadBuilder.php index 3043fc5eaf9..6695d5dd451 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessagePayloadBuilder.php @@ -23,31 +23,39 @@ final class InventoryEntryQuantitySetMessagePayloadBuilder implements Builder { /** + * @var ?int */ private $oldQuantityOnStock; /** + * @var ?int */ private $newQuantityOnStock; /** + * @var ?int */ private $oldAvailableQuantity; /** + * @var ?int */ private $newAvailableQuantity; /** + * @var null|ChannelReference|ChannelReferenceBuilder */ private $supplyChannel; /** + *

    Quantity on stock for the InventoryEntry before the quantity was updated.

    + * + * @return null|int */ public function getOldQuantityOnStock() @@ -56,6 +64,9 @@ public function getOldQuantityOnStock() } /** + *

    Quantity on stock for the InventoryEntry after the quantity was updated.

    + * + * @return null|int */ public function getNewQuantityOnStock() @@ -64,6 +75,9 @@ public function getNewQuantityOnStock() } /** + *

    Available quantity for the InventoryEntry before the quantity was updated.

    + * + * @return null|int */ public function getOldAvailableQuantity() @@ -72,6 +86,9 @@ public function getOldAvailableQuantity() } /** + *

    Available quantity for the InventoryEntry after the quantity was updated.

    + * + * @return null|int */ public function getNewAvailableQuantity() @@ -80,8 +97,9 @@ public function getNewAvailableQuantity() } /** - *

    Reference to a Channel.

    + *

    Reference to the Channel where the InventoryEntry quantity was set.

    * + * @return null|ChannelReference */ public function getSupplyChannel() diff --git a/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessagePayloadModel.php index d01df9afce2..ab7345d98df 100644 --- a/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/InventoryEntryQuantitySetMessagePayloadModel.php @@ -23,31 +23,37 @@ final class InventoryEntryQuantitySetMessagePayloadModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'InventoryEntryQuantitySet'; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $oldQuantityOnStock; /** + * * @var ?int */ protected $newQuantityOnStock; /** + * * @var ?int */ protected $oldAvailableQuantity; /** + * * @var ?int */ protected $newAvailableQuantity; /** + * * @var ?ChannelReference */ protected $supplyChannel; @@ -61,17 +67,19 @@ public function __construct( ?int $newQuantityOnStock = null, ?int $oldAvailableQuantity = null, ?int $newAvailableQuantity = null, - ?ChannelReference $supplyChannel = null + ?ChannelReference $supplyChannel = null, + ?string $type = null ) { $this->oldQuantityOnStock = $oldQuantityOnStock; $this->newQuantityOnStock = $newQuantityOnStock; $this->oldAvailableQuantity = $oldAvailableQuantity; $this->newAvailableQuantity = $newAvailableQuantity; $this->supplyChannel = $supplyChannel; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -89,6 +97,9 @@ public function getType() } /** + *

    Quantity on stock for the InventoryEntry before the quantity was updated.

    + * + * * @return null|int */ public function getOldQuantityOnStock() @@ -106,6 +117,9 @@ public function getOldQuantityOnStock() } /** + *

    Quantity on stock for the InventoryEntry after the quantity was updated.

    + * + * * @return null|int */ public function getNewQuantityOnStock() @@ -123,6 +137,9 @@ public function getNewQuantityOnStock() } /** + *

    Available quantity for the InventoryEntry before the quantity was updated.

    + * + * * @return null|int */ public function getOldAvailableQuantity() @@ -140,6 +157,9 @@ public function getOldAvailableQuantity() } /** + *

    Available quantity for the InventoryEntry after the quantity was updated.

    + * + * * @return null|int */ public function getNewAvailableQuantity() @@ -157,7 +177,8 @@ public function getNewAvailableQuantity() } /** - *

    Reference to a Channel.

    + *

    Reference to the Channel where the InventoryEntry quantity was set.

    + * * * @return null|ChannelReference */ diff --git a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessage.php b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessage.php index e82be4d9936..e20f229d5b8 100644 --- a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessage.php +++ b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessage.php @@ -22,30 +22,41 @@ interface LineItemStateTransitionMessage extends OrderMessage public const FIELD_TO_STATE = 'toState'; /** + *

    Unique identifier of the Line Item.

    + * + * @return null|string */ public function getLineItemId(); /** + *

    Date and time (UTC) when the transition of the Line Item State was performed.

    + * + * @return null|DateTimeImmutable */ public function getTransitionDate(); /** + *

    Number of Line Items for which the State was transitioned.

    + * + * @return null|int */ public function getQuantity(); /** - *

    Reference to a State.

    + *

    State the Line Item was transitioned from.

    * + * @return null|StateReference */ public function getFromState(); /** - *

    Reference to a State.

    + *

    State the Line Item was transitioned to.

    * + * @return null|StateReference */ public function getToState(); diff --git a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessageBuilder.php b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessageBuilder.php index 755aa2a65d7..44037716006 100644 --- a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessageBuilder.php @@ -30,83 +30,99 @@ final class LineItemStateTransitionMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $lineItemId; /** + * @var ?DateTimeImmutable */ private $transitionDate; /** + * @var ?int */ private $quantity; /** + * @var null|StateReference|StateReferenceBuilder */ private $fromState; /** + * @var null|StateReference|StateReferenceBuilder */ private $toState; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -115,6 +131,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -123,6 +142,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -131,6 +153,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -139,8 +164,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -151,6 +177,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -159,6 +186,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -167,8 +198,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -177,6 +209,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -185,6 +220,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -193,6 +231,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Line Item.

    + * + * @return null|string */ public function getLineItemId() @@ -201,6 +242,9 @@ public function getLineItemId() } /** + *

    Date and time (UTC) when the transition of the Line Item State was performed.

    + * + * @return null|DateTimeImmutable */ public function getTransitionDate() @@ -209,6 +253,9 @@ public function getTransitionDate() } /** + *

    Number of Line Items for which the State was transitioned.

    + * + * @return null|int */ public function getQuantity() @@ -217,8 +264,9 @@ public function getQuantity() } /** - *

    Reference to a State.

    + *

    State the Line Item was transitioned from.

    * + * @return null|StateReference */ public function getFromState() @@ -227,8 +275,9 @@ public function getFromState() } /** - *

    Reference to a State.

    + *

    State the Line Item was transitioned to.

    * + * @return null|StateReference */ public function getToState() diff --git a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessageModel.php b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessageModel.php index 0d09da645a5..03d49e2d289 100644 --- a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessageModel.php @@ -30,81 +30,97 @@ final class LineItemStateTransitionMessageModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'LineItemStateTransition'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?DateTimeImmutable */ protected $transitionDate; /** + * * @var ?int */ protected $quantity; /** + * * @var ?StateReference */ protected $fromState; /** + * * @var ?StateReference */ protected $toState; @@ -128,7 +144,8 @@ public function __construct( ?DateTimeImmutable $transitionDate = null, ?int $quantity = null, ?StateReference $fromState = null, - ?StateReference $toState = null + ?StateReference $toState = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -145,11 +162,12 @@ public function __construct( $this->quantity = $quantity; $this->fromState = $fromState; $this->toState = $toState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -168,6 +186,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -185,6 +206,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -206,6 +230,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -227,7 +254,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -249,6 +277,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -267,6 +296,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -284,7 +317,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -304,6 +338,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -321,6 +358,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -338,6 +378,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -356,6 +399,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Line Item.

    + * + * * @return null|string */ public function getLineItemId() @@ -373,6 +419,9 @@ public function getLineItemId() } /** + *

    Date and time (UTC) when the transition of the Line Item State was performed.

    + * + * * @return null|DateTimeImmutable */ public function getTransitionDate() @@ -394,6 +443,9 @@ public function getTransitionDate() } /** + *

    Number of Line Items for which the State was transitioned.

    + * + * * @return null|int */ public function getQuantity() @@ -411,7 +463,8 @@ public function getQuantity() } /** - *

    Reference to a State.

    + *

    State the Line Item was transitioned from.

    + * * * @return null|StateReference */ @@ -431,7 +484,8 @@ public function getFromState() } /** - *

    Reference to a State.

    + *

    State the Line Item was transitioned to.

    + * * * @return null|StateReference */ diff --git a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayload.php b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayload.php index 08c4d2e27ce..f1df497c39a 100644 --- a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayload.php @@ -22,30 +22,41 @@ interface LineItemStateTransitionMessagePayload extends OrderMessagePayload public const FIELD_TO_STATE = 'toState'; /** + *

    Unique identifier of the Line Item.

    + * + * @return null|string */ public function getLineItemId(); /** + *

    Date and time (UTC) when the transition of the Line Item State was performed.

    + * + * @return null|DateTimeImmutable */ public function getTransitionDate(); /** + *

    Number of Line Items for which the State was transitioned.

    + * + * @return null|int */ public function getQuantity(); /** - *

    Reference to a State.

    + *

    State the Line Item was transitioned from.

    * + * @return null|StateReference */ public function getFromState(); /** - *

    Reference to a State.

    + *

    State the Line Item was transitioned to.

    * + * @return null|StateReference */ public function getToState(); diff --git a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayloadBuilder.php index f2f35a72302..95569e2c656 100644 --- a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayloadBuilder.php @@ -24,31 +24,39 @@ final class LineItemStateTransitionMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?DateTimeImmutable */ private $transitionDate; /** + * @var ?int */ private $quantity; /** + * @var null|StateReference|StateReferenceBuilder */ private $fromState; /** + * @var null|StateReference|StateReferenceBuilder */ private $toState; /** + *

    Unique identifier of the Line Item.

    + * + * @return null|string */ public function getLineItemId() @@ -57,6 +65,9 @@ public function getLineItemId() } /** + *

    Date and time (UTC) when the transition of the Line Item State was performed.

    + * + * @return null|DateTimeImmutable */ public function getTransitionDate() @@ -65,6 +76,9 @@ public function getTransitionDate() } /** + *

    Number of Line Items for which the State was transitioned.

    + * + * @return null|int */ public function getQuantity() @@ -73,8 +87,9 @@ public function getQuantity() } /** - *

    Reference to a State.

    + *

    State the Line Item was transitioned from.

    * + * @return null|StateReference */ public function getFromState() @@ -83,8 +98,9 @@ public function getFromState() } /** - *

    Reference to a State.

    + *

    State the Line Item was transitioned to.

    * + * @return null|StateReference */ public function getToState() diff --git a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayloadModel.php index 2ed6bd08e6d..ac54ae0c872 100644 --- a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayloadModel.php @@ -24,31 +24,37 @@ final class LineItemStateTransitionMessagePayloadModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'LineItemStateTransition'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?DateTimeImmutable */ protected $transitionDate; /** + * * @var ?int */ protected $quantity; /** + * * @var ?StateReference */ protected $fromState; /** + * * @var ?StateReference */ protected $toState; @@ -62,17 +68,19 @@ public function __construct( ?DateTimeImmutable $transitionDate = null, ?int $quantity = null, ?StateReference $fromState = null, - ?StateReference $toState = null + ?StateReference $toState = null, + ?string $type = null ) { $this->lineItemId = $lineItemId; $this->transitionDate = $transitionDate; $this->quantity = $quantity; $this->fromState = $fromState; $this->toState = $toState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -90,6 +98,9 @@ public function getType() } /** + *

    Unique identifier of the Line Item.

    + * + * * @return null|string */ public function getLineItemId() @@ -107,6 +118,9 @@ public function getLineItemId() } /** + *

    Date and time (UTC) when the transition of the Line Item State was performed.

    + * + * * @return null|DateTimeImmutable */ public function getTransitionDate() @@ -128,6 +142,9 @@ public function getTransitionDate() } /** + *

    Number of Line Items for which the State was transitioned.

    + * + * * @return null|int */ public function getQuantity() @@ -145,7 +162,8 @@ public function getQuantity() } /** - *

    Reference to a State.

    + *

    State the Line Item was transitioned from.

    + * * * @return null|StateReference */ @@ -165,7 +183,8 @@ public function getFromState() } /** - *

    Reference to a State.

    + *

    State the Line Item was transitioned to.

    + * * * @return null|StateReference */ diff --git a/lib/commercetools-api/src/Models/Message/Message.php b/lib/commercetools-api/src/Models/Message/Message.php index 0b21ec7cb2c..2cf0ffa6eb1 100644 --- a/lib/commercetools-api/src/Models/Message/Message.php +++ b/lib/commercetools-api/src/Models/Message/Message.php @@ -28,30 +28,41 @@ interface Message extends BaseResource public const FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS = 'resourceUserProvidedIdentifiers'; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId(); /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion(); /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt(); /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -59,33 +70,48 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber(); /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource(); /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion(); /** + *

    Message Type of the Message.

    + * + * @return null|string */ public function getType(); /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers(); diff --git a/lib/commercetools-api/src/Models/Message/MessageBuilder.php b/lib/commercetools-api/src/Models/Message/MessageBuilder.php index 6de5c9e19da..562797ba285 100644 --- a/lib/commercetools-api/src/Models/Message/MessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/MessageBuilder.php @@ -30,58 +30,69 @@ final class MessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -90,6 +101,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -98,6 +112,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -106,6 +123,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -114,8 +134,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -126,6 +147,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -134,6 +156,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -142,8 +168,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -152,6 +179,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -160,6 +190,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/MessageModel.php b/lib/commercetools-api/src/Models/Message/MessageModel.php index 0b3ca3c89b1..7cdfb91ab1e 100644 --- a/lib/commercetools-api/src/Models/Message/MessageModel.php +++ b/lib/commercetools-api/src/Models/Message/MessageModel.php @@ -30,56 +30,67 @@ final class MessageModel extends JsonObjectModel implements Message { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; @@ -89,6 +100,29 @@ final class MessageModel extends JsonObjectModel implements Message * @psalm-suppress InvalidPropertyAssignmentValue */ private static $discriminatorClasses = [ + 'BusinessUnitAddressAdded' => BusinessUnitAddressAddedMessageModel::class, + 'BusinessUnitAddressChanged' => BusinessUnitAddressChangedMessageModel::class, + 'BusinessUnitAddressRemoved' => BusinessUnitAddressRemovedMessageModel::class, + 'BusinessUnitAssociateAdded' => BusinessUnitAssociateAddedMessageModel::class, + 'BusinessUnitAssociateChanged' => BusinessUnitAssociateChangedMessageModel::class, + 'BusinessUnitAssociateRemoved' => BusinessUnitAssociateRemovedMessageModel::class, + 'BusinessUnitAssociatesSet' => BusinessUnitAssociatesSetMessageModel::class, + 'BusinessUnitBillingAddressAdded' => BusinessUnitBillingAddressAddedMessageModel::class, + 'BusinessUnitBillingAddressRemoved' => BusinessUnitBillingAddressRemovedMessageModel::class, + 'BusinessUnitContactEmailSet' => BusinessUnitContactEmailSetMessageModel::class, + 'BusinessUnitCreated' => BusinessUnitCreatedMessageModel::class, + 'BusinessUnitDefaultBillingAddressSet' => BusinessUnitDefaultBillingAddressSetMessageModel::class, + 'BusinessUnitDefaultShippingAddressSet' => BusinessUnitDefaultShippingAddressSetMessageModel::class, + 'BusinessUnitDeleted' => BusinessUnitDeletedMessageModel::class, + 'BusinessUnitNameChanged' => BusinessUnitNameChangedMessageModel::class, + 'BusinessUnitParentUnitChanged' => BusinessUnitParentUnitChangedMessageModel::class, + 'BusinessUnitShippingAddressAdded' => BusinessUnitShippingAddressAddedMessageModel::class, + 'BusinessUnitShippingAddressRemoved' => BusinessUnitShippingAddressRemovedMessageModel::class, + 'BusinessUnitStatusChanged' => BusinessUnitStatusChangedMessageModel::class, + 'BusinessUnitStoreAdded' => BusinessUnitStoreAddedMessageModel::class, + 'BusinessUnitStoreModeChanged' => BusinessUnitStoreModeChangedMessageModel::class, + 'BusinessUnitStoreRemoved' => BusinessUnitStoreRemovedMessageModel::class, + 'BusinessUnitStoresSet' => BusinessUnitStoresSetMessageModel::class, 'CategoryCreated' => CategoryCreatedMessageModel::class, 'CategorySlugChanged' => CategorySlugChangedMessageModel::class, 'CustomLineItemStateTransition' => CustomLineItemStateTransitionMessageModel::class, @@ -116,7 +150,10 @@ final class MessageModel extends JsonObjectModel implements Message 'LineItemStateTransition' => LineItemStateTransitionMessageModel::class, 'OrderBillingAddressSet' => OrderBillingAddressSetMessageModel::class, 'OrderCreated' => OrderCreatedMessageModel::class, + 'OrderCustomLineItemAdded' => OrderCustomLineItemAddedMessageModel::class, 'OrderCustomLineItemDiscountSet' => OrderCustomLineItemDiscountSetMessageModel::class, + 'OrderCustomLineItemQuantityChanged' => OrderCustomLineItemQuantityChangedMessageModel::class, + 'OrderCustomLineItemRemoved' => OrderCustomLineItemRemovedMessageModel::class, 'OrderCustomerEmailSet' => OrderCustomerEmailSetMessageModel::class, 'OrderCustomerGroupSet' => OrderCustomerGroupSetMessageModel::class, 'OrderCustomerSet' => OrderCustomerSetMessageModel::class, @@ -175,9 +212,11 @@ final class MessageModel extends JsonObjectModel implements Message 'QuoteRequestCreated' => QuoteRequestCreatedMessageModel::class, 'QuoteRequestDeleted' => QuoteRequestDeletedMessageModel::class, 'QuoteRequestStateChanged' => QuoteRequestStateChangedMessageModel::class, + 'QuoteRequestStateTransition' => QuoteRequestStateTransitionMessageModel::class, 'QuoteStateChanged' => QuoteStateChangedMessageModel::class, - 'ReturnInfoAdded' => OrderReturnInfoAddedMessageModel::class, - 'ReturnInfoSet' => OrderReturnInfoSetMessageModel::class, + 'QuoteStateTransition' => QuoteStateTransitionMessageModel::class, + 'ReturnInfoAdded' => ReturnInfoAddedMessageModel::class, + 'ReturnInfoSet' => ReturnInfoSetMessageModel::class, 'ReviewCreated' => ReviewCreatedMessageModel::class, 'ReviewRatingSet' => ReviewRatingSetMessageModel::class, 'ReviewStateTransition' => ReviewStateTransitionMessageModel::class, @@ -185,15 +224,22 @@ final class MessageModel extends JsonObjectModel implements Message 'StagedQuoteDeleted' => StagedQuoteDeletedMessageModel::class, 'StagedQuoteSellerCommentSet' => StagedQuoteSellerCommentSetMessageModel::class, 'StagedQuoteStateChanged' => StagedQuoteStateChangedMessageModel::class, + 'StagedQuoteStateTransition' => StagedQuoteStateTransitionMessageModel::class, 'StagedQuoteValidToSet' => StagedQuoteValidToSetMessageModel::class, + 'StandalonePriceActiveChanged' => StandalonePriceActiveChangedMessageModel::class, 'StandalonePriceCreated' => StandalonePriceCreatedMessageModel::class, 'StandalonePriceDeleted' => StandalonePriceDeletedMessageModel::class, 'StandalonePriceDiscountSet' => StandalonePriceDiscountSetMessageModel::class, 'StandalonePriceExternalDiscountSet' => StandalonePriceExternalDiscountSetMessageModel::class, + 'StandalonePriceStagedChangesApplied' => StandalonePriceStagedChangesAppliedMessageModel::class, 'StandalonePriceValueChanged' => StandalonePriceValueChangedMessageModel::class, 'StoreCreated' => StoreCreatedMessageModel::class, 'StoreDeleted' => StoreDeletedMessageModel::class, + 'StoreDistributionChannelsChanged' => StoreDistributionChannelsChangedMessageModel::class, + 'StoreLanguagesChanged' => StoreLanguagesChangedMessageModel::class, + 'StoreNameSet' => StoreNameSetMessageModel::class, 'StoreProductSelectionsChanged' => StoreProductSelectionsChangedMessageModel::class, + 'StoreSupplyChannelsChanged' => StoreSupplyChannelsChangedMessageModel::class, 'null' => OrderMessageModel::class, ]; @@ -227,7 +273,8 @@ public function __construct( } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -246,6 +293,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -263,6 +313,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -284,6 +337,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -305,7 +361,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -327,6 +384,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -345,6 +403,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -362,7 +424,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -382,6 +445,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -399,6 +465,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -416,6 +485,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/MessagePagedQueryResponse.php b/lib/commercetools-api/src/Models/Message/MessagePagedQueryResponse.php index 45828bef9f0..b1d0f53bbfb 100644 --- a/lib/commercetools-api/src/Models/Message/MessagePagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Message/MessagePagedQueryResponse.php @@ -22,16 +22,27 @@ interface MessagePagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); /** + *

    Actual number of results returned.

    + * + * @return null|int */ public function getCount(); /** + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    + * + * @return null|int */ public function getTotal(); @@ -39,11 +50,15 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); /** + *

    Messages matching the query.

    + * + * @return null|MessageCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/Message/MessagePagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Message/MessagePagedQueryResponseBuilder.php index 095223a43ab..117a156623a 100644 --- a/lib/commercetools-api/src/Models/Message/MessagePagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Message/MessagePagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class MessagePagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?MessageCollection */ private $results; @@ -48,6 +53,7 @@ final class MessagePagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -56,6 +62,9 @@ public function getLimit() } /** + *

    Actual number of results returned.

    + * + * @return null|int */ public function getCount() @@ -64,6 +73,13 @@ public function getCount() } /** + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    + * + * @return null|int */ public function getTotal() @@ -74,6 +90,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -82,6 +99,9 @@ public function getOffset() } /** + *

    Messages matching the query.

    + * + * @return null|MessageCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Message/MessagePagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Message/MessagePagedQueryResponseModel.php index c345c0e07b3..e52cfd44337 100644 --- a/lib/commercetools-api/src/Models/Message/MessagePagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Message/MessagePagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class MessagePagedQueryResponseModel extends JsonObjectModel implements MessagePagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?MessageCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -82,6 +88,9 @@ public function getLimit() } /** + *

    Actual number of results returned.

    + * + * * @return null|int */ public function getCount() @@ -99,6 +108,13 @@ public function getCount() } /** + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    + * + * * @return null|int */ public function getTotal() @@ -118,6 +134,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -135,6 +152,9 @@ public function getOffset() } /** + *

    Messages matching the query.

    + * + * * @return null|MessageCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Message/MessagePayload.php b/lib/commercetools-api/src/Models/Message/MessagePayload.php index ec48947e4d6..d9a27fb9796 100644 --- a/lib/commercetools-api/src/Models/Message/MessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/MessagePayload.php @@ -17,6 +17,7 @@ interface MessagePayload extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php index 3bf0a3512e0..49ad1c3090e 100644 --- a/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php @@ -21,6 +21,7 @@ final class MessagePayloadModel extends JsonObjectModel implements MessagePayloa { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -30,6 +31,29 @@ final class MessagePayloadModel extends JsonObjectModel implements MessagePayloa * @psalm-suppress InvalidPropertyAssignmentValue */ private static $discriminatorClasses = [ + 'BusinessUnitAddressAdded' => BusinessUnitAddressAddedMessagePayloadModel::class, + 'BusinessUnitAddressChanged' => BusinessUnitAddressChangedMessagePayloadModel::class, + 'BusinessUnitAddressRemoved' => BusinessUnitAddressRemovedMessagePayloadModel::class, + 'BusinessUnitAssociateAdded' => BusinessUnitAssociateAddedMessagePayloadModel::class, + 'BusinessUnitAssociateChanged' => BusinessUnitAssociateChangedMessagePayloadModel::class, + 'BusinessUnitAssociateRemoved' => BusinessUnitAssociateRemovedMessagePayloadModel::class, + 'BusinessUnitAssociatesSet' => BusinessUnitAssociatesSetMessagePayloadModel::class, + 'BusinessUnitBillingAddressAdded' => BusinessUnitBillingAddressAddedMessagePayloadModel::class, + 'BusinessUnitBillingAddressRemoved' => BusinessUnitBillingAddressRemovedMessagePayloadModel::class, + 'BusinessUnitContactEmailSet' => BusinessUnitContactEmailSetMessagePayloadModel::class, + 'BusinessUnitCreated' => BusinessUnitCreatedMessagePayloadModel::class, + 'BusinessUnitDefaultBillingAddressSet' => BusinessUnitDefaultBillingAddressSetMessagePayloadModel::class, + 'BusinessUnitDefaultShippingAddressSet' => BusinessUnitDefaultShippingAddressSetMessagePayloadModel::class, + 'BusinessUnitDeleted' => BusinessUnitDeletedMessagePayloadModel::class, + 'BusinessUnitNameChanged' => BusinessUnitNameChangedMessagePayloadModel::class, + 'BusinessUnitParentUnitChanged' => BusinessUnitParentUnitChangedMessagePayloadModel::class, + 'BusinessUnitShippingAddressAdded' => BusinessUnitShippingAddressAddedMessagePayloadModel::class, + 'BusinessUnitShippingAddressRemoved' => BusinessUnitShippingAddressRemovedMessagePayloadModel::class, + 'BusinessUnitStatusChanged' => BusinessUnitStatusChangedMessagePayloadModel::class, + 'BusinessUnitStoreAdded' => BusinessUnitStoreAddedMessagePayloadModel::class, + 'BusinessUnitStoreModeChanged' => BusinessUnitStoreModeChangedMessagePayloadModel::class, + 'BusinessUnitStoreRemoved' => BusinessUnitStoreRemovedMessagePayloadModel::class, + 'BusinessUnitStoresSet' => BusinessUnitStoresSetMessagePayloadModel::class, 'CategoryCreated' => CategoryCreatedMessagePayloadModel::class, 'CategorySlugChanged' => CategorySlugChangedMessagePayloadModel::class, 'CustomLineItemStateTransition' => CustomLineItemStateTransitionMessagePayloadModel::class, @@ -57,7 +81,10 @@ final class MessagePayloadModel extends JsonObjectModel implements MessagePayloa 'LineItemStateTransition' => LineItemStateTransitionMessagePayloadModel::class, 'OrderBillingAddressSet' => OrderBillingAddressSetMessagePayloadModel::class, 'OrderCreated' => OrderCreatedMessagePayloadModel::class, + 'OrderCustomLineItemAdded' => OrderCustomLineItemAddedMessagePayloadModel::class, 'OrderCustomLineItemDiscountSet' => OrderCustomLineItemDiscountSetMessagePayloadModel::class, + 'OrderCustomLineItemQuantityChanged' => OrderCustomLineItemQuantityChangedMessagePayloadModel::class, + 'OrderCustomLineItemRemoved' => OrderCustomLineItemRemovedMessagePayloadModel::class, 'OrderCustomerEmailSet' => OrderCustomerEmailSetMessagePayloadModel::class, 'OrderCustomerGroupSet' => OrderCustomerGroupSetMessagePayloadModel::class, 'OrderCustomerSet' => OrderCustomerSetMessagePayloadModel::class, @@ -116,9 +143,11 @@ final class MessagePayloadModel extends JsonObjectModel implements MessagePayloa 'QuoteRequestCreated' => QuoteRequestCreatedMessagePayloadModel::class, 'QuoteRequestDeleted' => QuoteRequestDeletedMessagePayloadModel::class, 'QuoteRequestStateChanged' => QuoteRequestStateChangedMessagePayloadModel::class, + 'QuoteRequestStateTransition' => QuoteRequestStateTransitionMessagePayloadModel::class, 'QuoteStateChanged' => QuoteStateChangedMessagePayloadModel::class, - 'ReturnInfoAdded' => OrderReturnInfoAddedMessagePayloadModel::class, - 'ReturnInfoSet' => OrderReturnInfoSetMessagePayloadModel::class, + 'QuoteStateTransition' => QuoteStateTransitionMessagePayloadModel::class, + 'ReturnInfoAdded' => ReturnInfoAddedMessagePayloadModel::class, + 'ReturnInfoSet' => ReturnInfoSetMessagePayloadModel::class, 'ReviewCreated' => ReviewCreatedMessagePayloadModel::class, 'ReviewRatingSet' => ReviewRatingSetMessagePayloadModel::class, 'ReviewStateTransition' => ReviewStateTransitionMessagePayloadModel::class, @@ -127,15 +156,22 @@ final class MessagePayloadModel extends JsonObjectModel implements MessagePayloa 'StagedQuoteDeleted' => StagedQuoteDeletedMessagePayloadModel::class, 'StagedQuoteSellerCommentSet' => StagedQuoteSellerCommentSetMessagePayloadModel::class, 'StagedQuoteStateChanged' => StagedQuoteStateChangedMessagePayloadModel::class, + 'StagedQuoteStateTransition' => StagedQuoteStateTransitionMessagePayloadModel::class, 'StagedQuoteValidToSet' => StagedQuoteValidToSetMessagePayloadModel::class, + 'StandalonePriceActiveChanged' => StandalonePriceActiveChangedMessagePayloadModel::class, 'StandalonePriceCreated' => StandalonePriceCreatedMessagePayloadModel::class, 'StandalonePriceDeleted' => StandalonePriceDeletedMessagePayloadModel::class, 'StandalonePriceDiscountSet' => StandalonePriceDiscountSetMessagePayloadModel::class, 'StandalonePriceExternalDiscountSet' => StandalonePriceExternalDiscountSetMessagePayloadModel::class, + 'StandalonePriceStagedChangesApplied' => StandalonePriceStagedChangesAppliedMessagePayloadModel::class, 'StandalonePriceValueChanged' => StandalonePriceValueChangedMessagePayloadModel::class, 'StoreCreated' => StoreCreatedMessagePayloadModel::class, 'StoreDeleted' => StoreDeletedMessagePayloadModel::class, + 'StoreDistributionChannelsChanged' => StoreDistributionChannelsChangedMessagePayloadModel::class, + 'StoreLanguagesChanged' => StoreLanguagesChangedMessagePayloadModel::class, + 'StoreNameSet' => StoreNameSetMessagePayloadModel::class, 'StoreProductSelectionsChanged' => StoreProductSelectionsChangedMessagePayloadModel::class, + 'StoreSupplyChannelsChanged' => StoreSupplyChannelsChangedMessagePayloadModel::class, 'null' => OrderMessagePayloadModel::class, ]; @@ -143,11 +179,13 @@ final class MessagePayloadModel extends JsonObjectModel implements MessagePayloa * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Message/MessagesConfiguration.php b/lib/commercetools-api/src/Models/Message/MessagesConfiguration.php index 697453cdd48..49cfd036f2a 100644 --- a/lib/commercetools-api/src/Models/Message/MessagesConfiguration.php +++ b/lib/commercetools-api/src/Models/Message/MessagesConfiguration.php @@ -19,6 +19,7 @@ interface MessagesConfiguration extends JsonObject /** *

    When true, the Messages Query feature is active.

    * + * @return null|bool */ public function getEnabled(); @@ -28,6 +29,7 @@ public function getEnabled(); * For Messages older than the specified period, it is not guaranteed that they are still accessible via the API. * This field may not be present on Projects created before 8 October 2018.

    * + * @return null|int */ public function getDeleteDaysAfterCreation(); diff --git a/lib/commercetools-api/src/Models/Message/MessagesConfigurationBuilder.php b/lib/commercetools-api/src/Models/Message/MessagesConfigurationBuilder.php index b99577db35a..9ecdc871f5e 100644 --- a/lib/commercetools-api/src/Models/Message/MessagesConfigurationBuilder.php +++ b/lib/commercetools-api/src/Models/Message/MessagesConfigurationBuilder.php @@ -21,11 +21,13 @@ final class MessagesConfigurationBuilder implements Builder { /** + * @var ?bool */ private $enabled; /** + * @var ?int */ private $deleteDaysAfterCreation; @@ -33,6 +35,7 @@ final class MessagesConfigurationBuilder implements Builder /** *

    When true, the Messages Query feature is active.

    * + * @return null|bool */ public function getEnabled() @@ -45,6 +48,7 @@ public function getEnabled() * For Messages older than the specified period, it is not guaranteed that they are still accessible via the API. * This field may not be present on Projects created before 8 October 2018.

    * + * @return null|int */ public function getDeleteDaysAfterCreation() diff --git a/lib/commercetools-api/src/Models/Message/MessagesConfigurationDraft.php b/lib/commercetools-api/src/Models/Message/MessagesConfigurationDraft.php index 0dcaf9a0834..cc5aef56a8f 100644 --- a/lib/commercetools-api/src/Models/Message/MessagesConfigurationDraft.php +++ b/lib/commercetools-api/src/Models/Message/MessagesConfigurationDraft.php @@ -19,6 +19,7 @@ interface MessagesConfigurationDraft extends JsonObject /** *

    Setting to true activates the Messages Query feature.

    * + * @return null|bool */ public function getEnabled(); @@ -26,6 +27,7 @@ public function getEnabled(); /** *

    Specifies the number of days each Message should be available via the Messages Query API. For Messages older than the specified period, it is not guaranteed that they are still accessible via the API.

    * + * @return null|int */ public function getDeleteDaysAfterCreation(); diff --git a/lib/commercetools-api/src/Models/Message/MessagesConfigurationDraftBuilder.php b/lib/commercetools-api/src/Models/Message/MessagesConfigurationDraftBuilder.php index 423399e0fc1..be4f9716e57 100644 --- a/lib/commercetools-api/src/Models/Message/MessagesConfigurationDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Message/MessagesConfigurationDraftBuilder.php @@ -21,11 +21,13 @@ final class MessagesConfigurationDraftBuilder implements Builder { /** + * @var ?bool */ private $enabled; /** + * @var ?int */ private $deleteDaysAfterCreation; @@ -33,6 +35,7 @@ final class MessagesConfigurationDraftBuilder implements Builder /** *

    Setting to true activates the Messages Query feature.

    * + * @return null|bool */ public function getEnabled() @@ -43,6 +46,7 @@ public function getEnabled() /** *

    Specifies the number of days each Message should be available via the Messages Query API. For Messages older than the specified period, it is not guaranteed that they are still accessible via the API.

    * + * @return null|int */ public function getDeleteDaysAfterCreation() diff --git a/lib/commercetools-api/src/Models/Message/MessagesConfigurationDraftModel.php b/lib/commercetools-api/src/Models/Message/MessagesConfigurationDraftModel.php index 994a738bcca..8c432c0b41b 100644 --- a/lib/commercetools-api/src/Models/Message/MessagesConfigurationDraftModel.php +++ b/lib/commercetools-api/src/Models/Message/MessagesConfigurationDraftModel.php @@ -20,11 +20,13 @@ final class MessagesConfigurationDraftModel extends JsonObjectModel implements MessagesConfigurationDraft { /** + * * @var ?bool */ protected $enabled; /** + * * @var ?int */ protected $deleteDaysAfterCreation; @@ -44,6 +46,7 @@ public function __construct( /** *

    Setting to true activates the Messages Query feature.

    * + * * @return null|bool */ public function getEnabled() @@ -63,6 +66,7 @@ public function getEnabled() /** *

    Specifies the number of days each Message should be available via the Messages Query API. For Messages older than the specified period, it is not guaranteed that they are still accessible via the API.

    * + * * @return null|int */ public function getDeleteDaysAfterCreation() diff --git a/lib/commercetools-api/src/Models/Message/MessagesConfigurationModel.php b/lib/commercetools-api/src/Models/Message/MessagesConfigurationModel.php index 000cf3daf23..2992329cbae 100644 --- a/lib/commercetools-api/src/Models/Message/MessagesConfigurationModel.php +++ b/lib/commercetools-api/src/Models/Message/MessagesConfigurationModel.php @@ -20,11 +20,13 @@ final class MessagesConfigurationModel extends JsonObjectModel implements MessagesConfiguration { /** + * * @var ?bool */ protected $enabled; /** + * * @var ?int */ protected $deleteDaysAfterCreation; @@ -44,6 +46,7 @@ public function __construct( /** *

    When true, the Messages Query feature is active.

    * + * * @return null|bool */ public function getEnabled() @@ -65,6 +68,7 @@ public function getEnabled() * For Messages older than the specified period, it is not guaranteed that they are still accessible via the API. * This field may not be present on Projects created before 8 October 2018.

    * + * * @return null|int */ public function getDeleteDaysAfterCreation() diff --git a/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessage.php index 55be31b353b..a9d71af211d 100644 --- a/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessage.php @@ -18,11 +18,17 @@ interface OrderBillingAddressSetMessage extends OrderMessage public const FIELD_OLD_ADDRESS = 'oldAddress'; /** + *

    Billing address on the Order after the Set Billing Address update action.

    + * + * @return null|Address */ public function getAddress(); /** + *

    Billing address on the Order before the Set Billing Address update action.

    + * + * @return null|Address */ public function getOldAddress(); diff --git a/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessageBuilder.php index 72a2cba2419..da66534b3e1 100644 --- a/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessageBuilder.php @@ -30,68 +30,81 @@ final class OrderBillingAddressSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|Address|AddressBuilder */ private $address; /** + * @var null|Address|AddressBuilder */ private $oldAddress; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,6 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Billing address on the Order after the Set Billing Address update action.

    + * + * @return null|Address */ public function getAddress() @@ -186,6 +224,9 @@ public function getAddress() } /** + *

    Billing address on the Order before the Set Billing Address update action.

    + * + * @return null|Address */ public function getOldAddress() diff --git a/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessageModel.php index 9967e7d278f..b5955e716cb 100644 --- a/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessageModel.php @@ -30,66 +30,79 @@ final class OrderBillingAddressSetMessageModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'OrderBillingAddressSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?Address */ protected $address; /** + * * @var ?Address */ protected $oldAddress; @@ -110,7 +123,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?Address $address = null, - ?Address $oldAddress = null + ?Address $oldAddress = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +138,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->address = $address; $this->oldAddress = $oldAddress; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,6 +375,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Billing address on the Order after the Set Billing Address update action.

    + * + * * @return null|Address */ public function getAddress() @@ -353,6 +396,9 @@ public function getAddress() } /** + *

    Billing address on the Order before the Set Billing Address update action.

    + * + * * @return null|Address */ public function getOldAddress() diff --git a/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessagePayload.php index 7fe970d0dec..804daae2d11 100644 --- a/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessagePayload.php @@ -18,11 +18,17 @@ interface OrderBillingAddressSetMessagePayload extends OrderMessagePayload public const FIELD_OLD_ADDRESS = 'oldAddress'; /** + *

    Billing address on the Order after the Set Billing Address update action.

    + * + * @return null|Address */ public function getAddress(); /** + *

    Billing address on the Order before the Set Billing Address update action.

    + * + * @return null|Address */ public function getOldAddress(); diff --git a/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessagePayloadBuilder.php index d54a4020420..2f8f3617786 100644 --- a/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessagePayloadBuilder.php @@ -23,16 +23,21 @@ final class OrderBillingAddressSetMessagePayloadBuilder implements Builder { /** + * @var null|Address|AddressBuilder */ private $address; /** + * @var null|Address|AddressBuilder */ private $oldAddress; /** + *

    Billing address on the Order after the Set Billing Address update action.

    + * + * @return null|Address */ public function getAddress() @@ -41,6 +46,9 @@ public function getAddress() } /** + *

    Billing address on the Order before the Set Billing Address update action.

    + * + * @return null|Address */ public function getOldAddress() diff --git a/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessagePayloadModel.php index 26a74ccb55b..ec4e34c540d 100644 --- a/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderBillingAddressSetMessagePayloadModel.php @@ -23,16 +23,19 @@ final class OrderBillingAddressSetMessagePayloadModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'OrderBillingAddressSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?Address */ protected $address; /** + * * @var ?Address */ protected $oldAddress; @@ -43,14 +46,16 @@ final class OrderBillingAddressSetMessagePayloadModel extends JsonObjectModel im */ public function __construct( ?Address $address = null, - ?Address $oldAddress = null + ?Address $oldAddress = null, + ?string $type = null ) { $this->address = $address; $this->oldAddress = $oldAddress; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,6 +73,9 @@ public function getType() } /** + *

    Billing address on the Order after the Set Billing Address update action.

    + * + * * @return null|Address */ public function getAddress() @@ -86,6 +94,9 @@ public function getAddress() } /** + *

    Billing address on the Order before the Set Billing Address update action.

    + * + * * @return null|Address */ public function getOldAddress() diff --git a/lib/commercetools-api/src/Models/Message/OrderCreatedMessage.php b/lib/commercetools-api/src/Models/Message/OrderCreatedMessage.php index 7aa0e36ba2a..9b280c0aee7 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCreatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderCreatedMessage.php @@ -17,6 +17,9 @@ interface OrderCreatedMessage extends OrderMessage public const FIELD_ORDER = 'order'; /** + *

    Order that was created.

    + * + * @return null|Order */ public function getOrder(); diff --git a/lib/commercetools-api/src/Models/Message/OrderCreatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCreatedMessageBuilder.php index 1bb1fa062ab..414f9833d0e 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCreatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCreatedMessageBuilder.php @@ -30,63 +30,75 @@ final class OrderCreatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|Order|OrderBuilder */ private $order; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,6 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Order that was created.

    + * + * @return null|Order */ public function getOrder() diff --git a/lib/commercetools-api/src/Models/Message/OrderCreatedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderCreatedMessageModel.php index f286f76e290..c64cbf848b6 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCreatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCreatedMessageModel.php @@ -30,61 +30,73 @@ final class OrderCreatedMessageModel extends JsonObjectModel implements OrderCre { public const DISCRIMINATOR_VALUE = 'OrderCreated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?Order */ protected $order; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?Order $order = null + ?Order $order = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->order = $order; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,6 +367,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Order that was created.

    + * + * * @return null|Order */ public function getOrder() diff --git a/lib/commercetools-api/src/Models/Message/OrderCreatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderCreatedMessagePayload.php index 27cc5661347..6e8c2e27479 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCreatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderCreatedMessagePayload.php @@ -17,6 +17,9 @@ interface OrderCreatedMessagePayload extends OrderMessagePayload public const FIELD_ORDER = 'order'; /** + *

    Order that was created.

    + * + * @return null|Order */ public function getOrder(); diff --git a/lib/commercetools-api/src/Models/Message/OrderCreatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCreatedMessagePayloadBuilder.php index 8abccaa5fc3..4856a5a3714 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCreatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCreatedMessagePayloadBuilder.php @@ -23,11 +23,15 @@ final class OrderCreatedMessagePayloadBuilder implements Builder { /** + * @var null|Order|OrderBuilder */ private $order; /** + *

    Order that was created.

    + * + * @return null|Order */ public function getOrder() diff --git a/lib/commercetools-api/src/Models/Message/OrderCreatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderCreatedMessagePayloadModel.php index f45f9b0be2b..48c48036789 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCreatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCreatedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class OrderCreatedMessagePayloadModel extends JsonObjectModel implements O { public const DISCRIMINATOR_VALUE = 'OrderCreated'; /** + * * @var ?string */ protected $type; /** + * * @var ?Order */ protected $order; @@ -37,13 +39,15 @@ final class OrderCreatedMessagePayloadModel extends JsonObjectModel implements O * @psalm-suppress MissingParamType */ public function __construct( - ?Order $order = null + ?Order $order = null, + ?string $type = null ) { $this->order = $order; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,9 @@ public function getType() } /** + *

    Order that was created.

    + * + * * @return null|Order */ public function getOrder() diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessage.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessage.php new file mode 100644 index 00000000000..cea05709280 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessage.php @@ -0,0 +1,31 @@ +Custom Line Item that was added to the Order.

    + * + + * @return null|CustomLineItem + */ + public function getCustomLineItem(); + + /** + * @param ?CustomLineItem $customLineItem + */ + public function setCustomLineItem(?CustomLineItem $customLineItem): void; +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessageBuilder.php new file mode 100644 index 00000000000..31e9de354ea --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class OrderCustomLineItemAddedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|CustomLineItem|CustomLineItemBuilder + */ + private $customLineItem; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Custom Line Item that was added to the Order.

    + * + + * @return null|CustomLineItem + */ + public function getCustomLineItem() + { + return $this->customLineItem instanceof CustomLineItemBuilder ? $this->customLineItem->build() : $this->customLineItem; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?CustomLineItem $customLineItem + * @return $this + */ + public function withCustomLineItem(?CustomLineItem $customLineItem) + { + $this->customLineItem = $customLineItem; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withCustomLineItem() instead + * @return $this + */ + public function withCustomLineItemBuilder(?CustomLineItemBuilder $customLineItem) + { + $this->customLineItem = $customLineItem; + + return $this; + } + + public function build(): OrderCustomLineItemAddedMessage + { + return new OrderCustomLineItemAddedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->customLineItem instanceof CustomLineItemBuilder ? $this->customLineItem->build() : $this->customLineItem + ); + } + + public static function of(): OrderCustomLineItemAddedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessageCollection.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessageCollection.php new file mode 100644 index 00000000000..b3757cf9460 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method OrderCustomLineItemAddedMessage current() + * @method OrderCustomLineItemAddedMessage end() + * @method OrderCustomLineItemAddedMessage at($offset) + */ +class OrderCustomLineItemAddedMessageCollection extends OrderMessageCollection +{ + /** + * @psalm-assert OrderCustomLineItemAddedMessage $value + * @psalm-param OrderCustomLineItemAddedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return OrderCustomLineItemAddedMessageCollection + */ + public function add($value) + { + if (!$value instanceof OrderCustomLineItemAddedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?OrderCustomLineItemAddedMessage + */ + protected function mapper() + { + return function (?int $index): ?OrderCustomLineItemAddedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var OrderCustomLineItemAddedMessage $data */ + $data = OrderCustomLineItemAddedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessageModel.php new file mode 100644 index 00000000000..b8d7dccc4d6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->customLineItem = $customLineItem; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Custom Line Item that was added to the Order.

    + * + * + * @return null|CustomLineItem + */ + public function getCustomLineItem() + { + if (is_null($this->customLineItem)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM); + if (is_null($data)) { + return null; + } + + $this->customLineItem = CustomLineItemModel::of($data); + } + + return $this->customLineItem; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?CustomLineItem $customLineItem + */ + public function setCustomLineItem(?CustomLineItem $customLineItem): void + { + $this->customLineItem = $customLineItem; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessagePayload.php new file mode 100644 index 00000000000..8e481d944dd --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessagePayload.php @@ -0,0 +1,31 @@ +Custom Line Item that was added to the Order.

    + * + + * @return null|CustomLineItem + */ + public function getCustomLineItem(); + + /** + * @param ?CustomLineItem $customLineItem + */ + public function setCustomLineItem(?CustomLineItem $customLineItem): void; +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessagePayloadBuilder.php new file mode 100644 index 00000000000..1bf7ce0eb55 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class OrderCustomLineItemAddedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|CustomLineItem|CustomLineItemBuilder + */ + private $customLineItem; + + /** + *

    Custom Line Item that was added to the Order.

    + * + + * @return null|CustomLineItem + */ + public function getCustomLineItem() + { + return $this->customLineItem instanceof CustomLineItemBuilder ? $this->customLineItem->build() : $this->customLineItem; + } + + /** + * @param ?CustomLineItem $customLineItem + * @return $this + */ + public function withCustomLineItem(?CustomLineItem $customLineItem) + { + $this->customLineItem = $customLineItem; + + return $this; + } + + /** + * @deprecated use withCustomLineItem() instead + * @return $this + */ + public function withCustomLineItemBuilder(?CustomLineItemBuilder $customLineItem) + { + $this->customLineItem = $customLineItem; + + return $this; + } + + public function build(): OrderCustomLineItemAddedMessagePayload + { + return new OrderCustomLineItemAddedMessagePayloadModel( + $this->customLineItem instanceof CustomLineItemBuilder ? $this->customLineItem->build() : $this->customLineItem + ); + } + + public static function of(): OrderCustomLineItemAddedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessagePayloadCollection.php new file mode 100644 index 00000000000..2ac4ac97bc9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method OrderCustomLineItemAddedMessagePayload current() + * @method OrderCustomLineItemAddedMessagePayload end() + * @method OrderCustomLineItemAddedMessagePayload at($offset) + */ +class OrderCustomLineItemAddedMessagePayloadCollection extends OrderMessagePayloadCollection +{ + /** + * @psalm-assert OrderCustomLineItemAddedMessagePayload $value + * @psalm-param OrderCustomLineItemAddedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return OrderCustomLineItemAddedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof OrderCustomLineItemAddedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?OrderCustomLineItemAddedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?OrderCustomLineItemAddedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var OrderCustomLineItemAddedMessagePayload $data */ + $data = OrderCustomLineItemAddedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessagePayloadModel.php new file mode 100644 index 00000000000..f76a30967b6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemAddedMessagePayloadModel.php @@ -0,0 +1,96 @@ +customLineItem = $customLineItem; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Custom Line Item that was added to the Order.

    + * + * + * @return null|CustomLineItem + */ + public function getCustomLineItem() + { + if (is_null($this->customLineItem)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM); + if (is_null($data)) { + return null; + } + + $this->customLineItem = CustomLineItemModel::of($data); + } + + return $this->customLineItem; + } + + + /** + * @param ?CustomLineItem $customLineItem + */ + public function setCustomLineItem(?CustomLineItem $customLineItem): void + { + $this->customLineItem = $customLineItem; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessage.php index 3487cd0deea..dd5bb94edfe 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessage.php @@ -20,16 +20,25 @@ interface OrderCustomLineItemDiscountSetMessage extends OrderMessage public const FIELD_TAXED_PRICE = 'taxedPrice'; /** + *

    Unique identifier for the Custom Line Item.

    + * + * @return null|string */ public function getCustomLineItemId(); /** + *

    Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

    + * + * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity(); /** + *

    TaxedItemPrice of the Custom Line Item after the Discount recalculation.

    + * + * @return null|TaxedItemPrice */ public function getTaxedPrice(); diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessageBuilder.php index 080a91a4fda..3d717b5b63f 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessageBuilder.php @@ -31,73 +31,87 @@ final class OrderCustomLineItemDiscountSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $customLineItemId; /** + * @var ?DiscountedLineItemPriceForQuantityCollection */ private $discountedPricePerQuantity; /** + * @var null|TaxedItemPrice|TaxedItemPriceBuilder */ private $taxedPrice; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -106,6 +120,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -114,6 +131,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -122,6 +142,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -130,8 +153,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -142,6 +166,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -150,6 +175,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -158,8 +187,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -168,6 +198,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -176,6 +209,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -184,6 +220,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier for the Custom Line Item.

    + * + * @return null|string */ public function getCustomLineItemId() @@ -192,6 +231,9 @@ public function getCustomLineItemId() } /** + *

    Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

    + * + * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity() @@ -200,6 +242,9 @@ public function getDiscountedPricePerQuantity() } /** + *

    TaxedItemPrice of the Custom Line Item after the Discount recalculation.

    + * + * @return null|TaxedItemPrice */ public function getTaxedPrice() diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessageModel.php index 3073a818161..4db3435bdf0 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessageModel.php @@ -31,71 +31,85 @@ final class OrderCustomLineItemDiscountSetMessageModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'OrderCustomLineItemDiscountSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?DiscountedLineItemPriceForQuantityCollection */ protected $discountedPricePerQuantity; /** + * * @var ?TaxedItemPrice */ protected $taxedPrice; @@ -117,7 +131,8 @@ public function __construct( ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $customLineItemId = null, ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity = null, - ?TaxedItemPrice $taxedPrice = null + ?TaxedItemPrice $taxedPrice = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -132,11 +147,12 @@ public function __construct( $this->customLineItemId = $customLineItemId; $this->discountedPricePerQuantity = $discountedPricePerQuantity; $this->taxedPrice = $taxedPrice; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -155,6 +171,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -172,6 +191,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -193,6 +215,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -214,7 +239,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -236,6 +262,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -254,6 +281,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -271,7 +302,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -291,6 +323,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -308,6 +343,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -325,6 +363,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -343,6 +384,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier for the Custom Line Item.

    + * + * * @return null|string */ public function getCustomLineItemId() @@ -360,6 +404,9 @@ public function getCustomLineItemId() } /** + *

    Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

    + * + * * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity() @@ -377,6 +424,9 @@ public function getDiscountedPricePerQuantity() } /** + *

    TaxedItemPrice of the Custom Line Item after the Discount recalculation.

    + * + * * @return null|TaxedItemPrice */ public function getTaxedPrice() diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayload.php index 7577e86d187..9c16e648e3b 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayload.php @@ -20,16 +20,25 @@ interface OrderCustomLineItemDiscountSetMessagePayload extends OrderMessagePaylo public const FIELD_TAXED_PRICE = 'taxedPrice'; /** + *

    Unique identifier for the Custom Line Item.

    + * + * @return null|string */ public function getCustomLineItemId(); /** + *

    Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

    + * + * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity(); /** + *

    TaxedItemPrice of the Custom Line Item after the Discount recalculation.

    + * + * @return null|TaxedItemPrice */ public function getTaxedPrice(); diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayloadBuilder.php index 12ec0cb8319..0a11b35a783 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayloadBuilder.php @@ -24,21 +24,27 @@ final class OrderCustomLineItemDiscountSetMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var ?DiscountedLineItemPriceForQuantityCollection */ private $discountedPricePerQuantity; /** + * @var null|TaxedItemPrice|TaxedItemPriceBuilder */ private $taxedPrice; /** + *

    Unique identifier for the Custom Line Item.

    + * + * @return null|string */ public function getCustomLineItemId() @@ -47,6 +53,9 @@ public function getCustomLineItemId() } /** + *

    Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

    + * + * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity() @@ -55,6 +64,9 @@ public function getDiscountedPricePerQuantity() } /** + *

    TaxedItemPrice of the Custom Line Item after the Discount recalculation.

    + * + * @return null|TaxedItemPrice */ public function getTaxedPrice() diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayloadModel.php index 881f1a74b58..08b246e4d62 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayloadModel.php @@ -24,21 +24,25 @@ final class OrderCustomLineItemDiscountSetMessagePayloadModel extends JsonObject { public const DISCRIMINATOR_VALUE = 'OrderCustomLineItemDiscountSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?DiscountedLineItemPriceForQuantityCollection */ protected $discountedPricePerQuantity; /** + * * @var ?TaxedItemPrice */ protected $taxedPrice; @@ -50,15 +54,17 @@ final class OrderCustomLineItemDiscountSetMessagePayloadModel extends JsonObject public function __construct( ?string $customLineItemId = null, ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity = null, - ?TaxedItemPrice $taxedPrice = null + ?TaxedItemPrice $taxedPrice = null, + ?string $type = null ) { $this->customLineItemId = $customLineItemId; $this->discountedPricePerQuantity = $discountedPricePerQuantity; $this->taxedPrice = $taxedPrice; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,9 @@ public function getType() } /** + *

    Unique identifier for the Custom Line Item.

    + * + * * @return null|string */ public function getCustomLineItemId() @@ -93,6 +102,9 @@ public function getCustomLineItemId() } /** + *

    Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

    + * + * * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity() @@ -110,6 +122,9 @@ public function getDiscountedPricePerQuantity() } /** + *

    TaxedItemPrice of the Custom Line Item after the Discount recalculation.

    + * + * * @return null|TaxedItemPrice */ public function getTaxedPrice() diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessage.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessage.php new file mode 100644 index 00000000000..e602f6d8e8f --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessage.php @@ -0,0 +1,58 @@ +Unique identifier of the Custom Line Item.

    + * + + * @return null|string + */ + public function getCustomLineItemId(); + + /** + *

    Custom Line Item quantity after the Change Custom Line Item Quantity update action.

    + * + + * @return null|int + */ + public function getQuantity(); + + /** + *

    Custom Line Item quantity before the Change Custom Line Item Quantity update action.

    + * + + * @return null|int + */ + public function getOldQuantity(); + + /** + * @param ?string $customLineItemId + */ + public function setCustomLineItemId(?string $customLineItemId): void; + + /** + * @param ?int $quantity + */ + public function setQuantity(?int $quantity): void; + + /** + * @param ?int $oldQuantity + */ + public function setOldQuantity(?int $oldQuantity): void; +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessageBuilder.php new file mode 100644 index 00000000000..0a5ae868be7 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessageBuilder.php @@ -0,0 +1,462 @@ + + */ +final class OrderCustomLineItemQuantityChangedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $customLineItemId; + + /** + + * @var ?int + */ + private $quantity; + + /** + + * @var ?int + */ + private $oldQuantity; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Unique identifier of the Custom Line Item.

    + * + + * @return null|string + */ + public function getCustomLineItemId() + { + return $this->customLineItemId; + } + + /** + *

    Custom Line Item quantity after the Change Custom Line Item Quantity update action.

    + * + + * @return null|int + */ + public function getQuantity() + { + return $this->quantity; + } + + /** + *

    Custom Line Item quantity before the Change Custom Line Item Quantity update action.

    + * + + * @return null|int + */ + public function getOldQuantity() + { + return $this->oldQuantity; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $customLineItemId + * @return $this + */ + public function withCustomLineItemId(?string $customLineItemId) + { + $this->customLineItemId = $customLineItemId; + + return $this; + } + + /** + * @param ?int $quantity + * @return $this + */ + public function withQuantity(?int $quantity) + { + $this->quantity = $quantity; + + return $this; + } + + /** + * @param ?int $oldQuantity + * @return $this + */ + public function withOldQuantity(?int $oldQuantity) + { + $this->oldQuantity = $oldQuantity; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): OrderCustomLineItemQuantityChangedMessage + { + return new OrderCustomLineItemQuantityChangedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->customLineItemId, + $this->quantity, + $this->oldQuantity + ); + } + + public static function of(): OrderCustomLineItemQuantityChangedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessageCollection.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessageCollection.php new file mode 100644 index 00000000000..f09579eeba8 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method OrderCustomLineItemQuantityChangedMessage current() + * @method OrderCustomLineItemQuantityChangedMessage end() + * @method OrderCustomLineItemQuantityChangedMessage at($offset) + */ +class OrderCustomLineItemQuantityChangedMessageCollection extends OrderMessageCollection +{ + /** + * @psalm-assert OrderCustomLineItemQuantityChangedMessage $value + * @psalm-param OrderCustomLineItemQuantityChangedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return OrderCustomLineItemQuantityChangedMessageCollection + */ + public function add($value) + { + if (!$value instanceof OrderCustomLineItemQuantityChangedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?OrderCustomLineItemQuantityChangedMessage + */ + protected function mapper() + { + return function (?int $index): ?OrderCustomLineItemQuantityChangedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var OrderCustomLineItemQuantityChangedMessage $data */ + $data = OrderCustomLineItemQuantityChangedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessageModel.php new file mode 100644 index 00000000000..3c6a234f1a9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessageModel.php @@ -0,0 +1,562 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->customLineItemId = $customLineItemId; + $this->quantity = $quantity; + $this->oldQuantity = $oldQuantity; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Unique identifier of the Custom Line Item.

    + * + * + * @return null|string + */ + public function getCustomLineItemId() + { + if (is_null($this->customLineItemId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_ID); + if (is_null($data)) { + return null; + } + $this->customLineItemId = (string) $data; + } + + return $this->customLineItemId; + } + + /** + *

    Custom Line Item quantity after the Change Custom Line Item Quantity update action.

    + * + * + * @return null|int + */ + public function getQuantity() + { + if (is_null($this->quantity)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_QUANTITY); + if (is_null($data)) { + return null; + } + $this->quantity = (int) $data; + } + + return $this->quantity; + } + + /** + *

    Custom Line Item quantity before the Change Custom Line Item Quantity update action.

    + * + * + * @return null|int + */ + public function getOldQuantity() + { + if (is_null($this->oldQuantity)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_OLD_QUANTITY); + if (is_null($data)) { + return null; + } + $this->oldQuantity = (int) $data; + } + + return $this->oldQuantity; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $customLineItemId + */ + public function setCustomLineItemId(?string $customLineItemId): void + { + $this->customLineItemId = $customLineItemId; + } + + /** + * @param ?int $quantity + */ + public function setQuantity(?int $quantity): void + { + $this->quantity = $quantity; + } + + /** + * @param ?int $oldQuantity + */ + public function setOldQuantity(?int $oldQuantity): void + { + $this->oldQuantity = $oldQuantity; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayload.php new file mode 100644 index 00000000000..622da203c26 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayload.php @@ -0,0 +1,58 @@ +Unique identifier of the Custom Line Item.

    + * + + * @return null|string + */ + public function getCustomLineItemId(); + + /** + *

    Custom Line Item quantity after the Change Custom Line Item Quantity update action.

    + * + + * @return null|int + */ + public function getQuantity(); + + /** + *

    Custom Line Item quantity before the Change Custom Line Item Quantity update action.

    + * + + * @return null|int + */ + public function getOldQuantity(); + + /** + * @param ?string $customLineItemId + */ + public function setCustomLineItemId(?string $customLineItemId): void; + + /** + * @param ?int $quantity + */ + public function setQuantity(?int $quantity): void; + + /** + * @param ?int $oldQuantity + */ + public function setOldQuantity(?int $oldQuantity): void; +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayloadBuilder.php new file mode 100644 index 00000000000..7ad9601cc6b --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayloadBuilder.php @@ -0,0 +1,121 @@ + + */ +final class OrderCustomLineItemQuantityChangedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $customLineItemId; + + /** + + * @var ?int + */ + private $quantity; + + /** + + * @var ?int + */ + private $oldQuantity; + + /** + *

    Unique identifier of the Custom Line Item.

    + * + + * @return null|string + */ + public function getCustomLineItemId() + { + return $this->customLineItemId; + } + + /** + *

    Custom Line Item quantity after the Change Custom Line Item Quantity update action.

    + * + + * @return null|int + */ + public function getQuantity() + { + return $this->quantity; + } + + /** + *

    Custom Line Item quantity before the Change Custom Line Item Quantity update action.

    + * + + * @return null|int + */ + public function getOldQuantity() + { + return $this->oldQuantity; + } + + /** + * @param ?string $customLineItemId + * @return $this + */ + public function withCustomLineItemId(?string $customLineItemId) + { + $this->customLineItemId = $customLineItemId; + + return $this; + } + + /** + * @param ?int $quantity + * @return $this + */ + public function withQuantity(?int $quantity) + { + $this->quantity = $quantity; + + return $this; + } + + /** + * @param ?int $oldQuantity + * @return $this + */ + public function withOldQuantity(?int $oldQuantity) + { + $this->oldQuantity = $oldQuantity; + + return $this; + } + + + public function build(): OrderCustomLineItemQuantityChangedMessagePayload + { + return new OrderCustomLineItemQuantityChangedMessagePayloadModel( + $this->customLineItemId, + $this->quantity, + $this->oldQuantity + ); + } + + public static function of(): OrderCustomLineItemQuantityChangedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayloadCollection.php new file mode 100644 index 00000000000..7faae338ccb --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method OrderCustomLineItemQuantityChangedMessagePayload current() + * @method OrderCustomLineItemQuantityChangedMessagePayload end() + * @method OrderCustomLineItemQuantityChangedMessagePayload at($offset) + */ +class OrderCustomLineItemQuantityChangedMessagePayloadCollection extends OrderMessagePayloadCollection +{ + /** + * @psalm-assert OrderCustomLineItemQuantityChangedMessagePayload $value + * @psalm-param OrderCustomLineItemQuantityChangedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return OrderCustomLineItemQuantityChangedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof OrderCustomLineItemQuantityChangedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?OrderCustomLineItemQuantityChangedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?OrderCustomLineItemQuantityChangedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var OrderCustomLineItemQuantityChangedMessagePayload $data */ + $data = OrderCustomLineItemQuantityChangedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayloadModel.php new file mode 100644 index 00000000000..d0bed523500 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayloadModel.php @@ -0,0 +1,165 @@ +customLineItemId = $customLineItemId; + $this->quantity = $quantity; + $this->oldQuantity = $oldQuantity; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Unique identifier of the Custom Line Item.

    + * + * + * @return null|string + */ + public function getCustomLineItemId() + { + if (is_null($this->customLineItemId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_ID); + if (is_null($data)) { + return null; + } + $this->customLineItemId = (string) $data; + } + + return $this->customLineItemId; + } + + /** + *

    Custom Line Item quantity after the Change Custom Line Item Quantity update action.

    + * + * + * @return null|int + */ + public function getQuantity() + { + if (is_null($this->quantity)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_QUANTITY); + if (is_null($data)) { + return null; + } + $this->quantity = (int) $data; + } + + return $this->quantity; + } + + /** + *

    Custom Line Item quantity before the Change Custom Line Item Quantity update action.

    + * + * + * @return null|int + */ + public function getOldQuantity() + { + if (is_null($this->oldQuantity)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_OLD_QUANTITY); + if (is_null($data)) { + return null; + } + $this->oldQuantity = (int) $data; + } + + return $this->oldQuantity; + } + + + /** + * @param ?string $customLineItemId + */ + public function setCustomLineItemId(?string $customLineItemId): void + { + $this->customLineItemId = $customLineItemId; + } + + /** + * @param ?int $quantity + */ + public function setQuantity(?int $quantity): void + { + $this->quantity = $quantity; + } + + /** + * @param ?int $oldQuantity + */ + public function setOldQuantity(?int $oldQuantity): void + { + $this->oldQuantity = $oldQuantity; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessage.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessage.php new file mode 100644 index 00000000000..b92665b597c --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessage.php @@ -0,0 +1,45 @@ +Unique identifier of the Custom Line Item.

    + * + + * @return null|string + */ + public function getCustomLineItemId(); + + /** + *

    Custom Line Item that was removed from the Order.

    + * + + * @return null|CustomLineItem + */ + public function getCustomLineItem(); + + /** + * @param ?string $customLineItemId + */ + public function setCustomLineItemId(?string $customLineItemId): void; + + /** + * @param ?CustomLineItem $customLineItem + */ + public function setCustomLineItem(?CustomLineItem $customLineItem): void; +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessageBuilder.php new file mode 100644 index 00000000000..8583c350a39 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessageBuilder.php @@ -0,0 +1,446 @@ + + */ +final class OrderCustomLineItemRemovedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $customLineItemId; + + /** + + * @var null|CustomLineItem|CustomLineItemBuilder + */ + private $customLineItem; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Unique identifier of the Custom Line Item.

    + * + + * @return null|string + */ + public function getCustomLineItemId() + { + return $this->customLineItemId; + } + + /** + *

    Custom Line Item that was removed from the Order.

    + * + + * @return null|CustomLineItem + */ + public function getCustomLineItem() + { + return $this->customLineItem instanceof CustomLineItemBuilder ? $this->customLineItem->build() : $this->customLineItem; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $customLineItemId + * @return $this + */ + public function withCustomLineItemId(?string $customLineItemId) + { + $this->customLineItemId = $customLineItemId; + + return $this; + } + + /** + * @param ?CustomLineItem $customLineItem + * @return $this + */ + public function withCustomLineItem(?CustomLineItem $customLineItem) + { + $this->customLineItem = $customLineItem; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withCustomLineItem() instead + * @return $this + */ + public function withCustomLineItemBuilder(?CustomLineItemBuilder $customLineItem) + { + $this->customLineItem = $customLineItem; + + return $this; + } + + public function build(): OrderCustomLineItemRemovedMessage + { + return new OrderCustomLineItemRemovedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->customLineItemId, + $this->customLineItem instanceof CustomLineItemBuilder ? $this->customLineItem->build() : $this->customLineItem + ); + } + + public static function of(): OrderCustomLineItemRemovedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessageCollection.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessageCollection.php new file mode 100644 index 00000000000..652774ba3b5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method OrderCustomLineItemRemovedMessage current() + * @method OrderCustomLineItemRemovedMessage end() + * @method OrderCustomLineItemRemovedMessage at($offset) + */ +class OrderCustomLineItemRemovedMessageCollection extends OrderMessageCollection +{ + /** + * @psalm-assert OrderCustomLineItemRemovedMessage $value + * @psalm-param OrderCustomLineItemRemovedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return OrderCustomLineItemRemovedMessageCollection + */ + public function add($value) + { + if (!$value instanceof OrderCustomLineItemRemovedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?OrderCustomLineItemRemovedMessage + */ + protected function mapper() + { + return function (?int $index): ?OrderCustomLineItemRemovedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var OrderCustomLineItemRemovedMessage $data */ + $data = OrderCustomLineItemRemovedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessageModel.php new file mode 100644 index 00000000000..8d13fa10f72 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessageModel.php @@ -0,0 +1,529 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->customLineItemId = $customLineItemId; + $this->customLineItem = $customLineItem; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Unique identifier of the Custom Line Item.

    + * + * + * @return null|string + */ + public function getCustomLineItemId() + { + if (is_null($this->customLineItemId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_ID); + if (is_null($data)) { + return null; + } + $this->customLineItemId = (string) $data; + } + + return $this->customLineItemId; + } + + /** + *

    Custom Line Item that was removed from the Order.

    + * + * + * @return null|CustomLineItem + */ + public function getCustomLineItem() + { + if (is_null($this->customLineItem)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM); + if (is_null($data)) { + return null; + } + + $this->customLineItem = CustomLineItemModel::of($data); + } + + return $this->customLineItem; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $customLineItemId + */ + public function setCustomLineItemId(?string $customLineItemId): void + { + $this->customLineItemId = $customLineItemId; + } + + /** + * @param ?CustomLineItem $customLineItem + */ + public function setCustomLineItem(?CustomLineItem $customLineItem): void + { + $this->customLineItem = $customLineItem; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayload.php new file mode 100644 index 00000000000..524fee1aff5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayload.php @@ -0,0 +1,45 @@ +Unique identifier of the Custom Line Item.

    + * + + * @return null|string + */ + public function getCustomLineItemId(); + + /** + *

    Custom Line Item that was removed from the Order.

    + * + + * @return null|CustomLineItem + */ + public function getCustomLineItem(); + + /** + * @param ?string $customLineItemId + */ + public function setCustomLineItemId(?string $customLineItemId): void; + + /** + * @param ?CustomLineItem $customLineItem + */ + public function setCustomLineItem(?CustomLineItem $customLineItem): void; +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayloadBuilder.php new file mode 100644 index 00000000000..b2c2c32ae1f --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayloadBuilder.php @@ -0,0 +1,104 @@ + + */ +final class OrderCustomLineItemRemovedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $customLineItemId; + + /** + + * @var null|CustomLineItem|CustomLineItemBuilder + */ + private $customLineItem; + + /** + *

    Unique identifier of the Custom Line Item.

    + * + + * @return null|string + */ + public function getCustomLineItemId() + { + return $this->customLineItemId; + } + + /** + *

    Custom Line Item that was removed from the Order.

    + * + + * @return null|CustomLineItem + */ + public function getCustomLineItem() + { + return $this->customLineItem instanceof CustomLineItemBuilder ? $this->customLineItem->build() : $this->customLineItem; + } + + /** + * @param ?string $customLineItemId + * @return $this + */ + public function withCustomLineItemId(?string $customLineItemId) + { + $this->customLineItemId = $customLineItemId; + + return $this; + } + + /** + * @param ?CustomLineItem $customLineItem + * @return $this + */ + public function withCustomLineItem(?CustomLineItem $customLineItem) + { + $this->customLineItem = $customLineItem; + + return $this; + } + + /** + * @deprecated use withCustomLineItem() instead + * @return $this + */ + public function withCustomLineItemBuilder(?CustomLineItemBuilder $customLineItem) + { + $this->customLineItem = $customLineItem; + + return $this; + } + + public function build(): OrderCustomLineItemRemovedMessagePayload + { + return new OrderCustomLineItemRemovedMessagePayloadModel( + $this->customLineItemId, + $this->customLineItem instanceof CustomLineItemBuilder ? $this->customLineItem->build() : $this->customLineItem + ); + } + + public static function of(): OrderCustomLineItemRemovedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayloadCollection.php new file mode 100644 index 00000000000..a1c683ebb42 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method OrderCustomLineItemRemovedMessagePayload current() + * @method OrderCustomLineItemRemovedMessagePayload end() + * @method OrderCustomLineItemRemovedMessagePayload at($offset) + */ +class OrderCustomLineItemRemovedMessagePayloadCollection extends OrderMessagePayloadCollection +{ + /** + * @psalm-assert OrderCustomLineItemRemovedMessagePayload $value + * @psalm-param OrderCustomLineItemRemovedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return OrderCustomLineItemRemovedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof OrderCustomLineItemRemovedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?OrderCustomLineItemRemovedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?OrderCustomLineItemRemovedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var OrderCustomLineItemRemovedMessagePayload $data */ + $data = OrderCustomLineItemRemovedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayloadModel.php new file mode 100644 index 00000000000..1d07158d47e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayloadModel.php @@ -0,0 +1,132 @@ +customLineItemId = $customLineItemId; + $this->customLineItem = $customLineItem; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Unique identifier of the Custom Line Item.

    + * + * + * @return null|string + */ + public function getCustomLineItemId() + { + if (is_null($this->customLineItemId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_ID); + if (is_null($data)) { + return null; + } + $this->customLineItemId = (string) $data; + } + + return $this->customLineItemId; + } + + /** + *

    Custom Line Item that was removed from the Order.

    + * + * + * @return null|CustomLineItem + */ + public function getCustomLineItem() + { + if (is_null($this->customLineItem)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM); + if (is_null($data)) { + return null; + } + + $this->customLineItem = CustomLineItemModel::of($data); + } + + return $this->customLineItem; + } + + + /** + * @param ?string $customLineItemId + */ + public function setCustomLineItemId(?string $customLineItemId): void + { + $this->customLineItemId = $customLineItemId; + } + + /** + * @param ?CustomLineItem $customLineItem + */ + public function setCustomLineItem(?CustomLineItem $customLineItem): void + { + $this->customLineItem = $customLineItem; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessage.php index e9e9b028bdc..9b20c7a98f6 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessage.php @@ -17,11 +17,17 @@ interface OrderCustomerEmailSetMessage extends OrderMessage public const FIELD_OLD_EMAIL = 'oldEmail'; /** + *

    Email address on the Order after the Set Customer Email update action.

    + * + * @return null|string */ public function getEmail(); /** + *

    Email address on the Order before the Set Customer Email update action.

    + * + * @return null|string */ public function getOldEmail(); diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessageBuilder.php index 0f6557dd853..ee144dae6d7 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessageBuilder.php @@ -28,68 +28,81 @@ final class OrderCustomerEmailSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $email; /** + * @var ?string */ private $oldEmail; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -98,6 +111,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -106,6 +122,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -114,6 +133,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -122,8 +144,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -134,6 +157,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -142,6 +166,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -150,8 +178,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -160,6 +189,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -168,6 +200,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -176,6 +211,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Email address on the Order after the Set Customer Email update action.

    + * + * @return null|string */ public function getEmail() @@ -184,6 +222,9 @@ public function getEmail() } /** + *

    Email address on the Order before the Set Customer Email update action.

    + * + * @return null|string */ public function getOldEmail() diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessageModel.php index c9e581616a4..38b12561076 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessageModel.php @@ -28,66 +28,79 @@ final class OrderCustomerEmailSetMessageModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'OrderCustomerEmailSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $email; /** + * * @var ?string */ protected $oldEmail; @@ -108,7 +121,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $email = null, - ?string $oldEmail = null + ?string $oldEmail = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -122,11 +136,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->email = $email; $this->oldEmail = $oldEmail; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -145,6 +160,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -162,6 +180,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -183,6 +204,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -204,7 +228,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -226,6 +251,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -244,6 +270,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -261,7 +291,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -281,6 +312,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -298,6 +332,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -315,6 +352,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -333,6 +373,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Email address on the Order after the Set Customer Email update action.

    + * + * * @return null|string */ public function getEmail() @@ -350,6 +393,9 @@ public function getEmail() } /** + *

    Email address on the Order before the Set Customer Email update action.

    + * + * * @return null|string */ public function getOldEmail() diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessagePayload.php index 1dfc5fbc08b..36ed74582d2 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessagePayload.php @@ -17,11 +17,17 @@ interface OrderCustomerEmailSetMessagePayload extends OrderMessagePayload public const FIELD_OLD_EMAIL = 'oldEmail'; /** + *

    Email address on the Order after the Set Customer Email update action.

    + * + * @return null|string */ public function getEmail(); /** + *

    Email address on the Order before the Set Customer Email update action.

    + * + * @return null|string */ public function getOldEmail(); diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessagePayloadBuilder.php index 577e9e269f2..97a9477bdd6 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessagePayloadBuilder.php @@ -21,16 +21,21 @@ final class OrderCustomerEmailSetMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $email; /** + * @var ?string */ private $oldEmail; /** + *

    Email address on the Order after the Set Customer Email update action.

    + * + * @return null|string */ public function getEmail() @@ -39,6 +44,9 @@ public function getEmail() } /** + *

    Email address on the Order before the Set Customer Email update action.

    + * + * @return null|string */ public function getOldEmail() diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessagePayloadModel.php index a0d8194e623..6f62b396c99 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerEmailSetMessagePayloadModel.php @@ -21,16 +21,19 @@ final class OrderCustomerEmailSetMessagePayloadModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'OrderCustomerEmailSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $email; /** + * * @var ?string */ protected $oldEmail; @@ -41,14 +44,16 @@ final class OrderCustomerEmailSetMessagePayloadModel extends JsonObjectModel imp */ public function __construct( ?string $email = null, - ?string $oldEmail = null + ?string $oldEmail = null, + ?string $type = null ) { $this->email = $email; $this->oldEmail = $oldEmail; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -66,6 +71,9 @@ public function getType() } /** + *

    Email address on the Order after the Set Customer Email update action.

    + * + * * @return null|string */ public function getEmail() @@ -83,6 +91,9 @@ public function getEmail() } /** + *

    Email address on the Order before the Set Customer Email update action.

    + * + * * @return null|string */ public function getOldEmail() diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessage.php index c365f4fdd9d..4bf386a4520 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessage.php @@ -18,15 +18,17 @@ interface OrderCustomerGroupSetMessage extends OrderMessage public const FIELD_OLD_CUSTOMER_GROUP = 'oldCustomerGroup'; /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order after the Set Customer Group update action.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup(); /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order before the Set Customer Group update action.

    * + * @return null|CustomerGroupReference */ public function getOldCustomerGroup(); diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessageBuilder.php index 38841d5066d..bdb14bc5655 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessageBuilder.php @@ -30,68 +30,81 @@ final class OrderCustomerGroupSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $customerGroup; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $oldCustomerGroup; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,8 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order after the Set Customer Group update action.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -188,8 +224,9 @@ public function getCustomerGroup() } /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order before the Set Customer Group update action.

    * + * @return null|CustomerGroupReference */ public function getOldCustomerGroup() diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessageModel.php index 216146cc2d4..e98b44733db 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessageModel.php @@ -30,66 +30,79 @@ final class OrderCustomerGroupSetMessageModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'OrderCustomerGroupSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?CustomerGroupReference */ protected $customerGroup; /** + * * @var ?CustomerGroupReference */ protected $oldCustomerGroup; @@ -110,7 +123,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?CustomerGroupReference $customerGroup = null, - ?CustomerGroupReference $oldCustomerGroup = null + ?CustomerGroupReference $oldCustomerGroup = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +138,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->customerGroup = $customerGroup; $this->oldCustomerGroup = $oldCustomerGroup; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,7 +375,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order after the Set Customer Group update action.

    + * * * @return null|CustomerGroupReference */ @@ -355,7 +396,8 @@ public function getCustomerGroup() } /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order before the Set Customer Group update action.

    + * * * @return null|CustomerGroupReference */ diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessagePayload.php index 060a40192e3..753b6fef6a1 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessagePayload.php @@ -18,15 +18,17 @@ interface OrderCustomerGroupSetMessagePayload extends OrderMessagePayload public const FIELD_OLD_CUSTOMER_GROUP = 'oldCustomerGroup'; /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order after the Set Customer Group update action.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup(); /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order before the Set Customer Group update action.

    * + * @return null|CustomerGroupReference */ public function getOldCustomerGroup(); diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessagePayloadBuilder.php index 901cc9f2303..8464b63b199 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessagePayloadBuilder.php @@ -23,18 +23,21 @@ final class OrderCustomerGroupSetMessagePayloadBuilder implements Builder { /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $customerGroup; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $oldCustomerGroup; /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order after the Set Customer Group update action.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -43,8 +46,9 @@ public function getCustomerGroup() } /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order before the Set Customer Group update action.

    * + * @return null|CustomerGroupReference */ public function getOldCustomerGroup() diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessagePayloadModel.php index 44b62d958ff..f98b0bd6606 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerGroupSetMessagePayloadModel.php @@ -23,16 +23,19 @@ final class OrderCustomerGroupSetMessagePayloadModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'OrderCustomerGroupSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?CustomerGroupReference */ protected $customerGroup; /** + * * @var ?CustomerGroupReference */ protected $oldCustomerGroup; @@ -43,14 +46,16 @@ final class OrderCustomerGroupSetMessagePayloadModel extends JsonObjectModel imp */ public function __construct( ?CustomerGroupReference $customerGroup = null, - ?CustomerGroupReference $oldCustomerGroup = null + ?CustomerGroupReference $oldCustomerGroup = null, + ?string $type = null ) { $this->customerGroup = $customerGroup; $this->oldCustomerGroup = $oldCustomerGroup; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,7 +73,8 @@ public function getType() } /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order after the Set Customer Group update action.

    + * * * @return null|CustomerGroupReference */ @@ -88,7 +94,8 @@ public function getCustomerGroup() } /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order before the Set Customer Group update action.

    + * * * @return null|CustomerGroupReference */ diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessage.php index 3f63f55784e..e0b29ce3231 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessage.php @@ -21,29 +21,33 @@ interface OrderCustomerSetMessage extends OrderMessage public const FIELD_OLD_CUSTOMER_GROUP = 'oldCustomerGroup'; /** - *

    Reference to a Customer.

    + *

    Customer on the Order after the Set Customer Id update action.

    * + * @return null|CustomerReference */ public function getCustomer(); /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order after the Set Customer Id update action.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup(); /** - *

    Reference to a Customer.

    + *

    Customer on the Order before the Set Customer Id update action.

    * + * @return null|CustomerReference */ public function getOldCustomer(); /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order before the Set Customer Id update action.

    * + * @return null|CustomerGroupReference */ public function getOldCustomerGroup(); diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessageBuilder.php index 02bb3977f38..05d4d80e45a 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessageBuilder.php @@ -32,78 +32,93 @@ final class OrderCustomerSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|CustomerReference|CustomerReferenceBuilder */ private $customer; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $customerGroup; /** + * @var null|CustomerReference|CustomerReferenceBuilder */ private $oldCustomer; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $oldCustomerGroup; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -112,6 +127,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -120,6 +138,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -128,6 +149,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -136,8 +160,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -148,6 +173,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -156,6 +182,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -164,8 +194,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -174,6 +205,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -182,6 +216,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -190,8 +227,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a Customer.

    + *

    Customer on the Order after the Set Customer Id update action.

    * + * @return null|CustomerReference */ public function getCustomer() @@ -200,8 +238,9 @@ public function getCustomer() } /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order after the Set Customer Id update action.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -210,8 +249,9 @@ public function getCustomerGroup() } /** - *

    Reference to a Customer.

    + *

    Customer on the Order before the Set Customer Id update action.

    * + * @return null|CustomerReference */ public function getOldCustomer() @@ -220,8 +260,9 @@ public function getOldCustomer() } /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order before the Set Customer Id update action.

    * + * @return null|CustomerGroupReference */ public function getOldCustomerGroup() diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessageModel.php index 829748aab93..ac25c4492ab 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessageModel.php @@ -32,76 +32,91 @@ final class OrderCustomerSetMessageModel extends JsonObjectModel implements Orde { public const DISCRIMINATOR_VALUE = 'OrderCustomerSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?CustomerReference */ protected $customer; /** + * * @var ?CustomerGroupReference */ protected $customerGroup; /** + * * @var ?CustomerReference */ protected $oldCustomer; /** + * * @var ?CustomerGroupReference */ protected $oldCustomerGroup; @@ -124,7 +139,8 @@ public function __construct( ?CustomerReference $customer = null, ?CustomerGroupReference $customerGroup = null, ?CustomerReference $oldCustomer = null, - ?CustomerGroupReference $oldCustomerGroup = null + ?CustomerGroupReference $oldCustomerGroup = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -140,11 +156,12 @@ public function __construct( $this->customerGroup = $customerGroup; $this->oldCustomer = $oldCustomer; $this->oldCustomerGroup = $oldCustomerGroup; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -163,6 +180,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -180,6 +200,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -201,6 +224,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -222,7 +248,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -244,6 +271,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -262,6 +290,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -279,7 +311,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -299,6 +332,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -316,6 +352,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -333,6 +372,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -351,7 +393,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a Customer.

    + *

    Customer on the Order after the Set Customer Id update action.

    + * * * @return null|CustomerReference */ @@ -371,7 +414,8 @@ public function getCustomer() } /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order after the Set Customer Id update action.

    + * * * @return null|CustomerGroupReference */ @@ -391,7 +435,8 @@ public function getCustomerGroup() } /** - *

    Reference to a Customer.

    + *

    Customer on the Order before the Set Customer Id update action.

    + * * * @return null|CustomerReference */ @@ -411,7 +456,8 @@ public function getOldCustomer() } /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order before the Set Customer Id update action.

    + * * * @return null|CustomerGroupReference */ diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayload.php index cec0f284c21..8b18dd11f5f 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayload.php @@ -21,29 +21,33 @@ interface OrderCustomerSetMessagePayload extends OrderMessagePayload public const FIELD_OLD_CUSTOMER_GROUP = 'oldCustomerGroup'; /** - *

    Reference to a Customer.

    + *

    Customer on the Order after the Set Customer Id update action.

    * + * @return null|CustomerReference */ public function getCustomer(); /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order after the Set Customer Id update action.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup(); /** - *

    Reference to a Customer.

    + *

    Customer on the Order before the Set Customer Id update action.

    * + * @return null|CustomerReference */ public function getOldCustomer(); /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order before the Set Customer Id update action.

    * + * @return null|CustomerGroupReference */ public function getOldCustomerGroup(); diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayloadBuilder.php index ad5d8828d04..6655d8cc54d 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayloadBuilder.php @@ -25,28 +25,33 @@ final class OrderCustomerSetMessagePayloadBuilder implements Builder { /** + * @var null|CustomerReference|CustomerReferenceBuilder */ private $customer; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $customerGroup; /** + * @var null|CustomerReference|CustomerReferenceBuilder */ private $oldCustomer; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $oldCustomerGroup; /** - *

    Reference to a Customer.

    + *

    Customer on the Order after the Set Customer Id update action.

    * + * @return null|CustomerReference */ public function getCustomer() @@ -55,8 +60,9 @@ public function getCustomer() } /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order after the Set Customer Id update action.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -65,8 +71,9 @@ public function getCustomerGroup() } /** - *

    Reference to a Customer.

    + *

    Customer on the Order before the Set Customer Id update action.

    * + * @return null|CustomerReference */ public function getOldCustomer() @@ -75,8 +82,9 @@ public function getOldCustomer() } /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order before the Set Customer Id update action.

    * + * @return null|CustomerGroupReference */ public function getOldCustomerGroup() diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayloadModel.php index fbebf07d63b..a478cd4ebe4 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayloadModel.php @@ -25,26 +25,31 @@ final class OrderCustomerSetMessagePayloadModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'OrderCustomerSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?CustomerReference */ protected $customer; /** + * * @var ?CustomerGroupReference */ protected $customerGroup; /** + * * @var ?CustomerReference */ protected $oldCustomer; /** + * * @var ?CustomerGroupReference */ protected $oldCustomerGroup; @@ -57,16 +62,18 @@ public function __construct( ?CustomerReference $customer = null, ?CustomerGroupReference $customerGroup = null, ?CustomerReference $oldCustomer = null, - ?CustomerGroupReference $oldCustomerGroup = null + ?CustomerGroupReference $oldCustomerGroup = null, + ?string $type = null ) { $this->customer = $customer; $this->customerGroup = $customerGroup; $this->oldCustomer = $oldCustomer; $this->oldCustomerGroup = $oldCustomerGroup; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -84,7 +91,8 @@ public function getType() } /** - *

    Reference to a Customer.

    + *

    Customer on the Order after the Set Customer Id update action.

    + * * * @return null|CustomerReference */ @@ -104,7 +112,8 @@ public function getCustomer() } /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order after the Set Customer Id update action.

    + * * * @return null|CustomerGroupReference */ @@ -124,7 +133,8 @@ public function getCustomerGroup() } /** - *

    Reference to a Customer.

    + *

    Customer on the Order before the Set Customer Id update action.

    + * * * @return null|CustomerReference */ @@ -144,7 +154,8 @@ public function getOldCustomer() } /** - *

    Reference to a CustomerGroup.

    + *

    CustomerGroup on the Order before the Set Customer Id update action.

    + * * * @return null|CustomerGroupReference */ diff --git a/lib/commercetools-api/src/Models/Message/OrderDeletedMessage.php b/lib/commercetools-api/src/Models/Message/OrderDeletedMessage.php index f7b36dc7017..4289455ba66 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDeletedMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderDeletedMessage.php @@ -17,6 +17,9 @@ interface OrderDeletedMessage extends OrderMessage public const FIELD_ORDER = 'order'; /** + *

    Order that has been deleted.

    + * + * @return null|Order */ public function getOrder(); diff --git a/lib/commercetools-api/src/Models/Message/OrderDeletedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderDeletedMessageBuilder.php index 354be9166c2..0984b377ffb 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDeletedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderDeletedMessageBuilder.php @@ -30,63 +30,75 @@ final class OrderDeletedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|Order|OrderBuilder */ private $order; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,6 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Order that has been deleted.

    + * + * @return null|Order */ public function getOrder() diff --git a/lib/commercetools-api/src/Models/Message/OrderDeletedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderDeletedMessageModel.php index 5d7052185d0..009fa3d94bc 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDeletedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderDeletedMessageModel.php @@ -30,61 +30,73 @@ final class OrderDeletedMessageModel extends JsonObjectModel implements OrderDel { public const DISCRIMINATOR_VALUE = 'OrderDeleted'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?Order */ protected $order; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?Order $order = null + ?Order $order = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->order = $order; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,6 +367,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Order that has been deleted.

    + * + * * @return null|Order */ public function getOrder() diff --git a/lib/commercetools-api/src/Models/Message/OrderDeletedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderDeletedMessagePayload.php index 69b528fe287..3edb214d355 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDeletedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderDeletedMessagePayload.php @@ -17,6 +17,9 @@ interface OrderDeletedMessagePayload extends OrderMessagePayload public const FIELD_ORDER = 'order'; /** + *

    Order that has been deleted.

    + * + * @return null|Order */ public function getOrder(); diff --git a/lib/commercetools-api/src/Models/Message/OrderDeletedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderDeletedMessagePayloadBuilder.php index cb6f2b36bea..2301fa90a79 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDeletedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderDeletedMessagePayloadBuilder.php @@ -23,11 +23,15 @@ final class OrderDeletedMessagePayloadBuilder implements Builder { /** + * @var null|Order|OrderBuilder */ private $order; /** + *

    Order that has been deleted.

    + * + * @return null|Order */ public function getOrder() diff --git a/lib/commercetools-api/src/Models/Message/OrderDeletedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderDeletedMessagePayloadModel.php index 9cddc77da48..455082ad666 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDeletedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderDeletedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class OrderDeletedMessagePayloadModel extends JsonObjectModel implements O { public const DISCRIMINATOR_VALUE = 'OrderDeleted'; /** + * * @var ?string */ protected $type; /** + * * @var ?Order */ protected $order; @@ -37,13 +39,15 @@ final class OrderDeletedMessagePayloadModel extends JsonObjectModel implements O * @psalm-suppress MissingParamType */ public function __construct( - ?Order $order = null + ?Order $order = null, + ?string $type = null ) { $this->order = $order; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,9 @@ public function getType() } /** + *

    Order that has been deleted.

    + * + * * @return null|Order */ public function getOrder() diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessage.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessage.php index 99c59e3e60a..1329ce8f991 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessage.php @@ -17,8 +17,9 @@ interface OrderDiscountCodeAddedMessage extends OrderMessage public const FIELD_DISCOUNT_CODE = 'discountCode'; /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that was added.

    * + * @return null|DiscountCodeReference */ public function getDiscountCode(); diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessageBuilder.php index b49bc64bb38..b8a80b53d60 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessageBuilder.php @@ -30,63 +30,75 @@ final class OrderDiscountCodeAddedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|DiscountCodeReference|DiscountCodeReferenceBuilder */ private $discountCode; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,8 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that was added.

    * + * @return null|DiscountCodeReference */ public function getDiscountCode() diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessageModel.php index a4ed6ff7372..74659eeaa8f 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessageModel.php @@ -30,61 +30,73 @@ final class OrderDiscountCodeAddedMessageModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'OrderDiscountCodeAdded'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?DiscountCodeReference */ protected $discountCode; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?DiscountCodeReference $discountCode = null + ?DiscountCodeReference $discountCode = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->discountCode = $discountCode; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,7 +367,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that was added.

    + * * * @return null|DiscountCodeReference */ diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessagePayload.php index 57db22a9829..db1c516d272 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessagePayload.php @@ -17,8 +17,9 @@ interface OrderDiscountCodeAddedMessagePayload extends OrderMessagePayload public const FIELD_DISCOUNT_CODE = 'discountCode'; /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that was added.

    * + * @return null|DiscountCodeReference */ public function getDiscountCode(); diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessagePayloadBuilder.php index 50277fa1d04..c6db137a09a 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessagePayloadBuilder.php @@ -23,13 +23,15 @@ final class OrderDiscountCodeAddedMessagePayloadBuilder implements Builder { /** + * @var null|DiscountCodeReference|DiscountCodeReferenceBuilder */ private $discountCode; /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that was added.

    * + * @return null|DiscountCodeReference */ public function getDiscountCode() diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessagePayloadModel.php index dfbb3267e80..cae728be29b 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeAddedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class OrderDiscountCodeAddedMessagePayloadModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'OrderDiscountCodeAdded'; /** + * * @var ?string */ protected $type; /** + * * @var ?DiscountCodeReference */ protected $discountCode; @@ -37,13 +39,15 @@ final class OrderDiscountCodeAddedMessagePayloadModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?DiscountCodeReference $discountCode = null + ?DiscountCodeReference $discountCode = null, + ?string $type = null ) { $this->discountCode = $discountCode; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,7 +65,8 @@ public function getType() } /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that was added.

    + * * * @return null|DiscountCodeReference */ diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessage.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessage.php index 9411ef03587..97aec2a5641 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessage.php @@ -17,8 +17,9 @@ interface OrderDiscountCodeRemovedMessage extends OrderMessage public const FIELD_DISCOUNT_CODE = 'discountCode'; /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that was removed.

    * + * @return null|DiscountCodeReference */ public function getDiscountCode(); diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessageBuilder.php index 4e4a5a864d7..3db8a1014fb 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessageBuilder.php @@ -30,63 +30,75 @@ final class OrderDiscountCodeRemovedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|DiscountCodeReference|DiscountCodeReferenceBuilder */ private $discountCode; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,8 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that was removed.

    * + * @return null|DiscountCodeReference */ public function getDiscountCode() diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessageModel.php index 5cec7bbd200..c8048c6be66 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessageModel.php @@ -30,61 +30,73 @@ final class OrderDiscountCodeRemovedMessageModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'OrderDiscountCodeRemoved'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?DiscountCodeReference */ protected $discountCode; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?DiscountCodeReference $discountCode = null + ?DiscountCodeReference $discountCode = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->discountCode = $discountCode; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,7 +367,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that was removed.

    + * * * @return null|DiscountCodeReference */ diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessagePayload.php index dcb841c7915..0278e3a1235 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessagePayload.php @@ -17,8 +17,9 @@ interface OrderDiscountCodeRemovedMessagePayload extends OrderMessagePayload public const FIELD_DISCOUNT_CODE = 'discountCode'; /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that was removed.

    * + * @return null|DiscountCodeReference */ public function getDiscountCode(); diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessagePayloadBuilder.php index a5d59a2452e..83dca995d9b 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessagePayloadBuilder.php @@ -23,13 +23,15 @@ final class OrderDiscountCodeRemovedMessagePayloadBuilder implements Builder { /** + * @var null|DiscountCodeReference|DiscountCodeReferenceBuilder */ private $discountCode; /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that was removed.

    * + * @return null|DiscountCodeReference */ public function getDiscountCode() diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessagePayloadModel.php index a263cc7bab0..92bb6b2730a 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeRemovedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class OrderDiscountCodeRemovedMessagePayloadModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'OrderDiscountCodeRemoved'; /** + * * @var ?string */ protected $type; /** + * * @var ?DiscountCodeReference */ protected $discountCode; @@ -37,13 +39,15 @@ final class OrderDiscountCodeRemovedMessagePayloadModel extends JsonObjectModel * @psalm-suppress MissingParamType */ public function __construct( - ?DiscountCodeReference $discountCode = null + ?DiscountCodeReference $discountCode = null, + ?string $type = null ) { $this->discountCode = $discountCode; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,7 +65,8 @@ public function getType() } /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that was removed.

    + * * * @return null|DiscountCodeReference */ diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessage.php index 948d1d8f50b..5b4693b87d0 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessage.php @@ -19,18 +19,25 @@ interface OrderDiscountCodeStateSetMessage extends OrderMessage public const FIELD_OLD_STATE = 'oldState'; /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that changed due to the recalculation.

    * + * @return null|DiscountCodeReference */ public function getDiscountCode(); /** + *

    DiscountCodeState after the recalculation.

    + * + * @return null|string */ public function getState(); /** + *

    DiscountCodeState before the recalculation.

    + * + * @return null|string */ public function getOldState(); diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessageBuilder.php index 4af67f2c7d5..d86e0231289 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessageBuilder.php @@ -30,73 +30,87 @@ final class OrderDiscountCodeStateSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|DiscountCodeReference|DiscountCodeReferenceBuilder */ private $discountCode; /** + * @var ?string */ private $state; /** + * @var ?string */ private $oldState; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -105,6 +119,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -113,6 +130,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -121,6 +141,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -129,8 +152,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -141,6 +165,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -149,6 +174,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -157,8 +186,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -167,6 +197,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -175,6 +208,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -183,8 +219,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that changed due to the recalculation.

    * + * @return null|DiscountCodeReference */ public function getDiscountCode() @@ -193,6 +230,9 @@ public function getDiscountCode() } /** + *

    DiscountCodeState after the recalculation.

    + * + * @return null|string */ public function getState() @@ -201,6 +241,9 @@ public function getState() } /** + *

    DiscountCodeState before the recalculation.

    + * + * @return null|string */ public function getOldState() diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessageModel.php index 85d69165bdb..517d8ab8e2b 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessageModel.php @@ -30,71 +30,85 @@ final class OrderDiscountCodeStateSetMessageModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'OrderDiscountCodeStateSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?DiscountCodeReference */ protected $discountCode; /** + * * @var ?string */ protected $state; /** + * * @var ?string */ protected $oldState; @@ -116,7 +130,8 @@ public function __construct( ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?DiscountCodeReference $discountCode = null, ?string $state = null, - ?string $oldState = null + ?string $oldState = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -131,11 +146,12 @@ public function __construct( $this->discountCode = $discountCode; $this->state = $state; $this->oldState = $oldState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -154,6 +170,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -171,6 +190,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -192,6 +214,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -213,7 +238,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -235,6 +261,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -253,6 +280,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -270,7 +301,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -290,6 +322,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -307,6 +342,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -324,6 +362,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -342,7 +383,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that changed due to the recalculation.

    + * * * @return null|DiscountCodeReference */ @@ -362,6 +404,9 @@ public function getDiscountCode() } /** + *

    DiscountCodeState after the recalculation.

    + * + * * @return null|string */ public function getState() @@ -379,6 +424,9 @@ public function getState() } /** + *

    DiscountCodeState before the recalculation.

    + * + * * @return null|string */ public function getOldState() diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessagePayload.php index 42520bfe19f..d47bc49867a 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessagePayload.php @@ -19,18 +19,25 @@ interface OrderDiscountCodeStateSetMessagePayload extends OrderMessagePayload public const FIELD_OLD_STATE = 'oldState'; /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that changed due to the recalculation.

    * + * @return null|DiscountCodeReference */ public function getDiscountCode(); /** + *

    DiscountCodeState after the recalculation.

    + * + * @return null|string */ public function getState(); /** + *

    DiscountCodeState before the recalculation.

    + * + * @return null|string */ public function getOldState(); diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessagePayloadBuilder.php index 0ac6b1845b6..58765aa5d4f 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessagePayloadBuilder.php @@ -23,23 +23,27 @@ final class OrderDiscountCodeStateSetMessagePayloadBuilder implements Builder { /** + * @var null|DiscountCodeReference|DiscountCodeReferenceBuilder */ private $discountCode; /** + * @var ?string */ private $state; /** + * @var ?string */ private $oldState; /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that changed due to the recalculation.

    * + * @return null|DiscountCodeReference */ public function getDiscountCode() @@ -48,6 +52,9 @@ public function getDiscountCode() } /** + *

    DiscountCodeState after the recalculation.

    + * + * @return null|string */ public function getState() @@ -56,6 +63,9 @@ public function getState() } /** + *

    DiscountCodeState before the recalculation.

    + * + * @return null|string */ public function getOldState() diff --git a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessagePayloadModel.php index 6f64ebbc46f..28d77a105fe 100644 --- a/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderDiscountCodeStateSetMessagePayloadModel.php @@ -23,21 +23,25 @@ final class OrderDiscountCodeStateSetMessagePayloadModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'OrderDiscountCodeStateSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?DiscountCodeReference */ protected $discountCode; /** + * * @var ?string */ protected $state; /** + * * @var ?string */ protected $oldState; @@ -49,15 +53,17 @@ final class OrderDiscountCodeStateSetMessagePayloadModel extends JsonObjectModel public function __construct( ?DiscountCodeReference $discountCode = null, ?string $state = null, - ?string $oldState = null + ?string $oldState = null, + ?string $type = null ) { $this->discountCode = $discountCode; $this->state = $state; $this->oldState = $oldState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -75,7 +81,8 @@ public function getType() } /** - *

    Reference to a DiscountCode.

    + *

    DiscountCode that changed due to the recalculation.

    + * * * @return null|DiscountCodeReference */ @@ -95,6 +102,9 @@ public function getDiscountCode() } /** + *

    DiscountCodeState after the recalculation.

    + * + * * @return null|string */ public function getState() @@ -112,6 +122,9 @@ public function getState() } /** + *

    DiscountCodeState before the recalculation.

    + * + * * @return null|string */ public function getOldState() diff --git a/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessage.php b/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessage.php index 2fa43c40069..ef5ca46c910 100644 --- a/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessage.php @@ -8,8 +8,8 @@ namespace Commercetools\Api\Models\Message; +use Commercetools\Api\Models\OrderEdit\OrderEdit; use Commercetools\Api\Models\OrderEdit\OrderEditApplied; -use Commercetools\Api\Models\OrderEdit\OrderEditReference; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -19,21 +19,25 @@ interface OrderEditAppliedMessage extends OrderMessage public const FIELD_RESULT = 'result'; /** - *

    Reference to an OrderEdit.

    + *

    OrderEdit that was applied.

    * - * @return null|OrderEditReference + + * @return null|OrderEdit */ public function getEdit(); /** + *

    Information about a successfully applied OrderEdit.

    + * + * @return null|OrderEditApplied */ public function getResult(); /** - * @param ?OrderEditReference $edit + * @param ?OrderEdit $edit */ - public function setEdit(?OrderEditReference $edit): void; + public function setEdit(?OrderEdit $edit): void; /** * @param ?OrderEditApplied $result diff --git a/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessageBuilder.php index bf05b1ae1d4..6dc1e044640 100644 --- a/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessageBuilder.php @@ -14,10 +14,10 @@ use Commercetools\Api\Models\Common\LastModifiedByBuilder; use Commercetools\Api\Models\Common\Reference; use Commercetools\Api\Models\Common\ReferenceBuilder; +use Commercetools\Api\Models\OrderEdit\OrderEdit; use Commercetools\Api\Models\OrderEdit\OrderEditApplied; use Commercetools\Api\Models\OrderEdit\OrderEditAppliedBuilder; -use Commercetools\Api\Models\OrderEdit\OrderEditReference; -use Commercetools\Api\Models\OrderEdit\OrderEditReferenceBuilder; +use Commercetools\Api\Models\OrderEdit\OrderEditBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -32,68 +32,81 @@ final class OrderEditAppliedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** - * @var null|OrderEditReference|OrderEditReferenceBuilder + + * @var null|OrderEdit|OrderEditBuilder */ private $edit; /** + * @var null|OrderEditApplied|OrderEditAppliedBuilder */ private $result; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -102,6 +115,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -110,6 +126,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -118,6 +137,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -126,8 +148,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -138,6 +161,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -146,6 +170,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -154,8 +182,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -164,6 +193,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -172,6 +204,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -180,16 +215,20 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to an OrderEdit.

    + *

    OrderEdit that was applied.

    * - * @return null|OrderEditReference + + * @return null|OrderEdit */ public function getEdit() { - return $this->edit instanceof OrderEditReferenceBuilder ? $this->edit->build() : $this->edit; + return $this->edit instanceof OrderEditBuilder ? $this->edit->build() : $this->edit; } /** + *

    Information about a successfully applied OrderEdit.

    + * + * @return null|OrderEditApplied */ public function getResult() @@ -308,10 +347,10 @@ public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $re } /** - * @param ?OrderEditReference $edit + * @param ?OrderEdit $edit * @return $this */ - public function withEdit(?OrderEditReference $edit) + public function withEdit(?OrderEdit $edit) { $this->edit = $edit; @@ -377,7 +416,7 @@ public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifi * @deprecated use withEdit() instead * @return $this */ - public function withEditBuilder(?OrderEditReferenceBuilder $edit) + public function withEditBuilder(?OrderEditBuilder $edit) { $this->edit = $edit; @@ -408,7 +447,7 @@ public function build(): OrderEditAppliedMessage $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, - $this->edit instanceof OrderEditReferenceBuilder ? $this->edit->build() : $this->edit, + $this->edit instanceof OrderEditBuilder ? $this->edit->build() : $this->edit, $this->result instanceof OrderEditAppliedBuilder ? $this->result->build() : $this->result ); } diff --git a/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessageModel.php index 6f19f42b13f..f026b483c00 100644 --- a/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessageModel.php @@ -14,10 +14,10 @@ use Commercetools\Api\Models\Common\LastModifiedByModel; use Commercetools\Api\Models\Common\Reference; use Commercetools\Api\Models\Common\ReferenceModel; +use Commercetools\Api\Models\OrderEdit\OrderEdit; use Commercetools\Api\Models\OrderEdit\OrderEditApplied; use Commercetools\Api\Models\OrderEdit\OrderEditAppliedModel; -use Commercetools\Api\Models\OrderEdit\OrderEditReference; -use Commercetools\Api\Models\OrderEdit\OrderEditReferenceModel; +use Commercetools\Api\Models\OrderEdit\OrderEditModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -32,66 +32,79 @@ final class OrderEditAppliedMessageModel extends JsonObjectModel implements Orde { public const DISCRIMINATOR_VALUE = 'OrderEditApplied'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** - * @var ?OrderEditReference + * + * @var ?OrderEdit */ protected $edit; /** + * * @var ?OrderEditApplied */ protected $result; @@ -111,8 +124,9 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?OrderEditReference $edit = null, - ?OrderEditApplied $result = null + ?OrderEdit $edit = null, + ?OrderEditApplied $result = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -126,11 +140,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->edit = $edit; $this->result = $result; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -149,6 +164,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -166,6 +184,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -187,6 +208,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -208,7 +232,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -230,6 +255,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -248,6 +274,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -265,7 +295,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -285,6 +316,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -302,6 +336,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -319,6 +356,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -337,9 +377,10 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to an OrderEdit.

    + *

    OrderEdit that was applied.

    + * * - * @return null|OrderEditReference + * @return null|OrderEdit */ public function getEdit() { @@ -350,13 +391,16 @@ public function getEdit() return null; } - $this->edit = OrderEditReferenceModel::of($data); + $this->edit = OrderEditModel::of($data); } return $this->edit; } /** + *

    Information about a successfully applied OrderEdit.

    + * + * * @return null|OrderEditApplied */ public function getResult() @@ -456,9 +500,9 @@ public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $res } /** - * @param ?OrderEditReference $edit + * @param ?OrderEdit $edit */ - public function setEdit(?OrderEditReference $edit): void + public function setEdit(?OrderEdit $edit): void { $this->edit = $edit; } diff --git a/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessagePayload.php index 133564a4780..0749d75073d 100644 --- a/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessagePayload.php @@ -8,8 +8,8 @@ namespace Commercetools\Api\Models\Message; +use Commercetools\Api\Models\OrderEdit\OrderEdit; use Commercetools\Api\Models\OrderEdit\OrderEditApplied; -use Commercetools\Api\Models\OrderEdit\OrderEditReference; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -19,21 +19,25 @@ interface OrderEditAppliedMessagePayload extends OrderMessagePayload public const FIELD_RESULT = 'result'; /** - *

    Reference to an OrderEdit.

    + *

    OrderEdit that was applied.

    * - * @return null|OrderEditReference + + * @return null|OrderEdit */ public function getEdit(); /** + *

    Information about a successfully applied OrderEdit.

    + * + * @return null|OrderEditApplied */ public function getResult(); /** - * @param ?OrderEditReference $edit + * @param ?OrderEdit $edit */ - public function setEdit(?OrderEditReference $edit): void; + public function setEdit(?OrderEdit $edit): void; /** * @param ?OrderEditApplied $result diff --git a/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessagePayloadBuilder.php index 3e44f0abf99..901d257b539 100644 --- a/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessagePayloadBuilder.php @@ -8,10 +8,10 @@ namespace Commercetools\Api\Models\Message; +use Commercetools\Api\Models\OrderEdit\OrderEdit; use Commercetools\Api\Models\OrderEdit\OrderEditApplied; use Commercetools\Api\Models\OrderEdit\OrderEditAppliedBuilder; -use Commercetools\Api\Models\OrderEdit\OrderEditReference; -use Commercetools\Api\Models\OrderEdit\OrderEditReferenceBuilder; +use Commercetools\Api\Models\OrderEdit\OrderEditBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -25,26 +25,32 @@ final class OrderEditAppliedMessagePayloadBuilder implements Builder { /** - * @var null|OrderEditReference|OrderEditReferenceBuilder + + * @var null|OrderEdit|OrderEditBuilder */ private $edit; /** + * @var null|OrderEditApplied|OrderEditAppliedBuilder */ private $result; /** - *

    Reference to an OrderEdit.

    + *

    OrderEdit that was applied.

    * - * @return null|OrderEditReference + + * @return null|OrderEdit */ public function getEdit() { - return $this->edit instanceof OrderEditReferenceBuilder ? $this->edit->build() : $this->edit; + return $this->edit instanceof OrderEditBuilder ? $this->edit->build() : $this->edit; } /** + *

    Information about a successfully applied OrderEdit.

    + * + * @return null|OrderEditApplied */ public function getResult() @@ -53,10 +59,10 @@ public function getResult() } /** - * @param ?OrderEditReference $edit + * @param ?OrderEdit $edit * @return $this */ - public function withEdit(?OrderEditReference $edit) + public function withEdit(?OrderEdit $edit) { $this->edit = $edit; @@ -78,7 +84,7 @@ public function withResult(?OrderEditApplied $result) * @deprecated use withEdit() instead * @return $this */ - public function withEditBuilder(?OrderEditReferenceBuilder $edit) + public function withEditBuilder(?OrderEditBuilder $edit) { $this->edit = $edit; @@ -99,7 +105,7 @@ public function withResultBuilder(?OrderEditAppliedBuilder $result) public function build(): OrderEditAppliedMessagePayload { return new OrderEditAppliedMessagePayloadModel( - $this->edit instanceof OrderEditReferenceBuilder ? $this->edit->build() : $this->edit, + $this->edit instanceof OrderEditBuilder ? $this->edit->build() : $this->edit, $this->result instanceof OrderEditAppliedBuilder ? $this->result->build() : $this->result ); } diff --git a/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessagePayloadModel.php index 82ebd5161ce..bce8817c2c5 100644 --- a/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderEditAppliedMessagePayloadModel.php @@ -8,10 +8,10 @@ namespace Commercetools\Api\Models\Message; +use Commercetools\Api\Models\OrderEdit\OrderEdit; use Commercetools\Api\Models\OrderEdit\OrderEditApplied; use Commercetools\Api\Models\OrderEdit\OrderEditAppliedModel; -use Commercetools\Api\Models\OrderEdit\OrderEditReference; -use Commercetools\Api\Models\OrderEdit\OrderEditReferenceModel; +use Commercetools\Api\Models\OrderEdit\OrderEditModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -25,16 +25,19 @@ final class OrderEditAppliedMessagePayloadModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'OrderEditApplied'; /** + * * @var ?string */ protected $type; /** - * @var ?OrderEditReference + * + * @var ?OrderEdit */ protected $edit; /** + * * @var ?OrderEditApplied */ protected $result; @@ -44,15 +47,17 @@ final class OrderEditAppliedMessagePayloadModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?OrderEditReference $edit = null, - ?OrderEditApplied $result = null + ?OrderEdit $edit = null, + ?OrderEditApplied $result = null, + ?string $type = null ) { $this->edit = $edit; $this->result = $result; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -70,9 +75,10 @@ public function getType() } /** - *

    Reference to an OrderEdit.

    + *

    OrderEdit that was applied.

    * - * @return null|OrderEditReference + * + * @return null|OrderEdit */ public function getEdit() { @@ -83,13 +89,16 @@ public function getEdit() return null; } - $this->edit = OrderEditReferenceModel::of($data); + $this->edit = OrderEditModel::of($data); } return $this->edit; } /** + *

    Information about a successfully applied OrderEdit.

    + * + * * @return null|OrderEditApplied */ public function getResult() @@ -109,9 +118,9 @@ public function getResult() /** - * @param ?OrderEditReference $edit + * @param ?OrderEdit $edit */ - public function setEdit(?OrderEditReference $edit): void + public function setEdit(?OrderEdit $edit): void { $this->edit = $edit; } diff --git a/lib/commercetools-api/src/Models/Message/OrderImportedMessage.php b/lib/commercetools-api/src/Models/Message/OrderImportedMessage.php index a77bd928b93..0f61e050f2a 100644 --- a/lib/commercetools-api/src/Models/Message/OrderImportedMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderImportedMessage.php @@ -17,6 +17,9 @@ interface OrderImportedMessage extends OrderMessage public const FIELD_ORDER = 'order'; /** + *

    Order that was imported.

    + * + * @return null|Order */ public function getOrder(); diff --git a/lib/commercetools-api/src/Models/Message/OrderImportedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderImportedMessageBuilder.php index 9ffc5ccc8d9..dca7a46b88f 100644 --- a/lib/commercetools-api/src/Models/Message/OrderImportedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderImportedMessageBuilder.php @@ -30,63 +30,75 @@ final class OrderImportedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|Order|OrderBuilder */ private $order; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,6 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Order that was imported.

    + * + * @return null|Order */ public function getOrder() diff --git a/lib/commercetools-api/src/Models/Message/OrderImportedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderImportedMessageModel.php index 9c537551e0c..952f02fba34 100644 --- a/lib/commercetools-api/src/Models/Message/OrderImportedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderImportedMessageModel.php @@ -30,61 +30,73 @@ final class OrderImportedMessageModel extends JsonObjectModel implements OrderIm { public const DISCRIMINATOR_VALUE = 'OrderImported'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?Order */ protected $order; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?Order $order = null + ?Order $order = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->order = $order; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,6 +367,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Order that was imported.

    + * + * * @return null|Order */ public function getOrder() diff --git a/lib/commercetools-api/src/Models/Message/OrderImportedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderImportedMessagePayload.php index 1eb6eb241aa..c7922bfd110 100644 --- a/lib/commercetools-api/src/Models/Message/OrderImportedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderImportedMessagePayload.php @@ -17,6 +17,9 @@ interface OrderImportedMessagePayload extends OrderMessagePayload public const FIELD_ORDER = 'order'; /** + *

    Order that was imported.

    + * + * @return null|Order */ public function getOrder(); diff --git a/lib/commercetools-api/src/Models/Message/OrderImportedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderImportedMessagePayloadBuilder.php index 89f452d81d3..81a680350e5 100644 --- a/lib/commercetools-api/src/Models/Message/OrderImportedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderImportedMessagePayloadBuilder.php @@ -23,11 +23,15 @@ final class OrderImportedMessagePayloadBuilder implements Builder { /** + * @var null|Order|OrderBuilder */ private $order; /** + *

    Order that was imported.

    + * + * @return null|Order */ public function getOrder() diff --git a/lib/commercetools-api/src/Models/Message/OrderImportedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderImportedMessagePayloadModel.php index 41344cd31ed..bb66df78c82 100644 --- a/lib/commercetools-api/src/Models/Message/OrderImportedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderImportedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class OrderImportedMessagePayloadModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'OrderImported'; /** + * * @var ?string */ protected $type; /** + * * @var ?Order */ protected $order; @@ -37,13 +39,15 @@ final class OrderImportedMessagePayloadModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?Order $order = null + ?Order $order = null, + ?string $type = null ) { $this->order = $order; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,9 @@ public function getType() } /** + *

    Order that was imported.

    + * + * * @return null|Order */ public function getOrder() diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessage.php b/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessage.php index 5723cf904dd..1f251f924df 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessage.php @@ -18,11 +18,17 @@ interface OrderLineItemAddedMessage extends OrderMessage public const FIELD_ADDED_QUANTITY = 'addedQuantity'; /** + *

    Line Item that was added to the Order.

    + * + * @return null|LineItem */ public function getLineItem(); /** + *

    Quantity of Line Items that were added to the Order.

    + * + * @return null|int */ public function getAddedQuantity(); diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessageBuilder.php index 9d15b398447..f34adfb573b 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessageBuilder.php @@ -30,68 +30,81 @@ final class OrderLineItemAddedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|LineItem|LineItemBuilder */ private $lineItem; /** + * @var ?int */ private $addedQuantity; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,6 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Line Item that was added to the Order.

    + * + * @return null|LineItem */ public function getLineItem() @@ -186,6 +224,9 @@ public function getLineItem() } /** + *

    Quantity of Line Items that were added to the Order.

    + * + * @return null|int */ public function getAddedQuantity() diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessageModel.php index 7bb92f78449..9eae8a9f6a9 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessageModel.php @@ -30,66 +30,79 @@ final class OrderLineItemAddedMessageModel extends JsonObjectModel implements Or { public const DISCRIMINATOR_VALUE = 'OrderLineItemAdded'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?LineItem */ protected $lineItem; /** + * * @var ?int */ protected $addedQuantity; @@ -110,7 +123,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?LineItem $lineItem = null, - ?int $addedQuantity = null + ?int $addedQuantity = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +138,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->lineItem = $lineItem; $this->addedQuantity = $addedQuantity; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,6 +375,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Line Item that was added to the Order.

    + * + * * @return null|LineItem */ public function getLineItem() @@ -353,6 +396,9 @@ public function getLineItem() } /** + *

    Quantity of Line Items that were added to the Order.

    + * + * * @return null|int */ public function getAddedQuantity() diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessagePayload.php index 64995378f55..492c6fe4402 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessagePayload.php @@ -18,11 +18,17 @@ interface OrderLineItemAddedMessagePayload extends OrderMessagePayload public const FIELD_ADDED_QUANTITY = 'addedQuantity'; /** + *

    Line Item that was added to the Order.

    + * + * @return null|LineItem */ public function getLineItem(); /** + *

    Quantity of Line Items that were added to the Order.

    + * + * @return null|int */ public function getAddedQuantity(); diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessagePayloadBuilder.php index 097a0c5c7db..48039bfc306 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessagePayloadBuilder.php @@ -23,16 +23,21 @@ final class OrderLineItemAddedMessagePayloadBuilder implements Builder { /** + * @var null|LineItem|LineItemBuilder */ private $lineItem; /** + * @var ?int */ private $addedQuantity; /** + *

    Line Item that was added to the Order.

    + * + * @return null|LineItem */ public function getLineItem() @@ -41,6 +46,9 @@ public function getLineItem() } /** + *

    Quantity of Line Items that were added to the Order.

    + * + * @return null|int */ public function getAddedQuantity() diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessagePayloadModel.php index 93cbc9227db..2603704bbe5 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemAddedMessagePayloadModel.php @@ -23,16 +23,19 @@ final class OrderLineItemAddedMessagePayloadModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'OrderLineItemAdded'; /** + * * @var ?string */ protected $type; /** + * * @var ?LineItem */ protected $lineItem; /** + * * @var ?int */ protected $addedQuantity; @@ -43,14 +46,16 @@ final class OrderLineItemAddedMessagePayloadModel extends JsonObjectModel implem */ public function __construct( ?LineItem $lineItem = null, - ?int $addedQuantity = null + ?int $addedQuantity = null, + ?string $type = null ) { $this->lineItem = $lineItem; $this->addedQuantity = $addedQuantity; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,6 +73,9 @@ public function getType() } /** + *

    Line Item that was added to the Order.

    + * + * * @return null|LineItem */ public function getLineItem() @@ -86,6 +94,9 @@ public function getLineItem() } /** + *

    Quantity of Line Items that were added to the Order.

    + * + * * @return null|int */ public function getAddedQuantity() diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessage.php index 216cecdbefe..47296204c1e 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessage.php @@ -9,6 +9,7 @@ namespace Commercetools\Api\Models\Message; use Commercetools\Api\Models\Cart\DiscountedLineItemPriceForQuantityCollection; +use Commercetools\Api\Models\Cart\MethodTaxedPriceCollection; use Commercetools\Api\Models\Cart\TaxedItemPrice; use Commercetools\Api\Models\Common\Money; use Commercetools\Base\DateTimeImmutableCollection; @@ -20,30 +21,48 @@ interface OrderLineItemDiscountSetMessage extends OrderMessage public const FIELD_DISCOUNTED_PRICE_PER_QUANTITY = 'discountedPricePerQuantity'; public const FIELD_TOTAL_PRICE = 'totalPrice'; public const FIELD_TAXED_PRICE = 'taxedPrice'; + public const FIELD_TAXED_PRICE_PORTIONS = 'taxedPricePortions'; /** + *

    Unique identifier for the Line Item.

    + * + * @return null|string */ public function getLineItemId(); /** + *

    Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

    + * + * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity(); /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Total Price of the Line Item after the Discount recalculation.

    * + * @return null|Money */ public function getTotalPrice(); /** + *

    TaxedItemPrice of the Line Item after the Discount recalculation.

    + * + * @return null|TaxedItemPrice */ public function getTaxedPrice(); + /** + *

    Taxed price of the Shipping Methods in a Cart with Multi ShippingMode..

    + * + + * @return null|MethodTaxedPriceCollection + */ + public function getTaxedPricePortions(); + /** * @param ?string $lineItemId */ @@ -63,4 +82,9 @@ public function setTotalPrice(?Money $totalPrice): void; * @param ?TaxedItemPrice $taxedPrice */ public function setTaxedPrice(?TaxedItemPrice $taxedPrice): void; + + /** + * @param ?MethodTaxedPriceCollection $taxedPricePortions + */ + public function setTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions): void; } diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageBuilder.php index a1379b24d9f..a05958143c2 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageBuilder.php @@ -9,6 +9,7 @@ namespace Commercetools\Api\Models\Message; use Commercetools\Api\Models\Cart\DiscountedLineItemPriceForQuantityCollection; +use Commercetools\Api\Models\Cart\MethodTaxedPriceCollection; use Commercetools\Api\Models\Cart\TaxedItemPrice; use Commercetools\Api\Models\Cart\TaxedItemPriceBuilder; use Commercetools\Api\Models\Common\CreatedBy; @@ -33,78 +34,99 @@ final class OrderLineItemDiscountSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $lineItemId; /** + * @var ?DiscountedLineItemPriceForQuantityCollection */ private $discountedPricePerQuantity; /** + * @var null|Money|MoneyBuilder */ private $totalPrice; /** + * @var null|TaxedItemPrice|TaxedItemPriceBuilder */ private $taxedPrice; /** - *

    Unique identifier of the Message.

    + + * @var ?MethodTaxedPriceCollection + */ + private $taxedPricePortions; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -113,6 +135,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -121,6 +146,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -129,6 +157,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -137,8 +168,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -149,6 +181,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -157,6 +190,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -165,8 +202,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -175,6 +213,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -183,6 +224,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -191,6 +235,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier for the Line Item.

    + * + * @return null|string */ public function getLineItemId() @@ -199,6 +246,9 @@ public function getLineItemId() } /** + *

    Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

    + * + * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity() @@ -207,9 +257,9 @@ public function getDiscountedPricePerQuantity() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Total Price of the Line Item after the Discount recalculation.

    * + * @return null|Money */ public function getTotalPrice() @@ -218,6 +268,9 @@ public function getTotalPrice() } /** + *

    TaxedItemPrice of the Line Item after the Discount recalculation.

    + * + * @return null|TaxedItemPrice */ public function getTaxedPrice() @@ -225,6 +278,17 @@ public function getTaxedPrice() return $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice; } + /** + *

    Taxed price of the Shipping Methods in a Cart with Multi ShippingMode..

    + * + + * @return null|MethodTaxedPriceCollection + */ + public function getTaxedPricePortions() + { + return $this->taxedPricePortions; + } + /** * @param ?string $id * @return $this @@ -379,6 +443,17 @@ public function withTaxedPrice(?TaxedItemPrice $taxedPrice) return $this; } + /** + * @param ?MethodTaxedPriceCollection $taxedPricePortions + * @return $this + */ + public function withTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions) + { + $this->taxedPricePortions = $taxedPricePortions; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -461,7 +536,8 @@ public function build(): OrderLineItemDiscountSetMessage $this->lineItemId, $this->discountedPricePerQuantity, $this->totalPrice instanceof MoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, - $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice + $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice, + $this->taxedPricePortions ); } diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageModel.php index 707d4330392..f25694de959 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageModel.php @@ -9,6 +9,7 @@ namespace Commercetools\Api\Models\Message; use Commercetools\Api\Models\Cart\DiscountedLineItemPriceForQuantityCollection; +use Commercetools\Api\Models\Cart\MethodTaxedPriceCollection; use Commercetools\Api\Models\Cart\TaxedItemPrice; use Commercetools\Api\Models\Cart\TaxedItemPriceModel; use Commercetools\Api\Models\Common\CreatedBy; @@ -33,80 +34,101 @@ final class OrderLineItemDiscountSetMessageModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'OrderLineItemDiscountSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?DiscountedLineItemPriceForQuantityCollection */ protected $discountedPricePerQuantity; /** + * * @var ?Money */ protected $totalPrice; /** + * * @var ?TaxedItemPrice */ protected $taxedPrice; + /** + * + * @var ?MethodTaxedPriceCollection + */ + protected $taxedPricePortions; + /** * @psalm-suppress MissingParamType @@ -125,7 +147,9 @@ public function __construct( ?string $lineItemId = null, ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity = null, ?Money $totalPrice = null, - ?TaxedItemPrice $taxedPrice = null + ?TaxedItemPrice $taxedPrice = null, + ?MethodTaxedPriceCollection $taxedPricePortions = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -141,11 +165,13 @@ public function __construct( $this->discountedPricePerQuantity = $discountedPricePerQuantity; $this->totalPrice = $totalPrice; $this->taxedPrice = $taxedPrice; - $this->type = static::DISCRIMINATOR_VALUE; + $this->taxedPricePortions = $taxedPricePortions; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -164,6 +190,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -181,6 +210,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -202,6 +234,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -223,7 +258,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -245,6 +281,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -263,6 +300,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -280,7 +321,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -300,6 +342,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -317,6 +362,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -334,6 +382,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -352,6 +403,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier for the Line Item.

    + * + * * @return null|string */ public function getLineItemId() @@ -369,6 +423,9 @@ public function getLineItemId() } /** + *

    Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

    + * + * * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity() @@ -386,8 +443,8 @@ public function getDiscountedPricePerQuantity() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Total Price of the Line Item after the Discount recalculation.

    + * * * @return null|Money */ @@ -407,6 +464,9 @@ public function getTotalPrice() } /** + *

    TaxedItemPrice of the Line Item after the Discount recalculation.

    + * + * * @return null|TaxedItemPrice */ public function getTaxedPrice() @@ -424,6 +484,26 @@ public function getTaxedPrice() return $this->taxedPrice; } + /** + *

    Taxed price of the Shipping Methods in a Cart with Multi ShippingMode..

    + * + * + * @return null|MethodTaxedPriceCollection + */ + public function getTaxedPricePortions() + { + if (is_null($this->taxedPricePortions)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_TAXED_PRICE_PORTIONS); + if (is_null($data)) { + return null; + } + $this->taxedPricePortions = MethodTaxedPriceCollection::fromArray($data); + } + + return $this->taxedPricePortions; + } + /** * @param ?string $id @@ -537,6 +617,14 @@ public function setTaxedPrice(?TaxedItemPrice $taxedPrice): void $this->taxedPrice = $taxedPrice; } + /** + * @param ?MethodTaxedPriceCollection $taxedPricePortions + */ + public function setTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions): void + { + $this->taxedPricePortions = $taxedPricePortions; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayload.php index b0ae511cd41..3c274f054ac 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayload.php @@ -9,6 +9,7 @@ namespace Commercetools\Api\Models\Message; use Commercetools\Api\Models\Cart\DiscountedLineItemPriceForQuantityCollection; +use Commercetools\Api\Models\Cart\MethodTaxedPriceCollection; use Commercetools\Api\Models\Cart\TaxedItemPrice; use Commercetools\Api\Models\Common\Money; use Commercetools\Base\DateTimeImmutableCollection; @@ -20,30 +21,48 @@ interface OrderLineItemDiscountSetMessagePayload extends OrderMessagePayload public const FIELD_DISCOUNTED_PRICE_PER_QUANTITY = 'discountedPricePerQuantity'; public const FIELD_TOTAL_PRICE = 'totalPrice'; public const FIELD_TAXED_PRICE = 'taxedPrice'; + public const FIELD_TAXED_PRICE_PORTIONS = 'taxedPricePortions'; /** + *

    Unique identifier for the Line Item.

    + * + * @return null|string */ public function getLineItemId(); /** + *

    Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

    + * + * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity(); /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Total Price of the Line Item after the Discount recalculation.

    * + * @return null|Money */ public function getTotalPrice(); /** + *

    TaxedItemPrice of the Line Item after the Discount recalculation.

    + * + * @return null|TaxedItemPrice */ public function getTaxedPrice(); + /** + *

    Taxed price of the Shipping Methods in a Cart with Multi ShippingMode..

    + * + + * @return null|MethodTaxedPriceCollection + */ + public function getTaxedPricePortions(); + /** * @param ?string $lineItemId */ @@ -63,4 +82,9 @@ public function setTotalPrice(?Money $totalPrice): void; * @param ?TaxedItemPrice $taxedPrice */ public function setTaxedPrice(?TaxedItemPrice $taxedPrice): void; + + /** + * @param ?MethodTaxedPriceCollection $taxedPricePortions + */ + public function setTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions): void; } diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadBuilder.php index 937596c7fc4..d15ad282286 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadBuilder.php @@ -9,6 +9,7 @@ namespace Commercetools\Api\Models\Message; use Commercetools\Api\Models\Cart\DiscountedLineItemPriceForQuantityCollection; +use Commercetools\Api\Models\Cart\MethodTaxedPriceCollection; use Commercetools\Api\Models\Cart\TaxedItemPrice; use Commercetools\Api\Models\Cart\TaxedItemPriceBuilder; use Commercetools\Api\Models\Common\Money; @@ -26,26 +27,39 @@ final class OrderLineItemDiscountSetMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?DiscountedLineItemPriceForQuantityCollection */ private $discountedPricePerQuantity; /** + * @var null|Money|MoneyBuilder */ private $totalPrice; /** + * @var null|TaxedItemPrice|TaxedItemPriceBuilder */ private $taxedPrice; /** + + * @var ?MethodTaxedPriceCollection + */ + private $taxedPricePortions; + + /** + *

    Unique identifier for the Line Item.

    + * + * @return null|string */ public function getLineItemId() @@ -54,6 +68,9 @@ public function getLineItemId() } /** + *

    Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

    + * + * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity() @@ -62,9 +79,9 @@ public function getDiscountedPricePerQuantity() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Total Price of the Line Item after the Discount recalculation.

    * + * @return null|Money */ public function getTotalPrice() @@ -73,6 +90,9 @@ public function getTotalPrice() } /** + *

    TaxedItemPrice of the Line Item after the Discount recalculation.

    + * + * @return null|TaxedItemPrice */ public function getTaxedPrice() @@ -80,6 +100,17 @@ public function getTaxedPrice() return $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice; } + /** + *

    Taxed price of the Shipping Methods in a Cart with Multi ShippingMode..

    + * + + * @return null|MethodTaxedPriceCollection + */ + public function getTaxedPricePortions() + { + return $this->taxedPricePortions; + } + /** * @param ?string $lineItemId * @return $this @@ -124,6 +155,17 @@ public function withTaxedPrice(?TaxedItemPrice $taxedPrice) return $this; } + /** + * @param ?MethodTaxedPriceCollection $taxedPricePortions + * @return $this + */ + public function withTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions) + { + $this->taxedPricePortions = $taxedPricePortions; + + return $this; + } + /** * @deprecated use withTotalPrice() instead * @return $this @@ -152,7 +194,8 @@ public function build(): OrderLineItemDiscountSetMessagePayload $this->lineItemId, $this->discountedPricePerQuantity, $this->totalPrice instanceof MoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, - $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice + $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice, + $this->taxedPricePortions ); } diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadModel.php index e5e0b4de4dd..086d38ba734 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadModel.php @@ -9,6 +9,7 @@ namespace Commercetools\Api\Models\Message; use Commercetools\Api\Models\Cart\DiscountedLineItemPriceForQuantityCollection; +use Commercetools\Api\Models\Cart\MethodTaxedPriceCollection; use Commercetools\Api\Models\Cart\TaxedItemPrice; use Commercetools\Api\Models\Cart\TaxedItemPriceModel; use Commercetools\Api\Models\Common\Money; @@ -26,30 +27,41 @@ final class OrderLineItemDiscountSetMessagePayloadModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'OrderLineItemDiscountSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?DiscountedLineItemPriceForQuantityCollection */ protected $discountedPricePerQuantity; /** + * * @var ?Money */ protected $totalPrice; /** + * * @var ?TaxedItemPrice */ protected $taxedPrice; + /** + * + * @var ?MethodTaxedPriceCollection + */ + protected $taxedPricePortions; + /** * @psalm-suppress MissingParamType @@ -58,16 +70,20 @@ public function __construct( ?string $lineItemId = null, ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity = null, ?Money $totalPrice = null, - ?TaxedItemPrice $taxedPrice = null + ?TaxedItemPrice $taxedPrice = null, + ?MethodTaxedPriceCollection $taxedPricePortions = null, + ?string $type = null ) { $this->lineItemId = $lineItemId; $this->discountedPricePerQuantity = $discountedPricePerQuantity; $this->totalPrice = $totalPrice; $this->taxedPrice = $taxedPrice; - $this->type = static::DISCRIMINATOR_VALUE; + $this->taxedPricePortions = $taxedPricePortions; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +101,9 @@ public function getType() } /** + *

    Unique identifier for the Line Item.

    + * + * * @return null|string */ public function getLineItemId() @@ -102,6 +121,9 @@ public function getLineItemId() } /** + *

    Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

    + * + * * @return null|DiscountedLineItemPriceForQuantityCollection */ public function getDiscountedPricePerQuantity() @@ -119,8 +141,8 @@ public function getDiscountedPricePerQuantity() } /** - *

    Draft type that stores amounts in cent precision for the specified currency.

    - *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    + *

    Total Price of the Line Item after the Discount recalculation.

    + * * * @return null|Money */ @@ -140,6 +162,9 @@ public function getTotalPrice() } /** + *

    TaxedItemPrice of the Line Item after the Discount recalculation.

    + * + * * @return null|TaxedItemPrice */ public function getTaxedPrice() @@ -157,6 +182,26 @@ public function getTaxedPrice() return $this->taxedPrice; } + /** + *

    Taxed price of the Shipping Methods in a Cart with Multi ShippingMode..

    + * + * + * @return null|MethodTaxedPriceCollection + */ + public function getTaxedPricePortions() + { + if (is_null($this->taxedPricePortions)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_TAXED_PRICE_PORTIONS); + if (is_null($data)) { + return null; + } + $this->taxedPricePortions = MethodTaxedPriceCollection::fromArray($data); + } + + return $this->taxedPricePortions; + } + /** * @param ?string $lineItemId @@ -189,4 +234,12 @@ public function setTaxedPrice(?TaxedItemPrice $taxedPrice): void { $this->taxedPrice = $taxedPrice; } + + /** + * @param ?MethodTaxedPriceCollection $taxedPricePortions + */ + public function setTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions): void + { + $this->taxedPricePortions = $taxedPricePortions; + } } diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessage.php index b2663111876..720bc36be42 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessage.php @@ -18,13 +18,17 @@ interface OrderLineItemDistributionChannelSetMessage extends OrderMessage public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; /** + *

    Unique identifier of the Line Item.

    + * + * @return null|string */ public function getLineItemId(); /** - *

    Reference to a Channel.

    + *

    Distribution Channel that was set.

    * + * @return null|ChannelReference */ public function getDistributionChannel(); diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessageBuilder.php index 7e1cf1f6c95..27b7a603ca4 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessageBuilder.php @@ -30,68 +30,81 @@ final class OrderLineItemDistributionChannelSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $lineItemId; /** + * @var null|ChannelReference|ChannelReferenceBuilder */ private $distributionChannel; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,6 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Line Item.

    + * + * @return null|string */ public function getLineItemId() @@ -186,8 +224,9 @@ public function getLineItemId() } /** - *

    Reference to a Channel.

    + *

    Distribution Channel that was set.

    * + * @return null|ChannelReference */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessageModel.php index 2277bd7da20..7c5a9d7e6e2 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessageModel.php @@ -30,66 +30,79 @@ final class OrderLineItemDistributionChannelSetMessageModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'OrderLineItemDistributionChannelSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ChannelReference */ protected $distributionChannel; @@ -110,7 +123,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $lineItemId = null, - ?ChannelReference $distributionChannel = null + ?ChannelReference $distributionChannel = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +138,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->lineItemId = $lineItemId; $this->distributionChannel = $distributionChannel; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,6 +375,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Line Item.

    + * + * * @return null|string */ public function getLineItemId() @@ -352,7 +395,8 @@ public function getLineItemId() } /** - *

    Reference to a Channel.

    + *

    Distribution Channel that was set.

    + * * * @return null|ChannelReference */ diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayload.php index 18089332931..a57058174c5 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayload.php @@ -18,13 +18,17 @@ interface OrderLineItemDistributionChannelSetMessagePayload extends OrderMessage public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; /** + *

    Unique identifier of the Line Item.

    + * + * @return null|string */ public function getLineItemId(); /** - *

    Reference to a Channel.

    + *

    Distribution Channel that was set.

    * + * @return null|ChannelReference */ public function getDistributionChannel(); diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayloadBuilder.php index 4768f017855..3ef1d5b8d74 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayloadBuilder.php @@ -23,16 +23,21 @@ final class OrderLineItemDistributionChannelSetMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|ChannelReference|ChannelReferenceBuilder */ private $distributionChannel; /** + *

    Unique identifier of the Line Item.

    + * + * @return null|string */ public function getLineItemId() @@ -41,8 +46,9 @@ public function getLineItemId() } /** - *

    Reference to a Channel.

    + *

    Distribution Channel that was set.

    * + * @return null|ChannelReference */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayloadModel.php index f22d3006642..66732bc9b10 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayloadModel.php @@ -23,16 +23,19 @@ final class OrderLineItemDistributionChannelSetMessagePayloadModel extends JsonO { public const DISCRIMINATOR_VALUE = 'OrderLineItemDistributionChannelSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ChannelReference */ protected $distributionChannel; @@ -43,14 +46,16 @@ final class OrderLineItemDistributionChannelSetMessagePayloadModel extends JsonO */ public function __construct( ?string $lineItemId = null, - ?ChannelReference $distributionChannel = null + ?ChannelReference $distributionChannel = null, + ?string $type = null ) { $this->lineItemId = $lineItemId; $this->distributionChannel = $distributionChannel; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,6 +73,9 @@ public function getType() } /** + *

    Unique identifier of the Line Item.

    + * + * * @return null|string */ public function getLineItemId() @@ -85,7 +93,8 @@ public function getLineItemId() } /** - *

    Reference to a Channel.

    + *

    Distribution Channel that was set.

    + * * * @return null|ChannelReference */ diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessage.php b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessage.php index 9528b3a2035..4955293004e 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessage.php @@ -10,8 +10,8 @@ use Commercetools\Api\Models\Cart\ItemShippingDetails; use Commercetools\Api\Models\Cart\TaxedItemPrice; +use Commercetools\Api\Models\Common\CentPrecisionMoney; use Commercetools\Api\Models\Common\Price; -use Commercetools\Api\Models\Common\TypedMoney; use Commercetools\Api\Models\Order\ItemStateCollection; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -28,43 +28,65 @@ interface OrderLineItemRemovedMessage extends OrderMessage public const FIELD_NEW_SHIPPING_DETAIL = 'newShippingDetail'; /** + *

    Unique identifier of the Line Item.

    + * + * @return null|string */ public function getLineItemId(); /** + *

    Quantity of Line Items that were removed during the Remove Line Item update action.

    + * + * @return null|int */ public function getRemovedQuantity(); /** + *

    Line Item quantity after the Remove Line Item update action.

    + * + * @return null|int */ public function getNewQuantity(); /** + *

    ItemStates after the Remove Line Item update action.

    + * + * @return null|ItemStateCollection */ public function getNewState(); /** - *

    Base polymorphic read-only Money type which is stored in cent precision or high precision. The actual type is determined by the type field.

    + *

    totalPrice of the Order after the Remove Line Item update action.

    * - * @return null|TypedMoney + + * @return null|CentPrecisionMoney */ public function getNewTotalPrice(); /** + *

    TaxedItemPrice of the Order after the Remove Line Item update action.

    + * + * @return null|TaxedItemPrice */ public function getNewTaxedPrice(); /** + *

    Price of the Order after the Remove Line Item update action.

    + * + * @return null|Price */ public function getNewPrice(); /** + *

    Shipping Details of the Order after the Remove Line Item update action.

    + * + * @return null|ItemShippingDetails */ public function getNewShippingDetail(); @@ -90,9 +112,9 @@ public function setNewQuantity(?int $newQuantity): void; public function setNewState(?ItemStateCollection $newState): void; /** - * @param ?TypedMoney $newTotalPrice + * @param ?CentPrecisionMoney $newTotalPrice */ - public function setNewTotalPrice(?TypedMoney $newTotalPrice): void; + public function setNewTotalPrice(?CentPrecisionMoney $newTotalPrice): void; /** * @param ?TaxedItemPrice $newTaxedPrice diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessageBuilder.php index f3ed8d23797..7965fa02b5b 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessageBuilder.php @@ -12,6 +12,8 @@ use Commercetools\Api\Models\Cart\ItemShippingDetailsBuilder; use Commercetools\Api\Models\Cart\TaxedItemPrice; use Commercetools\Api\Models\Cart\TaxedItemPriceBuilder; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyBuilder; use Commercetools\Api\Models\Common\CreatedBy; use Commercetools\Api\Models\Common\CreatedByBuilder; use Commercetools\Api\Models\Common\LastModifiedBy; @@ -20,8 +22,6 @@ use Commercetools\Api\Models\Common\PriceBuilder; use Commercetools\Api\Models\Common\Reference; use Commercetools\Api\Models\Common\ReferenceBuilder; -use Commercetools\Api\Models\Common\TypedMoney; -use Commercetools\Api\Models\Common\TypedMoneyBuilder; use Commercetools\Api\Models\Order\ItemStateCollection; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; @@ -37,98 +37,117 @@ final class OrderLineItemRemovedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $lineItemId; /** + * @var ?int */ private $removedQuantity; /** + * @var ?int */ private $newQuantity; /** + * @var ?ItemStateCollection */ private $newState; /** - * @var null|TypedMoney|TypedMoneyBuilder + + * @var null|CentPrecisionMoney|CentPrecisionMoneyBuilder */ private $newTotalPrice; /** + * @var null|TaxedItemPrice|TaxedItemPriceBuilder */ private $newTaxedPrice; /** + * @var null|Price|PriceBuilder */ private $newPrice; /** + * @var null|ItemShippingDetails|ItemShippingDetailsBuilder */ private $newShippingDetail; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -137,6 +156,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -145,6 +167,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -153,6 +178,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -161,8 +189,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -173,6 +202,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -181,6 +211,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -189,8 +223,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -199,6 +234,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -207,6 +245,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -215,6 +256,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Line Item.

    + * + * @return null|string */ public function getLineItemId() @@ -223,6 +267,9 @@ public function getLineItemId() } /** + *

    Quantity of Line Items that were removed during the Remove Line Item update action.

    + * + * @return null|int */ public function getRemovedQuantity() @@ -231,6 +278,9 @@ public function getRemovedQuantity() } /** + *

    Line Item quantity after the Remove Line Item update action.

    + * + * @return null|int */ public function getNewQuantity() @@ -239,6 +289,9 @@ public function getNewQuantity() } /** + *

    ItemStates after the Remove Line Item update action.

    + * + * @return null|ItemStateCollection */ public function getNewState() @@ -247,16 +300,20 @@ public function getNewState() } /** - *

    Base polymorphic read-only Money type which is stored in cent precision or high precision. The actual type is determined by the type field.

    + *

    totalPrice of the Order after the Remove Line Item update action.

    * - * @return null|TypedMoney + + * @return null|CentPrecisionMoney */ public function getNewTotalPrice() { - return $this->newTotalPrice instanceof TypedMoneyBuilder ? $this->newTotalPrice->build() : $this->newTotalPrice; + return $this->newTotalPrice instanceof CentPrecisionMoneyBuilder ? $this->newTotalPrice->build() : $this->newTotalPrice; } /** + *

    TaxedItemPrice of the Order after the Remove Line Item update action.

    + * + * @return null|TaxedItemPrice */ public function getNewTaxedPrice() @@ -265,6 +322,9 @@ public function getNewTaxedPrice() } /** + *

    Price of the Order after the Remove Line Item update action.

    + * + * @return null|Price */ public function getNewPrice() @@ -273,6 +333,9 @@ public function getNewPrice() } /** + *

    Shipping Details of the Order after the Remove Line Item update action.

    + * + * @return null|ItemShippingDetails */ public function getNewShippingDetail() @@ -435,10 +498,10 @@ public function withNewState(?ItemStateCollection $newState) } /** - * @param ?TypedMoney $newTotalPrice + * @param ?CentPrecisionMoney $newTotalPrice * @return $this */ - public function withNewTotalPrice(?TypedMoney $newTotalPrice) + public function withNewTotalPrice(?CentPrecisionMoney $newTotalPrice) { $this->newTotalPrice = $newTotalPrice; @@ -526,7 +589,7 @@ public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifi * @deprecated use withNewTotalPrice() instead * @return $this */ - public function withNewTotalPriceBuilder(?TypedMoneyBuilder $newTotalPrice) + public function withNewTotalPriceBuilder(?CentPrecisionMoneyBuilder $newTotalPrice) { $this->newTotalPrice = $newTotalPrice; @@ -583,7 +646,7 @@ public function build(): OrderLineItemRemovedMessage $this->removedQuantity, $this->newQuantity, $this->newState, - $this->newTotalPrice instanceof TypedMoneyBuilder ? $this->newTotalPrice->build() : $this->newTotalPrice, + $this->newTotalPrice instanceof CentPrecisionMoneyBuilder ? $this->newTotalPrice->build() : $this->newTotalPrice, $this->newTaxedPrice instanceof TaxedItemPriceBuilder ? $this->newTaxedPrice->build() : $this->newTaxedPrice, $this->newPrice instanceof PriceBuilder ? $this->newPrice->build() : $this->newPrice, $this->newShippingDetail instanceof ItemShippingDetailsBuilder ? $this->newShippingDetail->build() : $this->newShippingDetail diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessageModel.php index e44da05c50d..ee17669f624 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessageModel.php @@ -12,6 +12,8 @@ use Commercetools\Api\Models\Cart\ItemShippingDetailsModel; use Commercetools\Api\Models\Cart\TaxedItemPrice; use Commercetools\Api\Models\Cart\TaxedItemPriceModel; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyModel; use Commercetools\Api\Models\Common\CreatedBy; use Commercetools\Api\Models\Common\CreatedByModel; use Commercetools\Api\Models\Common\LastModifiedBy; @@ -20,8 +22,6 @@ use Commercetools\Api\Models\Common\PriceModel; use Commercetools\Api\Models\Common\Reference; use Commercetools\Api\Models\Common\ReferenceModel; -use Commercetools\Api\Models\Common\TypedMoney; -use Commercetools\Api\Models\Common\TypedMoneyModel; use Commercetools\Api\Models\Order\ItemStateCollection; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -37,96 +37,115 @@ final class OrderLineItemRemovedMessageModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'OrderLineItemRemoved'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?int */ protected $removedQuantity; /** + * * @var ?int */ protected $newQuantity; /** + * * @var ?ItemStateCollection */ protected $newState; /** - * @var ?TypedMoney + * + * @var ?CentPrecisionMoney */ protected $newTotalPrice; /** + * * @var ?TaxedItemPrice */ protected $newTaxedPrice; /** + * * @var ?Price */ protected $newPrice; /** + * * @var ?ItemShippingDetails */ protected $newShippingDetail; @@ -150,10 +169,11 @@ public function __construct( ?int $removedQuantity = null, ?int $newQuantity = null, ?ItemStateCollection $newState = null, - ?TypedMoney $newTotalPrice = null, + ?CentPrecisionMoney $newTotalPrice = null, ?TaxedItemPrice $newTaxedPrice = null, ?Price $newPrice = null, - ?ItemShippingDetails $newShippingDetail = null + ?ItemShippingDetails $newShippingDetail = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -173,11 +193,12 @@ public function __construct( $this->newTaxedPrice = $newTaxedPrice; $this->newPrice = $newPrice; $this->newShippingDetail = $newShippingDetail; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -196,6 +217,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -213,6 +237,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -234,6 +261,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -255,7 +285,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -277,6 +308,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -295,6 +327,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -312,7 +348,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -332,6 +369,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -349,6 +389,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -366,6 +409,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -384,6 +430,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Line Item.

    + * + * * @return null|string */ public function getLineItemId() @@ -401,6 +450,9 @@ public function getLineItemId() } /** + *

    Quantity of Line Items that were removed during the Remove Line Item update action.

    + * + * * @return null|int */ public function getRemovedQuantity() @@ -418,6 +470,9 @@ public function getRemovedQuantity() } /** + *

    Line Item quantity after the Remove Line Item update action.

    + * + * * @return null|int */ public function getNewQuantity() @@ -435,6 +490,9 @@ public function getNewQuantity() } /** + *

    ItemStates after the Remove Line Item update action.

    + * + * * @return null|ItemStateCollection */ public function getNewState() @@ -452,9 +510,10 @@ public function getNewState() } /** - *

    Base polymorphic read-only Money type which is stored in cent precision or high precision. The actual type is determined by the type field.

    + *

    totalPrice of the Order after the Remove Line Item update action.

    + * * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getNewTotalPrice() { @@ -464,14 +523,17 @@ public function getNewTotalPrice() if (is_null($data)) { return null; } - $className = TypedMoneyModel::resolveDiscriminatorClass($data); - $this->newTotalPrice = $className::of($data); + + $this->newTotalPrice = CentPrecisionMoneyModel::of($data); } return $this->newTotalPrice; } /** + *

    TaxedItemPrice of the Order after the Remove Line Item update action.

    + * + * * @return null|TaxedItemPrice */ public function getNewTaxedPrice() @@ -490,6 +552,9 @@ public function getNewTaxedPrice() } /** + *

    Price of the Order after the Remove Line Item update action.

    + * + * * @return null|Price */ public function getNewPrice() @@ -508,6 +573,9 @@ public function getNewPrice() } /** + *

    Shipping Details of the Order after the Remove Line Item update action.

    + * + * * @return null|ItemShippingDetails */ public function getNewShippingDetail() @@ -639,9 +707,9 @@ public function setNewState(?ItemStateCollection $newState): void } /** - * @param ?TypedMoney $newTotalPrice + * @param ?CentPrecisionMoney $newTotalPrice */ - public function setNewTotalPrice(?TypedMoney $newTotalPrice): void + public function setNewTotalPrice(?CentPrecisionMoney $newTotalPrice): void { $this->newTotalPrice = $newTotalPrice; } diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayload.php index 82c997acaaa..6e3feff88b1 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayload.php @@ -10,8 +10,8 @@ use Commercetools\Api\Models\Cart\ItemShippingDetails; use Commercetools\Api\Models\Cart\TaxedItemPrice; +use Commercetools\Api\Models\Common\CentPrecisionMoney; use Commercetools\Api\Models\Common\Price; -use Commercetools\Api\Models\Common\TypedMoney; use Commercetools\Api\Models\Order\ItemStateCollection; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -28,43 +28,65 @@ interface OrderLineItemRemovedMessagePayload extends OrderMessagePayload public const FIELD_NEW_SHIPPING_DETAIL = 'newShippingDetail'; /** + *

    Unique identifier of the Line Item.

    + * + * @return null|string */ public function getLineItemId(); /** + *

    Quantity of Line Items that were removed during the Remove Line Item update action.

    + * + * @return null|int */ public function getRemovedQuantity(); /** + *

    Line Item quantity after the Remove Line Item update action.

    + * + * @return null|int */ public function getNewQuantity(); /** + *

    ItemStates after the Remove Line Item update action.

    + * + * @return null|ItemStateCollection */ public function getNewState(); /** - *

    Base polymorphic read-only Money type which is stored in cent precision or high precision. The actual type is determined by the type field.

    + *

    totalPrice of the Order after the Remove Line Item update action.

    * - * @return null|TypedMoney + + * @return null|CentPrecisionMoney */ public function getNewTotalPrice(); /** + *

    TaxedItemPrice of the Order after the Remove Line Item update action.

    + * + * @return null|TaxedItemPrice */ public function getNewTaxedPrice(); /** + *

    Price of the Order after the Remove Line Item update action.

    + * + * @return null|Price */ public function getNewPrice(); /** + *

    Shipping Details of the Order after the Remove Line Item update action.

    + * + * @return null|ItemShippingDetails */ public function getNewShippingDetail(); @@ -90,9 +112,9 @@ public function setNewQuantity(?int $newQuantity): void; public function setNewState(?ItemStateCollection $newState): void; /** - * @param ?TypedMoney $newTotalPrice + * @param ?CentPrecisionMoney $newTotalPrice */ - public function setNewTotalPrice(?TypedMoney $newTotalPrice): void; + public function setNewTotalPrice(?CentPrecisionMoney $newTotalPrice): void; /** * @param ?TaxedItemPrice $newTaxedPrice diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayloadBuilder.php index f50144664f5..74f68fcb136 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayloadBuilder.php @@ -12,10 +12,10 @@ use Commercetools\Api\Models\Cart\ItemShippingDetailsBuilder; use Commercetools\Api\Models\Cart\TaxedItemPrice; use Commercetools\Api\Models\Cart\TaxedItemPriceBuilder; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyBuilder; use Commercetools\Api\Models\Common\Price; use Commercetools\Api\Models\Common\PriceBuilder; -use Commercetools\Api\Models\Common\TypedMoney; -use Commercetools\Api\Models\Common\TypedMoneyBuilder; use Commercetools\Api\Models\Order\ItemStateCollection; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; @@ -30,46 +30,57 @@ final class OrderLineItemRemovedMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?int */ private $removedQuantity; /** + * @var ?int */ private $newQuantity; /** + * @var ?ItemStateCollection */ private $newState; /** - * @var null|TypedMoney|TypedMoneyBuilder + + * @var null|CentPrecisionMoney|CentPrecisionMoneyBuilder */ private $newTotalPrice; /** + * @var null|TaxedItemPrice|TaxedItemPriceBuilder */ private $newTaxedPrice; /** + * @var null|Price|PriceBuilder */ private $newPrice; /** + * @var null|ItemShippingDetails|ItemShippingDetailsBuilder */ private $newShippingDetail; /** + *

    Unique identifier of the Line Item.

    + * + * @return null|string */ public function getLineItemId() @@ -78,6 +89,9 @@ public function getLineItemId() } /** + *

    Quantity of Line Items that were removed during the Remove Line Item update action.

    + * + * @return null|int */ public function getRemovedQuantity() @@ -86,6 +100,9 @@ public function getRemovedQuantity() } /** + *

    Line Item quantity after the Remove Line Item update action.

    + * + * @return null|int */ public function getNewQuantity() @@ -94,6 +111,9 @@ public function getNewQuantity() } /** + *

    ItemStates after the Remove Line Item update action.

    + * + * @return null|ItemStateCollection */ public function getNewState() @@ -102,16 +122,20 @@ public function getNewState() } /** - *

    Base polymorphic read-only Money type which is stored in cent precision or high precision. The actual type is determined by the type field.

    + *

    totalPrice of the Order after the Remove Line Item update action.

    * - * @return null|TypedMoney + + * @return null|CentPrecisionMoney */ public function getNewTotalPrice() { - return $this->newTotalPrice instanceof TypedMoneyBuilder ? $this->newTotalPrice->build() : $this->newTotalPrice; + return $this->newTotalPrice instanceof CentPrecisionMoneyBuilder ? $this->newTotalPrice->build() : $this->newTotalPrice; } /** + *

    TaxedItemPrice of the Order after the Remove Line Item update action.

    + * + * @return null|TaxedItemPrice */ public function getNewTaxedPrice() @@ -120,6 +144,9 @@ public function getNewTaxedPrice() } /** + *

    Price of the Order after the Remove Line Item update action.

    + * + * @return null|Price */ public function getNewPrice() @@ -128,6 +155,9 @@ public function getNewPrice() } /** + *

    Shipping Details of the Order after the Remove Line Item update action.

    + * + * @return null|ItemShippingDetails */ public function getNewShippingDetail() @@ -180,10 +210,10 @@ public function withNewState(?ItemStateCollection $newState) } /** - * @param ?TypedMoney $newTotalPrice + * @param ?CentPrecisionMoney $newTotalPrice * @return $this */ - public function withNewTotalPrice(?TypedMoney $newTotalPrice) + public function withNewTotalPrice(?CentPrecisionMoney $newTotalPrice) { $this->newTotalPrice = $newTotalPrice; @@ -227,7 +257,7 @@ public function withNewShippingDetail(?ItemShippingDetails $newShippingDetail) * @deprecated use withNewTotalPrice() instead * @return $this */ - public function withNewTotalPriceBuilder(?TypedMoneyBuilder $newTotalPrice) + public function withNewTotalPriceBuilder(?CentPrecisionMoneyBuilder $newTotalPrice) { $this->newTotalPrice = $newTotalPrice; @@ -274,7 +304,7 @@ public function build(): OrderLineItemRemovedMessagePayload $this->removedQuantity, $this->newQuantity, $this->newState, - $this->newTotalPrice instanceof TypedMoneyBuilder ? $this->newTotalPrice->build() : $this->newTotalPrice, + $this->newTotalPrice instanceof CentPrecisionMoneyBuilder ? $this->newTotalPrice->build() : $this->newTotalPrice, $this->newTaxedPrice instanceof TaxedItemPriceBuilder ? $this->newTaxedPrice->build() : $this->newTaxedPrice, $this->newPrice instanceof PriceBuilder ? $this->newPrice->build() : $this->newPrice, $this->newShippingDetail instanceof ItemShippingDetailsBuilder ? $this->newShippingDetail->build() : $this->newShippingDetail diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayloadModel.php index e8411a527e3..b7c11a33856 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayloadModel.php @@ -12,10 +12,10 @@ use Commercetools\Api\Models\Cart\ItemShippingDetailsModel; use Commercetools\Api\Models\Cart\TaxedItemPrice; use Commercetools\Api\Models\Cart\TaxedItemPriceModel; +use Commercetools\Api\Models\Common\CentPrecisionMoney; +use Commercetools\Api\Models\Common\CentPrecisionMoneyModel; use Commercetools\Api\Models\Common\Price; use Commercetools\Api\Models\Common\PriceModel; -use Commercetools\Api\Models\Common\TypedMoney; -use Commercetools\Api\Models\Common\TypedMoneyModel; use Commercetools\Api\Models\Order\ItemStateCollection; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -30,46 +30,55 @@ final class OrderLineItemRemovedMessagePayloadModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'OrderLineItemRemoved'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?int */ protected $removedQuantity; /** + * * @var ?int */ protected $newQuantity; /** + * * @var ?ItemStateCollection */ protected $newState; /** - * @var ?TypedMoney + * + * @var ?CentPrecisionMoney */ protected $newTotalPrice; /** + * * @var ?TaxedItemPrice */ protected $newTaxedPrice; /** + * * @var ?Price */ protected $newPrice; /** + * * @var ?ItemShippingDetails */ protected $newShippingDetail; @@ -83,10 +92,11 @@ public function __construct( ?int $removedQuantity = null, ?int $newQuantity = null, ?ItemStateCollection $newState = null, - ?TypedMoney $newTotalPrice = null, + ?CentPrecisionMoney $newTotalPrice = null, ?TaxedItemPrice $newTaxedPrice = null, ?Price $newPrice = null, - ?ItemShippingDetails $newShippingDetail = null + ?ItemShippingDetails $newShippingDetail = null, + ?string $type = null ) { $this->lineItemId = $lineItemId; $this->removedQuantity = $removedQuantity; @@ -96,10 +106,11 @@ public function __construct( $this->newTaxedPrice = $newTaxedPrice; $this->newPrice = $newPrice; $this->newShippingDetail = $newShippingDetail; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -117,6 +128,9 @@ public function getType() } /** + *

    Unique identifier of the Line Item.

    + * + * * @return null|string */ public function getLineItemId() @@ -134,6 +148,9 @@ public function getLineItemId() } /** + *

    Quantity of Line Items that were removed during the Remove Line Item update action.

    + * + * * @return null|int */ public function getRemovedQuantity() @@ -151,6 +168,9 @@ public function getRemovedQuantity() } /** + *

    Line Item quantity after the Remove Line Item update action.

    + * + * * @return null|int */ public function getNewQuantity() @@ -168,6 +188,9 @@ public function getNewQuantity() } /** + *

    ItemStates after the Remove Line Item update action.

    + * + * * @return null|ItemStateCollection */ public function getNewState() @@ -185,9 +208,10 @@ public function getNewState() } /** - *

    Base polymorphic read-only Money type which is stored in cent precision or high precision. The actual type is determined by the type field.

    + *

    totalPrice of the Order after the Remove Line Item update action.

    + * * - * @return null|TypedMoney + * @return null|CentPrecisionMoney */ public function getNewTotalPrice() { @@ -197,14 +221,17 @@ public function getNewTotalPrice() if (is_null($data)) { return null; } - $className = TypedMoneyModel::resolveDiscriminatorClass($data); - $this->newTotalPrice = $className::of($data); + + $this->newTotalPrice = CentPrecisionMoneyModel::of($data); } return $this->newTotalPrice; } /** + *

    TaxedItemPrice of the Order after the Remove Line Item update action.

    + * + * * @return null|TaxedItemPrice */ public function getNewTaxedPrice() @@ -223,6 +250,9 @@ public function getNewTaxedPrice() } /** + *

    Price of the Order after the Remove Line Item update action.

    + * + * * @return null|Price */ public function getNewPrice() @@ -241,6 +271,9 @@ public function getNewPrice() } /** + *

    Shipping Details of the Order after the Remove Line Item update action.

    + * + * * @return null|ItemShippingDetails */ public function getNewShippingDetail() @@ -292,9 +325,9 @@ public function setNewState(?ItemStateCollection $newState): void } /** - * @param ?TypedMoney $newTotalPrice + * @param ?CentPrecisionMoney $newTotalPrice */ - public function setNewTotalPrice(?TypedMoney $newTotalPrice): void + public function setNewTotalPrice(?CentPrecisionMoney $newTotalPrice): void { $this->newTotalPrice = $newTotalPrice; } diff --git a/lib/commercetools-api/src/Models/Message/OrderMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderMessageBuilder.php index 95502f2f984..a81f7618397 100644 --- a/lib/commercetools-api/src/Models/Message/OrderMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderMessageBuilder.php @@ -28,58 +28,69 @@ final class OrderMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -88,6 +99,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -96,6 +110,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -104,6 +121,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -112,8 +132,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -124,6 +145,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -132,6 +154,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -140,8 +166,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -150,6 +177,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -158,6 +188,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/OrderMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderMessageModel.php index 72e4bc312c0..f51fc61f79b 100644 --- a/lib/commercetools-api/src/Models/Message/OrderMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderMessageModel.php @@ -123,7 +123,7 @@ public function __construct( } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * * * @return null|string @@ -143,6 +143,8 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * * * @return null|int */ @@ -161,6 +163,8 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * * * @return null|DateTimeImmutable */ @@ -183,6 +187,8 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * * * @return null|DateTimeImmutable */ @@ -205,7 +211,7 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * * * @return null|LastModifiedBy @@ -247,6 +253,9 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * * * @return null|int */ @@ -265,7 +274,7 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * * * @return null|Reference @@ -286,6 +295,8 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * * * @return null|int */ @@ -304,6 +315,8 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * * * @return null|string */ @@ -322,6 +335,8 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * * * @return null|UserProvidedIdentifiers */ diff --git a/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessage.php b/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessage.php index f3a43bd2462..af80115dc0b 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessage.php @@ -17,8 +17,9 @@ interface OrderPaymentAddedMessage extends Message public const FIELD_PAYMENT = 'payment'; /** - *

    Reference to a Payment.

    + *

    Payment that was added to the Order.

    * + * @return null|PaymentReference */ public function getPayment(); diff --git a/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessageBuilder.php index aa5d64aac44..fb237a1a511 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessageBuilder.php @@ -30,63 +30,75 @@ final class OrderPaymentAddedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|PaymentReference|PaymentReferenceBuilder */ private $payment; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,8 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a Payment.

    + *

    Payment that was added to the Order.

    * + * @return null|PaymentReference */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessageModel.php index 76fdb7b62ae..3ca3563db84 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessageModel.php @@ -30,61 +30,73 @@ final class OrderPaymentAddedMessageModel extends JsonObjectModel implements Ord { public const DISCRIMINATOR_VALUE = 'OrderPaymentAdded'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?PaymentReference */ protected $payment; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?PaymentReference $payment = null + ?PaymentReference $payment = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->payment = $payment; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,7 +367,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a Payment.

    + *

    Payment that was added to the Order.

    + * * * @return null|PaymentReference */ diff --git a/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessagePayload.php index d5e4a603a92..1df95eea8eb 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessagePayload.php @@ -17,8 +17,9 @@ interface OrderPaymentAddedMessagePayload extends MessagePayload public const FIELD_PAYMENT = 'payment'; /** - *

    Reference to a Payment.

    + *

    Payment that was added to the Order.

    * + * @return null|PaymentReference */ public function getPayment(); diff --git a/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessagePayloadBuilder.php index 49346ef760c..47ba9b0f8c5 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessagePayloadBuilder.php @@ -23,13 +23,15 @@ final class OrderPaymentAddedMessagePayloadBuilder implements Builder { /** + * @var null|PaymentReference|PaymentReferenceBuilder */ private $payment; /** - *

    Reference to a Payment.

    + *

    Payment that was added to the Order.

    * + * @return null|PaymentReference */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessagePayloadModel.php index 90ac7489717..56a00eb57d8 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderPaymentAddedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class OrderPaymentAddedMessagePayloadModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'OrderPaymentAdded'; /** + * * @var ?string */ protected $type; /** + * * @var ?PaymentReference */ protected $payment; @@ -37,13 +39,15 @@ final class OrderPaymentAddedMessagePayloadModel extends JsonObjectModel impleme * @psalm-suppress MissingParamType */ public function __construct( - ?PaymentReference $payment = null + ?PaymentReference $payment = null, + ?string $type = null ) { $this->payment = $payment; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,7 +65,8 @@ public function getType() } /** - *

    Reference to a Payment.

    + *

    Payment that was added to the Order.

    + * * * @return null|PaymentReference */ diff --git a/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessage.php b/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessage.php index 34dcf9ea84e..ff8e9b6e2c4 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessage.php @@ -17,11 +17,17 @@ interface OrderPaymentStateChangedMessage extends OrderMessage public const FIELD_OLD_PAYMENT_STATE = 'oldPaymentState'; /** + *

    PaymentState after the Change Payment State update action.

    + * + * @return null|string */ public function getPaymentState(); /** + *

    PaymentState before the Change Payment State update action.

    + * + * @return null|string */ public function getOldPaymentState(); diff --git a/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessageBuilder.php index bc103f953d0..efec2720eab 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessageBuilder.php @@ -28,68 +28,81 @@ final class OrderPaymentStateChangedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $paymentState; /** + * @var ?string */ private $oldPaymentState; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -98,6 +111,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -106,6 +122,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -114,6 +133,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -122,8 +144,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -134,6 +157,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -142,6 +166,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -150,8 +178,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -160,6 +189,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -168,6 +200,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -176,6 +211,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    PaymentState after the Change Payment State update action.

    + * + * @return null|string */ public function getPaymentState() @@ -184,6 +222,9 @@ public function getPaymentState() } /** + *

    PaymentState before the Change Payment State update action.

    + * + * @return null|string */ public function getOldPaymentState() diff --git a/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessageModel.php index fdf013107d1..77f88c11d76 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessageModel.php @@ -28,66 +28,79 @@ final class OrderPaymentStateChangedMessageModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'OrderPaymentStateChanged'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $paymentState; /** + * * @var ?string */ protected $oldPaymentState; @@ -108,7 +121,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $paymentState = null, - ?string $oldPaymentState = null + ?string $oldPaymentState = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -122,11 +136,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->paymentState = $paymentState; $this->oldPaymentState = $oldPaymentState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -145,6 +160,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -162,6 +180,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -183,6 +204,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -204,7 +228,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -226,6 +251,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -244,6 +270,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -261,7 +291,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -281,6 +312,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -298,6 +332,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -315,6 +352,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -333,6 +373,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    PaymentState after the Change Payment State update action.

    + * + * * @return null|string */ public function getPaymentState() @@ -350,6 +393,9 @@ public function getPaymentState() } /** + *

    PaymentState before the Change Payment State update action.

    + * + * * @return null|string */ public function getOldPaymentState() diff --git a/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessagePayload.php index 3f0501828e9..8534f29cfbc 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessagePayload.php @@ -17,11 +17,17 @@ interface OrderPaymentStateChangedMessagePayload extends OrderMessagePayload public const FIELD_OLD_PAYMENT_STATE = 'oldPaymentState'; /** + *

    PaymentState after the Change Payment State update action.

    + * + * @return null|string */ public function getPaymentState(); /** + *

    PaymentState before the Change Payment State update action.

    + * + * @return null|string */ public function getOldPaymentState(); diff --git a/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessagePayloadBuilder.php index 44d45f22b3d..5d340c13265 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessagePayloadBuilder.php @@ -21,16 +21,21 @@ final class OrderPaymentStateChangedMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $paymentState; /** + * @var ?string */ private $oldPaymentState; /** + *

    PaymentState after the Change Payment State update action.

    + * + * @return null|string */ public function getPaymentState() @@ -39,6 +44,9 @@ public function getPaymentState() } /** + *

    PaymentState before the Change Payment State update action.

    + * + * @return null|string */ public function getOldPaymentState() diff --git a/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessagePayloadModel.php index 73aab239cce..44f6e2acb0f 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderPaymentStateChangedMessagePayloadModel.php @@ -21,16 +21,19 @@ final class OrderPaymentStateChangedMessagePayloadModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'OrderPaymentStateChanged'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $paymentState; /** + * * @var ?string */ protected $oldPaymentState; @@ -41,14 +44,16 @@ final class OrderPaymentStateChangedMessagePayloadModel extends JsonObjectModel */ public function __construct( ?string $paymentState = null, - ?string $oldPaymentState = null + ?string $oldPaymentState = null, + ?string $type = null ) { $this->paymentState = $paymentState; $this->oldPaymentState = $oldPaymentState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -66,6 +71,9 @@ public function getType() } /** + *

    PaymentState after the Change Payment State update action.

    + * + * * @return null|string */ public function getPaymentState() @@ -83,6 +91,9 @@ public function getPaymentState() } /** + *

    PaymentState before the Change Payment State update action.

    + * + * * @return null|string */ public function getOldPaymentState() diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessageCollection.php b/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessageCollection.php deleted file mode 100644 index fcb8aaf5ad5..00000000000 --- a/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessageCollection.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @method OrderReturnInfoAddedMessage current() - * @method OrderReturnInfoAddedMessage end() - * @method OrderReturnInfoAddedMessage at($offset) - */ -class OrderReturnInfoAddedMessageCollection extends OrderMessageCollection -{ - /** - * @psalm-assert OrderReturnInfoAddedMessage $value - * @psalm-param OrderReturnInfoAddedMessage|stdClass $value - * @throws InvalidArgumentException - * - * @return OrderReturnInfoAddedMessageCollection - */ - public function add($value) - { - if (!$value instanceof OrderReturnInfoAddedMessage) { - throw new InvalidArgumentException(); - } - $this->store($value); - - return $this; - } - - /** - * @psalm-return callable(int):?OrderReturnInfoAddedMessage - */ - protected function mapper() - { - return function (?int $index): ?OrderReturnInfoAddedMessage { - $data = $this->get($index); - if ($data instanceof stdClass) { - /** @var OrderReturnInfoAddedMessage $data */ - $data = OrderReturnInfoAddedMessageModel::of($data); - $this->set($data, $index); - } - - return $data; - }; - } -} diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessagePayloadCollection.php deleted file mode 100644 index 5e014363e6d..00000000000 --- a/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessagePayloadCollection.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @method OrderReturnInfoAddedMessagePayload current() - * @method OrderReturnInfoAddedMessagePayload end() - * @method OrderReturnInfoAddedMessagePayload at($offset) - */ -class OrderReturnInfoAddedMessagePayloadCollection extends OrderMessagePayloadCollection -{ - /** - * @psalm-assert OrderReturnInfoAddedMessagePayload $value - * @psalm-param OrderReturnInfoAddedMessagePayload|stdClass $value - * @throws InvalidArgumentException - * - * @return OrderReturnInfoAddedMessagePayloadCollection - */ - public function add($value) - { - if (!$value instanceof OrderReturnInfoAddedMessagePayload) { - throw new InvalidArgumentException(); - } - $this->store($value); - - return $this; - } - - /** - * @psalm-return callable(int):?OrderReturnInfoAddedMessagePayload - */ - protected function mapper() - { - return function (?int $index): ?OrderReturnInfoAddedMessagePayload { - $data = $this->get($index); - if ($data instanceof stdClass) { - /** @var OrderReturnInfoAddedMessagePayload $data */ - $data = OrderReturnInfoAddedMessagePayloadModel::of($data); - $this->set($data, $index); - } - - return $data; - }; - } -} diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessageCollection.php b/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessageCollection.php deleted file mode 100644 index 9b7d3932d32..00000000000 --- a/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessageCollection.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @method OrderReturnInfoSetMessage current() - * @method OrderReturnInfoSetMessage end() - * @method OrderReturnInfoSetMessage at($offset) - */ -class OrderReturnInfoSetMessageCollection extends OrderMessageCollection -{ - /** - * @psalm-assert OrderReturnInfoSetMessage $value - * @psalm-param OrderReturnInfoSetMessage|stdClass $value - * @throws InvalidArgumentException - * - * @return OrderReturnInfoSetMessageCollection - */ - public function add($value) - { - if (!$value instanceof OrderReturnInfoSetMessage) { - throw new InvalidArgumentException(); - } - $this->store($value); - - return $this; - } - - /** - * @psalm-return callable(int):?OrderReturnInfoSetMessage - */ - protected function mapper() - { - return function (?int $index): ?OrderReturnInfoSetMessage { - $data = $this->get($index); - if ($data instanceof stdClass) { - /** @var OrderReturnInfoSetMessage $data */ - $data = OrderReturnInfoSetMessageModel::of($data); - $this->set($data, $index); - } - - return $data; - }; - } -} diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessagePayloadCollection.php deleted file mode 100644 index 5ba17e6219c..00000000000 --- a/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessagePayloadCollection.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @method OrderReturnInfoSetMessagePayload current() - * @method OrderReturnInfoSetMessagePayload end() - * @method OrderReturnInfoSetMessagePayload at($offset) - */ -class OrderReturnInfoSetMessagePayloadCollection extends OrderMessagePayloadCollection -{ - /** - * @psalm-assert OrderReturnInfoSetMessagePayload $value - * @psalm-param OrderReturnInfoSetMessagePayload|stdClass $value - * @throws InvalidArgumentException - * - * @return OrderReturnInfoSetMessagePayloadCollection - */ - public function add($value) - { - if (!$value instanceof OrderReturnInfoSetMessagePayload) { - throw new InvalidArgumentException(); - } - $this->store($value); - - return $this; - } - - /** - * @psalm-return callable(int):?OrderReturnInfoSetMessagePayload - */ - protected function mapper() - { - return function (?int $index): ?OrderReturnInfoSetMessagePayload { - $data = $this->get($index); - if ($data instanceof stdClass) { - /** @var OrderReturnInfoSetMessagePayload $data */ - $data = OrderReturnInfoSetMessagePayloadModel::of($data); - $this->set($data, $index); - } - - return $data; - }; - } -} diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessage.php b/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessage.php index 2a3742da7b7..b11dd8597c3 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessage.php @@ -17,11 +17,17 @@ interface OrderReturnShipmentStateChangedMessage extends OrderMessage public const FIELD_RETURN_SHIPMENT_STATE = 'returnShipmentState'; /** + *

    Unique identifier of the ReturnItem.

    + * + * @return null|string */ public function getReturnItemId(); /** + *

    State of the ReturnItem after the Set Return Shipment State update action.

    + * + * @return null|string */ public function getReturnShipmentState(); diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessageBuilder.php index e41fc0e9058..941836b9e1c 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessageBuilder.php @@ -28,68 +28,81 @@ final class OrderReturnShipmentStateChangedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $returnItemId; /** + * @var ?string */ private $returnShipmentState; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -98,6 +111,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -106,6 +122,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -114,6 +133,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -122,8 +144,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -134,6 +157,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -142,6 +166,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -150,8 +178,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -160,6 +189,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -168,6 +200,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -176,6 +211,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the ReturnItem.

    + * + * @return null|string */ public function getReturnItemId() @@ -184,6 +222,9 @@ public function getReturnItemId() } /** + *

    State of the ReturnItem after the Set Return Shipment State update action.

    + * + * @return null|string */ public function getReturnShipmentState() diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessageModel.php index 477c46a6ec0..38e52d96eed 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessageModel.php @@ -28,66 +28,79 @@ final class OrderReturnShipmentStateChangedMessageModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'OrderReturnShipmentStateChanged'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $returnItemId; /** + * * @var ?string */ protected $returnShipmentState; @@ -108,7 +121,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $returnItemId = null, - ?string $returnShipmentState = null + ?string $returnShipmentState = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -122,11 +136,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->returnItemId = $returnItemId; $this->returnShipmentState = $returnShipmentState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -145,6 +160,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -162,6 +180,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -183,6 +204,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -204,7 +228,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -226,6 +251,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -244,6 +270,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -261,7 +291,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -281,6 +312,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -298,6 +332,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -315,6 +352,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -333,6 +373,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the ReturnItem.

    + * + * * @return null|string */ public function getReturnItemId() @@ -350,6 +393,9 @@ public function getReturnItemId() } /** + *

    State of the ReturnItem after the Set Return Shipment State update action.

    + * + * * @return null|string */ public function getReturnShipmentState() diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessagePayload.php index a2b08966812..338292661e0 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessagePayload.php @@ -17,11 +17,17 @@ interface OrderReturnShipmentStateChangedMessagePayload extends OrderMessagePayl public const FIELD_RETURN_SHIPMENT_STATE = 'returnShipmentState'; /** + *

    Unique identifier of the ReturnItem.

    + * + * @return null|string */ public function getReturnItemId(); /** + *

    State of the ReturnItem after the Set Return Shipment State update action.

    + * + * @return null|string */ public function getReturnShipmentState(); diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessagePayloadBuilder.php index 440358927fc..acf1cd3c0cd 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessagePayloadBuilder.php @@ -21,16 +21,21 @@ final class OrderReturnShipmentStateChangedMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $returnItemId; /** + * @var ?string */ private $returnShipmentState; /** + *

    Unique identifier of the ReturnItem.

    + * + * @return null|string */ public function getReturnItemId() @@ -39,6 +44,9 @@ public function getReturnItemId() } /** + *

    State of the ReturnItem after the Set Return Shipment State update action.

    + * + * @return null|string */ public function getReturnShipmentState() diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessagePayloadModel.php index 20f9842ba72..0370e8bb6f5 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderReturnShipmentStateChangedMessagePayloadModel.php @@ -21,16 +21,19 @@ final class OrderReturnShipmentStateChangedMessagePayloadModel extends JsonObjec { public const DISCRIMINATOR_VALUE = 'OrderReturnShipmentStateChanged'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $returnItemId; /** + * * @var ?string */ protected $returnShipmentState; @@ -41,14 +44,16 @@ final class OrderReturnShipmentStateChangedMessagePayloadModel extends JsonObjec */ public function __construct( ?string $returnItemId = null, - ?string $returnShipmentState = null + ?string $returnShipmentState = null, + ?string $type = null ) { $this->returnItemId = $returnItemId; $this->returnShipmentState = $returnShipmentState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -66,6 +71,9 @@ public function getType() } /** + *

    Unique identifier of the ReturnItem.

    + * + * * @return null|string */ public function getReturnItemId() @@ -83,6 +91,9 @@ public function getReturnItemId() } /** + *

    State of the ReturnItem after the Set Return Shipment State update action.

    + * + * * @return null|string */ public function getReturnShipmentState() diff --git a/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessage.php b/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessage.php index 00e488db890..f64e5e9e6a1 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessage.php @@ -17,11 +17,17 @@ interface OrderShipmentStateChangedMessage extends OrderMessage public const FIELD_OLD_SHIPMENT_STATE = 'oldShipmentState'; /** + *

    ShipmentState after the Change Shipment State update action.

    + * + * @return null|string */ public function getShipmentState(); /** + *

    ShipmentState before the Change Shipment State update action.

    + * + * @return null|string */ public function getOldShipmentState(); diff --git a/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessageBuilder.php index 8206562a240..74c99fda383 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessageBuilder.php @@ -28,68 +28,81 @@ final class OrderShipmentStateChangedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $shipmentState; /** + * @var ?string */ private $oldShipmentState; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -98,6 +111,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -106,6 +122,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -114,6 +133,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -122,8 +144,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -134,6 +157,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -142,6 +166,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -150,8 +178,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -160,6 +189,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -168,6 +200,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -176,6 +211,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    ShipmentState after the Change Shipment State update action.

    + * + * @return null|string */ public function getShipmentState() @@ -184,6 +222,9 @@ public function getShipmentState() } /** + *

    ShipmentState before the Change Shipment State update action.

    + * + * @return null|string */ public function getOldShipmentState() diff --git a/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessageModel.php index a2d65d75e92..581efb0343d 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessageModel.php @@ -28,66 +28,79 @@ final class OrderShipmentStateChangedMessageModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'OrderShipmentStateChanged'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $shipmentState; /** + * * @var ?string */ protected $oldShipmentState; @@ -108,7 +121,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $shipmentState = null, - ?string $oldShipmentState = null + ?string $oldShipmentState = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -122,11 +136,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->shipmentState = $shipmentState; $this->oldShipmentState = $oldShipmentState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -145,6 +160,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -162,6 +180,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -183,6 +204,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -204,7 +228,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -226,6 +251,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -244,6 +270,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -261,7 +291,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -281,6 +312,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -298,6 +332,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -315,6 +352,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -333,6 +373,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    ShipmentState after the Change Shipment State update action.

    + * + * * @return null|string */ public function getShipmentState() @@ -350,6 +393,9 @@ public function getShipmentState() } /** + *

    ShipmentState before the Change Shipment State update action.

    + * + * * @return null|string */ public function getOldShipmentState() diff --git a/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessagePayload.php index 3f4f6fdf228..d270ca55eff 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessagePayload.php @@ -17,11 +17,17 @@ interface OrderShipmentStateChangedMessagePayload extends OrderMessagePayload public const FIELD_OLD_SHIPMENT_STATE = 'oldShipmentState'; /** + *

    ShipmentState after the Change Shipment State update action.

    + * + * @return null|string */ public function getShipmentState(); /** + *

    ShipmentState before the Change Shipment State update action.

    + * + * @return null|string */ public function getOldShipmentState(); diff --git a/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessagePayloadBuilder.php index 0359774a931..66bee22d78a 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessagePayloadBuilder.php @@ -21,16 +21,21 @@ final class OrderShipmentStateChangedMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $shipmentState; /** + * @var ?string */ private $oldShipmentState; /** + *

    ShipmentState after the Change Shipment State update action.

    + * + * @return null|string */ public function getShipmentState() @@ -39,6 +44,9 @@ public function getShipmentState() } /** + *

    ShipmentState before the Change Shipment State update action.

    + * + * @return null|string */ public function getOldShipmentState() diff --git a/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessagePayloadModel.php index c4b16078f15..5e09f2970a5 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderShipmentStateChangedMessagePayloadModel.php @@ -21,16 +21,19 @@ final class OrderShipmentStateChangedMessagePayloadModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'OrderShipmentStateChanged'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $shipmentState; /** + * * @var ?string */ protected $oldShipmentState; @@ -41,14 +44,16 @@ final class OrderShipmentStateChangedMessagePayloadModel extends JsonObjectModel */ public function __construct( ?string $shipmentState = null, - ?string $oldShipmentState = null + ?string $oldShipmentState = null, + ?string $type = null ) { $this->shipmentState = $shipmentState; $this->oldShipmentState = $oldShipmentState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -66,6 +71,9 @@ public function getType() } /** + *

    ShipmentState after the Change Shipment State update action.

    + * + * * @return null|string */ public function getShipmentState() @@ -83,6 +91,9 @@ public function getShipmentState() } /** + *

    ShipmentState before the Change Shipment State update action.

    + * + * * @return null|string */ public function getOldShipmentState() diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessage.php index b285562f711..77de21138be 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessage.php @@ -18,11 +18,17 @@ interface OrderShippingAddressSetMessage extends OrderMessage public const FIELD_OLD_ADDRESS = 'oldAddress'; /** + *

    Shipping address on the Order after the Set Shipping Address update action.

    + * + * @return null|Address */ public function getAddress(); /** + *

    Shipping address on the Order before the Set Shipping Address update action.

    + * + * @return null|Address */ public function getOldAddress(); diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessageBuilder.php index bfeb3a43049..3d86fc4a6f1 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessageBuilder.php @@ -30,68 +30,81 @@ final class OrderShippingAddressSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|Address|AddressBuilder */ private $address; /** + * @var null|Address|AddressBuilder */ private $oldAddress; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,6 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Shipping address on the Order after the Set Shipping Address update action.

    + * + * @return null|Address */ public function getAddress() @@ -186,6 +224,9 @@ public function getAddress() } /** + *

    Shipping address on the Order before the Set Shipping Address update action.

    + * + * @return null|Address */ public function getOldAddress() diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessageModel.php index 7b9eb513b39..9dcf5217aa8 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessageModel.php @@ -30,66 +30,79 @@ final class OrderShippingAddressSetMessageModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'OrderShippingAddressSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?Address */ protected $address; /** + * * @var ?Address */ protected $oldAddress; @@ -110,7 +123,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?Address $address = null, - ?Address $oldAddress = null + ?Address $oldAddress = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +138,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->address = $address; $this->oldAddress = $oldAddress; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,6 +375,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Shipping address on the Order after the Set Shipping Address update action.

    + * + * * @return null|Address */ public function getAddress() @@ -353,6 +396,9 @@ public function getAddress() } /** + *

    Shipping address on the Order before the Set Shipping Address update action.

    + * + * * @return null|Address */ public function getOldAddress() diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessagePayload.php index 75d0762d5dc..f896b40fe5c 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessagePayload.php @@ -18,11 +18,17 @@ interface OrderShippingAddressSetMessagePayload extends OrderMessagePayload public const FIELD_OLD_ADDRESS = 'oldAddress'; /** + *

    Shipping address on the Order after the Set Shipping Address update action.

    + * + * @return null|Address */ public function getAddress(); /** + *

    Shipping address on the Order before the Set Shipping Address update action.

    + * + * @return null|Address */ public function getOldAddress(); diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessagePayloadBuilder.php index 5148a82ff2d..a7a063f0860 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessagePayloadBuilder.php @@ -23,16 +23,21 @@ final class OrderShippingAddressSetMessagePayloadBuilder implements Builder { /** + * @var null|Address|AddressBuilder */ private $address; /** + * @var null|Address|AddressBuilder */ private $oldAddress; /** + *

    Shipping address on the Order after the Set Shipping Address update action.

    + * + * @return null|Address */ public function getAddress() @@ -41,6 +46,9 @@ public function getAddress() } /** + *

    Shipping address on the Order before the Set Shipping Address update action.

    + * + * @return null|Address */ public function getOldAddress() diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessagePayloadModel.php index e709bbb7a68..bcb182a946b 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingAddressSetMessagePayloadModel.php @@ -23,16 +23,19 @@ final class OrderShippingAddressSetMessagePayloadModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'OrderShippingAddressSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?Address */ protected $address; /** + * * @var ?Address */ protected $oldAddress; @@ -43,14 +46,16 @@ final class OrderShippingAddressSetMessagePayloadModel extends JsonObjectModel i */ public function __construct( ?Address $address = null, - ?Address $oldAddress = null + ?Address $oldAddress = null, + ?string $type = null ) { $this->address = $address; $this->oldAddress = $oldAddress; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,6 +73,9 @@ public function getType() } /** + *

    Shipping address on the Order after the Set Shipping Address update action.

    + * + * * @return null|Address */ public function getAddress() @@ -86,6 +94,9 @@ public function getAddress() } /** + *

    Shipping address on the Order before the Set Shipping Address update action.

    + * + * * @return null|Address */ public function getOldAddress() diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessage.php index 974ecbe0c0e..4b5fb276f23 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessage.php @@ -18,11 +18,17 @@ interface OrderShippingInfoSetMessage extends OrderMessage public const FIELD_OLD_SHIPPING_INFO = 'oldShippingInfo'; /** + *

    ShippingInfo after the Set Shipping Method or Set Custom Shipping Method update action.

    + * + * @return null|ShippingInfo */ public function getShippingInfo(); /** + *

    ShippingInfo before the Set Shipping Method or Set Custom Shipping Method update action.

    + * + * @return null|ShippingInfo */ public function getOldShippingInfo(); diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessageBuilder.php index f86028e4da4..3c07e2481ac 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessageBuilder.php @@ -30,68 +30,81 @@ final class OrderShippingInfoSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|ShippingInfo|ShippingInfoBuilder */ private $shippingInfo; /** + * @var null|ShippingInfo|ShippingInfoBuilder */ private $oldShippingInfo; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,6 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    ShippingInfo after the Set Shipping Method or Set Custom Shipping Method update action.

    + * + * @return null|ShippingInfo */ public function getShippingInfo() @@ -186,6 +224,9 @@ public function getShippingInfo() } /** + *

    ShippingInfo before the Set Shipping Method or Set Custom Shipping Method update action.

    + * + * @return null|ShippingInfo */ public function getOldShippingInfo() diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessageModel.php index 03803c638d7..7586173a2e2 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessageModel.php @@ -30,66 +30,79 @@ final class OrderShippingInfoSetMessageModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'OrderShippingInfoSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?ShippingInfo */ protected $shippingInfo; /** + * * @var ?ShippingInfo */ protected $oldShippingInfo; @@ -110,7 +123,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?ShippingInfo $shippingInfo = null, - ?ShippingInfo $oldShippingInfo = null + ?ShippingInfo $oldShippingInfo = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +138,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->shippingInfo = $shippingInfo; $this->oldShippingInfo = $oldShippingInfo; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,6 +375,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    ShippingInfo after the Set Shipping Method or Set Custom Shipping Method update action.

    + * + * * @return null|ShippingInfo */ public function getShippingInfo() @@ -353,6 +396,9 @@ public function getShippingInfo() } /** + *

    ShippingInfo before the Set Shipping Method or Set Custom Shipping Method update action.

    + * + * * @return null|ShippingInfo */ public function getOldShippingInfo() diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessagePayload.php index d8f62060925..7af193238a5 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessagePayload.php @@ -18,11 +18,17 @@ interface OrderShippingInfoSetMessagePayload extends OrderMessagePayload public const FIELD_OLD_SHIPPING_INFO = 'oldShippingInfo'; /** + *

    ShippingInfo after the Set Shipping Method or Set Custom Shipping Method update action.

    + * + * @return null|ShippingInfo */ public function getShippingInfo(); /** + *

    ShippingInfo before the Set Shipping Method or Set Custom Shipping Method update action.

    + * + * @return null|ShippingInfo */ public function getOldShippingInfo(); diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessagePayloadBuilder.php index cef4941f30f..6f7b937c953 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessagePayloadBuilder.php @@ -23,16 +23,21 @@ final class OrderShippingInfoSetMessagePayloadBuilder implements Builder { /** + * @var null|ShippingInfo|ShippingInfoBuilder */ private $shippingInfo; /** + * @var null|ShippingInfo|ShippingInfoBuilder */ private $oldShippingInfo; /** + *

    ShippingInfo after the Set Shipping Method or Set Custom Shipping Method update action.

    + * + * @return null|ShippingInfo */ public function getShippingInfo() @@ -41,6 +46,9 @@ public function getShippingInfo() } /** + *

    ShippingInfo before the Set Shipping Method or Set Custom Shipping Method update action.

    + * + * @return null|ShippingInfo */ public function getOldShippingInfo() diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessagePayloadModel.php index 29d5b2a0c6a..0ff080bdbdc 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingInfoSetMessagePayloadModel.php @@ -23,16 +23,19 @@ final class OrderShippingInfoSetMessagePayloadModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'OrderShippingInfoSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?ShippingInfo */ protected $shippingInfo; /** + * * @var ?ShippingInfo */ protected $oldShippingInfo; @@ -43,14 +46,16 @@ final class OrderShippingInfoSetMessagePayloadModel extends JsonObjectModel impl */ public function __construct( ?ShippingInfo $shippingInfo = null, - ?ShippingInfo $oldShippingInfo = null + ?ShippingInfo $oldShippingInfo = null, + ?string $type = null ) { $this->shippingInfo = $shippingInfo; $this->oldShippingInfo = $oldShippingInfo; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,6 +73,9 @@ public function getType() } /** + *

    ShippingInfo after the Set Shipping Method or Set Custom Shipping Method update action.

    + * + * * @return null|ShippingInfo */ public function getShippingInfo() @@ -86,6 +94,9 @@ public function getShippingInfo() } /** + *

    ShippingInfo before the Set Shipping Method or Set Custom Shipping Method update action.

    + * + * * @return null|ShippingInfo */ public function getOldShippingInfo() diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessage.php index c5cb610e63d..012983d3acc 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessage.php @@ -18,11 +18,17 @@ interface OrderShippingRateInputSetMessage extends OrderMessage public const FIELD_OLD_SHIPPING_RATE_INPUT = 'oldShippingRateInput'; /** + *

    ShippingRateInput after the Set ShippingRateInput update action.

    + * + * @return null|ShippingRateInput */ public function getShippingRateInput(); /** + *

    ShippingRateInput before the Set ShippingRateInput update action.

    + * + * @return null|ShippingRateInput */ public function getOldShippingRateInput(); diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessageBuilder.php index 4b3e5df6408..6aaca487748 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessageBuilder.php @@ -30,68 +30,81 @@ final class OrderShippingRateInputSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|ShippingRateInput|ShippingRateInputBuilder */ private $shippingRateInput; /** + * @var null|ShippingRateInput|ShippingRateInputBuilder */ private $oldShippingRateInput; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,6 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    ShippingRateInput after the Set ShippingRateInput update action.

    + * + * @return null|ShippingRateInput */ public function getShippingRateInput() @@ -186,6 +224,9 @@ public function getShippingRateInput() } /** + *

    ShippingRateInput before the Set ShippingRateInput update action.

    + * + * @return null|ShippingRateInput */ public function getOldShippingRateInput() diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessageModel.php index b53fb3984b2..0fb443e7302 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessageModel.php @@ -30,66 +30,79 @@ final class OrderShippingRateInputSetMessageModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'OrderShippingRateInputSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?ShippingRateInput */ protected $shippingRateInput; /** + * * @var ?ShippingRateInput */ protected $oldShippingRateInput; @@ -110,7 +123,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?ShippingRateInput $shippingRateInput = null, - ?ShippingRateInput $oldShippingRateInput = null + ?ShippingRateInput $oldShippingRateInput = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +138,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->shippingRateInput = $shippingRateInput; $this->oldShippingRateInput = $oldShippingRateInput; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,6 +375,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    ShippingRateInput after the Set ShippingRateInput update action.

    + * + * * @return null|ShippingRateInput */ public function getShippingRateInput() @@ -353,6 +396,9 @@ public function getShippingRateInput() } /** + *

    ShippingRateInput before the Set ShippingRateInput update action.

    + * + * * @return null|ShippingRateInput */ public function getOldShippingRateInput() diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessagePayload.php index 27d586f4d7c..bdb4ee9b4f3 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessagePayload.php @@ -18,11 +18,17 @@ interface OrderShippingRateInputSetMessagePayload extends OrderMessagePayload public const FIELD_OLD_SHIPPING_RATE_INPUT = 'oldShippingRateInput'; /** + *

    ShippingRateInput after the Set ShippingRateInput update action.

    + * + * @return null|ShippingRateInput */ public function getShippingRateInput(); /** + *

    ShippingRateInput before the Set ShippingRateInput update action.

    + * + * @return null|ShippingRateInput */ public function getOldShippingRateInput(); diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessagePayloadBuilder.php index 1e321256077..b60c65d2b43 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessagePayloadBuilder.php @@ -23,16 +23,21 @@ final class OrderShippingRateInputSetMessagePayloadBuilder implements Builder { /** + * @var null|ShippingRateInput|ShippingRateInputBuilder */ private $shippingRateInput; /** + * @var null|ShippingRateInput|ShippingRateInputBuilder */ private $oldShippingRateInput; /** + *

    ShippingRateInput after the Set ShippingRateInput update action.

    + * + * @return null|ShippingRateInput */ public function getShippingRateInput() @@ -41,6 +46,9 @@ public function getShippingRateInput() } /** + *

    ShippingRateInput before the Set ShippingRateInput update action.

    + * + * @return null|ShippingRateInput */ public function getOldShippingRateInput() diff --git a/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessagePayloadModel.php index b25a875b1d2..7ddc1ca6f1e 100644 --- a/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderShippingRateInputSetMessagePayloadModel.php @@ -23,16 +23,19 @@ final class OrderShippingRateInputSetMessagePayloadModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'OrderShippingRateInputSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?ShippingRateInput */ protected $shippingRateInput; /** + * * @var ?ShippingRateInput */ protected $oldShippingRateInput; @@ -43,14 +46,16 @@ final class OrderShippingRateInputSetMessagePayloadModel extends JsonObjectModel */ public function __construct( ?ShippingRateInput $shippingRateInput = null, - ?ShippingRateInput $oldShippingRateInput = null + ?ShippingRateInput $oldShippingRateInput = null, + ?string $type = null ) { $this->shippingRateInput = $shippingRateInput; $this->oldShippingRateInput = $oldShippingRateInput; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,6 +73,9 @@ public function getType() } /** + *

    ShippingRateInput after the Set ShippingRateInput update action.

    + * + * * @return null|ShippingRateInput */ public function getShippingRateInput() @@ -86,6 +94,9 @@ public function getShippingRateInput() } /** + *

    ShippingRateInput before the Set ShippingRateInput update action.

    + * + * * @return null|ShippingRateInput */ public function getOldShippingRateInput() diff --git a/lib/commercetools-api/src/Models/Message/OrderStateChangedMessage.php b/lib/commercetools-api/src/Models/Message/OrderStateChangedMessage.php index a2e88f6eeb6..ed4d4fc1bbd 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStateChangedMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderStateChangedMessage.php @@ -17,11 +17,17 @@ interface OrderStateChangedMessage extends OrderMessage public const FIELD_OLD_ORDER_STATE = 'oldOrderState'; /** + *

    OrderState after the Change Order State update action.

    + * + * @return null|string */ public function getOrderState(); /** + *

    OrderState before the Change Order State update action.

    + * + * @return null|string */ public function getOldOrderState(); diff --git a/lib/commercetools-api/src/Models/Message/OrderStateChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderStateChangedMessageBuilder.php index 5aa45fd0a62..7b74f874dd2 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStateChangedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderStateChangedMessageBuilder.php @@ -28,68 +28,81 @@ final class OrderStateChangedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $orderState; /** + * @var ?string */ private $oldOrderState; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -98,6 +111,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -106,6 +122,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -114,6 +133,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -122,8 +144,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -134,6 +157,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -142,6 +166,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -150,8 +178,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -160,6 +189,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -168,6 +200,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -176,6 +211,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    OrderState after the Change Order State update action.

    + * + * @return null|string */ public function getOrderState() @@ -184,6 +222,9 @@ public function getOrderState() } /** + *

    OrderState before the Change Order State update action.

    + * + * @return null|string */ public function getOldOrderState() diff --git a/lib/commercetools-api/src/Models/Message/OrderStateChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderStateChangedMessageModel.php index abfbd20b527..f6ab7b89495 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStateChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderStateChangedMessageModel.php @@ -28,66 +28,79 @@ final class OrderStateChangedMessageModel extends JsonObjectModel implements Ord { public const DISCRIMINATOR_VALUE = 'OrderStateChanged'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $orderState; /** + * * @var ?string */ protected $oldOrderState; @@ -108,7 +121,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $orderState = null, - ?string $oldOrderState = null + ?string $oldOrderState = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -122,11 +136,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->orderState = $orderState; $this->oldOrderState = $oldOrderState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -145,6 +160,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -162,6 +180,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -183,6 +204,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -204,7 +228,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -226,6 +251,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -244,6 +270,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -261,7 +291,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -281,6 +312,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -298,6 +332,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -315,6 +352,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -333,6 +373,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    OrderState after the Change Order State update action.

    + * + * * @return null|string */ public function getOrderState() @@ -350,6 +393,9 @@ public function getOrderState() } /** + *

    OrderState before the Change Order State update action.

    + * + * * @return null|string */ public function getOldOrderState() diff --git a/lib/commercetools-api/src/Models/Message/OrderStateChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderStateChangedMessagePayload.php index a862bc71c9c..1df6217ca46 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStateChangedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderStateChangedMessagePayload.php @@ -17,11 +17,17 @@ interface OrderStateChangedMessagePayload extends OrderMessagePayload public const FIELD_OLD_ORDER_STATE = 'oldOrderState'; /** + *

    OrderState after the Change Order State update action.

    + * + * @return null|string */ public function getOrderState(); /** + *

    OrderState before the Change Order State update action.

    + * + * @return null|string */ public function getOldOrderState(); diff --git a/lib/commercetools-api/src/Models/Message/OrderStateChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderStateChangedMessagePayloadBuilder.php index acb9a669b83..b8e442e9065 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStateChangedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderStateChangedMessagePayloadBuilder.php @@ -21,16 +21,21 @@ final class OrderStateChangedMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $orderState; /** + * @var ?string */ private $oldOrderState; /** + *

    OrderState after the Change Order State update action.

    + * + * @return null|string */ public function getOrderState() @@ -39,6 +44,9 @@ public function getOrderState() } /** + *

    OrderState before the Change Order State update action.

    + * + * @return null|string */ public function getOldOrderState() diff --git a/lib/commercetools-api/src/Models/Message/OrderStateChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderStateChangedMessagePayloadModel.php index 33a31452453..eebac004fe5 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStateChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderStateChangedMessagePayloadModel.php @@ -21,16 +21,19 @@ final class OrderStateChangedMessagePayloadModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'OrderStateChanged'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $orderState; /** + * * @var ?string */ protected $oldOrderState; @@ -41,14 +44,16 @@ final class OrderStateChangedMessagePayloadModel extends JsonObjectModel impleme */ public function __construct( ?string $orderState = null, - ?string $oldOrderState = null + ?string $oldOrderState = null, + ?string $type = null ) { $this->orderState = $orderState; $this->oldOrderState = $oldOrderState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -66,6 +71,9 @@ public function getType() } /** + *

    OrderState after the Change Order State update action.

    + * + * * @return null|string */ public function getOrderState() @@ -83,6 +91,9 @@ public function getOrderState() } /** + *

    OrderState before the Change Order State update action.

    + * + * * @return null|string */ public function getOldOrderState() diff --git a/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessage.php b/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessage.php index 6559d6ffcd8..d0658e08ab6 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessage.php @@ -19,20 +19,25 @@ interface OrderStateTransitionMessage extends OrderMessage public const FIELD_FORCE = 'force'; /** - *

    Reference to a State.

    + *

    OrderState after the Transition State update action.

    * + * @return null|StateReference */ public function getState(); /** - *

    Reference to a State.

    + *

    OrderState before the Transition State update action.

    * + * @return null|StateReference */ public function getOldState(); /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * @return null|bool */ public function getForce(); diff --git a/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessageBuilder.php index de1a773a371..b2fa0a46e92 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessageBuilder.php @@ -30,73 +30,87 @@ final class OrderStateTransitionMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|StateReference|StateReferenceBuilder */ private $state; /** + * @var null|StateReference|StateReferenceBuilder */ private $oldState; /** + * @var ?bool */ private $force; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -105,6 +119,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -113,6 +130,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -121,6 +141,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -129,8 +152,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -141,6 +165,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -149,6 +174,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -157,8 +186,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -167,6 +197,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -175,6 +208,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -183,8 +219,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a State.

    + *

    OrderState after the Transition State update action.

    * + * @return null|StateReference */ public function getState() @@ -193,8 +230,9 @@ public function getState() } /** - *

    Reference to a State.

    + *

    OrderState before the Transition State update action.

    * + * @return null|StateReference */ public function getOldState() @@ -203,6 +241,9 @@ public function getOldState() } /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessageModel.php index 1c19c70b779..295c60e315d 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessageModel.php @@ -30,71 +30,85 @@ final class OrderStateTransitionMessageModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'OrderStateTransition'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?StateReference */ protected $state; /** + * * @var ?StateReference */ protected $oldState; /** + * * @var ?bool */ protected $force; @@ -116,7 +130,8 @@ public function __construct( ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?StateReference $state = null, ?StateReference $oldState = null, - ?bool $force = null + ?bool $force = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -131,11 +146,12 @@ public function __construct( $this->state = $state; $this->oldState = $oldState; $this->force = $force; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -154,6 +170,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -171,6 +190,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -192,6 +214,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -213,7 +238,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -235,6 +261,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -253,6 +280,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -270,7 +301,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -290,6 +322,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -307,6 +342,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -324,6 +362,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -342,7 +383,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a State.

    + *

    OrderState after the Transition State update action.

    + * * * @return null|StateReference */ @@ -362,7 +404,8 @@ public function getState() } /** - *

    Reference to a State.

    + *

    OrderState before the Transition State update action.

    + * * * @return null|StateReference */ @@ -382,6 +425,9 @@ public function getOldState() } /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessagePayload.php index 98a3e589c26..f1b506947b9 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessagePayload.php @@ -19,20 +19,25 @@ interface OrderStateTransitionMessagePayload extends OrderMessagePayload public const FIELD_FORCE = 'force'; /** - *

    Reference to a State.

    + *

    OrderState after the Transition State update action.

    * + * @return null|StateReference */ public function getState(); /** - *

    Reference to a State.

    + *

    OrderState before the Transition State update action.

    * + * @return null|StateReference */ public function getOldState(); /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * @return null|bool */ public function getForce(); diff --git a/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessagePayloadBuilder.php index 502e7e28070..b4761e77ab2 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessagePayloadBuilder.php @@ -23,23 +23,27 @@ final class OrderStateTransitionMessagePayloadBuilder implements Builder { /** + * @var null|StateReference|StateReferenceBuilder */ private $state; /** + * @var null|StateReference|StateReferenceBuilder */ private $oldState; /** + * @var ?bool */ private $force; /** - *

    Reference to a State.

    + *

    OrderState after the Transition State update action.

    * + * @return null|StateReference */ public function getState() @@ -48,8 +52,9 @@ public function getState() } /** - *

    Reference to a State.

    + *

    OrderState before the Transition State update action.

    * + * @return null|StateReference */ public function getOldState() @@ -58,6 +63,9 @@ public function getOldState() } /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessagePayloadModel.php index 180cef44c04..7ef52c0ff77 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderStateTransitionMessagePayloadModel.php @@ -23,21 +23,25 @@ final class OrderStateTransitionMessagePayloadModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'OrderStateTransition'; /** + * * @var ?string */ protected $type; /** + * * @var ?StateReference */ protected $state; /** + * * @var ?StateReference */ protected $oldState; /** + * * @var ?bool */ protected $force; @@ -49,15 +53,17 @@ final class OrderStateTransitionMessagePayloadModel extends JsonObjectModel impl public function __construct( ?StateReference $state = null, ?StateReference $oldState = null, - ?bool $force = null + ?bool $force = null, + ?string $type = null ) { $this->state = $state; $this->oldState = $oldState; $this->force = $force; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -75,7 +81,8 @@ public function getType() } /** - *

    Reference to a State.

    + *

    OrderState after the Transition State update action.

    + * * * @return null|StateReference */ @@ -95,7 +102,8 @@ public function getState() } /** - *

    Reference to a State.

    + *

    OrderState before the Transition State update action.

    + * * * @return null|StateReference */ @@ -115,6 +123,9 @@ public function getOldState() } /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Message/OrderStoreSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderStoreSetMessage.php index d274be1d3c2..435fd776128 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStoreSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderStoreSetMessage.php @@ -17,8 +17,9 @@ interface OrderStoreSetMessage extends OrderMessage public const FIELD_STORE = 'store'; /** - *

    Reference to a Store by its key.

    + *

    Store that was set.

    * + * @return null|StoreKeyReference */ public function getStore(); diff --git a/lib/commercetools-api/src/Models/Message/OrderStoreSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderStoreSetMessageBuilder.php index 08f6f121d65..c0089838abe 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStoreSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderStoreSetMessageBuilder.php @@ -30,63 +30,75 @@ final class OrderStoreSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|StoreKeyReference|StoreKeyReferenceBuilder */ private $store; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,8 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a Store by its key.

    + *

    Store that was set.

    * + * @return null|StoreKeyReference */ public function getStore() diff --git a/lib/commercetools-api/src/Models/Message/OrderStoreSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderStoreSetMessageModel.php index 815c4a53c9a..29d706f5dba 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStoreSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderStoreSetMessageModel.php @@ -30,61 +30,73 @@ final class OrderStoreSetMessageModel extends JsonObjectModel implements OrderSt { public const DISCRIMINATOR_VALUE = 'OrderStoreSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?StoreKeyReference */ protected $store; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?StoreKeyReference $store = null + ?StoreKeyReference $store = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->store = $store; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,7 +367,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a Store by its key.

    + *

    Store that was set.

    + * * * @return null|StoreKeyReference */ diff --git a/lib/commercetools-api/src/Models/Message/OrderStoreSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderStoreSetMessagePayload.php index 484a398732b..1e8ab874db9 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStoreSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderStoreSetMessagePayload.php @@ -17,8 +17,9 @@ interface OrderStoreSetMessagePayload extends OrderMessagePayload public const FIELD_STORE = 'store'; /** - *

    Reference to a Store by its key.

    + *

    Store that was set.

    * + * @return null|StoreKeyReference */ public function getStore(); diff --git a/lib/commercetools-api/src/Models/Message/OrderStoreSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderStoreSetMessagePayloadBuilder.php index 127cfa5da32..98ec639602b 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStoreSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderStoreSetMessagePayloadBuilder.php @@ -23,13 +23,15 @@ final class OrderStoreSetMessagePayloadBuilder implements Builder { /** + * @var null|StoreKeyReference|StoreKeyReferenceBuilder */ private $store; /** - *

    Reference to a Store by its key.

    + *

    Store that was set.

    * + * @return null|StoreKeyReference */ public function getStore() diff --git a/lib/commercetools-api/src/Models/Message/OrderStoreSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderStoreSetMessagePayloadModel.php index bf389332cef..0bd2d7e850d 100644 --- a/lib/commercetools-api/src/Models/Message/OrderStoreSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderStoreSetMessagePayloadModel.php @@ -23,11 +23,13 @@ final class OrderStoreSetMessagePayloadModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'OrderStoreSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?StoreKeyReference */ protected $store; @@ -37,13 +39,15 @@ final class OrderStoreSetMessagePayloadModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?StoreKeyReference $store = null + ?StoreKeyReference $store = null, + ?string $type = null ) { $this->store = $store; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,7 +65,8 @@ public function getType() } /** - *

    Reference to a Store by its key.

    + *

    Store that was set.

    + * * * @return null|StoreKeyReference */ diff --git a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessage.php b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessage.php index 3aecdf197fe..b909a0755ff 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessage.php +++ b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessage.php @@ -17,17 +17,32 @@ interface ParcelAddedToDeliveryMessage extends OrderMessage { public const FIELD_DELIVERY = 'delivery'; public const FIELD_PARCEL = 'parcel'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    Unique identifier of the Delivery.

    + * + * @return null|Delivery */ public function getDelivery(); /** + *

    Parcel that was added to the Delivery.

    + * + * @return null|Parcel */ public function getParcel(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?Delivery $delivery */ @@ -37,4 +52,9 @@ public function setDelivery(?Delivery $delivery): void; * @param ?Parcel $parcel */ public function setParcel(?Parcel $parcel): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessageBuilder.php index 1c6a5ba120b..05e4b89bff0 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessageBuilder.php @@ -32,68 +32,87 @@ final class ParcelAddedToDeliveryMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|Delivery|DeliveryBuilder */ private $delivery; /** + * @var null|Parcel|ParcelBuilder */ private $parcel; /** - *

    Unique identifier of the Message.

    + + * @var ?string + */ + private $shippingKey; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -102,6 +121,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -110,6 +132,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -118,6 +143,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -126,8 +154,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -138,6 +167,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -146,6 +176,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -154,8 +188,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -164,6 +199,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -172,6 +210,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -180,6 +221,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Delivery.

    + * + * @return null|Delivery */ public function getDelivery() @@ -188,6 +232,9 @@ public function getDelivery() } /** + *

    Parcel that was added to the Delivery.

    + * + * @return null|Parcel */ public function getParcel() @@ -195,6 +242,17 @@ public function getParcel() return $this->parcel instanceof ParcelBuilder ? $this->parcel->build() : $this->parcel; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $id * @return $this @@ -327,6 +385,17 @@ public function withParcel(?Parcel $parcel) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -407,7 +476,8 @@ public function build(): ParcelAddedToDeliveryMessage $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, $this->delivery instanceof DeliveryBuilder ? $this->delivery->build() : $this->delivery, - $this->parcel instanceof ParcelBuilder ? $this->parcel->build() : $this->parcel + $this->parcel instanceof ParcelBuilder ? $this->parcel->build() : $this->parcel, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessageModel.php b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessageModel.php index cbbda2b4d01..5e53d28d67b 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessageModel.php @@ -32,70 +32,89 @@ final class ParcelAddedToDeliveryMessageModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'ParcelAddedToDelivery'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?Delivery */ protected $delivery; /** + * * @var ?Parcel */ protected $parcel; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -112,7 +131,9 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?Delivery $delivery = null, - ?Parcel $parcel = null + ?Parcel $parcel = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -126,11 +147,13 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->delivery = $delivery; $this->parcel = $parcel; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -149,6 +172,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -166,6 +192,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -187,6 +216,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -208,7 +240,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -230,6 +263,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -248,6 +282,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -265,7 +303,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -285,6 +324,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -302,6 +344,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -319,6 +364,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -337,6 +385,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Delivery.

    + * + * * @return null|Delivery */ public function getDelivery() @@ -355,6 +406,9 @@ public function getDelivery() } /** + *

    Parcel that was added to the Delivery.

    + * + * * @return null|Parcel */ public function getParcel() @@ -372,6 +426,26 @@ public function getParcel() return $this->parcel; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $id @@ -469,6 +543,14 @@ public function setParcel(?Parcel $parcel): void $this->parcel = $parcel; } + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayload.php b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayload.php index 52c0101c2ac..1f4111e4fb8 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayload.php @@ -17,17 +17,32 @@ interface ParcelAddedToDeliveryMessagePayload extends OrderMessagePayload { public const FIELD_DELIVERY = 'delivery'; public const FIELD_PARCEL = 'parcel'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    Unique identifier of the Delivery.

    + * + * @return null|Delivery */ public function getDelivery(); /** + *

    Parcel that was added to the Delivery.

    + * + * @return null|Parcel */ public function getParcel(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?Delivery $delivery */ @@ -37,4 +52,9 @@ public function setDelivery(?Delivery $delivery): void; * @param ?Parcel $parcel */ public function setParcel(?Parcel $parcel): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayloadBuilder.php index f934cbe3819..6798912a933 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayloadBuilder.php @@ -25,16 +25,27 @@ final class ParcelAddedToDeliveryMessagePayloadBuilder implements Builder { /** + * @var null|Delivery|DeliveryBuilder */ private $delivery; /** + * @var null|Parcel|ParcelBuilder */ private $parcel; /** + + * @var ?string + */ + private $shippingKey; + + /** + *

    Unique identifier of the Delivery.

    + * + * @return null|Delivery */ public function getDelivery() @@ -43,6 +54,9 @@ public function getDelivery() } /** + *

    Parcel that was added to the Delivery.

    + * + * @return null|Parcel */ public function getParcel() @@ -50,6 +64,17 @@ public function getParcel() return $this->parcel instanceof ParcelBuilder ? $this->parcel->build() : $this->parcel; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?Delivery $delivery * @return $this @@ -72,6 +97,17 @@ public function withParcel(?Parcel $parcel) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withDelivery() instead * @return $this @@ -98,7 +134,8 @@ public function build(): ParcelAddedToDeliveryMessagePayload { return new ParcelAddedToDeliveryMessagePayloadModel( $this->delivery instanceof DeliveryBuilder ? $this->delivery->build() : $this->delivery, - $this->parcel instanceof ParcelBuilder ? $this->parcel->build() : $this->parcel + $this->parcel instanceof ParcelBuilder ? $this->parcel->build() : $this->parcel, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayloadModel.php index 56b060f86cd..23b4fe1c7e9 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayloadModel.php @@ -25,34 +25,47 @@ final class ParcelAddedToDeliveryMessagePayloadModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'ParcelAddedToDelivery'; /** + * * @var ?string */ protected $type; /** + * * @var ?Delivery */ protected $delivery; /** + * * @var ?Parcel */ protected $parcel; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType */ public function __construct( ?Delivery $delivery = null, - ?Parcel $parcel = null + ?Parcel $parcel = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->delivery = $delivery; $this->parcel = $parcel; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -70,6 +83,9 @@ public function getType() } /** + *

    Unique identifier of the Delivery.

    + * + * * @return null|Delivery */ public function getDelivery() @@ -88,6 +104,9 @@ public function getDelivery() } /** + *

    Parcel that was added to the Delivery.

    + * + * * @return null|Parcel */ public function getParcel() @@ -105,6 +124,26 @@ public function getParcel() return $this->parcel; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?Delivery $delivery @@ -121,4 +160,12 @@ public function setParcel(?Parcel $parcel): void { $this->parcel = $parcel; } + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } } diff --git a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessage.php b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessage.php index cc06a3d0769..31633899086 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessage.php @@ -18,27 +18,48 @@ interface ParcelItemsUpdatedMessage extends OrderMessage public const FIELD_DELIVERY_ID = 'deliveryId'; public const FIELD_ITEMS = 'items'; public const FIELD_OLD_ITEMS = 'oldItems'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    Unique identifier of the Parcel.

    + * + * @return null|string */ public function getParcelId(); /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId(); /** + *

    Delivery Items after the Set Parcel Items update action.

    + * + * @return null|DeliveryItemCollection */ public function getItems(); /** + *

    Delivery Items before the Set Parcel Items update action.

    + * + * @return null|DeliveryItemCollection */ public function getOldItems(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?string $parcelId */ @@ -58,4 +79,9 @@ public function setItems(?DeliveryItemCollection $items): void; * @param ?DeliveryItemCollection $oldItems */ public function setOldItems(?DeliveryItemCollection $oldItems): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessageBuilder.php index 49330ce8432..88e6bf3b549 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessageBuilder.php @@ -29,78 +29,99 @@ final class ParcelItemsUpdatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $parcelId; /** + * @var ?string */ private $deliveryId; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @var ?DeliveryItemCollection */ private $oldItems; /** - *

    Unique identifier of the Message.

    + + * @var ?string + */ + private $shippingKey; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -109,6 +130,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -117,6 +141,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -125,6 +152,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -133,8 +163,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -145,6 +176,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -153,6 +185,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -161,8 +197,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -171,6 +208,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -179,6 +219,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -187,6 +230,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Parcel.

    + * + * @return null|string */ public function getParcelId() @@ -195,6 +241,9 @@ public function getParcelId() } /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId() @@ -203,6 +252,9 @@ public function getDeliveryId() } /** + *

    Delivery Items after the Set Parcel Items update action.

    + * + * @return null|DeliveryItemCollection */ public function getItems() @@ -211,6 +263,9 @@ public function getItems() } /** + *

    Delivery Items before the Set Parcel Items update action.

    + * + * @return null|DeliveryItemCollection */ public function getOldItems() @@ -218,6 +273,17 @@ public function getOldItems() return $this->oldItems; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $id * @return $this @@ -372,6 +438,17 @@ public function withOldItems(?DeliveryItemCollection $oldItems) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -432,7 +509,8 @@ public function build(): ParcelItemsUpdatedMessage $this->parcelId, $this->deliveryId, $this->items, - $this->oldItems + $this->oldItems, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessageModel.php b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessageModel.php index 74d29f08083..0e1e864a356 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessageModel.php @@ -29,80 +29,101 @@ final class ParcelItemsUpdatedMessageModel extends JsonObjectModel implements Pa { public const DISCRIMINATOR_VALUE = 'ParcelItemsUpdated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $parcelId; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?DeliveryItemCollection */ protected $items; /** + * * @var ?DeliveryItemCollection */ protected $oldItems; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -121,7 +142,9 @@ public function __construct( ?string $parcelId = null, ?string $deliveryId = null, ?DeliveryItemCollection $items = null, - ?DeliveryItemCollection $oldItems = null + ?DeliveryItemCollection $oldItems = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -137,11 +160,13 @@ public function __construct( $this->deliveryId = $deliveryId; $this->items = $items; $this->oldItems = $oldItems; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -160,6 +185,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -177,6 +205,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -198,6 +229,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -219,7 +253,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -241,6 +276,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -259,6 +295,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -276,7 +316,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -296,6 +337,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -313,6 +357,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -330,6 +377,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -348,6 +398,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Parcel.

    + * + * * @return null|string */ public function getParcelId() @@ -365,6 +418,9 @@ public function getParcelId() } /** + *

    Unique identifier of the Delivery.

    + * + * * @return null|string */ public function getDeliveryId() @@ -382,6 +438,9 @@ public function getDeliveryId() } /** + *

    Delivery Items after the Set Parcel Items update action.

    + * + * * @return null|DeliveryItemCollection */ public function getItems() @@ -399,6 +458,9 @@ public function getItems() } /** + *

    Delivery Items before the Set Parcel Items update action.

    + * + * * @return null|DeliveryItemCollection */ public function getOldItems() @@ -415,6 +477,26 @@ public function getOldItems() return $this->oldItems; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $id @@ -528,6 +610,14 @@ public function setOldItems(?DeliveryItemCollection $oldItems): void $this->oldItems = $oldItems; } + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayload.php index 600775e2a0e..56a4ae92d22 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayload.php @@ -18,27 +18,48 @@ interface ParcelItemsUpdatedMessagePayload extends OrderMessagePayload public const FIELD_DELIVERY_ID = 'deliveryId'; public const FIELD_ITEMS = 'items'; public const FIELD_OLD_ITEMS = 'oldItems'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    Unique identifier of the Parcel.

    + * + * @return null|string */ public function getParcelId(); /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId(); /** + *

    Delivery Items after the Set Parcel Items update action.

    + * + * @return null|DeliveryItemCollection */ public function getItems(); /** + *

    Delivery Items before the Set Parcel Items update action.

    + * + * @return null|DeliveryItemCollection */ public function getOldItems(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?string $parcelId */ @@ -58,4 +79,9 @@ public function setItems(?DeliveryItemCollection $items): void; * @param ?DeliveryItemCollection $oldItems */ public function setOldItems(?DeliveryItemCollection $oldItems): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayloadBuilder.php index 9f96cfdc789..1805b8a5de8 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayloadBuilder.php @@ -22,26 +22,39 @@ final class ParcelItemsUpdatedMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $parcelId; /** + * @var ?string */ private $deliveryId; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @var ?DeliveryItemCollection */ private $oldItems; /** + + * @var ?string + */ + private $shippingKey; + + /** + *

    Unique identifier of the Parcel.

    + * + * @return null|string */ public function getParcelId() @@ -50,6 +63,9 @@ public function getParcelId() } /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId() @@ -58,6 +74,9 @@ public function getDeliveryId() } /** + *

    Delivery Items after the Set Parcel Items update action.

    + * + * @return null|DeliveryItemCollection */ public function getItems() @@ -66,6 +85,9 @@ public function getItems() } /** + *

    Delivery Items before the Set Parcel Items update action.

    + * + * @return null|DeliveryItemCollection */ public function getOldItems() @@ -73,6 +95,17 @@ public function getOldItems() return $this->oldItems; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $parcelId * @return $this @@ -117,6 +150,17 @@ public function withOldItems(?DeliveryItemCollection $oldItems) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + public function build(): ParcelItemsUpdatedMessagePayload { @@ -124,7 +168,8 @@ public function build(): ParcelItemsUpdatedMessagePayload $this->parcelId, $this->deliveryId, $this->items, - $this->oldItems + $this->oldItems, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayloadModel.php index 0abfbfc5597..c0a1f966a25 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayloadModel.php @@ -22,30 +22,41 @@ final class ParcelItemsUpdatedMessagePayloadModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'ParcelItemsUpdated'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $parcelId; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?DeliveryItemCollection */ protected $items; /** + * * @var ?DeliveryItemCollection */ protected $oldItems; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -54,16 +65,20 @@ public function __construct( ?string $parcelId = null, ?string $deliveryId = null, ?DeliveryItemCollection $items = null, - ?DeliveryItemCollection $oldItems = null + ?DeliveryItemCollection $oldItems = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->parcelId = $parcelId; $this->deliveryId = $deliveryId; $this->items = $items; $this->oldItems = $oldItems; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -81,6 +96,9 @@ public function getType() } /** + *

    Unique identifier of the Parcel.

    + * + * * @return null|string */ public function getParcelId() @@ -98,6 +116,9 @@ public function getParcelId() } /** + *

    Unique identifier of the Delivery.

    + * + * * @return null|string */ public function getDeliveryId() @@ -115,6 +136,9 @@ public function getDeliveryId() } /** + *

    Delivery Items after the Set Parcel Items update action.

    + * + * * @return null|DeliveryItemCollection */ public function getItems() @@ -132,6 +156,9 @@ public function getItems() } /** + *

    Delivery Items before the Set Parcel Items update action.

    + * + * * @return null|DeliveryItemCollection */ public function getOldItems() @@ -148,6 +175,26 @@ public function getOldItems() return $this->oldItems; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $parcelId @@ -180,4 +227,12 @@ public function setOldItems(?DeliveryItemCollection $oldItems): void { $this->oldItems = $oldItems; } + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } } diff --git a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessage.php b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessage.php index e716f7c69b4..5eb96cc0409 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessage.php @@ -17,22 +17,40 @@ interface ParcelMeasurementsUpdatedMessage extends OrderMessage public const FIELD_DELIVERY_ID = 'deliveryId'; public const FIELD_PARCEL_ID = 'parcelId'; public const FIELD_MEASUREMENTS = 'measurements'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId(); /** + *

    Unique identifier of the Parcel.

    + * + * @return null|string */ public function getParcelId(); /** + *

    The Parcel Measurements that were set on the Parcel.

    + * + * @return null|ParcelMeasurements */ public function getMeasurements(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?string $deliveryId */ @@ -47,4 +65,9 @@ public function setParcelId(?string $parcelId): void; * @param ?ParcelMeasurements $measurements */ public function setMeasurements(?ParcelMeasurements $measurements): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessageBuilder.php index 2a07851363d..fda14214276 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessageBuilder.php @@ -30,73 +30,93 @@ final class ParcelMeasurementsUpdatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $deliveryId; /** + * @var ?string */ private $parcelId; /** + * @var null|ParcelMeasurements|ParcelMeasurementsBuilder */ private $measurements; /** - *

    Unique identifier of the Message.

    + + * @var ?string + */ + private $shippingKey; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -105,6 +125,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -113,6 +136,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -121,6 +147,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -129,8 +158,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -141,6 +171,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -149,6 +180,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -157,8 +192,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -167,6 +203,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -175,6 +214,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -183,6 +225,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId() @@ -191,6 +236,9 @@ public function getDeliveryId() } /** + *

    Unique identifier of the Parcel.

    + * + * @return null|string */ public function getParcelId() @@ -199,6 +247,9 @@ public function getParcelId() } /** + *

    The Parcel Measurements that were set on the Parcel.

    + * + * @return null|ParcelMeasurements */ public function getMeasurements() @@ -206,6 +257,17 @@ public function getMeasurements() return $this->measurements instanceof ParcelMeasurementsBuilder ? $this->measurements->build() : $this->measurements; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $id * @return $this @@ -349,6 +411,17 @@ public function withMeasurements(?ParcelMeasurements $measurements) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -419,7 +492,8 @@ public function build(): ParcelMeasurementsUpdatedMessage $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, $this->deliveryId, $this->parcelId, - $this->measurements instanceof ParcelMeasurementsBuilder ? $this->measurements->build() : $this->measurements + $this->measurements instanceof ParcelMeasurementsBuilder ? $this->measurements->build() : $this->measurements, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessageModel.php b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessageModel.php index 51f672d5c98..5b34ca7b5f3 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessageModel.php @@ -30,75 +30,95 @@ final class ParcelMeasurementsUpdatedMessageModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'ParcelMeasurementsUpdated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?string */ protected $parcelId; /** + * * @var ?ParcelMeasurements */ protected $measurements; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -116,7 +136,9 @@ public function __construct( ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $deliveryId = null, ?string $parcelId = null, - ?ParcelMeasurements $measurements = null + ?ParcelMeasurements $measurements = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -131,11 +153,13 @@ public function __construct( $this->deliveryId = $deliveryId; $this->parcelId = $parcelId; $this->measurements = $measurements; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -154,6 +178,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -171,6 +198,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -192,6 +222,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -213,7 +246,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -235,6 +269,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -253,6 +288,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -270,7 +309,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -290,6 +330,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -307,6 +350,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -324,6 +370,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -342,6 +391,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Delivery.

    + * + * * @return null|string */ public function getDeliveryId() @@ -359,6 +411,9 @@ public function getDeliveryId() } /** + *

    Unique identifier of the Parcel.

    + * + * * @return null|string */ public function getParcelId() @@ -376,6 +431,9 @@ public function getParcelId() } /** + *

    The Parcel Measurements that were set on the Parcel.

    + * + * * @return null|ParcelMeasurements */ public function getMeasurements() @@ -393,6 +451,26 @@ public function getMeasurements() return $this->measurements; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $id @@ -498,6 +576,14 @@ public function setMeasurements(?ParcelMeasurements $measurements): void $this->measurements = $measurements; } + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayload.php index 4c71ba0ea3e..d2e72e487ec 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayload.php @@ -17,22 +17,40 @@ interface ParcelMeasurementsUpdatedMessagePayload extends OrderMessagePayload public const FIELD_DELIVERY_ID = 'deliveryId'; public const FIELD_PARCEL_ID = 'parcelId'; public const FIELD_MEASUREMENTS = 'measurements'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId(); /** + *

    Unique identifier of the Parcel.

    + * + * @return null|string */ public function getParcelId(); /** + *

    The Parcel Measurements that were set on the Parcel.

    + * + * @return null|ParcelMeasurements */ public function getMeasurements(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?string $deliveryId */ @@ -47,4 +65,9 @@ public function setParcelId(?string $parcelId): void; * @param ?ParcelMeasurements $measurements */ public function setMeasurements(?ParcelMeasurements $measurements): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayloadBuilder.php index 784e7e3216c..8059bb0b34e 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayloadBuilder.php @@ -23,21 +23,33 @@ final class ParcelMeasurementsUpdatedMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var ?string */ private $parcelId; /** + * @var null|ParcelMeasurements|ParcelMeasurementsBuilder */ private $measurements; /** + + * @var ?string + */ + private $shippingKey; + + /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId() @@ -46,6 +58,9 @@ public function getDeliveryId() } /** + *

    Unique identifier of the Parcel.

    + * + * @return null|string */ public function getParcelId() @@ -54,6 +69,9 @@ public function getParcelId() } /** + *

    The Parcel Measurements that were set on the Parcel.

    + * + * @return null|ParcelMeasurements */ public function getMeasurements() @@ -61,6 +79,17 @@ public function getMeasurements() return $this->measurements instanceof ParcelMeasurementsBuilder ? $this->measurements->build() : $this->measurements; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $deliveryId * @return $this @@ -94,6 +123,17 @@ public function withMeasurements(?ParcelMeasurements $measurements) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withMeasurements() instead * @return $this @@ -110,7 +150,8 @@ public function build(): ParcelMeasurementsUpdatedMessagePayload return new ParcelMeasurementsUpdatedMessagePayloadModel( $this->deliveryId, $this->parcelId, - $this->measurements instanceof ParcelMeasurementsBuilder ? $this->measurements->build() : $this->measurements + $this->measurements instanceof ParcelMeasurementsBuilder ? $this->measurements->build() : $this->measurements, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayloadModel.php index 1ae836786cf..13beffa0a2a 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayloadModel.php @@ -23,25 +23,35 @@ final class ParcelMeasurementsUpdatedMessagePayloadModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'ParcelMeasurementsUpdated'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?string */ protected $parcelId; /** + * * @var ?ParcelMeasurements */ protected $measurements; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -49,15 +59,19 @@ final class ParcelMeasurementsUpdatedMessagePayloadModel extends JsonObjectModel public function __construct( ?string $deliveryId = null, ?string $parcelId = null, - ?ParcelMeasurements $measurements = null + ?ParcelMeasurements $measurements = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->deliveryId = $deliveryId; $this->parcelId = $parcelId; $this->measurements = $measurements; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -75,6 +89,9 @@ public function getType() } /** + *

    Unique identifier of the Delivery.

    + * + * * @return null|string */ public function getDeliveryId() @@ -92,6 +109,9 @@ public function getDeliveryId() } /** + *

    Unique identifier of the Parcel.

    + * + * * @return null|string */ public function getParcelId() @@ -109,6 +129,9 @@ public function getParcelId() } /** + *

    The Parcel Measurements that were set on the Parcel.

    + * + * * @return null|ParcelMeasurements */ public function getMeasurements() @@ -126,6 +149,26 @@ public function getMeasurements() return $this->measurements; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $deliveryId @@ -150,4 +193,12 @@ public function setMeasurements(?ParcelMeasurements $measurements): void { $this->measurements = $measurements; } + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } } diff --git a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessage.php b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessage.php index e806e7ab455..2646d33127f 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessage.php +++ b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessage.php @@ -16,17 +16,32 @@ interface ParcelRemovedFromDeliveryMessage extends OrderMessage { public const FIELD_DELIVERY_ID = 'deliveryId'; public const FIELD_PARCEL = 'parcel'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId(); /** + *

    Parcel that was removed from the Delivery.

    + * + * @return null|Parcel */ public function getParcel(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?string $deliveryId */ @@ -36,4 +51,9 @@ public function setDeliveryId(?string $deliveryId): void; * @param ?Parcel $parcel */ public function setParcel(?Parcel $parcel): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessageBuilder.php index aba31bf709d..072538c19a3 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessageBuilder.php @@ -30,68 +30,87 @@ final class ParcelRemovedFromDeliveryMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $deliveryId; /** + * @var null|Parcel|ParcelBuilder */ private $parcel; /** - *

    Unique identifier of the Message.

    + + * @var ?string + */ + private $shippingKey; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +119,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +130,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +141,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +152,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +165,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +174,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +186,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +197,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +208,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,6 +219,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId() @@ -186,6 +230,9 @@ public function getDeliveryId() } /** + *

    Parcel that was removed from the Delivery.

    + * + * @return null|Parcel */ public function getParcel() @@ -193,6 +240,17 @@ public function getParcel() return $this->parcel instanceof ParcelBuilder ? $this->parcel->build() : $this->parcel; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $id * @return $this @@ -325,6 +383,17 @@ public function withParcel(?Parcel $parcel) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -394,7 +463,8 @@ public function build(): ParcelRemovedFromDeliveryMessage $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, $this->deliveryId, - $this->parcel instanceof ParcelBuilder ? $this->parcel->build() : $this->parcel + $this->parcel instanceof ParcelBuilder ? $this->parcel->build() : $this->parcel, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessageModel.php b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessageModel.php index 628398936f1..2341e6fb319 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessageModel.php @@ -30,70 +30,89 @@ final class ParcelRemovedFromDeliveryMessageModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'ParcelRemovedFromDelivery'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?Parcel */ protected $parcel; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -110,7 +129,9 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $deliveryId = null, - ?Parcel $parcel = null + ?Parcel $parcel = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +145,13 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->deliveryId = $deliveryId; $this->parcel = $parcel; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +170,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +190,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +214,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +238,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +261,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +280,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +301,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +322,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +342,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +362,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,6 +383,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Delivery.

    + * + * * @return null|string */ public function getDeliveryId() @@ -352,6 +403,9 @@ public function getDeliveryId() } /** + *

    Parcel that was removed from the Delivery.

    + * + * * @return null|Parcel */ public function getParcel() @@ -369,6 +423,26 @@ public function getParcel() return $this->parcel; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $id @@ -466,6 +540,14 @@ public function setParcel(?Parcel $parcel): void $this->parcel = $parcel; } + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayload.php b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayload.php index a8c30235bcf..f5e0a238663 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayload.php @@ -16,17 +16,32 @@ interface ParcelRemovedFromDeliveryMessagePayload extends OrderMessagePayload { public const FIELD_DELIVERY_ID = 'deliveryId'; public const FIELD_PARCEL = 'parcel'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId(); /** + *

    Parcel that was removed from the Delivery.

    + * + * @return null|Parcel */ public function getParcel(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?string $deliveryId */ @@ -36,4 +51,9 @@ public function setDeliveryId(?string $deliveryId): void; * @param ?Parcel $parcel */ public function setParcel(?Parcel $parcel): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayloadBuilder.php index dcefb6755cc..65827367e43 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayloadBuilder.php @@ -23,16 +23,27 @@ final class ParcelRemovedFromDeliveryMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var null|Parcel|ParcelBuilder */ private $parcel; /** + + * @var ?string + */ + private $shippingKey; + + /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId() @@ -41,6 +52,9 @@ public function getDeliveryId() } /** + *

    Parcel that was removed from the Delivery.

    + * + * @return null|Parcel */ public function getParcel() @@ -48,6 +62,17 @@ public function getParcel() return $this->parcel instanceof ParcelBuilder ? $this->parcel->build() : $this->parcel; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $deliveryId * @return $this @@ -70,6 +95,17 @@ public function withParcel(?Parcel $parcel) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withParcel() instead * @return $this @@ -85,7 +121,8 @@ public function build(): ParcelRemovedFromDeliveryMessagePayload { return new ParcelRemovedFromDeliveryMessagePayloadModel( $this->deliveryId, - $this->parcel instanceof ParcelBuilder ? $this->parcel->build() : $this->parcel + $this->parcel instanceof ParcelBuilder ? $this->parcel->build() : $this->parcel, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayloadModel.php index 50015181d5c..d215c5796cf 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayloadModel.php @@ -23,34 +23,47 @@ final class ParcelRemovedFromDeliveryMessagePayloadModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'ParcelRemovedFromDelivery'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?Parcel */ protected $parcel; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType */ public function __construct( ?string $deliveryId = null, - ?Parcel $parcel = null + ?Parcel $parcel = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->deliveryId = $deliveryId; $this->parcel = $parcel; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,6 +81,9 @@ public function getType() } /** + *

    Unique identifier of the Delivery.

    + * + * * @return null|string */ public function getDeliveryId() @@ -85,6 +101,9 @@ public function getDeliveryId() } /** + *

    Parcel that was removed from the Delivery.

    + * + * * @return null|Parcel */ public function getParcel() @@ -102,6 +121,26 @@ public function getParcel() return $this->parcel; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $deliveryId @@ -118,4 +157,12 @@ public function setParcel(?Parcel $parcel): void { $this->parcel = $parcel; } + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } } diff --git a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessage.php b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessage.php index d760137f15f..9acd4aa36cd 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessage.php @@ -17,22 +17,40 @@ interface ParcelTrackingDataUpdatedMessage extends OrderMessage public const FIELD_DELIVERY_ID = 'deliveryId'; public const FIELD_PARCEL_ID = 'parcelId'; public const FIELD_TRACKING_DATA = 'trackingData'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId(); /** + *

    Unique identifier of the Parcel.

    + * + * @return null|string */ public function getParcelId(); /** + *

    The Tracking Data that was added to the Parcel.

    + * + * @return null|TrackingData */ public function getTrackingData(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?string $deliveryId */ @@ -47,4 +65,9 @@ public function setParcelId(?string $parcelId): void; * @param ?TrackingData $trackingData */ public function setTrackingData(?TrackingData $trackingData): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessageBuilder.php index 0bb01e4da71..8f28b94193f 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessageBuilder.php @@ -30,73 +30,93 @@ final class ParcelTrackingDataUpdatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $deliveryId; /** + * @var ?string */ private $parcelId; /** + * @var null|TrackingData|TrackingDataBuilder */ private $trackingData; /** - *

    Unique identifier of the Message.

    + + * @var ?string + */ + private $shippingKey; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -105,6 +125,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -113,6 +136,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -121,6 +147,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -129,8 +158,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -141,6 +171,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -149,6 +180,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -157,8 +192,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -167,6 +203,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -175,6 +214,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -183,6 +225,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId() @@ -191,6 +236,9 @@ public function getDeliveryId() } /** + *

    Unique identifier of the Parcel.

    + * + * @return null|string */ public function getParcelId() @@ -199,6 +247,9 @@ public function getParcelId() } /** + *

    The Tracking Data that was added to the Parcel.

    + * + * @return null|TrackingData */ public function getTrackingData() @@ -206,6 +257,17 @@ public function getTrackingData() return $this->trackingData instanceof TrackingDataBuilder ? $this->trackingData->build() : $this->trackingData; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $id * @return $this @@ -349,6 +411,17 @@ public function withTrackingData(?TrackingData $trackingData) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -419,7 +492,8 @@ public function build(): ParcelTrackingDataUpdatedMessage $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, $this->deliveryId, $this->parcelId, - $this->trackingData instanceof TrackingDataBuilder ? $this->trackingData->build() : $this->trackingData + $this->trackingData instanceof TrackingDataBuilder ? $this->trackingData->build() : $this->trackingData, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessageModel.php b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessageModel.php index bd77e2d591f..9f4dd817014 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessageModel.php @@ -30,75 +30,95 @@ final class ParcelTrackingDataUpdatedMessageModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'ParcelTrackingDataUpdated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?string */ protected $parcelId; /** + * * @var ?TrackingData */ protected $trackingData; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -116,7 +136,9 @@ public function __construct( ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $deliveryId = null, ?string $parcelId = null, - ?TrackingData $trackingData = null + ?TrackingData $trackingData = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -131,11 +153,13 @@ public function __construct( $this->deliveryId = $deliveryId; $this->parcelId = $parcelId; $this->trackingData = $trackingData; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -154,6 +178,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -171,6 +198,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -192,6 +222,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -213,7 +246,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -235,6 +269,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -253,6 +288,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -270,7 +309,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -290,6 +330,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -307,6 +350,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -324,6 +370,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -342,6 +391,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Delivery.

    + * + * * @return null|string */ public function getDeliveryId() @@ -359,6 +411,9 @@ public function getDeliveryId() } /** + *

    Unique identifier of the Parcel.

    + * + * * @return null|string */ public function getParcelId() @@ -376,6 +431,9 @@ public function getParcelId() } /** + *

    The Tracking Data that was added to the Parcel.

    + * + * * @return null|TrackingData */ public function getTrackingData() @@ -393,6 +451,26 @@ public function getTrackingData() return $this->trackingData; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $id @@ -498,6 +576,14 @@ public function setTrackingData(?TrackingData $trackingData): void $this->trackingData = $trackingData; } + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayload.php index dfdd1ea0d6e..a9a7f9e98dd 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayload.php @@ -17,22 +17,40 @@ interface ParcelTrackingDataUpdatedMessagePayload extends OrderMessagePayload public const FIELD_DELIVERY_ID = 'deliveryId'; public const FIELD_PARCEL_ID = 'parcelId'; public const FIELD_TRACKING_DATA = 'trackingData'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId(); /** + *

    Unique identifier of the Parcel.

    + * + * @return null|string */ public function getParcelId(); /** + *

    The Tracking Data that was added to the Parcel.

    + * + * @return null|TrackingData */ public function getTrackingData(); + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?string $deliveryId */ @@ -47,4 +65,9 @@ public function setParcelId(?string $parcelId): void; * @param ?TrackingData $trackingData */ public function setTrackingData(?TrackingData $trackingData): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayloadBuilder.php index 9cb95d5251c..3f9178b900a 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayloadBuilder.php @@ -23,21 +23,33 @@ final class ParcelTrackingDataUpdatedMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var ?string */ private $parcelId; /** + * @var null|TrackingData|TrackingDataBuilder */ private $trackingData; /** + + * @var ?string + */ + private $shippingKey; + + /** + *

    Unique identifier of the Delivery.

    + * + * @return null|string */ public function getDeliveryId() @@ -46,6 +58,9 @@ public function getDeliveryId() } /** + *

    Unique identifier of the Parcel.

    + * + * @return null|string */ public function getParcelId() @@ -54,6 +69,9 @@ public function getParcelId() } /** + *

    The Tracking Data that was added to the Parcel.

    + * + * @return null|TrackingData */ public function getTrackingData() @@ -61,6 +79,17 @@ public function getTrackingData() return $this->trackingData instanceof TrackingDataBuilder ? $this->trackingData->build() : $this->trackingData; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $deliveryId * @return $this @@ -94,6 +123,17 @@ public function withTrackingData(?TrackingData $trackingData) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withTrackingData() instead * @return $this @@ -110,7 +150,8 @@ public function build(): ParcelTrackingDataUpdatedMessagePayload return new ParcelTrackingDataUpdatedMessagePayloadModel( $this->deliveryId, $this->parcelId, - $this->trackingData instanceof TrackingDataBuilder ? $this->trackingData->build() : $this->trackingData + $this->trackingData instanceof TrackingDataBuilder ? $this->trackingData->build() : $this->trackingData, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayloadModel.php index 10fb1b8d658..5ae0a3e2f3c 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayloadModel.php @@ -23,25 +23,35 @@ final class ParcelTrackingDataUpdatedMessagePayloadModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'ParcelTrackingDataUpdated'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?string */ protected $parcelId; /** + * * @var ?TrackingData */ protected $trackingData; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -49,15 +59,19 @@ final class ParcelTrackingDataUpdatedMessagePayloadModel extends JsonObjectModel public function __construct( ?string $deliveryId = null, ?string $parcelId = null, - ?TrackingData $trackingData = null + ?TrackingData $trackingData = null, + ?string $shippingKey = null, + ?string $type = null ) { $this->deliveryId = $deliveryId; $this->parcelId = $parcelId; $this->trackingData = $trackingData; - $this->type = static::DISCRIMINATOR_VALUE; + $this->shippingKey = $shippingKey; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -75,6 +89,9 @@ public function getType() } /** + *

    Unique identifier of the Delivery.

    + * + * * @return null|string */ public function getDeliveryId() @@ -92,6 +109,9 @@ public function getDeliveryId() } /** + *

    Unique identifier of the Parcel.

    + * + * * @return null|string */ public function getParcelId() @@ -109,6 +129,9 @@ public function getParcelId() } /** + *

    The Tracking Data that was added to the Parcel.

    + * + * * @return null|TrackingData */ public function getTrackingData() @@ -126,6 +149,26 @@ public function getTrackingData() return $this->trackingData; } + /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $deliveryId @@ -150,4 +193,12 @@ public function setTrackingData(?TrackingData $trackingData): void { $this->trackingData = $trackingData; } + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } } diff --git a/lib/commercetools-api/src/Models/Message/PaymentCreatedMessage.php b/lib/commercetools-api/src/Models/Message/PaymentCreatedMessage.php index ab2a36de82c..2e2dfe982f1 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentCreatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/PaymentCreatedMessage.php @@ -17,6 +17,9 @@ interface PaymentCreatedMessage extends Message public const FIELD_PAYMENT = 'payment'; /** + *

    Payment that was created.

    + * + * @return null|Payment */ public function getPayment(); diff --git a/lib/commercetools-api/src/Models/Message/PaymentCreatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/PaymentCreatedMessageBuilder.php index ac2e8e38e68..7d4da9d775b 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentCreatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/PaymentCreatedMessageBuilder.php @@ -30,63 +30,75 @@ final class PaymentCreatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|Payment|PaymentBuilder */ private $payment; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,6 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Payment that was created.

    + * + * @return null|Payment */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Message/PaymentCreatedMessageModel.php b/lib/commercetools-api/src/Models/Message/PaymentCreatedMessageModel.php index 453928abf65..2c5df855e60 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentCreatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/PaymentCreatedMessageModel.php @@ -30,61 +30,73 @@ final class PaymentCreatedMessageModel extends JsonObjectModel implements Paymen { public const DISCRIMINATOR_VALUE = 'PaymentCreated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?Payment */ protected $payment; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?Payment $payment = null + ?Payment $payment = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->payment = $payment; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,6 +367,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Payment that was created.

    + * + * * @return null|Payment */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Message/PaymentCreatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/PaymentCreatedMessagePayload.php index 4b039290a1b..92dd829d904 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentCreatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/PaymentCreatedMessagePayload.php @@ -17,6 +17,9 @@ interface PaymentCreatedMessagePayload extends MessagePayload public const FIELD_PAYMENT = 'payment'; /** + *

    Payment that was created.

    + * + * @return null|Payment */ public function getPayment(); diff --git a/lib/commercetools-api/src/Models/Message/PaymentCreatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/PaymentCreatedMessagePayloadBuilder.php index b8708e4acaa..db3e6bb17b4 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentCreatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/PaymentCreatedMessagePayloadBuilder.php @@ -23,11 +23,15 @@ final class PaymentCreatedMessagePayloadBuilder implements Builder { /** + * @var null|Payment|PaymentBuilder */ private $payment; /** + *

    Payment that was created.

    + * + * @return null|Payment */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Message/PaymentCreatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/PaymentCreatedMessagePayloadModel.php index 4a43c0dfa39..5deca2b90df 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentCreatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/PaymentCreatedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class PaymentCreatedMessagePayloadModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'PaymentCreated'; /** + * * @var ?string */ protected $type; /** + * * @var ?Payment */ protected $payment; @@ -37,13 +39,15 @@ final class PaymentCreatedMessagePayloadModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?Payment $payment = null + ?Payment $payment = null, + ?string $type = null ) { $this->payment = $payment; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,9 @@ public function getType() } /** + *

    Payment that was created.

    + * + * * @return null|Payment */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessage.php b/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessage.php index f4683d35546..02e6c098578 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessage.php +++ b/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessage.php @@ -17,8 +17,9 @@ interface PaymentInteractionAddedMessage extends Message public const FIELD_INTERACTION = 'interaction'; /** - *

    Serves as value of the custom field on a resource or data type customized with a Type.

    + *

    The interface interaction that was added to the Payment.

    * + * @return null|CustomFields */ public function getInteraction(); diff --git a/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessageBuilder.php index 2a3bc852468..a198adfbe68 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessageBuilder.php @@ -30,63 +30,75 @@ final class PaymentInteractionAddedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $interaction; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,8 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Serves as value of the custom field on a resource or data type customized with a Type.

    + *

    The interface interaction that was added to the Payment.

    * + * @return null|CustomFields */ public function getInteraction() diff --git a/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessageModel.php index d69c1ff5f2a..3d04cec7dd9 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessageModel.php @@ -30,61 +30,73 @@ final class PaymentInteractionAddedMessageModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'PaymentInteractionAdded'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?CustomFields */ protected $interaction; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?CustomFields $interaction = null + ?CustomFields $interaction = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->interaction = $interaction; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,7 +367,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Serves as value of the custom field on a resource or data type customized with a Type.

    + *

    The interface interaction that was added to the Payment.

    + * * * @return null|CustomFields */ diff --git a/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessagePayload.php index ac1f19f9160..56659ae3c59 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessagePayload.php @@ -17,8 +17,9 @@ interface PaymentInteractionAddedMessagePayload extends MessagePayload public const FIELD_INTERACTION = 'interaction'; /** - *

    Serves as value of the custom field on a resource or data type customized with a Type.

    + *

    The interface interaction that was added to the Payment.

    * + * @return null|CustomFields */ public function getInteraction(); diff --git a/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessagePayloadBuilder.php index 7a07be1fee6..ddbec22393c 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessagePayloadBuilder.php @@ -23,13 +23,15 @@ final class PaymentInteractionAddedMessagePayloadBuilder implements Builder { /** + * @var null|CustomFields|CustomFieldsBuilder */ private $interaction; /** - *

    Serves as value of the custom field on a resource or data type customized with a Type.

    + *

    The interface interaction that was added to the Payment.

    * + * @return null|CustomFields */ public function getInteraction() diff --git a/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessagePayloadModel.php index a0adf52f7a0..a3309c21464 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/PaymentInteractionAddedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class PaymentInteractionAddedMessagePayloadModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'PaymentInteractionAdded'; /** + * * @var ?string */ protected $type; /** + * * @var ?CustomFields */ protected $interaction; @@ -37,13 +39,15 @@ final class PaymentInteractionAddedMessagePayloadModel extends JsonObjectModel i * @psalm-suppress MissingParamType */ public function __construct( - ?CustomFields $interaction = null + ?CustomFields $interaction = null, + ?string $type = null ) { $this->interaction = $interaction; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,7 +65,8 @@ public function getType() } /** - *

    Serves as value of the custom field on a resource or data type customized with a Type.

    + *

    The interface interaction that was added to the Payment.

    + * * * @return null|CustomFields */ diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessage.php b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessage.php index e91bf0c9f3a..b25010112f5 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessage.php @@ -17,11 +17,17 @@ interface PaymentStatusInterfaceCodeSetMessage extends Message public const FIELD_INTERFACE_CODE = 'interfaceCode'; /** + *

    Unique identifier for the Payment for which the Set StatusInterfaceCode update action was applied.

    + * + * @return null|string */ public function getPaymentId(); /** + *

    The interfaceCode that was set during the Set StatusInterfaceCode update action.

    + * + * @return null|string */ public function getInterfaceCode(); diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessageBuilder.php index 4f372fb7518..642b27c3644 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessageBuilder.php @@ -28,68 +28,81 @@ final class PaymentStatusInterfaceCodeSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $paymentId; /** + * @var ?string */ private $interfaceCode; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -98,6 +111,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -106,6 +122,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -114,6 +133,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -122,8 +144,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -134,6 +157,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -142,6 +166,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -150,8 +178,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -160,6 +189,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -168,6 +200,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -176,6 +211,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier for the Payment for which the Set StatusInterfaceCode update action was applied.

    + * + * @return null|string */ public function getPaymentId() @@ -184,6 +222,9 @@ public function getPaymentId() } /** + *

    The interfaceCode that was set during the Set StatusInterfaceCode update action.

    + * + * @return null|string */ public function getInterfaceCode() diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessageModel.php b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessageModel.php index 72bb99c2bd9..3492fec45f2 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessageModel.php @@ -28,66 +28,79 @@ final class PaymentStatusInterfaceCodeSetMessageModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'PaymentStatusInterfaceCodeSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $paymentId; /** + * * @var ?string */ protected $interfaceCode; @@ -108,7 +121,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $paymentId = null, - ?string $interfaceCode = null + ?string $interfaceCode = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -122,11 +136,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->paymentId = $paymentId; $this->interfaceCode = $interfaceCode; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -145,6 +160,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -162,6 +180,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -183,6 +204,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -204,7 +228,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -226,6 +251,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -244,6 +270,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -261,7 +291,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -281,6 +312,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -298,6 +332,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -315,6 +352,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -333,6 +373,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier for the Payment for which the Set StatusInterfaceCode update action was applied.

    + * + * * @return null|string */ public function getPaymentId() @@ -350,6 +393,9 @@ public function getPaymentId() } /** + *

    The interfaceCode that was set during the Set StatusInterfaceCode update action.

    + * + * * @return null|string */ public function getInterfaceCode() diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayload.php index e867866504f..c7017858d25 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayload.php @@ -17,11 +17,17 @@ interface PaymentStatusInterfaceCodeSetMessagePayload extends MessagePayload public const FIELD_INTERFACE_CODE = 'interfaceCode'; /** + *

    Unique identifier for the Payment for which the Set StatusInterfaceCode update action was applied.

    + * + * @return null|string */ public function getPaymentId(); /** + *

    The interfaceCode that was set during the Set StatusInterfaceCode update action.

    + * + * @return null|string */ public function getInterfaceCode(); diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayloadBuilder.php index d1350b90b70..0a860251af2 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayloadBuilder.php @@ -21,16 +21,21 @@ final class PaymentStatusInterfaceCodeSetMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $paymentId; /** + * @var ?string */ private $interfaceCode; /** + *

    Unique identifier for the Payment for which the Set StatusInterfaceCode update action was applied.

    + * + * @return null|string */ public function getPaymentId() @@ -39,6 +44,9 @@ public function getPaymentId() } /** + *

    The interfaceCode that was set during the Set StatusInterfaceCode update action.

    + * + * @return null|string */ public function getInterfaceCode() diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayloadModel.php index f76125a7a53..1b796bf76e1 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayloadModel.php @@ -21,16 +21,19 @@ final class PaymentStatusInterfaceCodeSetMessagePayloadModel extends JsonObjectM { public const DISCRIMINATOR_VALUE = 'PaymentStatusInterfaceCodeSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $paymentId; /** + * * @var ?string */ protected $interfaceCode; @@ -41,14 +44,16 @@ final class PaymentStatusInterfaceCodeSetMessagePayloadModel extends JsonObjectM */ public function __construct( ?string $paymentId = null, - ?string $interfaceCode = null + ?string $interfaceCode = null, + ?string $type = null ) { $this->paymentId = $paymentId; $this->interfaceCode = $interfaceCode; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -66,6 +71,9 @@ public function getType() } /** + *

    Unique identifier for the Payment for which the Set StatusInterfaceCode update action was applied.

    + * + * * @return null|string */ public function getPaymentId() @@ -83,6 +91,9 @@ public function getPaymentId() } /** + *

    The interfaceCode that was set during the Set StatusInterfaceCode update action.

    + * + * * @return null|string */ public function getInterfaceCode() diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessage.php b/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessage.php index 5b8ea3abe61..8ef2186d3ac 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessage.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessage.php @@ -18,13 +18,17 @@ interface PaymentStatusStateTransitionMessage extends Message public const FIELD_FORCE = 'force'; /** - *

    Reference to a State.

    + *

    State of the Payment after the Transition State update action.

    * + * @return null|StateReference */ public function getState(); /** + *

    Whether State transition validations were turned off during the Change Transaction State update action.

    + * + * @return null|bool */ public function getForce(); diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessageBuilder.php b/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessageBuilder.php index 6baf6ac5edd..3f3915adf14 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessageBuilder.php @@ -30,68 +30,81 @@ final class PaymentStatusStateTransitionMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|StateReference|StateReferenceBuilder */ private $state; /** + * @var ?bool */ private $force; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,8 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a State.

    + *

    State of the Payment after the Transition State update action.

    * + * @return null|StateReference */ public function getState() @@ -188,6 +224,9 @@ public function getState() } /** + *

    Whether State transition validations were turned off during the Change Transaction State update action.

    + * + * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessageModel.php b/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessageModel.php index d422de52d60..512c8d4aae6 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessageModel.php @@ -30,66 +30,79 @@ final class PaymentStatusStateTransitionMessageModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'PaymentStatusStateTransition'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?StateReference */ protected $state; /** + * * @var ?bool */ protected $force; @@ -110,7 +123,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?StateReference $state = null, - ?bool $force = null + ?bool $force = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +138,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->state = $state; $this->force = $force; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,7 +375,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a State.

    + *

    State of the Payment after the Transition State update action.

    + * * * @return null|StateReference */ @@ -355,6 +396,9 @@ public function getState() } /** + *

    Whether State transition validations were turned off during the Change Transaction State update action.

    + * + * * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessagePayload.php b/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessagePayload.php index 969c469b7fd..fb3cbd170b1 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessagePayload.php @@ -18,13 +18,17 @@ interface PaymentStatusStateTransitionMessagePayload extends MessagePayload public const FIELD_FORCE = 'force'; /** - *

    Reference to a State.

    + *

    State of the Payment after the Transition State update action.

    * + * @return null|StateReference */ public function getState(); /** + *

    Whether State transition validations were turned off during the Change Transaction State update action.

    + * + * @return null|bool */ public function getForce(); diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessagePayloadBuilder.php index be3896d98df..9d5c73ec54a 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessagePayloadBuilder.php @@ -23,18 +23,21 @@ final class PaymentStatusStateTransitionMessagePayloadBuilder implements Builder { /** + * @var null|StateReference|StateReferenceBuilder */ private $state; /** + * @var ?bool */ private $force; /** - *

    Reference to a State.

    + *

    State of the Payment after the Transition State update action.

    * + * @return null|StateReference */ public function getState() @@ -43,6 +46,9 @@ public function getState() } /** + *

    Whether State transition validations were turned off during the Change Transaction State update action.

    + * + * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessagePayloadModel.php index 7de499ef200..eca85a716ba 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusStateTransitionMessagePayloadModel.php @@ -23,16 +23,19 @@ final class PaymentStatusStateTransitionMessagePayloadModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'PaymentStatusStateTransition'; /** + * * @var ?string */ protected $type; /** + * * @var ?StateReference */ protected $state; /** + * * @var ?bool */ protected $force; @@ -43,14 +46,16 @@ final class PaymentStatusStateTransitionMessagePayloadModel extends JsonObjectMo */ public function __construct( ?StateReference $state = null, - ?bool $force = null + ?bool $force = null, + ?string $type = null ) { $this->state = $state; $this->force = $force; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,7 +73,8 @@ public function getType() } /** - *

    Reference to a State.

    + *

    State of the Payment after the Transition State update action.

    + * * * @return null|StateReference */ @@ -88,6 +94,9 @@ public function getState() } /** + *

    Whether State transition validations were turned off during the Change Transaction State update action.

    + * + * * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessage.php b/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessage.php index dec6d60634d..0ddd7173900 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessage.php +++ b/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessage.php @@ -17,6 +17,9 @@ interface PaymentTransactionAddedMessage extends Message public const FIELD_TRANSACTION = 'transaction'; /** + *

    Transaction that was added to the Payment.

    + * + * @return null|Transaction */ public function getTransaction(); diff --git a/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessageBuilder.php index 401a0f9b0db..ad09897a4b9 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessageBuilder.php @@ -30,63 +30,75 @@ final class PaymentTransactionAddedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|Transaction|TransactionBuilder */ private $transaction; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,6 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Transaction that was added to the Payment.

    + * + * @return null|Transaction */ public function getTransaction() diff --git a/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessageModel.php index 0100deb3d57..923fc48ba10 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessageModel.php @@ -30,61 +30,73 @@ final class PaymentTransactionAddedMessageModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'PaymentTransactionAdded'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?Transaction */ protected $transaction; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?Transaction $transaction = null + ?Transaction $transaction = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->transaction = $transaction; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,6 +367,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Transaction that was added to the Payment.

    + * + * * @return null|Transaction */ public function getTransaction() diff --git a/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessagePayload.php index 496557a230d..be3b5370ca7 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessagePayload.php @@ -17,6 +17,9 @@ interface PaymentTransactionAddedMessagePayload extends MessagePayload public const FIELD_TRANSACTION = 'transaction'; /** + *

    Transaction that was added to the Payment.

    + * + * @return null|Transaction */ public function getTransaction(); diff --git a/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessagePayloadBuilder.php index dd9adc6044b..299fe2626e4 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessagePayloadBuilder.php @@ -23,11 +23,15 @@ final class PaymentTransactionAddedMessagePayloadBuilder implements Builder { /** + * @var null|Transaction|TransactionBuilder */ private $transaction; /** + *

    Transaction that was added to the Payment.

    + * + * @return null|Transaction */ public function getTransaction() diff --git a/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessagePayloadModel.php index 4807653f7c4..b4e99d69be1 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/PaymentTransactionAddedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class PaymentTransactionAddedMessagePayloadModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'PaymentTransactionAdded'; /** + * * @var ?string */ protected $type; /** + * * @var ?Transaction */ protected $transaction; @@ -37,13 +39,15 @@ final class PaymentTransactionAddedMessagePayloadModel extends JsonObjectModel i * @psalm-suppress MissingParamType */ public function __construct( - ?Transaction $transaction = null + ?Transaction $transaction = null, + ?string $type = null ) { $this->transaction = $transaction; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,9 @@ public function getType() } /** + *

    Transaction that was added to the Payment.

    + * + * * @return null|Transaction */ public function getTransaction() diff --git a/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessage.php b/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessage.php index fc7da86768a..c0c6110acbb 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessage.php +++ b/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessage.php @@ -17,11 +17,17 @@ interface PaymentTransactionStateChangedMessage extends Message public const FIELD_STATE = 'state'; /** + *

    Unique identifier for the Transaction for which the Transaction State changed.

    + * + * @return null|string */ public function getTransactionId(); /** + *

    Transaction State after the Change Transaction State update action.

    + * + * @return null|string */ public function getState(); diff --git a/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessageBuilder.php index a3d48069fd3..159b2f728b7 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessageBuilder.php @@ -28,68 +28,81 @@ final class PaymentTransactionStateChangedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $transactionId; /** + * @var ?string */ private $state; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -98,6 +111,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -106,6 +122,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -114,6 +133,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -122,8 +144,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -134,6 +157,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -142,6 +166,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -150,8 +178,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -160,6 +189,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -168,6 +200,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -176,6 +211,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier for the Transaction for which the Transaction State changed.

    + * + * @return null|string */ public function getTransactionId() @@ -184,6 +222,9 @@ public function getTransactionId() } /** + *

    Transaction State after the Change Transaction State update action.

    + * + * @return null|string */ public function getState() diff --git a/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessageModel.php index cabfab1f817..c8470adb544 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessageModel.php @@ -28,66 +28,79 @@ final class PaymentTransactionStateChangedMessageModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'PaymentTransactionStateChanged'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $transactionId; /** + * * @var ?string */ protected $state; @@ -108,7 +121,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $transactionId = null, - ?string $state = null + ?string $state = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -122,11 +136,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->transactionId = $transactionId; $this->state = $state; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -145,6 +160,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -162,6 +180,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -183,6 +204,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -204,7 +228,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -226,6 +251,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -244,6 +270,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -261,7 +291,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -281,6 +312,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -298,6 +332,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -315,6 +352,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -333,6 +373,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier for the Transaction for which the Transaction State changed.

    + * + * * @return null|string */ public function getTransactionId() @@ -350,6 +393,9 @@ public function getTransactionId() } /** + *

    Transaction State after the Change Transaction State update action.

    + * + * * @return null|string */ public function getState() diff --git a/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessagePayload.php index 68d939eff6f..3def1106ba7 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessagePayload.php @@ -17,11 +17,17 @@ interface PaymentTransactionStateChangedMessagePayload extends MessagePayload public const FIELD_STATE = 'state'; /** + *

    Unique identifier for the Transaction for which the Transaction State changed.

    + * + * @return null|string */ public function getTransactionId(); /** + *

    Transaction State after the Change Transaction State update action.

    + * + * @return null|string */ public function getState(); diff --git a/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessagePayloadBuilder.php index d744648511d..ddc76bc2b12 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessagePayloadBuilder.php @@ -21,16 +21,21 @@ final class PaymentTransactionStateChangedMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $transactionId; /** + * @var ?string */ private $state; /** + *

    Unique identifier for the Transaction for which the Transaction State changed.

    + * + * @return null|string */ public function getTransactionId() @@ -39,6 +44,9 @@ public function getTransactionId() } /** + *

    Transaction State after the Change Transaction State update action.

    + * + * @return null|string */ public function getState() diff --git a/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessagePayloadModel.php index 05866768fbb..97ef2247938 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/PaymentTransactionStateChangedMessagePayloadModel.php @@ -21,16 +21,19 @@ final class PaymentTransactionStateChangedMessagePayloadModel extends JsonObject { public const DISCRIMINATOR_VALUE = 'PaymentTransactionStateChanged'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $transactionId; /** + * * @var ?string */ protected $state; @@ -41,14 +44,16 @@ final class PaymentTransactionStateChangedMessagePayloadModel extends JsonObject */ public function __construct( ?string $transactionId = null, - ?string $state = null + ?string $state = null, + ?string $type = null ) { $this->transactionId = $transactionId; $this->state = $state; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -66,6 +71,9 @@ public function getType() } /** + *

    Unique identifier for the Transaction for which the Transaction State changed.

    + * + * * @return null|string */ public function getTransactionId() @@ -83,6 +91,9 @@ public function getTransactionId() } /** + *

    Transaction State after the Change Transaction State update action.

    + * + * * @return null|string */ public function getState() diff --git a/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessage.php b/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessage.php index d370977e4c3..9d46b20b1b4 100644 --- a/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessage.php @@ -18,13 +18,17 @@ interface ProductAddedToCategoryMessage extends Message public const FIELD_STAGED = 'staged'; /** - *

    Reference to a Category.

    + *

    Category the Product was added to.

    * + * @return null|CategoryReference */ public function getCategory(); /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessageBuilder.php index 1385bca01da..2563458ef3a 100644 --- a/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessageBuilder.php @@ -30,68 +30,81 @@ final class ProductAddedToCategoryMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|CategoryReference|CategoryReferenceBuilder */ private $category; /** + * @var ?bool */ private $staged; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,8 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a Category.

    + *

    Category the Product was added to.

    * + * @return null|CategoryReference */ public function getCategory() @@ -188,6 +224,9 @@ public function getCategory() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessageModel.php index 1ebd671db02..8495f127244 100644 --- a/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessageModel.php @@ -30,66 +30,79 @@ final class ProductAddedToCategoryMessageModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'ProductAddedToCategory'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?CategoryReference */ protected $category; /** + * * @var ?bool */ protected $staged; @@ -110,7 +123,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?CategoryReference $category = null, - ?bool $staged = null + ?bool $staged = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +138,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->category = $category; $this->staged = $staged; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,7 +375,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a Category.

    + *

    Category the Product was added to.

    + * * * @return null|CategoryReference */ @@ -355,6 +396,9 @@ public function getCategory() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessagePayload.php index efbbdc6db70..89a3b835faa 100644 --- a/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessagePayload.php @@ -18,13 +18,17 @@ interface ProductAddedToCategoryMessagePayload extends MessagePayload public const FIELD_STAGED = 'staged'; /** - *

    Reference to a Category.

    + *

    Category the Product was added to.

    * + * @return null|CategoryReference */ public function getCategory(); /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessagePayloadBuilder.php index 37a03d70d14..84ff42192af 100644 --- a/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessagePayloadBuilder.php @@ -23,18 +23,21 @@ final class ProductAddedToCategoryMessagePayloadBuilder implements Builder { /** + * @var null|CategoryReference|CategoryReferenceBuilder */ private $category; /** + * @var ?bool */ private $staged; /** - *

    Reference to a Category.

    + *

    Category the Product was added to.

    * + * @return null|CategoryReference */ public function getCategory() @@ -43,6 +46,9 @@ public function getCategory() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessagePayloadModel.php index 6816a54d449..56f330c2549 100644 --- a/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductAddedToCategoryMessagePayloadModel.php @@ -23,16 +23,19 @@ final class ProductAddedToCategoryMessagePayloadModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'ProductAddedToCategory'; /** + * * @var ?string */ protected $type; /** + * * @var ?CategoryReference */ protected $category; /** + * * @var ?bool */ protected $staged; @@ -43,14 +46,16 @@ final class ProductAddedToCategoryMessagePayloadModel extends JsonObjectModel im */ public function __construct( ?CategoryReference $category = null, - ?bool $staged = null + ?bool $staged = null, + ?string $type = null ) { $this->category = $category; $this->staged = $staged; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,7 +73,8 @@ public function getType() } /** - *

    Reference to a Category.

    + *

    Category the Product was added to.

    + * * * @return null|CategoryReference */ @@ -88,6 +94,9 @@ public function getCategory() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductCreatedMessage.php b/lib/commercetools-api/src/Models/Message/ProductCreatedMessage.php index 902dc3694bb..8017d8aa5b2 100644 --- a/lib/commercetools-api/src/Models/Message/ProductCreatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductCreatedMessage.php @@ -17,6 +17,9 @@ interface ProductCreatedMessage extends Message public const FIELD_PRODUCT_PROJECTION = 'productProjection'; /** + *

    The staged Product Projection of the Product at the time of creation.

    + * + * @return null|ProductProjection */ public function getProductProjection(); diff --git a/lib/commercetools-api/src/Models/Message/ProductCreatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductCreatedMessageBuilder.php index f34dc5c835c..372b2d7cab4 100644 --- a/lib/commercetools-api/src/Models/Message/ProductCreatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductCreatedMessageBuilder.php @@ -30,63 +30,75 @@ final class ProductCreatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|ProductProjection|ProductProjectionBuilder */ private $productProjection; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,6 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The staged Product Projection of the Product at the time of creation.

    + * + * @return null|ProductProjection */ public function getProductProjection() diff --git a/lib/commercetools-api/src/Models/Message/ProductCreatedMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductCreatedMessageModel.php index 8cb71c1f252..885ffaddf66 100644 --- a/lib/commercetools-api/src/Models/Message/ProductCreatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductCreatedMessageModel.php @@ -30,61 +30,73 @@ final class ProductCreatedMessageModel extends JsonObjectModel implements Produc { public const DISCRIMINATOR_VALUE = 'ProductCreated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?ProductProjection */ protected $productProjection; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?ProductProjection $productProjection = null + ?ProductProjection $productProjection = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->productProjection = $productProjection; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,6 +367,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The staged Product Projection of the Product at the time of creation.

    + * + * * @return null|ProductProjection */ public function getProductProjection() diff --git a/lib/commercetools-api/src/Models/Message/ProductCreatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductCreatedMessagePayload.php index 03b7109de3e..fdf1a5cb815 100644 --- a/lib/commercetools-api/src/Models/Message/ProductCreatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductCreatedMessagePayload.php @@ -17,6 +17,9 @@ interface ProductCreatedMessagePayload extends MessagePayload public const FIELD_PRODUCT_PROJECTION = 'productProjection'; /** + *

    The staged Product Projection of the Product at the time of creation.

    + * + * @return null|ProductProjection */ public function getProductProjection(); diff --git a/lib/commercetools-api/src/Models/Message/ProductCreatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductCreatedMessagePayloadBuilder.php index 8035687c523..c2c67f8687d 100644 --- a/lib/commercetools-api/src/Models/Message/ProductCreatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductCreatedMessagePayloadBuilder.php @@ -23,11 +23,15 @@ final class ProductCreatedMessagePayloadBuilder implements Builder { /** + * @var null|ProductProjection|ProductProjectionBuilder */ private $productProjection; /** + *

    The staged Product Projection of the Product at the time of creation.

    + * + * @return null|ProductProjection */ public function getProductProjection() diff --git a/lib/commercetools-api/src/Models/Message/ProductCreatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductCreatedMessagePayloadModel.php index d162953e46c..d238cfad538 100644 --- a/lib/commercetools-api/src/Models/Message/ProductCreatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductCreatedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class ProductCreatedMessagePayloadModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'ProductCreated'; /** + * * @var ?string */ protected $type; /** + * * @var ?ProductProjection */ protected $productProjection; @@ -37,13 +39,15 @@ final class ProductCreatedMessagePayloadModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?ProductProjection $productProjection = null + ?ProductProjection $productProjection = null, + ?string $type = null ) { $this->productProjection = $productProjection; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,9 @@ public function getType() } /** + *

    The staged Product Projection of the Product at the time of creation.

    + * + * * @return null|ProductProjection */ public function getProductProjection() diff --git a/lib/commercetools-api/src/Models/Message/ProductDeletedMessage.php b/lib/commercetools-api/src/Models/Message/ProductDeletedMessage.php index 68d7049303c..0094ff91b97 100644 --- a/lib/commercetools-api/src/Models/Message/ProductDeletedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductDeletedMessage.php @@ -18,11 +18,17 @@ interface ProductDeletedMessage extends Message public const FIELD_CURRENT_PROJECTION = 'currentProjection'; /** + *

    List of image URLs that were removed during the Delete Product request.

    + * + * @return null|array */ public function getRemovedImageUrls(); /** + *

    Current Product Projection of the deleted Product.

    + * + * @return null|ProductProjection */ public function getCurrentProjection(); diff --git a/lib/commercetools-api/src/Models/Message/ProductDeletedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductDeletedMessageBuilder.php index 163318bd965..7b6f72f5008 100644 --- a/lib/commercetools-api/src/Models/Message/ProductDeletedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductDeletedMessageBuilder.php @@ -30,68 +30,81 @@ final class ProductDeletedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?array */ private $removedImageUrls; /** + * @var null|ProductProjection|ProductProjectionBuilder */ private $currentProjection; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,6 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    List of image URLs that were removed during the Delete Product request.

    + * + * @return null|array */ public function getRemovedImageUrls() @@ -186,6 +224,9 @@ public function getRemovedImageUrls() } /** + *

    Current Product Projection of the deleted Product.

    + * + * @return null|ProductProjection */ public function getCurrentProjection() diff --git a/lib/commercetools-api/src/Models/Message/ProductDeletedMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductDeletedMessageModel.php index 6eae6aeaf15..d47d48781e6 100644 --- a/lib/commercetools-api/src/Models/Message/ProductDeletedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductDeletedMessageModel.php @@ -30,66 +30,79 @@ final class ProductDeletedMessageModel extends JsonObjectModel implements Produc { public const DISCRIMINATOR_VALUE = 'ProductDeleted'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?array */ protected $removedImageUrls; /** + * * @var ?ProductProjection */ protected $currentProjection; @@ -110,7 +123,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?array $removedImageUrls = null, - ?ProductProjection $currentProjection = null + ?ProductProjection $currentProjection = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +138,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->removedImageUrls = $removedImageUrls; $this->currentProjection = $currentProjection; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,6 +375,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    List of image URLs that were removed during the Delete Product request.

    + * + * * @return null|array */ public function getRemovedImageUrls() @@ -352,6 +395,9 @@ public function getRemovedImageUrls() } /** + *

    Current Product Projection of the deleted Product.

    + * + * * @return null|ProductProjection */ public function getCurrentProjection() diff --git a/lib/commercetools-api/src/Models/Message/ProductDeletedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductDeletedMessagePayload.php index aaaae9d5a89..bdbfd090937 100644 --- a/lib/commercetools-api/src/Models/Message/ProductDeletedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductDeletedMessagePayload.php @@ -18,11 +18,17 @@ interface ProductDeletedMessagePayload extends MessagePayload public const FIELD_CURRENT_PROJECTION = 'currentProjection'; /** + *

    List of image URLs that were removed during the Delete Product request.

    + * + * @return null|array */ public function getRemovedImageUrls(); /** + *

    Current Product Projection of the deleted Product.

    + * + * @return null|ProductProjection */ public function getCurrentProjection(); diff --git a/lib/commercetools-api/src/Models/Message/ProductDeletedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductDeletedMessagePayloadBuilder.php index 4c19a6781dd..b72ab398a66 100644 --- a/lib/commercetools-api/src/Models/Message/ProductDeletedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductDeletedMessagePayloadBuilder.php @@ -23,16 +23,21 @@ final class ProductDeletedMessagePayloadBuilder implements Builder { /** + * @var ?array */ private $removedImageUrls; /** + * @var null|ProductProjection|ProductProjectionBuilder */ private $currentProjection; /** + *

    List of image URLs that were removed during the Delete Product request.

    + * + * @return null|array */ public function getRemovedImageUrls() @@ -41,6 +46,9 @@ public function getRemovedImageUrls() } /** + *

    Current Product Projection of the deleted Product.

    + * + * @return null|ProductProjection */ public function getCurrentProjection() diff --git a/lib/commercetools-api/src/Models/Message/ProductDeletedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductDeletedMessagePayloadModel.php index 40e32adcf03..34acfdccd51 100644 --- a/lib/commercetools-api/src/Models/Message/ProductDeletedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductDeletedMessagePayloadModel.php @@ -23,16 +23,19 @@ final class ProductDeletedMessagePayloadModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'ProductDeleted'; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $removedImageUrls; /** + * * @var ?ProductProjection */ protected $currentProjection; @@ -43,14 +46,16 @@ final class ProductDeletedMessagePayloadModel extends JsonObjectModel implements */ public function __construct( ?array $removedImageUrls = null, - ?ProductProjection $currentProjection = null + ?ProductProjection $currentProjection = null, + ?string $type = null ) { $this->removedImageUrls = $removedImageUrls; $this->currentProjection = $currentProjection; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,6 +73,9 @@ public function getType() } /** + *

    List of image URLs that were removed during the Delete Product request.

    + * + * * @return null|array */ public function getRemovedImageUrls() @@ -85,6 +93,9 @@ public function getRemovedImageUrls() } /** + *

    Current Product Projection of the deleted Product.

    + * + * * @return null|ProductProjection */ public function getCurrentProjection() diff --git a/lib/commercetools-api/src/Models/Message/ProductImageAddedMessage.php b/lib/commercetools-api/src/Models/Message/ProductImageAddedMessage.php index 318236cbab1..ea04adaece9 100644 --- a/lib/commercetools-api/src/Models/Message/ProductImageAddedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductImageAddedMessage.php @@ -19,16 +19,25 @@ interface ProductImageAddedMessage extends Message public const FIELD_STAGED = 'staged'; /** + *

    Unique identifier of the Product Variant to which the Image was added.

    + * + * @return null|int */ public function getVariantId(); /** + *

    Image that was added.

    + * + * @return null|Image */ public function getImage(); /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Message/ProductImageAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductImageAddedMessageBuilder.php index 7a988100071..0c8437c2b25 100644 --- a/lib/commercetools-api/src/Models/Message/ProductImageAddedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductImageAddedMessageBuilder.php @@ -30,73 +30,87 @@ final class ProductImageAddedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?int */ private $variantId; /** + * @var null|Image|ImageBuilder */ private $image; /** + * @var ?bool */ private $staged; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -105,6 +119,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -113,6 +130,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -121,6 +141,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -129,8 +152,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -141,6 +165,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -149,6 +174,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -157,8 +186,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -167,6 +197,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -175,6 +208,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -183,6 +219,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Product Variant to which the Image was added.

    + * + * @return null|int */ public function getVariantId() @@ -191,6 +230,9 @@ public function getVariantId() } /** + *

    Image that was added.

    + * + * @return null|Image */ public function getImage() @@ -199,6 +241,9 @@ public function getImage() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductImageAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductImageAddedMessageModel.php index 006c8646497..a6f0132a262 100644 --- a/lib/commercetools-api/src/Models/Message/ProductImageAddedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductImageAddedMessageModel.php @@ -30,71 +30,85 @@ final class ProductImageAddedMessageModel extends JsonObjectModel implements Pro { public const DISCRIMINATOR_VALUE = 'ProductImageAdded'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?int */ protected $variantId; /** + * * @var ?Image */ protected $image; /** + * * @var ?bool */ protected $staged; @@ -116,7 +130,8 @@ public function __construct( ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?int $variantId = null, ?Image $image = null, - ?bool $staged = null + ?bool $staged = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -131,11 +146,12 @@ public function __construct( $this->variantId = $variantId; $this->image = $image; $this->staged = $staged; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -154,6 +170,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -171,6 +190,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -192,6 +214,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -213,7 +238,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -235,6 +261,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -253,6 +280,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -270,7 +301,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -290,6 +322,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -307,6 +342,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -324,6 +362,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -342,6 +383,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Product Variant to which the Image was added.

    + * + * * @return null|int */ public function getVariantId() @@ -359,6 +403,9 @@ public function getVariantId() } /** + *

    Image that was added.

    + * + * * @return null|Image */ public function getImage() @@ -377,6 +424,9 @@ public function getImage() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductImageAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductImageAddedMessagePayload.php index 32e3c8fe1ae..bab24b3bb23 100644 --- a/lib/commercetools-api/src/Models/Message/ProductImageAddedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductImageAddedMessagePayload.php @@ -19,16 +19,25 @@ interface ProductImageAddedMessagePayload extends MessagePayload public const FIELD_STAGED = 'staged'; /** + *

    Unique identifier of the Product Variant to which the Image was added.

    + * + * @return null|int */ public function getVariantId(); /** + *

    Image that was added.

    + * + * @return null|Image */ public function getImage(); /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Message/ProductImageAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductImageAddedMessagePayloadBuilder.php index 1fb07e027c1..8e3fc332acc 100644 --- a/lib/commercetools-api/src/Models/Message/ProductImageAddedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductImageAddedMessagePayloadBuilder.php @@ -23,21 +23,27 @@ final class ProductImageAddedMessagePayloadBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var null|Image|ImageBuilder */ private $image; /** + * @var ?bool */ private $staged; /** + *

    Unique identifier of the Product Variant to which the Image was added.

    + * + * @return null|int */ public function getVariantId() @@ -46,6 +52,9 @@ public function getVariantId() } /** + *

    Image that was added.

    + * + * @return null|Image */ public function getImage() @@ -54,6 +63,9 @@ public function getImage() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductImageAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductImageAddedMessagePayloadModel.php index e54b67d5b91..9ad9267c7bd 100644 --- a/lib/commercetools-api/src/Models/Message/ProductImageAddedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductImageAddedMessagePayloadModel.php @@ -23,21 +23,25 @@ final class ProductImageAddedMessagePayloadModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'ProductImageAdded'; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $variantId; /** + * * @var ?Image */ protected $image; /** + * * @var ?bool */ protected $staged; @@ -49,15 +53,17 @@ final class ProductImageAddedMessagePayloadModel extends JsonObjectModel impleme public function __construct( ?int $variantId = null, ?Image $image = null, - ?bool $staged = null + ?bool $staged = null, + ?string $type = null ) { $this->variantId = $variantId; $this->image = $image; $this->staged = $staged; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -75,6 +81,9 @@ public function getType() } /** + *

    Unique identifier of the Product Variant to which the Image was added.

    + * + * * @return null|int */ public function getVariantId() @@ -92,6 +101,9 @@ public function getVariantId() } /** + *

    Image that was added.

    + * + * * @return null|Image */ public function getImage() @@ -110,6 +122,9 @@ public function getImage() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessage.php b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessage.php index 9d85dc142e7..18a4cbfcbdf 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessage.php @@ -16,6 +16,9 @@ interface ProductPriceDiscountsSetMessage extends Message public const FIELD_UPDATED_PRICES = 'updatedPrices'; /** + *

    Array containing details about the Embedded Prices that were updated.

    + * + * @return null|ProductPriceDiscountsSetUpdatedPriceCollection */ public function getUpdatedPrices(); diff --git a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessageBuilder.php index f4d7582bde7..f7ad65496ef 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessageBuilder.php @@ -28,63 +28,75 @@ final class ProductPriceDiscountsSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?ProductPriceDiscountsSetUpdatedPriceCollection */ private $updatedPrices; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -93,6 +105,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -101,6 +116,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -109,6 +127,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -117,8 +138,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -129,6 +151,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -137,6 +160,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -145,8 +172,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -155,6 +183,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -163,6 +194,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -171,6 +205,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Array containing details about the Embedded Prices that were updated.

    + * + * @return null|ProductPriceDiscountsSetUpdatedPriceCollection */ public function getUpdatedPrices() diff --git a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessageModel.php index f4c8685fe79..bc0160ecb74 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessageModel.php @@ -28,61 +28,73 @@ final class ProductPriceDiscountsSetMessageModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'ProductPriceDiscountsSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?ProductPriceDiscountsSetUpdatedPriceCollection */ protected $updatedPrices; @@ -102,7 +114,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?ProductPriceDiscountsSetUpdatedPriceCollection $updatedPrices = null + ?ProductPriceDiscountsSetUpdatedPriceCollection $updatedPrices = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -115,11 +128,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->updatedPrices = $updatedPrices; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -138,6 +152,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -155,6 +172,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -176,6 +196,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -197,7 +220,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -219,6 +243,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -237,6 +262,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -254,7 +283,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -274,6 +304,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -291,6 +324,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -308,6 +344,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -326,6 +365,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Array containing details about the Embedded Prices that were updated.

    + * + * * @return null|ProductPriceDiscountsSetUpdatedPriceCollection */ public function getUpdatedPrices() diff --git a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessagePayload.php index f9c7dc1721b..f17e9a14d28 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessagePayload.php @@ -16,6 +16,9 @@ interface ProductPriceDiscountsSetMessagePayload extends MessagePayload public const FIELD_UPDATED_PRICES = 'updatedPrices'; /** + *

    Array containing details about the Embedded Prices that were updated.

    + * + * @return null|ProductPriceDiscountsSetUpdatedPriceCollection */ public function getUpdatedPrices(); diff --git a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessagePayloadBuilder.php index 0dff190a66e..f87474221c6 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessagePayloadBuilder.php @@ -21,11 +21,15 @@ final class ProductPriceDiscountsSetMessagePayloadBuilder implements Builder { /** + * @var ?ProductPriceDiscountsSetUpdatedPriceCollection */ private $updatedPrices; /** + *

    Array containing details about the Embedded Prices that were updated.

    + * + * @return null|ProductPriceDiscountsSetUpdatedPriceCollection */ public function getUpdatedPrices() diff --git a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessagePayloadModel.php index 3210941a1e6..6638a4ddb12 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetMessagePayloadModel.php @@ -21,11 +21,13 @@ final class ProductPriceDiscountsSetMessagePayloadModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'ProductPriceDiscountsSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?ProductPriceDiscountsSetUpdatedPriceCollection */ protected $updatedPrices; @@ -35,13 +37,15 @@ final class ProductPriceDiscountsSetMessagePayloadModel extends JsonObjectModel * @psalm-suppress MissingParamType */ public function __construct( - ?ProductPriceDiscountsSetUpdatedPriceCollection $updatedPrices = null + ?ProductPriceDiscountsSetUpdatedPriceCollection $updatedPrices = null, + ?string $type = null ) { $this->updatedPrices = $updatedPrices; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,6 +63,9 @@ public function getType() } /** + *

    Array containing details about the Embedded Prices that were updated.

    + * + * * @return null|ProductPriceDiscountsSetUpdatedPriceCollection */ public function getUpdatedPrices() diff --git a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetUpdatedPrice.php b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetUpdatedPrice.php index 4f09bf80802..15bdd0963cd 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetUpdatedPrice.php +++ b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetUpdatedPrice.php @@ -22,31 +22,49 @@ interface ProductPriceDiscountsSetUpdatedPrice extends JsonObject public const FIELD_STAGED = 'staged'; /** + *

    Unique identifier of the ProductVariant for which the Discount was set.

    + * + * @return null|int */ public function getVariantId(); /** + *

    Key of the ProductVariant for which Discount was set.

    + * + * @return null|string */ public function getVariantKey(); /** + *

    SKU of the ProductVariant for which Discount was set.

    + * + * @return null|string */ public function getSku(); /** + *

    Unique identifier of the Embedded Price.

    + * + * @return null|string */ public function getPriceId(); /** + *

    Discounted Price for the ProductVariant for which Discount was set.

    + * + * @return null|DiscountedPrice */ public function getDiscounted(); /** + *

    Whether the update was only applied to the staged ProductProjection.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetUpdatedPriceBuilder.php b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetUpdatedPriceBuilder.php index 8903bad55eb..3c2b51b6669 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetUpdatedPriceBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetUpdatedPriceBuilder.php @@ -23,36 +23,45 @@ final class ProductPriceDiscountsSetUpdatedPriceBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $variantKey; /** + * @var ?string */ private $sku; /** + * @var ?string */ private $priceId; /** + * @var null|DiscountedPrice|DiscountedPriceBuilder */ private $discounted; /** + * @var ?bool */ private $staged; /** + *

    Unique identifier of the ProductVariant for which the Discount was set.

    + * + * @return null|int */ public function getVariantId() @@ -61,6 +70,9 @@ public function getVariantId() } /** + *

    Key of the ProductVariant for which Discount was set.

    + * + * @return null|string */ public function getVariantKey() @@ -69,6 +81,9 @@ public function getVariantKey() } /** + *

    SKU of the ProductVariant for which Discount was set.

    + * + * @return null|string */ public function getSku() @@ -77,6 +92,9 @@ public function getSku() } /** + *

    Unique identifier of the Embedded Price.

    + * + * @return null|string */ public function getPriceId() @@ -85,6 +103,9 @@ public function getPriceId() } /** + *

    Discounted Price for the ProductVariant for which Discount was set.

    + * + * @return null|DiscountedPrice */ public function getDiscounted() @@ -93,6 +114,9 @@ public function getDiscounted() } /** + *

    Whether the update was only applied to the staged ProductProjection.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetUpdatedPriceModel.php b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetUpdatedPriceModel.php index db7a39836cf..54f7c132889 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetUpdatedPriceModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductPriceDiscountsSetUpdatedPriceModel.php @@ -22,31 +22,37 @@ final class ProductPriceDiscountsSetUpdatedPriceModel extends JsonObjectModel implements ProductPriceDiscountsSetUpdatedPrice { /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $variantKey; /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $priceId; /** + * * @var ?DiscountedPrice */ protected $discounted; /** + * * @var ?bool */ protected $staged; @@ -72,6 +78,9 @@ public function __construct( } /** + *

    Unique identifier of the ProductVariant for which the Discount was set.

    + * + * * @return null|int */ public function getVariantId() @@ -89,6 +98,9 @@ public function getVariantId() } /** + *

    Key of the ProductVariant for which Discount was set.

    + * + * * @return null|string */ public function getVariantKey() @@ -106,6 +118,9 @@ public function getVariantKey() } /** + *

    SKU of the ProductVariant for which Discount was set.

    + * + * * @return null|string */ public function getSku() @@ -123,6 +138,9 @@ public function getSku() } /** + *

    Unique identifier of the Embedded Price.

    + * + * * @return null|string */ public function getPriceId() @@ -140,6 +158,9 @@ public function getPriceId() } /** + *

    Discounted Price for the ProductVariant for which Discount was set.

    + * + * * @return null|DiscountedPrice */ public function getDiscounted() @@ -158,6 +179,9 @@ public function getDiscounted() } /** + *

    Whether the update was only applied to the staged ProductProjection.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessage.php b/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessage.php index 7f20242143a..f7a1ea39231 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessage.php @@ -22,31 +22,49 @@ interface ProductPriceExternalDiscountSetMessage extends Message public const FIELD_STAGED = 'staged'; /** + *

    Unique identifier of the Product Variant for which the Discount was set.

    + * + * @return null|int */ public function getVariantId(); /** + *

    Key of the Product Variant for which the Discount was set.

    + * + * @return null|string */ public function getVariantKey(); /** + *

    SKU of the Product Variant for which Discount was set.

    + * + * @return null|string */ public function getSku(); /** + *

    Unique identifier of the Embedded Price.

    + * + * @return null|string */ public function getPriceId(); /** + *

    Discounted Price for the Product Variant for which Discount was set.

    + * + * @return null|DiscountedPrice */ public function getDiscounted(); /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessageBuilder.php index 2e2d1a3a2d7..b076bb9d66f 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessageBuilder.php @@ -30,88 +30,105 @@ final class ProductPriceExternalDiscountSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $variantKey; /** + * @var ?string */ private $sku; /** + * @var ?string */ private $priceId; /** + * @var null|DiscountedPrice|DiscountedPriceBuilder */ private $discounted; /** + * @var ?bool */ private $staged; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -120,6 +137,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -128,6 +148,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -136,6 +159,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -144,8 +170,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -156,6 +183,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -164,6 +192,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -172,8 +204,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -182,6 +215,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -190,6 +226,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -198,6 +237,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Product Variant for which the Discount was set.

    + * + * @return null|int */ public function getVariantId() @@ -206,6 +248,9 @@ public function getVariantId() } /** + *

    Key of the Product Variant for which the Discount was set.

    + * + * @return null|string */ public function getVariantKey() @@ -214,6 +259,9 @@ public function getVariantKey() } /** + *

    SKU of the Product Variant for which Discount was set.

    + * + * @return null|string */ public function getSku() @@ -222,6 +270,9 @@ public function getSku() } /** + *

    Unique identifier of the Embedded Price.

    + * + * @return null|string */ public function getPriceId() @@ -230,6 +281,9 @@ public function getPriceId() } /** + *

    Discounted Price for the Product Variant for which Discount was set.

    + * + * @return null|DiscountedPrice */ public function getDiscounted() @@ -238,6 +292,9 @@ public function getDiscounted() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessageModel.php index 21ca22e9864..d79c03940e3 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessageModel.php @@ -30,86 +30,103 @@ final class ProductPriceExternalDiscountSetMessageModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'ProductPriceExternalDiscountSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $variantKey; /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $priceId; /** + * * @var ?DiscountedPrice */ protected $discounted; /** + * * @var ?bool */ protected $staged; @@ -134,7 +151,8 @@ public function __construct( ?string $sku = null, ?string $priceId = null, ?DiscountedPrice $discounted = null, - ?bool $staged = null + ?bool $staged = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -152,11 +170,12 @@ public function __construct( $this->priceId = $priceId; $this->discounted = $discounted; $this->staged = $staged; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -175,6 +194,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -192,6 +214,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -213,6 +238,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -234,7 +262,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -256,6 +285,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -274,6 +304,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -291,7 +325,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -311,6 +346,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -328,6 +366,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -345,6 +386,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -363,6 +407,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Product Variant for which the Discount was set.

    + * + * * @return null|int */ public function getVariantId() @@ -380,6 +427,9 @@ public function getVariantId() } /** + *

    Key of the Product Variant for which the Discount was set.

    + * + * * @return null|string */ public function getVariantKey() @@ -397,6 +447,9 @@ public function getVariantKey() } /** + *

    SKU of the Product Variant for which Discount was set.

    + * + * * @return null|string */ public function getSku() @@ -414,6 +467,9 @@ public function getSku() } /** + *

    Unique identifier of the Embedded Price.

    + * + * * @return null|string */ public function getPriceId() @@ -431,6 +487,9 @@ public function getPriceId() } /** + *

    Discounted Price for the Product Variant for which Discount was set.

    + * + * * @return null|DiscountedPrice */ public function getDiscounted() @@ -449,6 +508,9 @@ public function getDiscounted() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessagePayload.php index 5bd8ce75b4f..df2fce69ff7 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessagePayload.php @@ -22,31 +22,49 @@ interface ProductPriceExternalDiscountSetMessagePayload extends MessagePayload public const FIELD_STAGED = 'staged'; /** + *

    Unique identifier of the Product Variant for which the Discount was set.

    + * + * @return null|int */ public function getVariantId(); /** + *

    Key of the Product Variant for which the Discount was set.

    + * + * @return null|string */ public function getVariantKey(); /** + *

    SKU of the Product Variant for which Discount was set.

    + * + * @return null|string */ public function getSku(); /** + *

    Unique identifier of the Embedded Price.

    + * + * @return null|string */ public function getPriceId(); /** + *

    Discounted Price for the Product Variant for which Discount was set.

    + * + * @return null|DiscountedPrice */ public function getDiscounted(); /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessagePayloadBuilder.php index 4f5ff15a0e8..7c4f363154e 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessagePayloadBuilder.php @@ -23,36 +23,45 @@ final class ProductPriceExternalDiscountSetMessagePayloadBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $variantKey; /** + * @var ?string */ private $sku; /** + * @var ?string */ private $priceId; /** + * @var null|DiscountedPrice|DiscountedPriceBuilder */ private $discounted; /** + * @var ?bool */ private $staged; /** + *

    Unique identifier of the Product Variant for which the Discount was set.

    + * + * @return null|int */ public function getVariantId() @@ -61,6 +70,9 @@ public function getVariantId() } /** + *

    Key of the Product Variant for which the Discount was set.

    + * + * @return null|string */ public function getVariantKey() @@ -69,6 +81,9 @@ public function getVariantKey() } /** + *

    SKU of the Product Variant for which Discount was set.

    + * + * @return null|string */ public function getSku() @@ -77,6 +92,9 @@ public function getSku() } /** + *

    Unique identifier of the Embedded Price.

    + * + * @return null|string */ public function getPriceId() @@ -85,6 +103,9 @@ public function getPriceId() } /** + *

    Discounted Price for the Product Variant for which Discount was set.

    + * + * @return null|DiscountedPrice */ public function getDiscounted() @@ -93,6 +114,9 @@ public function getDiscounted() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessagePayloadModel.php index 6385c47ba48..141464a743b 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductPriceExternalDiscountSetMessagePayloadModel.php @@ -23,36 +23,43 @@ final class ProductPriceExternalDiscountSetMessagePayloadModel extends JsonObjec { public const DISCRIMINATOR_VALUE = 'ProductPriceExternalDiscountSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $variantKey; /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $priceId; /** + * * @var ?DiscountedPrice */ protected $discounted; /** + * * @var ?bool */ protected $staged; @@ -67,7 +74,8 @@ public function __construct( ?string $sku = null, ?string $priceId = null, ?DiscountedPrice $discounted = null, - ?bool $staged = null + ?bool $staged = null, + ?string $type = null ) { $this->variantId = $variantId; $this->variantKey = $variantKey; @@ -75,10 +83,11 @@ public function __construct( $this->priceId = $priceId; $this->discounted = $discounted; $this->staged = $staged; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -96,6 +105,9 @@ public function getType() } /** + *

    Unique identifier of the Product Variant for which the Discount was set.

    + * + * * @return null|int */ public function getVariantId() @@ -113,6 +125,9 @@ public function getVariantId() } /** + *

    Key of the Product Variant for which the Discount was set.

    + * + * * @return null|string */ public function getVariantKey() @@ -130,6 +145,9 @@ public function getVariantKey() } /** + *

    SKU of the Product Variant for which Discount was set.

    + * + * * @return null|string */ public function getSku() @@ -147,6 +165,9 @@ public function getSku() } /** + *

    Unique identifier of the Embedded Price.

    + * + * * @return null|string */ public function getPriceId() @@ -164,6 +185,9 @@ public function getPriceId() } /** + *

    Discounted Price for the Product Variant for which Discount was set.

    + * + * * @return null|DiscountedPrice */ public function getDiscounted() @@ -182,6 +206,9 @@ public function getDiscounted() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductPublishedMessage.php b/lib/commercetools-api/src/Models/Message/ProductPublishedMessage.php index ab9d54c32e8..8499cb5081d 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPublishedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductPublishedMessage.php @@ -19,16 +19,25 @@ interface ProductPublishedMessage extends Message public const FIELD_SCOPE = 'scope'; /** + *

    List of image URLs which were removed during the Publish update action.

    + * + * @return null|array */ public function getRemovedImageUrls(); /** + *

    Current Product Projection of the Product at the time of creation.

    + * + * @return null|ProductProjection */ public function getProductProjection(); /** + *

    Publishing Scope that was used during the Publish update action.

    + * + * @return null|string */ public function getScope(); diff --git a/lib/commercetools-api/src/Models/Message/ProductPublishedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductPublishedMessageBuilder.php index b83caf46925..4fc2dff84fc 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPublishedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductPublishedMessageBuilder.php @@ -30,73 +30,87 @@ final class ProductPublishedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?array */ private $removedImageUrls; /** + * @var null|ProductProjection|ProductProjectionBuilder */ private $productProjection; /** + * @var ?string */ private $scope; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -105,6 +119,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -113,6 +130,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -121,6 +141,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -129,8 +152,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -141,6 +165,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -149,6 +174,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -157,8 +186,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -167,6 +197,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -175,6 +208,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -183,6 +219,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    List of image URLs which were removed during the Publish update action.

    + * + * @return null|array */ public function getRemovedImageUrls() @@ -191,6 +230,9 @@ public function getRemovedImageUrls() } /** + *

    Current Product Projection of the Product at the time of creation.

    + * + * @return null|ProductProjection */ public function getProductProjection() @@ -199,6 +241,9 @@ public function getProductProjection() } /** + *

    Publishing Scope that was used during the Publish update action.

    + * + * @return null|string */ public function getScope() diff --git a/lib/commercetools-api/src/Models/Message/ProductPublishedMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductPublishedMessageModel.php index 1806116b6b6..57ed525736e 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPublishedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductPublishedMessageModel.php @@ -30,71 +30,85 @@ final class ProductPublishedMessageModel extends JsonObjectModel implements Prod { public const DISCRIMINATOR_VALUE = 'ProductPublished'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?array */ protected $removedImageUrls; /** + * * @var ?ProductProjection */ protected $productProjection; /** + * * @var ?string */ protected $scope; @@ -116,7 +130,8 @@ public function __construct( ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?array $removedImageUrls = null, ?ProductProjection $productProjection = null, - ?string $scope = null + ?string $scope = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -131,11 +146,12 @@ public function __construct( $this->removedImageUrls = $removedImageUrls; $this->productProjection = $productProjection; $this->scope = $scope; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -154,6 +170,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -171,6 +190,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -192,6 +214,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -213,7 +238,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -235,6 +261,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -253,6 +280,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -270,7 +301,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -290,6 +322,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -307,6 +342,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -324,6 +362,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -342,6 +383,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    List of image URLs which were removed during the Publish update action.

    + * + * * @return null|array */ public function getRemovedImageUrls() @@ -359,6 +403,9 @@ public function getRemovedImageUrls() } /** + *

    Current Product Projection of the Product at the time of creation.

    + * + * * @return null|ProductProjection */ public function getProductProjection() @@ -377,6 +424,9 @@ public function getProductProjection() } /** + *

    Publishing Scope that was used during the Publish update action.

    + * + * * @return null|string */ public function getScope() diff --git a/lib/commercetools-api/src/Models/Message/ProductPublishedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductPublishedMessagePayload.php index 3e55e86a1e1..8ea4a7fc2a5 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPublishedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductPublishedMessagePayload.php @@ -19,16 +19,25 @@ interface ProductPublishedMessagePayload extends MessagePayload public const FIELD_SCOPE = 'scope'; /** + *

    List of image URLs which were removed during the Publish update action.

    + * + * @return null|array */ public function getRemovedImageUrls(); /** + *

    Current Product Projection of the Product at the time of creation.

    + * + * @return null|ProductProjection */ public function getProductProjection(); /** + *

    Publishing Scope that was used during the Publish update action.

    + * + * @return null|string */ public function getScope(); diff --git a/lib/commercetools-api/src/Models/Message/ProductPublishedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductPublishedMessagePayloadBuilder.php index ded1805b6a2..793217016a5 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPublishedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductPublishedMessagePayloadBuilder.php @@ -23,21 +23,27 @@ final class ProductPublishedMessagePayloadBuilder implements Builder { /** + * @var ?array */ private $removedImageUrls; /** + * @var null|ProductProjection|ProductProjectionBuilder */ private $productProjection; /** + * @var ?string */ private $scope; /** + *

    List of image URLs which were removed during the Publish update action.

    + * + * @return null|array */ public function getRemovedImageUrls() @@ -46,6 +52,9 @@ public function getRemovedImageUrls() } /** + *

    Current Product Projection of the Product at the time of creation.

    + * + * @return null|ProductProjection */ public function getProductProjection() @@ -54,6 +63,9 @@ public function getProductProjection() } /** + *

    Publishing Scope that was used during the Publish update action.

    + * + * @return null|string */ public function getScope() diff --git a/lib/commercetools-api/src/Models/Message/ProductPublishedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductPublishedMessagePayloadModel.php index 19d70890834..9e946939a88 100644 --- a/lib/commercetools-api/src/Models/Message/ProductPublishedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductPublishedMessagePayloadModel.php @@ -23,21 +23,25 @@ final class ProductPublishedMessagePayloadModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'ProductPublished'; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $removedImageUrls; /** + * * @var ?ProductProjection */ protected $productProjection; /** + * * @var ?string */ protected $scope; @@ -49,15 +53,17 @@ final class ProductPublishedMessagePayloadModel extends JsonObjectModel implemen public function __construct( ?array $removedImageUrls = null, ?ProductProjection $productProjection = null, - ?string $scope = null + ?string $scope = null, + ?string $type = null ) { $this->removedImageUrls = $removedImageUrls; $this->productProjection = $productProjection; $this->scope = $scope; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -75,6 +81,9 @@ public function getType() } /** + *

    List of image URLs which were removed during the Publish update action.

    + * + * * @return null|array */ public function getRemovedImageUrls() @@ -92,6 +101,9 @@ public function getRemovedImageUrls() } /** + *

    Current Product Projection of the Product at the time of creation.

    + * + * * @return null|ProductProjection */ public function getProductProjection() @@ -110,6 +122,9 @@ public function getProductProjection() } /** + *

    Publishing Scope that was used during the Publish update action.

    + * + * * @return null|string */ public function getScope() diff --git a/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessage.php b/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessage.php index 96a0eacc15b..e5172bd0da4 100644 --- a/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessage.php @@ -18,13 +18,17 @@ interface ProductRemovedFromCategoryMessage extends Message public const FIELD_STAGED = 'staged'; /** - *

    Reference to a Category.

    + *

    Category the Product was removed from.

    * + * @return null|CategoryReference */ public function getCategory(); /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessageBuilder.php index c5656e80464..e77d1b5af12 100644 --- a/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessageBuilder.php @@ -30,68 +30,81 @@ final class ProductRemovedFromCategoryMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|CategoryReference|CategoryReferenceBuilder */ private $category; /** + * @var ?bool */ private $staged; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,8 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a Category.

    + *

    Category the Product was removed from.

    * + * @return null|CategoryReference */ public function getCategory() @@ -188,6 +224,9 @@ public function getCategory() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessageModel.php index 7e236004184..85b0f7e9b5c 100644 --- a/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessageModel.php @@ -30,66 +30,79 @@ final class ProductRemovedFromCategoryMessageModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'ProductRemovedFromCategory'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?CategoryReference */ protected $category; /** + * * @var ?bool */ protected $staged; @@ -110,7 +123,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?CategoryReference $category = null, - ?bool $staged = null + ?bool $staged = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +138,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->category = $category; $this->staged = $staged; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,7 +375,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a Category.

    + *

    Category the Product was removed from.

    + * * * @return null|CategoryReference */ @@ -355,6 +396,9 @@ public function getCategory() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessagePayload.php index e777da033b2..6f74c15d7e3 100644 --- a/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessagePayload.php @@ -18,13 +18,17 @@ interface ProductRemovedFromCategoryMessagePayload extends MessagePayload public const FIELD_STAGED = 'staged'; /** - *

    Reference to a Category.

    + *

    Category the Product was removed from.

    * + * @return null|CategoryReference */ public function getCategory(); /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessagePayloadBuilder.php index c3c0c519d67..0ea82b19bf9 100644 --- a/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessagePayloadBuilder.php @@ -23,18 +23,21 @@ final class ProductRemovedFromCategoryMessagePayloadBuilder implements Builder { /** + * @var null|CategoryReference|CategoryReferenceBuilder */ private $category; /** + * @var ?bool */ private $staged; /** - *

    Reference to a Category.

    + *

    Category the Product was removed from.

    * + * @return null|CategoryReference */ public function getCategory() @@ -43,6 +46,9 @@ public function getCategory() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessagePayloadModel.php index 6a75403f5c1..4245716c8c3 100644 --- a/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductRemovedFromCategoryMessagePayloadModel.php @@ -23,16 +23,19 @@ final class ProductRemovedFromCategoryMessagePayloadModel extends JsonObjectMode { public const DISCRIMINATOR_VALUE = 'ProductRemovedFromCategory'; /** + * * @var ?string */ protected $type; /** + * * @var ?CategoryReference */ protected $category; /** + * * @var ?bool */ protected $staged; @@ -43,14 +46,16 @@ final class ProductRemovedFromCategoryMessagePayloadModel extends JsonObjectMode */ public function __construct( ?CategoryReference $category = null, - ?bool $staged = null + ?bool $staged = null, + ?string $type = null ) { $this->category = $category; $this->staged = $staged; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,7 +73,8 @@ public function getType() } /** - *

    Reference to a Category.

    + *

    Category the Product was removed from.

    + * * * @return null|CategoryReference */ @@ -88,6 +94,9 @@ public function getCategory() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessage.php b/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessage.php index 4a0bf97c606..da4703cd6c4 100644 --- a/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessage.php @@ -16,6 +16,9 @@ interface ProductRevertedStagedChangesMessage extends Message public const FIELD_REMOVED_IMAGE_URLS = 'removedImageUrls'; /** + *

    List of image URLs that were removed during the Revert Staged Changes update action.

    + * + * @return null|array */ public function getRemovedImageUrls(); diff --git a/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessageBuilder.php index 702a2abae96..73576da2a82 100644 --- a/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessageBuilder.php @@ -28,63 +28,75 @@ final class ProductRevertedStagedChangesMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?array */ private $removedImageUrls; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -93,6 +105,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -101,6 +116,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -109,6 +127,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -117,8 +138,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -129,6 +151,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -137,6 +160,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -145,8 +172,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -155,6 +183,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -163,6 +194,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -171,6 +205,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    List of image URLs that were removed during the Revert Staged Changes update action.

    + * + * @return null|array */ public function getRemovedImageUrls() diff --git a/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessageModel.php index c0888c3e612..a1429a996c7 100644 --- a/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessageModel.php @@ -28,61 +28,73 @@ final class ProductRevertedStagedChangesMessageModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'ProductRevertedStagedChanges'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?array */ protected $removedImageUrls; @@ -102,7 +114,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?array $removedImageUrls = null + ?array $removedImageUrls = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -115,11 +128,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->removedImageUrls = $removedImageUrls; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -138,6 +152,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -155,6 +172,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -176,6 +196,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -197,7 +220,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -219,6 +243,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -237,6 +262,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -254,7 +283,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -274,6 +304,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -291,6 +324,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -308,6 +344,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -326,6 +365,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    List of image URLs that were removed during the Revert Staged Changes update action.

    + * + * * @return null|array */ public function getRemovedImageUrls() diff --git a/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessagePayload.php index 94f559f7f7b..2abca922754 100644 --- a/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessagePayload.php @@ -16,6 +16,9 @@ interface ProductRevertedStagedChangesMessagePayload extends MessagePayload public const FIELD_REMOVED_IMAGE_URLS = 'removedImageUrls'; /** + *

    List of image URLs that were removed during the Revert Staged Changes update action.

    + * + * @return null|array */ public function getRemovedImageUrls(); diff --git a/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessagePayloadBuilder.php index e47e9aae99b..1bb70f9b435 100644 --- a/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessagePayloadBuilder.php @@ -21,11 +21,15 @@ final class ProductRevertedStagedChangesMessagePayloadBuilder implements Builder { /** + * @var ?array */ private $removedImageUrls; /** + *

    List of image URLs that were removed during the Revert Staged Changes update action.

    + * + * @return null|array */ public function getRemovedImageUrls() diff --git a/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessagePayloadModel.php index 5d423f59ef8..02a71c93be4 100644 --- a/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductRevertedStagedChangesMessagePayloadModel.php @@ -21,11 +21,13 @@ final class ProductRevertedStagedChangesMessagePayloadModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'ProductRevertedStagedChanges'; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $removedImageUrls; @@ -35,13 +37,15 @@ final class ProductRevertedStagedChangesMessagePayloadModel extends JsonObjectMo * @psalm-suppress MissingParamType */ public function __construct( - ?array $removedImageUrls = null + ?array $removedImageUrls = null, + ?string $type = null ) { $this->removedImageUrls = $removedImageUrls; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,6 +63,9 @@ public function getType() } /** + *

    List of image URLs that were removed during the Revert Staged Changes update action.

    + * + * * @return null|array */ public function getRemovedImageUrls() diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessage.php b/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessage.php index b2475eed330..f44011f6810 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessage.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\Message; -use Commercetools\Api\Models\ProductSelection\ProductSelectionType; +use Commercetools\Api\Models\ProductSelection\IndividualProductSelectionType; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -17,12 +17,15 @@ interface ProductSelectionCreatedMessage extends Message public const FIELD_PRODUCT_SELECTION = 'productSelection'; /** - * @return null|ProductSelectionType + *

    The type and name of the individual Product Selection.

    + * + + * @return null|IndividualProductSelectionType */ public function getProductSelection(); /** - * @param ?ProductSelectionType $productSelection + * @param ?IndividualProductSelectionType $productSelection */ - public function setProductSelection(?ProductSelectionType $productSelection): void; + public function setProductSelection(?IndividualProductSelectionType $productSelection): void; } diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessageBuilder.php index 037364944c6..a756d8f86dc 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessageBuilder.php @@ -14,8 +14,8 @@ use Commercetools\Api\Models\Common\LastModifiedByBuilder; use Commercetools\Api\Models\Common\Reference; use Commercetools\Api\Models\Common\ReferenceBuilder; -use Commercetools\Api\Models\ProductSelection\ProductSelectionType; -use Commercetools\Api\Models\ProductSelection\ProductSelectionTypeBuilder; +use Commercetools\Api\Models\ProductSelection\IndividualProductSelectionType; +use Commercetools\Api\Models\ProductSelection\IndividualProductSelectionTypeBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -30,63 +30,75 @@ final class ProductSelectionCreatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** - * @var null|ProductSelectionType|ProductSelectionTypeBuilder + + * @var null|IndividualProductSelectionType|IndividualProductSelectionTypeBuilder */ private $productSelection; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,11 +207,14 @@ public function getResourceUserProvidedIdentifiers() } /** - * @return null|ProductSelectionType + *

    The type and name of the individual Product Selection.

    + * + + * @return null|IndividualProductSelectionType */ public function getProductSelection() { - return $this->productSelection instanceof ProductSelectionTypeBuilder ? $this->productSelection->build() : $this->productSelection; + return $this->productSelection instanceof IndividualProductSelectionTypeBuilder ? $this->productSelection->build() : $this->productSelection; } /** @@ -291,10 +328,10 @@ public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $re } /** - * @param ?ProductSelectionType $productSelection + * @param ?IndividualProductSelectionType $productSelection * @return $this */ - public function withProductSelection(?ProductSelectionType $productSelection) + public function withProductSelection(?IndividualProductSelectionType $productSelection) { $this->productSelection = $productSelection; @@ -349,7 +386,7 @@ public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifi * @deprecated use withProductSelection() instead * @return $this */ - public function withProductSelectionBuilder(?ProductSelectionTypeBuilder $productSelection) + public function withProductSelectionBuilder(?IndividualProductSelectionTypeBuilder $productSelection) { $this->productSelection = $productSelection; @@ -369,7 +406,7 @@ public function build(): ProductSelectionCreatedMessage $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, - $this->productSelection instanceof ProductSelectionTypeBuilder ? $this->productSelection->build() : $this->productSelection + $this->productSelection instanceof IndividualProductSelectionTypeBuilder ? $this->productSelection->build() : $this->productSelection ); } diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessageModel.php index 09cb21258c5..f7a230a3d38 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessageModel.php @@ -14,8 +14,8 @@ use Commercetools\Api\Models\Common\LastModifiedByModel; use Commercetools\Api\Models\Common\Reference; use Commercetools\Api\Models\Common\ReferenceModel; -use Commercetools\Api\Models\ProductSelection\ProductSelectionType; -use Commercetools\Api\Models\ProductSelection\ProductSelectionTypeModel; +use Commercetools\Api\Models\ProductSelection\IndividualProductSelectionType; +use Commercetools\Api\Models\ProductSelection\IndividualProductSelectionTypeModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -30,62 +30,74 @@ final class ProductSelectionCreatedMessageModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'ProductSelectionCreated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** - * @var ?ProductSelectionType + * + * @var ?IndividualProductSelectionType */ protected $productSelection; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?ProductSelectionType $productSelection = null + ?IndividualProductSelectionType $productSelection = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->productSelection = $productSelection; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,7 +367,10 @@ public function getResourceUserProvidedIdentifiers() } /** - * @return null|ProductSelectionType + *

    The type and name of the individual Product Selection.

    + * + * + * @return null|IndividualProductSelectionType */ public function getProductSelection() { @@ -338,8 +380,8 @@ public function getProductSelection() if (is_null($data)) { return null; } - $className = ProductSelectionTypeModel::resolveDiscriminatorClass($data); - $this->productSelection = $className::of($data); + + $this->productSelection = IndividualProductSelectionTypeModel::of($data); } return $this->productSelection; @@ -427,9 +469,9 @@ public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $res } /** - * @param ?ProductSelectionType $productSelection + * @param ?IndividualProductSelectionType $productSelection */ - public function setProductSelection(?ProductSelectionType $productSelection): void + public function setProductSelection(?IndividualProductSelectionType $productSelection): void { $this->productSelection = $productSelection; } diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessagePayload.php index 101d3fcd482..0a3339265c9 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessagePayload.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\Message; -use Commercetools\Api\Models\ProductSelection\ProductSelectionType; +use Commercetools\Api\Models\ProductSelection\IndividualProductSelectionType; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -17,12 +17,15 @@ interface ProductSelectionCreatedMessagePayload extends MessagePayload public const FIELD_PRODUCT_SELECTION = 'productSelection'; /** - * @return null|ProductSelectionType + *

    The type and name of the individual Product Selection.

    + * + + * @return null|IndividualProductSelectionType */ public function getProductSelection(); /** - * @param ?ProductSelectionType $productSelection + * @param ?IndividualProductSelectionType $productSelection */ - public function setProductSelection(?ProductSelectionType $productSelection): void; + public function setProductSelection(?IndividualProductSelectionType $productSelection): void; } diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessagePayloadBuilder.php index 0913ff425a5..d4b4008773a 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessagePayloadBuilder.php @@ -8,8 +8,8 @@ namespace Commercetools\Api\Models\Message; -use Commercetools\Api\Models\ProductSelection\ProductSelectionType; -use Commercetools\Api\Models\ProductSelection\ProductSelectionTypeBuilder; +use Commercetools\Api\Models\ProductSelection\IndividualProductSelectionType; +use Commercetools\Api\Models\ProductSelection\IndividualProductSelectionTypeBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -23,23 +23,27 @@ final class ProductSelectionCreatedMessagePayloadBuilder implements Builder { /** - * @var null|ProductSelectionType|ProductSelectionTypeBuilder + + * @var null|IndividualProductSelectionType|IndividualProductSelectionTypeBuilder */ private $productSelection; /** - * @return null|ProductSelectionType + *

    The type and name of the individual Product Selection.

    + * + + * @return null|IndividualProductSelectionType */ public function getProductSelection() { - return $this->productSelection instanceof ProductSelectionTypeBuilder ? $this->productSelection->build() : $this->productSelection; + return $this->productSelection instanceof IndividualProductSelectionTypeBuilder ? $this->productSelection->build() : $this->productSelection; } /** - * @param ?ProductSelectionType $productSelection + * @param ?IndividualProductSelectionType $productSelection * @return $this */ - public function withProductSelection(?ProductSelectionType $productSelection) + public function withProductSelection(?IndividualProductSelectionType $productSelection) { $this->productSelection = $productSelection; @@ -50,7 +54,7 @@ public function withProductSelection(?ProductSelectionType $productSelection) * @deprecated use withProductSelection() instead * @return $this */ - public function withProductSelectionBuilder(?ProductSelectionTypeBuilder $productSelection) + public function withProductSelectionBuilder(?IndividualProductSelectionTypeBuilder $productSelection) { $this->productSelection = $productSelection; @@ -60,7 +64,7 @@ public function withProductSelectionBuilder(?ProductSelectionTypeBuilder $produc public function build(): ProductSelectionCreatedMessagePayload { return new ProductSelectionCreatedMessagePayloadModel( - $this->productSelection instanceof ProductSelectionTypeBuilder ? $this->productSelection->build() : $this->productSelection + $this->productSelection instanceof IndividualProductSelectionTypeBuilder ? $this->productSelection->build() : $this->productSelection ); } diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessagePayloadModel.php index 7a551e32b23..247d4876cec 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionCreatedMessagePayloadModel.php @@ -8,8 +8,8 @@ namespace Commercetools\Api\Models\Message; -use Commercetools\Api\Models\ProductSelection\ProductSelectionType; -use Commercetools\Api\Models\ProductSelection\ProductSelectionTypeModel; +use Commercetools\Api\Models\ProductSelection\IndividualProductSelectionType; +use Commercetools\Api\Models\ProductSelection\IndividualProductSelectionTypeModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -23,12 +23,14 @@ final class ProductSelectionCreatedMessagePayloadModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'ProductSelectionCreated'; /** + * * @var ?string */ protected $type; /** - * @var ?ProductSelectionType + * + * @var ?IndividualProductSelectionType */ protected $productSelection; @@ -37,13 +39,15 @@ final class ProductSelectionCreatedMessagePayloadModel extends JsonObjectModel i * @psalm-suppress MissingParamType */ public function __construct( - ?ProductSelectionType $productSelection = null + ?IndividualProductSelectionType $productSelection = null, + ?string $type = null ) { $this->productSelection = $productSelection; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,7 +65,10 @@ public function getType() } /** - * @return null|ProductSelectionType + *

    The type and name of the individual Product Selection.

    + * + * + * @return null|IndividualProductSelectionType */ public function getProductSelection() { @@ -71,8 +78,8 @@ public function getProductSelection() if (is_null($data)) { return null; } - $className = ProductSelectionTypeModel::resolveDiscriminatorClass($data); - $this->productSelection = $className::of($data); + + $this->productSelection = IndividualProductSelectionTypeModel::of($data); } return $this->productSelection; @@ -80,9 +87,9 @@ public function getProductSelection() /** - * @param ?ProductSelectionType $productSelection + * @param ?IndividualProductSelectionType $productSelection */ - public function setProductSelection(?ProductSelectionType $productSelection): void + public function setProductSelection(?IndividualProductSelectionType $productSelection): void { $this->productSelection = $productSelection; } diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessage.php b/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessage.php index d42cbad2674..a2411e143f6 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessage.php @@ -8,23 +8,9 @@ namespace Commercetools\Api\Models\Message; -use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; interface ProductSelectionDeletedMessage extends Message { - public const FIELD_NAME = 'name'; - - /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    - * - * @return null|LocalizedString - */ - public function getName(); - - /** - * @param ?LocalizedString $name - */ - public function setName(?LocalizedString $name): void; } diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessageBuilder.php index f7a233a7cca..d78446fdd41 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessageBuilder.php @@ -12,8 +12,6 @@ use Commercetools\Api\Models\Common\CreatedByBuilder; use Commercetools\Api\Models\Common\LastModifiedBy; use Commercetools\Api\Models\Common\LastModifiedByBuilder; -use Commercetools\Api\Models\Common\LocalizedString; -use Commercetools\Api\Models\Common\LocalizedStringBuilder; use Commercetools\Api\Models\Common\Reference; use Commercetools\Api\Models\Common\ReferenceBuilder; use Commercetools\Base\Builder; @@ -30,63 +28,69 @@ final class ProductSelectionDeletedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** - * @var null|LocalizedString|LocalizedStringBuilder - */ - private $name; - - /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +99,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +110,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +121,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +132,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +145,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +154,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +166,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +177,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +188,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -172,16 +198,6 @@ public function getResourceUserProvidedIdentifiers() return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; } - /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    - * - * @return null|LocalizedString - */ - public function getName() - { - return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name; - } - /** * @param ?string $id * @return $this @@ -292,17 +308,6 @@ public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $re return $this; } - /** - * @param ?LocalizedString $name - * @return $this - */ - public function withName(?LocalizedString $name) - { - $this->name = $name; - - return $this; - } - /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -347,17 +352,6 @@ public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifi return $this; } - /** - * @deprecated use withName() instead - * @return $this - */ - public function withNameBuilder(?LocalizedStringBuilder $name) - { - $this->name = $name; - - return $this; - } - public function build(): ProductSelectionDeletedMessage { return new ProductSelectionDeletedMessageModel( @@ -370,8 +364,7 @@ public function build(): ProductSelectionDeletedMessage $this->sequenceNumber, $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, $this->resourceVersion, - $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, - $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers ); } diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessageModel.php index cf4b55297c4..845d1ef788b 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessageModel.php @@ -12,8 +12,6 @@ use Commercetools\Api\Models\Common\CreatedByModel; use Commercetools\Api\Models\Common\LastModifiedBy; use Commercetools\Api\Models\Common\LastModifiedByModel; -use Commercetools\Api\Models\Common\LocalizedString; -use Commercetools\Api\Models\Common\LocalizedStringModel; use Commercetools\Api\Models\Common\Reference; use Commercetools\Api\Models\Common\ReferenceModel; use Commercetools\Base\DateTimeImmutableCollection; @@ -30,65 +28,71 @@ final class ProductSelectionDeletedMessageModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'ProductSelectionDeleted'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; - /** - * @var ?LocalizedString - */ - protected $name; - /** * @psalm-suppress MissingParamType @@ -104,7 +108,7 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?LocalizedString $name = null + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -116,12 +120,12 @@ public function __construct( $this->resource = $resource; $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; - $this->name = $name; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +144,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +164,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +188,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +212,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +235,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +254,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +275,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +296,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +316,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +336,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -327,26 +356,6 @@ public function getResourceUserProvidedIdentifiers() return $this->resourceUserProvidedIdentifiers; } - /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    - * - * @return null|LocalizedString - */ - public function getName() - { - if (is_null($this->name)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_NAME); - if (is_null($data)) { - return null; - } - - $this->name = LocalizedStringModel::of($data); - } - - return $this->name; - } - /** * @param ?string $id @@ -428,14 +437,6 @@ public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $res $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; } - /** - * @param ?LocalizedString $name - */ - public function setName(?LocalizedString $name): void - { - $this->name = $name; - } - #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessagePayload.php index 23405c9e8db..f79121910bb 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessagePayload.php @@ -8,23 +8,9 @@ namespace Commercetools\Api\Models\Message; -use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; interface ProductSelectionDeletedMessagePayload extends MessagePayload { - public const FIELD_NAME = 'name'; - - /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    - * - * @return null|LocalizedString - */ - public function getName(); - - /** - * @param ?LocalizedString $name - */ - public function setName(?LocalizedString $name): void; } diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessagePayloadBuilder.php index 24ae44e3e60..0f200b48cdb 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessagePayloadBuilder.php @@ -8,8 +8,6 @@ namespace Commercetools\Api\Models\Message; -use Commercetools\Api\Models\Common\LocalizedString; -use Commercetools\Api\Models\Common\LocalizedStringBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -22,47 +20,9 @@ */ final class ProductSelectionDeletedMessagePayloadBuilder implements Builder { - /** - * @var null|LocalizedString|LocalizedStringBuilder - */ - private $name; - - /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    - * - * @return null|LocalizedString - */ - public function getName() - { - return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name; - } - - /** - * @param ?LocalizedString $name - * @return $this - */ - public function withName(?LocalizedString $name) - { - $this->name = $name; - - return $this; - } - - /** - * @deprecated use withName() instead - * @return $this - */ - public function withNameBuilder(?LocalizedStringBuilder $name) - { - $this->name = $name; - - return $this; - } - public function build(): ProductSelectionDeletedMessagePayload { return new ProductSelectionDeletedMessagePayloadModel( - $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name ); } diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessagePayloadModel.php index 1ef83e97f08..c9c10a58034 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionDeletedMessagePayloadModel.php @@ -8,8 +8,6 @@ namespace Commercetools\Api\Models\Message; -use Commercetools\Api\Models\Common\LocalizedString; -use Commercetools\Api\Models\Common\LocalizedStringModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -23,27 +21,23 @@ final class ProductSelectionDeletedMessagePayloadModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'ProductSelectionDeleted'; /** + * * @var ?string */ protected $type; - /** - * @var ?LocalizedString - */ - protected $name; - /** * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $name = null + ?string $type = null ) { - $this->name = $name; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,33 +53,4 @@ public function getType() return $this->type; } - - /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    - * - * @return null|LocalizedString - */ - public function getName() - { - if (is_null($this->name)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_NAME); - if (is_null($data)) { - return null; - } - - $this->name = LocalizedStringModel::of($data); - } - - return $this->name; - } - - - /** - * @param ?LocalizedString $name - */ - public function setName(?LocalizedString $name): void - { - $this->name = $name; - } } diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessage.php b/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessage.php index 8588f0e1f55..cfb600e2cb5 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessage.php @@ -19,15 +19,17 @@ interface ProductSelectionProductAddedMessage extends Message public const FIELD_VARIANT_SELECTION = 'variantSelection'; /** - *

    Reference to a Product.

    + *

    Product that was added to the Product Selection.

    * + * @return null|ProductReference */ public function getProduct(); /** - *

    Polymorphic base type for Product Variant Selections. The actual type is determined by the type field.

    + *

    Product Variant Selection after the Add Product update action.

    * + * @return null|ProductVariantSelection */ public function getVariantSelection(); diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessageBuilder.php index 16cc0e67f37..c38728bb652 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessageBuilder.php @@ -32,68 +32,81 @@ final class ProductSelectionProductAddedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|ProductReference|ProductReferenceBuilder */ private $product; /** + * @var null|ProductVariantSelection|ProductVariantSelectionBuilder */ private $variantSelection; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -102,6 +115,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -110,6 +126,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -118,6 +137,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -126,8 +148,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -138,6 +161,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -146,6 +170,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -154,8 +182,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -164,6 +193,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -172,6 +204,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -180,8 +215,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a Product.

    + *

    Product that was added to the Product Selection.

    * + * @return null|ProductReference */ public function getProduct() @@ -190,8 +226,9 @@ public function getProduct() } /** - *

    Polymorphic base type for Product Variant Selections. The actual type is determined by the type field.

    + *

    Product Variant Selection after the Add Product update action.

    * + * @return null|ProductVariantSelection */ public function getVariantSelection() diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessageModel.php index 6b4b01cc195..1085b321adc 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessageModel.php @@ -32,66 +32,79 @@ final class ProductSelectionProductAddedMessageModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'ProductSelectionProductAdded'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?ProductReference */ protected $product; /** + * * @var ?ProductVariantSelection */ protected $variantSelection; @@ -112,7 +125,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?ProductReference $product = null, - ?ProductVariantSelection $variantSelection = null + ?ProductVariantSelection $variantSelection = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -126,11 +140,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->product = $product; $this->variantSelection = $variantSelection; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -149,6 +164,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -166,6 +184,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -187,6 +208,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -208,7 +232,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -230,6 +255,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -248,6 +274,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -265,7 +295,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -285,6 +316,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -302,6 +336,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -319,6 +356,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -337,7 +377,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a Product.

    + *

    Product that was added to the Product Selection.

    + * * * @return null|ProductReference */ @@ -357,7 +398,8 @@ public function getProduct() } /** - *

    Polymorphic base type for Product Variant Selections. The actual type is determined by the type field.

    + *

    Product Variant Selection after the Add Product update action.

    + * * * @return null|ProductVariantSelection */ @@ -369,8 +411,8 @@ public function getVariantSelection() if (is_null($data)) { return null; } - $className = ProductVariantSelectionModel::resolveDiscriminatorClass($data); - $this->variantSelection = $className::of($data); + + $this->variantSelection = ProductVariantSelectionModel::of($data); } return $this->variantSelection; diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessagePayload.php index 1ae14a360fb..89121b76426 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessagePayload.php @@ -19,15 +19,17 @@ interface ProductSelectionProductAddedMessagePayload extends MessagePayload public const FIELD_VARIANT_SELECTION = 'variantSelection'; /** - *

    Reference to a Product.

    + *

    Product that was added to the Product Selection.

    * + * @return null|ProductReference */ public function getProduct(); /** - *

    Polymorphic base type for Product Variant Selections. The actual type is determined by the type field.

    + *

    Product Variant Selection after the Add Product update action.

    * + * @return null|ProductVariantSelection */ public function getVariantSelection(); diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessagePayloadBuilder.php index 662db9f5df0..8dcf96cdd95 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessagePayloadBuilder.php @@ -25,18 +25,21 @@ final class ProductSelectionProductAddedMessagePayloadBuilder implements Builder { /** + * @var null|ProductReference|ProductReferenceBuilder */ private $product; /** + * @var null|ProductVariantSelection|ProductVariantSelectionBuilder */ private $variantSelection; /** - *

    Reference to a Product.

    + *

    Product that was added to the Product Selection.

    * + * @return null|ProductReference */ public function getProduct() @@ -45,8 +48,9 @@ public function getProduct() } /** - *

    Polymorphic base type for Product Variant Selections. The actual type is determined by the type field.

    + *

    Product Variant Selection after the Add Product update action.

    * + * @return null|ProductVariantSelection */ public function getVariantSelection() diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessagePayloadModel.php index 79cdd18b89d..40dad39e803 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessagePayloadModel.php @@ -25,16 +25,19 @@ final class ProductSelectionProductAddedMessagePayloadModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'ProductSelectionProductAdded'; /** + * * @var ?string */ protected $type; /** + * * @var ?ProductReference */ protected $product; /** + * * @var ?ProductVariantSelection */ protected $variantSelection; @@ -45,14 +48,16 @@ final class ProductSelectionProductAddedMessagePayloadModel extends JsonObjectMo */ public function __construct( ?ProductReference $product = null, - ?ProductVariantSelection $variantSelection = null + ?ProductVariantSelection $variantSelection = null, + ?string $type = null ) { $this->product = $product; $this->variantSelection = $variantSelection; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -70,7 +75,8 @@ public function getType() } /** - *

    Reference to a Product.

    + *

    Product that was added to the Product Selection.

    + * * * @return null|ProductReference */ @@ -90,7 +96,8 @@ public function getProduct() } /** - *

    Polymorphic base type for Product Variant Selections. The actual type is determined by the type field.

    + *

    Product Variant Selection after the Add Product update action.

    + * * * @return null|ProductVariantSelection */ @@ -102,8 +109,8 @@ public function getVariantSelection() if (is_null($data)) { return null; } - $className = ProductVariantSelectionModel::resolveDiscriminatorClass($data); - $this->variantSelection = $className::of($data); + + $this->variantSelection = ProductVariantSelectionModel::of($data); } return $this->variantSelection; diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessage.php b/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessage.php index 30f0c789793..4e09b5d6d4d 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessage.php @@ -17,8 +17,9 @@ interface ProductSelectionProductRemovedMessage extends Message public const FIELD_PRODUCT = 'product'; /** - *

    Reference to a Product.

    + *

    Product that was removed from the Product Selection.

    * + * @return null|ProductReference */ public function getProduct(); diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessageBuilder.php index 46f65bc095d..0e0b459f1cd 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessageBuilder.php @@ -30,63 +30,75 @@ final class ProductSelectionProductRemovedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|ProductReference|ProductReferenceBuilder */ private $product; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,8 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a Product.

    + *

    Product that was removed from the Product Selection.

    * + * @return null|ProductReference */ public function getProduct() diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessageModel.php index 8edef30452a..b09be71daf8 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessageModel.php @@ -30,61 +30,73 @@ final class ProductSelectionProductRemovedMessageModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'ProductSelectionProductRemoved'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?ProductReference */ protected $product; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?ProductReference $product = null + ?ProductReference $product = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->product = $product; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,7 +367,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a Product.

    + *

    Product that was removed from the Product Selection.

    + * * * @return null|ProductReference */ diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessagePayload.php index 698f66f3d1f..3fbd08fe68a 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessagePayload.php @@ -17,8 +17,9 @@ interface ProductSelectionProductRemovedMessagePayload extends MessagePayload public const FIELD_PRODUCT = 'product'; /** - *

    Reference to a Product.

    + *

    Product that was removed from the Product Selection.

    * + * @return null|ProductReference */ public function getProduct(); diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessagePayloadBuilder.php index dbd325fb406..bc5bbb26296 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessagePayloadBuilder.php @@ -23,13 +23,15 @@ final class ProductSelectionProductRemovedMessagePayloadBuilder implements Builder { /** + * @var null|ProductReference|ProductReferenceBuilder */ private $product; /** - *

    Reference to a Product.

    + *

    Product that was removed from the Product Selection.

    * + * @return null|ProductReference */ public function getProduct() diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessagePayloadModel.php index f353de1ade4..d5389e56e61 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionProductRemovedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class ProductSelectionProductRemovedMessagePayloadModel extends JsonObject { public const DISCRIMINATOR_VALUE = 'ProductSelectionProductRemoved'; /** + * * @var ?string */ protected $type; /** + * * @var ?ProductReference */ protected $product; @@ -37,13 +39,15 @@ final class ProductSelectionProductRemovedMessagePayloadModel extends JsonObject * @psalm-suppress MissingParamType */ public function __construct( - ?ProductReference $product = null + ?ProductReference $product = null, + ?string $type = null ) { $this->product = $product; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,7 +65,8 @@ public function getType() } /** - *

    Reference to a Product.

    + *

    Product that was removed from the Product Selection.

    + * * * @return null|ProductReference */ diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessage.php b/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessage.php index fdaf43afaec..79ee55ee79c 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessage.php @@ -20,22 +20,25 @@ interface ProductSelectionVariantSelectionChangedMessage extends Message public const FIELD_NEW_VARIANT_SELECTION = 'newVariantSelection'; /** - *

    Reference to a Product.

    + *

    Product for which the Product Variant Selection changed.

    * + * @return null|ProductReference */ public function getProduct(); /** - *

    The former Product Variant Selection if any.

    + *

    Product Variant Selection before the Set Variant Selection update action.

    * + * @return null|ProductVariantSelection */ public function getOldVariantSelection(); /** - *

    The updated Product Variant Selection if any.

    + *

    Product Variant Selection after the Set Variant Selection update action.

    * + * @return null|ProductVariantSelection */ public function getNewVariantSelection(); diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessageBuilder.php index be7ab078fb9..6ae57b0d4aa 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessageBuilder.php @@ -32,73 +32,87 @@ final class ProductSelectionVariantSelectionChangedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|ProductReference|ProductReferenceBuilder */ private $product; /** + * @var null|ProductVariantSelection|ProductVariantSelectionBuilder */ private $oldVariantSelection; /** + * @var null|ProductVariantSelection|ProductVariantSelectionBuilder */ private $newVariantSelection; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -107,6 +121,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -115,6 +132,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -123,6 +143,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -131,8 +154,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -143,6 +167,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -151,6 +176,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -159,8 +188,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -169,6 +199,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -177,6 +210,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -185,8 +221,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a Product.

    + *

    Product for which the Product Variant Selection changed.

    * + * @return null|ProductReference */ public function getProduct() @@ -195,8 +232,9 @@ public function getProduct() } /** - *

    The former Product Variant Selection if any.

    + *

    Product Variant Selection before the Set Variant Selection update action.

    * + * @return null|ProductVariantSelection */ public function getOldVariantSelection() @@ -205,8 +243,9 @@ public function getOldVariantSelection() } /** - *

    The updated Product Variant Selection if any.

    + *

    Product Variant Selection after the Set Variant Selection update action.

    * + * @return null|ProductVariantSelection */ public function getNewVariantSelection() diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessageModel.php index 2cdfb509e2c..16c05535045 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessageModel.php @@ -32,71 +32,85 @@ final class ProductSelectionVariantSelectionChangedMessageModel extends JsonObje { public const DISCRIMINATOR_VALUE = 'ProductSelectionVariantSelectionChanged'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?ProductReference */ protected $product; /** + * * @var ?ProductVariantSelection */ protected $oldVariantSelection; /** + * * @var ?ProductVariantSelection */ protected $newVariantSelection; @@ -118,7 +132,8 @@ public function __construct( ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?ProductReference $product = null, ?ProductVariantSelection $oldVariantSelection = null, - ?ProductVariantSelection $newVariantSelection = null + ?ProductVariantSelection $newVariantSelection = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -133,11 +148,12 @@ public function __construct( $this->product = $product; $this->oldVariantSelection = $oldVariantSelection; $this->newVariantSelection = $newVariantSelection; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -156,6 +172,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -173,6 +192,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -194,6 +216,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -215,7 +240,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -237,6 +263,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -255,6 +282,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -272,7 +303,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -292,6 +324,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -309,6 +344,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -326,6 +364,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -344,7 +385,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a Product.

    + *

    Product for which the Product Variant Selection changed.

    + * * * @return null|ProductReference */ @@ -364,7 +406,8 @@ public function getProduct() } /** - *

    The former Product Variant Selection if any.

    + *

    Product Variant Selection before the Set Variant Selection update action.

    + * * * @return null|ProductVariantSelection */ @@ -384,7 +427,8 @@ public function getOldVariantSelection() } /** - *

    The updated Product Variant Selection if any.

    + *

    Product Variant Selection after the Set Variant Selection update action.

    + * * * @return null|ProductVariantSelection */ diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessagePayload.php index 7c64487b90c..ad4439523cf 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessagePayload.php @@ -20,22 +20,25 @@ interface ProductSelectionVariantSelectionChangedMessagePayload extends MessageP public const FIELD_NEW_VARIANT_SELECTION = 'newVariantSelection'; /** - *

    Reference to a Product.

    + *

    Product for which the Product Variant Selection changed.

    * + * @return null|ProductReference */ public function getProduct(); /** - *

    The former Product Variant Selection if any.

    + *

    Product Variant Selection before the Set Variant Selection update action.

    * + * @return null|ProductVariantSelection */ public function getOldVariantSelection(); /** - *

    The updated Product Variant Selection if any.

    + *

    Product Variant Selection after the Set Variant Selection update action.

    * + * @return null|ProductVariantSelection */ public function getNewVariantSelection(); diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessagePayloadBuilder.php index abe76589844..4a74222493a 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessagePayloadBuilder.php @@ -25,23 +25,27 @@ final class ProductSelectionVariantSelectionChangedMessagePayloadBuilder implements Builder { /** + * @var null|ProductReference|ProductReferenceBuilder */ private $product; /** + * @var null|ProductVariantSelection|ProductVariantSelectionBuilder */ private $oldVariantSelection; /** + * @var null|ProductVariantSelection|ProductVariantSelectionBuilder */ private $newVariantSelection; /** - *

    Reference to a Product.

    + *

    Product for which the Product Variant Selection changed.

    * + * @return null|ProductReference */ public function getProduct() @@ -50,8 +54,9 @@ public function getProduct() } /** - *

    The former Product Variant Selection if any.

    + *

    Product Variant Selection before the Set Variant Selection update action.

    * + * @return null|ProductVariantSelection */ public function getOldVariantSelection() @@ -60,8 +65,9 @@ public function getOldVariantSelection() } /** - *

    The updated Product Variant Selection if any.

    + *

    Product Variant Selection after the Set Variant Selection update action.

    * + * @return null|ProductVariantSelection */ public function getNewVariantSelection() diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessagePayloadModel.php index 9e09e4a10c8..4beb47d74a6 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessagePayloadModel.php @@ -25,21 +25,25 @@ final class ProductSelectionVariantSelectionChangedMessagePayloadModel extends J { public const DISCRIMINATOR_VALUE = 'ProductSelectionVariantSelectionChanged'; /** + * * @var ?string */ protected $type; /** + * * @var ?ProductReference */ protected $product; /** + * * @var ?ProductVariantSelection */ protected $oldVariantSelection; /** + * * @var ?ProductVariantSelection */ protected $newVariantSelection; @@ -51,15 +55,17 @@ final class ProductSelectionVariantSelectionChangedMessagePayloadModel extends J public function __construct( ?ProductReference $product = null, ?ProductVariantSelection $oldVariantSelection = null, - ?ProductVariantSelection $newVariantSelection = null + ?ProductVariantSelection $newVariantSelection = null, + ?string $type = null ) { $this->product = $product; $this->oldVariantSelection = $oldVariantSelection; $this->newVariantSelection = $newVariantSelection; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -77,7 +83,8 @@ public function getType() } /** - *

    Reference to a Product.

    + *

    Product for which the Product Variant Selection changed.

    + * * * @return null|ProductReference */ @@ -97,7 +104,8 @@ public function getProduct() } /** - *

    The former Product Variant Selection if any.

    + *

    Product Variant Selection before the Set Variant Selection update action.

    + * * * @return null|ProductVariantSelection */ @@ -117,7 +125,8 @@ public function getOldVariantSelection() } /** - *

    The updated Product Variant Selection if any.

    + *

    Product Variant Selection after the Set Variant Selection update action.

    + * * * @return null|ProductVariantSelection */ diff --git a/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessage.php b/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessage.php index 705dadd1ddb..51ebcefe8e1 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessage.php @@ -18,15 +18,17 @@ interface ProductSlugChangedMessage extends Message public const FIELD_OLD_SLUG = 'oldSlug'; /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Product after the Change Slug update action.

    * + * @return null|LocalizedString */ public function getSlug(); /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Product before the Change Slug update action.

    * + * @return null|LocalizedString */ public function getOldSlug(); diff --git a/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessageBuilder.php index 71b93dda49d..73b0225be38 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessageBuilder.php @@ -30,68 +30,81 @@ final class ProductSlugChangedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $oldSlug; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,8 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Product after the Change Slug update action.

    * + * @return null|LocalizedString */ public function getSlug() @@ -188,8 +224,9 @@ public function getSlug() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Product before the Change Slug update action.

    * + * @return null|LocalizedString */ public function getOldSlug() diff --git a/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessageModel.php index 257b30986bc..e910f257ce3 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessageModel.php @@ -30,66 +30,79 @@ final class ProductSlugChangedMessageModel extends JsonObjectModel implements Pr { public const DISCRIMINATOR_VALUE = 'ProductSlugChanged'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?LocalizedString */ protected $slug; /** + * * @var ?LocalizedString */ protected $oldSlug; @@ -110,7 +123,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?LocalizedString $slug = null, - ?LocalizedString $oldSlug = null + ?LocalizedString $oldSlug = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +138,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->slug = $slug; $this->oldSlug = $oldSlug; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,7 +375,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Product after the Change Slug update action.

    + * * * @return null|LocalizedString */ @@ -355,7 +396,8 @@ public function getSlug() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Product before the Change Slug update action.

    + * * * @return null|LocalizedString */ diff --git a/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessagePayload.php index 4738fd54f81..dade79a8c29 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessagePayload.php @@ -18,15 +18,17 @@ interface ProductSlugChangedMessagePayload extends MessagePayload public const FIELD_OLD_SLUG = 'oldSlug'; /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Product after the Change Slug update action.

    * + * @return null|LocalizedString */ public function getSlug(); /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Product before the Change Slug update action.

    * + * @return null|LocalizedString */ public function getOldSlug(); diff --git a/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessagePayloadBuilder.php index 6e391a3f34e..104fcaa7304 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessagePayloadBuilder.php @@ -23,18 +23,21 @@ final class ProductSlugChangedMessagePayloadBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $oldSlug; /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Product after the Change Slug update action.

    * + * @return null|LocalizedString */ public function getSlug() @@ -43,8 +46,9 @@ public function getSlug() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Product before the Change Slug update action.

    * + * @return null|LocalizedString */ public function getOldSlug() diff --git a/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessagePayloadModel.php index ca2ea49b275..7db0d29a482 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductSlugChangedMessagePayloadModel.php @@ -23,16 +23,19 @@ final class ProductSlugChangedMessagePayloadModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'ProductSlugChanged'; /** + * * @var ?string */ protected $type; /** + * * @var ?LocalizedString */ protected $slug; /** + * * @var ?LocalizedString */ protected $oldSlug; @@ -43,14 +46,16 @@ final class ProductSlugChangedMessagePayloadModel extends JsonObjectModel implem */ public function __construct( ?LocalizedString $slug = null, - ?LocalizedString $oldSlug = null + ?LocalizedString $oldSlug = null, + ?string $type = null ) { $this->slug = $slug; $this->oldSlug = $oldSlug; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,7 +73,8 @@ public function getType() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Product after the Change Slug update action.

    + * * * @return null|LocalizedString */ @@ -88,7 +94,8 @@ public function getSlug() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The slug of the Product before the Change Slug update action.

    + * * * @return null|LocalizedString */ diff --git a/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessage.php b/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessage.php index 11e4ccfaee1..bdd4dc225b3 100644 --- a/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessage.php @@ -18,13 +18,17 @@ interface ProductStateTransitionMessage extends Message public const FIELD_FORCE = 'force'; /** - *

    Reference to a State.

    + *

    Product State after the Transition State update action.

    * + * @return null|StateReference */ public function getState(); /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * @return null|bool */ public function getForce(); diff --git a/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessageBuilder.php index 5ce5c5a144d..68382bf41d8 100644 --- a/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessageBuilder.php @@ -30,68 +30,81 @@ final class ProductStateTransitionMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|StateReference|StateReferenceBuilder */ private $state; /** + * @var ?bool */ private $force; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,8 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a State.

    + *

    Product State after the Transition State update action.

    * + * @return null|StateReference */ public function getState() @@ -188,6 +224,9 @@ public function getState() } /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessageModel.php index e4468b6c368..b4ccab44e35 100644 --- a/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessageModel.php @@ -30,66 +30,79 @@ final class ProductStateTransitionMessageModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'ProductStateTransition'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?StateReference */ protected $state; /** + * * @var ?bool */ protected $force; @@ -110,7 +123,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?StateReference $state = null, - ?bool $force = null + ?bool $force = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +138,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->state = $state; $this->force = $force; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,7 +375,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a State.

    + *

    Product State after the Transition State update action.

    + * * * @return null|StateReference */ @@ -355,6 +396,9 @@ public function getState() } /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessagePayload.php index 97f291086ce..7385d889ba8 100644 --- a/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessagePayload.php @@ -18,13 +18,17 @@ interface ProductStateTransitionMessagePayload extends MessagePayload public const FIELD_FORCE = 'force'; /** - *

    Reference to a State.

    + *

    Product State after the Transition State update action.

    * + * @return null|StateReference */ public function getState(); /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * @return null|bool */ public function getForce(); diff --git a/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessagePayloadBuilder.php index 7e75607435a..d12a90af873 100644 --- a/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessagePayloadBuilder.php @@ -23,18 +23,21 @@ final class ProductStateTransitionMessagePayloadBuilder implements Builder { /** + * @var null|StateReference|StateReferenceBuilder */ private $state; /** + * @var ?bool */ private $force; /** - *

    Reference to a State.

    + *

    Product State after the Transition State update action.

    * + * @return null|StateReference */ public function getState() @@ -43,6 +46,9 @@ public function getState() } /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessagePayloadModel.php index 56288131bb6..a19a13977fb 100644 --- a/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductStateTransitionMessagePayloadModel.php @@ -23,16 +23,19 @@ final class ProductStateTransitionMessagePayloadModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'ProductStateTransition'; /** + * * @var ?string */ protected $type; /** + * * @var ?StateReference */ protected $state; /** + * * @var ?bool */ protected $force; @@ -43,14 +46,16 @@ final class ProductStateTransitionMessagePayloadModel extends JsonObjectModel im */ public function __construct( ?StateReference $state = null, - ?bool $force = null + ?bool $force = null, + ?string $type = null ) { $this->state = $state; $this->force = $force; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,7 +73,8 @@ public function getType() } /** - *

    Reference to a State.

    + *

    Product State after the Transition State update action.

    + * * * @return null|StateReference */ @@ -88,6 +94,9 @@ public function getState() } /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Message/ProductUnpublishedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductUnpublishedMessageBuilder.php index 5890d1d5f78..65828745b3d 100644 --- a/lib/commercetools-api/src/Models/Message/ProductUnpublishedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductUnpublishedMessageBuilder.php @@ -28,58 +28,69 @@ final class ProductUnpublishedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -88,6 +99,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -96,6 +110,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -104,6 +121,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -112,8 +132,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -124,6 +145,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -132,6 +154,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -140,8 +166,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -150,6 +177,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -158,6 +188,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/ProductUnpublishedMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductUnpublishedMessageModel.php index d8a7e9434bd..ca411729ef2 100644 --- a/lib/commercetools-api/src/Models/Message/ProductUnpublishedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductUnpublishedMessageModel.php @@ -28,56 +28,67 @@ final class ProductUnpublishedMessageModel extends JsonObjectModel implements Pr { public const DISCRIMINATOR_VALUE = 'ProductUnpublished'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; @@ -96,7 +107,8 @@ public function __construct( ?int $sequenceNumber = null, ?Reference $resource = null, ?int $resourceVersion = null, - ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null + ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -108,11 +120,12 @@ public function __construct( $this->resource = $resource; $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -131,6 +144,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -148,6 +164,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -169,6 +188,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -190,7 +212,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -212,6 +235,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -230,6 +254,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -247,7 +275,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -267,6 +296,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -284,6 +316,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -301,6 +336,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/ProductUnpublishedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductUnpublishedMessagePayloadModel.php index 99c64b8f715..b201ab2d60e 100644 --- a/lib/commercetools-api/src/Models/Message/ProductUnpublishedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductUnpublishedMessagePayloadModel.php @@ -21,6 +21,7 @@ final class ProductUnpublishedMessagePayloadModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'ProductUnpublished'; /** + * * @var ?string */ protected $type; @@ -30,11 +31,13 @@ final class ProductUnpublishedMessagePayloadModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessage.php b/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessage.php index fedf8fa60bf..4fc374e8a53 100644 --- a/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessage.php @@ -18,11 +18,17 @@ interface ProductVariantAddedMessage extends Message public const FIELD_STAGED = 'staged'; /** + *

    Unique identifier of the Product Variant that was added.

    + * + * @return null|ProductVariant */ public function getVariant(); /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessageBuilder.php index 2ad92884671..9d699c0077d 100644 --- a/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessageBuilder.php @@ -30,68 +30,81 @@ final class ProductVariantAddedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|ProductVariant|ProductVariantBuilder */ private $variant; /** + * @var ?bool */ private $staged; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,6 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Product Variant that was added.

    + * + * @return null|ProductVariant */ public function getVariant() @@ -186,6 +224,9 @@ public function getVariant() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessageModel.php index 934b05e3823..482ee091185 100644 --- a/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessageModel.php @@ -30,66 +30,79 @@ final class ProductVariantAddedMessageModel extends JsonObjectModel implements P { public const DISCRIMINATOR_VALUE = 'ProductVariantAdded'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?ProductVariant */ protected $variant; /** + * * @var ?bool */ protected $staged; @@ -110,7 +123,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?ProductVariant $variant = null, - ?bool $staged = null + ?bool $staged = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +138,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->variant = $variant; $this->staged = $staged; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,6 +375,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Product Variant that was added.

    + * + * * @return null|ProductVariant */ public function getVariant() @@ -353,6 +396,9 @@ public function getVariant() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessagePayload.php index 53b33112d66..c6aa53d85a7 100644 --- a/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessagePayload.php @@ -18,11 +18,17 @@ interface ProductVariantAddedMessagePayload extends MessagePayload public const FIELD_STAGED = 'staged'; /** + *

    Unique identifier of the Product Variant that was added.

    + * + * @return null|ProductVariant */ public function getVariant(); /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessagePayloadBuilder.php index af05dfe2222..7b6bf558b39 100644 --- a/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessagePayloadBuilder.php @@ -23,16 +23,21 @@ final class ProductVariantAddedMessagePayloadBuilder implements Builder { /** + * @var null|ProductVariant|ProductVariantBuilder */ private $variant; /** + * @var ?bool */ private $staged; /** + *

    Unique identifier of the Product Variant that was added.

    + * + * @return null|ProductVariant */ public function getVariant() @@ -41,6 +46,9 @@ public function getVariant() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessagePayloadModel.php index b319f5e3c80..25ab31239c2 100644 --- a/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductVariantAddedMessagePayloadModel.php @@ -23,16 +23,19 @@ final class ProductVariantAddedMessagePayloadModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'ProductVariantAdded'; /** + * * @var ?string */ protected $type; /** + * * @var ?ProductVariant */ protected $variant; /** + * * @var ?bool */ protected $staged; @@ -43,14 +46,16 @@ final class ProductVariantAddedMessagePayloadModel extends JsonObjectModel imple */ public function __construct( ?ProductVariant $variant = null, - ?bool $staged = null + ?bool $staged = null, + ?string $type = null ) { $this->variant = $variant; $this->staged = $staged; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,6 +73,9 @@ public function getType() } /** + *

    Unique identifier of the Product Variant that was added.

    + * + * * @return null|ProductVariant */ public function getVariant() @@ -86,6 +94,9 @@ public function getVariant() } /** + *

    Whether the update was only applied to the staged Product Projection.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessage.php b/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessage.php index 321efe96cc4..dd3a7ba5da8 100644 --- a/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessage.php @@ -18,11 +18,17 @@ interface ProductVariantDeletedMessage extends Message public const FIELD_REMOVED_IMAGE_URLS = 'removedImageUrls'; /** + *

    Unique identifier of the Product Variant that was added.

    + * + * @return null|ProductVariant */ public function getVariant(); /** + *

    List of image URLs that were removed with the Remove Product Variant update action.

    + * + * @return null|array */ public function getRemovedImageUrls(); diff --git a/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessageBuilder.php index 0e5eda1bdfe..b3eb32ef768 100644 --- a/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessageBuilder.php @@ -30,68 +30,81 @@ final class ProductVariantDeletedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|ProductVariant|ProductVariantBuilder */ private $variant; /** + * @var ?array */ private $removedImageUrls; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -100,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -108,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -116,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -136,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -144,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -152,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -162,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -170,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -178,6 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Product Variant that was added.

    + * + * @return null|ProductVariant */ public function getVariant() @@ -186,6 +224,9 @@ public function getVariant() } /** + *

    List of image URLs that were removed with the Remove Product Variant update action.

    + * + * @return null|array */ public function getRemovedImageUrls() diff --git a/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessageModel.php index cd47662cc8a..ea0656dec1c 100644 --- a/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessageModel.php @@ -30,66 +30,79 @@ final class ProductVariantDeletedMessageModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'ProductVariantDeleted'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?ProductVariant */ protected $variant; /** + * * @var ?array */ protected $removedImageUrls; @@ -110,7 +123,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?ProductVariant $variant = null, - ?array $removedImageUrls = null + ?array $removedImageUrls = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -124,11 +138,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->variant = $variant; $this->removedImageUrls = $removedImageUrls; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -147,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -185,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -228,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -263,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -283,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -300,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -317,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -335,6 +375,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique identifier of the Product Variant that was added.

    + * + * * @return null|ProductVariant */ public function getVariant() @@ -353,6 +396,9 @@ public function getVariant() } /** + *

    List of image URLs that were removed with the Remove Product Variant update action.

    + * + * * @return null|array */ public function getRemovedImageUrls() diff --git a/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessagePayload.php index 5535d52c00b..b83796f03d2 100644 --- a/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessagePayload.php @@ -18,11 +18,17 @@ interface ProductVariantDeletedMessagePayload extends MessagePayload public const FIELD_REMOVED_IMAGE_URLS = 'removedImageUrls'; /** + *

    Unique identifier of the Product Variant that was added.

    + * + * @return null|ProductVariant */ public function getVariant(); /** + *

    List of image URLs that were removed with the Remove Product Variant update action.

    + * + * @return null|array */ public function getRemovedImageUrls(); diff --git a/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessagePayloadBuilder.php index 218526c674e..b9d395e3605 100644 --- a/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessagePayloadBuilder.php @@ -23,16 +23,21 @@ final class ProductVariantDeletedMessagePayloadBuilder implements Builder { /** + * @var null|ProductVariant|ProductVariantBuilder */ private $variant; /** + * @var ?array */ private $removedImageUrls; /** + *

    Unique identifier of the Product Variant that was added.

    + * + * @return null|ProductVariant */ public function getVariant() @@ -41,6 +46,9 @@ public function getVariant() } /** + *

    List of image URLs that were removed with the Remove Product Variant update action.

    + * + * @return null|array */ public function getRemovedImageUrls() diff --git a/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessagePayloadModel.php index c46da702c99..75939e3918c 100644 --- a/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductVariantDeletedMessagePayloadModel.php @@ -23,16 +23,19 @@ final class ProductVariantDeletedMessagePayloadModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'ProductVariantDeleted'; /** + * * @var ?string */ protected $type; /** + * * @var ?ProductVariant */ protected $variant; /** + * * @var ?array */ protected $removedImageUrls; @@ -43,14 +46,16 @@ final class ProductVariantDeletedMessagePayloadModel extends JsonObjectModel imp */ public function __construct( ?ProductVariant $variant = null, - ?array $removedImageUrls = null + ?array $removedImageUrls = null, + ?string $type = null ) { $this->variant = $variant; $this->removedImageUrls = $removedImageUrls; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,6 +73,9 @@ public function getType() } /** + *

    Unique identifier of the Product Variant that was added.

    + * + * * @return null|ProductVariant */ public function getVariant() @@ -86,6 +94,9 @@ public function getVariant() } /** + *

    List of image URLs that were removed with the Remove Product Variant update action.

    + * + * * @return null|array */ public function getRemovedImageUrls() diff --git a/lib/commercetools-api/src/Models/Message/QuoteCreatedMessage.php b/lib/commercetools-api/src/Models/Message/QuoteCreatedMessage.php index a789e827f42..bbc7e800d07 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteCreatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/QuoteCreatedMessage.php @@ -8,9 +8,24 @@ namespace Commercetools\Api\Models\Message; +use Commercetools\Api\Models\Quote\Quote; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; interface QuoteCreatedMessage extends Message { + public const FIELD_QUOTE = 'quote'; + + /** + *

    Quote that was created.

    + * + + * @return null|Quote + */ + public function getQuote(); + + /** + * @param ?Quote $quote + */ + public function setQuote(?Quote $quote): void; } diff --git a/lib/commercetools-api/src/Models/Message/QuoteCreatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/QuoteCreatedMessageBuilder.php index 212e242ca07..2693e7d063c 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteCreatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/QuoteCreatedMessageBuilder.php @@ -14,6 +14,8 @@ use Commercetools\Api\Models\Common\LastModifiedByBuilder; use Commercetools\Api\Models\Common\Reference; use Commercetools\Api\Models\Common\ReferenceBuilder; +use Commercetools\Api\Models\Quote\Quote; +use Commercetools\Api\Models\Quote\QuoteBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -28,58 +30,75 @@ final class QuoteCreatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** - *

    Unique identifier of the Message.

    + + * @var null|Quote|QuoteBuilder + */ + private $quote; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -88,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -96,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -104,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -112,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -124,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -132,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -140,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -150,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -158,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -165,6 +206,17 @@ public function getResourceUserProvidedIdentifiers() return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; } + /** + *

    Quote that was created.

    + * + + * @return null|Quote + */ + public function getQuote() + { + return $this->quote instanceof QuoteBuilder ? $this->quote->build() : $this->quote; + } + /** * @param ?string $id * @return $this @@ -275,6 +327,17 @@ public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $re return $this; } + /** + * @param ?Quote $quote + * @return $this + */ + public function withQuote(?Quote $quote) + { + $this->quote = $quote; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -319,6 +382,17 @@ public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifi return $this; } + /** + * @deprecated use withQuote() instead + * @return $this + */ + public function withQuoteBuilder(?QuoteBuilder $quote) + { + $this->quote = $quote; + + return $this; + } + public function build(): QuoteCreatedMessage { return new QuoteCreatedMessageModel( @@ -331,7 +405,8 @@ public function build(): QuoteCreatedMessage $this->sequenceNumber, $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, $this->resourceVersion, - $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->quote instanceof QuoteBuilder ? $this->quote->build() : $this->quote ); } diff --git a/lib/commercetools-api/src/Models/Message/QuoteCreatedMessageModel.php b/lib/commercetools-api/src/Models/Message/QuoteCreatedMessageModel.php index 0b4a648ac79..467fc37129c 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteCreatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/QuoteCreatedMessageModel.php @@ -14,6 +14,8 @@ use Commercetools\Api\Models\Common\LastModifiedByModel; use Commercetools\Api\Models\Common\Reference; use Commercetools\Api\Models\Common\ReferenceModel; +use Commercetools\Api\Models\Quote\Quote; +use Commercetools\Api\Models\Quote\QuoteModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -28,60 +30,77 @@ final class QuoteCreatedMessageModel extends JsonObjectModel implements QuoteCre { public const DISCRIMINATOR_VALUE = 'QuoteCreated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; + /** + * + * @var ?Quote + */ + protected $quote; + /** * @psalm-suppress MissingParamType @@ -96,7 +115,9 @@ public function __construct( ?int $sequenceNumber = null, ?Reference $resource = null, ?int $resourceVersion = null, - ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null + ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, + ?Quote $quote = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -108,11 +129,13 @@ public function __construct( $this->resource = $resource; $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; - $this->type = static::DISCRIMINATOR_VALUE; + $this->quote = $quote; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -131,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -148,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -169,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -190,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -212,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -230,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -247,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -267,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -284,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -301,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -318,6 +366,27 @@ public function getResourceUserProvidedIdentifiers() return $this->resourceUserProvidedIdentifiers; } + /** + *

    Quote that was created.

    + * + * + * @return null|Quote + */ + public function getQuote() + { + if (is_null($this->quote)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_QUOTE); + if (is_null($data)) { + return null; + } + + $this->quote = QuoteModel::of($data); + } + + return $this->quote; + } + /** * @param ?string $id @@ -399,6 +468,14 @@ public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $res $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; } + /** + * @param ?Quote $quote + */ + public function setQuote(?Quote $quote): void + { + $this->quote = $quote; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/QuoteCreatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/QuoteCreatedMessagePayload.php index 7edd125592f..5973925da01 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteCreatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/QuoteCreatedMessagePayload.php @@ -8,9 +8,24 @@ namespace Commercetools\Api\Models\Message; +use Commercetools\Api\Models\Quote\Quote; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; interface QuoteCreatedMessagePayload extends MessagePayload { + public const FIELD_QUOTE = 'quote'; + + /** + *

    Quote that was created.

    + * + + * @return null|Quote + */ + public function getQuote(); + + /** + * @param ?Quote $quote + */ + public function setQuote(?Quote $quote): void; } diff --git a/lib/commercetools-api/src/Models/Message/QuoteCreatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/QuoteCreatedMessagePayloadBuilder.php index 6a6e8615bf4..4418e9cc493 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteCreatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/QuoteCreatedMessagePayloadBuilder.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Message; +use Commercetools\Api\Models\Quote\Quote; +use Commercetools\Api\Models\Quote\QuoteBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -20,9 +22,49 @@ */ final class QuoteCreatedMessagePayloadBuilder implements Builder { + /** + + * @var null|Quote|QuoteBuilder + */ + private $quote; + + /** + *

    Quote that was created.

    + * + + * @return null|Quote + */ + public function getQuote() + { + return $this->quote instanceof QuoteBuilder ? $this->quote->build() : $this->quote; + } + + /** + * @param ?Quote $quote + * @return $this + */ + public function withQuote(?Quote $quote) + { + $this->quote = $quote; + + return $this; + } + + /** + * @deprecated use withQuote() instead + * @return $this + */ + public function withQuoteBuilder(?QuoteBuilder $quote) + { + $this->quote = $quote; + + return $this; + } + public function build(): QuoteCreatedMessagePayload { return new QuoteCreatedMessagePayloadModel( + $this->quote instanceof QuoteBuilder ? $this->quote->build() : $this->quote ); } diff --git a/lib/commercetools-api/src/Models/Message/QuoteCreatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/QuoteCreatedMessagePayloadModel.php index 49ada2c8113..16a5abdfebe 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteCreatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/QuoteCreatedMessagePayloadModel.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Message; +use Commercetools\Api\Models\Quote\Quote; +use Commercetools\Api\Models\Quote\QuoteModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -21,20 +23,31 @@ final class QuoteCreatedMessagePayloadModel extends JsonObjectModel implements Q { public const DISCRIMINATOR_VALUE = 'QuoteCreated'; /** + * * @var ?string */ protected $type; + /** + * + * @var ?Quote + */ + protected $quote; + /** * @psalm-suppress MissingParamType */ public function __construct( + ?Quote $quote = null, + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->quote = $quote; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -50,4 +63,34 @@ public function getType() return $this->type; } + + /** + *

    Quote that was created.

    + * + * + * @return null|Quote + */ + public function getQuote() + { + if (is_null($this->quote)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_QUOTE); + if (is_null($data)) { + return null; + } + + $this->quote = QuoteModel::of($data); + } + + return $this->quote; + } + + + /** + * @param ?Quote $quote + */ + public function setQuote(?Quote $quote): void + { + $this->quote = $quote; + } } diff --git a/lib/commercetools-api/src/Models/Message/QuoteDeletedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/QuoteDeletedMessageBuilder.php index 40852bd06de..3da0b7887a0 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteDeletedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/QuoteDeletedMessageBuilder.php @@ -28,58 +28,69 @@ final class QuoteDeletedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -88,6 +99,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -96,6 +110,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -104,6 +121,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -112,8 +132,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -124,6 +145,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -132,6 +154,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -140,8 +166,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -150,6 +177,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -158,6 +188,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/QuoteDeletedMessageModel.php b/lib/commercetools-api/src/Models/Message/QuoteDeletedMessageModel.php index 40ed7c7b3de..419e13f0fba 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteDeletedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/QuoteDeletedMessageModel.php @@ -28,56 +28,67 @@ final class QuoteDeletedMessageModel extends JsonObjectModel implements QuoteDel { public const DISCRIMINATOR_VALUE = 'QuoteDeleted'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; @@ -96,7 +107,8 @@ public function __construct( ?int $sequenceNumber = null, ?Reference $resource = null, ?int $resourceVersion = null, - ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null + ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -108,11 +120,12 @@ public function __construct( $this->resource = $resource; $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -131,6 +144,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -148,6 +164,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -169,6 +188,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -190,7 +212,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -212,6 +235,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -230,6 +254,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -247,7 +275,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -267,6 +296,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -284,6 +316,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -301,6 +336,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/QuoteDeletedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/QuoteDeletedMessagePayloadModel.php index 25776cb5bb3..b24b276542f 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteDeletedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/QuoteDeletedMessagePayloadModel.php @@ -21,6 +21,7 @@ final class QuoteDeletedMessagePayloadModel extends JsonObjectModel implements Q { public const DISCRIMINATOR_VALUE = 'QuoteDeleted'; /** + * * @var ?string */ protected $type; @@ -30,11 +31,13 @@ final class QuoteDeletedMessagePayloadModel extends JsonObjectModel implements Q * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessage.php b/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessage.php index 6eeb9f65fcb..08a44ce620d 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessage.php @@ -8,9 +8,24 @@ namespace Commercetools\Api\Models\Message; +use Commercetools\Api\Models\QuoteRequest\QuoteRequest; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; interface QuoteRequestCreatedMessage extends Message { + public const FIELD_QUOTE_REQUEST = 'quoteRequest'; + + /** + *

    Quote Request that was created.

    + * + + * @return null|QuoteRequest + */ + public function getQuoteRequest(); + + /** + * @param ?QuoteRequest $quoteRequest + */ + public function setQuoteRequest(?QuoteRequest $quoteRequest): void; } diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessageBuilder.php index 2b6542f5dae..3b19f92c74a 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessageBuilder.php @@ -14,6 +14,8 @@ use Commercetools\Api\Models\Common\LastModifiedByBuilder; use Commercetools\Api\Models\Common\Reference; use Commercetools\Api\Models\Common\ReferenceBuilder; +use Commercetools\Api\Models\QuoteRequest\QuoteRequest; +use Commercetools\Api\Models\QuoteRequest\QuoteRequestBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -28,58 +30,75 @@ final class QuoteRequestCreatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** - *

    Unique identifier of the Message.

    + + * @var null|QuoteRequest|QuoteRequestBuilder + */ + private $quoteRequest; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -88,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -96,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -104,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -112,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -124,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -132,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -140,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -150,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -158,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -165,6 +206,17 @@ public function getResourceUserProvidedIdentifiers() return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; } + /** + *

    Quote Request that was created.

    + * + + * @return null|QuoteRequest + */ + public function getQuoteRequest() + { + return $this->quoteRequest instanceof QuoteRequestBuilder ? $this->quoteRequest->build() : $this->quoteRequest; + } + /** * @param ?string $id * @return $this @@ -275,6 +327,17 @@ public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $re return $this; } + /** + * @param ?QuoteRequest $quoteRequest + * @return $this + */ + public function withQuoteRequest(?QuoteRequest $quoteRequest) + { + $this->quoteRequest = $quoteRequest; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -319,6 +382,17 @@ public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifi return $this; } + /** + * @deprecated use withQuoteRequest() instead + * @return $this + */ + public function withQuoteRequestBuilder(?QuoteRequestBuilder $quoteRequest) + { + $this->quoteRequest = $quoteRequest; + + return $this; + } + public function build(): QuoteRequestCreatedMessage { return new QuoteRequestCreatedMessageModel( @@ -331,7 +405,8 @@ public function build(): QuoteRequestCreatedMessage $this->sequenceNumber, $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, $this->resourceVersion, - $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->quoteRequest instanceof QuoteRequestBuilder ? $this->quoteRequest->build() : $this->quoteRequest ); } diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessageModel.php b/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessageModel.php index a7467ef8e9b..ac907267b21 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessageModel.php @@ -14,6 +14,8 @@ use Commercetools\Api\Models\Common\LastModifiedByModel; use Commercetools\Api\Models\Common\Reference; use Commercetools\Api\Models\Common\ReferenceModel; +use Commercetools\Api\Models\QuoteRequest\QuoteRequest; +use Commercetools\Api\Models\QuoteRequest\QuoteRequestModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -28,60 +30,77 @@ final class QuoteRequestCreatedMessageModel extends JsonObjectModel implements Q { public const DISCRIMINATOR_VALUE = 'QuoteRequestCreated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; + /** + * + * @var ?QuoteRequest + */ + protected $quoteRequest; + /** * @psalm-suppress MissingParamType @@ -96,7 +115,9 @@ public function __construct( ?int $sequenceNumber = null, ?Reference $resource = null, ?int $resourceVersion = null, - ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null + ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, + ?QuoteRequest $quoteRequest = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -108,11 +129,13 @@ public function __construct( $this->resource = $resource; $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; - $this->type = static::DISCRIMINATOR_VALUE; + $this->quoteRequest = $quoteRequest; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -131,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -148,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -169,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -190,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -212,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -230,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -247,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -267,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -284,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -301,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -318,6 +366,27 @@ public function getResourceUserProvidedIdentifiers() return $this->resourceUserProvidedIdentifiers; } + /** + *

    Quote Request that was created.

    + * + * + * @return null|QuoteRequest + */ + public function getQuoteRequest() + { + if (is_null($this->quoteRequest)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_QUOTE_REQUEST); + if (is_null($data)) { + return null; + } + + $this->quoteRequest = QuoteRequestModel::of($data); + } + + return $this->quoteRequest; + } + /** * @param ?string $id @@ -399,6 +468,14 @@ public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $res $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; } + /** + * @param ?QuoteRequest $quoteRequest + */ + public function setQuoteRequest(?QuoteRequest $quoteRequest): void + { + $this->quoteRequest = $quoteRequest; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessagePayload.php index 2a351cb3748..ad4b5583a06 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessagePayload.php @@ -8,9 +8,24 @@ namespace Commercetools\Api\Models\Message; +use Commercetools\Api\Models\QuoteRequest\QuoteRequest; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; interface QuoteRequestCreatedMessagePayload extends MessagePayload { + public const FIELD_QUOTE_REQUEST = 'quoteRequest'; + + /** + *

    Quote Request that was created.

    + * + + * @return null|QuoteRequest + */ + public function getQuoteRequest(); + + /** + * @param ?QuoteRequest $quoteRequest + */ + public function setQuoteRequest(?QuoteRequest $quoteRequest): void; } diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessagePayloadBuilder.php index c6715bfaae4..2e36a05d6fb 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessagePayloadBuilder.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Message; +use Commercetools\Api\Models\QuoteRequest\QuoteRequest; +use Commercetools\Api\Models\QuoteRequest\QuoteRequestBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -20,9 +22,49 @@ */ final class QuoteRequestCreatedMessagePayloadBuilder implements Builder { + /** + + * @var null|QuoteRequest|QuoteRequestBuilder + */ + private $quoteRequest; + + /** + *

    Quote Request that was created.

    + * + + * @return null|QuoteRequest + */ + public function getQuoteRequest() + { + return $this->quoteRequest instanceof QuoteRequestBuilder ? $this->quoteRequest->build() : $this->quoteRequest; + } + + /** + * @param ?QuoteRequest $quoteRequest + * @return $this + */ + public function withQuoteRequest(?QuoteRequest $quoteRequest) + { + $this->quoteRequest = $quoteRequest; + + return $this; + } + + /** + * @deprecated use withQuoteRequest() instead + * @return $this + */ + public function withQuoteRequestBuilder(?QuoteRequestBuilder $quoteRequest) + { + $this->quoteRequest = $quoteRequest; + + return $this; + } + public function build(): QuoteRequestCreatedMessagePayload { return new QuoteRequestCreatedMessagePayloadModel( + $this->quoteRequest instanceof QuoteRequestBuilder ? $this->quoteRequest->build() : $this->quoteRequest ); } diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessagePayloadModel.php index dad6594e8a1..fc7dd994bb6 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestCreatedMessagePayloadModel.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Message; +use Commercetools\Api\Models\QuoteRequest\QuoteRequest; +use Commercetools\Api\Models\QuoteRequest\QuoteRequestModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -21,20 +23,31 @@ final class QuoteRequestCreatedMessagePayloadModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'QuoteRequestCreated'; /** + * * @var ?string */ protected $type; + /** + * + * @var ?QuoteRequest + */ + protected $quoteRequest; + /** * @psalm-suppress MissingParamType */ public function __construct( + ?QuoteRequest $quoteRequest = null, + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->quoteRequest = $quoteRequest; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -50,4 +63,34 @@ public function getType() return $this->type; } + + /** + *

    Quote Request that was created.

    + * + * + * @return null|QuoteRequest + */ + public function getQuoteRequest() + { + if (is_null($this->quoteRequest)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_QUOTE_REQUEST); + if (is_null($data)) { + return null; + } + + $this->quoteRequest = QuoteRequestModel::of($data); + } + + return $this->quoteRequest; + } + + + /** + * @param ?QuoteRequest $quoteRequest + */ + public function setQuoteRequest(?QuoteRequest $quoteRequest): void + { + $this->quoteRequest = $quoteRequest; + } } diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestDeletedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/QuoteRequestDeletedMessageBuilder.php index eb9624607aa..7af44b58468 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteRequestDeletedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestDeletedMessageBuilder.php @@ -28,58 +28,69 @@ final class QuoteRequestDeletedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -88,6 +99,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -96,6 +110,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -104,6 +121,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -112,8 +132,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -124,6 +145,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -132,6 +154,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -140,8 +166,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -150,6 +177,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -158,6 +188,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestDeletedMessageModel.php b/lib/commercetools-api/src/Models/Message/QuoteRequestDeletedMessageModel.php index 69776026e1e..1d1cf758781 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteRequestDeletedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestDeletedMessageModel.php @@ -28,56 +28,67 @@ final class QuoteRequestDeletedMessageModel extends JsonObjectModel implements Q { public const DISCRIMINATOR_VALUE = 'QuoteRequestDeleted'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; @@ -96,7 +107,8 @@ public function __construct( ?int $sequenceNumber = null, ?Reference $resource = null, ?int $resourceVersion = null, - ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null + ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -108,11 +120,12 @@ public function __construct( $this->resource = $resource; $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -131,6 +144,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -148,6 +164,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -169,6 +188,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -190,7 +212,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -212,6 +235,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -230,6 +254,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -247,7 +275,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -267,6 +296,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -284,6 +316,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -301,6 +336,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestDeletedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/QuoteRequestDeletedMessagePayloadModel.php index 84ff97534ca..fe0e678c78d 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteRequestDeletedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestDeletedMessagePayloadModel.php @@ -21,6 +21,7 @@ final class QuoteRequestDeletedMessagePayloadModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'QuoteRequestDeleted'; /** + * * @var ?string */ protected $type; @@ -30,11 +31,13 @@ final class QuoteRequestDeletedMessagePayloadModel extends JsonObjectModel imple * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessage.php b/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessage.php index 4ff6560932c..f3254e831bc 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessage.php +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessage.php @@ -17,15 +17,17 @@ interface QuoteRequestStateChangedMessage extends Message public const FIELD_OLD_QUOTE_REQUEST_STATE = 'oldQuoteRequestState'; /** - *

    Predefined states tracking the status of the Quote Request in the negotiation process.

    + *

    State of the Quote Request after the Change Quote Request State update action.

    * + * @return null|string */ public function getQuoteRequestState(); /** - *

    Predefined states tracking the status of the Quote Request in the negotiation process.

    + *

    State of the Quote Request before the Change Quote Request State update action.

    * + * @return null|string */ public function getOldQuoteRequestState(); diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessageBuilder.php index fda747014a1..eda2da9ec65 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessageBuilder.php @@ -28,68 +28,81 @@ final class QuoteRequestStateChangedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $quoteRequestState; /** + * @var ?string */ private $oldQuoteRequestState; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -98,6 +111,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -106,6 +122,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -114,6 +133,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -122,8 +144,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -134,6 +157,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -142,6 +166,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -150,8 +178,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -160,6 +189,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -168,6 +200,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -176,8 +211,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Predefined states tracking the status of the Quote Request in the negotiation process.

    + *

    State of the Quote Request after the Change Quote Request State update action.

    * + * @return null|string */ public function getQuoteRequestState() @@ -186,8 +222,9 @@ public function getQuoteRequestState() } /** - *

    Predefined states tracking the status of the Quote Request in the negotiation process.

    + *

    State of the Quote Request before the Change Quote Request State update action.

    * + * @return null|string */ public function getOldQuoteRequestState() diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessageModel.php index 345e3e101f3..18ac333df8a 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessageModel.php @@ -28,66 +28,79 @@ final class QuoteRequestStateChangedMessageModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'QuoteRequestStateChanged'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $quoteRequestState; /** + * * @var ?string */ protected $oldQuoteRequestState; @@ -108,7 +121,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $quoteRequestState = null, - ?string $oldQuoteRequestState = null + ?string $oldQuoteRequestState = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -122,11 +136,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->quoteRequestState = $quoteRequestState; $this->oldQuoteRequestState = $oldQuoteRequestState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -145,6 +160,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -162,6 +180,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -183,6 +204,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -204,7 +228,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -226,6 +251,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -244,6 +270,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -261,7 +291,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -281,6 +312,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -298,6 +332,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -315,6 +352,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -333,7 +373,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Predefined states tracking the status of the Quote Request in the negotiation process.

    + *

    State of the Quote Request after the Change Quote Request State update action.

    + * * * @return null|string */ @@ -352,7 +393,8 @@ public function getQuoteRequestState() } /** - *

    Predefined states tracking the status of the Quote Request in the negotiation process.

    + *

    State of the Quote Request before the Change Quote Request State update action.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessagePayload.php index 78d333766d3..dae4f11a636 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessagePayload.php @@ -17,15 +17,17 @@ interface QuoteRequestStateChangedMessagePayload extends MessagePayload public const FIELD_OLD_QUOTE_REQUEST_STATE = 'oldQuoteRequestState'; /** - *

    Predefined states tracking the status of the Quote Request in the negotiation process.

    + *

    State of the Quote Request after the Change Quote Request State update action.

    * + * @return null|string */ public function getQuoteRequestState(); /** - *

    Predefined states tracking the status of the Quote Request in the negotiation process.

    + *

    State of the Quote Request before the Change Quote Request State update action.

    * + * @return null|string */ public function getOldQuoteRequestState(); diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessagePayloadBuilder.php index fb3378f89b8..b78afeeb74f 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessagePayloadBuilder.php @@ -21,18 +21,21 @@ final class QuoteRequestStateChangedMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $quoteRequestState; /** + * @var ?string */ private $oldQuoteRequestState; /** - *

    Predefined states tracking the status of the Quote Request in the negotiation process.

    + *

    State of the Quote Request after the Change Quote Request State update action.

    * + * @return null|string */ public function getQuoteRequestState() @@ -41,8 +44,9 @@ public function getQuoteRequestState() } /** - *

    Predefined states tracking the status of the Quote Request in the negotiation process.

    + *

    State of the Quote Request before the Change Quote Request State update action.

    * + * @return null|string */ public function getOldQuoteRequestState() diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessagePayloadModel.php index 30407f70d10..19370d678d8 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestStateChangedMessagePayloadModel.php @@ -21,16 +21,19 @@ final class QuoteRequestStateChangedMessagePayloadModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'QuoteRequestStateChanged'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $quoteRequestState; /** + * * @var ?string */ protected $oldQuoteRequestState; @@ -41,14 +44,16 @@ final class QuoteRequestStateChangedMessagePayloadModel extends JsonObjectModel */ public function __construct( ?string $quoteRequestState = null, - ?string $oldQuoteRequestState = null + ?string $oldQuoteRequestState = null, + ?string $type = null ) { $this->quoteRequestState = $quoteRequestState; $this->oldQuoteRequestState = $oldQuoteRequestState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -66,7 +71,8 @@ public function getType() } /** - *

    Predefined states tracking the status of the Quote Request in the negotiation process.

    + *

    State of the Quote Request after the Change Quote Request State update action.

    + * * * @return null|string */ @@ -85,7 +91,8 @@ public function getQuoteRequestState() } /** - *

    Predefined states tracking the status of the Quote Request in the negotiation process.

    + *

    State of the Quote Request before the Change Quote Request State update action.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessage.php b/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessage.php new file mode 100644 index 00000000000..6ea413a4ca4 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessage.php @@ -0,0 +1,59 @@ +State of the Quote after the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getState(); + + /** + *

    State of the Quote before the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getOldState(); + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + + * @return null|bool + */ + public function getForce(); + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void; + + /** + * @param ?StateReference $oldState + */ + public function setOldState(?StateReference $oldState): void; + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void; +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessageBuilder.php b/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessageBuilder.php new file mode 100644 index 00000000000..93dd667d7fa --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessageBuilder.php @@ -0,0 +1,486 @@ + + */ +final class QuoteRequestStateTransitionMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|StateReference|StateReferenceBuilder + */ + private $state; + + /** + + * @var null|StateReference|StateReferenceBuilder + */ + private $oldState; + + /** + + * @var ?bool + */ + private $force; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    State of the Quote after the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getState() + { + return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; + } + + /** + *

    State of the Quote before the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getOldState() + { + return $this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState; + } + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + + * @return null|bool + */ + public function getForce() + { + return $this->force; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?StateReference $state + * @return $this + */ + public function withState(?StateReference $state) + { + $this->state = $state; + + return $this; + } + + /** + * @param ?StateReference $oldState + * @return $this + */ + public function withOldState(?StateReference $oldState) + { + $this->oldState = $oldState; + + return $this; + } + + /** + * @param ?bool $force + * @return $this + */ + public function withForce(?bool $force) + { + $this->force = $force; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateReferenceBuilder $state) + { + $this->state = $state; + + return $this; + } + + /** + * @deprecated use withOldState() instead + * @return $this + */ + public function withOldStateBuilder(?StateReferenceBuilder $oldState) + { + $this->oldState = $oldState; + + return $this; + } + + public function build(): QuoteRequestStateTransitionMessage + { + return new QuoteRequestStateTransitionMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state, + $this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState, + $this->force + ); + } + + public static function of(): QuoteRequestStateTransitionMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessageCollection.php b/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessageCollection.php new file mode 100644 index 00000000000..f45b466547b --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessageCollection.php @@ -0,0 +1,56 @@ + + * @method QuoteRequestStateTransitionMessage current() + * @method QuoteRequestStateTransitionMessage end() + * @method QuoteRequestStateTransitionMessage at($offset) + */ +class QuoteRequestStateTransitionMessageCollection extends MessageCollection +{ + /** + * @psalm-assert QuoteRequestStateTransitionMessage $value + * @psalm-param QuoteRequestStateTransitionMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return QuoteRequestStateTransitionMessageCollection + */ + public function add($value) + { + if (!$value instanceof QuoteRequestStateTransitionMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?QuoteRequestStateTransitionMessage + */ + protected function mapper() + { + return function (?int $index): ?QuoteRequestStateTransitionMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var QuoteRequestStateTransitionMessage $data */ + $data = QuoteRequestStateTransitionMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessageModel.php b/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessageModel.php new file mode 100644 index 00000000000..5eba49c6815 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessageModel.php @@ -0,0 +1,566 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->state = $state; + $this->oldState = $oldState; + $this->force = $force; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    State of the Quote after the Transition State update action.

    + * + * + * @return null|StateReference + */ + public function getState() + { + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); + if (is_null($data)) { + return null; + } + + $this->state = StateReferenceModel::of($data); + } + + return $this->state; + } + + /** + *

    State of the Quote before the Transition State update action.

    + * + * + * @return null|StateReference + */ + public function getOldState() + { + if (is_null($this->oldState)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_OLD_STATE); + if (is_null($data)) { + return null; + } + + $this->oldState = StateReferenceModel::of($data); + } + + return $this->oldState; + } + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * + * @return null|bool + */ + public function getForce() + { + if (is_null($this->force)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_FORCE); + if (is_null($data)) { + return null; + } + $this->force = (bool) $data; + } + + return $this->force; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void + { + $this->state = $state; + } + + /** + * @param ?StateReference $oldState + */ + public function setOldState(?StateReference $oldState): void + { + $this->oldState = $oldState; + } + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void + { + $this->force = $force; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessagePayload.php b/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessagePayload.php new file mode 100644 index 00000000000..9d5f62b2a8e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessagePayload.php @@ -0,0 +1,59 @@ +State of the Quote after the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getState(); + + /** + *

    State of the Quote before the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getOldState(); + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + + * @return null|bool + */ + public function getForce(); + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void; + + /** + * @param ?StateReference $oldState + */ + public function setOldState(?StateReference $oldState): void; + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void; +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessagePayloadBuilder.php new file mode 100644 index 00000000000..9ecd75f47fd --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessagePayloadBuilder.php @@ -0,0 +1,144 @@ + + */ +final class QuoteRequestStateTransitionMessagePayloadBuilder implements Builder +{ + /** + + * @var null|StateReference|StateReferenceBuilder + */ + private $state; + + /** + + * @var null|StateReference|StateReferenceBuilder + */ + private $oldState; + + /** + + * @var ?bool + */ + private $force; + + /** + *

    State of the Quote after the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getState() + { + return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; + } + + /** + *

    State of the Quote before the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getOldState() + { + return $this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState; + } + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + + * @return null|bool + */ + public function getForce() + { + return $this->force; + } + + /** + * @param ?StateReference $state + * @return $this + */ + public function withState(?StateReference $state) + { + $this->state = $state; + + return $this; + } + + /** + * @param ?StateReference $oldState + * @return $this + */ + public function withOldState(?StateReference $oldState) + { + $this->oldState = $oldState; + + return $this; + } + + /** + * @param ?bool $force + * @return $this + */ + public function withForce(?bool $force) + { + $this->force = $force; + + return $this; + } + + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateReferenceBuilder $state) + { + $this->state = $state; + + return $this; + } + + /** + * @deprecated use withOldState() instead + * @return $this + */ + public function withOldStateBuilder(?StateReferenceBuilder $oldState) + { + $this->oldState = $oldState; + + return $this; + } + + public function build(): QuoteRequestStateTransitionMessagePayload + { + return new QuoteRequestStateTransitionMessagePayloadModel( + $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state, + $this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState, + $this->force + ); + } + + public static function of(): QuoteRequestStateTransitionMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessagePayloadCollection.php new file mode 100644 index 00000000000..1a3f1296286 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method QuoteRequestStateTransitionMessagePayload current() + * @method QuoteRequestStateTransitionMessagePayload end() + * @method QuoteRequestStateTransitionMessagePayload at($offset) + */ +class QuoteRequestStateTransitionMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert QuoteRequestStateTransitionMessagePayload $value + * @psalm-param QuoteRequestStateTransitionMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return QuoteRequestStateTransitionMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof QuoteRequestStateTransitionMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?QuoteRequestStateTransitionMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?QuoteRequestStateTransitionMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var QuoteRequestStateTransitionMessagePayload $data */ + $data = QuoteRequestStateTransitionMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessagePayloadModel.php new file mode 100644 index 00000000000..74a3c502009 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteRequestStateTransitionMessagePayloadModel.php @@ -0,0 +1,169 @@ +state = $state; + $this->oldState = $oldState; + $this->force = $force; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    State of the Quote after the Transition State update action.

    + * + * + * @return null|StateReference + */ + public function getState() + { + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); + if (is_null($data)) { + return null; + } + + $this->state = StateReferenceModel::of($data); + } + + return $this->state; + } + + /** + *

    State of the Quote before the Transition State update action.

    + * + * + * @return null|StateReference + */ + public function getOldState() + { + if (is_null($this->oldState)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_OLD_STATE); + if (is_null($data)) { + return null; + } + + $this->oldState = StateReferenceModel::of($data); + } + + return $this->oldState; + } + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * + * @return null|bool + */ + public function getForce() + { + if (is_null($this->force)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_FORCE); + if (is_null($data)) { + return null; + } + $this->force = (bool) $data; + } + + return $this->force; + } + + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void + { + $this->state = $state; + } + + /** + * @param ?StateReference $oldState + */ + public function setOldState(?StateReference $oldState): void + { + $this->oldState = $oldState; + } + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void + { + $this->force = $force; + } +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessage.php b/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessage.php index 6ff6b8ce77c..b0782c71165 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessage.php +++ b/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessage.php @@ -17,15 +17,17 @@ interface QuoteStateChangedMessage extends Message public const FIELD_OLD_QUOTE_STATE = 'oldQuoteState'; /** - *

    Predefined states tracking the status of the Quote.

    + *

    State of the Quote after the Change Quote State update action.

    * + * @return null|string */ public function getQuoteState(); /** - *

    Predefined states tracking the status of the Quote.

    + *

    State of the Quote before the Change Quote State update action.

    * + * @return null|string */ public function getOldQuoteState(); diff --git a/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessageBuilder.php index 7ea5e4d3774..5f16a1f1ee3 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessageBuilder.php @@ -28,68 +28,81 @@ final class QuoteStateChangedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $quoteState; /** + * @var ?string */ private $oldQuoteState; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -98,6 +111,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -106,6 +122,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -114,6 +133,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -122,8 +144,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -134,6 +157,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -142,6 +166,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -150,8 +178,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -160,6 +189,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -168,6 +200,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -176,8 +211,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Predefined states tracking the status of the Quote.

    + *

    State of the Quote after the Change Quote State update action.

    * + * @return null|string */ public function getQuoteState() @@ -186,8 +222,9 @@ public function getQuoteState() } /** - *

    Predefined states tracking the status of the Quote.

    + *

    State of the Quote before the Change Quote State update action.

    * + * @return null|string */ public function getOldQuoteState() diff --git a/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessageModel.php index 3505bc857be..dc09cabca6e 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessageModel.php @@ -28,66 +28,79 @@ final class QuoteStateChangedMessageModel extends JsonObjectModel implements Quo { public const DISCRIMINATOR_VALUE = 'QuoteStateChanged'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $quoteState; /** + * * @var ?string */ protected $oldQuoteState; @@ -108,7 +121,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $quoteState = null, - ?string $oldQuoteState = null + ?string $oldQuoteState = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -122,11 +136,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->quoteState = $quoteState; $this->oldQuoteState = $oldQuoteState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -145,6 +160,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -162,6 +180,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -183,6 +204,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -204,7 +228,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -226,6 +251,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -244,6 +270,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -261,7 +291,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -281,6 +312,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -298,6 +332,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -315,6 +352,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -333,7 +373,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Predefined states tracking the status of the Quote.

    + *

    State of the Quote after the Change Quote State update action.

    + * * * @return null|string */ @@ -352,7 +393,8 @@ public function getQuoteState() } /** - *

    Predefined states tracking the status of the Quote.

    + *

    State of the Quote before the Change Quote State update action.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessagePayload.php index 8716edac2d8..b8b1567831f 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessagePayload.php @@ -17,15 +17,17 @@ interface QuoteStateChangedMessagePayload extends MessagePayload public const FIELD_OLD_QUOTE_STATE = 'oldQuoteState'; /** - *

    Predefined states tracking the status of the Quote.

    + *

    State of the Quote after the Change Quote State update action.

    * + * @return null|string */ public function getQuoteState(); /** - *

    Predefined states tracking the status of the Quote.

    + *

    State of the Quote before the Change Quote State update action.

    * + * @return null|string */ public function getOldQuoteState(); diff --git a/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessagePayloadBuilder.php index 204d9228572..d6ef925a73b 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessagePayloadBuilder.php @@ -21,18 +21,21 @@ final class QuoteStateChangedMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $quoteState; /** + * @var ?string */ private $oldQuoteState; /** - *

    Predefined states tracking the status of the Quote.

    + *

    State of the Quote after the Change Quote State update action.

    * + * @return null|string */ public function getQuoteState() @@ -41,8 +44,9 @@ public function getQuoteState() } /** - *

    Predefined states tracking the status of the Quote.

    + *

    State of the Quote before the Change Quote State update action.

    * + * @return null|string */ public function getOldQuoteState() diff --git a/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessagePayloadModel.php index 7b04ca03528..0e48db016a5 100644 --- a/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/QuoteStateChangedMessagePayloadModel.php @@ -21,16 +21,19 @@ final class QuoteStateChangedMessagePayloadModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'QuoteStateChanged'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $quoteState; /** + * * @var ?string */ protected $oldQuoteState; @@ -41,14 +44,16 @@ final class QuoteStateChangedMessagePayloadModel extends JsonObjectModel impleme */ public function __construct( ?string $quoteState = null, - ?string $oldQuoteState = null + ?string $oldQuoteState = null, + ?string $type = null ) { $this->quoteState = $quoteState; $this->oldQuoteState = $oldQuoteState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -66,7 +71,8 @@ public function getType() } /** - *

    Predefined states tracking the status of the Quote.

    + *

    State of the Quote after the Change Quote State update action.

    + * * * @return null|string */ @@ -85,7 +91,8 @@ public function getQuoteState() } /** - *

    Predefined states tracking the status of the Quote.

    + *

    State of the Quote before the Change Quote State update action.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessage.php b/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessage.php new file mode 100644 index 00000000000..70295d5fa6e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessage.php @@ -0,0 +1,59 @@ +State of the Quote after the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getState(); + + /** + *

    State of the Quote before the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getOldState(); + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + + * @return null|bool + */ + public function getForce(); + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void; + + /** + * @param ?StateReference $oldState + */ + public function setOldState(?StateReference $oldState): void; + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void; +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessageBuilder.php b/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessageBuilder.php new file mode 100644 index 00000000000..f421ed2a610 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessageBuilder.php @@ -0,0 +1,486 @@ + + */ +final class QuoteStateTransitionMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|StateReference|StateReferenceBuilder + */ + private $state; + + /** + + * @var null|StateReference|StateReferenceBuilder + */ + private $oldState; + + /** + + * @var ?bool + */ + private $force; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    State of the Quote after the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getState() + { + return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; + } + + /** + *

    State of the Quote before the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getOldState() + { + return $this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState; + } + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + + * @return null|bool + */ + public function getForce() + { + return $this->force; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?StateReference $state + * @return $this + */ + public function withState(?StateReference $state) + { + $this->state = $state; + + return $this; + } + + /** + * @param ?StateReference $oldState + * @return $this + */ + public function withOldState(?StateReference $oldState) + { + $this->oldState = $oldState; + + return $this; + } + + /** + * @param ?bool $force + * @return $this + */ + public function withForce(?bool $force) + { + $this->force = $force; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateReferenceBuilder $state) + { + $this->state = $state; + + return $this; + } + + /** + * @deprecated use withOldState() instead + * @return $this + */ + public function withOldStateBuilder(?StateReferenceBuilder $oldState) + { + $this->oldState = $oldState; + + return $this; + } + + public function build(): QuoteStateTransitionMessage + { + return new QuoteStateTransitionMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state, + $this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState, + $this->force + ); + } + + public static function of(): QuoteStateTransitionMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessageCollection.php b/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessageCollection.php new file mode 100644 index 00000000000..d07ffff6d0b --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessageCollection.php @@ -0,0 +1,56 @@ + + * @method QuoteStateTransitionMessage current() + * @method QuoteStateTransitionMessage end() + * @method QuoteStateTransitionMessage at($offset) + */ +class QuoteStateTransitionMessageCollection extends MessageCollection +{ + /** + * @psalm-assert QuoteStateTransitionMessage $value + * @psalm-param QuoteStateTransitionMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return QuoteStateTransitionMessageCollection + */ + public function add($value) + { + if (!$value instanceof QuoteStateTransitionMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?QuoteStateTransitionMessage + */ + protected function mapper() + { + return function (?int $index): ?QuoteStateTransitionMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var QuoteStateTransitionMessage $data */ + $data = QuoteStateTransitionMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessageModel.php b/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessageModel.php new file mode 100644 index 00000000000..030f58cceb9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessageModel.php @@ -0,0 +1,566 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->state = $state; + $this->oldState = $oldState; + $this->force = $force; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    State of the Quote after the Transition State update action.

    + * + * + * @return null|StateReference + */ + public function getState() + { + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); + if (is_null($data)) { + return null; + } + + $this->state = StateReferenceModel::of($data); + } + + return $this->state; + } + + /** + *

    State of the Quote before the Transition State update action.

    + * + * + * @return null|StateReference + */ + public function getOldState() + { + if (is_null($this->oldState)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_OLD_STATE); + if (is_null($data)) { + return null; + } + + $this->oldState = StateReferenceModel::of($data); + } + + return $this->oldState; + } + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * + * @return null|bool + */ + public function getForce() + { + if (is_null($this->force)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_FORCE); + if (is_null($data)) { + return null; + } + $this->force = (bool) $data; + } + + return $this->force; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void + { + $this->state = $state; + } + + /** + * @param ?StateReference $oldState + */ + public function setOldState(?StateReference $oldState): void + { + $this->oldState = $oldState; + } + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void + { + $this->force = $force; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessagePayload.php b/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessagePayload.php new file mode 100644 index 00000000000..cb0bd1d7e69 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessagePayload.php @@ -0,0 +1,59 @@ +State of the Quote after the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getState(); + + /** + *

    State of the Quote before the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getOldState(); + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + + * @return null|bool + */ + public function getForce(); + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void; + + /** + * @param ?StateReference $oldState + */ + public function setOldState(?StateReference $oldState): void; + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void; +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessagePayloadBuilder.php new file mode 100644 index 00000000000..8315a2a1c36 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessagePayloadBuilder.php @@ -0,0 +1,144 @@ + + */ +final class QuoteStateTransitionMessagePayloadBuilder implements Builder +{ + /** + + * @var null|StateReference|StateReferenceBuilder + */ + private $state; + + /** + + * @var null|StateReference|StateReferenceBuilder + */ + private $oldState; + + /** + + * @var ?bool + */ + private $force; + + /** + *

    State of the Quote after the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getState() + { + return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; + } + + /** + *

    State of the Quote before the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getOldState() + { + return $this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState; + } + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + + * @return null|bool + */ + public function getForce() + { + return $this->force; + } + + /** + * @param ?StateReference $state + * @return $this + */ + public function withState(?StateReference $state) + { + $this->state = $state; + + return $this; + } + + /** + * @param ?StateReference $oldState + * @return $this + */ + public function withOldState(?StateReference $oldState) + { + $this->oldState = $oldState; + + return $this; + } + + /** + * @param ?bool $force + * @return $this + */ + public function withForce(?bool $force) + { + $this->force = $force; + + return $this; + } + + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateReferenceBuilder $state) + { + $this->state = $state; + + return $this; + } + + /** + * @deprecated use withOldState() instead + * @return $this + */ + public function withOldStateBuilder(?StateReferenceBuilder $oldState) + { + $this->oldState = $oldState; + + return $this; + } + + public function build(): QuoteStateTransitionMessagePayload + { + return new QuoteStateTransitionMessagePayloadModel( + $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state, + $this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState, + $this->force + ); + } + + public static function of(): QuoteStateTransitionMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessagePayloadCollection.php new file mode 100644 index 00000000000..0428a977faf --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method QuoteStateTransitionMessagePayload current() + * @method QuoteStateTransitionMessagePayload end() + * @method QuoteStateTransitionMessagePayload at($offset) + */ +class QuoteStateTransitionMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert QuoteStateTransitionMessagePayload $value + * @psalm-param QuoteStateTransitionMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return QuoteStateTransitionMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof QuoteStateTransitionMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?QuoteStateTransitionMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?QuoteStateTransitionMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var QuoteStateTransitionMessagePayload $data */ + $data = QuoteStateTransitionMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessagePayloadModel.php new file mode 100644 index 00000000000..99142ab029e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteStateTransitionMessagePayloadModel.php @@ -0,0 +1,169 @@ +state = $state; + $this->oldState = $oldState; + $this->force = $force; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    State of the Quote after the Transition State update action.

    + * + * + * @return null|StateReference + */ + public function getState() + { + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); + if (is_null($data)) { + return null; + } + + $this->state = StateReferenceModel::of($data); + } + + return $this->state; + } + + /** + *

    State of the Quote before the Transition State update action.

    + * + * + * @return null|StateReference + */ + public function getOldState() + { + if (is_null($this->oldState)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_OLD_STATE); + if (is_null($data)) { + return null; + } + + $this->oldState = StateReferenceModel::of($data); + } + + return $this->oldState; + } + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * + * @return null|bool + */ + public function getForce() + { + if (is_null($this->force)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_FORCE); + if (is_null($data)) { + return null; + } + $this->force = (bool) $data; + } + + return $this->force; + } + + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void + { + $this->state = $state; + } + + /** + * @param ?StateReference $oldState + */ + public function setOldState(?StateReference $oldState): void + { + $this->oldState = $oldState; + } + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void + { + $this->force = $force; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessage.php b/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessage.php similarity index 73% rename from lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessage.php rename to lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessage.php index 3ec938f901a..72ab9ae3d46 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessage.php @@ -12,11 +12,14 @@ use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; -interface OrderReturnInfoAddedMessage extends OrderMessage +interface ReturnInfoAddedMessage extends OrderMessage { public const FIELD_RETURN_INFO = 'returnInfo'; /** + *

    The ReturnInfo that was added to the Order.

    + * + * @return null|ReturnInfo */ public function getReturnInfo(); diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessageBuilder.php similarity index 83% rename from lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessageBuilder.php rename to lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessageBuilder.php index cc786e8a0ac..d3ebc90517f 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessageBuilder.php @@ -25,68 +25,80 @@ use stdClass; /** - * @implements Builder + * @implements Builder */ -final class OrderReturnInfoAddedMessageBuilder implements Builder +final class ReturnInfoAddedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|ReturnInfo|ReturnInfoBuilder */ private $returnInfo; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,6 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The ReturnInfo that was added to the Order.

    + * + * @return null|ReturnInfo */ public function getReturnInfo() @@ -356,9 +393,9 @@ public function withReturnInfoBuilder(?ReturnInfoBuilder $returnInfo) return $this; } - public function build(): OrderReturnInfoAddedMessage + public function build(): ReturnInfoAddedMessage { - return new OrderReturnInfoAddedMessageModel( + return new ReturnInfoAddedMessageModel( $this->id, $this->version, $this->createdAt, @@ -373,7 +410,7 @@ public function build(): OrderReturnInfoAddedMessage ); } - public static function of(): OrderReturnInfoAddedMessageBuilder + public static function of(): ReturnInfoAddedMessageBuilder { return new self(); } diff --git a/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessageCollection.php b/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessageCollection.php new file mode 100644 index 00000000000..02da8a32478 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method ReturnInfoAddedMessage current() + * @method ReturnInfoAddedMessage end() + * @method ReturnInfoAddedMessage at($offset) + */ +class ReturnInfoAddedMessageCollection extends OrderMessageCollection +{ + /** + * @psalm-assert ReturnInfoAddedMessage $value + * @psalm-param ReturnInfoAddedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return ReturnInfoAddedMessageCollection + */ + public function add($value) + { + if (!$value instanceof ReturnInfoAddedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ReturnInfoAddedMessage + */ + protected function mapper() + { + return function (?int $index): ?ReturnInfoAddedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ReturnInfoAddedMessage $data */ + $data = ReturnInfoAddedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessageModel.php similarity index 85% rename from lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessageModel.php rename to lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessageModel.php index 04984fcd668..2e3faa86c5d 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessageModel.php @@ -26,65 +26,77 @@ /** * @internal */ -final class OrderReturnInfoAddedMessageModel extends JsonObjectModel implements OrderReturnInfoAddedMessage +final class ReturnInfoAddedMessageModel extends JsonObjectModel implements ReturnInfoAddedMessage { public const DISCRIMINATOR_VALUE = 'ReturnInfoAdded'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?ReturnInfo */ protected $returnInfo; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?ReturnInfo $returnInfo = null + ?ReturnInfo $returnInfo = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->returnInfo = $returnInfo; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,6 +367,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The ReturnInfo that was added to the Order.

    + * + * * @return null|ReturnInfo */ public function getReturnInfo() diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessagePayload.php similarity index 72% rename from lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessagePayload.php rename to lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessagePayload.php index 214eea7a036..be5e6304309 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessagePayload.php @@ -12,11 +12,14 @@ use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; -interface OrderReturnInfoAddedMessagePayload extends OrderMessagePayload +interface ReturnInfoAddedMessagePayload extends OrderMessagePayload { public const FIELD_RETURN_INFO = 'returnInfo'; /** + *

    The ReturnInfo that was added to the Order.

    + * + * @return null|ReturnInfo */ public function getReturnInfo(); diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessagePayloadBuilder.php similarity index 75% rename from lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessagePayloadBuilder.php rename to lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessagePayloadBuilder.php index 323244f5246..dee24f8f8a8 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessagePayloadBuilder.php @@ -18,16 +18,20 @@ use stdClass; /** - * @implements Builder + * @implements Builder */ -final class OrderReturnInfoAddedMessagePayloadBuilder implements Builder +final class ReturnInfoAddedMessagePayloadBuilder implements Builder { /** + * @var null|ReturnInfo|ReturnInfoBuilder */ private $returnInfo; /** + *

    The ReturnInfo that was added to the Order.

    + * + * @return null|ReturnInfo */ public function getReturnInfo() @@ -57,14 +61,14 @@ public function withReturnInfoBuilder(?ReturnInfoBuilder $returnInfo) return $this; } - public function build(): OrderReturnInfoAddedMessagePayload + public function build(): ReturnInfoAddedMessagePayload { - return new OrderReturnInfoAddedMessagePayloadModel( + return new ReturnInfoAddedMessagePayloadModel( $this->returnInfo instanceof ReturnInfoBuilder ? $this->returnInfo->build() : $this->returnInfo ); } - public static function of(): OrderReturnInfoAddedMessagePayloadBuilder + public static function of(): ReturnInfoAddedMessagePayloadBuilder { return new self(); } diff --git a/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessagePayloadCollection.php new file mode 100644 index 00000000000..c748bad9157 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method ReturnInfoAddedMessagePayload current() + * @method ReturnInfoAddedMessagePayload end() + * @method ReturnInfoAddedMessagePayload at($offset) + */ +class ReturnInfoAddedMessagePayloadCollection extends OrderMessagePayloadCollection +{ + /** + * @psalm-assert ReturnInfoAddedMessagePayload $value + * @psalm-param ReturnInfoAddedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return ReturnInfoAddedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof ReturnInfoAddedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ReturnInfoAddedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?ReturnInfoAddedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ReturnInfoAddedMessagePayload $data */ + $data = ReturnInfoAddedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessagePayloadModel.php similarity index 81% rename from lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessagePayloadModel.php rename to lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessagePayloadModel.php index 25e04c64ae0..b4e90872774 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnInfoAddedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ReturnInfoAddedMessagePayloadModel.php @@ -19,15 +19,17 @@ /** * @internal */ -final class OrderReturnInfoAddedMessagePayloadModel extends JsonObjectModel implements OrderReturnInfoAddedMessagePayload +final class ReturnInfoAddedMessagePayloadModel extends JsonObjectModel implements ReturnInfoAddedMessagePayload { public const DISCRIMINATOR_VALUE = 'ReturnInfoAdded'; /** + * * @var ?string */ protected $type; /** + * * @var ?ReturnInfo */ protected $returnInfo; @@ -37,13 +39,15 @@ final class OrderReturnInfoAddedMessagePayloadModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?ReturnInfo $returnInfo = null + ?ReturnInfo $returnInfo = null, + ?string $type = null ) { $this->returnInfo = $returnInfo; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,9 @@ public function getType() } /** + *

    The ReturnInfo that was added to the Order.

    + * + * * @return null|ReturnInfo */ public function getReturnInfo() diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessage.php similarity index 70% rename from lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessagePayload.php rename to lib/commercetools-api/src/Models/Message/ReturnInfoSetMessage.php index 4039f559296..c06faee585c 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessage.php @@ -12,11 +12,14 @@ use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; -interface OrderReturnInfoSetMessagePayload extends OrderMessagePayload +interface ReturnInfoSetMessage extends OrderMessage { public const FIELD_RETURN_INFO = 'returnInfo'; /** + *

    The ReturnInfo that was set on the Order or Order Edit.

    + * + * @return null|ReturnInfoCollection */ public function getReturnInfo(); diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessageBuilder.php similarity index 82% rename from lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessageBuilder.php rename to lib/commercetools-api/src/Models/Message/ReturnInfoSetMessageBuilder.php index 699cdec976b..2030c947946 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessageBuilder.php @@ -24,68 +24,80 @@ use stdClass; /** - * @implements Builder + * @implements Builder */ -final class OrderReturnInfoSetMessageBuilder implements Builder +final class ReturnInfoSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?ReturnInfoCollection */ private $returnInfo; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -94,6 +106,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -102,6 +117,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -110,6 +128,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -118,8 +139,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -130,6 +152,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -138,6 +161,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -146,8 +173,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -156,6 +184,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -164,6 +195,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -172,6 +206,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The ReturnInfo that was set on the Order or Order Edit.

    + * + * @return null|ReturnInfoCollection */ public function getReturnInfo() @@ -344,9 +381,9 @@ public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifi return $this; } - public function build(): OrderReturnInfoSetMessage + public function build(): ReturnInfoSetMessage { - return new OrderReturnInfoSetMessageModel( + return new ReturnInfoSetMessageModel( $this->id, $this->version, $this->createdAt, @@ -361,7 +398,7 @@ public function build(): OrderReturnInfoSetMessage ); } - public static function of(): OrderReturnInfoSetMessageBuilder + public static function of(): ReturnInfoSetMessageBuilder { return new self(); } diff --git a/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessageCollection.php b/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessageCollection.php new file mode 100644 index 00000000000..12c6c8d082f --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessageCollection.php @@ -0,0 +1,56 @@ + + * @method ReturnInfoSetMessage current() + * @method ReturnInfoSetMessage end() + * @method ReturnInfoSetMessage at($offset) + */ +class ReturnInfoSetMessageCollection extends OrderMessageCollection +{ + /** + * @psalm-assert ReturnInfoSetMessage $value + * @psalm-param ReturnInfoSetMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return ReturnInfoSetMessageCollection + */ + public function add($value) + { + if (!$value instanceof ReturnInfoSetMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ReturnInfoSetMessage + */ + protected function mapper() + { + return function (?int $index): ?ReturnInfoSetMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ReturnInfoSetMessage $data */ + $data = ReturnInfoSetMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessageModel.php b/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessageModel.php similarity index 85% rename from lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessageModel.php rename to lib/commercetools-api/src/Models/Message/ReturnInfoSetMessageModel.php index 1be29289fc3..fb04b9ea4d9 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessageModel.php @@ -25,65 +25,77 @@ /** * @internal */ -final class OrderReturnInfoSetMessageModel extends JsonObjectModel implements OrderReturnInfoSetMessage +final class ReturnInfoSetMessageModel extends JsonObjectModel implements ReturnInfoSetMessage { public const DISCRIMINATOR_VALUE = 'ReturnInfoSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?ReturnInfoCollection */ protected $returnInfo; @@ -103,7 +115,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?ReturnInfoCollection $returnInfo = null + ?ReturnInfoCollection $returnInfo = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -116,11 +129,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->returnInfo = $returnInfo; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -139,6 +153,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -156,6 +173,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -177,6 +197,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -198,7 +221,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -220,6 +244,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -238,6 +263,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -255,7 +284,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -275,6 +305,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -292,6 +325,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -309,6 +345,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -327,6 +366,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The ReturnInfo that was set on the Order or Order Edit.

    + * + * * @return null|ReturnInfoCollection */ public function getReturnInfo() diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessage.php b/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessagePayload.php similarity index 69% rename from lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessage.php rename to lib/commercetools-api/src/Models/Message/ReturnInfoSetMessagePayload.php index d9338698302..d33a55985af 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessagePayload.php @@ -12,11 +12,14 @@ use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; -interface OrderReturnInfoSetMessage extends OrderMessage +interface ReturnInfoSetMessagePayload extends OrderMessagePayload { public const FIELD_RETURN_INFO = 'returnInfo'; /** + *

    The ReturnInfo that was set on the Order or Order Edit.

    + * + * @return null|ReturnInfoCollection */ public function getReturnInfo(); diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessagePayloadBuilder.php similarity index 66% rename from lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessagePayloadBuilder.php rename to lib/commercetools-api/src/Models/Message/ReturnInfoSetMessagePayloadBuilder.php index 61a039956c9..cd1b082ba91 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessagePayloadBuilder.php @@ -17,16 +17,20 @@ use stdClass; /** - * @implements Builder + * @implements Builder */ -final class OrderReturnInfoSetMessagePayloadBuilder implements Builder +final class ReturnInfoSetMessagePayloadBuilder implements Builder { /** + * @var ?ReturnInfoCollection */ private $returnInfo; /** + *

    The ReturnInfo that was set on the Order or Order Edit.

    + * + * @return null|ReturnInfoCollection */ public function getReturnInfo() @@ -46,14 +50,14 @@ public function withReturnInfo(?ReturnInfoCollection $returnInfo) } - public function build(): OrderReturnInfoSetMessagePayload + public function build(): ReturnInfoSetMessagePayload { - return new OrderReturnInfoSetMessagePayloadModel( + return new ReturnInfoSetMessagePayloadModel( $this->returnInfo ); } - public static function of(): OrderReturnInfoSetMessagePayloadBuilder + public static function of(): ReturnInfoSetMessagePayloadBuilder { return new self(); } diff --git a/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessagePayloadCollection.php new file mode 100644 index 00000000000..e9f7fe49373 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method ReturnInfoSetMessagePayload current() + * @method ReturnInfoSetMessagePayload end() + * @method ReturnInfoSetMessagePayload at($offset) + */ +class ReturnInfoSetMessagePayloadCollection extends OrderMessagePayloadCollection +{ + /** + * @psalm-assert ReturnInfoSetMessagePayload $value + * @psalm-param ReturnInfoSetMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return ReturnInfoSetMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof ReturnInfoSetMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ReturnInfoSetMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?ReturnInfoSetMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ReturnInfoSetMessagePayload $data */ + $data = ReturnInfoSetMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessagePayloadModel.php similarity index 79% rename from lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessagePayloadModel.php rename to lib/commercetools-api/src/Models/Message/ReturnInfoSetMessagePayloadModel.php index 48eaad55906..ad699d12df8 100644 --- a/lib/commercetools-api/src/Models/Message/OrderReturnInfoSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ReturnInfoSetMessagePayloadModel.php @@ -18,15 +18,17 @@ /** * @internal */ -final class OrderReturnInfoSetMessagePayloadModel extends JsonObjectModel implements OrderReturnInfoSetMessagePayload +final class ReturnInfoSetMessagePayloadModel extends JsonObjectModel implements ReturnInfoSetMessagePayload { public const DISCRIMINATOR_VALUE = 'ReturnInfoSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?ReturnInfoCollection */ protected $returnInfo; @@ -36,13 +38,15 @@ final class OrderReturnInfoSetMessagePayloadModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?ReturnInfoCollection $returnInfo = null + ?ReturnInfoCollection $returnInfo = null, + ?string $type = null ) { $this->returnInfo = $returnInfo; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -60,6 +64,9 @@ public function getType() } /** + *

    The ReturnInfo that was set on the Order or Order Edit.

    + * + * * @return null|ReturnInfoCollection */ public function getReturnInfo() diff --git a/lib/commercetools-api/src/Models/Message/ReviewCreatedMessage.php b/lib/commercetools-api/src/Models/Message/ReviewCreatedMessage.php index 71cfbdcbb7d..83fecc08e54 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewCreatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ReviewCreatedMessage.php @@ -17,6 +17,9 @@ interface ReviewCreatedMessage extends Message public const FIELD_REVIEW = 'review'; /** + *

    Review that was created.

    + * + * @return null|Review */ public function getReview(); diff --git a/lib/commercetools-api/src/Models/Message/ReviewCreatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ReviewCreatedMessageBuilder.php index d81d2264a9a..c7c65682761 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewCreatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ReviewCreatedMessageBuilder.php @@ -30,63 +30,75 @@ final class ReviewCreatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|Review|ReviewBuilder */ private $review; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,6 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Review that was created.

    + * + * @return null|Review */ public function getReview() diff --git a/lib/commercetools-api/src/Models/Message/ReviewCreatedMessageModel.php b/lib/commercetools-api/src/Models/Message/ReviewCreatedMessageModel.php index 92e6e8dc79b..f1895a0ad82 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewCreatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ReviewCreatedMessageModel.php @@ -30,61 +30,73 @@ final class ReviewCreatedMessageModel extends JsonObjectModel implements ReviewC { public const DISCRIMINATOR_VALUE = 'ReviewCreated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?Review */ protected $review; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?Review $review = null + ?Review $review = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->review = $review; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,6 +367,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Review that was created.

    + * + * * @return null|Review */ public function getReview() diff --git a/lib/commercetools-api/src/Models/Message/ReviewCreatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ReviewCreatedMessagePayload.php index 199d51a5ad4..404288c544b 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewCreatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ReviewCreatedMessagePayload.php @@ -17,6 +17,9 @@ interface ReviewCreatedMessagePayload extends MessagePayload public const FIELD_REVIEW = 'review'; /** + *

    Review that was created.

    + * + * @return null|Review */ public function getReview(); diff --git a/lib/commercetools-api/src/Models/Message/ReviewCreatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ReviewCreatedMessagePayloadBuilder.php index 9f808db9cf5..2f000da0dc7 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewCreatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ReviewCreatedMessagePayloadBuilder.php @@ -23,11 +23,15 @@ final class ReviewCreatedMessagePayloadBuilder implements Builder { /** + * @var null|Review|ReviewBuilder */ private $review; /** + *

    Review that was created.

    + * + * @return null|Review */ public function getReview() diff --git a/lib/commercetools-api/src/Models/Message/ReviewCreatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ReviewCreatedMessagePayloadModel.php index 2bb8421eaff..061fbfba2f6 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewCreatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ReviewCreatedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class ReviewCreatedMessagePayloadModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'ReviewCreated'; /** + * * @var ?string */ protected $type; /** + * * @var ?Review */ protected $review; @@ -37,13 +39,15 @@ final class ReviewCreatedMessagePayloadModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?Review $review = null + ?Review $review = null, + ?string $type = null ) { $this->review = $review; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,9 @@ public function getType() } /** + *

    Review that was created.

    + * + * * @return null|Review */ public function getReview() diff --git a/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessage.php b/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessage.php index fb4427444bf..ee393a520ed 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessage.php @@ -20,23 +20,33 @@ interface ReviewRatingSetMessage extends Message public const FIELD_TARGET = 'target'; /** + *

    The rating of the Review before the Set Rating update action.

    + * + * @return null|float */ public function getOldRating(); /** + *

    The rating of the Review after the Set Rating update action.

    + * + * @return null|float */ public function getNewRating(); /** + *

    Whether the Review was taken into account in the ratings statistics of the target.

    + * + * @return null|bool */ public function getIncludedInStatistics(); /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that the Review belongs to.

    * + * @return null|Reference */ public function getTarget(); diff --git a/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessageBuilder.php index d64e0023594..3bf99817db7 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessageBuilder.php @@ -28,78 +28,93 @@ final class ReviewRatingSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?float */ private $oldRating; /** + * @var ?float */ private $newRating; /** + * @var ?bool */ private $includedInStatistics; /** + * @var null|Reference|ReferenceBuilder */ private $target; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -108,6 +123,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -116,6 +134,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -124,6 +145,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -132,8 +156,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -144,6 +169,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -152,6 +178,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -160,8 +190,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -170,6 +201,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -178,6 +212,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -186,6 +223,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The rating of the Review before the Set Rating update action.

    + * + * @return null|float */ public function getOldRating() @@ -194,6 +234,9 @@ public function getOldRating() } /** + *

    The rating of the Review after the Set Rating update action.

    + * + * @return null|float */ public function getNewRating() @@ -202,6 +245,9 @@ public function getNewRating() } /** + *

    Whether the Review was taken into account in the ratings statistics of the target.

    + * + * @return null|bool */ public function getIncludedInStatistics() @@ -210,8 +256,9 @@ public function getIncludedInStatistics() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that the Review belongs to.

    * + * @return null|Reference */ public function getTarget() diff --git a/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessageModel.php b/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessageModel.php index 74a3f8c34b8..196955ca7b5 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessageModel.php @@ -28,76 +28,91 @@ final class ReviewRatingSetMessageModel extends JsonObjectModel implements Revie { public const DISCRIMINATOR_VALUE = 'ReviewRatingSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?float */ protected $oldRating; /** + * * @var ?float */ protected $newRating; /** + * * @var ?bool */ protected $includedInStatistics; /** + * * @var ?Reference */ protected $target; @@ -120,7 +135,8 @@ public function __construct( ?float $oldRating = null, ?float $newRating = null, ?bool $includedInStatistics = null, - ?Reference $target = null + ?Reference $target = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -136,11 +152,12 @@ public function __construct( $this->newRating = $newRating; $this->includedInStatistics = $includedInStatistics; $this->target = $target; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -159,6 +176,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -176,6 +196,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -197,6 +220,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -218,7 +244,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -240,6 +267,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -258,6 +286,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -275,7 +307,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -295,6 +328,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -312,6 +348,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -329,6 +368,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -347,6 +389,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    The rating of the Review before the Set Rating update action.

    + * + * * @return null|float */ public function getOldRating() @@ -364,6 +409,9 @@ public function getOldRating() } /** + *

    The rating of the Review after the Set Rating update action.

    + * + * * @return null|float */ public function getNewRating() @@ -381,6 +429,9 @@ public function getNewRating() } /** + *

    Whether the Review was taken into account in the ratings statistics of the target.

    + * + * * @return null|bool */ public function getIncludedInStatistics() @@ -398,7 +449,8 @@ public function getIncludedInStatistics() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that the Review belongs to.

    + * * * @return null|Reference */ diff --git a/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessagePayload.php index 09c43894c00..5be0323cc95 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessagePayload.php @@ -20,23 +20,33 @@ interface ReviewRatingSetMessagePayload extends MessagePayload public const FIELD_TARGET = 'target'; /** + *

    The rating of the Review before the Set Rating update action.

    + * + * @return null|float */ public function getOldRating(); /** + *

    The rating of the Review after the Set Rating update action.

    + * + * @return null|float */ public function getNewRating(); /** + *

    Whether the Review was taken into account in the ratings statistics of the target.

    + * + * @return null|bool */ public function getIncludedInStatistics(); /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that the Review belongs to.

    * + * @return null|Reference */ public function getTarget(); diff --git a/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessagePayloadBuilder.php index ccf7ff861d6..9260c9d063f 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessagePayloadBuilder.php @@ -23,26 +23,33 @@ final class ReviewRatingSetMessagePayloadBuilder implements Builder { /** + * @var ?float */ private $oldRating; /** + * @var ?float */ private $newRating; /** + * @var ?bool */ private $includedInStatistics; /** + * @var null|Reference|ReferenceBuilder */ private $target; /** + *

    The rating of the Review before the Set Rating update action.

    + * + * @return null|float */ public function getOldRating() @@ -51,6 +58,9 @@ public function getOldRating() } /** + *

    The rating of the Review after the Set Rating update action.

    + * + * @return null|float */ public function getNewRating() @@ -59,6 +69,9 @@ public function getNewRating() } /** + *

    Whether the Review was taken into account in the ratings statistics of the target.

    + * + * @return null|bool */ public function getIncludedInStatistics() @@ -67,8 +80,9 @@ public function getIncludedInStatistics() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that the Review belongs to.

    * + * @return null|Reference */ public function getTarget() diff --git a/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessagePayloadModel.php index a7225456759..0c0fca2e752 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ReviewRatingSetMessagePayloadModel.php @@ -23,26 +23,31 @@ final class ReviewRatingSetMessagePayloadModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'ReviewRatingSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?float */ protected $oldRating; /** + * * @var ?float */ protected $newRating; /** + * * @var ?bool */ protected $includedInStatistics; /** + * * @var ?Reference */ protected $target; @@ -55,16 +60,18 @@ public function __construct( ?float $oldRating = null, ?float $newRating = null, ?bool $includedInStatistics = null, - ?Reference $target = null + ?Reference $target = null, + ?string $type = null ) { $this->oldRating = $oldRating; $this->newRating = $newRating; $this->includedInStatistics = $includedInStatistics; $this->target = $target; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -82,6 +89,9 @@ public function getType() } /** + *

    The rating of the Review before the Set Rating update action.

    + * + * * @return null|float */ public function getOldRating() @@ -99,6 +109,9 @@ public function getOldRating() } /** + *

    The rating of the Review after the Set Rating update action.

    + * + * * @return null|float */ public function getNewRating() @@ -116,6 +129,9 @@ public function getNewRating() } /** + *

    Whether the Review was taken into account in the ratings statistics of the target.

    + * + * * @return null|bool */ public function getIncludedInStatistics() @@ -133,7 +149,8 @@ public function getIncludedInStatistics() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that the Review belongs to.

    + * * * @return null|Reference */ diff --git a/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessage.php b/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessage.php index b726fa6c51d..15a144cc294 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessage.php +++ b/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessage.php @@ -23,37 +23,49 @@ interface ReviewStateTransitionMessage extends Message public const FIELD_FORCE = 'force'; /** - *

    Reference to a State.

    + *

    State of the Review before the Transition State update action.

    * + * @return null|StateReference */ public function getOldState(); /** - *

    Reference to a State.

    + *

    State of the Review after the Transition State update action.

    * + * @return null|StateReference */ public function getNewState(); /** + *

    Whether the old Review was taken into account in the rating statistics of the target before the state transition.

    + * + * @return null|bool */ public function getOldIncludedInStatistics(); /** + *

    Whether the new Review was taken into account in the rating statistics of the target after the state transition.

    + * + * @return null|bool */ public function getNewIncludedInStatistics(); /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that the Review belongs to.

    * + * @return null|Reference */ public function getTarget(); /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * @return null|bool */ public function getForce(); diff --git a/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessageBuilder.php index 39dd5558974..77e88eff05a 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessageBuilder.php @@ -30,88 +30,105 @@ final class ReviewStateTransitionMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|StateReference|StateReferenceBuilder */ private $oldState; /** + * @var null|StateReference|StateReferenceBuilder */ private $newState; /** + * @var ?bool */ private $oldIncludedInStatistics; /** + * @var ?bool */ private $newIncludedInStatistics; /** + * @var null|Reference|ReferenceBuilder */ private $target; /** + * @var ?bool */ private $force; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -120,6 +137,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -128,6 +148,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -136,6 +159,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -144,8 +170,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -156,6 +183,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -164,6 +192,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -172,8 +204,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -182,6 +215,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -190,6 +226,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -198,8 +237,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a State.

    + *

    State of the Review before the Transition State update action.

    * + * @return null|StateReference */ public function getOldState() @@ -208,8 +248,9 @@ public function getOldState() } /** - *

    Reference to a State.

    + *

    State of the Review after the Transition State update action.

    * + * @return null|StateReference */ public function getNewState() @@ -218,6 +259,9 @@ public function getNewState() } /** + *

    Whether the old Review was taken into account in the rating statistics of the target before the state transition.

    + * + * @return null|bool */ public function getOldIncludedInStatistics() @@ -226,6 +270,9 @@ public function getOldIncludedInStatistics() } /** + *

    Whether the new Review was taken into account in the rating statistics of the target after the state transition.

    + * + * @return null|bool */ public function getNewIncludedInStatistics() @@ -234,8 +281,9 @@ public function getNewIncludedInStatistics() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that the Review belongs to.

    * + * @return null|Reference */ public function getTarget() @@ -244,6 +292,9 @@ public function getTarget() } /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessageModel.php b/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessageModel.php index e1bffa7af07..416d71450d5 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessageModel.php @@ -30,86 +30,103 @@ final class ReviewStateTransitionMessageModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'ReviewStateTransition'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?StateReference */ protected $oldState; /** + * * @var ?StateReference */ protected $newState; /** + * * @var ?bool */ protected $oldIncludedInStatistics; /** + * * @var ?bool */ protected $newIncludedInStatistics; /** + * * @var ?Reference */ protected $target; /** + * * @var ?bool */ protected $force; @@ -134,7 +151,8 @@ public function __construct( ?bool $oldIncludedInStatistics = null, ?bool $newIncludedInStatistics = null, ?Reference $target = null, - ?bool $force = null + ?bool $force = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -152,11 +170,12 @@ public function __construct( $this->newIncludedInStatistics = $newIncludedInStatistics; $this->target = $target; $this->force = $force; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -175,6 +194,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -192,6 +214,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -213,6 +238,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -234,7 +262,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -256,6 +285,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -274,6 +304,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -291,7 +325,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -311,6 +346,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -328,6 +366,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -345,6 +386,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -363,7 +407,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Reference to a State.

    + *

    State of the Review before the Transition State update action.

    + * * * @return null|StateReference */ @@ -383,7 +428,8 @@ public function getOldState() } /** - *

    Reference to a State.

    + *

    State of the Review after the Transition State update action.

    + * * * @return null|StateReference */ @@ -403,6 +449,9 @@ public function getNewState() } /** + *

    Whether the old Review was taken into account in the rating statistics of the target before the state transition.

    + * + * * @return null|bool */ public function getOldIncludedInStatistics() @@ -420,6 +469,9 @@ public function getOldIncludedInStatistics() } /** + *

    Whether the new Review was taken into account in the rating statistics of the target after the state transition.

    + * + * * @return null|bool */ public function getNewIncludedInStatistics() @@ -437,7 +489,8 @@ public function getNewIncludedInStatistics() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that the Review belongs to.

    + * * * @return null|Reference */ @@ -457,6 +510,9 @@ public function getTarget() } /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessagePayload.php b/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessagePayload.php index 4fdcf3c1817..d8cfae9e9f8 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessagePayload.php @@ -23,37 +23,49 @@ interface ReviewStateTransitionMessagePayload extends MessagePayload public const FIELD_FORCE = 'force'; /** - *

    Reference to a State.

    + *

    State of the Review before the Transition State update action.

    * + * @return null|StateReference */ public function getOldState(); /** - *

    Reference to a State.

    + *

    State of the Review after the Transition State update action.

    * + * @return null|StateReference */ public function getNewState(); /** + *

    Whether the old Review was taken into account in the rating statistics of the target before the state transition.

    + * + * @return null|bool */ public function getOldIncludedInStatistics(); /** + *

    Whether the new Review was taken into account in the rating statistics of the target after the state transition.

    + * + * @return null|bool */ public function getNewIncludedInStatistics(); /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that the Review belongs to.

    * + * @return null|Reference */ public function getTarget(); /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * @return null|bool */ public function getForce(); diff --git a/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessagePayloadBuilder.php index 36810f1e933..a878c44c016 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessagePayloadBuilder.php @@ -25,38 +25,45 @@ final class ReviewStateTransitionMessagePayloadBuilder implements Builder { /** + * @var null|StateReference|StateReferenceBuilder */ private $oldState; /** + * @var null|StateReference|StateReferenceBuilder */ private $newState; /** + * @var ?bool */ private $oldIncludedInStatistics; /** + * @var ?bool */ private $newIncludedInStatistics; /** + * @var null|Reference|ReferenceBuilder */ private $target; /** + * @var ?bool */ private $force; /** - *

    Reference to a State.

    + *

    State of the Review before the Transition State update action.

    * + * @return null|StateReference */ public function getOldState() @@ -65,8 +72,9 @@ public function getOldState() } /** - *

    Reference to a State.

    + *

    State of the Review after the Transition State update action.

    * + * @return null|StateReference */ public function getNewState() @@ -75,6 +83,9 @@ public function getNewState() } /** + *

    Whether the old Review was taken into account in the rating statistics of the target before the state transition.

    + * + * @return null|bool */ public function getOldIncludedInStatistics() @@ -83,6 +94,9 @@ public function getOldIncludedInStatistics() } /** + *

    Whether the new Review was taken into account in the rating statistics of the target after the state transition.

    + * + * @return null|bool */ public function getNewIncludedInStatistics() @@ -91,8 +105,9 @@ public function getNewIncludedInStatistics() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that the Review belongs to.

    * + * @return null|Reference */ public function getTarget() @@ -101,6 +116,9 @@ public function getTarget() } /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessagePayloadModel.php index b023304aae3..e20fa51e0b9 100644 --- a/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ReviewStateTransitionMessagePayloadModel.php @@ -25,36 +25,43 @@ final class ReviewStateTransitionMessagePayloadModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'ReviewStateTransition'; /** + * * @var ?string */ protected $type; /** + * * @var ?StateReference */ protected $oldState; /** + * * @var ?StateReference */ protected $newState; /** + * * @var ?bool */ protected $oldIncludedInStatistics; /** + * * @var ?bool */ protected $newIncludedInStatistics; /** + * * @var ?Reference */ protected $target; /** + * * @var ?bool */ protected $force; @@ -69,7 +76,8 @@ public function __construct( ?bool $oldIncludedInStatistics = null, ?bool $newIncludedInStatistics = null, ?Reference $target = null, - ?bool $force = null + ?bool $force = null, + ?string $type = null ) { $this->oldState = $oldState; $this->newState = $newState; @@ -77,10 +85,11 @@ public function __construct( $this->newIncludedInStatistics = $newIncludedInStatistics; $this->target = $target; $this->force = $force; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -98,7 +107,8 @@ public function getType() } /** - *

    Reference to a State.

    + *

    State of the Review before the Transition State update action.

    + * * * @return null|StateReference */ @@ -118,7 +128,8 @@ public function getOldState() } /** - *

    Reference to a State.

    + *

    State of the Review after the Transition State update action.

    + * * * @return null|StateReference */ @@ -138,6 +149,9 @@ public function getNewState() } /** + *

    Whether the old Review was taken into account in the rating statistics of the target before the state transition.

    + * + * * @return null|bool */ public function getOldIncludedInStatistics() @@ -155,6 +169,9 @@ public function getOldIncludedInStatistics() } /** + *

    Whether the new Review was taken into account in the rating statistics of the target after the state transition.

    + * + * * @return null|bool */ public function getNewIncludedInStatistics() @@ -172,7 +189,8 @@ public function getNewIncludedInStatistics() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that the Review belongs to.

    + * * * @return null|Reference */ @@ -192,6 +210,9 @@ public function getTarget() } /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Message/ShoppingListStoreSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/ShoppingListStoreSetMessagePayload.php index d84abeea7bc..7664a80331a 100644 --- a/lib/commercetools-api/src/Models/Message/ShoppingListStoreSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ShoppingListStoreSetMessagePayload.php @@ -19,6 +19,7 @@ interface ShoppingListStoreSetMessagePayload extends MessagePayload /** *

    Reference to a Store by its key.

    * + * @return null|StoreKeyReference */ public function getStore(); diff --git a/lib/commercetools-api/src/Models/Message/ShoppingListStoreSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ShoppingListStoreSetMessagePayloadBuilder.php index 56bed428c9d..2c93ae32d12 100644 --- a/lib/commercetools-api/src/Models/Message/ShoppingListStoreSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ShoppingListStoreSetMessagePayloadBuilder.php @@ -23,6 +23,7 @@ final class ShoppingListStoreSetMessagePayloadBuilder implements Builder { /** + * @var null|StoreKeyReference|StoreKeyReferenceBuilder */ private $store; @@ -30,6 +31,7 @@ final class ShoppingListStoreSetMessagePayloadBuilder implements Builder /** *

    Reference to a Store by its key.

    * + * @return null|StoreKeyReference */ public function getStore() diff --git a/lib/commercetools-api/src/Models/Message/ShoppingListStoreSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ShoppingListStoreSetMessagePayloadModel.php index c61d806894d..35a7b4cf7c0 100644 --- a/lib/commercetools-api/src/Models/Message/ShoppingListStoreSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ShoppingListStoreSetMessagePayloadModel.php @@ -23,11 +23,13 @@ final class ShoppingListStoreSetMessagePayloadModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'ShoppingListStoreSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?StoreKeyReference */ protected $store; @@ -37,13 +39,15 @@ final class ShoppingListStoreSetMessagePayloadModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?StoreKeyReference $store = null + ?StoreKeyReference $store = null, + ?string $type = null ) { $this->store = $store; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -63,6 +67,7 @@ public function getType() /** *

    Reference to a Store by its key.

    * + * * @return null|StoreKeyReference */ public function getStore() diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessage.php b/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessage.php index 68c2805f676..e73e838f788 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessage.php @@ -8,9 +8,24 @@ namespace Commercetools\Api\Models\Message; +use Commercetools\Api\Models\StagedQuote\StagedQuote; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; interface StagedQuoteCreatedMessage extends Message { + public const FIELD_STAGED_QUOTE = 'stagedQuote'; + + /** + *

    Staged Quote that was created.

    + * + + * @return null|StagedQuote + */ + public function getStagedQuote(); + + /** + * @param ?StagedQuote $stagedQuote + */ + public function setStagedQuote(?StagedQuote $stagedQuote): void; } diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessageBuilder.php index c73df6f504e..14d77a50da0 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessageBuilder.php @@ -14,6 +14,8 @@ use Commercetools\Api\Models\Common\LastModifiedByBuilder; use Commercetools\Api\Models\Common\Reference; use Commercetools\Api\Models\Common\ReferenceBuilder; +use Commercetools\Api\Models\StagedQuote\StagedQuote; +use Commercetools\Api\Models\StagedQuote\StagedQuoteBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -28,58 +30,75 @@ final class StagedQuoteCreatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** - *

    Unique identifier of the Message.

    + + * @var null|StagedQuote|StagedQuoteBuilder + */ + private $stagedQuote; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -88,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -96,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -104,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -112,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -124,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -132,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -140,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -150,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -158,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -165,6 +206,17 @@ public function getResourceUserProvidedIdentifiers() return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; } + /** + *

    Staged Quote that was created.

    + * + + * @return null|StagedQuote + */ + public function getStagedQuote() + { + return $this->stagedQuote instanceof StagedQuoteBuilder ? $this->stagedQuote->build() : $this->stagedQuote; + } + /** * @param ?string $id * @return $this @@ -275,6 +327,17 @@ public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $re return $this; } + /** + * @param ?StagedQuote $stagedQuote + * @return $this + */ + public function withStagedQuote(?StagedQuote $stagedQuote) + { + $this->stagedQuote = $stagedQuote; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -319,6 +382,17 @@ public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifi return $this; } + /** + * @deprecated use withStagedQuote() instead + * @return $this + */ + public function withStagedQuoteBuilder(?StagedQuoteBuilder $stagedQuote) + { + $this->stagedQuote = $stagedQuote; + + return $this; + } + public function build(): StagedQuoteCreatedMessage { return new StagedQuoteCreatedMessageModel( @@ -331,7 +405,8 @@ public function build(): StagedQuoteCreatedMessage $this->sequenceNumber, $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, $this->resourceVersion, - $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->stagedQuote instanceof StagedQuoteBuilder ? $this->stagedQuote->build() : $this->stagedQuote ); } diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessageModel.php b/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessageModel.php index 09e2819f44a..ea1a565ce62 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessageModel.php @@ -14,6 +14,8 @@ use Commercetools\Api\Models\Common\LastModifiedByModel; use Commercetools\Api\Models\Common\Reference; use Commercetools\Api\Models\Common\ReferenceModel; +use Commercetools\Api\Models\StagedQuote\StagedQuote; +use Commercetools\Api\Models\StagedQuote\StagedQuoteModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -28,60 +30,77 @@ final class StagedQuoteCreatedMessageModel extends JsonObjectModel implements St { public const DISCRIMINATOR_VALUE = 'StagedQuoteCreated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; + /** + * + * @var ?StagedQuote + */ + protected $stagedQuote; + /** * @psalm-suppress MissingParamType @@ -96,7 +115,9 @@ public function __construct( ?int $sequenceNumber = null, ?Reference $resource = null, ?int $resourceVersion = null, - ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null + ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, + ?StagedQuote $stagedQuote = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -108,11 +129,13 @@ public function __construct( $this->resource = $resource; $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; - $this->type = static::DISCRIMINATOR_VALUE; + $this->stagedQuote = $stagedQuote; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -131,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -148,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -169,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -190,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -212,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -230,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -247,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -267,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -284,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -301,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -318,6 +366,27 @@ public function getResourceUserProvidedIdentifiers() return $this->resourceUserProvidedIdentifiers; } + /** + *

    Staged Quote that was created.

    + * + * + * @return null|StagedQuote + */ + public function getStagedQuote() + { + if (is_null($this->stagedQuote)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STAGED_QUOTE); + if (is_null($data)) { + return null; + } + + $this->stagedQuote = StagedQuoteModel::of($data); + } + + return $this->stagedQuote; + } + /** * @param ?string $id @@ -399,6 +468,14 @@ public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $res $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; } + /** + * @param ?StagedQuote $stagedQuote + */ + public function setStagedQuote(?StagedQuote $stagedQuote): void + { + $this->stagedQuote = $stagedQuote; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessagePayload.php index 8ae37e80cbc..6f02b265bfe 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessagePayload.php @@ -8,9 +8,24 @@ namespace Commercetools\Api\Models\Message; +use Commercetools\Api\Models\StagedQuote\StagedQuote; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; interface StagedQuoteCreatedMessagePayload extends MessagePayload { + public const FIELD_STAGED_QUOTE = 'stagedQuote'; + + /** + *

    Staged Quote that was created.

    + * + + * @return null|StagedQuote + */ + public function getStagedQuote(); + + /** + * @param ?StagedQuote $stagedQuote + */ + public function setStagedQuote(?StagedQuote $stagedQuote): void; } diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessagePayloadBuilder.php index 1c7c1b17df4..f3c8928caa4 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessagePayloadBuilder.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Message; +use Commercetools\Api\Models\StagedQuote\StagedQuote; +use Commercetools\Api\Models\StagedQuote\StagedQuoteBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -20,9 +22,49 @@ */ final class StagedQuoteCreatedMessagePayloadBuilder implements Builder { + /** + + * @var null|StagedQuote|StagedQuoteBuilder + */ + private $stagedQuote; + + /** + *

    Staged Quote that was created.

    + * + + * @return null|StagedQuote + */ + public function getStagedQuote() + { + return $this->stagedQuote instanceof StagedQuoteBuilder ? $this->stagedQuote->build() : $this->stagedQuote; + } + + /** + * @param ?StagedQuote $stagedQuote + * @return $this + */ + public function withStagedQuote(?StagedQuote $stagedQuote) + { + $this->stagedQuote = $stagedQuote; + + return $this; + } + + /** + * @deprecated use withStagedQuote() instead + * @return $this + */ + public function withStagedQuoteBuilder(?StagedQuoteBuilder $stagedQuote) + { + $this->stagedQuote = $stagedQuote; + + return $this; + } + public function build(): StagedQuoteCreatedMessagePayload { return new StagedQuoteCreatedMessagePayloadModel( + $this->stagedQuote instanceof StagedQuoteBuilder ? $this->stagedQuote->build() : $this->stagedQuote ); } diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessagePayloadModel.php index 9a1cf2c35f8..7def887d4c1 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteCreatedMessagePayloadModel.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Message; +use Commercetools\Api\Models\StagedQuote\StagedQuote; +use Commercetools\Api\Models\StagedQuote\StagedQuoteModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -21,20 +23,31 @@ final class StagedQuoteCreatedMessagePayloadModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'StagedQuoteCreated'; /** + * * @var ?string */ protected $type; + /** + * + * @var ?StagedQuote + */ + protected $stagedQuote; + /** * @psalm-suppress MissingParamType */ public function __construct( + ?StagedQuote $stagedQuote = null, + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->stagedQuote = $stagedQuote; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -50,4 +63,34 @@ public function getType() return $this->type; } + + /** + *

    Staged Quote that was created.

    + * + * + * @return null|StagedQuote + */ + public function getStagedQuote() + { + if (is_null($this->stagedQuote)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STAGED_QUOTE); + if (is_null($data)) { + return null; + } + + $this->stagedQuote = StagedQuoteModel::of($data); + } + + return $this->stagedQuote; + } + + + /** + * @param ?StagedQuote $stagedQuote + */ + public function setStagedQuote(?StagedQuote $stagedQuote): void + { + $this->stagedQuote = $stagedQuote; + } } diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteDeletedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StagedQuoteDeletedMessageBuilder.php index 50a12d0fb90..d86cc98fa73 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteDeletedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteDeletedMessageBuilder.php @@ -28,58 +28,69 @@ final class StagedQuoteDeletedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -88,6 +99,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -96,6 +110,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -104,6 +121,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -112,8 +132,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -124,6 +145,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -132,6 +154,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -140,8 +166,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -150,6 +177,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -158,6 +188,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteDeletedMessageModel.php b/lib/commercetools-api/src/Models/Message/StagedQuoteDeletedMessageModel.php index e1defe932be..2acc57e4914 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteDeletedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteDeletedMessageModel.php @@ -28,56 +28,67 @@ final class StagedQuoteDeletedMessageModel extends JsonObjectModel implements St { public const DISCRIMINATOR_VALUE = 'StagedQuoteDeleted'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; @@ -96,7 +107,8 @@ public function __construct( ?int $sequenceNumber = null, ?Reference $resource = null, ?int $resourceVersion = null, - ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null + ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -108,11 +120,12 @@ public function __construct( $this->resource = $resource; $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -131,6 +144,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -148,6 +164,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -169,6 +188,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -190,7 +212,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -212,6 +235,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -230,6 +254,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -247,7 +275,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -267,6 +296,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -284,6 +316,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -301,6 +336,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteDeletedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StagedQuoteDeletedMessagePayloadModel.php index a166b644f78..ca6be7984a7 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteDeletedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteDeletedMessagePayloadModel.php @@ -21,6 +21,7 @@ final class StagedQuoteDeletedMessagePayloadModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'StagedQuoteDeleted'; /** + * * @var ?string */ protected $type; @@ -30,11 +31,13 @@ final class StagedQuoteDeletedMessagePayloadModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessage.php b/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessage.php index 4482ebd906a..e833bf203c4 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessage.php @@ -16,6 +16,9 @@ interface StagedQuoteSellerCommentSetMessage extends Message public const FIELD_SELLER_COMMENT = 'sellerComment'; /** + *

    sellerComment on the StagedQuote after a successful Set Seller Comment update action.

    + * + * @return null|string */ public function getSellerComment(); diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessageBuilder.php index 7f771a16dfc..08b20bf48c0 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessageBuilder.php @@ -28,63 +28,75 @@ final class StagedQuoteSellerCommentSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $sellerComment; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -93,6 +105,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -101,6 +116,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -109,6 +127,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -117,8 +138,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -129,6 +151,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -137,6 +160,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -145,8 +172,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -155,6 +183,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -163,6 +194,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -171,6 +205,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    sellerComment on the StagedQuote after a successful Set Seller Comment update action.

    + * + * @return null|string */ public function getSellerComment() diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessageModel.php b/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessageModel.php index 4260c3c4a02..3816d7079c8 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessageModel.php @@ -28,61 +28,73 @@ final class StagedQuoteSellerCommentSetMessageModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'StagedQuoteSellerCommentSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $sellerComment; @@ -102,7 +114,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?string $sellerComment = null + ?string $sellerComment = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -115,11 +128,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->sellerComment = $sellerComment; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -138,6 +152,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -155,6 +172,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -176,6 +196,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -197,7 +220,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -219,6 +243,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -237,6 +262,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -254,7 +283,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -274,6 +304,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -291,6 +324,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -308,6 +344,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -326,6 +365,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    sellerComment on the StagedQuote after a successful Set Seller Comment update action.

    + * + * * @return null|string */ public function getSellerComment() diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessagePayload.php index c3cb131221c..1515810cc5e 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessagePayload.php @@ -16,6 +16,9 @@ interface StagedQuoteSellerCommentSetMessagePayload extends MessagePayload public const FIELD_SELLER_COMMENT = 'sellerComment'; /** + *

    sellerComment on the StagedQuote after a successful Set Seller Comment update action.

    + * + * @return null|string */ public function getSellerComment(); diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessagePayloadBuilder.php index 124b85347f2..950cdfbd453 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessagePayloadBuilder.php @@ -21,11 +21,15 @@ final class StagedQuoteSellerCommentSetMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $sellerComment; /** + *

    sellerComment on the StagedQuote after a successful Set Seller Comment update action.

    + * + * @return null|string */ public function getSellerComment() diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessagePayloadModel.php index 32f8b0141e8..0888b8aa452 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteSellerCommentSetMessagePayloadModel.php @@ -21,11 +21,13 @@ final class StagedQuoteSellerCommentSetMessagePayloadModel extends JsonObjectMod { public const DISCRIMINATOR_VALUE = 'StagedQuoteSellerCommentSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $sellerComment; @@ -35,13 +37,15 @@ final class StagedQuoteSellerCommentSetMessagePayloadModel extends JsonObjectMod * @psalm-suppress MissingParamType */ public function __construct( - ?string $sellerComment = null + ?string $sellerComment = null, + ?string $type = null ) { $this->sellerComment = $sellerComment; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,6 +63,9 @@ public function getType() } /** + *

    sellerComment on the StagedQuote after a successful Set Seller Comment update action.

    + * + * * @return null|string */ public function getSellerComment() diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessage.php b/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessage.php index e861777ff63..4893a5c5c6b 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessage.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessage.php @@ -17,15 +17,17 @@ interface StagedQuoteStateChangedMessage extends Message public const FIELD_OLD_STAGED_QUOTE_STATE = 'oldStagedQuoteState'; /** - *

    Predefined states tracking the status of the Staged Quote.

    + *

    State of the Staged Quote after the Change Staged Quote State update action.

    * + * @return null|string */ public function getStagedQuoteState(); /** - *

    Predefined states tracking the status of the Staged Quote.

    + *

    State of the Staged Quote before the Change Staged Quote State update action.

    * + * @return null|string */ public function getOldStagedQuoteState(); diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessageBuilder.php index 5ebec48418c..00719b7ab3d 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessageBuilder.php @@ -28,68 +28,81 @@ final class StagedQuoteStateChangedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $stagedQuoteState; /** + * @var ?string */ private $oldStagedQuoteState; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -98,6 +111,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -106,6 +122,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -114,6 +133,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -122,8 +144,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -134,6 +157,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -142,6 +166,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -150,8 +178,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -160,6 +189,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -168,6 +200,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -176,8 +211,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Predefined states tracking the status of the Staged Quote.

    + *

    State of the Staged Quote after the Change Staged Quote State update action.

    * + * @return null|string */ public function getStagedQuoteState() @@ -186,8 +222,9 @@ public function getStagedQuoteState() } /** - *

    Predefined states tracking the status of the Staged Quote.

    + *

    State of the Staged Quote before the Change Staged Quote State update action.

    * + * @return null|string */ public function getOldStagedQuoteState() diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessageModel.php index 5d1483cc044..4bf9e4222ef 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessageModel.php @@ -28,66 +28,79 @@ final class StagedQuoteStateChangedMessageModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'StagedQuoteStateChanged'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $stagedQuoteState; /** + * * @var ?string */ protected $oldStagedQuoteState; @@ -108,7 +121,8 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $stagedQuoteState = null, - ?string $oldStagedQuoteState = null + ?string $oldStagedQuoteState = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -122,11 +136,12 @@ public function __construct( $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->stagedQuoteState = $stagedQuoteState; $this->oldStagedQuoteState = $oldStagedQuoteState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -145,6 +160,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -162,6 +180,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -183,6 +204,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -204,7 +228,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -226,6 +251,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -244,6 +270,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -261,7 +291,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -281,6 +312,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -298,6 +332,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -315,6 +352,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -333,7 +373,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    Predefined states tracking the status of the Staged Quote.

    + *

    State of the Staged Quote after the Change Staged Quote State update action.

    + * * * @return null|string */ @@ -352,7 +393,8 @@ public function getStagedQuoteState() } /** - *

    Predefined states tracking the status of the Staged Quote.

    + *

    State of the Staged Quote before the Change Staged Quote State update action.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessagePayload.php index 471f5b602a9..e6a2c69af78 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessagePayload.php @@ -17,15 +17,17 @@ interface StagedQuoteStateChangedMessagePayload extends MessagePayload public const FIELD_OLD_STAGED_QUOTE_STATE = 'oldStagedQuoteState'; /** - *

    Predefined states tracking the status of the Staged Quote.

    + *

    State of the Staged Quote after the Change Staged Quote State update action.

    * + * @return null|string */ public function getStagedQuoteState(); /** - *

    Predefined states tracking the status of the Staged Quote.

    + *

    State of the Staged Quote before the Change Staged Quote State update action.

    * + * @return null|string */ public function getOldStagedQuoteState(); diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessagePayloadBuilder.php index 3070dc3db04..78b032d6cb9 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessagePayloadBuilder.php @@ -21,18 +21,21 @@ final class StagedQuoteStateChangedMessagePayloadBuilder implements Builder { /** + * @var ?string */ private $stagedQuoteState; /** + * @var ?string */ private $oldStagedQuoteState; /** - *

    Predefined states tracking the status of the Staged Quote.

    + *

    State of the Staged Quote after the Change Staged Quote State update action.

    * + * @return null|string */ public function getStagedQuoteState() @@ -41,8 +44,9 @@ public function getStagedQuoteState() } /** - *

    Predefined states tracking the status of the Staged Quote.

    + *

    State of the Staged Quote before the Change Staged Quote State update action.

    * + * @return null|string */ public function getOldStagedQuoteState() diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessagePayloadModel.php index 1e0c3c99025..13336844953 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteStateChangedMessagePayloadModel.php @@ -21,16 +21,19 @@ final class StagedQuoteStateChangedMessagePayloadModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'StagedQuoteStateChanged'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $stagedQuoteState; /** + * * @var ?string */ protected $oldStagedQuoteState; @@ -41,14 +44,16 @@ final class StagedQuoteStateChangedMessagePayloadModel extends JsonObjectModel i */ public function __construct( ?string $stagedQuoteState = null, - ?string $oldStagedQuoteState = null + ?string $oldStagedQuoteState = null, + ?string $type = null ) { $this->stagedQuoteState = $stagedQuoteState; $this->oldStagedQuoteState = $oldStagedQuoteState; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -66,7 +71,8 @@ public function getType() } /** - *

    Predefined states tracking the status of the Staged Quote.

    + *

    State of the Staged Quote after the Change Staged Quote State update action.

    + * * * @return null|string */ @@ -85,7 +91,8 @@ public function getStagedQuoteState() } /** - *

    Predefined states tracking the status of the Staged Quote.

    + *

    State of the Staged Quote before the Change Staged Quote State update action.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessage.php b/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessage.php new file mode 100644 index 00000000000..0d763bceb81 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessage.php @@ -0,0 +1,59 @@ +State of the Quote after the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getState(); + + /** + *

    State of the Quote before the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getOldState(); + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + + * @return null|bool + */ + public function getForce(); + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void; + + /** + * @param ?StateReference $oldState + */ + public function setOldState(?StateReference $oldState): void; + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void; +} diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessageBuilder.php new file mode 100644 index 00000000000..ac35ea23257 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessageBuilder.php @@ -0,0 +1,486 @@ + + */ +final class StagedQuoteStateTransitionMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|StateReference|StateReferenceBuilder + */ + private $state; + + /** + + * @var null|StateReference|StateReferenceBuilder + */ + private $oldState; + + /** + + * @var ?bool + */ + private $force; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    State of the Quote after the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getState() + { + return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; + } + + /** + *

    State of the Quote before the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getOldState() + { + return $this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState; + } + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + + * @return null|bool + */ + public function getForce() + { + return $this->force; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?StateReference $state + * @return $this + */ + public function withState(?StateReference $state) + { + $this->state = $state; + + return $this; + } + + /** + * @param ?StateReference $oldState + * @return $this + */ + public function withOldState(?StateReference $oldState) + { + $this->oldState = $oldState; + + return $this; + } + + /** + * @param ?bool $force + * @return $this + */ + public function withForce(?bool $force) + { + $this->force = $force; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateReferenceBuilder $state) + { + $this->state = $state; + + return $this; + } + + /** + * @deprecated use withOldState() instead + * @return $this + */ + public function withOldStateBuilder(?StateReferenceBuilder $oldState) + { + $this->oldState = $oldState; + + return $this; + } + + public function build(): StagedQuoteStateTransitionMessage + { + return new StagedQuoteStateTransitionMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state, + $this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState, + $this->force + ); + } + + public static function of(): StagedQuoteStateTransitionMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessageCollection.php b/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessageCollection.php new file mode 100644 index 00000000000..88b7ffe9a59 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessageCollection.php @@ -0,0 +1,56 @@ + + * @method StagedQuoteStateTransitionMessage current() + * @method StagedQuoteStateTransitionMessage end() + * @method StagedQuoteStateTransitionMessage at($offset) + */ +class StagedQuoteStateTransitionMessageCollection extends MessageCollection +{ + /** + * @psalm-assert StagedQuoteStateTransitionMessage $value + * @psalm-param StagedQuoteStateTransitionMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return StagedQuoteStateTransitionMessageCollection + */ + public function add($value) + { + if (!$value instanceof StagedQuoteStateTransitionMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StagedQuoteStateTransitionMessage + */ + protected function mapper() + { + return function (?int $index): ?StagedQuoteStateTransitionMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StagedQuoteStateTransitionMessage $data */ + $data = StagedQuoteStateTransitionMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessageModel.php b/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessageModel.php new file mode 100644 index 00000000000..1ac8c8b45c2 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessageModel.php @@ -0,0 +1,566 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->state = $state; + $this->oldState = $oldState; + $this->force = $force; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    State of the Quote after the Transition State update action.

    + * + * + * @return null|StateReference + */ + public function getState() + { + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); + if (is_null($data)) { + return null; + } + + $this->state = StateReferenceModel::of($data); + } + + return $this->state; + } + + /** + *

    State of the Quote before the Transition State update action.

    + * + * + * @return null|StateReference + */ + public function getOldState() + { + if (is_null($this->oldState)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_OLD_STATE); + if (is_null($data)) { + return null; + } + + $this->oldState = StateReferenceModel::of($data); + } + + return $this->oldState; + } + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * + * @return null|bool + */ + public function getForce() + { + if (is_null($this->force)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_FORCE); + if (is_null($data)) { + return null; + } + $this->force = (bool) $data; + } + + return $this->force; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void + { + $this->state = $state; + } + + /** + * @param ?StateReference $oldState + */ + public function setOldState(?StateReference $oldState): void + { + $this->oldState = $oldState; + } + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void + { + $this->force = $force; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessagePayload.php b/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessagePayload.php new file mode 100644 index 00000000000..c8dd815d055 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessagePayload.php @@ -0,0 +1,59 @@ +State of the Quote after the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getState(); + + /** + *

    State of the Quote before the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getOldState(); + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + + * @return null|bool + */ + public function getForce(); + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void; + + /** + * @param ?StateReference $oldState + */ + public function setOldState(?StateReference $oldState): void; + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void; +} diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessagePayloadBuilder.php new file mode 100644 index 00000000000..e447394bf8d --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessagePayloadBuilder.php @@ -0,0 +1,144 @@ + + */ +final class StagedQuoteStateTransitionMessagePayloadBuilder implements Builder +{ + /** + + * @var null|StateReference|StateReferenceBuilder + */ + private $state; + + /** + + * @var null|StateReference|StateReferenceBuilder + */ + private $oldState; + + /** + + * @var ?bool + */ + private $force; + + /** + *

    State of the Quote after the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getState() + { + return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; + } + + /** + *

    State of the Quote before the Transition State update action.

    + * + + * @return null|StateReference + */ + public function getOldState() + { + return $this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState; + } + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + + * @return null|bool + */ + public function getForce() + { + return $this->force; + } + + /** + * @param ?StateReference $state + * @return $this + */ + public function withState(?StateReference $state) + { + $this->state = $state; + + return $this; + } + + /** + * @param ?StateReference $oldState + * @return $this + */ + public function withOldState(?StateReference $oldState) + { + $this->oldState = $oldState; + + return $this; + } + + /** + * @param ?bool $force + * @return $this + */ + public function withForce(?bool $force) + { + $this->force = $force; + + return $this; + } + + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateReferenceBuilder $state) + { + $this->state = $state; + + return $this; + } + + /** + * @deprecated use withOldState() instead + * @return $this + */ + public function withOldStateBuilder(?StateReferenceBuilder $oldState) + { + $this->oldState = $oldState; + + return $this; + } + + public function build(): StagedQuoteStateTransitionMessagePayload + { + return new StagedQuoteStateTransitionMessagePayloadModel( + $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state, + $this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState, + $this->force + ); + } + + public static function of(): StagedQuoteStateTransitionMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessagePayloadCollection.php new file mode 100644 index 00000000000..add6019502a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method StagedQuoteStateTransitionMessagePayload current() + * @method StagedQuoteStateTransitionMessagePayload end() + * @method StagedQuoteStateTransitionMessagePayload at($offset) + */ +class StagedQuoteStateTransitionMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert StagedQuoteStateTransitionMessagePayload $value + * @psalm-param StagedQuoteStateTransitionMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return StagedQuoteStateTransitionMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof StagedQuoteStateTransitionMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StagedQuoteStateTransitionMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?StagedQuoteStateTransitionMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StagedQuoteStateTransitionMessagePayload $data */ + $data = StagedQuoteStateTransitionMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessagePayloadModel.php new file mode 100644 index 00000000000..94b3591c08a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteStateTransitionMessagePayloadModel.php @@ -0,0 +1,169 @@ +state = $state; + $this->oldState = $oldState; + $this->force = $force; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    State of the Quote after the Transition State update action.

    + * + * + * @return null|StateReference + */ + public function getState() + { + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); + if (is_null($data)) { + return null; + } + + $this->state = StateReferenceModel::of($data); + } + + return $this->state; + } + + /** + *

    State of the Quote before the Transition State update action.

    + * + * + * @return null|StateReference + */ + public function getOldState() + { + if (is_null($this->oldState)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_OLD_STATE); + if (is_null($data)) { + return null; + } + + $this->oldState = StateReferenceModel::of($data); + } + + return $this->oldState; + } + + /** + *

    Whether State transition validations were turned off during the Transition State update action.

    + * + * + * @return null|bool + */ + public function getForce() + { + if (is_null($this->force)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_FORCE); + if (is_null($data)) { + return null; + } + $this->force = (bool) $data; + } + + return $this->force; + } + + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void + { + $this->state = $state; + } + + /** + * @param ?StateReference $oldState + */ + public function setOldState(?StateReference $oldState): void + { + $this->oldState = $oldState; + } + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void + { + $this->force = $force; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessage.php b/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessage.php index 6392a30469e..26f868f7f58 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessage.php @@ -17,6 +17,9 @@ interface StagedQuoteValidToSetMessage extends Message public const FIELD_VALID_TO = 'validTo'; /** + *

    Expiration date for the Staged Quote after the Set Valid To update action.

    + * + * @return null|DateTimeImmutable */ public function getValidTo(); diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessageBuilder.php index 9728c1cfc9a..7e9159b1326 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessageBuilder.php @@ -28,63 +28,75 @@ final class StagedQuoteValidToSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?DateTimeImmutable */ private $validTo; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -93,6 +105,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -101,6 +116,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -109,6 +127,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -117,8 +138,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -129,6 +151,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -137,6 +160,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -145,8 +172,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -155,6 +183,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -163,6 +194,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -171,6 +205,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Expiration date for the Staged Quote after the Set Valid To update action.

    + * + * @return null|DateTimeImmutable */ public function getValidTo() diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessageModel.php b/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessageModel.php index cf709acb001..6055245ca7e 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessageModel.php @@ -28,61 +28,73 @@ final class StagedQuoteValidToSetMessageModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'StagedQuoteValidToSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?DateTimeImmutable */ protected $validTo; @@ -102,7 +114,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?DateTimeImmutable $validTo = null + ?DateTimeImmutable $validTo = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -115,11 +128,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->validTo = $validTo; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -138,6 +152,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -155,6 +172,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -176,6 +196,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -197,7 +220,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -219,6 +243,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -237,6 +262,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -254,7 +283,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -274,6 +304,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -291,6 +324,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -308,6 +344,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -326,6 +365,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Expiration date for the Staged Quote after the Set Valid To update action.

    + * + * * @return null|DateTimeImmutable */ public function getValidTo() diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessagePayload.php index 95c68555e40..39319299e2c 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessagePayload.php @@ -17,6 +17,9 @@ interface StagedQuoteValidToSetMessagePayload extends MessagePayload public const FIELD_VALID_TO = 'validTo'; /** + *

    Expiration date for the Staged Quote after the Set Valid To update action.

    + * + * @return null|DateTimeImmutable */ public function getValidTo(); diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessagePayloadBuilder.php index faf08e0451a..9221455553e 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessagePayloadBuilder.php @@ -22,11 +22,15 @@ final class StagedQuoteValidToSetMessagePayloadBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $validTo; /** + *

    Expiration date for the Staged Quote after the Set Valid To update action.

    + * + * @return null|DateTimeImmutable */ public function getValidTo() diff --git a/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessagePayloadModel.php index 6dbc291a7c9..cde76dbb990 100644 --- a/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/StagedQuoteValidToSetMessagePayloadModel.php @@ -22,11 +22,13 @@ final class StagedQuoteValidToSetMessagePayloadModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'StagedQuoteValidToSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?DateTimeImmutable */ protected $validTo; @@ -36,13 +38,15 @@ final class StagedQuoteValidToSetMessagePayloadModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutable $validTo = null + ?DateTimeImmutable $validTo = null, + ?string $type = null ) { $this->validTo = $validTo; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -60,6 +64,9 @@ public function getType() } /** + *

    Expiration date for the Staged Quote after the Set Valid To update action.

    + * + * * @return null|DateTimeImmutable */ public function getValidTo() diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessage.php b/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessage.php new file mode 100644 index 00000000000..e94f428d1a5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessage.php @@ -0,0 +1,44 @@ +Value of the active field of the StandalonePrice after the Change Active update action.

    + * + + * @return null|bool + */ + public function getActive(); + + /** + *

    Value of the active field of the StandalonePrice before the Change Active update action.

    + * + + * @return null|bool + */ + public function getOldActive(); + + /** + * @param ?bool $active + */ + public function setActive(?bool $active): void; + + /** + * @param ?bool $oldActive + */ + public function setOldActive(?bool $oldActive): void; +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessageBuilder.php new file mode 100644 index 00000000000..89f0ddd6d94 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessageBuilder.php @@ -0,0 +1,433 @@ + + */ +final class StandalonePriceActiveChangedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?bool + */ + private $active; + + /** + + * @var ?bool + */ + private $oldActive; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Value of the active field of the StandalonePrice after the Change Active update action.

    + * + + * @return null|bool + */ + public function getActive() + { + return $this->active; + } + + /** + *

    Value of the active field of the StandalonePrice before the Change Active update action.

    + * + + * @return null|bool + */ + public function getOldActive() + { + return $this->oldActive; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?bool $active + * @return $this + */ + public function withActive(?bool $active) + { + $this->active = $active; + + return $this; + } + + /** + * @param ?bool $oldActive + * @return $this + */ + public function withOldActive(?bool $oldActive) + { + $this->oldActive = $oldActive; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): StandalonePriceActiveChangedMessage + { + return new StandalonePriceActiveChangedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->active, + $this->oldActive + ); + } + + public static function of(): StandalonePriceActiveChangedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessageCollection.php b/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessageCollection.php new file mode 100644 index 00000000000..40e3a136009 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method StandalonePriceActiveChangedMessage current() + * @method StandalonePriceActiveChangedMessage end() + * @method StandalonePriceActiveChangedMessage at($offset) + */ +class StandalonePriceActiveChangedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert StandalonePriceActiveChangedMessage $value + * @psalm-param StandalonePriceActiveChangedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return StandalonePriceActiveChangedMessageCollection + */ + public function add($value) + { + if (!$value instanceof StandalonePriceActiveChangedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StandalonePriceActiveChangedMessage + */ + protected function mapper() + { + return function (?int $index): ?StandalonePriceActiveChangedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StandalonePriceActiveChangedMessage $data */ + $data = StandalonePriceActiveChangedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessageModel.php new file mode 100644 index 00000000000..f34023dcc45 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessageModel.php @@ -0,0 +1,526 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->active = $active; + $this->oldActive = $oldActive; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Value of the active field of the StandalonePrice after the Change Active update action.

    + * + * + * @return null|bool + */ + public function getActive() + { + if (is_null($this->active)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_ACTIVE); + if (is_null($data)) { + return null; + } + $this->active = (bool) $data; + } + + return $this->active; + } + + /** + *

    Value of the active field of the StandalonePrice before the Change Active update action.

    + * + * + * @return null|bool + */ + public function getOldActive() + { + if (is_null($this->oldActive)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_OLD_ACTIVE); + if (is_null($data)) { + return null; + } + $this->oldActive = (bool) $data; + } + + return $this->oldActive; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?bool $active + */ + public function setActive(?bool $active): void + { + $this->active = $active; + } + + /** + * @param ?bool $oldActive + */ + public function setOldActive(?bool $oldActive): void + { + $this->oldActive = $oldActive; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessagePayload.php new file mode 100644 index 00000000000..7392b89ee68 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessagePayload.php @@ -0,0 +1,44 @@ +Value of the active field of the StandalonePrice after the Change Active update action.

    + * + + * @return null|bool + */ + public function getActive(); + + /** + *

    Value of the active field of the StandalonePrice before the Change Active update action.

    + * + + * @return null|bool + */ + public function getOldActive(); + + /** + * @param ?bool $active + */ + public function setActive(?bool $active): void; + + /** + * @param ?bool $oldActive + */ + public function setOldActive(?bool $oldActive): void; +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessagePayloadBuilder.php new file mode 100644 index 00000000000..2d5ce0d2b67 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessagePayloadBuilder.php @@ -0,0 +1,92 @@ + + */ +final class StandalonePriceActiveChangedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?bool + */ + private $active; + + /** + + * @var ?bool + */ + private $oldActive; + + /** + *

    Value of the active field of the StandalonePrice after the Change Active update action.

    + * + + * @return null|bool + */ + public function getActive() + { + return $this->active; + } + + /** + *

    Value of the active field of the StandalonePrice before the Change Active update action.

    + * + + * @return null|bool + */ + public function getOldActive() + { + return $this->oldActive; + } + + /** + * @param ?bool $active + * @return $this + */ + public function withActive(?bool $active) + { + $this->active = $active; + + return $this; + } + + /** + * @param ?bool $oldActive + * @return $this + */ + public function withOldActive(?bool $oldActive) + { + $this->oldActive = $oldActive; + + return $this; + } + + + public function build(): StandalonePriceActiveChangedMessagePayload + { + return new StandalonePriceActiveChangedMessagePayloadModel( + $this->active, + $this->oldActive + ); + } + + public static function of(): StandalonePriceActiveChangedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessagePayloadCollection.php new file mode 100644 index 00000000000..ca636da15a2 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method StandalonePriceActiveChangedMessagePayload current() + * @method StandalonePriceActiveChangedMessagePayload end() + * @method StandalonePriceActiveChangedMessagePayload at($offset) + */ +class StandalonePriceActiveChangedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert StandalonePriceActiveChangedMessagePayload $value + * @psalm-param StandalonePriceActiveChangedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return StandalonePriceActiveChangedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof StandalonePriceActiveChangedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StandalonePriceActiveChangedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?StandalonePriceActiveChangedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StandalonePriceActiveChangedMessagePayload $data */ + $data = StandalonePriceActiveChangedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessagePayloadModel.php new file mode 100644 index 00000000000..0a5ac24c605 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceActiveChangedMessagePayloadModel.php @@ -0,0 +1,129 @@ +active = $active; + $this->oldActive = $oldActive; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Value of the active field of the StandalonePrice after the Change Active update action.

    + * + * + * @return null|bool + */ + public function getActive() + { + if (is_null($this->active)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_ACTIVE); + if (is_null($data)) { + return null; + } + $this->active = (bool) $data; + } + + return $this->active; + } + + /** + *

    Value of the active field of the StandalonePrice before the Change Active update action.

    + * + * + * @return null|bool + */ + public function getOldActive() + { + if (is_null($this->oldActive)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_OLD_ACTIVE); + if (is_null($data)) { + return null; + } + $this->oldActive = (bool) $data; + } + + return $this->oldActive; + } + + + /** + * @param ?bool $active + */ + public function setActive(?bool $active): void + { + $this->active = $active; + } + + /** + * @param ?bool $oldActive + */ + public function setOldActive(?bool $oldActive): void + { + $this->oldActive = $oldActive; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessage.php b/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessage.php index ea96ab78123..f9ef6a50c57 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessage.php @@ -17,8 +17,9 @@ interface StandalonePriceCreatedMessage extends Message public const FIELD_STANDALONE_PRICE = 'standalonePrice'; /** - *

    The Standalone Price as it was created.

    + *

    Standalone Price that was created.

    * + * @return null|StandalonePrice */ public function getStandalonePrice(); diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessageBuilder.php index 88d0b802b8d..abe1e47df36 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessageBuilder.php @@ -30,63 +30,75 @@ final class StandalonePriceCreatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|StandalonePrice|StandalonePriceBuilder */ private $standalonePrice; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,8 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    The Standalone Price as it was created.

    + *

    Standalone Price that was created.

    * + * @return null|StandalonePrice */ public function getStandalonePrice() diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessageModel.php b/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessageModel.php index f3357e92bf4..1e4867308f1 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessageModel.php @@ -30,61 +30,73 @@ final class StandalonePriceCreatedMessageModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'StandalonePriceCreated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?StandalonePrice */ protected $standalonePrice; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?StandalonePrice $standalonePrice = null + ?StandalonePrice $standalonePrice = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->standalonePrice = $standalonePrice; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,7 +367,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    The Standalone Price as it was created.

    + *

    Standalone Price that was created.

    + * * * @return null|StandalonePrice */ diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessagePayload.php index d01d039d719..34824edfce6 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessagePayload.php @@ -17,8 +17,9 @@ interface StandalonePriceCreatedMessagePayload extends MessagePayload public const FIELD_STANDALONE_PRICE = 'standalonePrice'; /** - *

    The Standalone Price as it was created.

    + *

    Standalone Price that was created.

    * + * @return null|StandalonePrice */ public function getStandalonePrice(); diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessagePayloadBuilder.php index 84242ddf75d..a621ba7e2d2 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessagePayloadBuilder.php @@ -23,13 +23,15 @@ final class StandalonePriceCreatedMessagePayloadBuilder implements Builder { /** + * @var null|StandalonePrice|StandalonePriceBuilder */ private $standalonePrice; /** - *

    The Standalone Price as it was created.

    + *

    Standalone Price that was created.

    * + * @return null|StandalonePrice */ public function getStandalonePrice() diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessagePayloadModel.php index 7045ef3970f..4ff8d463e4d 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceCreatedMessagePayloadModel.php @@ -23,11 +23,13 @@ final class StandalonePriceCreatedMessagePayloadModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'StandalonePriceCreated'; /** + * * @var ?string */ protected $type; /** + * * @var ?StandalonePrice */ protected $standalonePrice; @@ -37,13 +39,15 @@ final class StandalonePriceCreatedMessagePayloadModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?StandalonePrice $standalonePrice = null + ?StandalonePrice $standalonePrice = null, + ?string $type = null ) { $this->standalonePrice = $standalonePrice; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,7 +65,8 @@ public function getType() } /** - *

    The Standalone Price as it was created.

    + *

    Standalone Price that was created.

    + * * * @return null|StandalonePrice */ diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceDeletedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StandalonePriceDeletedMessageBuilder.php index 338db9b1b71..7aa6a4e35e6 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceDeletedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceDeletedMessageBuilder.php @@ -28,58 +28,69 @@ final class StandalonePriceDeletedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -88,6 +99,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -96,6 +110,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -104,6 +121,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -112,8 +132,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -124,6 +145,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -132,6 +154,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -140,8 +166,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -150,6 +177,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -158,6 +188,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceDeletedMessageModel.php b/lib/commercetools-api/src/Models/Message/StandalonePriceDeletedMessageModel.php index 22ae70bd219..3a55de43c2c 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceDeletedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceDeletedMessageModel.php @@ -28,56 +28,67 @@ final class StandalonePriceDeletedMessageModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'StandalonePriceDeleted'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; @@ -96,7 +107,8 @@ public function __construct( ?int $sequenceNumber = null, ?Reference $resource = null, ?int $resourceVersion = null, - ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null + ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -108,11 +120,12 @@ public function __construct( $this->resource = $resource; $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -131,6 +144,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -148,6 +164,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -169,6 +188,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -190,7 +212,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -212,6 +235,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -230,6 +254,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -247,7 +275,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -267,6 +296,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -284,6 +316,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -301,6 +336,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceDeletedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StandalonePriceDeletedMessagePayloadModel.php index 5f51373569b..3df6ef592f6 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceDeletedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceDeletedMessagePayloadModel.php @@ -21,6 +21,7 @@ final class StandalonePriceDeletedMessagePayloadModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'StandalonePriceDeleted'; /** + * * @var ?string */ protected $type; @@ -30,11 +31,13 @@ final class StandalonePriceDeletedMessagePayloadModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessage.php b/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessage.php index f241603b7a0..9b4024e5ea3 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessage.php @@ -17,8 +17,9 @@ interface StandalonePriceDiscountSetMessage extends Message public const FIELD_DISCOUNTED = 'discounted'; /** - *

    The new discounted value of the updated StandalonePrice.

    + *

    The new discounted value of the updated StandalonePrice.

    * + * @return null|DiscountedPrice */ public function getDiscounted(); diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessageBuilder.php index fbc2034046a..867a9e96c14 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessageBuilder.php @@ -30,63 +30,75 @@ final class StandalonePriceDiscountSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|DiscountedPrice|DiscountedPriceBuilder */ private $discounted; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,8 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    The new discounted value of the updated StandalonePrice.

    + *

    The new discounted value of the updated StandalonePrice.

    * + * @return null|DiscountedPrice */ public function getDiscounted() diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessageModel.php b/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessageModel.php index f492950a84c..3decac23c8f 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessageModel.php @@ -30,61 +30,73 @@ final class StandalonePriceDiscountSetMessageModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'StandalonePriceDiscountSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?DiscountedPrice */ protected $discounted; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?DiscountedPrice $discounted = null + ?DiscountedPrice $discounted = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->discounted = $discounted; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,7 +367,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    The new discounted value of the updated StandalonePrice.

    + *

    The new discounted value of the updated StandalonePrice.

    + * * * @return null|DiscountedPrice */ diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessagePayload.php index ebdbf2b12ed..0e417ea0c11 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessagePayload.php @@ -17,8 +17,9 @@ interface StandalonePriceDiscountSetMessagePayload extends MessagePayload public const FIELD_DISCOUNTED = 'discounted'; /** - *

    The new discounted value of the updated StandalonePrice.

    + *

    The new discounted value of the updated StandalonePrice.

    * + * @return null|DiscountedPrice */ public function getDiscounted(); diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessagePayloadBuilder.php index 0b772838f59..66aa82e5418 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessagePayloadBuilder.php @@ -23,13 +23,15 @@ final class StandalonePriceDiscountSetMessagePayloadBuilder implements Builder { /** + * @var null|DiscountedPrice|DiscountedPriceBuilder */ private $discounted; /** - *

    The new discounted value of the updated StandalonePrice.

    + *

    The new discounted value of the updated StandalonePrice.

    * + * @return null|DiscountedPrice */ public function getDiscounted() diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessagePayloadModel.php index c3776880b3c..a2281bf54ab 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceDiscountSetMessagePayloadModel.php @@ -23,11 +23,13 @@ final class StandalonePriceDiscountSetMessagePayloadModel extends JsonObjectMode { public const DISCRIMINATOR_VALUE = 'StandalonePriceDiscountSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?DiscountedPrice */ protected $discounted; @@ -37,13 +39,15 @@ final class StandalonePriceDiscountSetMessagePayloadModel extends JsonObjectMode * @psalm-suppress MissingParamType */ public function __construct( - ?DiscountedPrice $discounted = null + ?DiscountedPrice $discounted = null, + ?string $type = null ) { $this->discounted = $discounted; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,7 +65,8 @@ public function getType() } /** - *

    The new discounted value of the updated StandalonePrice.

    + *

    The new discounted value of the updated StandalonePrice.

    + * * * @return null|DiscountedPrice */ diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessage.php b/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessage.php index 1ffe08f9988..1273d0bd2a3 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessage.php @@ -17,8 +17,9 @@ interface StandalonePriceExternalDiscountSetMessage extends Message public const FIELD_DISCOUNTED = 'discounted'; /** - *

    The new discounted value of the updated StandalonePrice.

    + *

    The discounted value of the StandalonePrice after the Set Discounted Price update action.

    * + * @return null|DiscountedPrice */ public function getDiscounted(); diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessageBuilder.php index b2a9e422698..39249aac3ec 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessageBuilder.php @@ -30,63 +30,75 @@ final class StandalonePriceExternalDiscountSetMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|DiscountedPrice|DiscountedPriceBuilder */ private $discounted; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +107,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +118,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +129,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +140,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +162,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +174,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +185,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +196,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,8 +207,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    The new discounted value of the updated StandalonePrice.

    + *

    The discounted value of the StandalonePrice after the Set Discounted Price update action.

    * + * @return null|DiscountedPrice */ public function getDiscounted() diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessageModel.php b/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessageModel.php index 462707a9f16..13417aa3c44 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessageModel.php @@ -30,61 +30,73 @@ final class StandalonePriceExternalDiscountSetMessageModel extends JsonObjectMod { public const DISCRIMINATOR_VALUE = 'StandalonePriceExternalDiscountSet'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?DiscountedPrice */ protected $discounted; @@ -104,7 +116,8 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?DiscountedPrice $discounted = null + ?DiscountedPrice $discounted = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +130,12 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->discounted = $discounted; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +154,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +174,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +198,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +222,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +245,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +264,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +285,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +306,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +326,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +346,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,7 +367,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    The new discounted value of the updated StandalonePrice.

    + *

    The discounted value of the StandalonePrice after the Set Discounted Price update action.

    + * * * @return null|DiscountedPrice */ diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessagePayload.php index 554d110699e..e792a2fbbc7 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessagePayload.php @@ -17,8 +17,9 @@ interface StandalonePriceExternalDiscountSetMessagePayload extends MessagePayloa public const FIELD_DISCOUNTED = 'discounted'; /** - *

    The new discounted value of the updated StandalonePrice.

    + *

    The discounted value of the StandalonePrice after the Set Discounted Price update action.

    * + * @return null|DiscountedPrice */ public function getDiscounted(); diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessagePayloadBuilder.php index 6bb5a0a3a32..7922a616c97 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessagePayloadBuilder.php @@ -23,13 +23,15 @@ final class StandalonePriceExternalDiscountSetMessagePayloadBuilder implements Builder { /** + * @var null|DiscountedPrice|DiscountedPriceBuilder */ private $discounted; /** - *

    The new discounted value of the updated StandalonePrice.

    + *

    The discounted value of the StandalonePrice after the Set Discounted Price update action.

    * + * @return null|DiscountedPrice */ public function getDiscounted() diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessagePayloadModel.php index f0e5322d15c..69239ef9704 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceExternalDiscountSetMessagePayloadModel.php @@ -23,11 +23,13 @@ final class StandalonePriceExternalDiscountSetMessagePayloadModel extends JsonOb { public const DISCRIMINATOR_VALUE = 'StandalonePriceExternalDiscountSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?DiscountedPrice */ protected $discounted; @@ -37,13 +39,15 @@ final class StandalonePriceExternalDiscountSetMessagePayloadModel extends JsonOb * @psalm-suppress MissingParamType */ public function __construct( - ?DiscountedPrice $discounted = null + ?DiscountedPrice $discounted = null, + ?string $type = null ) { $this->discounted = $discounted; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,7 +65,8 @@ public function getType() } /** - *

    The new discounted value of the updated StandalonePrice.

    + *

    The discounted value of the StandalonePrice after the Set Discounted Price update action.

    + * * * @return null|DiscountedPrice */ diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessage.php b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessage.php new file mode 100644 index 00000000000..7c340fe4d14 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessage.php @@ -0,0 +1,31 @@ +Applied changes of the StandalonePrice after the Apply Staged Changes update action.

    + * + + * @return null|StagedStandalonePrice + */ + public function getStagedChanges(); + + /** + * @param ?StagedStandalonePrice $stagedChanges + */ + public function setStagedChanges(?StagedStandalonePrice $stagedChanges): void; +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessageBuilder.php new file mode 100644 index 00000000000..025f9706a2b --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class StandalonePriceStagedChangesAppliedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|StagedStandalonePrice|StagedStandalonePriceBuilder + */ + private $stagedChanges; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Applied changes of the StandalonePrice after the Apply Staged Changes update action.

    + * + + * @return null|StagedStandalonePrice + */ + public function getStagedChanges() + { + return $this->stagedChanges instanceof StagedStandalonePriceBuilder ? $this->stagedChanges->build() : $this->stagedChanges; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?StagedStandalonePrice $stagedChanges + * @return $this + */ + public function withStagedChanges(?StagedStandalonePrice $stagedChanges) + { + $this->stagedChanges = $stagedChanges; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withStagedChanges() instead + * @return $this + */ + public function withStagedChangesBuilder(?StagedStandalonePriceBuilder $stagedChanges) + { + $this->stagedChanges = $stagedChanges; + + return $this; + } + + public function build(): StandalonePriceStagedChangesAppliedMessage + { + return new StandalonePriceStagedChangesAppliedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->stagedChanges instanceof StagedStandalonePriceBuilder ? $this->stagedChanges->build() : $this->stagedChanges + ); + } + + public static function of(): StandalonePriceStagedChangesAppliedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessageCollection.php b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessageCollection.php new file mode 100644 index 00000000000..60998c43383 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method StandalonePriceStagedChangesAppliedMessage current() + * @method StandalonePriceStagedChangesAppliedMessage end() + * @method StandalonePriceStagedChangesAppliedMessage at($offset) + */ +class StandalonePriceStagedChangesAppliedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert StandalonePriceStagedChangesAppliedMessage $value + * @psalm-param StandalonePriceStagedChangesAppliedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return StandalonePriceStagedChangesAppliedMessageCollection + */ + public function add($value) + { + if (!$value instanceof StandalonePriceStagedChangesAppliedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StandalonePriceStagedChangesAppliedMessage + */ + protected function mapper() + { + return function (?int $index): ?StandalonePriceStagedChangesAppliedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StandalonePriceStagedChangesAppliedMessage $data */ + $data = StandalonePriceStagedChangesAppliedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessageModel.php b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessageModel.php new file mode 100644 index 00000000000..df761272f92 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->stagedChanges = $stagedChanges; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Applied changes of the StandalonePrice after the Apply Staged Changes update action.

    + * + * + * @return null|StagedStandalonePrice + */ + public function getStagedChanges() + { + if (is_null($this->stagedChanges)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STAGED_CHANGES); + if (is_null($data)) { + return null; + } + + $this->stagedChanges = StagedStandalonePriceModel::of($data); + } + + return $this->stagedChanges; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?StagedStandalonePrice $stagedChanges + */ + public function setStagedChanges(?StagedStandalonePrice $stagedChanges): void + { + $this->stagedChanges = $stagedChanges; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessagePayload.php b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessagePayload.php new file mode 100644 index 00000000000..6c48c42b6e8 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessagePayload.php @@ -0,0 +1,31 @@ +Applied changes of the StandalonePrice after the Apply Staged Changes update action.

    + * + + * @return null|StagedStandalonePrice + */ + public function getStagedChanges(); + + /** + * @param ?StagedStandalonePrice $stagedChanges + */ + public function setStagedChanges(?StagedStandalonePrice $stagedChanges): void; +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessagePayloadBuilder.php new file mode 100644 index 00000000000..7cf89c6c0f6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class StandalonePriceStagedChangesAppliedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|StagedStandalonePrice|StagedStandalonePriceBuilder + */ + private $stagedChanges; + + /** + *

    Applied changes of the StandalonePrice after the Apply Staged Changes update action.

    + * + + * @return null|StagedStandalonePrice + */ + public function getStagedChanges() + { + return $this->stagedChanges instanceof StagedStandalonePriceBuilder ? $this->stagedChanges->build() : $this->stagedChanges; + } + + /** + * @param ?StagedStandalonePrice $stagedChanges + * @return $this + */ + public function withStagedChanges(?StagedStandalonePrice $stagedChanges) + { + $this->stagedChanges = $stagedChanges; + + return $this; + } + + /** + * @deprecated use withStagedChanges() instead + * @return $this + */ + public function withStagedChangesBuilder(?StagedStandalonePriceBuilder $stagedChanges) + { + $this->stagedChanges = $stagedChanges; + + return $this; + } + + public function build(): StandalonePriceStagedChangesAppliedMessagePayload + { + return new StandalonePriceStagedChangesAppliedMessagePayloadModel( + $this->stagedChanges instanceof StagedStandalonePriceBuilder ? $this->stagedChanges->build() : $this->stagedChanges + ); + } + + public static function of(): StandalonePriceStagedChangesAppliedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessagePayloadCollection.php new file mode 100644 index 00000000000..6687895409d --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method StandalonePriceStagedChangesAppliedMessagePayload current() + * @method StandalonePriceStagedChangesAppliedMessagePayload end() + * @method StandalonePriceStagedChangesAppliedMessagePayload at($offset) + */ +class StandalonePriceStagedChangesAppliedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert StandalonePriceStagedChangesAppliedMessagePayload $value + * @psalm-param StandalonePriceStagedChangesAppliedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return StandalonePriceStagedChangesAppliedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof StandalonePriceStagedChangesAppliedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StandalonePriceStagedChangesAppliedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?StandalonePriceStagedChangesAppliedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StandalonePriceStagedChangesAppliedMessagePayload $data */ + $data = StandalonePriceStagedChangesAppliedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessagePayloadModel.php new file mode 100644 index 00000000000..7a6703eed1a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesAppliedMessagePayloadModel.php @@ -0,0 +1,96 @@ +stagedChanges = $stagedChanges; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Applied changes of the StandalonePrice after the Apply Staged Changes update action.

    + * + * + * @return null|StagedStandalonePrice + */ + public function getStagedChanges() + { + if (is_null($this->stagedChanges)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STAGED_CHANGES); + if (is_null($data)) { + return null; + } + + $this->stagedChanges = StagedStandalonePriceModel::of($data); + } + + return $this->stagedChanges; + } + + + /** + * @param ?StagedStandalonePrice $stagedChanges + */ + public function setStagedChanges(?StagedStandalonePrice $stagedChanges): void + { + $this->stagedChanges = $stagedChanges; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessage.php b/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessage.php index 41bee076990..d29e0e2cce6 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessage.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessage.php @@ -15,16 +15,31 @@ interface StandalonePriceValueChangedMessage extends Message { public const FIELD_VALUE = 'value'; + public const FIELD_STAGED = 'staged'; /** - *

    The new value of the updated StandalonePrice.

    + *

    The new value of the updated StandalonePrice.

    * + * @return null|Money */ public function getValue(); + /** + *

    Whether the new value was applied to the current or the staged representation of the StandalonePrice. Staged changes are stored on the StagedStandalonePrice.

    + * + + * @return null|bool + */ + public function getStaged(); + /** * @param ?Money $value */ public function setValue(?Money $value): void; + + /** + * @param ?bool $staged + */ + public function setStaged(?bool $staged): void; } diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessageBuilder.php index ea42085bc83..0bf7a7f9871 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessageBuilder.php @@ -30,63 +30,81 @@ final class StandalonePriceValueChangedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|Money|MoneyBuilder */ private $value; /** - *

    Unique identifier of the Message.

    + + * @var ?bool + */ + private $staged; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -95,6 +113,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -103,6 +124,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -111,6 +135,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -119,8 +146,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -131,6 +159,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -139,6 +168,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -147,8 +180,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -157,6 +191,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -165,6 +202,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -173,8 +213,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    The new value of the updated StandalonePrice.

    + *

    The new value of the updated StandalonePrice.

    * + * @return null|Money */ public function getValue() @@ -182,6 +223,17 @@ public function getValue() return $this->value instanceof MoneyBuilder ? $this->value->build() : $this->value; } + /** + *

    Whether the new value was applied to the current or the staged representation of the StandalonePrice. Staged changes are stored on the StagedStandalonePrice.

    + * + + * @return null|bool + */ + public function getStaged() + { + return $this->staged; + } + /** * @param ?string $id * @return $this @@ -303,6 +355,17 @@ public function withValue(?Money $value) return $this; } + /** + * @param ?bool $staged + * @return $this + */ + public function withStaged(?bool $staged) + { + $this->staged = $staged; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -371,7 +434,8 @@ public function build(): StandalonePriceValueChangedMessage $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, - $this->value instanceof MoneyBuilder ? $this->value->build() : $this->value + $this->value instanceof MoneyBuilder ? $this->value->build() : $this->value, + $this->staged ); } diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessageModel.php index 8f828cfae42..b08ccec350f 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessageModel.php @@ -30,65 +30,83 @@ final class StandalonePriceValueChangedMessageModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'StandalonePriceValueChanged'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?Money */ protected $value; + /** + * + * @var ?bool + */ + protected $staged; + /** * @psalm-suppress MissingParamType @@ -104,7 +122,9 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?Money $value = null + ?Money $value = null, + ?bool $staged = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -117,11 +137,13 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->staged = $staged; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -140,6 +162,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -157,6 +182,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -178,6 +206,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -199,7 +230,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -221,6 +253,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -239,6 +272,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -256,7 +293,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -276,6 +314,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -293,6 +334,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -310,6 +354,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -328,7 +375,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    The new value of the updated StandalonePrice.

    + *

    The new value of the updated StandalonePrice.

    + * * * @return null|Money */ @@ -347,6 +395,26 @@ public function getValue() return $this->value; } + /** + *

    Whether the new value was applied to the current or the staged representation of the StandalonePrice. Staged changes are stored on the StagedStandalonePrice.

    + * + * + * @return null|bool + */ + public function getStaged() + { + if (is_null($this->staged)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_STAGED); + if (is_null($data)) { + return null; + } + $this->staged = (bool) $data; + } + + return $this->staged; + } + /** * @param ?string $id @@ -436,6 +504,14 @@ public function setValue(?Money $value): void $this->value = $value; } + /** + * @param ?bool $staged + */ + public function setStaged(?bool $staged): void + { + $this->staged = $staged; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessagePayload.php index 02a1db38bad..156339af5c8 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessagePayload.php @@ -15,16 +15,31 @@ interface StandalonePriceValueChangedMessagePayload extends MessagePayload { public const FIELD_VALUE = 'value'; + public const FIELD_STAGED = 'staged'; /** - *

    The new value of the updated StandalonePrice.

    + *

    The new value of the updated StandalonePrice.

    * + * @return null|Money */ public function getValue(); + /** + *

    Whether the new value was applied to the current or the staged representation of the StandalonePrice. Staged changes are stored on the StagedStandalonePrice.

    + * + + * @return null|bool + */ + public function getStaged(); + /** * @param ?Money $value */ public function setValue(?Money $value): void; + + /** + * @param ?bool $staged + */ + public function setStaged(?bool $staged): void; } diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessagePayloadBuilder.php index 3c3cb2dd61b..44ca7510e5d 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessagePayloadBuilder.php @@ -23,13 +23,21 @@ final class StandalonePriceValueChangedMessagePayloadBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $value; /** - *

    The new value of the updated StandalonePrice.

    + + * @var ?bool + */ + private $staged; + + /** + *

    The new value of the updated StandalonePrice.

    * + * @return null|Money */ public function getValue() @@ -37,6 +45,17 @@ public function getValue() return $this->value instanceof MoneyBuilder ? $this->value->build() : $this->value; } + /** + *

    Whether the new value was applied to the current or the staged representation of the StandalonePrice. Staged changes are stored on the StagedStandalonePrice.

    + * + + * @return null|bool + */ + public function getStaged() + { + return $this->staged; + } + /** * @param ?Money $value * @return $this @@ -48,6 +67,17 @@ public function withValue(?Money $value) return $this; } + /** + * @param ?bool $staged + * @return $this + */ + public function withStaged(?bool $staged) + { + $this->staged = $staged; + + return $this; + } + /** * @deprecated use withValue() instead * @return $this @@ -62,7 +92,8 @@ public function withValueBuilder(?MoneyBuilder $value) public function build(): StandalonePriceValueChangedMessagePayload { return new StandalonePriceValueChangedMessagePayloadModel( - $this->value instanceof MoneyBuilder ? $this->value->build() : $this->value + $this->value instanceof MoneyBuilder ? $this->value->build() : $this->value, + $this->staged ); } diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessagePayloadModel.php index ef60f1d39ab..cb98db05c5b 100644 --- a/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceValueChangedMessagePayloadModel.php @@ -23,27 +23,39 @@ final class StandalonePriceValueChangedMessagePayloadModel extends JsonObjectMod { public const DISCRIMINATOR_VALUE = 'StandalonePriceValueChanged'; /** + * * @var ?string */ protected $type; /** + * * @var ?Money */ protected $value; + /** + * + * @var ?bool + */ + protected $staged; + /** * @psalm-suppress MissingParamType */ public function __construct( - ?Money $value = null + ?Money $value = null, + ?bool $staged = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->staged = $staged; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,7 +73,8 @@ public function getType() } /** - *

    The new value of the updated StandalonePrice.

    + *

    The new value of the updated StandalonePrice.

    + * * * @return null|Money */ @@ -80,6 +93,26 @@ public function getValue() return $this->value; } + /** + *

    Whether the new value was applied to the current or the staged representation of the StandalonePrice. Staged changes are stored on the StagedStandalonePrice.

    + * + * + * @return null|bool + */ + public function getStaged() + { + if (is_null($this->staged)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_STAGED); + if (is_null($data)) { + return null; + } + $this->staged = (bool) $data; + } + + return $this->staged; + } + /** * @param ?Money $value @@ -88,4 +121,12 @@ public function setValue(?Money $value): void { $this->value = $value; } + + /** + * @param ?bool $staged + */ + public function setStaged(?bool $staged): void + { + $this->staged = $staged; + } } diff --git a/lib/commercetools-api/src/Models/Message/StoreCreatedMessage.php b/lib/commercetools-api/src/Models/Message/StoreCreatedMessage.php index d058626de2f..2e53677d786 100644 --- a/lib/commercetools-api/src/Models/Message/StoreCreatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/StoreCreatedMessage.php @@ -25,35 +25,49 @@ interface StoreCreatedMessage extends Message public const FIELD_CUSTOM = 'custom'; /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The name of the Store that was created.

    * + * @return null|LocalizedString */ public function getName(); /** + *

    Languages of the Store that was created. Languages are represented as IETF language tags.

    + * + * @return null|array */ public function getLanguages(); /** + *

    Distribution Channels of the Store that was created.

    + * + * @return null|ChannelReferenceCollection */ public function getDistributionChannels(); /** + *

    Supply Channels of the Store that was created.

    + * + * @return null|ChannelReferenceCollection */ public function getSupplyChannels(); /** + *

    ProductSelectionSettings of the Store that was created.

    + * + * @return null|ProductSelectionSettingCollection */ public function getProductSelections(); /** - *

    Serves as value of the custom field on a resource or data type customized with a Type.

    + *

    Custom Fields on the Store that was created.

    * + * @return null|CustomFields */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Message/StoreCreatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StoreCreatedMessageBuilder.php index 39aa51d5e38..33f312dfd6d 100644 --- a/lib/commercetools-api/src/Models/Message/StoreCreatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StoreCreatedMessageBuilder.php @@ -34,88 +34,105 @@ final class StoreCreatedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?array */ private $languages; /** + * @var ?ChannelReferenceCollection */ private $distributionChannels; /** + * @var ?ChannelReferenceCollection */ private $supplyChannels; /** + * @var ?ProductSelectionSettingCollection */ private $productSelections; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -124,6 +141,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -132,6 +152,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -140,6 +163,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -148,8 +174,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -160,6 +187,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -168,6 +196,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -176,8 +208,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -186,6 +219,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -194,6 +230,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -202,8 +241,9 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The name of the Store that was created.

    * + * @return null|LocalizedString */ public function getName() @@ -212,6 +252,9 @@ public function getName() } /** + *

    Languages of the Store that was created. Languages are represented as IETF language tags.

    + * + * @return null|array */ public function getLanguages() @@ -220,6 +263,9 @@ public function getLanguages() } /** + *

    Distribution Channels of the Store that was created.

    + * + * @return null|ChannelReferenceCollection */ public function getDistributionChannels() @@ -228,6 +274,9 @@ public function getDistributionChannels() } /** + *

    Supply Channels of the Store that was created.

    + * + * @return null|ChannelReferenceCollection */ public function getSupplyChannels() @@ -236,6 +285,9 @@ public function getSupplyChannels() } /** + *

    ProductSelectionSettings of the Store that was created.

    + * + * @return null|ProductSelectionSettingCollection */ public function getProductSelections() @@ -244,8 +296,9 @@ public function getProductSelections() } /** - *

    Serves as value of the custom field on a resource or data type customized with a Type.

    + *

    Custom Fields on the Store that was created.

    * + * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Message/StoreCreatedMessageModel.php b/lib/commercetools-api/src/Models/Message/StoreCreatedMessageModel.php index 3b68ceacf4a..36973addcb1 100644 --- a/lib/commercetools-api/src/Models/Message/StoreCreatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/StoreCreatedMessageModel.php @@ -34,86 +34,103 @@ final class StoreCreatedMessageModel extends JsonObjectModel implements StoreCre { public const DISCRIMINATOR_VALUE = 'StoreCreated'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?array */ protected $languages; /** + * * @var ?ChannelReferenceCollection */ protected $distributionChannels; /** + * * @var ?ChannelReferenceCollection */ protected $supplyChannels; /** + * * @var ?ProductSelectionSettingCollection */ protected $productSelections; /** + * * @var ?CustomFields */ protected $custom; @@ -138,7 +155,8 @@ public function __construct( ?ChannelReferenceCollection $distributionChannels = null, ?ChannelReferenceCollection $supplyChannels = null, ?ProductSelectionSettingCollection $productSelections = null, - ?CustomFields $custom = null + ?CustomFields $custom = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -156,11 +174,12 @@ public function __construct( $this->supplyChannels = $supplyChannels; $this->productSelections = $productSelections; $this->custom = $custom; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -179,6 +198,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -196,6 +218,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -217,6 +242,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -238,7 +266,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -260,6 +289,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -278,6 +308,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -295,7 +329,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -315,6 +350,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -332,6 +370,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -349,6 +390,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -367,7 +411,8 @@ public function getResourceUserProvidedIdentifiers() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The name of the Store that was created.

    + * * * @return null|LocalizedString */ @@ -387,6 +432,9 @@ public function getName() } /** + *

    Languages of the Store that was created. Languages are represented as IETF language tags.

    + * + * * @return null|array */ public function getLanguages() @@ -404,6 +452,9 @@ public function getLanguages() } /** + *

    Distribution Channels of the Store that was created.

    + * + * * @return null|ChannelReferenceCollection */ public function getDistributionChannels() @@ -421,6 +472,9 @@ public function getDistributionChannels() } /** + *

    Supply Channels of the Store that was created.

    + * + * * @return null|ChannelReferenceCollection */ public function getSupplyChannels() @@ -438,6 +492,9 @@ public function getSupplyChannels() } /** + *

    ProductSelectionSettings of the Store that was created.

    + * + * * @return null|ProductSelectionSettingCollection */ public function getProductSelections() @@ -455,7 +512,8 @@ public function getProductSelections() } /** - *

    Serves as value of the custom field on a resource or data type customized with a Type.

    + *

    Custom Fields on the Store that was created.

    + * * * @return null|CustomFields */ diff --git a/lib/commercetools-api/src/Models/Message/StoreCreatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/StoreCreatedMessagePayload.php index 7dc885c61f0..e2a77f1bd62 100644 --- a/lib/commercetools-api/src/Models/Message/StoreCreatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/StoreCreatedMessagePayload.php @@ -25,35 +25,49 @@ interface StoreCreatedMessagePayload extends MessagePayload public const FIELD_CUSTOM = 'custom'; /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The name of the Store that was created.

    * + * @return null|LocalizedString */ public function getName(); /** + *

    Languages of the Store that was created. Languages are represented as IETF language tags.

    + * + * @return null|array */ public function getLanguages(); /** + *

    Distribution Channels of the Store that was created.

    + * + * @return null|ChannelReferenceCollection */ public function getDistributionChannels(); /** + *

    Supply Channels of the Store that was created.

    + * + * @return null|ChannelReferenceCollection */ public function getSupplyChannels(); /** + *

    ProductSelectionSettings of the Store that was created.

    + * + * @return null|ProductSelectionSettingCollection */ public function getProductSelections(); /** - *

    Serves as value of the custom field on a resource or data type customized with a Type.

    + *

    Custom Fields on the Store that was created.

    * + * @return null|CustomFields */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Message/StoreCreatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StoreCreatedMessagePayloadBuilder.php index 3fa5dda5cb5..a3b649376c1 100644 --- a/lib/commercetools-api/src/Models/Message/StoreCreatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StoreCreatedMessagePayloadBuilder.php @@ -27,38 +27,45 @@ final class StoreCreatedMessagePayloadBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?array */ private $languages; /** + * @var ?ChannelReferenceCollection */ private $distributionChannels; /** + * @var ?ChannelReferenceCollection */ private $supplyChannels; /** + * @var ?ProductSelectionSettingCollection */ private $productSelections; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The name of the Store that was created.

    * + * @return null|LocalizedString */ public function getName() @@ -67,6 +74,9 @@ public function getName() } /** + *

    Languages of the Store that was created. Languages are represented as IETF language tags.

    + * + * @return null|array */ public function getLanguages() @@ -75,6 +85,9 @@ public function getLanguages() } /** + *

    Distribution Channels of the Store that was created.

    + * + * @return null|ChannelReferenceCollection */ public function getDistributionChannels() @@ -83,6 +96,9 @@ public function getDistributionChannels() } /** + *

    Supply Channels of the Store that was created.

    + * + * @return null|ChannelReferenceCollection */ public function getSupplyChannels() @@ -91,6 +107,9 @@ public function getSupplyChannels() } /** + *

    ProductSelectionSettings of the Store that was created.

    + * + * @return null|ProductSelectionSettingCollection */ public function getProductSelections() @@ -99,8 +118,9 @@ public function getProductSelections() } /** - *

    Serves as value of the custom field on a resource or data type customized with a Type.

    + *

    Custom Fields on the Store that was created.

    * + * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Message/StoreCreatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StoreCreatedMessagePayloadModel.php index 68c56907c03..afdba01b084 100644 --- a/lib/commercetools-api/src/Models/Message/StoreCreatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/StoreCreatedMessagePayloadModel.php @@ -27,36 +27,43 @@ final class StoreCreatedMessagePayloadModel extends JsonObjectModel implements S { public const DISCRIMINATOR_VALUE = 'StoreCreated'; /** + * * @var ?string */ protected $type; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?array */ protected $languages; /** + * * @var ?ChannelReferenceCollection */ protected $distributionChannels; /** + * * @var ?ChannelReferenceCollection */ protected $supplyChannels; /** + * * @var ?ProductSelectionSettingCollection */ protected $productSelections; /** + * * @var ?CustomFields */ protected $custom; @@ -71,7 +78,8 @@ public function __construct( ?ChannelReferenceCollection $distributionChannels = null, ?ChannelReferenceCollection $supplyChannels = null, ?ProductSelectionSettingCollection $productSelections = null, - ?CustomFields $custom = null + ?CustomFields $custom = null, + ?string $type = null ) { $this->name = $name; $this->languages = $languages; @@ -79,10 +87,11 @@ public function __construct( $this->supplyChannels = $supplyChannels; $this->productSelections = $productSelections; $this->custom = $custom; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -100,7 +109,8 @@ public function getType() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    The name of the Store that was created.

    + * * * @return null|LocalizedString */ @@ -120,6 +130,9 @@ public function getName() } /** + *

    Languages of the Store that was created. Languages are represented as IETF language tags.

    + * + * * @return null|array */ public function getLanguages() @@ -137,6 +150,9 @@ public function getLanguages() } /** + *

    Distribution Channels of the Store that was created.

    + * + * * @return null|ChannelReferenceCollection */ public function getDistributionChannels() @@ -154,6 +170,9 @@ public function getDistributionChannels() } /** + *

    Supply Channels of the Store that was created.

    + * + * * @return null|ChannelReferenceCollection */ public function getSupplyChannels() @@ -171,6 +190,9 @@ public function getSupplyChannels() } /** + *

    ProductSelectionSettings of the Store that was created.

    + * + * * @return null|ProductSelectionSettingCollection */ public function getProductSelections() @@ -188,7 +210,8 @@ public function getProductSelections() } /** - *

    Serves as value of the custom field on a resource or data type customized with a Type.

    + *

    Custom Fields on the Store that was created.

    + * * * @return null|CustomFields */ diff --git a/lib/commercetools-api/src/Models/Message/StoreDeletedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StoreDeletedMessageBuilder.php index 04167aab979..4da0a8e2cc5 100644 --- a/lib/commercetools-api/src/Models/Message/StoreDeletedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StoreDeletedMessageBuilder.php @@ -28,58 +28,69 @@ final class StoreDeletedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -88,6 +99,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -96,6 +110,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -104,6 +121,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -112,8 +132,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -124,6 +145,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -132,6 +154,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -140,8 +166,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -150,6 +177,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -158,6 +188,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/StoreDeletedMessageModel.php b/lib/commercetools-api/src/Models/Message/StoreDeletedMessageModel.php index d08ea1d8367..d3617865339 100644 --- a/lib/commercetools-api/src/Models/Message/StoreDeletedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/StoreDeletedMessageModel.php @@ -28,56 +28,67 @@ final class StoreDeletedMessageModel extends JsonObjectModel implements StoreDel { public const DISCRIMINATOR_VALUE = 'StoreDeleted'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; @@ -96,7 +107,8 @@ public function __construct( ?int $sequenceNumber = null, ?Reference $resource = null, ?int $resourceVersion = null, - ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null + ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -108,11 +120,12 @@ public function __construct( $this->resource = $resource; $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -131,6 +144,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -148,6 +164,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -169,6 +188,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -190,7 +212,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -212,6 +235,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -230,6 +254,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -247,7 +275,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -267,6 +296,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -284,6 +316,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -301,6 +336,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Message/StoreDeletedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StoreDeletedMessagePayloadModel.php index 7dcaae79e0d..f518674d547 100644 --- a/lib/commercetools-api/src/Models/Message/StoreDeletedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/StoreDeletedMessagePayloadModel.php @@ -21,6 +21,7 @@ final class StoreDeletedMessagePayloadModel extends JsonObjectModel implements S { public const DISCRIMINATOR_VALUE = 'StoreDeleted'; /** + * * @var ?string */ protected $type; @@ -30,11 +31,13 @@ final class StoreDeletedMessagePayloadModel extends JsonObjectModel implements S * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessage.php b/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessage.php new file mode 100644 index 00000000000..4830c731844 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessage.php @@ -0,0 +1,45 @@ +Product distribution Channels that have been added to the Store.

    + * + + * @return null|ChannelReferenceCollection + */ + public function getAddedDistributionChannels(); + + /** + *

    Product distribution Channels that have been removed from the Store.

    + * + + * @return null|ChannelReferenceCollection + */ + public function getRemovedDistributionChannels(); + + /** + * @param ?ChannelReferenceCollection $addedDistributionChannels + */ + public function setAddedDistributionChannels(?ChannelReferenceCollection $addedDistributionChannels): void; + + /** + * @param ?ChannelReferenceCollection $removedDistributionChannels + */ + public function setRemovedDistributionChannels(?ChannelReferenceCollection $removedDistributionChannels): void; +} diff --git a/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessageBuilder.php new file mode 100644 index 00000000000..1a7f8f83a4f --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessageBuilder.php @@ -0,0 +1,434 @@ + + */ +final class StoreDistributionChannelsChangedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?ChannelReferenceCollection + */ + private $addedDistributionChannels; + + /** + + * @var ?ChannelReferenceCollection + */ + private $removedDistributionChannels; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Product distribution Channels that have been added to the Store.

    + * + + * @return null|ChannelReferenceCollection + */ + public function getAddedDistributionChannels() + { + return $this->addedDistributionChannels; + } + + /** + *

    Product distribution Channels that have been removed from the Store.

    + * + + * @return null|ChannelReferenceCollection + */ + public function getRemovedDistributionChannels() + { + return $this->removedDistributionChannels; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?ChannelReferenceCollection $addedDistributionChannels + * @return $this + */ + public function withAddedDistributionChannels(?ChannelReferenceCollection $addedDistributionChannels) + { + $this->addedDistributionChannels = $addedDistributionChannels; + + return $this; + } + + /** + * @param ?ChannelReferenceCollection $removedDistributionChannels + * @return $this + */ + public function withRemovedDistributionChannels(?ChannelReferenceCollection $removedDistributionChannels) + { + $this->removedDistributionChannels = $removedDistributionChannels; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): StoreDistributionChannelsChangedMessage + { + return new StoreDistributionChannelsChangedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->addedDistributionChannels, + $this->removedDistributionChannels + ); + } + + public static function of(): StoreDistributionChannelsChangedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessageCollection.php b/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessageCollection.php new file mode 100644 index 00000000000..32724f276c1 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method StoreDistributionChannelsChangedMessage current() + * @method StoreDistributionChannelsChangedMessage end() + * @method StoreDistributionChannelsChangedMessage at($offset) + */ +class StoreDistributionChannelsChangedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert StoreDistributionChannelsChangedMessage $value + * @psalm-param StoreDistributionChannelsChangedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return StoreDistributionChannelsChangedMessageCollection + */ + public function add($value) + { + if (!$value instanceof StoreDistributionChannelsChangedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StoreDistributionChannelsChangedMessage + */ + protected function mapper() + { + return function (?int $index): ?StoreDistributionChannelsChangedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StoreDistributionChannelsChangedMessage $data */ + $data = StoreDistributionChannelsChangedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessageModel.php new file mode 100644 index 00000000000..5eebff37b4f --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessageModel.php @@ -0,0 +1,527 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->addedDistributionChannels = $addedDistributionChannels; + $this->removedDistributionChannels = $removedDistributionChannels; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Product distribution Channels that have been added to the Store.

    + * + * + * @return null|ChannelReferenceCollection + */ + public function getAddedDistributionChannels() + { + if (is_null($this->addedDistributionChannels)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ADDED_DISTRIBUTION_CHANNELS); + if (is_null($data)) { + return null; + } + $this->addedDistributionChannels = ChannelReferenceCollection::fromArray($data); + } + + return $this->addedDistributionChannels; + } + + /** + *

    Product distribution Channels that have been removed from the Store.

    + * + * + * @return null|ChannelReferenceCollection + */ + public function getRemovedDistributionChannels() + { + if (is_null($this->removedDistributionChannels)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_REMOVED_DISTRIBUTION_CHANNELS); + if (is_null($data)) { + return null; + } + $this->removedDistributionChannels = ChannelReferenceCollection::fromArray($data); + } + + return $this->removedDistributionChannels; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?ChannelReferenceCollection $addedDistributionChannels + */ + public function setAddedDistributionChannels(?ChannelReferenceCollection $addedDistributionChannels): void + { + $this->addedDistributionChannels = $addedDistributionChannels; + } + + /** + * @param ?ChannelReferenceCollection $removedDistributionChannels + */ + public function setRemovedDistributionChannels(?ChannelReferenceCollection $removedDistributionChannels): void + { + $this->removedDistributionChannels = $removedDistributionChannels; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessagePayload.php new file mode 100644 index 00000000000..864599013a5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessagePayload.php @@ -0,0 +1,45 @@ +Product distribution Channels that have been added to the Store.

    + * + + * @return null|ChannelReferenceCollection + */ + public function getAddedDistributionChannels(); + + /** + *

    Product distribution Channels that have been removed from the Store.

    + * + + * @return null|ChannelReferenceCollection + */ + public function getRemovedDistributionChannels(); + + /** + * @param ?ChannelReferenceCollection $addedDistributionChannels + */ + public function setAddedDistributionChannels(?ChannelReferenceCollection $addedDistributionChannels): void; + + /** + * @param ?ChannelReferenceCollection $removedDistributionChannels + */ + public function setRemovedDistributionChannels(?ChannelReferenceCollection $removedDistributionChannels): void; +} diff --git a/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessagePayloadBuilder.php new file mode 100644 index 00000000000..6c67a69a766 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessagePayloadBuilder.php @@ -0,0 +1,93 @@ + + */ +final class StoreDistributionChannelsChangedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?ChannelReferenceCollection + */ + private $addedDistributionChannels; + + /** + + * @var ?ChannelReferenceCollection + */ + private $removedDistributionChannels; + + /** + *

    Product distribution Channels that have been added to the Store.

    + * + + * @return null|ChannelReferenceCollection + */ + public function getAddedDistributionChannels() + { + return $this->addedDistributionChannels; + } + + /** + *

    Product distribution Channels that have been removed from the Store.

    + * + + * @return null|ChannelReferenceCollection + */ + public function getRemovedDistributionChannels() + { + return $this->removedDistributionChannels; + } + + /** + * @param ?ChannelReferenceCollection $addedDistributionChannels + * @return $this + */ + public function withAddedDistributionChannels(?ChannelReferenceCollection $addedDistributionChannels) + { + $this->addedDistributionChannels = $addedDistributionChannels; + + return $this; + } + + /** + * @param ?ChannelReferenceCollection $removedDistributionChannels + * @return $this + */ + public function withRemovedDistributionChannels(?ChannelReferenceCollection $removedDistributionChannels) + { + $this->removedDistributionChannels = $removedDistributionChannels; + + return $this; + } + + + public function build(): StoreDistributionChannelsChangedMessagePayload + { + return new StoreDistributionChannelsChangedMessagePayloadModel( + $this->addedDistributionChannels, + $this->removedDistributionChannels + ); + } + + public static function of(): StoreDistributionChannelsChangedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessagePayloadCollection.php new file mode 100644 index 00000000000..1635bd36f44 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method StoreDistributionChannelsChangedMessagePayload current() + * @method StoreDistributionChannelsChangedMessagePayload end() + * @method StoreDistributionChannelsChangedMessagePayload at($offset) + */ +class StoreDistributionChannelsChangedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert StoreDistributionChannelsChangedMessagePayload $value + * @psalm-param StoreDistributionChannelsChangedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return StoreDistributionChannelsChangedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof StoreDistributionChannelsChangedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StoreDistributionChannelsChangedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?StoreDistributionChannelsChangedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StoreDistributionChannelsChangedMessagePayload $data */ + $data = StoreDistributionChannelsChangedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessagePayloadModel.php new file mode 100644 index 00000000000..885478365c2 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreDistributionChannelsChangedMessagePayloadModel.php @@ -0,0 +1,130 @@ +addedDistributionChannels = $addedDistributionChannels; + $this->removedDistributionChannels = $removedDistributionChannels; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Product distribution Channels that have been added to the Store.

    + * + * + * @return null|ChannelReferenceCollection + */ + public function getAddedDistributionChannels() + { + if (is_null($this->addedDistributionChannels)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ADDED_DISTRIBUTION_CHANNELS); + if (is_null($data)) { + return null; + } + $this->addedDistributionChannels = ChannelReferenceCollection::fromArray($data); + } + + return $this->addedDistributionChannels; + } + + /** + *

    Product distribution Channels that have been removed from the Store.

    + * + * + * @return null|ChannelReferenceCollection + */ + public function getRemovedDistributionChannels() + { + if (is_null($this->removedDistributionChannels)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_REMOVED_DISTRIBUTION_CHANNELS); + if (is_null($data)) { + return null; + } + $this->removedDistributionChannels = ChannelReferenceCollection::fromArray($data); + } + + return $this->removedDistributionChannels; + } + + + /** + * @param ?ChannelReferenceCollection $addedDistributionChannels + */ + public function setAddedDistributionChannels(?ChannelReferenceCollection $addedDistributionChannels): void + { + $this->addedDistributionChannels = $addedDistributionChannels; + } + + /** + * @param ?ChannelReferenceCollection $removedDistributionChannels + */ + public function setRemovedDistributionChannels(?ChannelReferenceCollection $removedDistributionChannels): void + { + $this->removedDistributionChannels = $removedDistributionChannels; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessage.php b/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessage.php new file mode 100644 index 00000000000..cdea267cf78 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessage.php @@ -0,0 +1,44 @@ +Locales added to the Store after the Set Languages update action.

    + * + + * @return null|array + */ + public function getAddedLanguages(); + + /** + *

    Locales removed from the Store during the Set Languages update action.

    + * + + * @return null|array + */ + public function getRemovedLanguages(); + + /** + * @param ?array $addedLanguages + */ + public function setAddedLanguages(?array $addedLanguages): void; + + /** + * @param ?array $removedLanguages + */ + public function setRemovedLanguages(?array $removedLanguages): void; +} diff --git a/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessageBuilder.php new file mode 100644 index 00000000000..c6a2b99392e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessageBuilder.php @@ -0,0 +1,433 @@ + + */ +final class StoreLanguagesChangedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?array + */ + private $addedLanguages; + + /** + + * @var ?array + */ + private $removedLanguages; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Locales added to the Store after the Set Languages update action.

    + * + + * @return null|array + */ + public function getAddedLanguages() + { + return $this->addedLanguages; + } + + /** + *

    Locales removed from the Store during the Set Languages update action.

    + * + + * @return null|array + */ + public function getRemovedLanguages() + { + return $this->removedLanguages; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?array $addedLanguages + * @return $this + */ + public function withAddedLanguages(?array $addedLanguages) + { + $this->addedLanguages = $addedLanguages; + + return $this; + } + + /** + * @param ?array $removedLanguages + * @return $this + */ + public function withRemovedLanguages(?array $removedLanguages) + { + $this->removedLanguages = $removedLanguages; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): StoreLanguagesChangedMessage + { + return new StoreLanguagesChangedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->addedLanguages, + $this->removedLanguages + ); + } + + public static function of(): StoreLanguagesChangedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessageCollection.php b/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessageCollection.php new file mode 100644 index 00000000000..d4b8510deff --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method StoreLanguagesChangedMessage current() + * @method StoreLanguagesChangedMessage end() + * @method StoreLanguagesChangedMessage at($offset) + */ +class StoreLanguagesChangedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert StoreLanguagesChangedMessage $value + * @psalm-param StoreLanguagesChangedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return StoreLanguagesChangedMessageCollection + */ + public function add($value) + { + if (!$value instanceof StoreLanguagesChangedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StoreLanguagesChangedMessage + */ + protected function mapper() + { + return function (?int $index): ?StoreLanguagesChangedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StoreLanguagesChangedMessage $data */ + $data = StoreLanguagesChangedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessageModel.php new file mode 100644 index 00000000000..75960f165e4 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessageModel.php @@ -0,0 +1,526 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->addedLanguages = $addedLanguages; + $this->removedLanguages = $removedLanguages; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Locales added to the Store after the Set Languages update action.

    + * + * + * @return null|array + */ + public function getAddedLanguages() + { + if (is_null($this->addedLanguages)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ADDED_LANGUAGES); + if (is_null($data)) { + return null; + } + $this->addedLanguages = $data; + } + + return $this->addedLanguages; + } + + /** + *

    Locales removed from the Store during the Set Languages update action.

    + * + * + * @return null|array + */ + public function getRemovedLanguages() + { + if (is_null($this->removedLanguages)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_REMOVED_LANGUAGES); + if (is_null($data)) { + return null; + } + $this->removedLanguages = $data; + } + + return $this->removedLanguages; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?array $addedLanguages + */ + public function setAddedLanguages(?array $addedLanguages): void + { + $this->addedLanguages = $addedLanguages; + } + + /** + * @param ?array $removedLanguages + */ + public function setRemovedLanguages(?array $removedLanguages): void + { + $this->removedLanguages = $removedLanguages; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessagePayload.php new file mode 100644 index 00000000000..8767ba647d9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessagePayload.php @@ -0,0 +1,44 @@ +Locales added to the Store after the Set Languages update action.

    + * + + * @return null|array + */ + public function getAddedLanguages(); + + /** + *

    Locales removed from the Store during the Set Languages update action.

    + * + + * @return null|array + */ + public function getRemovedLanguages(); + + /** + * @param ?array $addedLanguages + */ + public function setAddedLanguages(?array $addedLanguages): void; + + /** + * @param ?array $removedLanguages + */ + public function setRemovedLanguages(?array $removedLanguages): void; +} diff --git a/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessagePayloadBuilder.php new file mode 100644 index 00000000000..44813dd2c22 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessagePayloadBuilder.php @@ -0,0 +1,92 @@ + + */ +final class StoreLanguagesChangedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?array + */ + private $addedLanguages; + + /** + + * @var ?array + */ + private $removedLanguages; + + /** + *

    Locales added to the Store after the Set Languages update action.

    + * + + * @return null|array + */ + public function getAddedLanguages() + { + return $this->addedLanguages; + } + + /** + *

    Locales removed from the Store during the Set Languages update action.

    + * + + * @return null|array + */ + public function getRemovedLanguages() + { + return $this->removedLanguages; + } + + /** + * @param ?array $addedLanguages + * @return $this + */ + public function withAddedLanguages(?array $addedLanguages) + { + $this->addedLanguages = $addedLanguages; + + return $this; + } + + /** + * @param ?array $removedLanguages + * @return $this + */ + public function withRemovedLanguages(?array $removedLanguages) + { + $this->removedLanguages = $removedLanguages; + + return $this; + } + + + public function build(): StoreLanguagesChangedMessagePayload + { + return new StoreLanguagesChangedMessagePayloadModel( + $this->addedLanguages, + $this->removedLanguages + ); + } + + public static function of(): StoreLanguagesChangedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessagePayloadCollection.php new file mode 100644 index 00000000000..22a49dd9ab9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method StoreLanguagesChangedMessagePayload current() + * @method StoreLanguagesChangedMessagePayload end() + * @method StoreLanguagesChangedMessagePayload at($offset) + */ +class StoreLanguagesChangedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert StoreLanguagesChangedMessagePayload $value + * @psalm-param StoreLanguagesChangedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return StoreLanguagesChangedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof StoreLanguagesChangedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StoreLanguagesChangedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?StoreLanguagesChangedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StoreLanguagesChangedMessagePayload $data */ + $data = StoreLanguagesChangedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessagePayloadModel.php new file mode 100644 index 00000000000..444f457526c --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreLanguagesChangedMessagePayloadModel.php @@ -0,0 +1,129 @@ +addedLanguages = $addedLanguages; + $this->removedLanguages = $removedLanguages; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Locales added to the Store after the Set Languages update action.

    + * + * + * @return null|array + */ + public function getAddedLanguages() + { + if (is_null($this->addedLanguages)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ADDED_LANGUAGES); + if (is_null($data)) { + return null; + } + $this->addedLanguages = $data; + } + + return $this->addedLanguages; + } + + /** + *

    Locales removed from the Store during the Set Languages update action.

    + * + * + * @return null|array + */ + public function getRemovedLanguages() + { + if (is_null($this->removedLanguages)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_REMOVED_LANGUAGES); + if (is_null($data)) { + return null; + } + $this->removedLanguages = $data; + } + + return $this->removedLanguages; + } + + + /** + * @param ?array $addedLanguages + */ + public function setAddedLanguages(?array $addedLanguages): void + { + $this->addedLanguages = $addedLanguages; + } + + /** + * @param ?array $removedLanguages + */ + public function setRemovedLanguages(?array $removedLanguages): void + { + $this->removedLanguages = $removedLanguages; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreNameSetMessage.php b/lib/commercetools-api/src/Models/Message/StoreNameSetMessage.php new file mode 100644 index 00000000000..ccc04e8710f --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreNameSetMessage.php @@ -0,0 +1,46 @@ +Name of the Store set during the Set Name update action.

    + * + + * @return null|LocalizedString + */ + public function getName(); + + /** + *

    Names set for the Store in different locales.

    + * + + * @return null|LocalizedStringCollection + */ + public function getNameAllLocales(); + + /** + * @param ?LocalizedString $name + */ + public function setName(?LocalizedString $name): void; + + /** + * @param ?LocalizedStringCollection $nameAllLocales + */ + public function setNameAllLocales(?LocalizedStringCollection $nameAllLocales): void; +} diff --git a/lib/commercetools-api/src/Models/Message/StoreNameSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StoreNameSetMessageBuilder.php new file mode 100644 index 00000000000..3c1d9ee2a9f --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreNameSetMessageBuilder.php @@ -0,0 +1,447 @@ + + */ +final class StoreNameSetMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|LocalizedString|LocalizedStringBuilder + */ + private $name; + + /** + + * @var ?LocalizedStringCollection + */ + private $nameAllLocales; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Name of the Store set during the Set Name update action.

    + * + + * @return null|LocalizedString + */ + public function getName() + { + return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name; + } + + /** + *

    Names set for the Store in different locales.

    + * + + * @return null|LocalizedStringCollection + */ + public function getNameAllLocales() + { + return $this->nameAllLocales; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?LocalizedString $name + * @return $this + */ + public function withName(?LocalizedString $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param ?LocalizedStringCollection $nameAllLocales + * @return $this + */ + public function withNameAllLocales(?LocalizedStringCollection $nameAllLocales) + { + $this->nameAllLocales = $nameAllLocales; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withName() instead + * @return $this + */ + public function withNameBuilder(?LocalizedStringBuilder $name) + { + $this->name = $name; + + return $this; + } + + public function build(): StoreNameSetMessage + { + return new StoreNameSetMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, + $this->nameAllLocales + ); + } + + public static function of(): StoreNameSetMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreNameSetMessageCollection.php b/lib/commercetools-api/src/Models/Message/StoreNameSetMessageCollection.php new file mode 100644 index 00000000000..d92111afce8 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreNameSetMessageCollection.php @@ -0,0 +1,56 @@ + + * @method StoreNameSetMessage current() + * @method StoreNameSetMessage end() + * @method StoreNameSetMessage at($offset) + */ +class StoreNameSetMessageCollection extends MessageCollection +{ + /** + * @psalm-assert StoreNameSetMessage $value + * @psalm-param StoreNameSetMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return StoreNameSetMessageCollection + */ + public function add($value) + { + if (!$value instanceof StoreNameSetMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StoreNameSetMessage + */ + protected function mapper() + { + return function (?int $index): ?StoreNameSetMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StoreNameSetMessage $data */ + $data = StoreNameSetMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreNameSetMessageModel.php b/lib/commercetools-api/src/Models/Message/StoreNameSetMessageModel.php new file mode 100644 index 00000000000..6c2f7296a9a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreNameSetMessageModel.php @@ -0,0 +1,530 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->name = $name; + $this->nameAllLocales = $nameAllLocales; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Name of the Store set during the Set Name update action.

    + * + * + * @return null|LocalizedString + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + + $this->name = LocalizedStringModel::of($data); + } + + return $this->name; + } + + /** + *

    Names set for the Store in different locales.

    + * + * + * @return null|LocalizedStringCollection + */ + public function getNameAllLocales() + { + if (is_null($this->nameAllLocales)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_NAME_ALL_LOCALES); + if (is_null($data)) { + return null; + } + $this->nameAllLocales = LocalizedStringCollection::fromArray($data); + } + + return $this->nameAllLocales; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?LocalizedString $name + */ + public function setName(?LocalizedString $name): void + { + $this->name = $name; + } + + /** + * @param ?LocalizedStringCollection $nameAllLocales + */ + public function setNameAllLocales(?LocalizedStringCollection $nameAllLocales): void + { + $this->nameAllLocales = $nameAllLocales; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreNameSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/StoreNameSetMessagePayload.php new file mode 100644 index 00000000000..4b7e998b9a4 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreNameSetMessagePayload.php @@ -0,0 +1,46 @@ +Name of the Store set during the Set Name update action.

    + * + + * @return null|LocalizedString + */ + public function getName(); + + /** + *

    Names set for the Store in different locales.

    + * + + * @return null|LocalizedStringCollection + */ + public function getNameAllLocales(); + + /** + * @param ?LocalizedString $name + */ + public function setName(?LocalizedString $name): void; + + /** + * @param ?LocalizedStringCollection $nameAllLocales + */ + public function setNameAllLocales(?LocalizedStringCollection $nameAllLocales): void; +} diff --git a/lib/commercetools-api/src/Models/Message/StoreNameSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StoreNameSetMessagePayloadBuilder.php new file mode 100644 index 00000000000..c571d7298cf --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreNameSetMessagePayloadBuilder.php @@ -0,0 +1,105 @@ + + */ +final class StoreNameSetMessagePayloadBuilder implements Builder +{ + /** + + * @var null|LocalizedString|LocalizedStringBuilder + */ + private $name; + + /** + + * @var ?LocalizedStringCollection + */ + private $nameAllLocales; + + /** + *

    Name of the Store set during the Set Name update action.

    + * + + * @return null|LocalizedString + */ + public function getName() + { + return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name; + } + + /** + *

    Names set for the Store in different locales.

    + * + + * @return null|LocalizedStringCollection + */ + public function getNameAllLocales() + { + return $this->nameAllLocales; + } + + /** + * @param ?LocalizedString $name + * @return $this + */ + public function withName(?LocalizedString $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param ?LocalizedStringCollection $nameAllLocales + * @return $this + */ + public function withNameAllLocales(?LocalizedStringCollection $nameAllLocales) + { + $this->nameAllLocales = $nameAllLocales; + + return $this; + } + + /** + * @deprecated use withName() instead + * @return $this + */ + public function withNameBuilder(?LocalizedStringBuilder $name) + { + $this->name = $name; + + return $this; + } + + public function build(): StoreNameSetMessagePayload + { + return new StoreNameSetMessagePayloadModel( + $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, + $this->nameAllLocales + ); + } + + public static function of(): StoreNameSetMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreNameSetMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/StoreNameSetMessagePayloadCollection.php new file mode 100644 index 00000000000..425cc599b6c --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreNameSetMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method StoreNameSetMessagePayload current() + * @method StoreNameSetMessagePayload end() + * @method StoreNameSetMessagePayload at($offset) + */ +class StoreNameSetMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert StoreNameSetMessagePayload $value + * @psalm-param StoreNameSetMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return StoreNameSetMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof StoreNameSetMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StoreNameSetMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?StoreNameSetMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StoreNameSetMessagePayload $data */ + $data = StoreNameSetMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreNameSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StoreNameSetMessagePayloadModel.php new file mode 100644 index 00000000000..435ff297323 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreNameSetMessagePayloadModel.php @@ -0,0 +1,133 @@ +name = $name; + $this->nameAllLocales = $nameAllLocales; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Name of the Store set during the Set Name update action.

    + * + * + * @return null|LocalizedString + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + + $this->name = LocalizedStringModel::of($data); + } + + return $this->name; + } + + /** + *

    Names set for the Store in different locales.

    + * + * + * @return null|LocalizedStringCollection + */ + public function getNameAllLocales() + { + if (is_null($this->nameAllLocales)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_NAME_ALL_LOCALES); + if (is_null($data)) { + return null; + } + $this->nameAllLocales = LocalizedStringCollection::fromArray($data); + } + + return $this->nameAllLocales; + } + + + /** + * @param ?LocalizedString $name + */ + public function setName(?LocalizedString $name): void + { + $this->name = $name; + } + + /** + * @param ?LocalizedStringCollection $nameAllLocales + */ + public function setNameAllLocales(?LocalizedStringCollection $nameAllLocales): void + { + $this->nameAllLocales = $nameAllLocales; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessage.php b/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessage.php index 753798485dc..037afcd15ef 100644 --- a/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessage.php +++ b/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessage.php @@ -19,16 +19,25 @@ interface StoreProductSelectionsChangedMessage extends Message public const FIELD_UPDATED_PRODUCT_SELECTIONS = 'updatedProductSelections'; /** + *

    ProductSelectionSettings that were added to the Store.

    + * + * @return null|ProductSelectionSettingCollection */ public function getAddedProductSelections(); /** + *

    ProductSelectionSettings that were removed from the Store.

    + * + * @return null|ProductSelectionSettingCollection */ public function getRemovedProductSelections(); /** + *

    ProductSelectionSettings that were updated in the Store.

    + * + * @return null|ProductSelectionSettingCollection */ public function getUpdatedProductSelections(); diff --git a/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessageBuilder.php index 5aa46d6db47..565d06fa952 100644 --- a/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessageBuilder.php @@ -29,73 +29,87 @@ final class StoreProductSelectionsChangedMessageBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?int */ private $sequenceNumber; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?int */ private $resourceVersion; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?ProductSelectionSettingCollection */ private $addedProductSelections; /** + * @var ?ProductSelectionSettingCollection */ private $removedProductSelections; /** + * @var ?ProductSelectionSettingCollection */ private $updatedProductSelections; /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    * + * @return null|string */ public function getId() @@ -104,6 +118,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * @return null|int */ public function getVersion() @@ -112,6 +129,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -120,6 +140,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -128,8 +151,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -140,6 +164,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -148,6 +173,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * @return null|int */ public function getSequenceNumber() @@ -156,8 +185,9 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    * + * @return null|Reference */ public function getResource() @@ -166,6 +196,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -174,6 +207,9 @@ public function getResourceVersion() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -182,6 +218,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    ProductSelectionSettings that were added to the Store.

    + * + * @return null|ProductSelectionSettingCollection */ public function getAddedProductSelections() @@ -190,6 +229,9 @@ public function getAddedProductSelections() } /** + *

    ProductSelectionSettings that were removed from the Store.

    + * + * @return null|ProductSelectionSettingCollection */ public function getRemovedProductSelections() @@ -198,6 +240,9 @@ public function getRemovedProductSelections() } /** + *

    ProductSelectionSettings that were updated in the Store.

    + * + * @return null|ProductSelectionSettingCollection */ public function getUpdatedProductSelections() diff --git a/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessageModel.php index 0faad9d15b0..89b65228add 100644 --- a/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessageModel.php @@ -29,71 +29,85 @@ final class StoreProductSelectionsChangedMessageModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'StoreProductSelectionsChanged'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?ProductSelectionSettingCollection */ protected $addedProductSelections; /** + * * @var ?ProductSelectionSettingCollection */ protected $removedProductSelections; /** + * * @var ?ProductSelectionSettingCollection */ protected $updatedProductSelections; @@ -115,7 +129,8 @@ public function __construct( ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?ProductSelectionSettingCollection $addedProductSelections = null, ?ProductSelectionSettingCollection $removedProductSelections = null, - ?ProductSelectionSettingCollection $updatedProductSelections = null + ?ProductSelectionSettingCollection $updatedProductSelections = null, + ?string $type = null ) { $this->id = $id; $this->version = $version; @@ -130,11 +145,12 @@ public function __construct( $this->addedProductSelections = $addedProductSelections; $this->removedProductSelections = $removedProductSelections; $this->updatedProductSelections = $updatedProductSelections; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** - *

    Unique identifier of the Message.

    + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * * * @return null|string */ @@ -153,6 +169,9 @@ public function getId() } /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * * @return null|int */ public function getVersion() @@ -170,6 +189,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Message was generated.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -191,6 +213,9 @@ public function getCreatedAt() } /** + *

    Value of createdAt.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -212,7 +237,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Value of createdBy.

    + * * * @return null|LastModifiedBy */ @@ -234,6 +260,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -252,6 +279,10 @@ public function getCreatedBy() } /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -269,7 +300,8 @@ public function getSequenceNumber() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource on which the change or action was performed.

    + * * * @return null|Reference */ @@ -289,6 +321,9 @@ public function getResource() } /** + *

    Version of the resource on which the change or action was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -306,6 +341,9 @@ public function getResourceVersion() } /** + *

    Message Type of the Message.

    + * + * * @return null|string */ public function getType() @@ -323,6 +361,9 @@ public function getType() } /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -341,6 +382,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    ProductSelectionSettings that were added to the Store.

    + * + * * @return null|ProductSelectionSettingCollection */ public function getAddedProductSelections() @@ -358,6 +402,9 @@ public function getAddedProductSelections() } /** + *

    ProductSelectionSettings that were removed from the Store.

    + * + * * @return null|ProductSelectionSettingCollection */ public function getRemovedProductSelections() @@ -375,6 +422,9 @@ public function getRemovedProductSelections() } /** + *

    ProductSelectionSettings that were updated in the Store.

    + * + * * @return null|ProductSelectionSettingCollection */ public function getUpdatedProductSelections() diff --git a/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessagePayload.php index 99b8f46b759..3af9a27051e 100644 --- a/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessagePayload.php @@ -19,16 +19,25 @@ interface StoreProductSelectionsChangedMessagePayload extends MessagePayload public const FIELD_UPDATED_PRODUCT_SELECTIONS = 'updatedProductSelections'; /** + *

    ProductSelectionSettings that were added to the Store.

    + * + * @return null|ProductSelectionSettingCollection */ public function getAddedProductSelections(); /** + *

    ProductSelectionSettings that were removed from the Store.

    + * + * @return null|ProductSelectionSettingCollection */ public function getRemovedProductSelections(); /** + *

    ProductSelectionSettings that were updated in the Store.

    + * + * @return null|ProductSelectionSettingCollection */ public function getUpdatedProductSelections(); diff --git a/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessagePayloadBuilder.php index 1b571dbb927..d660d08f4a1 100644 --- a/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessagePayloadBuilder.php @@ -22,21 +22,27 @@ final class StoreProductSelectionsChangedMessagePayloadBuilder implements Builder { /** + * @var ?ProductSelectionSettingCollection */ private $addedProductSelections; /** + * @var ?ProductSelectionSettingCollection */ private $removedProductSelections; /** + * @var ?ProductSelectionSettingCollection */ private $updatedProductSelections; /** + *

    ProductSelectionSettings that were added to the Store.

    + * + * @return null|ProductSelectionSettingCollection */ public function getAddedProductSelections() @@ -45,6 +51,9 @@ public function getAddedProductSelections() } /** + *

    ProductSelectionSettings that were removed from the Store.

    + * + * @return null|ProductSelectionSettingCollection */ public function getRemovedProductSelections() @@ -53,6 +62,9 @@ public function getRemovedProductSelections() } /** + *

    ProductSelectionSettings that were updated in the Store.

    + * + * @return null|ProductSelectionSettingCollection */ public function getUpdatedProductSelections() diff --git a/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessagePayloadModel.php index ff538decb0a..19dc6940685 100644 --- a/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/StoreProductSelectionsChangedMessagePayloadModel.php @@ -22,21 +22,25 @@ final class StoreProductSelectionsChangedMessagePayloadModel extends JsonObjectM { public const DISCRIMINATOR_VALUE = 'StoreProductSelectionsChanged'; /** + * * @var ?string */ protected $type; /** + * * @var ?ProductSelectionSettingCollection */ protected $addedProductSelections; /** + * * @var ?ProductSelectionSettingCollection */ protected $removedProductSelections; /** + * * @var ?ProductSelectionSettingCollection */ protected $updatedProductSelections; @@ -48,15 +52,17 @@ final class StoreProductSelectionsChangedMessagePayloadModel extends JsonObjectM public function __construct( ?ProductSelectionSettingCollection $addedProductSelections = null, ?ProductSelectionSettingCollection $removedProductSelections = null, - ?ProductSelectionSettingCollection $updatedProductSelections = null + ?ProductSelectionSettingCollection $updatedProductSelections = null, + ?string $type = null ) { $this->addedProductSelections = $addedProductSelections; $this->removedProductSelections = $removedProductSelections; $this->updatedProductSelections = $updatedProductSelections; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -74,6 +80,9 @@ public function getType() } /** + *

    ProductSelectionSettings that were added to the Store.

    + * + * * @return null|ProductSelectionSettingCollection */ public function getAddedProductSelections() @@ -91,6 +100,9 @@ public function getAddedProductSelections() } /** + *

    ProductSelectionSettings that were removed from the Store.

    + * + * * @return null|ProductSelectionSettingCollection */ public function getRemovedProductSelections() @@ -108,6 +120,9 @@ public function getRemovedProductSelections() } /** + *

    ProductSelectionSettings that were updated in the Store.

    + * + * * @return null|ProductSelectionSettingCollection */ public function getUpdatedProductSelections() diff --git a/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessage.php b/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessage.php new file mode 100644 index 00000000000..9194042ff71 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessage.php @@ -0,0 +1,45 @@ +Inventory supply Channels that have been added to the Store.

    + * + + * @return null|ChannelReferenceCollection + */ + public function getAddedSupplyChannels(); + + /** + *

    Inventory supply Channels that have been removed from the Store.

    + * + + * @return null|ChannelReferenceCollection + */ + public function getRemovedSupplyChannels(); + + /** + * @param ?ChannelReferenceCollection $addedSupplyChannels + */ + public function setAddedSupplyChannels(?ChannelReferenceCollection $addedSupplyChannels): void; + + /** + * @param ?ChannelReferenceCollection $removedSupplyChannels + */ + public function setRemovedSupplyChannels(?ChannelReferenceCollection $removedSupplyChannels): void; +} diff --git a/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessageBuilder.php new file mode 100644 index 00000000000..49177a60e07 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessageBuilder.php @@ -0,0 +1,434 @@ + + */ +final class StoreSupplyChannelsChangedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?ChannelReferenceCollection + */ + private $addedSupplyChannels; + + /** + + * @var ?ChannelReferenceCollection + */ + private $removedSupplyChannels; + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Inventory supply Channels that have been added to the Store.

    + * + + * @return null|ChannelReferenceCollection + */ + public function getAddedSupplyChannels() + { + return $this->addedSupplyChannels; + } + + /** + *

    Inventory supply Channels that have been removed from the Store.

    + * + + * @return null|ChannelReferenceCollection + */ + public function getRemovedSupplyChannels() + { + return $this->removedSupplyChannels; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?ChannelReferenceCollection $addedSupplyChannels + * @return $this + */ + public function withAddedSupplyChannels(?ChannelReferenceCollection $addedSupplyChannels) + { + $this->addedSupplyChannels = $addedSupplyChannels; + + return $this; + } + + /** + * @param ?ChannelReferenceCollection $removedSupplyChannels + * @return $this + */ + public function withRemovedSupplyChannels(?ChannelReferenceCollection $removedSupplyChannels) + { + $this->removedSupplyChannels = $removedSupplyChannels; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): StoreSupplyChannelsChangedMessage + { + return new StoreSupplyChannelsChangedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->addedSupplyChannels, + $this->removedSupplyChannels + ); + } + + public static function of(): StoreSupplyChannelsChangedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessageCollection.php b/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessageCollection.php new file mode 100644 index 00000000000..e3a4faf7576 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method StoreSupplyChannelsChangedMessage current() + * @method StoreSupplyChannelsChangedMessage end() + * @method StoreSupplyChannelsChangedMessage at($offset) + */ +class StoreSupplyChannelsChangedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert StoreSupplyChannelsChangedMessage $value + * @psalm-param StoreSupplyChannelsChangedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return StoreSupplyChannelsChangedMessageCollection + */ + public function add($value) + { + if (!$value instanceof StoreSupplyChannelsChangedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StoreSupplyChannelsChangedMessage + */ + protected function mapper() + { + return function (?int $index): ?StoreSupplyChannelsChangedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StoreSupplyChannelsChangedMessage $data */ + $data = StoreSupplyChannelsChangedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessageModel.php new file mode 100644 index 00000000000..53894ddb070 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessageModel.php @@ -0,0 +1,527 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->addedSupplyChannels = $addedSupplyChannels; + $this->removedSupplyChannels = $removedSupplyChannels; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    Unique identifier of the Message. Can be used to track which Messages have been processed.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Version of a resource. In case of Messages, this is always 1.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

    Date and time (UTC) the Message was generated.

    + * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

    Value of createdAt.

    + * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

    Value of createdBy.

    + * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

    Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

    + * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

    Reference to the resource on which the change or action was performed.

    + * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

    Version of the resource on which the change or action was performed.

    + * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

    Message Type of the Message.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

    + * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

    Inventory supply Channels that have been added to the Store.

    + * + * + * @return null|ChannelReferenceCollection + */ + public function getAddedSupplyChannels() + { + if (is_null($this->addedSupplyChannels)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ADDED_SUPPLY_CHANNELS); + if (is_null($data)) { + return null; + } + $this->addedSupplyChannels = ChannelReferenceCollection::fromArray($data); + } + + return $this->addedSupplyChannels; + } + + /** + *

    Inventory supply Channels that have been removed from the Store.

    + * + * + * @return null|ChannelReferenceCollection + */ + public function getRemovedSupplyChannels() + { + if (is_null($this->removedSupplyChannels)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_REMOVED_SUPPLY_CHANNELS); + if (is_null($data)) { + return null; + } + $this->removedSupplyChannels = ChannelReferenceCollection::fromArray($data); + } + + return $this->removedSupplyChannels; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?ChannelReferenceCollection $addedSupplyChannels + */ + public function setAddedSupplyChannels(?ChannelReferenceCollection $addedSupplyChannels): void + { + $this->addedSupplyChannels = $addedSupplyChannels; + } + + /** + * @param ?ChannelReferenceCollection $removedSupplyChannels + */ + public function setRemovedSupplyChannels(?ChannelReferenceCollection $removedSupplyChannels): void + { + $this->removedSupplyChannels = $removedSupplyChannels; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessagePayload.php new file mode 100644 index 00000000000..9f99d9a6b5d --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessagePayload.php @@ -0,0 +1,45 @@ +Inventory supply Channels that have been added to the Store.

    + * + + * @return null|ChannelReferenceCollection + */ + public function getAddedSupplyChannels(); + + /** + *

    Inventory supply Channels that have been removed from the Store.

    + * + + * @return null|ChannelReferenceCollection + */ + public function getRemovedSupplyChannels(); + + /** + * @param ?ChannelReferenceCollection $addedSupplyChannels + */ + public function setAddedSupplyChannels(?ChannelReferenceCollection $addedSupplyChannels): void; + + /** + * @param ?ChannelReferenceCollection $removedSupplyChannels + */ + public function setRemovedSupplyChannels(?ChannelReferenceCollection $removedSupplyChannels): void; +} diff --git a/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessagePayloadBuilder.php new file mode 100644 index 00000000000..470d57808f2 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessagePayloadBuilder.php @@ -0,0 +1,93 @@ + + */ +final class StoreSupplyChannelsChangedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?ChannelReferenceCollection + */ + private $addedSupplyChannels; + + /** + + * @var ?ChannelReferenceCollection + */ + private $removedSupplyChannels; + + /** + *

    Inventory supply Channels that have been added to the Store.

    + * + + * @return null|ChannelReferenceCollection + */ + public function getAddedSupplyChannels() + { + return $this->addedSupplyChannels; + } + + /** + *

    Inventory supply Channels that have been removed from the Store.

    + * + + * @return null|ChannelReferenceCollection + */ + public function getRemovedSupplyChannels() + { + return $this->removedSupplyChannels; + } + + /** + * @param ?ChannelReferenceCollection $addedSupplyChannels + * @return $this + */ + public function withAddedSupplyChannels(?ChannelReferenceCollection $addedSupplyChannels) + { + $this->addedSupplyChannels = $addedSupplyChannels; + + return $this; + } + + /** + * @param ?ChannelReferenceCollection $removedSupplyChannels + * @return $this + */ + public function withRemovedSupplyChannels(?ChannelReferenceCollection $removedSupplyChannels) + { + $this->removedSupplyChannels = $removedSupplyChannels; + + return $this; + } + + + public function build(): StoreSupplyChannelsChangedMessagePayload + { + return new StoreSupplyChannelsChangedMessagePayloadModel( + $this->addedSupplyChannels, + $this->removedSupplyChannels + ); + } + + public static function of(): StoreSupplyChannelsChangedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessagePayloadCollection.php new file mode 100644 index 00000000000..5c18bb4ce34 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method StoreSupplyChannelsChangedMessagePayload current() + * @method StoreSupplyChannelsChangedMessagePayload end() + * @method StoreSupplyChannelsChangedMessagePayload at($offset) + */ +class StoreSupplyChannelsChangedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert StoreSupplyChannelsChangedMessagePayload $value + * @psalm-param StoreSupplyChannelsChangedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return StoreSupplyChannelsChangedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof StoreSupplyChannelsChangedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StoreSupplyChannelsChangedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?StoreSupplyChannelsChangedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StoreSupplyChannelsChangedMessagePayload $data */ + $data = StoreSupplyChannelsChangedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessagePayloadModel.php new file mode 100644 index 00000000000..28fb735ad00 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StoreSupplyChannelsChangedMessagePayloadModel.php @@ -0,0 +1,130 @@ +addedSupplyChannels = $addedSupplyChannels; + $this->removedSupplyChannels = $removedSupplyChannels; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Inventory supply Channels that have been added to the Store.

    + * + * + * @return null|ChannelReferenceCollection + */ + public function getAddedSupplyChannels() + { + if (is_null($this->addedSupplyChannels)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ADDED_SUPPLY_CHANNELS); + if (is_null($data)) { + return null; + } + $this->addedSupplyChannels = ChannelReferenceCollection::fromArray($data); + } + + return $this->addedSupplyChannels; + } + + /** + *

    Inventory supply Channels that have been removed from the Store.

    + * + * + * @return null|ChannelReferenceCollection + */ + public function getRemovedSupplyChannels() + { + if (is_null($this->removedSupplyChannels)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_REMOVED_SUPPLY_CHANNELS); + if (is_null($data)) { + return null; + } + $this->removedSupplyChannels = ChannelReferenceCollection::fromArray($data); + } + + return $this->removedSupplyChannels; + } + + + /** + * @param ?ChannelReferenceCollection $addedSupplyChannels + */ + public function setAddedSupplyChannels(?ChannelReferenceCollection $addedSupplyChannels): void + { + $this->addedSupplyChannels = $addedSupplyChannels; + } + + /** + * @param ?ChannelReferenceCollection $removedSupplyChannels + */ + public function setRemovedSupplyChannels(?ChannelReferenceCollection $removedSupplyChannels): void + { + $this->removedSupplyChannels = $removedSupplyChannels; + } +} diff --git a/lib/commercetools-api/src/Models/Message/UserProvidedIdentifiers.php b/lib/commercetools-api/src/Models/Message/UserProvidedIdentifiers.php index 9fbdb697de0..15af6b6c7f7 100644 --- a/lib/commercetools-api/src/Models/Message/UserProvidedIdentifiers.php +++ b/lib/commercetools-api/src/Models/Message/UserProvidedIdentifiers.php @@ -25,40 +25,55 @@ interface UserProvidedIdentifiers extends JsonObject /** *

    User-provided unique identifier of the resource.

    * + * @return null|string */ public function getKey(); /** + *

    User-provided unique identifier of the resource.

    + * + * @return null|string */ public function getExternalId(); /** + *

    User-provided unique identifier of an Order.

    + * + * @return null|string */ public function getOrderNumber(); /** + *

    User-provided unique identifier of a Customer.

    + * + * @return null|string */ public function getCustomerNumber(); /** + *

    Unique SKU of a Product Variant.

    + * + * @return null|string */ public function getSku(); /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Unique identifier usually used in deep-link URLs for a Product. The value corresponds to the slug in the current Product Projection.

    * + * @return null|LocalizedString */ public function getSlug(); /** - *

    Custom Objects are grouped into containers, which can be used like namespaces. Within a given container, a user-defined key can be used to uniquely identify resources.

    + *

    Unique identifier of a Custom Object.

    * + * @return null|ContainerAndKey */ public function getContainerAndKey(); diff --git a/lib/commercetools-api/src/Models/Message/UserProvidedIdentifiersBuilder.php b/lib/commercetools-api/src/Models/Message/UserProvidedIdentifiersBuilder.php index 534416343a5..c94a9ee6851 100644 --- a/lib/commercetools-api/src/Models/Message/UserProvidedIdentifiersBuilder.php +++ b/lib/commercetools-api/src/Models/Message/UserProvidedIdentifiersBuilder.php @@ -23,36 +23,43 @@ final class UserProvidedIdentifiersBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $externalId; /** + * @var ?string */ private $orderNumber; /** + * @var ?string */ private $customerNumber; /** + * @var ?string */ private $sku; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @var null|ContainerAndKey|ContainerAndKeyBuilder */ private $containerAndKey; @@ -60,6 +67,7 @@ final class UserProvidedIdentifiersBuilder implements Builder /** *

    User-provided unique identifier of the resource.

    * + * @return null|string */ public function getKey() @@ -68,6 +76,9 @@ public function getKey() } /** + *

    User-provided unique identifier of the resource.

    + * + * @return null|string */ public function getExternalId() @@ -76,6 +87,9 @@ public function getExternalId() } /** + *

    User-provided unique identifier of an Order.

    + * + * @return null|string */ public function getOrderNumber() @@ -84,6 +98,9 @@ public function getOrderNumber() } /** + *

    User-provided unique identifier of a Customer.

    + * + * @return null|string */ public function getCustomerNumber() @@ -92,6 +109,9 @@ public function getCustomerNumber() } /** + *

    Unique SKU of a Product Variant.

    + * + * @return null|string */ public function getSku() @@ -100,8 +120,9 @@ public function getSku() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Unique identifier usually used in deep-link URLs for a Product. The value corresponds to the slug in the current Product Projection.

    * + * @return null|LocalizedString */ public function getSlug() @@ -110,8 +131,9 @@ public function getSlug() } /** - *

    Custom Objects are grouped into containers, which can be used like namespaces. Within a given container, a user-defined key can be used to uniquely identify resources.

    + *

    Unique identifier of a Custom Object.

    * + * @return null|ContainerAndKey */ public function getContainerAndKey() diff --git a/lib/commercetools-api/src/Models/Message/UserProvidedIdentifiersModel.php b/lib/commercetools-api/src/Models/Message/UserProvidedIdentifiersModel.php index cc17cc83078..ee11b6df2c9 100644 --- a/lib/commercetools-api/src/Models/Message/UserProvidedIdentifiersModel.php +++ b/lib/commercetools-api/src/Models/Message/UserProvidedIdentifiersModel.php @@ -22,36 +22,43 @@ final class UserProvidedIdentifiersModel extends JsonObjectModel implements UserProvidedIdentifiers { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $externalId; /** + * * @var ?string */ protected $orderNumber; /** + * * @var ?string */ protected $customerNumber; /** + * * @var ?string */ protected $sku; /** + * * @var ?LocalizedString */ protected $slug; /** + * * @var ?ContainerAndKey */ protected $containerAndKey; @@ -81,6 +88,7 @@ public function __construct( /** *

    User-provided unique identifier of the resource.

    * + * * @return null|string */ public function getKey() @@ -98,6 +106,9 @@ public function getKey() } /** + *

    User-provided unique identifier of the resource.

    + * + * * @return null|string */ public function getExternalId() @@ -115,6 +126,9 @@ public function getExternalId() } /** + *

    User-provided unique identifier of an Order.

    + * + * * @return null|string */ public function getOrderNumber() @@ -132,6 +146,9 @@ public function getOrderNumber() } /** + *

    User-provided unique identifier of a Customer.

    + * + * * @return null|string */ public function getCustomerNumber() @@ -149,6 +166,9 @@ public function getCustomerNumber() } /** + *

    Unique SKU of a Product Variant.

    + * + * * @return null|string */ public function getSku() @@ -166,7 +186,8 @@ public function getSku() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Unique identifier usually used in deep-link URLs for a Product. The value corresponds to the slug in the current Product Projection.

    + * * * @return null|LocalizedString */ @@ -186,7 +207,8 @@ public function getSlug() } /** - *

    Custom Objects are grouped into containers, which can be used like namespaces. Within a given container, a user-defined key can be used to uniquely identify resources.

    + *

    Unique identifier of a Custom Object.

    + * * * @return null|ContainerAndKey */ diff --git a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItem.php b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItem.php index 6890217e18c..bae6094349c 100644 --- a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItem.php +++ b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItem.php @@ -16,6 +16,7 @@ interface CustomLineItemReturnItem extends ReturnItem public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; /** + * @return null|string */ public function getCustomLineItemId(); diff --git a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemBuilder.php b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemBuilder.php index 46eb3b2690f..7a33f9223d4 100644 --- a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemBuilder.php +++ b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemBuilder.php @@ -24,46 +24,55 @@ final class CustomLineItemReturnItemBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $quantity; /** + * @var ?string */ private $comment; /** + * @var ?string */ private $shipmentState; /** + * @var ?string */ private $paymentState; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?string */ private $customLineItemId; @@ -71,6 +80,7 @@ final class CustomLineItemReturnItemBuilder implements Builder /** *

    Unique identifier of the ReturnItem.

    * + * @return null|string */ public function getId() @@ -79,6 +89,7 @@ public function getId() } /** + * @return null|int */ public function getQuantity() @@ -87,6 +98,7 @@ public function getQuantity() } /** + * @return null|string */ public function getComment() @@ -95,6 +107,7 @@ public function getComment() } /** + * @return null|string */ public function getShipmentState() @@ -103,6 +116,7 @@ public function getShipmentState() } /** + * @return null|string */ public function getPaymentState() @@ -113,6 +127,7 @@ public function getPaymentState() /** *

    Custom Fields of this return item.

    * + * @return null|CustomFields */ public function getCustom() @@ -121,6 +136,7 @@ public function getCustom() } /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -129,6 +145,7 @@ public function getLastModifiedAt() } /** + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -137,6 +154,7 @@ public function getCreatedAt() } /** + * @return null|string */ public function getCustomLineItemId() diff --git a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemModel.php b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemModel.php index aece9ba3d2f..cc1c9e1050a 100644 --- a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemModel.php +++ b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemModel.php @@ -24,51 +24,61 @@ final class CustomLineItemReturnItemModel extends JsonObjectModel implements Cus { public const DISCRIMINATOR_VALUE = 'CustomLineItemReturnItem'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $quantity; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $comment; /** + * * @var ?string */ protected $shipmentState; /** + * * @var ?string */ protected $paymentState; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?string */ protected $customLineItemId; @@ -86,7 +96,8 @@ public function __construct( ?CustomFields $custom = null, ?DateTimeImmutable $lastModifiedAt = null, ?DateTimeImmutable $createdAt = null, - ?string $customLineItemId = null + ?string $customLineItemId = null, + ?string $type = null ) { $this->id = $id; $this->quantity = $quantity; @@ -97,12 +108,13 @@ public function __construct( $this->lastModifiedAt = $lastModifiedAt; $this->createdAt = $createdAt; $this->customLineItemId = $customLineItemId; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    Unique identifier of the ReturnItem.

    * + * * @return null|string */ public function getId() @@ -120,6 +132,7 @@ public function getId() } /** + * * @return null|int */ public function getQuantity() @@ -137,6 +150,7 @@ public function getQuantity() } /** + * * @return null|string */ public function getType() @@ -154,6 +168,7 @@ public function getType() } /** + * * @return null|string */ public function getComment() @@ -171,6 +186,7 @@ public function getComment() } /** + * * @return null|string */ public function getShipmentState() @@ -188,6 +204,7 @@ public function getShipmentState() } /** + * * @return null|string */ public function getPaymentState() @@ -207,6 +224,7 @@ public function getPaymentState() /** *

    Custom Fields of this return item.

    * + * * @return null|CustomFields */ public function getCustom() @@ -225,6 +243,7 @@ public function getCustom() } /** + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -246,6 +265,7 @@ public function getLastModifiedAt() } /** + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -267,6 +287,7 @@ public function getCreatedAt() } /** + * * @return null|string */ public function getCustomLineItemId() diff --git a/lib/commercetools-api/src/Models/Order/Delivery.php b/lib/commercetools-api/src/Models/Order/Delivery.php index 15bc6e53315..4d7708393d0 100644 --- a/lib/commercetools-api/src/Models/Order/Delivery.php +++ b/lib/commercetools-api/src/Models/Order/Delivery.php @@ -26,11 +26,13 @@ interface Delivery extends JsonObject /** *

    Unique identifier of the Delivery.

    * + * @return null|string */ public function getId(); /** + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -39,16 +41,19 @@ public function getCreatedAt(); *

    Items which are shipped in this delivery regardless their distribution over several parcels. * Can also be specified individually for each Parcel.

    * + * @return null|DeliveryItemCollection */ public function getItems(); /** + * @return null|ParcelCollection */ public function getParcels(); /** + * @return null|Address */ public function getAddress(); @@ -56,6 +61,7 @@ public function getAddress(); /** *

    Custom Fields for the Transaction.

    * + * @return null|CustomFields */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Order/DeliveryBuilder.php b/lib/commercetools-api/src/Models/Order/DeliveryBuilder.php index ccbbfc2f4e9..6c885ddd9ff 100644 --- a/lib/commercetools-api/src/Models/Order/DeliveryBuilder.php +++ b/lib/commercetools-api/src/Models/Order/DeliveryBuilder.php @@ -26,31 +26,37 @@ final class DeliveryBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @var ?ParcelCollection */ private $parcels; /** + * @var null|Address|AddressBuilder */ private $address; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; @@ -58,6 +64,7 @@ final class DeliveryBuilder implements Builder /** *

    Unique identifier of the Delivery.

    * + * @return null|string */ public function getId() @@ -66,6 +73,7 @@ public function getId() } /** + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -77,6 +85,7 @@ public function getCreatedAt() *

    Items which are shipped in this delivery regardless their distribution over several parcels. * Can also be specified individually for each Parcel.

    * + * @return null|DeliveryItemCollection */ public function getItems() @@ -85,6 +94,7 @@ public function getItems() } /** + * @return null|ParcelCollection */ public function getParcels() @@ -93,6 +103,7 @@ public function getParcels() } /** + * @return null|Address */ public function getAddress() @@ -103,6 +114,7 @@ public function getAddress() /** *

    Custom Fields for the Transaction.

    * + * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Order/DeliveryDraft.php b/lib/commercetools-api/src/Models/Order/DeliveryDraft.php new file mode 100644 index 00000000000..31847289fca --- /dev/null +++ b/lib/commercetools-api/src/Models/Order/DeliveryDraft.php @@ -0,0 +1,71 @@ +Items which are shipped in this delivery regardless their distribution over several parcels. + * Can also be specified individually for each Parcel.

    + * + + * @return null|DeliveryItemCollection + */ + public function getItems(); + + /** + + * @return null|ParcelDraftCollection + */ + public function getParcels(); + + /** + + * @return null|AddressDraft + */ + public function getAddress(); + + /** + *

    Custom Fields for the Transaction.

    + * + + * @return null|CustomFieldsDraft + */ + public function getCustom(); + + /** + * @param ?DeliveryItemCollection $items + */ + public function setItems(?DeliveryItemCollection $items): void; + + /** + * @param ?ParcelDraftCollection $parcels + */ + public function setParcels(?ParcelDraftCollection $parcels): void; + + /** + * @param ?AddressDraft $address + */ + public function setAddress(?AddressDraft $address): void; + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void; +} diff --git a/lib/commercetools-api/src/Models/Order/DeliveryDraftBuilder.php b/lib/commercetools-api/src/Models/Order/DeliveryDraftBuilder.php new file mode 100644 index 00000000000..3b424501991 --- /dev/null +++ b/lib/commercetools-api/src/Models/Order/DeliveryDraftBuilder.php @@ -0,0 +1,172 @@ + + */ +final class DeliveryDraftBuilder implements Builder +{ + /** + + * @var ?DeliveryItemCollection + */ + private $items; + + /** + + * @var ?ParcelDraftCollection + */ + private $parcels; + + /** + + * @var null|AddressDraft|AddressDraftBuilder + */ + private $address; + + /** + + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + */ + private $custom; + + /** + *

    Items which are shipped in this delivery regardless their distribution over several parcels. + * Can also be specified individually for each Parcel.

    + * + + * @return null|DeliveryItemCollection + */ + public function getItems() + { + return $this->items; + } + + /** + + * @return null|ParcelDraftCollection + */ + public function getParcels() + { + return $this->parcels; + } + + /** + + * @return null|AddressDraft + */ + public function getAddress() + { + return $this->address instanceof AddressDraftBuilder ? $this->address->build() : $this->address; + } + + /** + *

    Custom Fields for the Transaction.

    + * + + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; + } + + /** + * @param ?DeliveryItemCollection $items + * @return $this + */ + public function withItems(?DeliveryItemCollection $items) + { + $this->items = $items; + + return $this; + } + + /** + * @param ?ParcelDraftCollection $parcels + * @return $this + */ + public function withParcels(?ParcelDraftCollection $parcels) + { + $this->parcels = $parcels; + + return $this; + } + + /** + * @param ?AddressDraft $address + * @return $this + */ + public function withAddress(?AddressDraft $address) + { + $this->address = $address; + + return $this; + } + + /** + * @param ?CustomFieldsDraft $custom + * @return $this + */ + public function withCustom(?CustomFieldsDraft $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @deprecated use withAddress() instead + * @return $this + */ + public function withAddressBuilder(?AddressDraftBuilder $address) + { + $this->address = $address; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + + public function build(): DeliveryDraft + { + return new DeliveryDraftModel( + $this->items, + $this->parcels, + $this->address instanceof AddressDraftBuilder ? $this->address->build() : $this->address, + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom + ); + } + + public static function of(): DeliveryDraftBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Order/DeliveryDraftCollection.php b/lib/commercetools-api/src/Models/Order/DeliveryDraftCollection.php new file mode 100644 index 00000000000..c52d99b3977 --- /dev/null +++ b/lib/commercetools-api/src/Models/Order/DeliveryDraftCollection.php @@ -0,0 +1,56 @@ + + * @method DeliveryDraft current() + * @method DeliveryDraft end() + * @method DeliveryDraft at($offset) + */ +class DeliveryDraftCollection extends MapperSequence +{ + /** + * @psalm-assert DeliveryDraft $value + * @psalm-param DeliveryDraft|stdClass $value + * @throws InvalidArgumentException + * + * @return DeliveryDraftCollection + */ + public function add($value) + { + if (!$value instanceof DeliveryDraft) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?DeliveryDraft + */ + protected function mapper() + { + return function (?int $index): ?DeliveryDraft { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var DeliveryDraft $data */ + $data = DeliveryDraftModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Order/DeliveryDraftModel.php b/lib/commercetools-api/src/Models/Order/DeliveryDraftModel.php new file mode 100644 index 00000000000..46dca3e222a --- /dev/null +++ b/lib/commercetools-api/src/Models/Order/DeliveryDraftModel.php @@ -0,0 +1,177 @@ +items = $items; + $this->parcels = $parcels; + $this->address = $address; + $this->custom = $custom; + } + + /** + *

    Items which are shipped in this delivery regardless their distribution over several parcels. + * Can also be specified individually for each Parcel.

    + * + * + * @return null|DeliveryItemCollection + */ + public function getItems() + { + if (is_null($this->items)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ITEMS); + if (is_null($data)) { + return null; + } + $this->items = DeliveryItemCollection::fromArray($data); + } + + return $this->items; + } + + /** + * + * @return null|ParcelDraftCollection + */ + public function getParcels() + { + if (is_null($this->parcels)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_PARCELS); + if (is_null($data)) { + return null; + } + $this->parcels = ParcelDraftCollection::fromArray($data); + } + + return $this->parcels; + } + + /** + * + * @return null|AddressDraft + */ + public function getAddress() + { + if (is_null($this->address)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ADDRESS); + if (is_null($data)) { + return null; + } + + $this->address = AddressDraftModel::of($data); + } + + return $this->address; + } + + /** + *

    Custom Fields for the Transaction.

    + * + * + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomFieldsDraftModel::of($data); + } + + return $this->custom; + } + + + /** + * @param ?DeliveryItemCollection $items + */ + public function setItems(?DeliveryItemCollection $items): void + { + $this->items = $items; + } + + /** + * @param ?ParcelDraftCollection $parcels + */ + public function setParcels(?ParcelDraftCollection $parcels): void + { + $this->parcels = $parcels; + } + + /** + * @param ?AddressDraft $address + */ + public function setAddress(?AddressDraft $address): void + { + $this->address = $address; + } + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void + { + $this->custom = $custom; + } +} diff --git a/lib/commercetools-api/src/Models/Order/DeliveryItem.php b/lib/commercetools-api/src/Models/Order/DeliveryItem.php index 407d3ad555c..fe83e620b1e 100644 --- a/lib/commercetools-api/src/Models/Order/DeliveryItem.php +++ b/lib/commercetools-api/src/Models/Order/DeliveryItem.php @@ -19,11 +19,13 @@ interface DeliveryItem extends JsonObject /** *

    Unique identifier of the DeliveryItem.

    * + * @return null|string */ public function getId(); /** + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-api/src/Models/Order/DeliveryItemBuilder.php b/lib/commercetools-api/src/Models/Order/DeliveryItemBuilder.php index 68cae50b79a..3dbc7f4be75 100644 --- a/lib/commercetools-api/src/Models/Order/DeliveryItemBuilder.php +++ b/lib/commercetools-api/src/Models/Order/DeliveryItemBuilder.php @@ -21,11 +21,13 @@ final class DeliveryItemBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $quantity; @@ -33,6 +35,7 @@ final class DeliveryItemBuilder implements Builder /** *

    Unique identifier of the DeliveryItem.

    * + * @return null|string */ public function getId() @@ -41,6 +44,7 @@ public function getId() } /** + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Order/DeliveryItemModel.php b/lib/commercetools-api/src/Models/Order/DeliveryItemModel.php index 624e19600a5..3af065f3238 100644 --- a/lib/commercetools-api/src/Models/Order/DeliveryItemModel.php +++ b/lib/commercetools-api/src/Models/Order/DeliveryItemModel.php @@ -20,11 +20,13 @@ final class DeliveryItemModel extends JsonObjectModel implements DeliveryItem { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $quantity; @@ -44,6 +46,7 @@ public function __construct( /** *

    Unique identifier of the DeliveryItem.

    * + * * @return null|string */ public function getId() @@ -61,6 +64,7 @@ public function getId() } /** + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/Order/DeliveryModel.php b/lib/commercetools-api/src/Models/Order/DeliveryModel.php index 984d828c9f8..e071841fa10 100644 --- a/lib/commercetools-api/src/Models/Order/DeliveryModel.php +++ b/lib/commercetools-api/src/Models/Order/DeliveryModel.php @@ -25,31 +25,37 @@ final class DeliveryModel extends JsonObjectModel implements Delivery { /** + * * @var ?string */ protected $id; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DeliveryItemCollection */ protected $items; /** + * * @var ?ParcelCollection */ protected $parcels; /** + * * @var ?Address */ protected $address; /** + * * @var ?CustomFields */ protected $custom; @@ -77,6 +83,7 @@ public function __construct( /** *

    Unique identifier of the Delivery.

    * + * * @return null|string */ public function getId() @@ -94,6 +101,7 @@ public function getId() } /** + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -118,6 +126,7 @@ public function getCreatedAt() *

    Items which are shipped in this delivery regardless their distribution over several parcels. * Can also be specified individually for each Parcel.

    * + * * @return null|DeliveryItemCollection */ public function getItems() @@ -135,6 +144,7 @@ public function getItems() } /** + * * @return null|ParcelCollection */ public function getParcels() @@ -152,6 +162,7 @@ public function getParcels() } /** + * * @return null|Address */ public function getAddress() @@ -172,6 +183,7 @@ public function getAddress() /** *

    Custom Fields for the Transaction.

    * + * * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraft.php b/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraft.php index 75af4517e76..53d236fa469 100644 --- a/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraft.php +++ b/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraft.php @@ -22,11 +22,13 @@ interface DiscountedLineItemPriceDraft extends JsonObject *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getValue(); /** + * @return null|DiscountedLineItemPortionCollection */ public function getIncludedDiscounts(); diff --git a/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraftBuilder.php b/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraftBuilder.php index c4f6fac119d..e5d8168b82e 100644 --- a/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraftBuilder.php @@ -24,11 +24,13 @@ final class DiscountedLineItemPriceDraftBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $value; /** + * @var ?DiscountedLineItemPortionCollection */ private $includedDiscounts; @@ -37,6 +39,7 @@ final class DiscountedLineItemPriceDraftBuilder implements Builder *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getValue() @@ -45,6 +48,7 @@ public function getValue() } /** + * @return null|DiscountedLineItemPortionCollection */ public function getIncludedDiscounts() diff --git a/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraftModel.php b/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraftModel.php index 595009bc35c..d2d27a1955b 100644 --- a/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraftModel.php @@ -23,11 +23,13 @@ final class DiscountedLineItemPriceDraftModel extends JsonObjectModel implements DiscountedLineItemPriceDraft { /** + * * @var ?Money */ protected $value; /** + * * @var ?DiscountedLineItemPortionCollection */ protected $includedDiscounts; @@ -48,6 +50,7 @@ public function __construct( *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * * @return null|Money */ public function getValue() @@ -66,6 +69,7 @@ public function getValue() } /** + * * @return null|DiscountedLineItemPortionCollection */ public function getIncludedDiscounts() diff --git a/lib/commercetools-api/src/Models/Order/Hit.php b/lib/commercetools-api/src/Models/Order/Hit.php index 7fb6d7f8ef4..055a6608b67 100644 --- a/lib/commercetools-api/src/Models/Order/Hit.php +++ b/lib/commercetools-api/src/Models/Order/Hit.php @@ -20,6 +20,7 @@ interface Hit extends JsonObject /** *

    Unique identifier of the Order.

    * + * @return null|string */ public function getId(); @@ -27,6 +28,7 @@ public function getId(); /** *

    Current version of the Order.

    * + * @return null|int */ public function getVersion(); @@ -34,6 +36,7 @@ public function getVersion(); /** *

    The higher the value is, the more relevant the hit is for the search request.

    * + * @return null|float */ public function getRelevance(); diff --git a/lib/commercetools-api/src/Models/Order/HitBuilder.php b/lib/commercetools-api/src/Models/Order/HitBuilder.php index 9ffbc82b4ac..3bf810c7b0d 100644 --- a/lib/commercetools-api/src/Models/Order/HitBuilder.php +++ b/lib/commercetools-api/src/Models/Order/HitBuilder.php @@ -21,16 +21,19 @@ final class HitBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?float */ private $relevance; @@ -38,6 +41,7 @@ final class HitBuilder implements Builder /** *

    Unique identifier of the Order.

    * + * @return null|string */ public function getId() @@ -48,6 +52,7 @@ public function getId() /** *

    Current version of the Order.

    * + * @return null|int */ public function getVersion() @@ -58,6 +63,7 @@ public function getVersion() /** *

    The higher the value is, the more relevant the hit is for the search request.

    * + * @return null|float */ public function getRelevance() diff --git a/lib/commercetools-api/src/Models/Order/HitModel.php b/lib/commercetools-api/src/Models/Order/HitModel.php index be6df55d7c6..b7a4f90a822 100644 --- a/lib/commercetools-api/src/Models/Order/HitModel.php +++ b/lib/commercetools-api/src/Models/Order/HitModel.php @@ -20,16 +20,19 @@ final class HitModel extends JsonObjectModel implements Hit { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?float */ protected $relevance; @@ -51,6 +54,7 @@ public function __construct( /** *

    Unique identifier of the Order.

    * + * * @return null|string */ public function getId() @@ -70,6 +74,7 @@ public function getId() /** *

    Current version of the Order.

    * + * * @return null|int */ public function getVersion() @@ -89,6 +94,7 @@ public function getVersion() /** *

    The higher the value is, the more relevant the hit is for the search request.

    * + * * @return null|float */ public function getRelevance() diff --git a/lib/commercetools-api/src/Models/Order/ItemState.php b/lib/commercetools-api/src/Models/Order/ItemState.php index 0dbf9fc9762..67679ac8791 100644 --- a/lib/commercetools-api/src/Models/Order/ItemState.php +++ b/lib/commercetools-api/src/Models/Order/ItemState.php @@ -18,11 +18,13 @@ interface ItemState extends JsonObject public const FIELD_STATE = 'state'; /** + * @return null|int */ public function getQuantity(); /** + * @return null|StateReference */ public function getState(); diff --git a/lib/commercetools-api/src/Models/Order/ItemStateBuilder.php b/lib/commercetools-api/src/Models/Order/ItemStateBuilder.php index 9b5b392dd0f..4d815a386ec 100644 --- a/lib/commercetools-api/src/Models/Order/ItemStateBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ItemStateBuilder.php @@ -23,16 +23,19 @@ final class ItemStateBuilder implements Builder { /** + * @var ?int */ private $quantity; /** + * @var null|StateReference|StateReferenceBuilder */ private $state; /** + * @return null|int */ public function getQuantity() @@ -41,6 +44,7 @@ public function getQuantity() } /** + * @return null|StateReference */ public function getState() diff --git a/lib/commercetools-api/src/Models/Order/ItemStateModel.php b/lib/commercetools-api/src/Models/Order/ItemStateModel.php index 2aa83f1d2cc..136c7ac8daf 100644 --- a/lib/commercetools-api/src/Models/Order/ItemStateModel.php +++ b/lib/commercetools-api/src/Models/Order/ItemStateModel.php @@ -22,11 +22,13 @@ final class ItemStateModel extends JsonObjectModel implements ItemState { /** + * * @var ?int */ protected $quantity; /** + * * @var ?StateReference */ protected $state; @@ -44,6 +46,7 @@ public function __construct( } /** + * * @return null|int */ public function getQuantity() @@ -61,6 +64,7 @@ public function getQuantity() } /** + * * @return null|StateReference */ public function getState() diff --git a/lib/commercetools-api/src/Models/Order/LineItemImportDraft.php b/lib/commercetools-api/src/Models/Order/LineItemImportDraft.php index 21955070a43..1de13892d70 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemImportDraft.php +++ b/lib/commercetools-api/src/Models/Order/LineItemImportDraft.php @@ -29,12 +29,14 @@ interface LineItemImportDraft extends JsonObject public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; public const FIELD_TAX_RATE = 'taxRate'; public const FIELD_CUSTOM = 'custom'; + public const FIELD_INVENTORY_MODE = 'inventoryMode'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; /** *

    ID of the existing product. * You also need to specify the ID of the variant if this property is set or alternatively you can just specify SKU of the product variant.

    * + * @return null|string */ public function getProductId(); @@ -42,26 +44,31 @@ public function getProductId(); /** *

    The product name.

    * + * @return null|LocalizedString */ public function getName(); /** + * @return null|ProductVariantImportDraft */ public function getVariant(); /** + * @return null|PriceDraft */ public function getPrice(); /** + * @return null|int */ public function getQuantity(); /** + * @return null|ItemStateCollection */ public function getState(); @@ -73,6 +80,7 @@ public function getState(); * The provided channel should have the * InventorySupply role.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel(); @@ -81,11 +89,13 @@ public function getSupplyChannel(); *

    The channel is used to select a ProductPrice. * The provided channel should have the ProductDistribution role.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel(); /** + * @return null|TaxRate */ public function getTaxRate(); @@ -93,11 +103,22 @@ public function getTaxRate(); /** *

    The custom fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); /** + *

    Inventory mode specific to the line item only, valid for the entire quantity of the line item. + * Set only if inventory mode should be different from the inventoryMode specified on the OrderImportDraft.

    + * + + * @return null|string + */ + public function getInventoryMode(); + + /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); @@ -152,6 +173,11 @@ public function setTaxRate(?TaxRate $taxRate): void; */ public function setCustom(?CustomFieldsDraft $custom): void; + /** + * @param ?string $inventoryMode + */ + public function setInventoryMode(?string $inventoryMode): void; + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ diff --git a/lib/commercetools-api/src/Models/Order/LineItemImportDraftBuilder.php b/lib/commercetools-api/src/Models/Order/LineItemImportDraftBuilder.php index a5b92b92057..0ab8767c8f8 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemImportDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/LineItemImportDraftBuilder.php @@ -33,56 +33,73 @@ final class LineItemImportDraftBuilder implements Builder { /** + * @var ?string */ private $productId; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|ProductVariantImportDraft|ProductVariantImportDraftBuilder */ private $variant; /** + * @var null|PriceDraft|PriceDraftBuilder */ private $price; /** + * @var ?int */ private $quantity; /** + * @var ?ItemStateCollection */ private $state; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $supplyChannel; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $distributionChannel; /** + * @var null|TaxRate|TaxRateBuilder */ private $taxRate; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + + * @var ?string + */ + private $inventoryMode; + + /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetails; @@ -91,6 +108,7 @@ final class LineItemImportDraftBuilder implements Builder *

    ID of the existing product. * You also need to specify the ID of the variant if this property is set or alternatively you can just specify SKU of the product variant.

    * + * @return null|string */ public function getProductId() @@ -101,6 +119,7 @@ public function getProductId() /** *

    The product name.

    * + * @return null|LocalizedString */ public function getName() @@ -109,6 +128,7 @@ public function getName() } /** + * @return null|ProductVariantImportDraft */ public function getVariant() @@ -117,6 +137,7 @@ public function getVariant() } /** + * @return null|PriceDraft */ public function getPrice() @@ -125,6 +146,7 @@ public function getPrice() } /** + * @return null|int */ public function getQuantity() @@ -133,6 +155,7 @@ public function getQuantity() } /** + * @return null|ItemStateCollection */ public function getState() @@ -147,6 +170,7 @@ public function getState() * The provided channel should have the * InventorySupply role.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -158,6 +182,7 @@ public function getSupplyChannel() *

    The channel is used to select a ProductPrice. * The provided channel should have the ProductDistribution role.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() @@ -166,6 +191,7 @@ public function getDistributionChannel() } /** + * @return null|TaxRate */ public function getTaxRate() @@ -176,6 +202,7 @@ public function getTaxRate() /** *

    The custom fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -184,6 +211,19 @@ public function getCustom() } /** + *

    Inventory mode specific to the line item only, valid for the entire quantity of the line item. + * Set only if inventory mode should be different from the inventoryMode specified on the OrderImportDraft.

    + * + + * @return null|string + */ + public function getInventoryMode() + { + return $this->inventoryMode; + } + + /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() @@ -301,6 +341,17 @@ public function withCustom(?CustomFieldsDraft $custom) return $this; } + /** + * @param ?string $inventoryMode + * @return $this + */ + public function withInventoryMode(?string $inventoryMode) + { + $this->inventoryMode = $inventoryMode; + + return $this; + } + /** * @param ?ItemShippingDetailsDraft $shippingDetails * @return $this @@ -413,6 +464,7 @@ public function build(): LineItemImportDraft $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel, $this->taxRate instanceof TaxRateBuilder ? $this->taxRate->build() : $this->taxRate, $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, + $this->inventoryMode, $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails ); } diff --git a/lib/commercetools-api/src/Models/Order/LineItemImportDraftModel.php b/lib/commercetools-api/src/Models/Order/LineItemImportDraftModel.php index 86fadbeb7ed..ed86bae1c9f 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemImportDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/LineItemImportDraftModel.php @@ -32,56 +32,73 @@ final class LineItemImportDraftModel extends JsonObjectModel implements LineItemImportDraft { /** + * * @var ?string */ protected $productId; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?ProductVariantImportDraft */ protected $variant; /** + * * @var ?PriceDraft */ protected $price; /** + * * @var ?int */ protected $quantity; /** + * * @var ?ItemStateCollection */ protected $state; /** + * * @var ?ChannelResourceIdentifier */ protected $supplyChannel; /** + * * @var ?ChannelResourceIdentifier */ protected $distributionChannel; /** + * * @var ?TaxRate */ protected $taxRate; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * + * @var ?string + */ + protected $inventoryMode; + + /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; @@ -101,6 +118,7 @@ public function __construct( ?ChannelResourceIdentifier $distributionChannel = null, ?TaxRate $taxRate = null, ?CustomFieldsDraft $custom = null, + ?string $inventoryMode = null, ?ItemShippingDetailsDraft $shippingDetails = null ) { $this->productId = $productId; @@ -113,6 +131,7 @@ public function __construct( $this->distributionChannel = $distributionChannel; $this->taxRate = $taxRate; $this->custom = $custom; + $this->inventoryMode = $inventoryMode; $this->shippingDetails = $shippingDetails; } @@ -120,6 +139,7 @@ public function __construct( *

    ID of the existing product. * You also need to specify the ID of the variant if this property is set or alternatively you can just specify SKU of the product variant.

    * + * * @return null|string */ public function getProductId() @@ -139,6 +159,7 @@ public function getProductId() /** *

    The product name.

    * + * * @return null|LocalizedString */ public function getName() @@ -157,6 +178,7 @@ public function getName() } /** + * * @return null|ProductVariantImportDraft */ public function getVariant() @@ -175,6 +197,7 @@ public function getVariant() } /** + * * @return null|PriceDraft */ public function getPrice() @@ -193,6 +216,7 @@ public function getPrice() } /** + * * @return null|int */ public function getQuantity() @@ -210,6 +234,7 @@ public function getQuantity() } /** + * * @return null|ItemStateCollection */ public function getState() @@ -233,6 +258,7 @@ public function getState() * The provided channel should have the * InventorySupply role.

    * + * * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -254,6 +280,7 @@ public function getSupplyChannel() *

    The channel is used to select a ProductPrice. * The provided channel should have the ProductDistribution role.

    * + * * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() @@ -272,6 +299,7 @@ public function getDistributionChannel() } /** + * * @return null|TaxRate */ public function getTaxRate() @@ -292,6 +320,7 @@ public function getTaxRate() /** *

    The custom fields.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -310,6 +339,28 @@ public function getCustom() } /** + *

    Inventory mode specific to the line item only, valid for the entire quantity of the line item. + * Set only if inventory mode should be different from the inventoryMode specified on the OrderImportDraft.

    + * + * + * @return null|string + */ + public function getInventoryMode() + { + if (is_null($this->inventoryMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_INVENTORY_MODE); + if (is_null($data)) { + return null; + } + $this->inventoryMode = (string) $data; + } + + return $this->inventoryMode; + } + + /** + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() @@ -408,6 +459,14 @@ public function setCustom(?CustomFieldsDraft $custom): void $this->custom = $custom; } + /** + * @param ?string $inventoryMode + */ + public function setInventoryMode(?string $inventoryMode): void + { + $this->inventoryMode = $inventoryMode; + } + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ diff --git a/lib/commercetools-api/src/Models/Order/LineItemReturnItem.php b/lib/commercetools-api/src/Models/Order/LineItemReturnItem.php index ffb68353d25..f518b92d60e 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemReturnItem.php +++ b/lib/commercetools-api/src/Models/Order/LineItemReturnItem.php @@ -16,6 +16,7 @@ interface LineItemReturnItem extends ReturnItem public const FIELD_LINE_ITEM_ID = 'lineItemId'; /** + * @return null|string */ public function getLineItemId(); diff --git a/lib/commercetools-api/src/Models/Order/LineItemReturnItemBuilder.php b/lib/commercetools-api/src/Models/Order/LineItemReturnItemBuilder.php index 4d045acc4f1..ab4d19437b6 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemReturnItemBuilder.php +++ b/lib/commercetools-api/src/Models/Order/LineItemReturnItemBuilder.php @@ -24,46 +24,55 @@ final class LineItemReturnItemBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $quantity; /** + * @var ?string */ private $comment; /** + * @var ?string */ private $shipmentState; /** + * @var ?string */ private $paymentState; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?string */ private $lineItemId; @@ -71,6 +80,7 @@ final class LineItemReturnItemBuilder implements Builder /** *

    Unique identifier of the ReturnItem.

    * + * @return null|string */ public function getId() @@ -79,6 +89,7 @@ public function getId() } /** + * @return null|int */ public function getQuantity() @@ -87,6 +98,7 @@ public function getQuantity() } /** + * @return null|string */ public function getComment() @@ -95,6 +107,7 @@ public function getComment() } /** + * @return null|string */ public function getShipmentState() @@ -103,6 +116,7 @@ public function getShipmentState() } /** + * @return null|string */ public function getPaymentState() @@ -113,6 +127,7 @@ public function getPaymentState() /** *

    Custom Fields of this return item.

    * + * @return null|CustomFields */ public function getCustom() @@ -121,6 +136,7 @@ public function getCustom() } /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -129,6 +145,7 @@ public function getLastModifiedAt() } /** + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -137,6 +154,7 @@ public function getCreatedAt() } /** + * @return null|string */ public function getLineItemId() diff --git a/lib/commercetools-api/src/Models/Order/LineItemReturnItemModel.php b/lib/commercetools-api/src/Models/Order/LineItemReturnItemModel.php index e7bd813f652..7379c9bad2c 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemReturnItemModel.php +++ b/lib/commercetools-api/src/Models/Order/LineItemReturnItemModel.php @@ -24,51 +24,61 @@ final class LineItemReturnItemModel extends JsonObjectModel implements LineItemR { public const DISCRIMINATOR_VALUE = 'LineItemReturnItem'; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $quantity; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $comment; /** + * * @var ?string */ protected $shipmentState; /** + * * @var ?string */ protected $paymentState; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?string */ protected $lineItemId; @@ -86,7 +96,8 @@ public function __construct( ?CustomFields $custom = null, ?DateTimeImmutable $lastModifiedAt = null, ?DateTimeImmutable $createdAt = null, - ?string $lineItemId = null + ?string $lineItemId = null, + ?string $type = null ) { $this->id = $id; $this->quantity = $quantity; @@ -97,12 +108,13 @@ public function __construct( $this->lastModifiedAt = $lastModifiedAt; $this->createdAt = $createdAt; $this->lineItemId = $lineItemId; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    Unique identifier of the ReturnItem.

    * + * * @return null|string */ public function getId() @@ -120,6 +132,7 @@ public function getId() } /** + * * @return null|int */ public function getQuantity() @@ -137,6 +150,7 @@ public function getQuantity() } /** + * * @return null|string */ public function getType() @@ -154,6 +168,7 @@ public function getType() } /** + * * @return null|string */ public function getComment() @@ -171,6 +186,7 @@ public function getComment() } /** + * * @return null|string */ public function getShipmentState() @@ -188,6 +204,7 @@ public function getShipmentState() } /** + * * @return null|string */ public function getPaymentState() @@ -207,6 +224,7 @@ public function getPaymentState() /** *

    Custom Fields of this return item.

    * + * * @return null|CustomFields */ public function getCustom() @@ -225,6 +243,7 @@ public function getCustom() } /** + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -246,6 +265,7 @@ public function getLastModifiedAt() } /** + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -267,6 +287,7 @@ public function getCreatedAt() } /** + * * @return null|string */ public function getLineItemId() diff --git a/lib/commercetools-api/src/Models/Order/Order.php b/lib/commercetools-api/src/Models/Order/Order.php index 60def78f1bc..c090d5fd55e 100644 --- a/lib/commercetools-api/src/Models/Order/Order.php +++ b/lib/commercetools-api/src/Models/Order/Order.php @@ -8,10 +8,12 @@ namespace Commercetools\Api\Models\Order; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; use Commercetools\Api\Models\Cart\CartReference; use Commercetools\Api\Models\Cart\CustomLineItemCollection; use Commercetools\Api\Models\Cart\DiscountCodeInfoCollection; use Commercetools\Api\Models\Cart\LineItemCollection; +use Commercetools\Api\Models\Cart\ShippingCollection; use Commercetools\Api\Models\Cart\ShippingInfo; use Commercetools\Api\Models\Cart\ShippingRateInput; use Commercetools\Api\Models\Cart\TaxedPrice; @@ -41,13 +43,17 @@ interface Order extends BaseResource public const FIELD_CUSTOMER_ID = 'customerId'; public const FIELD_CUSTOMER_EMAIL = 'customerEmail'; public const FIELD_ANONYMOUS_ID = 'anonymousId'; + public const FIELD_BUSINESS_UNIT = 'businessUnit'; public const FIELD_STORE = 'store'; public const FIELD_LINE_ITEMS = 'lineItems'; public const FIELD_CUSTOM_LINE_ITEMS = 'customLineItems'; public const FIELD_TOTAL_PRICE = 'totalPrice'; public const FIELD_TAXED_PRICE = 'taxedPrice'; + public const FIELD_TAXED_SHIPPING_PRICE = 'taxedShippingPrice'; public const FIELD_SHIPPING_ADDRESS = 'shippingAddress'; public const FIELD_BILLING_ADDRESS = 'billingAddress'; + public const FIELD_SHIPPING_MODE = 'shippingMode'; + public const FIELD_SHIPPING = 'shipping'; public const FIELD_TAX_MODE = 'taxMode'; public const FIELD_TAX_ROUNDING_MODE = 'taxRoundingMode'; public const FIELD_CUSTOMER_GROUP = 'customerGroup'; @@ -76,6 +82,7 @@ interface Order extends BaseResource /** *

    Unique identifier of the Order.

    * + * @return null|string */ public function getId(); @@ -83,16 +90,19 @@ public function getId(); /** *

    The current version of the order.

    * + * @return null|int */ public function getVersion(); /** + * @return null|DateTimeImmutable */ public function getCreatedAt(); /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -100,6 +110,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -107,6 +118,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -114,6 +126,7 @@ public function getCreatedBy(); /** *

    This field will only be present if it was set for Order Import

    * + * @return null|DateTimeImmutable */ public function getCompletedAt(); @@ -124,16 +137,19 @@ public function getCompletedAt(); * It should be unique across a project. * Once it's set it cannot be changed.

    * + * @return null|string */ public function getOrderNumber(); /** + * @return null|string */ public function getCustomerId(); /** + * @return null|string */ public function getCustomerEmail(); @@ -141,26 +157,39 @@ public function getCustomerEmail(); /** *

    Identifies carts and orders belonging to an anonymous session (the customer has not signed up/in yet).

    * + * @return null|string */ public function getAnonymousId(); /** + *

    The Business Unit the Order belongs to.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit(); + + /** + * @return null|StoreKeyReference */ public function getStore(); /** + * @return null|LineItemCollection */ public function getLineItems(); /** + * @return null|CustomLineItemCollection */ public function getCustomLineItems(); /** + * @return null|TypedMoney */ public function getTotalPrice(); @@ -168,21 +197,54 @@ public function getTotalPrice(); /** *

    The taxes are calculated based on the shipping address.

    * + * @return null|TaxedPrice */ public function getTaxedPrice(); /** + *

    Sum of taxedPrice of ShippingInfo across all Shipping Methods. + * For Platform TaxMode, it is set automatically only if shipping address is set or Shipping Method is added to the Cart.

    + * + + * @return null|TaxedPrice + */ + public function getTaxedShippingPrice(); + + /** + *

    Holds all shipping-related information per Shipping Method.

    + *

    For Multi ShippingMode, it is updated automatically after the Shipping Methods are added.

    + * + * @return null|Address */ public function getShippingAddress(); /** + * @return null|Address */ public function getBillingAddress(); /** + *

    Indicates whether one or multiple Shipping Methods are added to the Cart.

    + * + + * @return null|string + */ + public function getShippingMode(); + + /** + *

    Holds all shipping-related information per Shipping Method for Multi ShippingMode.

    + *

    It is updated automatically after the Shipping Method is added.

    + * + + * @return null|ShippingCollection + */ + public function getShipping(); + + /** + * @return null|string */ public function getTaxMode(); @@ -190,6 +252,7 @@ public function getTaxMode(); /** *

    When calculating taxes for taxedPrice, the selected mode is used for rouding.

    * + * @return null|string */ public function getTaxRoundingMode(); @@ -198,6 +261,7 @@ public function getTaxRoundingMode(); *

    Set when the customer is set and the customer is a member of a customer group. * Used for product variant price selection.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup(); @@ -206,6 +270,7 @@ public function getCustomerGroup(); *

    A two-digit country code as per ISO 3166-1 alpha-2. * Used for product variant price selection.

    * + * @return null|string */ public function getCountry(); @@ -213,6 +278,7 @@ public function getCountry(); /** *

    One of the four predefined OrderStates.

    * + * @return null|string */ public function getOrderState(); @@ -220,16 +286,19 @@ public function getOrderState(); /** *

    This reference can point to a state in a custom workflow.

    * + * @return null|StateReference */ public function getState(); /** + * @return null|string */ public function getShipmentState(); /** + * @return null|string */ public function getPaymentState(); @@ -237,21 +306,25 @@ public function getPaymentState(); /** *

    Set if the ShippingMethod is set.

    * + * @return null|ShippingInfo */ public function getShippingInfo(); /** + * @return null|SyncInfoCollection */ public function getSyncInfo(); /** + * @return null|ReturnInfoCollection */ public function getReturnInfo(); /** + * @return null|DiscountCodeInfoCollection */ public function getDiscountCodes(); @@ -259,6 +332,7 @@ public function getDiscountCodes(); /** *

    Internal-only field.

    * + * @deprecated * @return null|int */ public function getLastMessageSequenceNumber(); @@ -267,6 +341,7 @@ public function getLastMessageSequenceNumber(); *

    Set when this order was created from a cart. * The cart will have the state Ordered.

    * + * @return null|CartReference */ public function getCart(); @@ -274,31 +349,37 @@ public function getCart(); /** *

    Set when this order was created from a quote.

    * + * @return null|QuoteReference */ public function getQuote(); /** + * @return null|CustomFields */ public function getCustom(); /** + * @return null|PaymentInfo */ public function getPaymentInfo(); /** + * @return null|string */ public function getLocale(); /** + * @return null|string */ public function getInventoryMode(); /** + * @return null|string */ public function getOrigin(); @@ -306,6 +387,7 @@ public function getOrigin(); /** *

    When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

    * + * @return null|string */ public function getTaxCalculationMode(); @@ -313,6 +395,7 @@ public function getTaxCalculationMode(); /** *

    The shippingRateInput is used as an input to select a ShippingRatePriceTier.

    * + * @return null|ShippingRateInput */ public function getShippingRateInput(); @@ -320,6 +403,7 @@ public function getShippingRateInput(); /** *

    Contains addresses for orders with multiple shipping addresses.

    * + * @return null|AddressCollection */ public function getItemShippingAddresses(); @@ -327,6 +411,7 @@ public function getItemShippingAddresses(); /** *

    Automatically filled when a line item with LineItemMode GiftLineItem is removed from this order.

    * + * @return null|CartDiscountReferenceCollection */ public function getRefusedGifts(); @@ -386,6 +471,11 @@ public function setCustomerEmail(?string $customerEmail): void; */ public function setAnonymousId(?string $anonymousId): void; + /** + * @param ?BusinessUnitKeyReference $businessUnit + */ + public function setBusinessUnit(?BusinessUnitKeyReference $businessUnit): void; + /** * @param ?StoreKeyReference $store */ @@ -411,6 +501,11 @@ public function setTotalPrice(?TypedMoney $totalPrice): void; */ public function setTaxedPrice(?TaxedPrice $taxedPrice): void; + /** + * @param ?TaxedPrice $taxedShippingPrice + */ + public function setTaxedShippingPrice(?TaxedPrice $taxedShippingPrice): void; + /** * @param ?Address $shippingAddress */ @@ -421,6 +516,16 @@ public function setShippingAddress(?Address $shippingAddress): void; */ public function setBillingAddress(?Address $billingAddress): void; + /** + * @param ?string $shippingMode + */ + public function setShippingMode(?string $shippingMode): void; + + /** + * @param ?ShippingCollection $shipping + */ + public function setShipping(?ShippingCollection $shipping): void; + /** * @param ?string $taxMode */ diff --git a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryAction.php b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryAction.php index c857cf692a8..48befa9f6a2 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryAction.php @@ -16,21 +16,33 @@ interface OrderAddDeliveryAction extends OrderUpdateAction { public const FIELD_ITEMS = 'items'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; public const FIELD_ADDRESS = 'address'; public const FIELD_PARCELS = 'parcels'; public const FIELD_CUSTOM = 'custom'; /** + * @return null|DeliveryItemCollection */ public function getItems(); /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey(); + + /** + * @return null|BaseAddress */ public function getAddress(); /** + * @return null|ParcelDraftCollection */ public function getParcels(); @@ -38,6 +50,7 @@ public function getParcels(); /** *

    Custom Fields for the Transaction.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -47,6 +60,11 @@ public function getCustom(); */ public function setItems(?DeliveryItemCollection $items): void; + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; + /** * @param ?BaseAddress $address */ diff --git a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionBuilder.php index 84f264008ad..da7f1cf9160 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionBuilder.php @@ -25,26 +25,37 @@ final class OrderAddDeliveryActionBuilder implements Builder { /** + * @var ?DeliveryItemCollection */ private $items; /** + + * @var ?string + */ + private $shippingKey; + + /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @var ?ParcelDraftCollection */ private $parcels; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @return null|DeliveryItemCollection */ public function getItems() @@ -53,6 +64,18 @@ public function getItems() } /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + + /** + * @return null|BaseAddress */ public function getAddress() @@ -61,6 +84,7 @@ public function getAddress() } /** + * @return null|ParcelDraftCollection */ public function getParcels() @@ -71,6 +95,7 @@ public function getParcels() /** *

    Custom Fields for the Transaction.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -89,6 +114,17 @@ public function withItems(?DeliveryItemCollection $items) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @param ?BaseAddress $address * @return $this @@ -148,6 +184,7 @@ public function build(): OrderAddDeliveryAction { return new OrderAddDeliveryActionModel( $this->items, + $this->shippingKey, $this->address instanceof BaseAddressBuilder ? $this->address->build() : $this->address, $this->parcels, $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom diff --git a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionModel.php b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionModel.php index b7ea9a8a87d..263345326b6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionModel.php @@ -25,26 +25,37 @@ final class OrderAddDeliveryActionModel extends JsonObjectModel implements Order { public const DISCRIMINATOR_VALUE = 'addDelivery'; /** + * * @var ?string */ protected $action; /** + * * @var ?DeliveryItemCollection */ protected $items; /** + * + * @var ?string + */ + protected $shippingKey; + + /** + * * @var ?BaseAddress */ protected $address; /** + * * @var ?ParcelDraftCollection */ protected $parcels; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -55,18 +66,22 @@ final class OrderAddDeliveryActionModel extends JsonObjectModel implements Order */ public function __construct( ?DeliveryItemCollection $items = null, + ?string $shippingKey = null, ?BaseAddress $address = null, ?ParcelDraftCollection $parcels = null, - ?CustomFieldsDraft $custom = null + ?CustomFieldsDraft $custom = null, + ?string $action = null ) { $this->items = $items; + $this->shippingKey = $shippingKey; $this->address = $address; $this->parcels = $parcels; $this->custom = $custom; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -84,6 +99,7 @@ public function getAction() } /** + * * @return null|DeliveryItemCollection */ public function getItems() @@ -101,6 +117,27 @@ public function getItems() } /** + *

    User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

    + * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + + /** + * * @return null|BaseAddress */ public function getAddress() @@ -119,6 +156,7 @@ public function getAddress() } /** + * * @return null|ParcelDraftCollection */ public function getParcels() @@ -138,6 +176,7 @@ public function getParcels() /** *

    Custom Fields for the Transaction.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -164,6 +203,14 @@ public function setItems(?DeliveryItemCollection $items): void $this->items = $items; } + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } + /** * @param ?BaseAddress $address */ diff --git a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressAction.php index 5a97cabb241..fd1b33e690f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressAction.php @@ -17,6 +17,7 @@ interface OrderAddItemShippingAddressAction extends OrderUpdateAction public const FIELD_ADDRESS = 'address'; /** + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionBuilder.php index c57ac77a163..a6061a1ee45 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionBuilder.php @@ -23,11 +23,13 @@ final class OrderAddItemShippingAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionModel.php index 3975a9402af..09e812a4f72 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionModel.php @@ -23,11 +23,13 @@ final class OrderAddItemShippingAddressActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'addItemShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -37,13 +39,15 @@ final class OrderAddItemShippingAddressActionModel extends JsonObjectModel imple * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryAction.php b/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryAction.php index 5874ebd9a37..1afa8e16960 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryAction.php @@ -19,21 +19,25 @@ interface OrderAddParcelToDeliveryAction extends OrderUpdateAction public const FIELD_ITEMS = 'items'; /** + * @return null|string */ public function getDeliveryId(); /** + * @return null|ParcelMeasurements */ public function getMeasurements(); /** + * @return null|TrackingData */ public function getTrackingData(); /** + * @return null|DeliveryItemCollection */ public function getItems(); diff --git a/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryActionBuilder.php index 4d1d317e3fe..d6e59703871 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryActionBuilder.php @@ -21,26 +21,31 @@ final class OrderAddParcelToDeliveryActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var null|ParcelMeasurements|ParcelMeasurementsBuilder */ private $measurements; /** + * @var null|TrackingData|TrackingDataBuilder */ private $trackingData; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @return null|string */ public function getDeliveryId() @@ -49,6 +54,7 @@ public function getDeliveryId() } /** + * @return null|ParcelMeasurements */ public function getMeasurements() @@ -57,6 +63,7 @@ public function getMeasurements() } /** + * @return null|TrackingData */ public function getTrackingData() @@ -65,6 +72,7 @@ public function getTrackingData() } /** + * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryActionModel.php b/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryActionModel.php index 693310dd0a9..aa811c32eb0 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryActionModel.php @@ -21,26 +21,31 @@ final class OrderAddParcelToDeliveryActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'addParcelToDelivery'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?ParcelMeasurements */ protected $measurements; /** + * * @var ?TrackingData */ protected $trackingData; /** + * * @var ?DeliveryItemCollection */ protected $items; @@ -53,16 +58,18 @@ public function __construct( ?string $deliveryId = null, ?ParcelMeasurements $measurements = null, ?TrackingData $trackingData = null, - ?DeliveryItemCollection $items = null + ?DeliveryItemCollection $items = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; $this->measurements = $measurements; $this->trackingData = $trackingData; $this->items = $items; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -80,6 +87,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() @@ -97,6 +105,7 @@ public function getDeliveryId() } /** + * * @return null|ParcelMeasurements */ public function getMeasurements() @@ -115,6 +124,7 @@ public function getMeasurements() } /** + * * @return null|TrackingData */ public function getTrackingData() @@ -133,6 +143,7 @@ public function getTrackingData() } /** + * * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-api/src/Models/Order/OrderAddPaymentAction.php b/lib/commercetools-api/src/Models/Order/OrderAddPaymentAction.php index 601371f43b1..a28f8daaeaa 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddPaymentAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddPaymentAction.php @@ -19,6 +19,7 @@ interface OrderAddPaymentAction extends OrderUpdateAction /** *

    ResourceIdentifier to a Payment.

    * + * @return null|PaymentResourceIdentifier */ public function getPayment(); diff --git a/lib/commercetools-api/src/Models/Order/OrderAddPaymentActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderAddPaymentActionBuilder.php index 9bbc313ebbe..ee6e23c182a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddPaymentActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddPaymentActionBuilder.php @@ -23,6 +23,7 @@ final class OrderAddPaymentActionBuilder implements Builder { /** + * @var null|PaymentResourceIdentifier|PaymentResourceIdentifierBuilder */ private $payment; @@ -30,6 +31,7 @@ final class OrderAddPaymentActionBuilder implements Builder /** *

    ResourceIdentifier to a Payment.

    * + * @return null|PaymentResourceIdentifier */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Order/OrderAddPaymentActionModel.php b/lib/commercetools-api/src/Models/Order/OrderAddPaymentActionModel.php index 205eb6932fe..6a85cf7f797 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddPaymentActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddPaymentActionModel.php @@ -23,11 +23,13 @@ final class OrderAddPaymentActionModel extends JsonObjectModel implements OrderA { public const DISCRIMINATOR_VALUE = 'addPayment'; /** + * * @var ?string */ protected $action; /** + * * @var ?PaymentResourceIdentifier */ protected $payment; @@ -37,13 +39,15 @@ final class OrderAddPaymentActionModel extends JsonObjectModel implements OrderA * @psalm-suppress MissingParamType */ public function __construct( - ?PaymentResourceIdentifier $payment = null + ?PaymentResourceIdentifier $payment = null, + ?string $action = null ) { $this->payment = $payment; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    ResourceIdentifier to a Payment.

    * + * * @return null|PaymentResourceIdentifier */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoAction.php b/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoAction.php index 05362b6754f..1203124ac83 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoAction.php @@ -19,16 +19,19 @@ interface OrderAddReturnInfoAction extends OrderUpdateAction public const FIELD_RETURN_DATE = 'returnDate'; /** + * @return null|string */ public function getReturnTrackingId(); /** + * @return null|ReturnItemDraftCollection */ public function getItems(); /** + * @return null|DateTimeImmutable */ public function getReturnDate(); diff --git a/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoActionBuilder.php index 6fe5c138308..b556ce578aa 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoActionBuilder.php @@ -22,21 +22,25 @@ final class OrderAddReturnInfoActionBuilder implements Builder { /** + * @var ?string */ private $returnTrackingId; /** + * @var ?ReturnItemDraftCollection */ private $items; /** + * @var ?DateTimeImmutable */ private $returnDate; /** + * @return null|string */ public function getReturnTrackingId() @@ -45,6 +49,7 @@ public function getReturnTrackingId() } /** + * @return null|ReturnItemDraftCollection */ public function getItems() @@ -53,6 +58,7 @@ public function getItems() } /** + * @return null|DateTimeImmutable */ public function getReturnDate() diff --git a/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoActionModel.php b/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoActionModel.php index 670900541bc..493b3083198 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoActionModel.php @@ -22,21 +22,25 @@ final class OrderAddReturnInfoActionModel extends JsonObjectModel implements Ord { public const DISCRIMINATOR_VALUE = 'addReturnInfo'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $returnTrackingId; /** + * * @var ?ReturnItemDraftCollection */ protected $items; /** + * * @var ?DateTimeImmutable */ protected $returnDate; @@ -48,15 +52,17 @@ final class OrderAddReturnInfoActionModel extends JsonObjectModel implements Ord public function __construct( ?string $returnTrackingId = null, ?ReturnItemDraftCollection $items = null, - ?DateTimeImmutable $returnDate = null + ?DateTimeImmutable $returnDate = null, + ?string $action = null ) { $this->returnTrackingId = $returnTrackingId; $this->items = $items; $this->returnDate = $returnDate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -74,6 +80,7 @@ public function getAction() } /** + * * @return null|string */ public function getReturnTrackingId() @@ -91,6 +98,7 @@ public function getReturnTrackingId() } /** + * * @return null|ReturnItemDraftCollection */ public function getItems() @@ -108,6 +116,7 @@ public function getItems() } /** + * * @return null|DateTimeImmutable */ public function getReturnDate() diff --git a/lib/commercetools-api/src/Models/Order/OrderBuilder.php b/lib/commercetools-api/src/Models/Order/OrderBuilder.php index 74a4aa0b1c5..d7ffed474f1 100644 --- a/lib/commercetools-api/src/Models/Order/OrderBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderBuilder.php @@ -8,11 +8,14 @@ namespace Commercetools\Api\Models\Order; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceBuilder; use Commercetools\Api\Models\Cart\CartReference; use Commercetools\Api\Models\Cart\CartReferenceBuilder; use Commercetools\Api\Models\Cart\CustomLineItemCollection; use Commercetools\Api\Models\Cart\DiscountCodeInfoCollection; use Commercetools\Api\Models\Cart\LineItemCollection; +use Commercetools\Api\Models\Cart\ShippingCollection; use Commercetools\Api\Models\Cart\ShippingInfo; use Commercetools\Api\Models\Cart\ShippingInfoBuilder; use Commercetools\Api\Models\Cart\ShippingRateInput; @@ -57,211 +60,277 @@ final class OrderBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?DateTimeImmutable */ private $completedAt; /** + * @var ?string */ private $orderNumber; /** + * @var ?string */ private $customerId; /** + * @var ?string */ private $customerEmail; /** + * @var ?string */ private $anonymousId; /** + + * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + */ + private $businessUnit; + + /** + * @var null|StoreKeyReference|StoreKeyReferenceBuilder */ private $store; /** + * @var ?LineItemCollection */ private $lineItems; /** + * @var ?CustomLineItemCollection */ private $customLineItems; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalPrice; /** + * @var null|TaxedPrice|TaxedPriceBuilder */ private $taxedPrice; /** + + * @var null|TaxedPrice|TaxedPriceBuilder + */ + private $taxedShippingPrice; + + /** + * @var null|Address|AddressBuilder */ private $shippingAddress; /** + * @var null|Address|AddressBuilder */ private $billingAddress; /** + + * @var ?string + */ + private $shippingMode; + + /** + + * @var ?ShippingCollection + */ + private $shipping; + + /** + * @var ?string */ private $taxMode; /** + * @var ?string */ private $taxRoundingMode; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $customerGroup; /** + * @var ?string */ private $country; /** + * @var ?string */ private $orderState; /** + * @var null|StateReference|StateReferenceBuilder */ private $state; /** + * @var ?string */ private $shipmentState; /** + * @var ?string */ private $paymentState; /** + * @var null|ShippingInfo|ShippingInfoBuilder */ private $shippingInfo; /** + * @var ?SyncInfoCollection */ private $syncInfo; /** + * @var ?ReturnInfoCollection */ private $returnInfo; /** + * @var ?DiscountCodeInfoCollection */ private $discountCodes; /** + * @deprecated * @var ?int */ private $lastMessageSequenceNumber; /** + * @var null|CartReference|CartReferenceBuilder */ private $cart; /** + * @var null|QuoteReference|QuoteReferenceBuilder */ private $quote; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var null|PaymentInfo|PaymentInfoBuilder */ private $paymentInfo; /** + * @var ?string */ private $locale; /** + * @var ?string */ private $inventoryMode; /** + * @var ?string */ private $origin; /** + * @var ?string */ private $taxCalculationMode; /** + * @var null|ShippingRateInput|ShippingRateInputBuilder */ private $shippingRateInput; /** + * @var ?AddressCollection */ private $itemShippingAddresses; /** + * @var ?CartDiscountReferenceCollection */ private $refusedGifts; @@ -269,6 +338,7 @@ final class OrderBuilder implements Builder /** *

    Unique identifier of the Order.

    * + * @return null|string */ public function getId() @@ -279,6 +349,7 @@ public function getId() /** *

    The current version of the order.

    * + * @return null|int */ public function getVersion() @@ -287,6 +358,7 @@ public function getVersion() } /** + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -295,6 +367,7 @@ public function getCreatedAt() } /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -305,6 +378,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -315,6 +389,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -325,6 +400,7 @@ public function getCreatedBy() /** *

    This field will only be present if it was set for Order Import

    * + * @return null|DateTimeImmutable */ public function getCompletedAt() @@ -338,6 +414,7 @@ public function getCompletedAt() * It should be unique across a project. * Once it's set it cannot be changed.

    * + * @return null|string */ public function getOrderNumber() @@ -346,6 +423,7 @@ public function getOrderNumber() } /** + * @return null|string */ public function getCustomerId() @@ -354,6 +432,7 @@ public function getCustomerId() } /** + * @return null|string */ public function getCustomerEmail() @@ -364,6 +443,7 @@ public function getCustomerEmail() /** *

    Identifies carts and orders belonging to an anonymous session (the customer has not signed up/in yet).

    * + * @return null|string */ public function getAnonymousId() @@ -372,6 +452,18 @@ public function getAnonymousId() } /** + *

    The Business Unit the Order belongs to.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit() + { + return $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit; + } + + /** + * @return null|StoreKeyReference */ public function getStore() @@ -380,6 +472,7 @@ public function getStore() } /** + * @return null|LineItemCollection */ public function getLineItems() @@ -388,6 +481,7 @@ public function getLineItems() } /** + * @return null|CustomLineItemCollection */ public function getCustomLineItems() @@ -396,6 +490,7 @@ public function getCustomLineItems() } /** + * @return null|TypedMoney */ public function getTotalPrice() @@ -406,6 +501,7 @@ public function getTotalPrice() /** *

    The taxes are calculated based on the shipping address.

    * + * @return null|TaxedPrice */ public function getTaxedPrice() @@ -414,6 +510,22 @@ public function getTaxedPrice() } /** + *

    Sum of taxedPrice of ShippingInfo across all Shipping Methods. + * For Platform TaxMode, it is set automatically only if shipping address is set or Shipping Method is added to the Cart.

    + * + + * @return null|TaxedPrice + */ + public function getTaxedShippingPrice() + { + return $this->taxedShippingPrice instanceof TaxedPriceBuilder ? $this->taxedShippingPrice->build() : $this->taxedShippingPrice; + } + + /** + *

    Holds all shipping-related information per Shipping Method.

    + *

    For Multi ShippingMode, it is updated automatically after the Shipping Methods are added.

    + * + * @return null|Address */ public function getShippingAddress() @@ -422,6 +534,7 @@ public function getShippingAddress() } /** + * @return null|Address */ public function getBillingAddress() @@ -430,6 +543,30 @@ public function getBillingAddress() } /** + *

    Indicates whether one or multiple Shipping Methods are added to the Cart.

    + * + + * @return null|string + */ + public function getShippingMode() + { + return $this->shippingMode; + } + + /** + *

    Holds all shipping-related information per Shipping Method for Multi ShippingMode.

    + *

    It is updated automatically after the Shipping Method is added.

    + * + + * @return null|ShippingCollection + */ + public function getShipping() + { + return $this->shipping; + } + + /** + * @return null|string */ public function getTaxMode() @@ -440,6 +577,7 @@ public function getTaxMode() /** *

    When calculating taxes for taxedPrice, the selected mode is used for rouding.

    * + * @return null|string */ public function getTaxRoundingMode() @@ -451,6 +589,7 @@ public function getTaxRoundingMode() *

    Set when the customer is set and the customer is a member of a customer group. * Used for product variant price selection.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -462,6 +601,7 @@ public function getCustomerGroup() *

    A two-digit country code as per ISO 3166-1 alpha-2. * Used for product variant price selection.

    * + * @return null|string */ public function getCountry() @@ -472,6 +612,7 @@ public function getCountry() /** *

    One of the four predefined OrderStates.

    * + * @return null|string */ public function getOrderState() @@ -482,6 +623,7 @@ public function getOrderState() /** *

    This reference can point to a state in a custom workflow.

    * + * @return null|StateReference */ public function getState() @@ -490,6 +632,7 @@ public function getState() } /** + * @return null|string */ public function getShipmentState() @@ -498,6 +641,7 @@ public function getShipmentState() } /** + * @return null|string */ public function getPaymentState() @@ -508,6 +652,7 @@ public function getPaymentState() /** *

    Set if the ShippingMethod is set.

    * + * @return null|ShippingInfo */ public function getShippingInfo() @@ -516,6 +661,7 @@ public function getShippingInfo() } /** + * @return null|SyncInfoCollection */ public function getSyncInfo() @@ -524,6 +670,7 @@ public function getSyncInfo() } /** + * @return null|ReturnInfoCollection */ public function getReturnInfo() @@ -532,6 +679,7 @@ public function getReturnInfo() } /** + * @return null|DiscountCodeInfoCollection */ public function getDiscountCodes() @@ -542,6 +690,7 @@ public function getDiscountCodes() /** *

    Internal-only field.

    * + * @deprecated * @return null|int */ public function getLastMessageSequenceNumber() @@ -553,6 +702,7 @@ public function getLastMessageSequenceNumber() *

    Set when this order was created from a cart. * The cart will have the state Ordered.

    * + * @return null|CartReference */ public function getCart() @@ -563,6 +713,7 @@ public function getCart() /** *

    Set when this order was created from a quote.

    * + * @return null|QuoteReference */ public function getQuote() @@ -571,6 +722,7 @@ public function getQuote() } /** + * @return null|CustomFields */ public function getCustom() @@ -579,6 +731,7 @@ public function getCustom() } /** + * @return null|PaymentInfo */ public function getPaymentInfo() @@ -587,6 +740,7 @@ public function getPaymentInfo() } /** + * @return null|string */ public function getLocale() @@ -595,6 +749,7 @@ public function getLocale() } /** + * @return null|string */ public function getInventoryMode() @@ -603,6 +758,7 @@ public function getInventoryMode() } /** + * @return null|string */ public function getOrigin() @@ -613,6 +769,7 @@ public function getOrigin() /** *

    When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

    * + * @return null|string */ public function getTaxCalculationMode() @@ -623,6 +780,7 @@ public function getTaxCalculationMode() /** *

    The shippingRateInput is used as an input to select a ShippingRatePriceTier.

    * + * @return null|ShippingRateInput */ public function getShippingRateInput() @@ -633,6 +791,7 @@ public function getShippingRateInput() /** *

    Contains addresses for orders with multiple shipping addresses.

    * + * @return null|AddressCollection */ public function getItemShippingAddresses() @@ -643,6 +802,7 @@ public function getItemShippingAddresses() /** *

    Automatically filled when a line item with LineItemMode GiftLineItem is removed from this order.

    * + * @return null|CartDiscountReferenceCollection */ public function getRefusedGifts() @@ -771,6 +931,17 @@ public function withAnonymousId(?string $anonymousId) return $this; } + /** + * @param ?BusinessUnitKeyReference $businessUnit + * @return $this + */ + public function withBusinessUnit(?BusinessUnitKeyReference $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + /** * @param ?StoreKeyReference $store * @return $this @@ -826,6 +997,17 @@ public function withTaxedPrice(?TaxedPrice $taxedPrice) return $this; } + /** + * @param ?TaxedPrice $taxedShippingPrice + * @return $this + */ + public function withTaxedShippingPrice(?TaxedPrice $taxedShippingPrice) + { + $this->taxedShippingPrice = $taxedShippingPrice; + + return $this; + } + /** * @param ?Address $shippingAddress * @return $this @@ -848,6 +1030,28 @@ public function withBillingAddress(?Address $billingAddress) return $this; } + /** + * @param ?string $shippingMode + * @return $this + */ + public function withShippingMode(?string $shippingMode) + { + $this->shippingMode = $shippingMode; + + return $this; + } + + /** + * @param ?ShippingCollection $shipping + * @return $this + */ + public function withShipping(?ShippingCollection $shipping) + { + $this->shipping = $shipping; + + return $this; + } + /** * @param ?string $taxMode * @return $this @@ -1134,6 +1338,17 @@ public function withCreatedByBuilder(?CreatedByBuilder $createdBy) return $this; } + /** + * @deprecated use withBusinessUnit() instead + * @return $this + */ + public function withBusinessUnitBuilder(?BusinessUnitKeyReferenceBuilder $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + /** * @deprecated use withStore() instead * @return $this @@ -1167,6 +1382,17 @@ public function withTaxedPriceBuilder(?TaxedPriceBuilder $taxedPrice) return $this; } + /** + * @deprecated use withTaxedShippingPrice() instead + * @return $this + */ + public function withTaxedShippingPriceBuilder(?TaxedPriceBuilder $taxedShippingPrice) + { + $this->taxedShippingPrice = $taxedShippingPrice; + + return $this; + } + /** * @deprecated use withShippingAddress() instead * @return $this @@ -1291,13 +1517,17 @@ public function build(): Order $this->customerId, $this->customerEmail, $this->anonymousId, + $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit, $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store, $this->lineItems, $this->customLineItems, $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, $this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice, + $this->taxedShippingPrice instanceof TaxedPriceBuilder ? $this->taxedShippingPrice->build() : $this->taxedShippingPrice, $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress, + $this->shippingMode, + $this->shipping, $this->taxMode, $this->taxRoundingMode, $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup, diff --git a/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateAction.php b/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateAction.php index 71042147077..9b1e4d1439f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateAction.php @@ -16,6 +16,7 @@ interface OrderChangeOrderStateAction extends OrderUpdateAction public const FIELD_ORDER_STATE = 'orderState'; /** + * @return null|string */ public function getOrderState(); diff --git a/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateActionBuilder.php index c8ab0b80b72..28ec7c040fe 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateActionBuilder.php @@ -21,11 +21,13 @@ final class OrderChangeOrderStateActionBuilder implements Builder { /** + * @var ?string */ private $orderState; /** + * @return null|string */ public function getOrderState() diff --git a/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateActionModel.php index 04f7221f62b..8977a7325a8 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateActionModel.php @@ -21,11 +21,13 @@ final class OrderChangeOrderStateActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'changeOrderState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $orderState; @@ -35,13 +37,15 @@ final class OrderChangeOrderStateActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $orderState = null + ?string $orderState = null, + ?string $action = null ) { $this->orderState = $orderState; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getOrderState() diff --git a/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateAction.php b/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateAction.php index f4cf3de6b73..db06b37be93 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateAction.php @@ -16,6 +16,7 @@ interface OrderChangePaymentStateAction extends OrderUpdateAction public const FIELD_PAYMENT_STATE = 'paymentState'; /** + * @return null|string */ public function getPaymentState(); diff --git a/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateActionBuilder.php index 8d8df92435b..f8071ff1161 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateActionBuilder.php @@ -21,11 +21,13 @@ final class OrderChangePaymentStateActionBuilder implements Builder { /** + * @var ?string */ private $paymentState; /** + * @return null|string */ public function getPaymentState() diff --git a/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateActionModel.php index c69e8a03fc4..da6aa197fbb 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateActionModel.php @@ -21,11 +21,13 @@ final class OrderChangePaymentStateActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'changePaymentState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $paymentState; @@ -35,13 +37,15 @@ final class OrderChangePaymentStateActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?string $paymentState = null + ?string $paymentState = null, + ?string $action = null ) { $this->paymentState = $paymentState; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getPaymentState() diff --git a/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateAction.php b/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateAction.php index f3820caa92e..4d8d00f24da 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateAction.php @@ -16,6 +16,7 @@ interface OrderChangeShipmentStateAction extends OrderUpdateAction public const FIELD_SHIPMENT_STATE = 'shipmentState'; /** + * @return null|string */ public function getShipmentState(); diff --git a/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateActionBuilder.php index c9b4e2cd36e..2b6575692a7 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateActionBuilder.php @@ -21,11 +21,13 @@ final class OrderChangeShipmentStateActionBuilder implements Builder { /** + * @var ?string */ private $shipmentState; /** + * @return null|string */ public function getShipmentState() diff --git a/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateActionModel.php index 2febafa92e0..ad00204e01a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateActionModel.php @@ -21,11 +21,13 @@ final class OrderChangeShipmentStateActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'changeShipmentState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $shipmentState; @@ -35,13 +37,15 @@ final class OrderChangeShipmentStateActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?string $shipmentState = null + ?string $shipmentState = null, + ?string $action = null ) { $this->shipmentState = $shipmentState; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getShipmentState() diff --git a/lib/commercetools-api/src/Models/Order/OrderFromCartDraft.php b/lib/commercetools-api/src/Models/Order/OrderFromCartDraft.php index fd0639be180..36baa4d8199 100644 --- a/lib/commercetools-api/src/Models/Order/OrderFromCartDraft.php +++ b/lib/commercetools-api/src/Models/Order/OrderFromCartDraft.php @@ -29,18 +29,21 @@ interface OrderFromCartDraft extends JsonObject /** *

    Unique identifier of the Cart from which you can create an Order.

    * + * @deprecated * @return null|string */ public function getId(); /** - *

    ResourceIdentifier to the Cart from which this order is created.

    + *

    ResourceIdentifier of the Cart from which this order is created.

    * + * @return null|CartResourceIdentifier */ public function getCart(); /** + * @return null|int */ public function getVersion(); @@ -52,16 +55,19 @@ public function getVersion(); * Once it's set it cannot be changed. * For easier use on Get, Update and Delete actions we suggest assigning order numbers that match the regular expression [a-z0-9_-]{2,36}.

    * + * @return null|string */ public function getOrderNumber(); /** + * @return null|string */ public function getPaymentState(); /** + * @return null|string */ public function getShipmentState(); @@ -69,11 +75,13 @@ public function getShipmentState(); /** *

    Order will be created with Open status by default.

    * + * @return null|string */ public function getOrderState(); /** + * @return null|StateResourceIdentifier */ public function getState(); @@ -83,6 +91,7 @@ public function getState(); * If specified, the Custom Fields are merged with the Custom Fields on the referenced Cart and added to the Order. * If empty, the Custom Fields on the referenced Cart are added to the Order automatically.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Order/OrderFromCartDraftBuilder.php b/lib/commercetools-api/src/Models/Order/OrderFromCartDraftBuilder.php index cece605f657..92bf3706242 100644 --- a/lib/commercetools-api/src/Models/Order/OrderFromCartDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderFromCartDraftBuilder.php @@ -27,46 +27,55 @@ final class OrderFromCartDraftBuilder implements Builder { /** + * @deprecated * @var ?string */ private $id; /** + * @var null|CartResourceIdentifier|CartResourceIdentifierBuilder */ private $cart; /** + * @var ?int */ private $version; /** + * @var ?string */ private $orderNumber; /** + * @var ?string */ private $paymentState; /** + * @var ?string */ private $shipmentState; /** + * @var ?string */ private $orderState; /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $state; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; @@ -74,6 +83,7 @@ final class OrderFromCartDraftBuilder implements Builder /** *

    Unique identifier of the Cart from which you can create an Order.

    * + * @deprecated * @return null|string */ public function getId() @@ -82,8 +92,9 @@ public function getId() } /** - *

    ResourceIdentifier to the Cart from which this order is created.

    + *

    ResourceIdentifier of the Cart from which this order is created.

    * + * @return null|CartResourceIdentifier */ public function getCart() @@ -92,6 +103,7 @@ public function getCart() } /** + * @return null|int */ public function getVersion() @@ -106,6 +118,7 @@ public function getVersion() * Once it's set it cannot be changed. * For easier use on Get, Update and Delete actions we suggest assigning order numbers that match the regular expression [a-z0-9_-]{2,36}.

    * + * @return null|string */ public function getOrderNumber() @@ -114,6 +127,7 @@ public function getOrderNumber() } /** + * @return null|string */ public function getPaymentState() @@ -122,6 +136,7 @@ public function getPaymentState() } /** + * @return null|string */ public function getShipmentState() @@ -132,6 +147,7 @@ public function getShipmentState() /** *

    Order will be created with Open status by default.

    * + * @return null|string */ public function getOrderState() @@ -140,6 +156,7 @@ public function getOrderState() } /** + * @return null|StateResourceIdentifier */ public function getState() @@ -152,6 +169,7 @@ public function getState() * If specified, the Custom Fields are merged with the Custom Fields on the referenced Cart and added to the Order. * If empty, the Custom Fields on the referenced Cart are added to the Order automatically.

    * + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Order/OrderFromCartDraftModel.php b/lib/commercetools-api/src/Models/Order/OrderFromCartDraftModel.php index 5e05fab0e24..c9ecf1f5407 100644 --- a/lib/commercetools-api/src/Models/Order/OrderFromCartDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderFromCartDraftModel.php @@ -26,46 +26,55 @@ final class OrderFromCartDraftModel extends JsonObjectModel implements OrderFromCartDraft { /** + * @deprecated * @var ?string */ protected $id; /** + * * @var ?CartResourceIdentifier */ protected $cart; /** + * * @var ?int */ protected $version; /** + * * @var ?string */ protected $orderNumber; /** + * * @var ?string */ protected $paymentState; /** + * * @var ?string */ protected $shipmentState; /** + * * @var ?string */ protected $orderState; /** + * * @var ?StateResourceIdentifier */ protected $state; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -99,6 +108,7 @@ public function __construct( /** *

    Unique identifier of the Cart from which you can create an Order.

    * + * @deprecated * @return null|string */ public function getId() @@ -116,7 +126,8 @@ public function getId() } /** - *

    ResourceIdentifier to the Cart from which this order is created.

    + *

    ResourceIdentifier of the Cart from which this order is created.

    + * * * @return null|CartResourceIdentifier */ @@ -136,6 +147,7 @@ public function getCart() } /** + * * @return null|int */ public function getVersion() @@ -159,6 +171,7 @@ public function getVersion() * Once it's set it cannot be changed. * For easier use on Get, Update and Delete actions we suggest assigning order numbers that match the regular expression [a-z0-9_-]{2,36}.

    * + * * @return null|string */ public function getOrderNumber() @@ -176,6 +189,7 @@ public function getOrderNumber() } /** + * * @return null|string */ public function getPaymentState() @@ -193,6 +207,7 @@ public function getPaymentState() } /** + * * @return null|string */ public function getShipmentState() @@ -212,6 +227,7 @@ public function getShipmentState() /** *

    Order will be created with Open status by default.

    * + * * @return null|string */ public function getOrderState() @@ -229,6 +245,7 @@ public function getOrderState() } /** + * * @return null|StateResourceIdentifier */ public function getState() @@ -251,6 +268,7 @@ public function getState() * If specified, the Custom Fields are merged with the Custom Fields on the referenced Cart and added to the Order. * If empty, the Custom Fields on the referenced Cart are added to the Order automatically.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraft.php b/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraft.php index c52797161e9..c79ed331bad 100644 --- a/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraft.php +++ b/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraft.php @@ -17,6 +17,7 @@ interface OrderFromQuoteDraft extends JsonObject { public const FIELD_QUOTE = 'quote'; public const FIELD_VERSION = 'version'; + public const FIELD_QUOTE_STATE_TO_ACCEPTED = 'quoteStateToAccepted'; public const FIELD_ORDER_NUMBER = 'orderNumber'; public const FIELD_PAYMENT_STATE = 'paymentState'; public const FIELD_SHIPMENT_STATE = 'shipmentState'; @@ -24,17 +25,29 @@ interface OrderFromQuoteDraft extends JsonObject public const FIELD_STATE = 'state'; /** - *

    ResourceIdentifier to the Quote from which this order is created. If the quote has QuoteState in Accepted, Declined or Withdrawn then the order creation will fail. The creation will also if the Quote has expired (validTo check).

    + *

    ResourceIdentifier of the Quote from which this Order is created. If the Quote has QuoteState in Accepted, Declined or Withdrawn then the order creation will fail. The creation will also fail if the Quote has expired (validTo check).

    * + * @return null|QuoteResourceIdentifier */ public function getQuote(); /** + *

    version of the Quote from which an Order is created.

    + * + * @return null|int */ public function getVersion(); + /** + *

    If true, the quoteState of the referenced Quote will be set to Accepted.

    + * + + * @return null|bool + */ + public function getQuoteStateToAccepted(); + /** *

    String that uniquely identifies an order. * It can be used to create more human-readable (in contrast to ID) identifier for the order. @@ -42,16 +55,19 @@ public function getVersion(); * Once it's set it cannot be changed. * For easier use on Get, Update and Delete actions we suggest assigning order numbers that match the regular expression [a-z0-9_-]{2,36}.

    * + * @return null|string */ public function getOrderNumber(); /** + * @return null|string */ public function getPaymentState(); /** + * @return null|string */ public function getShipmentState(); @@ -59,11 +75,13 @@ public function getShipmentState(); /** *

    Order will be created with Open status by default.

    * + * @return null|string */ public function getOrderState(); /** + * @return null|StateResourceIdentifier */ public function getState(); @@ -78,6 +96,11 @@ public function setQuote(?QuoteResourceIdentifier $quote): void; */ public function setVersion(?int $version): void; + /** + * @param ?bool $quoteStateToAccepted + */ + public function setQuoteStateToAccepted(?bool $quoteStateToAccepted): void; + /** * @param ?string $orderNumber */ diff --git a/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraftBuilder.php b/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraftBuilder.php index f0e892f57e9..e63945c1bcb 100644 --- a/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraftBuilder.php @@ -25,43 +25,57 @@ final class OrderFromQuoteDraftBuilder implements Builder { /** + * @var null|QuoteResourceIdentifier|QuoteResourceIdentifierBuilder */ private $quote; /** + * @var ?int */ private $version; /** + + * @var ?bool + */ + private $quoteStateToAccepted; + + /** + * @var ?string */ private $orderNumber; /** + * @var ?string */ private $paymentState; /** + * @var ?string */ private $shipmentState; /** + * @var ?string */ private $orderState; /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $state; /** - *

    ResourceIdentifier to the Quote from which this order is created. If the quote has QuoteState in Accepted, Declined or Withdrawn then the order creation will fail. The creation will also if the Quote has expired (validTo check).

    + *

    ResourceIdentifier of the Quote from which this Order is created. If the Quote has QuoteState in Accepted, Declined or Withdrawn then the order creation will fail. The creation will also fail if the Quote has expired (validTo check).

    * + * @return null|QuoteResourceIdentifier */ public function getQuote() @@ -70,6 +84,9 @@ public function getQuote() } /** + *

    version of the Quote from which an Order is created.

    + * + * @return null|int */ public function getVersion() @@ -77,6 +94,17 @@ public function getVersion() return $this->version; } + /** + *

    If true, the quoteState of the referenced Quote will be set to Accepted.

    + * + + * @return null|bool + */ + public function getQuoteStateToAccepted() + { + return $this->quoteStateToAccepted; + } + /** *

    String that uniquely identifies an order. * It can be used to create more human-readable (in contrast to ID) identifier for the order. @@ -84,6 +112,7 @@ public function getVersion() * Once it's set it cannot be changed. * For easier use on Get, Update and Delete actions we suggest assigning order numbers that match the regular expression [a-z0-9_-]{2,36}.

    * + * @return null|string */ public function getOrderNumber() @@ -92,6 +121,7 @@ public function getOrderNumber() } /** + * @return null|string */ public function getPaymentState() @@ -100,6 +130,7 @@ public function getPaymentState() } /** + * @return null|string */ public function getShipmentState() @@ -110,6 +141,7 @@ public function getShipmentState() /** *

    Order will be created with Open status by default.

    * + * @return null|string */ public function getOrderState() @@ -118,6 +150,7 @@ public function getOrderState() } /** + * @return null|StateResourceIdentifier */ public function getState() @@ -147,6 +180,17 @@ public function withVersion(?int $version) return $this; } + /** + * @param ?bool $quoteStateToAccepted + * @return $this + */ + public function withQuoteStateToAccepted(?bool $quoteStateToAccepted) + { + $this->quoteStateToAccepted = $quoteStateToAccepted; + + return $this; + } + /** * @param ?string $orderNumber * @return $this @@ -229,6 +273,7 @@ public function build(): OrderFromQuoteDraft return new OrderFromQuoteDraftModel( $this->quote instanceof QuoteResourceIdentifierBuilder ? $this->quote->build() : $this->quote, $this->version, + $this->quoteStateToAccepted, $this->orderNumber, $this->paymentState, $this->shipmentState, diff --git a/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraftModel.php b/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraftModel.php index 47cf3493ba6..ce98f88c985 100644 --- a/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraftModel.php @@ -24,36 +24,49 @@ final class OrderFromQuoteDraftModel extends JsonObjectModel implements OrderFromQuoteDraft { /** + * * @var ?QuoteResourceIdentifier */ protected $quote; /** + * * @var ?int */ protected $version; /** + * + * @var ?bool + */ + protected $quoteStateToAccepted; + + /** + * * @var ?string */ protected $orderNumber; /** + * * @var ?string */ protected $paymentState; /** + * * @var ?string */ protected $shipmentState; /** + * * @var ?string */ protected $orderState; /** + * * @var ?StateResourceIdentifier */ protected $state; @@ -65,6 +78,7 @@ final class OrderFromQuoteDraftModel extends JsonObjectModel implements OrderFro public function __construct( ?QuoteResourceIdentifier $quote = null, ?int $version = null, + ?bool $quoteStateToAccepted = null, ?string $orderNumber = null, ?string $paymentState = null, ?string $shipmentState = null, @@ -73,6 +87,7 @@ public function __construct( ) { $this->quote = $quote; $this->version = $version; + $this->quoteStateToAccepted = $quoteStateToAccepted; $this->orderNumber = $orderNumber; $this->paymentState = $paymentState; $this->shipmentState = $shipmentState; @@ -81,7 +96,8 @@ public function __construct( } /** - *

    ResourceIdentifier to the Quote from which this order is created. If the quote has QuoteState in Accepted, Declined or Withdrawn then the order creation will fail. The creation will also if the Quote has expired (validTo check).

    + *

    ResourceIdentifier of the Quote from which this Order is created. If the Quote has QuoteState in Accepted, Declined or Withdrawn then the order creation will fail. The creation will also fail if the Quote has expired (validTo check).

    + * * * @return null|QuoteResourceIdentifier */ @@ -101,6 +117,9 @@ public function getQuote() } /** + *

    version of the Quote from which an Order is created.

    + * + * * @return null|int */ public function getVersion() @@ -117,6 +136,26 @@ public function getVersion() return $this->version; } + /** + *

    If true, the quoteState of the referenced Quote will be set to Accepted.

    + * + * + * @return null|bool + */ + public function getQuoteStateToAccepted() + { + if (is_null($this->quoteStateToAccepted)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_QUOTE_STATE_TO_ACCEPTED); + if (is_null($data)) { + return null; + } + $this->quoteStateToAccepted = (bool) $data; + } + + return $this->quoteStateToAccepted; + } + /** *

    String that uniquely identifies an order. * It can be used to create more human-readable (in contrast to ID) identifier for the order. @@ -124,6 +163,7 @@ public function getVersion() * Once it's set it cannot be changed. * For easier use on Get, Update and Delete actions we suggest assigning order numbers that match the regular expression [a-z0-9_-]{2,36}.

    * + * * @return null|string */ public function getOrderNumber() @@ -141,6 +181,7 @@ public function getOrderNumber() } /** + * * @return null|string */ public function getPaymentState() @@ -158,6 +199,7 @@ public function getPaymentState() } /** + * * @return null|string */ public function getShipmentState() @@ -177,6 +219,7 @@ public function getShipmentState() /** *

    Order will be created with Open status by default.

    * + * * @return null|string */ public function getOrderState() @@ -194,6 +237,7 @@ public function getOrderState() } /** + * * @return null|StateResourceIdentifier */ public function getState() @@ -228,6 +272,14 @@ public function setVersion(?int $version): void $this->version = $version; } + /** + * @param ?bool $quoteStateToAccepted + */ + public function setQuoteStateToAccepted(?bool $quoteStateToAccepted): void + { + $this->quoteStateToAccepted = $quoteStateToAccepted; + } + /** * @param ?string $orderNumber */ diff --git a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateAction.php b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateAction.php index f02baf24839..f4fe4b1a667 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateAction.php @@ -17,11 +17,13 @@ interface OrderImportCustomLineItemStateAction extends OrderUpdateAction public const FIELD_STATE = 'state'; /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|ItemStateCollection */ public function getState(); diff --git a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionBuilder.php index aa3e0586a4e..ed4267b834c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionBuilder.php @@ -21,16 +21,19 @@ final class OrderImportCustomLineItemStateActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var ?ItemStateCollection */ private $state; /** + * @return null|string */ public function getCustomLineItemId() @@ -39,6 +42,7 @@ public function getCustomLineItemId() } /** + * @return null|ItemStateCollection */ public function getState() diff --git a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionModel.php index 14779aed177..e5192401f93 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionModel.php @@ -21,16 +21,19 @@ final class OrderImportCustomLineItemStateActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'importCustomLineItemState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?ItemStateCollection */ protected $state; @@ -41,14 +44,16 @@ final class OrderImportCustomLineItemStateActionModel extends JsonObjectModel im */ public function __construct( ?string $customLineItemId = null, - ?ItemStateCollection $state = null + ?ItemStateCollection $state = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->state = $state; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -83,6 +89,7 @@ public function getCustomLineItemId() } /** + * * @return null|ItemStateCollection */ public function getState() diff --git a/lib/commercetools-api/src/Models/Order/OrderImportDraft.php b/lib/commercetools-api/src/Models/Order/OrderImportDraft.php index ae8a1492b7a..97026b64eb9 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportDraft.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportDraft.php @@ -8,6 +8,7 @@ namespace Commercetools\Api\Models\Order; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifier; use Commercetools\Api\Models\Cart\CustomLineItemImportDraftCollection; use Commercetools\Api\Models\Cart\TaxedPriceDraft; use Commercetools\Api\Models\Common\BaseAddress; @@ -45,6 +46,7 @@ interface OrderImportDraft extends JsonObject public const FIELD_INVENTORY_MODE = 'inventoryMode'; public const FIELD_TAX_ROUNDING_MODE = 'taxRoundingMode'; public const FIELD_ITEM_SHIPPING_ADDRESSES = 'itemShippingAddresses'; + public const FIELD_BUSINESS_UNIT = 'businessUnit'; public const FIELD_STORE = 'store'; public const FIELD_ORIGIN = 'origin'; @@ -53,6 +55,7 @@ interface OrderImportDraft extends JsonObject * It can be used to create more human-readable (in contrast to ID) identifier for the order. * It should be unique within a project.

    * + * @return null|string */ public function getOrderNumber(); @@ -60,6 +63,7 @@ public function getOrderNumber(); /** *

    If given the customer with that ID must exist in the project.

    * + * @return null|string */ public function getCustomerId(); @@ -67,6 +71,7 @@ public function getCustomerId(); /** *

    The customer email can be used when no check against existing Customers is desired during order import.

    * + * @return null|string */ public function getCustomerEmail(); @@ -74,6 +79,7 @@ public function getCustomerEmail(); /** *

    If not given customLineItems must not be empty.

    * + * @return null|LineItemImportDraftCollection */ public function getLineItems(); @@ -81,11 +87,13 @@ public function getLineItems(); /** *

    If not given lineItems must not be empty.

    * + * @return null|CustomLineItemImportDraftCollection */ public function getCustomLineItems(); /** + * @return null|Money */ public function getTotalPrice(); @@ -94,16 +102,19 @@ public function getTotalPrice(); *

    Order Import does not support calculation of taxes. * When setting the draft the taxedPrice is to be provided.

    * + * @return null|TaxedPriceDraft */ public function getTaxedPrice(); /** + * @return null|BaseAddress */ public function getShippingAddress(); /** + * @return null|BaseAddress */ public function getBillingAddress(); @@ -112,6 +123,7 @@ public function getBillingAddress(); *

    Set when the customer is set and the customer is a member of a customer group. * Used for product variant price selection.

    * + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup(); @@ -120,6 +132,7 @@ public function getCustomerGroup(); *

    A two-digit country code as per ISO 3166-1 alpha-2. * Used for product variant price selection.

    * + * @return null|string */ public function getCountry(); @@ -127,6 +140,7 @@ public function getCountry(); /** *

    If not given the Open state will be assigned by default.

    * + * @return null|string */ public function getOrderState(); @@ -134,16 +148,19 @@ public function getOrderState(); /** *

    This reference can point to a state in a custom workflow.

    * + * @return null|StateReference */ public function getState(); /** + * @return null|string */ public function getShipmentState(); /** + * @return null|string */ public function getPaymentState(); @@ -151,16 +168,19 @@ public function getPaymentState(); /** *

    Set if the ShippingMethod is set.

    * + * @return null|ShippingInfoImportDraft */ public function getShippingInfo(); /** + * @return null|PaymentInfo */ public function getPaymentInfo(); /** + * @return null|DateTimeImmutable */ public function getCompletedAt(); @@ -168,6 +188,7 @@ public function getCompletedAt(); /** *

    The custom fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -175,6 +196,7 @@ public function getCustom(); /** *

    If not given the mode None will be assigned by default.

    * + * @return null|string */ public function getInventoryMode(); @@ -182,6 +204,7 @@ public function getInventoryMode(); /** *

    If not given the tax rounding mode HalfEven will be assigned by default.

    * + * @return null|string */ public function getTaxRoundingMode(); @@ -189,11 +212,21 @@ public function getTaxRoundingMode(); /** *

    Contains addresses for orders with multiple shipping addresses.

    * + * @return null|BaseAddressCollection */ public function getItemShippingAddresses(); /** + *

    The Business Unit the Cart belongs to.

    + * + + * @return null|BusinessUnitResourceIdentifier + */ + public function getBusinessUnit(); + + /** + * @return null|StoreResourceIdentifier */ public function getStore(); @@ -201,6 +234,7 @@ public function getStore(); /** *

    The default origin is Customer.

    * + * @return null|string */ public function getOrigin(); @@ -315,6 +349,11 @@ public function setTaxRoundingMode(?string $taxRoundingMode): void; */ public function setItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses): void; + /** + * @param ?BusinessUnitResourceIdentifier $businessUnit + */ + public function setBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit): void; + /** * @param ?StoreResourceIdentifier $store */ diff --git a/lib/commercetools-api/src/Models/Order/OrderImportDraftBuilder.php b/lib/commercetools-api/src/Models/Order/OrderImportDraftBuilder.php index 49a440d3eaf..69ff7a4d201 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportDraftBuilder.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Order; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifier; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifierBuilder; use Commercetools\Api\Models\Cart\CustomLineItemImportDraftCollection; use Commercetools\Api\Models\Cart\TaxedPriceDraft; use Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder; @@ -38,121 +40,151 @@ final class OrderImportDraftBuilder implements Builder { /** + * @var ?string */ private $orderNumber; /** + * @var ?string */ private $customerId; /** + * @var ?string */ private $customerEmail; /** + * @var ?LineItemImportDraftCollection */ private $lineItems; /** + * @var ?CustomLineItemImportDraftCollection */ private $customLineItems; /** + * @var null|Money|MoneyBuilder */ private $totalPrice; /** + * @var null|TaxedPriceDraft|TaxedPriceDraftBuilder */ private $taxedPrice; /** + * @var null|BaseAddress|BaseAddressBuilder */ private $shippingAddress; /** + * @var null|BaseAddress|BaseAddressBuilder */ private $billingAddress; /** + * @var null|CustomerGroupResourceIdentifier|CustomerGroupResourceIdentifierBuilder */ private $customerGroup; /** + * @var ?string */ private $country; /** + * @var ?string */ private $orderState; /** + * @var null|StateReference|StateReferenceBuilder */ private $state; /** + * @var ?string */ private $shipmentState; /** + * @var ?string */ private $paymentState; /** + * @var null|ShippingInfoImportDraft|ShippingInfoImportDraftBuilder */ private $shippingInfo; /** + * @var null|PaymentInfo|PaymentInfoBuilder */ private $paymentInfo; /** + * @var ?DateTimeImmutable */ private $completedAt; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var ?string */ private $inventoryMode; /** + * @var ?string */ private $taxRoundingMode; /** + * @var ?BaseAddressCollection */ private $itemShippingAddresses; /** + + * @var null|BusinessUnitResourceIdentifier|BusinessUnitResourceIdentifierBuilder + */ + private $businessUnit; + + /** + * @var null|StoreResourceIdentifier|StoreResourceIdentifierBuilder */ private $store; /** + * @var ?string */ private $origin; @@ -162,6 +194,7 @@ final class OrderImportDraftBuilder implements Builder * It can be used to create more human-readable (in contrast to ID) identifier for the order. * It should be unique within a project.

    * + * @return null|string */ public function getOrderNumber() @@ -172,6 +205,7 @@ public function getOrderNumber() /** *

    If given the customer with that ID must exist in the project.

    * + * @return null|string */ public function getCustomerId() @@ -182,6 +216,7 @@ public function getCustomerId() /** *

    The customer email can be used when no check against existing Customers is desired during order import.

    * + * @return null|string */ public function getCustomerEmail() @@ -192,6 +227,7 @@ public function getCustomerEmail() /** *

    If not given customLineItems must not be empty.

    * + * @return null|LineItemImportDraftCollection */ public function getLineItems() @@ -202,6 +238,7 @@ public function getLineItems() /** *

    If not given lineItems must not be empty.

    * + * @return null|CustomLineItemImportDraftCollection */ public function getCustomLineItems() @@ -210,6 +247,7 @@ public function getCustomLineItems() } /** + * @return null|Money */ public function getTotalPrice() @@ -221,6 +259,7 @@ public function getTotalPrice() *

    Order Import does not support calculation of taxes. * When setting the draft the taxedPrice is to be provided.

    * + * @return null|TaxedPriceDraft */ public function getTaxedPrice() @@ -229,6 +268,7 @@ public function getTaxedPrice() } /** + * @return null|BaseAddress */ public function getShippingAddress() @@ -237,6 +277,7 @@ public function getShippingAddress() } /** + * @return null|BaseAddress */ public function getBillingAddress() @@ -248,6 +289,7 @@ public function getBillingAddress() *

    Set when the customer is set and the customer is a member of a customer group. * Used for product variant price selection.

    * + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() @@ -259,6 +301,7 @@ public function getCustomerGroup() *

    A two-digit country code as per ISO 3166-1 alpha-2. * Used for product variant price selection.

    * + * @return null|string */ public function getCountry() @@ -269,6 +312,7 @@ public function getCountry() /** *

    If not given the Open state will be assigned by default.

    * + * @return null|string */ public function getOrderState() @@ -279,6 +323,7 @@ public function getOrderState() /** *

    This reference can point to a state in a custom workflow.

    * + * @return null|StateReference */ public function getState() @@ -287,6 +332,7 @@ public function getState() } /** + * @return null|string */ public function getShipmentState() @@ -295,6 +341,7 @@ public function getShipmentState() } /** + * @return null|string */ public function getPaymentState() @@ -305,6 +352,7 @@ public function getPaymentState() /** *

    Set if the ShippingMethod is set.

    * + * @return null|ShippingInfoImportDraft */ public function getShippingInfo() @@ -313,6 +361,7 @@ public function getShippingInfo() } /** + * @return null|PaymentInfo */ public function getPaymentInfo() @@ -321,6 +370,7 @@ public function getPaymentInfo() } /** + * @return null|DateTimeImmutable */ public function getCompletedAt() @@ -331,6 +381,7 @@ public function getCompletedAt() /** *

    The custom fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -341,6 +392,7 @@ public function getCustom() /** *

    If not given the mode None will be assigned by default.

    * + * @return null|string */ public function getInventoryMode() @@ -351,6 +403,7 @@ public function getInventoryMode() /** *

    If not given the tax rounding mode HalfEven will be assigned by default.

    * + * @return null|string */ public function getTaxRoundingMode() @@ -361,6 +414,7 @@ public function getTaxRoundingMode() /** *

    Contains addresses for orders with multiple shipping addresses.

    * + * @return null|BaseAddressCollection */ public function getItemShippingAddresses() @@ -369,6 +423,18 @@ public function getItemShippingAddresses() } /** + *

    The Business Unit the Cart belongs to.

    + * + + * @return null|BusinessUnitResourceIdentifier + */ + public function getBusinessUnit() + { + return $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit; + } + + /** + * @return null|StoreResourceIdentifier */ public function getStore() @@ -379,6 +445,7 @@ public function getStore() /** *

    The default origin is Customer.

    * + * @return null|string */ public function getOrigin() @@ -628,6 +695,17 @@ public function withItemShippingAddresses(?BaseAddressCollection $itemShippingAd return $this; } + /** + * @param ?BusinessUnitResourceIdentifier $businessUnit + * @return $this + */ + public function withBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + /** * @param ?StoreResourceIdentifier $store * @return $this @@ -749,6 +827,17 @@ public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) return $this; } + /** + * @deprecated use withBusinessUnit() instead + * @return $this + */ + public function withBusinessUnitBuilder(?BusinessUnitResourceIdentifierBuilder $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + /** * @deprecated use withStore() instead * @return $this @@ -785,6 +874,7 @@ public function build(): OrderImportDraft $this->inventoryMode, $this->taxRoundingMode, $this->itemShippingAddresses, + $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit, $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store, $this->origin ); diff --git a/lib/commercetools-api/src/Models/Order/OrderImportDraftModel.php b/lib/commercetools-api/src/Models/Order/OrderImportDraftModel.php index bea4a2abfb5..0123995d63a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportDraftModel.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Order; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifier; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifierModel; use Commercetools\Api\Models\Cart\CustomLineItemImportDraftCollection; use Commercetools\Api\Models\Cart\TaxedPriceDraft; use Commercetools\Api\Models\Cart\TaxedPriceDraftModel; @@ -37,121 +39,151 @@ final class OrderImportDraftModel extends JsonObjectModel implements OrderImportDraft { /** + * * @var ?string */ protected $orderNumber; /** + * * @var ?string */ protected $customerId; /** + * * @var ?string */ protected $customerEmail; /** + * * @var ?LineItemImportDraftCollection */ protected $lineItems; /** + * * @var ?CustomLineItemImportDraftCollection */ protected $customLineItems; /** + * * @var ?Money */ protected $totalPrice; /** + * * @var ?TaxedPriceDraft */ protected $taxedPrice; /** + * * @var ?BaseAddress */ protected $shippingAddress; /** + * * @var ?BaseAddress */ protected $billingAddress; /** + * * @var ?CustomerGroupResourceIdentifier */ protected $customerGroup; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $orderState; /** + * * @var ?StateReference */ protected $state; /** + * * @var ?string */ protected $shipmentState; /** + * * @var ?string */ protected $paymentState; /** + * * @var ?ShippingInfoImportDraft */ protected $shippingInfo; /** + * * @var ?PaymentInfo */ protected $paymentInfo; /** + * * @var ?DateTimeImmutable */ protected $completedAt; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?string */ protected $inventoryMode; /** + * * @var ?string */ protected $taxRoundingMode; /** + * * @var ?BaseAddressCollection */ protected $itemShippingAddresses; /** + * + * @var ?BusinessUnitResourceIdentifier + */ + protected $businessUnit; + + /** + * * @var ?StoreResourceIdentifier */ protected $store; /** + * * @var ?string */ protected $origin; @@ -183,6 +215,7 @@ public function __construct( ?string $inventoryMode = null, ?string $taxRoundingMode = null, ?BaseAddressCollection $itemShippingAddresses = null, + ?BusinessUnitResourceIdentifier $businessUnit = null, ?StoreResourceIdentifier $store = null, ?string $origin = null ) { @@ -208,6 +241,7 @@ public function __construct( $this->inventoryMode = $inventoryMode; $this->taxRoundingMode = $taxRoundingMode; $this->itemShippingAddresses = $itemShippingAddresses; + $this->businessUnit = $businessUnit; $this->store = $store; $this->origin = $origin; } @@ -217,6 +251,7 @@ public function __construct( * It can be used to create more human-readable (in contrast to ID) identifier for the order. * It should be unique within a project.

    * + * * @return null|string */ public function getOrderNumber() @@ -236,6 +271,7 @@ public function getOrderNumber() /** *

    If given the customer with that ID must exist in the project.

    * + * * @return null|string */ public function getCustomerId() @@ -255,6 +291,7 @@ public function getCustomerId() /** *

    The customer email can be used when no check against existing Customers is desired during order import.

    * + * * @return null|string */ public function getCustomerEmail() @@ -274,6 +311,7 @@ public function getCustomerEmail() /** *

    If not given customLineItems must not be empty.

    * + * * @return null|LineItemImportDraftCollection */ public function getLineItems() @@ -293,6 +331,7 @@ public function getLineItems() /** *

    If not given lineItems must not be empty.

    * + * * @return null|CustomLineItemImportDraftCollection */ public function getCustomLineItems() @@ -310,6 +349,7 @@ public function getCustomLineItems() } /** + * * @return null|Money */ public function getTotalPrice() @@ -331,6 +371,7 @@ public function getTotalPrice() *

    Order Import does not support calculation of taxes. * When setting the draft the taxedPrice is to be provided.

    * + * * @return null|TaxedPriceDraft */ public function getTaxedPrice() @@ -349,6 +390,7 @@ public function getTaxedPrice() } /** + * * @return null|BaseAddress */ public function getShippingAddress() @@ -367,6 +409,7 @@ public function getShippingAddress() } /** + * * @return null|BaseAddress */ public function getBillingAddress() @@ -388,6 +431,7 @@ public function getBillingAddress() *

    Set when the customer is set and the customer is a member of a customer group. * Used for product variant price selection.

    * + * * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() @@ -409,6 +453,7 @@ public function getCustomerGroup() *

    A two-digit country code as per ISO 3166-1 alpha-2. * Used for product variant price selection.

    * + * * @return null|string */ public function getCountry() @@ -428,6 +473,7 @@ public function getCountry() /** *

    If not given the Open state will be assigned by default.

    * + * * @return null|string */ public function getOrderState() @@ -447,6 +493,7 @@ public function getOrderState() /** *

    This reference can point to a state in a custom workflow.

    * + * * @return null|StateReference */ public function getState() @@ -465,6 +512,7 @@ public function getState() } /** + * * @return null|string */ public function getShipmentState() @@ -482,6 +530,7 @@ public function getShipmentState() } /** + * * @return null|string */ public function getPaymentState() @@ -501,6 +550,7 @@ public function getPaymentState() /** *

    Set if the ShippingMethod is set.

    * + * * @return null|ShippingInfoImportDraft */ public function getShippingInfo() @@ -519,6 +569,7 @@ public function getShippingInfo() } /** + * * @return null|PaymentInfo */ public function getPaymentInfo() @@ -537,6 +588,7 @@ public function getPaymentInfo() } /** + * * @return null|DateTimeImmutable */ public function getCompletedAt() @@ -560,6 +612,7 @@ public function getCompletedAt() /** *

    The custom fields.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -580,6 +633,7 @@ public function getCustom() /** *

    If not given the mode None will be assigned by default.

    * + * * @return null|string */ public function getInventoryMode() @@ -599,6 +653,7 @@ public function getInventoryMode() /** *

    If not given the tax rounding mode HalfEven will be assigned by default.

    * + * * @return null|string */ public function getTaxRoundingMode() @@ -618,6 +673,7 @@ public function getTaxRoundingMode() /** *

    Contains addresses for orders with multiple shipping addresses.

    * + * * @return null|BaseAddressCollection */ public function getItemShippingAddresses() @@ -635,6 +691,28 @@ public function getItemShippingAddresses() } /** + *

    The Business Unit the Cart belongs to.

    + * + * + * @return null|BusinessUnitResourceIdentifier + */ + public function getBusinessUnit() + { + if (is_null($this->businessUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BUSINESS_UNIT); + if (is_null($data)) { + return null; + } + + $this->businessUnit = BusinessUnitResourceIdentifierModel::of($data); + } + + return $this->businessUnit; + } + + /** + * * @return null|StoreResourceIdentifier */ public function getStore() @@ -655,6 +733,7 @@ public function getStore() /** *

    The default origin is Customer.

    * + * * @return null|string */ public function getOrigin() @@ -848,6 +927,14 @@ public function setItemShippingAddresses(?BaseAddressCollection $itemShippingAdd $this->itemShippingAddresses = $itemShippingAddresses; } + /** + * @param ?BusinessUnitResourceIdentifier $businessUnit + */ + public function setBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit): void + { + $this->businessUnit = $businessUnit; + } + /** * @param ?StoreResourceIdentifier $store */ diff --git a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateAction.php b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateAction.php index f7069e0194a..e43b5428731 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateAction.php @@ -17,11 +17,13 @@ interface OrderImportLineItemStateAction extends OrderUpdateAction public const FIELD_STATE = 'state'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|ItemStateCollection */ public function getState(); diff --git a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionBuilder.php index a33da42ae3b..20e58e8d73f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionBuilder.php @@ -21,16 +21,19 @@ final class OrderImportLineItemStateActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?ItemStateCollection */ private $state; /** + * @return null|string */ public function getLineItemId() @@ -39,6 +42,7 @@ public function getLineItemId() } /** + * @return null|ItemStateCollection */ public function getState() diff --git a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionModel.php index 6be7c73b1a0..a3f60473283 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionModel.php @@ -21,16 +21,19 @@ final class OrderImportLineItemStateActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'importLineItemState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ItemStateCollection */ protected $state; @@ -41,14 +44,16 @@ final class OrderImportLineItemStateActionModel extends JsonObjectModel implemen */ public function __construct( ?string $lineItemId = null, - ?ItemStateCollection $state = null + ?ItemStateCollection $state = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->state = $state; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -83,6 +89,7 @@ public function getLineItemId() } /** + * * @return null|ItemStateCollection */ public function getState() diff --git a/lib/commercetools-api/src/Models/Order/OrderModel.php b/lib/commercetools-api/src/Models/Order/OrderModel.php index a861d687f50..521fd000f8c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderModel.php @@ -8,11 +8,14 @@ namespace Commercetools\Api\Models\Order; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceModel; use Commercetools\Api\Models\Cart\CartReference; use Commercetools\Api\Models\Cart\CartReferenceModel; use Commercetools\Api\Models\Cart\CustomLineItemCollection; use Commercetools\Api\Models\Cart\DiscountCodeInfoCollection; use Commercetools\Api\Models\Cart\LineItemCollection; +use Commercetools\Api\Models\Cart\ShippingCollection; use Commercetools\Api\Models\Cart\ShippingInfo; use Commercetools\Api\Models\Cart\ShippingInfoModel; use Commercetools\Api\Models\Cart\ShippingRateInput; @@ -56,211 +59,277 @@ final class OrderModel extends JsonObjectModel implements Order { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?DateTimeImmutable */ protected $completedAt; /** + * * @var ?string */ protected $orderNumber; /** + * * @var ?string */ protected $customerId; /** + * * @var ?string */ protected $customerEmail; /** + * * @var ?string */ protected $anonymousId; /** + * + * @var ?BusinessUnitKeyReference + */ + protected $businessUnit; + + /** + * * @var ?StoreKeyReference */ protected $store; /** + * * @var ?LineItemCollection */ protected $lineItems; /** + * * @var ?CustomLineItemCollection */ protected $customLineItems; /** + * * @var ?TypedMoney */ protected $totalPrice; /** + * * @var ?TaxedPrice */ protected $taxedPrice; /** + * + * @var ?TaxedPrice + */ + protected $taxedShippingPrice; + + /** + * * @var ?Address */ protected $shippingAddress; /** + * * @var ?Address */ protected $billingAddress; /** + * + * @var ?string + */ + protected $shippingMode; + + /** + * + * @var ?ShippingCollection + */ + protected $shipping; + + /** + * * @var ?string */ protected $taxMode; /** + * * @var ?string */ protected $taxRoundingMode; /** + * * @var ?CustomerGroupReference */ protected $customerGroup; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $orderState; /** + * * @var ?StateReference */ protected $state; /** + * * @var ?string */ protected $shipmentState; /** + * * @var ?string */ protected $paymentState; /** + * * @var ?ShippingInfo */ protected $shippingInfo; /** + * * @var ?SyncInfoCollection */ protected $syncInfo; /** + * * @var ?ReturnInfoCollection */ protected $returnInfo; /** + * * @var ?DiscountCodeInfoCollection */ protected $discountCodes; /** + * @deprecated * @var ?int */ protected $lastMessageSequenceNumber; /** + * * @var ?CartReference */ protected $cart; /** + * * @var ?QuoteReference */ protected $quote; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?PaymentInfo */ protected $paymentInfo; /** + * * @var ?string */ protected $locale; /** + * * @var ?string */ protected $inventoryMode; /** + * * @var ?string */ protected $origin; /** + * * @var ?string */ protected $taxCalculationMode; /** + * * @var ?ShippingRateInput */ protected $shippingRateInput; /** + * * @var ?AddressCollection */ protected $itemShippingAddresses; /** + * * @var ?CartDiscountReferenceCollection */ protected $refusedGifts; @@ -281,13 +350,17 @@ public function __construct( ?string $customerId = null, ?string $customerEmail = null, ?string $anonymousId = null, + ?BusinessUnitKeyReference $businessUnit = null, ?StoreKeyReference $store = null, ?LineItemCollection $lineItems = null, ?CustomLineItemCollection $customLineItems = null, ?TypedMoney $totalPrice = null, ?TaxedPrice $taxedPrice = null, + ?TaxedPrice $taxedShippingPrice = null, ?Address $shippingAddress = null, ?Address $billingAddress = null, + ?string $shippingMode = null, + ?ShippingCollection $shipping = null, ?string $taxMode = null, ?string $taxRoundingMode = null, ?CustomerGroupReference $customerGroup = null, @@ -324,13 +397,17 @@ public function __construct( $this->customerId = $customerId; $this->customerEmail = $customerEmail; $this->anonymousId = $anonymousId; + $this->businessUnit = $businessUnit; $this->store = $store; $this->lineItems = $lineItems; $this->customLineItems = $customLineItems; $this->totalPrice = $totalPrice; $this->taxedPrice = $taxedPrice; + $this->taxedShippingPrice = $taxedShippingPrice; $this->shippingAddress = $shippingAddress; $this->billingAddress = $billingAddress; + $this->shippingMode = $shippingMode; + $this->shipping = $shipping; $this->taxMode = $taxMode; $this->taxRoundingMode = $taxRoundingMode; $this->customerGroup = $customerGroup; @@ -360,6 +437,7 @@ public function __construct( /** *

    Unique identifier of the Order.

    * + * * @return null|string */ public function getId() @@ -379,6 +457,7 @@ public function getId() /** *

    The current version of the order.

    * + * * @return null|int */ public function getVersion() @@ -396,6 +475,7 @@ public function getVersion() } /** + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -417,6 +497,7 @@ public function getCreatedAt() } /** + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -440,6 +521,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -460,6 +542,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -480,6 +563,7 @@ public function getCreatedBy() /** *

    This field will only be present if it was set for Order Import

    * + * * @return null|DateTimeImmutable */ public function getCompletedAt() @@ -506,6 +590,7 @@ public function getCompletedAt() * It should be unique across a project. * Once it's set it cannot be changed.

    * + * * @return null|string */ public function getOrderNumber() @@ -523,6 +608,7 @@ public function getOrderNumber() } /** + * * @return null|string */ public function getCustomerId() @@ -540,6 +626,7 @@ public function getCustomerId() } /** + * * @return null|string */ public function getCustomerEmail() @@ -559,6 +646,7 @@ public function getCustomerEmail() /** *

    Identifies carts and orders belonging to an anonymous session (the customer has not signed up/in yet).

    * + * * @return null|string */ public function getAnonymousId() @@ -576,6 +664,28 @@ public function getAnonymousId() } /** + *

    The Business Unit the Order belongs to.

    + * + * + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit() + { + if (is_null($this->businessUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BUSINESS_UNIT); + if (is_null($data)) { + return null; + } + + $this->businessUnit = BusinessUnitKeyReferenceModel::of($data); + } + + return $this->businessUnit; + } + + /** + * * @return null|StoreKeyReference */ public function getStore() @@ -594,6 +704,7 @@ public function getStore() } /** + * * @return null|LineItemCollection */ public function getLineItems() @@ -611,6 +722,7 @@ public function getLineItems() } /** + * * @return null|CustomLineItemCollection */ public function getCustomLineItems() @@ -628,6 +740,7 @@ public function getCustomLineItems() } /** + * * @return null|TypedMoney */ public function getTotalPrice() @@ -648,6 +761,7 @@ public function getTotalPrice() /** *

    The taxes are calculated based on the shipping address.

    * + * * @return null|TaxedPrice */ public function getTaxedPrice() @@ -666,6 +780,32 @@ public function getTaxedPrice() } /** + *

    Sum of taxedPrice of ShippingInfo across all Shipping Methods. + * For Platform TaxMode, it is set automatically only if shipping address is set or Shipping Method is added to the Cart.

    + * + * + * @return null|TaxedPrice + */ + public function getTaxedShippingPrice() + { + if (is_null($this->taxedShippingPrice)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TAXED_SHIPPING_PRICE); + if (is_null($data)) { + return null; + } + + $this->taxedShippingPrice = TaxedPriceModel::of($data); + } + + return $this->taxedShippingPrice; + } + + /** + *

    Holds all shipping-related information per Shipping Method.

    + *

    For Multi ShippingMode, it is updated automatically after the Shipping Methods are added.

    + * + * * @return null|Address */ public function getShippingAddress() @@ -684,6 +824,7 @@ public function getShippingAddress() } /** + * * @return null|Address */ public function getBillingAddress() @@ -702,6 +843,48 @@ public function getBillingAddress() } /** + *

    Indicates whether one or multiple Shipping Methods are added to the Cart.

    + * + * + * @return null|string + */ + public function getShippingMode() + { + if (is_null($this->shippingMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_MODE); + if (is_null($data)) { + return null; + } + $this->shippingMode = (string) $data; + } + + return $this->shippingMode; + } + + /** + *

    Holds all shipping-related information per Shipping Method for Multi ShippingMode.

    + *

    It is updated automatically after the Shipping Method is added.

    + * + * + * @return null|ShippingCollection + */ + public function getShipping() + { + if (is_null($this->shipping)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SHIPPING); + if (is_null($data)) { + return null; + } + $this->shipping = ShippingCollection::fromArray($data); + } + + return $this->shipping; + } + + /** + * * @return null|string */ public function getTaxMode() @@ -721,6 +904,7 @@ public function getTaxMode() /** *

    When calculating taxes for taxedPrice, the selected mode is used for rouding.

    * + * * @return null|string */ public function getTaxRoundingMode() @@ -741,6 +925,7 @@ public function getTaxRoundingMode() *

    Set when the customer is set and the customer is a member of a customer group. * Used for product variant price selection.

    * + * * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -762,6 +947,7 @@ public function getCustomerGroup() *

    A two-digit country code as per ISO 3166-1 alpha-2. * Used for product variant price selection.

    * + * * @return null|string */ public function getCountry() @@ -781,6 +967,7 @@ public function getCountry() /** *

    One of the four predefined OrderStates.

    * + * * @return null|string */ public function getOrderState() @@ -800,6 +987,7 @@ public function getOrderState() /** *

    This reference can point to a state in a custom workflow.

    * + * * @return null|StateReference */ public function getState() @@ -818,6 +1006,7 @@ public function getState() } /** + * * @return null|string */ public function getShipmentState() @@ -835,6 +1024,7 @@ public function getShipmentState() } /** + * * @return null|string */ public function getPaymentState() @@ -854,6 +1044,7 @@ public function getPaymentState() /** *

    Set if the ShippingMethod is set.

    * + * * @return null|ShippingInfo */ public function getShippingInfo() @@ -872,6 +1063,7 @@ public function getShippingInfo() } /** + * * @return null|SyncInfoCollection */ public function getSyncInfo() @@ -889,6 +1081,7 @@ public function getSyncInfo() } /** + * * @return null|ReturnInfoCollection */ public function getReturnInfo() @@ -906,6 +1099,7 @@ public function getReturnInfo() } /** + * * @return null|DiscountCodeInfoCollection */ public function getDiscountCodes() @@ -925,6 +1119,7 @@ public function getDiscountCodes() /** *

    Internal-only field.

    * + * @deprecated * @return null|int */ public function getLastMessageSequenceNumber() @@ -945,6 +1140,7 @@ public function getLastMessageSequenceNumber() *

    Set when this order was created from a cart. * The cart will have the state Ordered.

    * + * * @return null|CartReference */ public function getCart() @@ -965,6 +1161,7 @@ public function getCart() /** *

    Set when this order was created from a quote.

    * + * * @return null|QuoteReference */ public function getQuote() @@ -983,6 +1180,7 @@ public function getQuote() } /** + * * @return null|CustomFields */ public function getCustom() @@ -1001,6 +1199,7 @@ public function getCustom() } /** + * * @return null|PaymentInfo */ public function getPaymentInfo() @@ -1019,6 +1218,7 @@ public function getPaymentInfo() } /** + * * @return null|string */ public function getLocale() @@ -1036,6 +1236,7 @@ public function getLocale() } /** + * * @return null|string */ public function getInventoryMode() @@ -1053,6 +1254,7 @@ public function getInventoryMode() } /** + * * @return null|string */ public function getOrigin() @@ -1072,6 +1274,7 @@ public function getOrigin() /** *

    When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

    * + * * @return null|string */ public function getTaxCalculationMode() @@ -1091,6 +1294,7 @@ public function getTaxCalculationMode() /** *

    The shippingRateInput is used as an input to select a ShippingRatePriceTier.

    * + * * @return null|ShippingRateInput */ public function getShippingRateInput() @@ -1111,6 +1315,7 @@ public function getShippingRateInput() /** *

    Contains addresses for orders with multiple shipping addresses.

    * + * * @return null|AddressCollection */ public function getItemShippingAddresses() @@ -1130,6 +1335,7 @@ public function getItemShippingAddresses() /** *

    Automatically filled when a line item with LineItemMode GiftLineItem is removed from this order.

    * + * * @return null|CartDiscountReferenceCollection */ public function getRefusedGifts() @@ -1235,6 +1441,14 @@ public function setAnonymousId(?string $anonymousId): void $this->anonymousId = $anonymousId; } + /** + * @param ?BusinessUnitKeyReference $businessUnit + */ + public function setBusinessUnit(?BusinessUnitKeyReference $businessUnit): void + { + $this->businessUnit = $businessUnit; + } + /** * @param ?StoreKeyReference $store */ @@ -1275,6 +1489,14 @@ public function setTaxedPrice(?TaxedPrice $taxedPrice): void $this->taxedPrice = $taxedPrice; } + /** + * @param ?TaxedPrice $taxedShippingPrice + */ + public function setTaxedShippingPrice(?TaxedPrice $taxedShippingPrice): void + { + $this->taxedShippingPrice = $taxedShippingPrice; + } + /** * @param ?Address $shippingAddress */ @@ -1291,6 +1513,22 @@ public function setBillingAddress(?Address $billingAddress): void $this->billingAddress = $billingAddress; } + /** + * @param ?string $shippingMode + */ + public function setShippingMode(?string $shippingMode): void + { + $this->shippingMode = $shippingMode; + } + + /** + * @param ?ShippingCollection $shipping + */ + public function setShipping(?ShippingCollection $shipping): void + { + $this->shipping = $shipping; + } + /** * @param ?string $taxMode */ diff --git a/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponse.php b/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponse.php index 6f540a1c049..e17e93a0fe5 100644 --- a/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponse.php @@ -22,16 +22,19 @@ interface OrderPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); /** + * @return null|int */ public function getCount(); /** + * @return null|int */ public function getTotal(); @@ -39,11 +42,13 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); /** + * @return null|OrderCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponseBuilder.php index 7032334d747..fc2a10893ac 100644 --- a/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class OrderPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?OrderCollection */ private $results; @@ -48,6 +53,7 @@ final class OrderPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -56,6 +62,7 @@ public function getLimit() } /** + * @return null|int */ public function getCount() @@ -64,6 +71,7 @@ public function getCount() } /** + * @return null|int */ public function getTotal() @@ -74,6 +82,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -82,6 +91,7 @@ public function getOffset() } /** + * @return null|OrderCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponseModel.php index ca4207e68ce..8d863fd0bc2 100644 --- a/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class OrderPagedQueryResponseModel extends JsonObjectModel implements OrderPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?OrderCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -82,6 +88,7 @@ public function getLimit() } /** + * * @return null|int */ public function getCount() @@ -99,6 +106,7 @@ public function getCount() } /** + * * @return null|int */ public function getTotal() @@ -118,6 +126,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -135,6 +144,7 @@ public function getOffset() } /** + * * @return null|OrderCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Order/OrderPagedSearchResponse.php b/lib/commercetools-api/src/Models/Order/OrderPagedSearchResponse.php index 74f35f6bd71..fee45ec5109 100644 --- a/lib/commercetools-api/src/Models/Order/OrderPagedSearchResponse.php +++ b/lib/commercetools-api/src/Models/Order/OrderPagedSearchResponse.php @@ -21,6 +21,7 @@ interface OrderPagedSearchResponse extends JsonObject /** *

    Total number of results matching the query.

    * + * @return null|int */ public function getTotal(); @@ -28,6 +29,7 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -35,6 +37,7 @@ public function getOffset(); /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -42,6 +45,7 @@ public function getLimit(); /** *

    Actual results.

    * + * @return null|HitCollection */ public function getHits(); diff --git a/lib/commercetools-api/src/Models/Order/OrderPagedSearchResponseBuilder.php b/lib/commercetools-api/src/Models/Order/OrderPagedSearchResponseBuilder.php index be7f5496c1d..b1da2b40527 100644 --- a/lib/commercetools-api/src/Models/Order/OrderPagedSearchResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderPagedSearchResponseBuilder.php @@ -21,21 +21,25 @@ final class OrderPagedSearchResponseBuilder implements Builder { /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $limit; /** + * @var ?HitCollection */ private $hits; @@ -43,6 +47,7 @@ final class OrderPagedSearchResponseBuilder implements Builder /** *

    Total number of results matching the query.

    * + * @return null|int */ public function getTotal() @@ -53,6 +58,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -63,6 +69,7 @@ public function getOffset() /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -73,6 +80,7 @@ public function getLimit() /** *

    Actual results.

    * + * @return null|HitCollection */ public function getHits() diff --git a/lib/commercetools-api/src/Models/Order/OrderPagedSearchResponseModel.php b/lib/commercetools-api/src/Models/Order/OrderPagedSearchResponseModel.php index a5a3215d7cf..686c53dbbe9 100644 --- a/lib/commercetools-api/src/Models/Order/OrderPagedSearchResponseModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderPagedSearchResponseModel.php @@ -20,21 +20,25 @@ final class OrderPagedSearchResponseModel extends JsonObjectModel implements OrderPagedSearchResponse { /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $limit; /** + * * @var ?HitCollection */ protected $hits; @@ -58,6 +62,7 @@ public function __construct( /** *

    Total number of results matching the query.

    * + * * @return null|int */ public function getTotal() @@ -77,6 +82,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -96,6 +102,7 @@ public function getOffset() /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -115,6 +122,7 @@ public function getLimit() /** *

    Actual results.

    * + * * @return null|HitCollection */ public function getHits() diff --git a/lib/commercetools-api/src/Models/Order/OrderReference.php b/lib/commercetools-api/src/Models/Order/OrderReference.php index a3323b8298d..271aa879b0c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderReference.php +++ b/lib/commercetools-api/src/Models/Order/OrderReference.php @@ -17,6 +17,7 @@ interface OrderReference extends Reference public const FIELD_OBJ = 'obj'; /** + * @return null|Order */ public function getObj(); diff --git a/lib/commercetools-api/src/Models/Order/OrderReferenceBuilder.php b/lib/commercetools-api/src/Models/Order/OrderReferenceBuilder.php index a87c32d7867..dd6cd5fed79 100644 --- a/lib/commercetools-api/src/Models/Order/OrderReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderReferenceBuilder.php @@ -23,11 +23,13 @@ final class OrderReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|Order|OrderBuilder */ private $obj; @@ -35,6 +37,7 @@ final class OrderReferenceBuilder implements Builder /** *

    Unique ID of the referenced resource.

    * + * @return null|string */ public function getId() @@ -43,6 +46,7 @@ public function getId() } /** + * @return null|Order */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Order/OrderReferenceModel.php b/lib/commercetools-api/src/Models/Order/OrderReferenceModel.php index cdd64b3cb3f..70a0c625fa9 100644 --- a/lib/commercetools-api/src/Models/Order/OrderReferenceModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderReferenceModel.php @@ -23,16 +23,19 @@ final class OrderReferenceModel extends JsonObjectModel implements OrderReferenc { public const DISCRIMINATOR_VALUE = 'order'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?Order */ protected $obj; @@ -43,16 +46,18 @@ final class OrderReferenceModel extends JsonObjectModel implements OrderReferenc */ public function __construct( ?string $id = null, - ?Order $obj = null + ?Order $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique ID of the referenced resource.

    * + * * @return null|string */ public function getId() @@ -89,6 +95,7 @@ public function getId() } /** + * * @return null|Order */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryAction.php b/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryAction.php index 8cdcd78a3d3..03c11970192 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryAction.php @@ -16,6 +16,7 @@ interface OrderRemoveDeliveryAction extends OrderUpdateAction public const FIELD_DELIVERY_ID = 'deliveryId'; /** + * @return null|string */ public function getDeliveryId(); diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryActionBuilder.php index f1f120d008a..d0dcd42b17c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryActionBuilder.php @@ -21,11 +21,13 @@ final class OrderRemoveDeliveryActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @return null|string */ public function getDeliveryId() diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryActionModel.php b/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryActionModel.php index 5146bdd82ce..e3cf4446992 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryActionModel.php @@ -21,11 +21,13 @@ final class OrderRemoveDeliveryActionModel extends JsonObjectModel implements Or { public const DISCRIMINATOR_VALUE = 'removeDelivery'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; @@ -35,13 +37,15 @@ final class OrderRemoveDeliveryActionModel extends JsonObjectModel implements Or * @psalm-suppress MissingParamType */ public function __construct( - ?string $deliveryId = null + ?string $deliveryId = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressAction.php index e6cd0f45b3c..500f7474732 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressAction.php @@ -16,6 +16,7 @@ interface OrderRemoveItemShippingAddressAction extends OrderUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressActionBuilder.php index 272ade5adbd..c985bce43ab 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressActionBuilder.php @@ -21,11 +21,13 @@ final class OrderRemoveItemShippingAddressActionBuilder implements Builder { /** + * @var ?string */ private $addressKey; /** + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressActionModel.php index 7a789f4b2ff..faae6e4fc6c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressActionModel.php @@ -21,11 +21,13 @@ final class OrderRemoveItemShippingAddressActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'removeItemShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressKey; @@ -35,13 +37,15 @@ final class OrderRemoveItemShippingAddressActionModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryAction.php b/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryAction.php index 8da8c51899f..cae3c6576fc 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryAction.php @@ -16,6 +16,7 @@ interface OrderRemoveParcelFromDeliveryAction extends OrderUpdateAction public const FIELD_PARCEL_ID = 'parcelId'; /** + * @return null|string */ public function getParcelId(); diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryActionBuilder.php index cddaf8ea4d0..45c83ac7477 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryActionBuilder.php @@ -21,11 +21,13 @@ final class OrderRemoveParcelFromDeliveryActionBuilder implements Builder { /** + * @var ?string */ private $parcelId; /** + * @return null|string */ public function getParcelId() diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryActionModel.php b/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryActionModel.php index 147f717554e..2f9878a883c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryActionModel.php @@ -21,11 +21,13 @@ final class OrderRemoveParcelFromDeliveryActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'removeParcelFromDelivery'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $parcelId; @@ -35,13 +37,15 @@ final class OrderRemoveParcelFromDeliveryActionModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?string $parcelId = null + ?string $parcelId = null, + ?string $action = null ) { $this->parcelId = $parcelId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getParcelId() diff --git a/lib/commercetools-api/src/Models/Order/OrderRemovePaymentAction.php b/lib/commercetools-api/src/Models/Order/OrderRemovePaymentAction.php index bf85a60af2c..d360fe8b9ca 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemovePaymentAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemovePaymentAction.php @@ -19,6 +19,7 @@ interface OrderRemovePaymentAction extends OrderUpdateAction /** *

    ResourceIdentifier to a Payment.

    * + * @return null|PaymentResourceIdentifier */ public function getPayment(); diff --git a/lib/commercetools-api/src/Models/Order/OrderRemovePaymentActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderRemovePaymentActionBuilder.php index fb34efbb7d5..28be0d4283e 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemovePaymentActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemovePaymentActionBuilder.php @@ -23,6 +23,7 @@ final class OrderRemovePaymentActionBuilder implements Builder { /** + * @var null|PaymentResourceIdentifier|PaymentResourceIdentifierBuilder */ private $payment; @@ -30,6 +31,7 @@ final class OrderRemovePaymentActionBuilder implements Builder /** *

    ResourceIdentifier to a Payment.

    * + * @return null|PaymentResourceIdentifier */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Order/OrderRemovePaymentActionModel.php b/lib/commercetools-api/src/Models/Order/OrderRemovePaymentActionModel.php index f4672c0d4ba..385d2b120a2 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemovePaymentActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemovePaymentActionModel.php @@ -23,11 +23,13 @@ final class OrderRemovePaymentActionModel extends JsonObjectModel implements Ord { public const DISCRIMINATOR_VALUE = 'removePayment'; /** + * * @var ?string */ protected $action; /** + * * @var ?PaymentResourceIdentifier */ protected $payment; @@ -37,13 +39,15 @@ final class OrderRemovePaymentActionModel extends JsonObjectModel implements Ord * @psalm-suppress MissingParamType */ public function __construct( - ?PaymentResourceIdentifier $payment = null + ?PaymentResourceIdentifier $payment = null, + ?string $action = null ) { $this->payment = $payment; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    ResourceIdentifier to a Payment.

    * + * * @return null|PaymentResourceIdentifier */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierBuilder.php index 4f48e3bf565..7dce089bfad 100644 --- a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class OrderResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class OrderResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced resource. Required if key is absent.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced resource. Required if id is absent.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierModel.php b/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierModel.php index fd23f62bd90..7dff591895a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class OrderResourceIdentifierModel extends JsonObjectModel implements Orde { public const DISCRIMINATOR_VALUE = 'order'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class OrderResourceIdentifierModel extends JsonObjectModel implements Orde */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced resource. Required if key is absent.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced resource. Required if id is absent.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Order/OrderSearchRequest.php b/lib/commercetools-api/src/Models/Order/OrderSearchRequest.php index 07dfdb7972e..eee07f61045 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSearchRequest.php +++ b/lib/commercetools-api/src/Models/Order/OrderSearchRequest.php @@ -21,6 +21,7 @@ interface OrderSearchRequest extends JsonObject /** *

    The Order search query.

    * + * @return null|OrderSearchQuery */ public function getQuery(); @@ -28,13 +29,15 @@ public function getQuery(); /** *

    Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

    * - * @return null|string + + * @return null|OrderSearchSortingCollection */ public function getSort(); /** *

    The maximum number of search results to be returned.

    * + * @return null|int */ public function getLimit(); @@ -42,6 +45,7 @@ public function getLimit(); /** *

    The number of search results to be skipped in the response for pagination.

    * + * @return null|int */ public function getOffset(); @@ -52,9 +56,9 @@ public function getOffset(); public function setQuery(?OrderSearchQuery $query): void; /** - * @param ?string $sort + * @param ?OrderSearchSortingCollection $sort */ - public function setSort(?string $sort): void; + public function setSort(?OrderSearchSortingCollection $sort): void; /** * @param ?int $limit diff --git a/lib/commercetools-api/src/Models/Order/OrderSearchRequestBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSearchRequestBuilder.php index 241f272740b..229cec32b60 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSearchRequestBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSearchRequestBuilder.php @@ -21,21 +21,25 @@ final class OrderSearchRequestBuilder implements Builder { /** + * @var null|OrderSearchQuery|OrderSearchQueryBuilder */ private $query; /** - * @var ?string + + * @var ?OrderSearchSortingCollection */ private $sort; /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; @@ -43,6 +47,7 @@ final class OrderSearchRequestBuilder implements Builder /** *

    The Order search query.

    * + * @return null|OrderSearchQuery */ public function getQuery() @@ -53,7 +58,8 @@ public function getQuery() /** *

    Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

    * - * @return null|string + + * @return null|OrderSearchSortingCollection */ public function getSort() { @@ -63,6 +69,7 @@ public function getSort() /** *

    The maximum number of search results to be returned.

    * + * @return null|int */ public function getLimit() @@ -73,6 +80,7 @@ public function getLimit() /** *

    The number of search results to be skipped in the response for pagination.

    * + * @return null|int */ public function getOffset() @@ -92,10 +100,10 @@ public function withQuery(?OrderSearchQuery $query) } /** - * @param ?string $sort + * @param ?OrderSearchSortingCollection $sort * @return $this */ - public function withSort(?string $sort) + public function withSort(?OrderSearchSortingCollection $sort) { $this->sort = $sort; diff --git a/lib/commercetools-api/src/Models/Order/OrderSearchRequestModel.php b/lib/commercetools-api/src/Models/Order/OrderSearchRequestModel.php index fa705082af4..cacc01d968f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSearchRequestModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSearchRequestModel.php @@ -20,21 +20,25 @@ final class OrderSearchRequestModel extends JsonObjectModel implements OrderSearchRequest { /** + * * @var ?OrderSearchQuery */ protected $query; /** - * @var ?string + * + * @var ?OrderSearchSortingCollection */ protected $sort; /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; @@ -45,7 +49,7 @@ final class OrderSearchRequestModel extends JsonObjectModel implements OrderSear */ public function __construct( ?OrderSearchQuery $query = null, - ?string $sort = null, + ?OrderSearchSortingCollection $sort = null, ?int $limit = null, ?int $offset = null ) { @@ -58,6 +62,7 @@ public function __construct( /** *

    The Order search query.

    * + * * @return null|OrderSearchQuery */ public function getQuery() @@ -78,17 +83,18 @@ public function getQuery() /** *

    Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

    * - * @return null|string + * + * @return null|OrderSearchSortingCollection */ public function getSort() { if (is_null($this->sort)) { - /** @psalm-var ?string $data */ + /** @psalm-var ?list $data */ $data = $this->raw(self::FIELD_SORT); if (is_null($data)) { return null; } - $this->sort = (string) $data; + $this->sort = OrderSearchSortingCollection::fromArray($data); } return $this->sort; @@ -97,6 +103,7 @@ public function getSort() /** *

    The maximum number of search results to be returned.

    * + * * @return null|int */ public function getLimit() @@ -116,6 +123,7 @@ public function getLimit() /** *

    The number of search results to be skipped in the response for pagination.

    * + * * @return null|int */ public function getOffset() @@ -142,9 +150,9 @@ public function setQuery(?OrderSearchQuery $query): void } /** - * @param ?string $sort + * @param ?OrderSearchSortingCollection $sort */ - public function setSort(?string $sort): void + public function setSort(?OrderSearchSortingCollection $sort): void { $this->sort = $sort; } diff --git a/lib/commercetools-api/src/Models/Order/OrderSearchSorting.php b/lib/commercetools-api/src/Models/Order/OrderSearchSorting.php new file mode 100644 index 00000000000..48ba26be977 --- /dev/null +++ b/lib/commercetools-api/src/Models/Order/OrderSearchSorting.php @@ -0,0 +1,16 @@ + + */ +final class OrderSearchSortingBuilder implements Builder +{ + public function build(): OrderSearchSorting + { + return new OrderSearchSortingModel( + ); + } + + public static function of(): OrderSearchSortingBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Order/OrderSearchSortingCollection.php b/lib/commercetools-api/src/Models/Order/OrderSearchSortingCollection.php new file mode 100644 index 00000000000..b19cc04431c --- /dev/null +++ b/lib/commercetools-api/src/Models/Order/OrderSearchSortingCollection.php @@ -0,0 +1,56 @@ + + * @method OrderSearchSorting current() + * @method OrderSearchSorting end() + * @method OrderSearchSorting at($offset) + */ +class OrderSearchSortingCollection extends MapperSequence +{ + /** + * @psalm-assert OrderSearchSorting $value + * @psalm-param OrderSearchSorting|stdClass $value + * @throws InvalidArgumentException + * + * @return OrderSearchSortingCollection + */ + public function add($value) + { + if (!$value instanceof OrderSearchSorting) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?OrderSearchSorting + */ + protected function mapper() + { + return function (?int $index): ?OrderSearchSorting { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var OrderSearchSorting $data */ + $data = OrderSearchSortingModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Order/OrderSearchSortingModel.php b/lib/commercetools-api/src/Models/Order/OrderSearchSortingModel.php new file mode 100644 index 00000000000..0dd0e920966 --- /dev/null +++ b/lib/commercetools-api/src/Models/Order/OrderSearchSortingModel.php @@ -0,0 +1,28 @@ +address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomFieldAction.php index 3e67ccb36e6..4c4ceeb1f4c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomFieldAction.php @@ -19,6 +19,7 @@ interface OrderSetBillingAddressCustomFieldAction extends OrderUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomFieldActionBuilder.php index d9d34f6d5c3..22cb4f538a7 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class OrderSetBillingAddressCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class OrderSetBillingAddressCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomFieldActionModel.php index 804d330c6e4..8c4ef57c96b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class OrderSetBillingAddressCustomFieldActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setBillingAddressCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class OrderSetBillingAddressCustomFieldActionModel extends JsonObjectModel */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomTypeAction.php index 552d3ebacb4..08ea8229636 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomTypeAction.php @@ -22,6 +22,7 @@ interface OrderSetBillingAddressCustomTypeAction extends OrderUpdateAction *

    Defines the Type that extends the billingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the billingAddress.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the billingAddress.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomTypeActionBuilder.php index 83bf255c8f9..9d080677e42 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class OrderSetBillingAddressCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class OrderSetBillingAddressCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the billingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the billingAddress.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the billingAddress.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomTypeActionModel.php index 009110d5868..460448914d9 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class OrderSetBillingAddressCustomTypeActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setBillingAddressCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class OrderSetBillingAddressCustomTypeActionModel extends JsonObjectModel */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the billingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the billingAddress.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the billingAddress.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomFieldAction.php index ce0e53cbaa8..d8e4355d0db 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface OrderSetCustomFieldAction extends OrderUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomFieldActionBuilder.php index 163cd94cc2c..76a2399074a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class OrderSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class OrderSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomFieldActionModel.php index 6ee3bc2a778..dba6b644a5f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class OrderSetCustomFieldActionModel extends JsonObjectModel implements Or { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class OrderSetCustomFieldActionModel extends JsonObjectModel implements Or */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldAction.php index 2fe31400263..7ac0307ce02 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldAction.php @@ -18,6 +18,7 @@ interface OrderSetCustomLineItemCustomFieldAction extends OrderUpdateAction public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getCustomLineItemId(); @@ -25,6 +26,7 @@ public function getCustomLineItemId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -34,6 +36,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionBuilder.php index d0a9dab671c..94fc4274d63 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class OrderSetCustomLineItemCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getCustomLineItemId() @@ -46,6 +50,7 @@ public function getCustomLineItemId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -58,6 +63,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionModel.php index 057f03f90e4..e5dcc24b18f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class OrderSetCustomLineItemCustomFieldActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setCustomLineItemCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class OrderSetCustomLineItemCustomFieldActionModel extends JsonObjectModel public function __construct( ?string $customLineItemId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -92,6 +99,7 @@ public function getCustomLineItemId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -113,6 +121,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeAction.php index ee09769eb67..1aef92dbf35 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeAction.php @@ -20,6 +20,7 @@ interface OrderSetCustomLineItemCustomTypeAction extends OrderUpdateAction public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getCustomLineItemId(); @@ -28,6 +29,7 @@ public function getCustomLineItemId(); *

    Defines the Type that extends the CustomLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -35,6 +37,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the CustomLineItem.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionBuilder.php index b61af1d0743..646e5c18b9b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class OrderSetCustomLineItemCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getCustomLineItemId() @@ -51,6 +55,7 @@ public function getCustomLineItemId() *

    Defines the Type that extends the CustomLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -61,6 +66,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the CustomLineItem.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionModel.php index cf0355ba441..fd576964670 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionModel.php @@ -25,21 +25,25 @@ final class OrderSetCustomLineItemCustomTypeActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setCustomLineItemCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -51,15 +55,17 @@ final class OrderSetCustomLineItemCustomTypeActionModel extends JsonObjectModel public function __construct( ?string $customLineItemId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -97,6 +104,7 @@ public function getCustomLineItemId() *

    Defines the Type that extends the CustomLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the CustomLineItem.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsAction.php index ba1902b167e..ad30911a378 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsAction.php @@ -18,11 +18,13 @@ interface OrderSetCustomLineItemShippingDetailsAction extends OrderUpdateAction public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionBuilder.php index ddb2146abc2..1dead66df8b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionBuilder.php @@ -23,16 +23,19 @@ final class OrderSetCustomLineItemShippingDetailsActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetails; /** + * @return null|string */ public function getCustomLineItemId() @@ -41,6 +44,7 @@ public function getCustomLineItemId() } /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionModel.php index e78517302bb..3f49aff1156 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionModel.php @@ -23,16 +23,19 @@ final class OrderSetCustomLineItemShippingDetailsActionModel extends JsonObjectM { public const DISCRIMINATOR_VALUE = 'setCustomLineItemShippingDetails'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; @@ -43,14 +46,16 @@ final class OrderSetCustomLineItemShippingDetailsActionModel extends JsonObjectM */ public function __construct( ?string $customLineItemId = null, - ?ItemShippingDetailsDraft $shippingDetails = null + ?ItemShippingDetailsDraft $shippingDetails = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->shippingDetails = $shippingDetails; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -85,6 +91,7 @@ public function getCustomLineItemId() } /** + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomTypeAction.php index bb4ba2c9e77..12fb6c8e682 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface OrderSetCustomTypeAction extends OrderUpdateAction *

    Defines the Type that extends the Order with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Order.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the Order.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomTypeActionBuilder.php index 98421e86b8b..dd0681b43a2 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class OrderSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class OrderSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the Order with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Order.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Order.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomTypeActionModel.php index b50abc1b500..a27a72c5a8c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class OrderSetCustomTypeActionModel extends JsonObjectModel implements Ord { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class OrderSetCustomTypeActionModel extends JsonObjectModel implements Ord */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the Order with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Order.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Order.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailAction.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailAction.php index 2c6b58ff504..ced6ddf5653 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailAction.php @@ -16,6 +16,7 @@ interface OrderSetCustomerEmailAction extends OrderUpdateAction public const FIELD_EMAIL = 'email'; /** + * @return null|string */ public function getEmail(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailActionBuilder.php index b9d37d51afa..64a18a75c3d 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailActionBuilder.php @@ -21,11 +21,13 @@ final class OrderSetCustomerEmailActionBuilder implements Builder { /** + * @var ?string */ private $email; /** + * @return null|string */ public function getEmail() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailActionModel.php index 4784be8e9e6..2067dc6eb61 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailActionModel.php @@ -21,11 +21,13 @@ final class OrderSetCustomerEmailActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setCustomerEmail'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $email; @@ -35,13 +37,15 @@ final class OrderSetCustomerEmailActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $email = null + ?string $email = null, + ?string $action = null ) { $this->email = $email; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getEmail() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdAction.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdAction.php index 5eee10b5590..2c71c305a62 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdAction.php @@ -16,6 +16,7 @@ interface OrderSetCustomerIdAction extends OrderUpdateAction public const FIELD_CUSTOMER_ID = 'customerId'; /** + * @return null|string */ public function getCustomerId(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdActionBuilder.php index d017f03f472..74ab4af5ee8 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdActionBuilder.php @@ -21,11 +21,13 @@ final class OrderSetCustomerIdActionBuilder implements Builder { /** + * @var ?string */ private $customerId; /** + * @return null|string */ public function getCustomerId() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdActionModel.php index 7364a33b496..b35c6923ea5 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdActionModel.php @@ -21,11 +21,13 @@ final class OrderSetCustomerIdActionModel extends JsonObjectModel implements Ord { public const DISCRIMINATOR_VALUE = 'setCustomerId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customerId; @@ -35,13 +37,15 @@ final class OrderSetCustomerIdActionModel extends JsonObjectModel implements Ord * @psalm-suppress MissingParamType */ public function __construct( - ?string $customerId = null + ?string $customerId = null, + ?string $action = null ) { $this->customerId = $customerId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomerId() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressAction.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressAction.php index 13d759158c2..63827404ec7 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressAction.php @@ -18,11 +18,13 @@ interface OrderSetDeliveryAddressAction extends OrderUpdateAction public const FIELD_ADDRESS = 'address'; /** + * @return null|string */ public function getDeliveryId(); /** + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionBuilder.php index da91d206191..2618b40021d 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionBuilder.php @@ -23,16 +23,19 @@ final class OrderSetDeliveryAddressActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @return null|string */ public function getDeliveryId() @@ -41,6 +44,7 @@ public function getDeliveryId() } /** + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionModel.php index 9f80aeb9dcc..c6208bd350d 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionModel.php @@ -23,16 +23,19 @@ final class OrderSetDeliveryAddressActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'setDeliveryAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?BaseAddress */ protected $address; @@ -43,14 +46,16 @@ final class OrderSetDeliveryAddressActionModel extends JsonObjectModel implement */ public function __construct( ?string $deliveryId = null, - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() @@ -85,6 +91,7 @@ public function getDeliveryId() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldAction.php index f6b95742372..916453abd96 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldAction.php @@ -18,6 +18,7 @@ interface OrderSetDeliveryAddressCustomFieldAction extends OrderUpdateAction public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getDeliveryId(); @@ -25,6 +26,7 @@ public function getDeliveryId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -34,6 +36,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldActionBuilder.php index 3ac1e103c1e..0283c4f1ea1 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class OrderSetDeliveryAddressCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getDeliveryId() @@ -46,6 +50,7 @@ public function getDeliveryId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -58,6 +63,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldActionModel.php index 3f0b52b0bca..d5defceb3a6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class OrderSetDeliveryAddressCustomFieldActionModel extends JsonObjectMode { public const DISCRIMINATOR_VALUE = 'setDeliveryAddressCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class OrderSetDeliveryAddressCustomFieldActionModel extends JsonObjectMode public function __construct( ?string $deliveryId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() @@ -92,6 +99,7 @@ public function getDeliveryId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -113,6 +121,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeAction.php index cff6da1ffcc..38a479fb9fb 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeAction.php @@ -20,6 +20,7 @@ interface OrderSetDeliveryAddressCustomTypeAction extends OrderUpdateAction public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getDeliveryId(); @@ -28,6 +29,7 @@ public function getDeliveryId(); *

    Defines the Type that extends the address in a Delivery with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -35,6 +37,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the address in a Delivery.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeActionBuilder.php index fe201f752b1..cbdf54f4eb7 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class OrderSetDeliveryAddressCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getDeliveryId() @@ -51,6 +55,7 @@ public function getDeliveryId() *

    Defines the Type that extends the address in a Delivery with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -61,6 +66,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the address in a Delivery.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeActionModel.php index f91f38a78a7..4c287f744b8 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeActionModel.php @@ -25,21 +25,25 @@ final class OrderSetDeliveryAddressCustomTypeActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setDeliveryAddressCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -51,15 +55,17 @@ final class OrderSetDeliveryAddressCustomTypeActionModel extends JsonObjectModel public function __construct( ?string $deliveryId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() @@ -97,6 +104,7 @@ public function getDeliveryId() *

    Defines the Type that extends the address in a Delivery with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the address in a Delivery.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldAction.php index 7481a4c52c3..a62fffb60b0 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldAction.php @@ -18,6 +18,7 @@ interface OrderSetDeliveryCustomFieldAction extends OrderUpdateAction public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getDeliveryId(); @@ -25,6 +26,7 @@ public function getDeliveryId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -34,6 +36,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldActionBuilder.php index 95b27b54eb3..74329386553 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class OrderSetDeliveryCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getDeliveryId() @@ -46,6 +50,7 @@ public function getDeliveryId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -58,6 +63,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldActionModel.php index 9c5cb74edc4..50d8b77fe59 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class OrderSetDeliveryCustomFieldActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setDeliveryCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class OrderSetDeliveryCustomFieldActionModel extends JsonObjectModel imple public function __construct( ?string $deliveryId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() @@ -92,6 +99,7 @@ public function getDeliveryId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -113,6 +121,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeAction.php index ede30d9d865..f035faf4615 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeAction.php @@ -20,6 +20,7 @@ interface OrderSetDeliveryCustomTypeAction extends OrderUpdateAction public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getDeliveryId(); @@ -28,6 +29,7 @@ public function getDeliveryId(); *

    Defines the Type that extends the Delivery with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Delivery.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -35,6 +37,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the Delivery.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeActionBuilder.php index 2ebe83f3c4a..47fe522bfb4 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class OrderSetDeliveryCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getDeliveryId() @@ -51,6 +55,7 @@ public function getDeliveryId() *

    Defines the Type that extends the Delivery with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Delivery.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -61,6 +66,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Delivery.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeActionModel.php index 2f113fcb53c..60ece8f6f01 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeActionModel.php @@ -25,21 +25,25 @@ final class OrderSetDeliveryCustomTypeActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setDeliveryCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -51,15 +55,17 @@ final class OrderSetDeliveryCustomTypeActionModel extends JsonObjectModel implem public function __construct( ?string $deliveryId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() @@ -97,6 +104,7 @@ public function getDeliveryId() *

    Defines the Type that extends the Delivery with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Delivery.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Delivery.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsAction.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsAction.php index 7274550a4c4..20ba2e6f020 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsAction.php @@ -17,11 +17,13 @@ interface OrderSetDeliveryItemsAction extends OrderUpdateAction public const FIELD_ITEMS = 'items'; /** + * @return null|string */ public function getDeliveryId(); /** + * @return null|DeliveryItemCollection */ public function getItems(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsActionBuilder.php index f99befcf086..03d651ab749 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsActionBuilder.php @@ -21,16 +21,19 @@ final class OrderSetDeliveryItemsActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @return null|string */ public function getDeliveryId() @@ -39,6 +42,7 @@ public function getDeliveryId() } /** + * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsActionModel.php index 144b3285fff..40213ea0408 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsActionModel.php @@ -21,16 +21,19 @@ final class OrderSetDeliveryItemsActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setDeliveryItems'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?DeliveryItemCollection */ protected $items; @@ -41,14 +44,16 @@ final class OrderSetDeliveryItemsActionModel extends JsonObjectModel implements */ public function __construct( ?string $deliveryId = null, - ?DeliveryItemCollection $items = null + ?DeliveryItemCollection $items = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; $this->items = $items; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() @@ -83,6 +89,7 @@ public function getDeliveryId() } /** + * * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldAction.php index eb8ffcdc63f..538097f03b4 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldAction.php @@ -18,6 +18,7 @@ interface OrderSetItemShippingAddressCustomFieldAction extends OrderUpdateAction public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getAddressKey(); @@ -25,6 +26,7 @@ public function getAddressKey(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -34,6 +36,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldActionBuilder.php index 98a8d6292c4..1068a83fbe8 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class OrderSetItemShippingAddressCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $addressKey; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getAddressKey() @@ -46,6 +50,7 @@ public function getAddressKey() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -58,6 +63,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldActionModel.php index b309d47de27..58100fcf97f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class OrderSetItemShippingAddressCustomFieldActionModel extends JsonObject { public const DISCRIMINATOR_VALUE = 'setItemShippingAddressCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressKey; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class OrderSetItemShippingAddressCustomFieldActionModel extends JsonObject public function __construct( ?string $addressKey = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->addressKey = $addressKey; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,7 @@ public function getAction() } /** + * * @return null|string */ public function getAddressKey() @@ -92,6 +99,7 @@ public function getAddressKey() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -113,6 +121,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeAction.php index 30299d03a4b..c2040fcbe85 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeAction.php @@ -20,6 +20,7 @@ interface OrderSetItemShippingAddressCustomTypeAction extends OrderUpdateAction public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getAddressKey(); @@ -28,6 +29,7 @@ public function getAddressKey(); *

    Defines the Type that extends the itemShippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the itemShippingAddress.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -35,6 +37,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the itemShippingAddress.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeActionBuilder.php index 185c4ffb2ad..2eaf2e0360e 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class OrderSetItemShippingAddressCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $addressKey; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getAddressKey() @@ -51,6 +55,7 @@ public function getAddressKey() *

    Defines the Type that extends the itemShippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the itemShippingAddress.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -61,6 +66,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the itemShippingAddress.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeActionModel.php index 677c11fe1d5..080f00c82fa 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeActionModel.php @@ -25,21 +25,25 @@ final class OrderSetItemShippingAddressCustomTypeActionModel extends JsonObjectM { public const DISCRIMINATOR_VALUE = 'setItemShippingAddressCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressKey; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -51,15 +55,17 @@ final class OrderSetItemShippingAddressCustomTypeActionModel extends JsonObjectM public function __construct( ?string $addressKey = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->addressKey = $addressKey; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getAddressKey() @@ -97,6 +104,7 @@ public function getAddressKey() *

    Defines the Type that extends the itemShippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the itemShippingAddress.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the itemShippingAddress.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomFieldAction.php index b56b304ea34..fbcc3b653fb 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomFieldAction.php @@ -18,6 +18,7 @@ interface OrderSetLineItemCustomFieldAction extends OrderUpdateAction public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getLineItemId(); @@ -25,6 +26,7 @@ public function getLineItemId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -34,6 +36,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomFieldActionBuilder.php index 846ea914d96..395f40d356a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class OrderSetLineItemCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getLineItemId() @@ -46,6 +50,7 @@ public function getLineItemId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -58,6 +63,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomFieldActionModel.php index 3a32a0d9dfd..23d98f476e5 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class OrderSetLineItemCustomFieldActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setLineItemCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class OrderSetLineItemCustomFieldActionModel extends JsonObjectModel imple public function __construct( ?string $lineItemId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -92,6 +99,7 @@ public function getLineItemId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -113,6 +121,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeAction.php index 2e9b02fe319..77f709e6050 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeAction.php @@ -20,6 +20,7 @@ interface OrderSetLineItemCustomTypeAction extends OrderUpdateAction public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getLineItemId(); @@ -28,6 +29,7 @@ public function getLineItemId(); *

    Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -35,6 +37,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the LineItem.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeActionBuilder.php index 37f1f4a37f5..b64c8f27cb7 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class OrderSetLineItemCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getLineItemId() @@ -51,6 +55,7 @@ public function getLineItemId() *

    Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -61,6 +66,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the LineItem.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeActionModel.php index a4aa3c47a10..a984a270764 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeActionModel.php @@ -25,21 +25,25 @@ final class OrderSetLineItemCustomTypeActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setLineItemCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -51,15 +55,17 @@ final class OrderSetLineItemCustomTypeActionModel extends JsonObjectModel implem public function __construct( ?string $lineItemId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -97,6 +104,7 @@ public function getLineItemId() *

    Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the LineItem.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsAction.php index e13b6c0eb36..fdd73c3f4c0 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsAction.php @@ -18,11 +18,13 @@ interface OrderSetLineItemShippingDetailsAction extends OrderUpdateAction public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionBuilder.php index 6e35813c614..1d6ec8c9ed3 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionBuilder.php @@ -23,16 +23,19 @@ final class OrderSetLineItemShippingDetailsActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetails; /** + * @return null|string */ public function getLineItemId() @@ -41,6 +44,7 @@ public function getLineItemId() } /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionModel.php index a987114c6e5..11e36ee24fb 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionModel.php @@ -23,16 +23,19 @@ final class OrderSetLineItemShippingDetailsActionModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'setLineItemShippingDetails'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; @@ -43,14 +46,16 @@ final class OrderSetLineItemShippingDetailsActionModel extends JsonObjectModel i */ public function __construct( ?string $lineItemId = null, - ?ItemShippingDetailsDraft $shippingDetails = null + ?ItemShippingDetailsDraft $shippingDetails = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->shippingDetails = $shippingDetails; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -85,6 +91,7 @@ public function getLineItemId() } /** + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLocaleAction.php b/lib/commercetools-api/src/Models/Order/OrderSetLocaleAction.php index 1a5414df387..261dd4c019d 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLocaleAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLocaleAction.php @@ -16,6 +16,7 @@ interface OrderSetLocaleAction extends OrderUpdateAction public const FIELD_LOCALE = 'locale'; /** + * @return null|string */ public function getLocale(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLocaleActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetLocaleActionBuilder.php index b27ce07f338..1a8d60114f9 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLocaleActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLocaleActionBuilder.php @@ -21,11 +21,13 @@ final class OrderSetLocaleActionBuilder implements Builder { /** + * @var ?string */ private $locale; /** + * @return null|string */ public function getLocale() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLocaleActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetLocaleActionModel.php index 6d73e612bd5..7c349854896 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLocaleActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLocaleActionModel.php @@ -21,11 +21,13 @@ final class OrderSetLocaleActionModel extends JsonObjectModel implements OrderSe { public const DISCRIMINATOR_VALUE = 'setLocale'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $locale; @@ -35,13 +37,15 @@ final class OrderSetLocaleActionModel extends JsonObjectModel implements OrderSe * @psalm-suppress MissingParamType */ public function __construct( - ?string $locale = null + ?string $locale = null, + ?string $action = null ) { $this->locale = $locale; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getLocale() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberAction.php b/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberAction.php index 206e4d7a24c..04e7c464b57 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberAction.php @@ -16,6 +16,7 @@ interface OrderSetOrderNumberAction extends OrderUpdateAction public const FIELD_ORDER_NUMBER = 'orderNumber'; /** + * @return null|string */ public function getOrderNumber(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberActionBuilder.php index 8abccd3628f..9f194dd7e3f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberActionBuilder.php @@ -21,11 +21,13 @@ final class OrderSetOrderNumberActionBuilder implements Builder { /** + * @var ?string */ private $orderNumber; /** + * @return null|string */ public function getOrderNumber() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberActionModel.php index 41318bd2bf0..3453ae61ff3 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberActionModel.php @@ -21,11 +21,13 @@ final class OrderSetOrderNumberActionModel extends JsonObjectModel implements Or { public const DISCRIMINATOR_VALUE = 'setOrderNumber'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $orderNumber; @@ -35,13 +37,15 @@ final class OrderSetOrderNumberActionModel extends JsonObjectModel implements Or * @psalm-suppress MissingParamType */ public function __construct( - ?string $orderNumber = null + ?string $orderNumber = null, + ?string $action = null ) { $this->orderNumber = $orderNumber; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getOrderNumber() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldAction.php index a8520cb8414..e798ef9ac97 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldAction.php @@ -18,6 +18,7 @@ interface OrderSetParcelCustomFieldAction extends OrderUpdateAction public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getParcelId(); @@ -25,6 +26,7 @@ public function getParcelId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -34,6 +36,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldActionBuilder.php index 495ec67bdec..f3ef6a6c557 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class OrderSetParcelCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $parcelId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getParcelId() @@ -46,6 +50,7 @@ public function getParcelId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -58,6 +63,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldActionModel.php index 2c052e97a10..01ea6952107 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class OrderSetParcelCustomFieldActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setParcelCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $parcelId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class OrderSetParcelCustomFieldActionModel extends JsonObjectModel impleme public function __construct( ?string $parcelId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->parcelId = $parcelId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,7 @@ public function getAction() } /** + * * @return null|string */ public function getParcelId() @@ -92,6 +99,7 @@ public function getParcelId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -113,6 +121,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeAction.php index cf625fc0bcd..94662fe5918 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeAction.php @@ -20,6 +20,7 @@ interface OrderSetParcelCustomTypeAction extends OrderUpdateAction public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getParcelId(); @@ -28,6 +29,7 @@ public function getParcelId(); *

    Defines the Type that extends the Parcel with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Parcel.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -35,6 +37,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the Parcel.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeActionBuilder.php index a8ae631918b..8162a61b6dd 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class OrderSetParcelCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $parcelId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getParcelId() @@ -51,6 +55,7 @@ public function getParcelId() *

    Defines the Type that extends the Parcel with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Parcel.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -61,6 +66,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Parcel.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeActionModel.php index a365d546cbb..af3b3c929b5 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeActionModel.php @@ -25,21 +25,25 @@ final class OrderSetParcelCustomTypeActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'setParcelCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $parcelId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -51,15 +55,17 @@ final class OrderSetParcelCustomTypeActionModel extends JsonObjectModel implemen public function __construct( ?string $parcelId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->parcelId = $parcelId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getParcelId() @@ -97,6 +104,7 @@ public function getParcelId() *

    Defines the Type that extends the Parcel with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Parcel.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Parcel.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsAction.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsAction.php index 4b25f3ff7f2..a14aeb7653b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsAction.php @@ -17,11 +17,13 @@ interface OrderSetParcelItemsAction extends OrderUpdateAction public const FIELD_ITEMS = 'items'; /** + * @return null|string */ public function getParcelId(); /** + * @return null|DeliveryItemCollection */ public function getItems(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsActionBuilder.php index f8dc6473cb1..1cf8f9c70fc 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsActionBuilder.php @@ -21,16 +21,19 @@ final class OrderSetParcelItemsActionBuilder implements Builder { /** + * @var ?string */ private $parcelId; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @return null|string */ public function getParcelId() @@ -39,6 +42,7 @@ public function getParcelId() } /** + * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsActionModel.php index 58d3795620b..c5386333336 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsActionModel.php @@ -21,16 +21,19 @@ final class OrderSetParcelItemsActionModel extends JsonObjectModel implements Or { public const DISCRIMINATOR_VALUE = 'setParcelItems'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $parcelId; /** + * * @var ?DeliveryItemCollection */ protected $items; @@ -41,14 +44,16 @@ final class OrderSetParcelItemsActionModel extends JsonObjectModel implements Or */ public function __construct( ?string $parcelId = null, - ?DeliveryItemCollection $items = null + ?DeliveryItemCollection $items = null, + ?string $action = null ) { $this->parcelId = $parcelId; $this->items = $items; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getParcelId() @@ -83,6 +89,7 @@ public function getParcelId() } /** + * * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsAction.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsAction.php index 15119707a03..dfe7ba28960 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsAction.php @@ -17,11 +17,13 @@ interface OrderSetParcelMeasurementsAction extends OrderUpdateAction public const FIELD_MEASUREMENTS = 'measurements'; /** + * @return null|string */ public function getParcelId(); /** + * @return null|ParcelMeasurements */ public function getMeasurements(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsActionBuilder.php index b47e20b03c6..2479070ca22 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsActionBuilder.php @@ -21,16 +21,19 @@ final class OrderSetParcelMeasurementsActionBuilder implements Builder { /** + * @var ?string */ private $parcelId; /** + * @var null|ParcelMeasurements|ParcelMeasurementsBuilder */ private $measurements; /** + * @return null|string */ public function getParcelId() @@ -39,6 +42,7 @@ public function getParcelId() } /** + * @return null|ParcelMeasurements */ public function getMeasurements() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsActionModel.php index 1a984390dfa..18f63ad397c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsActionModel.php @@ -21,16 +21,19 @@ final class OrderSetParcelMeasurementsActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setParcelMeasurements'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $parcelId; /** + * * @var ?ParcelMeasurements */ protected $measurements; @@ -41,14 +44,16 @@ final class OrderSetParcelMeasurementsActionModel extends JsonObjectModel implem */ public function __construct( ?string $parcelId = null, - ?ParcelMeasurements $measurements = null + ?ParcelMeasurements $measurements = null, + ?string $action = null ) { $this->parcelId = $parcelId; $this->measurements = $measurements; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getParcelId() @@ -83,6 +89,7 @@ public function getParcelId() } /** + * * @return null|ParcelMeasurements */ public function getMeasurements() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataAction.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataAction.php index 6edd2aa34a0..6e6cf5ac63f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataAction.php @@ -17,11 +17,13 @@ interface OrderSetParcelTrackingDataAction extends OrderUpdateAction public const FIELD_TRACKING_DATA = 'trackingData'; /** + * @return null|string */ public function getParcelId(); /** + * @return null|TrackingData */ public function getTrackingData(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataActionBuilder.php index b71c1ab8ac6..29b0028f07c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataActionBuilder.php @@ -21,16 +21,19 @@ final class OrderSetParcelTrackingDataActionBuilder implements Builder { /** + * @var ?string */ private $parcelId; /** + * @var null|TrackingData|TrackingDataBuilder */ private $trackingData; /** + * @return null|string */ public function getParcelId() @@ -39,6 +42,7 @@ public function getParcelId() } /** + * @return null|TrackingData */ public function getTrackingData() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataActionModel.php index 0fbe511e146..d54f619c375 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataActionModel.php @@ -21,16 +21,19 @@ final class OrderSetParcelTrackingDataActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setParcelTrackingData'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $parcelId; /** + * * @var ?TrackingData */ protected $trackingData; @@ -41,14 +44,16 @@ final class OrderSetParcelTrackingDataActionModel extends JsonObjectModel implem */ public function __construct( ?string $parcelId = null, - ?TrackingData $trackingData = null + ?TrackingData $trackingData = null, + ?string $action = null ) { $this->parcelId = $parcelId; $this->trackingData = $trackingData; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getParcelId() @@ -83,6 +89,7 @@ public function getParcelId() } /** + * * @return null|TrackingData */ public function getTrackingData() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoAction.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoAction.php index f859b14f34d..b57500faa85 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoAction.php @@ -16,6 +16,7 @@ interface OrderSetReturnInfoAction extends OrderUpdateAction public const FIELD_ITEMS = 'items'; /** + * @return null|ReturnInfoDraftCollection */ public function getItems(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoActionBuilder.php index c584da012e2..56f3c920ae5 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoActionBuilder.php @@ -21,11 +21,13 @@ final class OrderSetReturnInfoActionBuilder implements Builder { /** + * @var ?ReturnInfoDraftCollection */ private $items; /** + * @return null|ReturnInfoDraftCollection */ public function getItems() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoActionModel.php index 0b773ffa9e9..3673b9294b9 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoActionModel.php @@ -21,11 +21,13 @@ final class OrderSetReturnInfoActionModel extends JsonObjectModel implements Ord { public const DISCRIMINATOR_VALUE = 'setReturnInfo'; /** + * * @var ?string */ protected $action; /** + * * @var ?ReturnInfoDraftCollection */ protected $items; @@ -35,13 +37,15 @@ final class OrderSetReturnInfoActionModel extends JsonObjectModel implements Ord * @psalm-suppress MissingParamType */ public function __construct( - ?ReturnInfoDraftCollection $items = null + ?ReturnInfoDraftCollection $items = null, + ?string $action = null ) { $this->items = $items; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|ReturnInfoDraftCollection */ public function getItems() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldAction.php index 8f31e299ae1..e0b17e2bb86 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldAction.php @@ -18,6 +18,7 @@ interface OrderSetReturnItemCustomFieldAction extends OrderUpdateAction public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getReturnItemId(); @@ -25,6 +26,7 @@ public function getReturnItemId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -34,6 +36,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionBuilder.php index a15944766a1..433436352e2 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class OrderSetReturnItemCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $returnItemId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getReturnItemId() @@ -46,6 +50,7 @@ public function getReturnItemId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -58,6 +63,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionModel.php index bf6d466c8fc..cbc530155d2 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class OrderSetReturnItemCustomFieldActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'setReturnItemCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $returnItemId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class OrderSetReturnItemCustomFieldActionModel extends JsonObjectModel imp public function __construct( ?string $returnItemId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->returnItemId = $returnItemId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,7 @@ public function getAction() } /** + * * @return null|string */ public function getReturnItemId() @@ -92,6 +99,7 @@ public function getReturnItemId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -113,6 +121,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeAction.php index 706c81fe800..e27af1d1d4d 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeAction.php @@ -20,6 +20,7 @@ interface OrderSetReturnItemCustomTypeAction extends OrderUpdateAction public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getReturnItemId(); @@ -28,6 +29,7 @@ public function getReturnItemId(); *

    Defines the Type that extends the ReturnItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ReturnItem.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -35,6 +37,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the ReturnItem.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionBuilder.php index 066d02b6060..2347b564b64 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class OrderSetReturnItemCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $returnItemId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getReturnItemId() @@ -51,6 +55,7 @@ public function getReturnItemId() *

    Defines the Type that extends the ReturnItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ReturnItem.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -61,6 +66,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the ReturnItem.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionModel.php index 48fb734b939..fd044caed9a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionModel.php @@ -25,21 +25,25 @@ final class OrderSetReturnItemCustomTypeActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setReturnItemCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $returnItemId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -51,15 +55,17 @@ final class OrderSetReturnItemCustomTypeActionModel extends JsonObjectModel impl public function __construct( ?string $returnItemId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->returnItemId = $returnItemId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getReturnItemId() @@ -97,6 +104,7 @@ public function getReturnItemId() *

    Defines the Type that extends the ReturnItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ReturnItem.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the ReturnItem.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateAction.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateAction.php index 0d5b78e6d95..7a57bdb3e5c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateAction.php @@ -17,11 +17,13 @@ interface OrderSetReturnPaymentStateAction extends OrderUpdateAction public const FIELD_PAYMENT_STATE = 'paymentState'; /** + * @return null|string */ public function getReturnItemId(); /** + * @return null|string */ public function getPaymentState(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionBuilder.php index 1cfeaafe276..6636630d52b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionBuilder.php @@ -21,16 +21,19 @@ final class OrderSetReturnPaymentStateActionBuilder implements Builder { /** + * @var ?string */ private $returnItemId; /** + * @var ?string */ private $paymentState; /** + * @return null|string */ public function getReturnItemId() @@ -39,6 +42,7 @@ public function getReturnItemId() } /** + * @return null|string */ public function getPaymentState() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionModel.php index b46f012bcf6..bf015e38090 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionModel.php @@ -21,16 +21,19 @@ final class OrderSetReturnPaymentStateActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setReturnPaymentState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $returnItemId; /** + * * @var ?string */ protected $paymentState; @@ -41,14 +44,16 @@ final class OrderSetReturnPaymentStateActionModel extends JsonObjectModel implem */ public function __construct( ?string $returnItemId = null, - ?string $paymentState = null + ?string $paymentState = null, + ?string $action = null ) { $this->returnItemId = $returnItemId; $this->paymentState = $paymentState; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getReturnItemId() @@ -83,6 +89,7 @@ public function getReturnItemId() } /** + * * @return null|string */ public function getPaymentState() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateAction.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateAction.php index 340edf6bbbe..72821bd3416 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateAction.php @@ -17,11 +17,13 @@ interface OrderSetReturnShipmentStateAction extends OrderUpdateAction public const FIELD_SHIPMENT_STATE = 'shipmentState'; /** + * @return null|string */ public function getReturnItemId(); /** + * @return null|string */ public function getShipmentState(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionBuilder.php index a2003a24796..901056a5373 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionBuilder.php @@ -21,16 +21,19 @@ final class OrderSetReturnShipmentStateActionBuilder implements Builder { /** + * @var ?string */ private $returnItemId; /** + * @var ?string */ private $shipmentState; /** + * @return null|string */ public function getReturnItemId() @@ -39,6 +42,7 @@ public function getReturnItemId() } /** + * @return null|string */ public function getShipmentState() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionModel.php index 4a84ba1c7f9..274be5de398 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionModel.php @@ -21,16 +21,19 @@ final class OrderSetReturnShipmentStateActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setReturnShipmentState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $returnItemId; /** + * * @var ?string */ protected $shipmentState; @@ -41,14 +44,16 @@ final class OrderSetReturnShipmentStateActionModel extends JsonObjectModel imple */ public function __construct( ?string $returnItemId = null, - ?string $shipmentState = null + ?string $shipmentState = null, + ?string $action = null ) { $this->returnItemId = $returnItemId; $this->shipmentState = $shipmentState; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getReturnItemId() @@ -83,6 +89,7 @@ public function getReturnItemId() } /** + * * @return null|string */ public function getShipmentState() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressAction.php b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressAction.php index d11e75c90ec..a1460cb7c4b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressAction.php @@ -17,6 +17,7 @@ interface OrderSetShippingAddressAction extends OrderUpdateAction public const FIELD_ADDRESS = 'address'; /** + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionBuilder.php index dd475a546e2..51453bcdd15 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionBuilder.php @@ -23,11 +23,13 @@ final class OrderSetShippingAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionModel.php index 31ec0257540..db9d0519b03 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionModel.php @@ -23,11 +23,13 @@ final class OrderSetShippingAddressActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'setShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -37,13 +39,15 @@ final class OrderSetShippingAddressActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomFieldAction.php index 396bb47ea4b..01d06daec46 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomFieldAction.php @@ -19,6 +19,7 @@ interface OrderSetShippingAddressCustomFieldAction extends OrderUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomFieldActionBuilder.php index b6a52b78b1e..ac0a3e71b9c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class OrderSetShippingAddressCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class OrderSetShippingAddressCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomFieldActionModel.php index 5ca250f5c13..769c666e94b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class OrderSetShippingAddressCustomFieldActionModel extends JsonObjectMode { public const DISCRIMINATOR_VALUE = 'setShippingAddressCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class OrderSetShippingAddressCustomFieldActionModel extends JsonObjectMode */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomTypeAction.php index d8bb6d88ed5..896a09bbbfc 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomTypeAction.php @@ -22,6 +22,7 @@ interface OrderSetShippingAddressCustomTypeAction extends OrderUpdateAction *

    Defines the Type that extends the shippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the shippingAddress.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the shippingAddress.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomTypeActionBuilder.php index 8a1c4f65ec5..36d8e93a712 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class OrderSetShippingAddressCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class OrderSetShippingAddressCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the shippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the shippingAddress.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the shippingAddress.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomTypeActionModel.php index 06cd53141e0..386b2653149 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class OrderSetShippingAddressCustomTypeActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setShippingAddressCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class OrderSetShippingAddressCustomTypeActionModel extends JsonObjectModel */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the shippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the shippingAddress.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the shippingAddress.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetStoreAction.php b/lib/commercetools-api/src/Models/Order/OrderSetStoreAction.php index 4635593a46c..67cb8b71daa 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetStoreAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetStoreAction.php @@ -19,6 +19,7 @@ interface OrderSetStoreAction extends OrderUpdateAction /** *

    ResourceIdentifier to a Store.

    * + * @return null|StoreResourceIdentifier */ public function getStore(); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetStoreActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetStoreActionBuilder.php index 5c35a632014..1be99bf9701 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetStoreActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetStoreActionBuilder.php @@ -23,6 +23,7 @@ final class OrderSetStoreActionBuilder implements Builder { /** + * @var null|StoreResourceIdentifier|StoreResourceIdentifierBuilder */ private $store; @@ -30,6 +31,7 @@ final class OrderSetStoreActionBuilder implements Builder /** *

    ResourceIdentifier to a Store.

    * + * @return null|StoreResourceIdentifier */ public function getStore() diff --git a/lib/commercetools-api/src/Models/Order/OrderSetStoreActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetStoreActionModel.php index 46e4d88b2f2..6c9f6a9721b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetStoreActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetStoreActionModel.php @@ -23,11 +23,13 @@ final class OrderSetStoreActionModel extends JsonObjectModel implements OrderSet { public const DISCRIMINATOR_VALUE = 'setStore'; /** + * * @var ?string */ protected $action; /** + * * @var ?StoreResourceIdentifier */ protected $store; @@ -37,13 +39,15 @@ final class OrderSetStoreActionModel extends JsonObjectModel implements OrderSet * @psalm-suppress MissingParamType */ public function __construct( - ?StoreResourceIdentifier $store = null + ?StoreResourceIdentifier $store = null, + ?string $action = null ) { $this->store = $store; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    ResourceIdentifier to a Store.

    * + * * @return null|StoreResourceIdentifier */ public function getStore() diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateAction.php b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateAction.php index 7275e4ad5f1..7614b7a536a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateAction.php @@ -22,11 +22,13 @@ interface OrderTransitionCustomLineItemStateAction extends OrderUpdateAction public const FIELD_ACTUAL_TRANSITION_DATE = 'actualTransitionDate'; /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|int */ public function getQuantity(); @@ -34,6 +36,7 @@ public function getQuantity(); /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getFromState(); @@ -41,11 +44,13 @@ public function getFromState(); /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getToState(); /** + * @return null|DateTimeImmutable */ public function getActualTransitionDate(); diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionBuilder.php index bcb450187aa..9ac69a8405a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionBuilder.php @@ -24,31 +24,37 @@ final class OrderTransitionCustomLineItemStateActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var ?int */ private $quantity; /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $fromState; /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $toState; /** + * @var ?DateTimeImmutable */ private $actualTransitionDate; /** + * @return null|string */ public function getCustomLineItemId() @@ -57,6 +63,7 @@ public function getCustomLineItemId() } /** + * @return null|int */ public function getQuantity() @@ -67,6 +74,7 @@ public function getQuantity() /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getFromState() @@ -77,6 +85,7 @@ public function getFromState() /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getToState() @@ -85,6 +94,7 @@ public function getToState() } /** + * @return null|DateTimeImmutable */ public function getActualTransitionDate() diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionModel.php index 822917f32ce..37f1a579d0b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionModel.php @@ -24,31 +24,37 @@ final class OrderTransitionCustomLineItemStateActionModel extends JsonObjectMode { public const DISCRIMINATOR_VALUE = 'transitionCustomLineItemState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?int */ protected $quantity; /** + * * @var ?StateResourceIdentifier */ protected $fromState; /** + * * @var ?StateResourceIdentifier */ protected $toState; /** + * * @var ?DateTimeImmutable */ protected $actualTransitionDate; @@ -62,17 +68,19 @@ public function __construct( ?int $quantity = null, ?StateResourceIdentifier $fromState = null, ?StateResourceIdentifier $toState = null, - ?DateTimeImmutable $actualTransitionDate = null + ?DateTimeImmutable $actualTransitionDate = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->quantity = $quantity; $this->fromState = $fromState; $this->toState = $toState; $this->actualTransitionDate = $actualTransitionDate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -90,6 +98,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -107,6 +116,7 @@ public function getCustomLineItemId() } /** + * * @return null|int */ public function getQuantity() @@ -126,6 +136,7 @@ public function getQuantity() /** *

    ResourceIdentifier to a State.

    * + * * @return null|StateResourceIdentifier */ public function getFromState() @@ -146,6 +157,7 @@ public function getFromState() /** *

    ResourceIdentifier to a State.

    * + * * @return null|StateResourceIdentifier */ public function getToState() @@ -164,6 +176,7 @@ public function getToState() } /** + * * @return null|DateTimeImmutable */ public function getActualTransitionDate() diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateAction.php b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateAction.php index 62afbc94f42..e553f8ec86b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateAction.php @@ -22,11 +22,13 @@ interface OrderTransitionLineItemStateAction extends OrderUpdateAction public const FIELD_ACTUAL_TRANSITION_DATE = 'actualTransitionDate'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|int */ public function getQuantity(); @@ -34,6 +36,7 @@ public function getQuantity(); /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getFromState(); @@ -41,11 +44,13 @@ public function getFromState(); /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getToState(); /** + * @return null|DateTimeImmutable */ public function getActualTransitionDate(); diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionBuilder.php index 3f705148115..419cdacfa46 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionBuilder.php @@ -24,31 +24,37 @@ final class OrderTransitionLineItemStateActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?int */ private $quantity; /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $fromState; /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $toState; /** + * @var ?DateTimeImmutable */ private $actualTransitionDate; /** + * @return null|string */ public function getLineItemId() @@ -57,6 +63,7 @@ public function getLineItemId() } /** + * @return null|int */ public function getQuantity() @@ -67,6 +74,7 @@ public function getQuantity() /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getFromState() @@ -77,6 +85,7 @@ public function getFromState() /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getToState() @@ -85,6 +94,7 @@ public function getToState() } /** + * @return null|DateTimeImmutable */ public function getActualTransitionDate() diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionModel.php index af4399aa68b..e9d0d19a5f2 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionModel.php @@ -24,31 +24,37 @@ final class OrderTransitionLineItemStateActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'transitionLineItemState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?int */ protected $quantity; /** + * * @var ?StateResourceIdentifier */ protected $fromState; /** + * * @var ?StateResourceIdentifier */ protected $toState; /** + * * @var ?DateTimeImmutable */ protected $actualTransitionDate; @@ -62,17 +68,19 @@ public function __construct( ?int $quantity = null, ?StateResourceIdentifier $fromState = null, ?StateResourceIdentifier $toState = null, - ?DateTimeImmutable $actualTransitionDate = null + ?DateTimeImmutable $actualTransitionDate = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->quantity = $quantity; $this->fromState = $fromState; $this->toState = $toState; $this->actualTransitionDate = $actualTransitionDate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -90,6 +98,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -107,6 +116,7 @@ public function getLineItemId() } /** + * * @return null|int */ public function getQuantity() @@ -126,6 +136,7 @@ public function getQuantity() /** *

    ResourceIdentifier to a State.

    * + * * @return null|StateResourceIdentifier */ public function getFromState() @@ -146,6 +157,7 @@ public function getFromState() /** *

    ResourceIdentifier to a State.

    * + * * @return null|StateResourceIdentifier */ public function getToState() @@ -164,6 +176,7 @@ public function getToState() } /** + * * @return null|DateTimeImmutable */ public function getActualTransitionDate() diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionStateAction.php b/lib/commercetools-api/src/Models/Order/OrderTransitionStateAction.php index 051c64d8773..7ae0c579dab 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionStateAction.php @@ -20,11 +20,13 @@ interface OrderTransitionStateAction extends OrderUpdateAction /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getState(); /** + * @return null|bool */ public function getForce(); diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderTransitionStateActionBuilder.php index 52b6068566f..ec6e00a12e6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionStateActionBuilder.php @@ -23,11 +23,13 @@ final class OrderTransitionStateActionBuilder implements Builder { /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $state; /** + * @var ?bool */ private $force; @@ -35,6 +37,7 @@ final class OrderTransitionStateActionBuilder implements Builder /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getState() @@ -43,6 +46,7 @@ public function getState() } /** + * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderTransitionStateActionModel.php index 3efea99c8c7..710d342b868 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionStateActionModel.php @@ -23,16 +23,19 @@ final class OrderTransitionStateActionModel extends JsonObjectModel implements O { public const DISCRIMINATOR_VALUE = 'transitionState'; /** + * * @var ?string */ protected $action; /** + * * @var ?StateResourceIdentifier */ protected $state; /** + * * @var ?bool */ protected $force; @@ -43,14 +46,16 @@ final class OrderTransitionStateActionModel extends JsonObjectModel implements O */ public function __construct( ?StateResourceIdentifier $state = null, - ?bool $force = null + ?bool $force = null, + ?string $action = null ) { $this->state = $state; $this->force = $force; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() /** *

    ResourceIdentifier to a State.

    * + * * @return null|StateResourceIdentifier */ public function getState() @@ -88,6 +94,7 @@ public function getState() } /** + * * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdate.php b/lib/commercetools-api/src/Models/Order/OrderUpdate.php index de60e2797aa..358000861d4 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdate.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdate.php @@ -17,11 +17,13 @@ interface OrderUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + * @return null|int */ public function getVersion(); /** + * @return null|OrderUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateAction.php b/lib/commercetools-api/src/Models/Order/OrderUpdateAction.php index f34ab2157e1..4ce456cd975 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateAction.php @@ -17,6 +17,7 @@ interface OrderUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderUpdateActionModel.php index 0675ffbc057..cb4d769d6bc 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateActionModel.php @@ -21,6 +21,7 @@ final class OrderUpdateActionModel extends JsonObjectModel implements OrderUpdat { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -92,11 +93,13 @@ final class OrderUpdateActionModel extends JsonObjectModel implements OrderUpdat * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateBuilder.php b/lib/commercetools-api/src/Models/Order/OrderUpdateBuilder.php index e1734099d38..fd55646deba 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateBuilder.php @@ -21,16 +21,19 @@ final class OrderUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?OrderUpdateActionCollection */ private $actions; /** + * @return null|int */ public function getVersion() @@ -39,6 +42,7 @@ public function getVersion() } /** + * @return null|OrderUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressAction.php index 04eef22ec26..87ab6841bd0 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressAction.php @@ -17,6 +17,7 @@ interface OrderUpdateItemShippingAddressAction extends OrderUpdateAction public const FIELD_ADDRESS = 'address'; /** + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionBuilder.php index 8261c800425..d0428caa7a0 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionBuilder.php @@ -23,11 +23,13 @@ final class OrderUpdateItemShippingAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionModel.php index e373b5b3897..6e5b838c41f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionModel.php @@ -23,11 +23,13 @@ final class OrderUpdateItemShippingAddressActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'updateItemShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -37,13 +39,15 @@ final class OrderUpdateItemShippingAddressActionModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateModel.php b/lib/commercetools-api/src/Models/Order/OrderUpdateModel.php index 5d2de0019e8..697e6c53165 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateModel.php @@ -20,11 +20,13 @@ final class OrderUpdateModel extends JsonObjectModel implements OrderUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?OrderUpdateActionCollection */ protected $actions; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|int */ public function getVersion() @@ -59,6 +62,7 @@ public function getVersion() } /** + * * @return null|OrderUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoAction.php b/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoAction.php index 08985f37897..f8315da3376 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoAction.php @@ -22,16 +22,19 @@ interface OrderUpdateSyncInfoAction extends OrderUpdateAction /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getChannel(); /** + * @return null|string */ public function getExternalId(); /** + * @return null|DateTimeImmutable */ public function getSyncedAt(); diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoActionBuilder.php index 9fa345b4230..97e5b18c262 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoActionBuilder.php @@ -24,16 +24,19 @@ final class OrderUpdateSyncInfoActionBuilder implements Builder { /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $channel; /** + * @var ?string */ private $externalId; /** + * @var ?DateTimeImmutable */ private $syncedAt; @@ -41,6 +44,7 @@ final class OrderUpdateSyncInfoActionBuilder implements Builder /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getChannel() @@ -49,6 +53,7 @@ public function getChannel() } /** + * @return null|string */ public function getExternalId() @@ -57,6 +62,7 @@ public function getExternalId() } /** + * @return null|DateTimeImmutable */ public function getSyncedAt() diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoActionModel.php b/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoActionModel.php index 8036b5fede9..5f5e3b0f59c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoActionModel.php @@ -24,21 +24,25 @@ final class OrderUpdateSyncInfoActionModel extends JsonObjectModel implements Or { public const DISCRIMINATOR_VALUE = 'updateSyncInfo'; /** + * * @var ?string */ protected $action; /** + * * @var ?ChannelResourceIdentifier */ protected $channel; /** + * * @var ?string */ protected $externalId; /** + * * @var ?DateTimeImmutable */ protected $syncedAt; @@ -50,15 +54,17 @@ final class OrderUpdateSyncInfoActionModel extends JsonObjectModel implements Or public function __construct( ?ChannelResourceIdentifier $channel = null, ?string $externalId = null, - ?DateTimeImmutable $syncedAt = null + ?DateTimeImmutable $syncedAt = null, + ?string $action = null ) { $this->channel = $channel; $this->externalId = $externalId; $this->syncedAt = $syncedAt; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -78,6 +84,7 @@ public function getAction() /** *

    ResourceIdentifier to a Channel.

    * + * * @return null|ChannelResourceIdentifier */ public function getChannel() @@ -96,6 +103,7 @@ public function getChannel() } /** + * * @return null|string */ public function getExternalId() @@ -113,6 +121,7 @@ public function getExternalId() } /** + * * @return null|DateTimeImmutable */ public function getSyncedAt() diff --git a/lib/commercetools-api/src/Models/Order/Parcel.php b/lib/commercetools-api/src/Models/Order/Parcel.php index 35eaf4ca10e..7c1c506aa2a 100644 --- a/lib/commercetools-api/src/Models/Order/Parcel.php +++ b/lib/commercetools-api/src/Models/Order/Parcel.php @@ -25,21 +25,25 @@ interface Parcel extends JsonObject /** *

    Unique identifier of the Parcel.

    * + * @return null|string */ public function getId(); /** + * @return null|DateTimeImmutable */ public function getCreatedAt(); /** + * @return null|ParcelMeasurements */ public function getMeasurements(); /** + * @return null|TrackingData */ public function getTrackingData(); @@ -47,6 +51,7 @@ public function getTrackingData(); /** *

    The delivery items contained in this parcel.

    * + * @return null|DeliveryItemCollection */ public function getItems(); @@ -54,6 +59,7 @@ public function getItems(); /** *

    Custom Fields of this parcel.

    * + * @return null|CustomFields */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Order/ParcelBuilder.php b/lib/commercetools-api/src/Models/Order/ParcelBuilder.php index d1270d6945e..1bb235da1ae 100644 --- a/lib/commercetools-api/src/Models/Order/ParcelBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ParcelBuilder.php @@ -24,31 +24,37 @@ final class ParcelBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var null|ParcelMeasurements|ParcelMeasurementsBuilder */ private $measurements; /** + * @var null|TrackingData|TrackingDataBuilder */ private $trackingData; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; @@ -56,6 +62,7 @@ final class ParcelBuilder implements Builder /** *

    Unique identifier of the Parcel.

    * + * @return null|string */ public function getId() @@ -64,6 +71,7 @@ public function getId() } /** + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -72,6 +80,7 @@ public function getCreatedAt() } /** + * @return null|ParcelMeasurements */ public function getMeasurements() @@ -80,6 +89,7 @@ public function getMeasurements() } /** + * @return null|TrackingData */ public function getTrackingData() @@ -90,6 +100,7 @@ public function getTrackingData() /** *

    The delivery items contained in this parcel.

    * + * @return null|DeliveryItemCollection */ public function getItems() @@ -100,6 +111,7 @@ public function getItems() /** *

    Custom Fields of this parcel.

    * + * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Order/ParcelDraft.php b/lib/commercetools-api/src/Models/Order/ParcelDraft.php index c54fdaf6032..df4f3e52144 100644 --- a/lib/commercetools-api/src/Models/Order/ParcelDraft.php +++ b/lib/commercetools-api/src/Models/Order/ParcelDraft.php @@ -20,11 +20,13 @@ interface ParcelDraft extends JsonObject public const FIELD_CUSTOM = 'custom'; /** + * @return null|ParcelMeasurements */ public function getMeasurements(); /** + * @return null|TrackingData */ public function getTrackingData(); @@ -32,6 +34,7 @@ public function getTrackingData(); /** *

    The delivery items contained in this parcel.

    * + * @return null|DeliveryItemCollection */ public function getItems(); @@ -39,6 +42,7 @@ public function getItems(); /** *

    Custom Fields of this parcel.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Order/ParcelDraftBuilder.php b/lib/commercetools-api/src/Models/Order/ParcelDraftBuilder.php index 903402b3956..fa19d516b21 100644 --- a/lib/commercetools-api/src/Models/Order/ParcelDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ParcelDraftBuilder.php @@ -23,26 +23,31 @@ final class ParcelDraftBuilder implements Builder { /** + * @var null|ParcelMeasurements|ParcelMeasurementsBuilder */ private $measurements; /** + * @var null|TrackingData|TrackingDataBuilder */ private $trackingData; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @return null|ParcelMeasurements */ public function getMeasurements() @@ -51,6 +56,7 @@ public function getMeasurements() } /** + * @return null|TrackingData */ public function getTrackingData() @@ -61,6 +67,7 @@ public function getTrackingData() /** *

    The delivery items contained in this parcel.

    * + * @return null|DeliveryItemCollection */ public function getItems() @@ -71,6 +78,7 @@ public function getItems() /** *

    Custom Fields of this parcel.

    * + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Order/ParcelDraftModel.php b/lib/commercetools-api/src/Models/Order/ParcelDraftModel.php index 61b59e8f1c4..686ec2b903c 100644 --- a/lib/commercetools-api/src/Models/Order/ParcelDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/ParcelDraftModel.php @@ -22,21 +22,25 @@ final class ParcelDraftModel extends JsonObjectModel implements ParcelDraft { /** + * * @var ?ParcelMeasurements */ protected $measurements; /** + * * @var ?TrackingData */ protected $trackingData; /** + * * @var ?DeliveryItemCollection */ protected $items; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -58,6 +62,7 @@ public function __construct( } /** + * * @return null|ParcelMeasurements */ public function getMeasurements() @@ -76,6 +81,7 @@ public function getMeasurements() } /** + * * @return null|TrackingData */ public function getTrackingData() @@ -96,6 +102,7 @@ public function getTrackingData() /** *

    The delivery items contained in this parcel.

    * + * * @return null|DeliveryItemCollection */ public function getItems() @@ -115,6 +122,7 @@ public function getItems() /** *

    Custom Fields of this parcel.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Order/ParcelMeasurements.php b/lib/commercetools-api/src/Models/Order/ParcelMeasurements.php index e5da8571095..645812c359a 100644 --- a/lib/commercetools-api/src/Models/Order/ParcelMeasurements.php +++ b/lib/commercetools-api/src/Models/Order/ParcelMeasurements.php @@ -19,21 +19,25 @@ interface ParcelMeasurements extends JsonObject public const FIELD_WEIGHT_IN_GRAM = 'weightInGram'; /** + * @return null|int */ public function getHeightInMillimeter(); /** + * @return null|int */ public function getLengthInMillimeter(); /** + * @return null|int */ public function getWidthInMillimeter(); /** + * @return null|int */ public function getWeightInGram(); diff --git a/lib/commercetools-api/src/Models/Order/ParcelMeasurementsBuilder.php b/lib/commercetools-api/src/Models/Order/ParcelMeasurementsBuilder.php index f2af5dffa1e..e0bdb540129 100644 --- a/lib/commercetools-api/src/Models/Order/ParcelMeasurementsBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ParcelMeasurementsBuilder.php @@ -21,26 +21,31 @@ final class ParcelMeasurementsBuilder implements Builder { /** + * @var ?int */ private $heightInMillimeter; /** + * @var ?int */ private $lengthInMillimeter; /** + * @var ?int */ private $widthInMillimeter; /** + * @var ?int */ private $weightInGram; /** + * @return null|int */ public function getHeightInMillimeter() @@ -49,6 +54,7 @@ public function getHeightInMillimeter() } /** + * @return null|int */ public function getLengthInMillimeter() @@ -57,6 +63,7 @@ public function getLengthInMillimeter() } /** + * @return null|int */ public function getWidthInMillimeter() @@ -65,6 +72,7 @@ public function getWidthInMillimeter() } /** + * @return null|int */ public function getWeightInGram() diff --git a/lib/commercetools-api/src/Models/Order/ParcelMeasurementsModel.php b/lib/commercetools-api/src/Models/Order/ParcelMeasurementsModel.php index 000b06482e2..788e7b9cf61 100644 --- a/lib/commercetools-api/src/Models/Order/ParcelMeasurementsModel.php +++ b/lib/commercetools-api/src/Models/Order/ParcelMeasurementsModel.php @@ -20,21 +20,25 @@ final class ParcelMeasurementsModel extends JsonObjectModel implements ParcelMeasurements { /** + * * @var ?int */ protected $heightInMillimeter; /** + * * @var ?int */ protected $lengthInMillimeter; /** + * * @var ?int */ protected $widthInMillimeter; /** + * * @var ?int */ protected $weightInGram; @@ -56,6 +60,7 @@ public function __construct( } /** + * * @return null|int */ public function getHeightInMillimeter() @@ -73,6 +78,7 @@ public function getHeightInMillimeter() } /** + * * @return null|int */ public function getLengthInMillimeter() @@ -90,6 +96,7 @@ public function getLengthInMillimeter() } /** + * * @return null|int */ public function getWidthInMillimeter() @@ -107,6 +114,7 @@ public function getWidthInMillimeter() } /** + * * @return null|int */ public function getWeightInGram() diff --git a/lib/commercetools-api/src/Models/Order/ParcelModel.php b/lib/commercetools-api/src/Models/Order/ParcelModel.php index 22e796c08d7..7e3b06c49ad 100644 --- a/lib/commercetools-api/src/Models/Order/ParcelModel.php +++ b/lib/commercetools-api/src/Models/Order/ParcelModel.php @@ -23,31 +23,37 @@ final class ParcelModel extends JsonObjectModel implements Parcel { /** + * * @var ?string */ protected $id; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?ParcelMeasurements */ protected $measurements; /** + * * @var ?TrackingData */ protected $trackingData; /** + * * @var ?DeliveryItemCollection */ protected $items; /** + * * @var ?CustomFields */ protected $custom; @@ -75,6 +81,7 @@ public function __construct( /** *

    Unique identifier of the Parcel.

    * + * * @return null|string */ public function getId() @@ -92,6 +99,7 @@ public function getId() } /** + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -113,6 +121,7 @@ public function getCreatedAt() } /** + * * @return null|ParcelMeasurements */ public function getMeasurements() @@ -131,6 +140,7 @@ public function getMeasurements() } /** + * * @return null|TrackingData */ public function getTrackingData() @@ -151,6 +161,7 @@ public function getTrackingData() /** *

    The delivery items contained in this parcel.

    * + * * @return null|DeliveryItemCollection */ public function getItems() @@ -170,6 +181,7 @@ public function getItems() /** *

    Custom Fields of this parcel.

    * + * * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Order/PaymentInfo.php b/lib/commercetools-api/src/Models/Order/PaymentInfo.php index e2bc2891b4e..b5200167659 100644 --- a/lib/commercetools-api/src/Models/Order/PaymentInfo.php +++ b/lib/commercetools-api/src/Models/Order/PaymentInfo.php @@ -17,6 +17,7 @@ interface PaymentInfo extends JsonObject public const FIELD_PAYMENTS = 'payments'; /** + * @return null|PaymentReferenceCollection */ public function getPayments(); diff --git a/lib/commercetools-api/src/Models/Order/PaymentInfoBuilder.php b/lib/commercetools-api/src/Models/Order/PaymentInfoBuilder.php index 95436af39b9..0a64ff2d977 100644 --- a/lib/commercetools-api/src/Models/Order/PaymentInfoBuilder.php +++ b/lib/commercetools-api/src/Models/Order/PaymentInfoBuilder.php @@ -22,11 +22,13 @@ final class PaymentInfoBuilder implements Builder { /** + * @var ?PaymentReferenceCollection */ private $payments; /** + * @return null|PaymentReferenceCollection */ public function getPayments() diff --git a/lib/commercetools-api/src/Models/Order/PaymentInfoModel.php b/lib/commercetools-api/src/Models/Order/PaymentInfoModel.php index d7a0b30992c..36d5cf7e31d 100644 --- a/lib/commercetools-api/src/Models/Order/PaymentInfoModel.php +++ b/lib/commercetools-api/src/Models/Order/PaymentInfoModel.php @@ -21,6 +21,7 @@ final class PaymentInfoModel extends JsonObjectModel implements PaymentInfo { /** + * * @var ?PaymentReferenceCollection */ protected $payments; @@ -36,6 +37,7 @@ public function __construct( } /** + * * @return null|PaymentReferenceCollection */ public function getPayments() diff --git a/lib/commercetools-api/src/Models/Order/ProductVariantImportDraft.php b/lib/commercetools-api/src/Models/Order/ProductVariantImportDraft.php index cb1190a20bb..574fbde0d60 100644 --- a/lib/commercetools-api/src/Models/Order/ProductVariantImportDraft.php +++ b/lib/commercetools-api/src/Models/Order/ProductVariantImportDraft.php @@ -27,6 +27,7 @@ interface ProductVariantImportDraft extends JsonObject * The variant with provided ID should exist in some existing product, so you also need to specify the productId if this property is set, * or alternatively you can just specify SKU of the product variant.

    * + * @return null|int */ public function getId(); @@ -34,15 +35,17 @@ public function getId(); /** *

    The SKU of the existing variant.

    * + * @return null|string */ public function getSku(); /** - *

    The EmbeddedPrices of the variant. - * The prices should not contain two prices for the same price scope (same currency, country and customer group). + *

    The Embedded Prices of the variant. + * The prices should not contain two prices for the same price scope (same currency, country, customer group, channel, valid from and valid until). * If this property is defined, then it will override the prices property from the original product variant, otherwise prices property from the original product variant would be copied in the resulting order.

    * + * @return null|PriceDraftCollection */ public function getPrices(); @@ -51,6 +54,7 @@ public function getPrices(); *

    If this property is defined, then it will override the attributes property from the original * product variant, otherwise attributes property from the original product variant would be copied in the resulting order.

    * + * @return null|AttributeCollection */ public function getAttributes(); @@ -59,6 +63,7 @@ public function getAttributes(); *

    If this property is defined, then it will override the images property from the original * product variant, otherwise images property from the original product variant would be copied in the resulting order.

    * + * @return null|ImageCollection */ public function getImages(); diff --git a/lib/commercetools-api/src/Models/Order/ProductVariantImportDraftBuilder.php b/lib/commercetools-api/src/Models/Order/ProductVariantImportDraftBuilder.php index 7194d8f4bd0..e9d989085b2 100644 --- a/lib/commercetools-api/src/Models/Order/ProductVariantImportDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ProductVariantImportDraftBuilder.php @@ -24,26 +24,31 @@ final class ProductVariantImportDraftBuilder implements Builder { /** + * @var ?int */ private $id; /** + * @var ?string */ private $sku; /** + * @var ?PriceDraftCollection */ private $prices; /** + * @var ?AttributeCollection */ private $attributes; /** + * @var ?ImageCollection */ private $images; @@ -53,6 +58,7 @@ final class ProductVariantImportDraftBuilder implements Builder * The variant with provided ID should exist in some existing product, so you also need to specify the productId if this property is set, * or alternatively you can just specify SKU of the product variant.

    * + * @return null|int */ public function getId() @@ -63,6 +69,7 @@ public function getId() /** *

    The SKU of the existing variant.

    * + * @return null|string */ public function getSku() @@ -71,10 +78,11 @@ public function getSku() } /** - *

    The EmbeddedPrices of the variant. - * The prices should not contain two prices for the same price scope (same currency, country and customer group). + *

    The Embedded Prices of the variant. + * The prices should not contain two prices for the same price scope (same currency, country, customer group, channel, valid from and valid until). * If this property is defined, then it will override the prices property from the original product variant, otherwise prices property from the original product variant would be copied in the resulting order.

    * + * @return null|PriceDraftCollection */ public function getPrices() @@ -86,6 +94,7 @@ public function getPrices() *

    If this property is defined, then it will override the attributes property from the original * product variant, otherwise attributes property from the original product variant would be copied in the resulting order.

    * + * @return null|AttributeCollection */ public function getAttributes() @@ -97,6 +106,7 @@ public function getAttributes() *

    If this property is defined, then it will override the images property from the original * product variant, otherwise images property from the original product variant would be copied in the resulting order.

    * + * @return null|ImageCollection */ public function getImages() diff --git a/lib/commercetools-api/src/Models/Order/ProductVariantImportDraftModel.php b/lib/commercetools-api/src/Models/Order/ProductVariantImportDraftModel.php index e31c6640943..4e204623898 100644 --- a/lib/commercetools-api/src/Models/Order/ProductVariantImportDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/ProductVariantImportDraftModel.php @@ -23,26 +23,31 @@ final class ProductVariantImportDraftModel extends JsonObjectModel implements ProductVariantImportDraft { /** + * * @var ?int */ protected $id; /** + * * @var ?string */ protected $sku; /** + * * @var ?PriceDraftCollection */ protected $prices; /** + * * @var ?AttributeCollection */ protected $attributes; /** + * * @var ?ImageCollection */ protected $images; @@ -70,6 +75,7 @@ public function __construct( * The variant with provided ID should exist in some existing product, so you also need to specify the productId if this property is set, * or alternatively you can just specify SKU of the product variant.

    * + * * @return null|int */ public function getId() @@ -89,6 +95,7 @@ public function getId() /** *

    The SKU of the existing variant.

    * + * * @return null|string */ public function getSku() @@ -106,10 +113,11 @@ public function getSku() } /** - *

    The EmbeddedPrices of the variant. - * The prices should not contain two prices for the same price scope (same currency, country and customer group). + *

    The Embedded Prices of the variant. + * The prices should not contain two prices for the same price scope (same currency, country, customer group, channel, valid from and valid until). * If this property is defined, then it will override the prices property from the original product variant, otherwise prices property from the original product variant would be copied in the resulting order.

    * + * * @return null|PriceDraftCollection */ public function getPrices() @@ -130,6 +138,7 @@ public function getPrices() *

    If this property is defined, then it will override the attributes property from the original * product variant, otherwise attributes property from the original product variant would be copied in the resulting order.

    * + * * @return null|AttributeCollection */ public function getAttributes() @@ -150,6 +159,7 @@ public function getAttributes() *

    If this property is defined, then it will override the images property from the original * product variant, otherwise images property from the original product variant would be copied in the resulting order.

    * + * * @return null|ImageCollection */ public function getImages() diff --git a/lib/commercetools-api/src/Models/Order/ReturnInfo.php b/lib/commercetools-api/src/Models/Order/ReturnInfo.php index e766ef73d45..3dc3ecc085e 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnInfo.php +++ b/lib/commercetools-api/src/Models/Order/ReturnInfo.php @@ -19,6 +19,7 @@ interface ReturnInfo extends JsonObject public const FIELD_RETURN_DATE = 'returnDate'; /** + * @return null|ReturnItemCollection */ public function getItems(); @@ -26,11 +27,13 @@ public function getItems(); /** *

    Identifies, which return tracking ID is connected to this particular return.

    * + * @return null|string */ public function getReturnTrackingId(); /** + * @return null|DateTimeImmutable */ public function getReturnDate(); diff --git a/lib/commercetools-api/src/Models/Order/ReturnInfoBuilder.php b/lib/commercetools-api/src/Models/Order/ReturnInfoBuilder.php index fca2da58288..0ecb814a293 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnInfoBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ReturnInfoBuilder.php @@ -22,21 +22,25 @@ final class ReturnInfoBuilder implements Builder { /** + * @var ?ReturnItemCollection */ private $items; /** + * @var ?string */ private $returnTrackingId; /** + * @var ?DateTimeImmutable */ private $returnDate; /** + * @return null|ReturnItemCollection */ public function getItems() @@ -47,6 +51,7 @@ public function getItems() /** *

    Identifies, which return tracking ID is connected to this particular return.

    * + * @return null|string */ public function getReturnTrackingId() @@ -55,6 +60,7 @@ public function getReturnTrackingId() } /** + * @return null|DateTimeImmutable */ public function getReturnDate() diff --git a/lib/commercetools-api/src/Models/Order/ReturnInfoDraft.php b/lib/commercetools-api/src/Models/Order/ReturnInfoDraft.php index 1fe998acf7e..ceff35c3023 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnInfoDraft.php +++ b/lib/commercetools-api/src/Models/Order/ReturnInfoDraft.php @@ -19,6 +19,7 @@ interface ReturnInfoDraft extends JsonObject public const FIELD_RETURN_DATE = 'returnDate'; /** + * @return null|ReturnItemDraftCollection */ public function getItems(); @@ -26,11 +27,13 @@ public function getItems(); /** *

    Identifies, which return tracking ID is connected to this particular return.

    * + * @return null|string */ public function getReturnTrackingId(); /** + * @return null|DateTimeImmutable */ public function getReturnDate(); diff --git a/lib/commercetools-api/src/Models/Order/ReturnInfoDraftBuilder.php b/lib/commercetools-api/src/Models/Order/ReturnInfoDraftBuilder.php index c43510ddae6..5d906d2c85a 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnInfoDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ReturnInfoDraftBuilder.php @@ -22,21 +22,25 @@ final class ReturnInfoDraftBuilder implements Builder { /** + * @var ?ReturnItemDraftCollection */ private $items; /** + * @var ?string */ private $returnTrackingId; /** + * @var ?DateTimeImmutable */ private $returnDate; /** + * @return null|ReturnItemDraftCollection */ public function getItems() @@ -47,6 +51,7 @@ public function getItems() /** *

    Identifies, which return tracking ID is connected to this particular return.

    * + * @return null|string */ public function getReturnTrackingId() @@ -55,6 +60,7 @@ public function getReturnTrackingId() } /** + * @return null|DateTimeImmutable */ public function getReturnDate() diff --git a/lib/commercetools-api/src/Models/Order/ReturnInfoDraftModel.php b/lib/commercetools-api/src/Models/Order/ReturnInfoDraftModel.php index e9148c27339..3f008b18b2c 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnInfoDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/ReturnInfoDraftModel.php @@ -21,16 +21,19 @@ final class ReturnInfoDraftModel extends JsonObjectModel implements ReturnInfoDraft { /** + * * @var ?ReturnItemDraftCollection */ protected $items; /** + * * @var ?string */ protected $returnTrackingId; /** + * * @var ?DateTimeImmutable */ protected $returnDate; @@ -50,6 +53,7 @@ public function __construct( } /** + * * @return null|ReturnItemDraftCollection */ public function getItems() @@ -69,6 +73,7 @@ public function getItems() /** *

    Identifies, which return tracking ID is connected to this particular return.

    * + * * @return null|string */ public function getReturnTrackingId() @@ -86,6 +91,7 @@ public function getReturnTrackingId() } /** + * * @return null|DateTimeImmutable */ public function getReturnDate() diff --git a/lib/commercetools-api/src/Models/Order/ReturnInfoModel.php b/lib/commercetools-api/src/Models/Order/ReturnInfoModel.php index dab6fa40f3a..f434964ffb3 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnInfoModel.php +++ b/lib/commercetools-api/src/Models/Order/ReturnInfoModel.php @@ -21,16 +21,19 @@ final class ReturnInfoModel extends JsonObjectModel implements ReturnInfo { /** + * * @var ?ReturnItemCollection */ protected $items; /** + * * @var ?string */ protected $returnTrackingId; /** + * * @var ?DateTimeImmutable */ protected $returnDate; @@ -50,6 +53,7 @@ public function __construct( } /** + * * @return null|ReturnItemCollection */ public function getItems() @@ -69,6 +73,7 @@ public function getItems() /** *

    Identifies, which return tracking ID is connected to this particular return.

    * + * * @return null|string */ public function getReturnTrackingId() @@ -86,6 +91,7 @@ public function getReturnTrackingId() } /** + * * @return null|DateTimeImmutable */ public function getReturnDate() diff --git a/lib/commercetools-api/src/Models/Order/ReturnItem.php b/lib/commercetools-api/src/Models/Order/ReturnItem.php index 74545c38b01..00684a3cb58 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItem.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItem.php @@ -29,31 +29,37 @@ interface ReturnItem extends JsonObject /** *

    Unique identifier of the ReturnItem.

    * + * @return null|string */ public function getId(); /** + * @return null|int */ public function getQuantity(); /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getComment(); /** + * @return null|string */ public function getShipmentState(); /** + * @return null|string */ public function getPaymentState(); @@ -61,16 +67,19 @@ public function getPaymentState(); /** *

    Custom Fields of this return item.

    * + * @return null|CustomFields */ public function getCustom(); /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); /** + * @return null|DateTimeImmutable */ public function getCreatedAt(); diff --git a/lib/commercetools-api/src/Models/Order/ReturnItemBuilder.php b/lib/commercetools-api/src/Models/Order/ReturnItemBuilder.php index 23e718cae5a..bc7402cf533 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItemBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItemBuilder.php @@ -24,41 +24,49 @@ final class ReturnItemBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $quantity; /** + * @var ?string */ private $comment; /** + * @var ?string */ private $shipmentState; /** + * @var ?string */ private $paymentState; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var ?DateTimeImmutable */ private $createdAt; @@ -66,6 +74,7 @@ final class ReturnItemBuilder implements Builder /** *

    Unique identifier of the ReturnItem.

    * + * @return null|string */ public function getId() @@ -74,6 +83,7 @@ public function getId() } /** + * @return null|int */ public function getQuantity() @@ -82,6 +92,7 @@ public function getQuantity() } /** + * @return null|string */ public function getComment() @@ -90,6 +101,7 @@ public function getComment() } /** + * @return null|string */ public function getShipmentState() @@ -98,6 +110,7 @@ public function getShipmentState() } /** + * @return null|string */ public function getPaymentState() @@ -108,6 +121,7 @@ public function getPaymentState() /** *

    Custom Fields of this return item.

    * + * @return null|CustomFields */ public function getCustom() @@ -116,6 +130,7 @@ public function getCustom() } /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -124,6 +139,7 @@ public function getLastModifiedAt() } /** + * @return null|DateTimeImmutable */ public function getCreatedAt() diff --git a/lib/commercetools-api/src/Models/Order/ReturnItemDraft.php b/lib/commercetools-api/src/Models/Order/ReturnItemDraft.php index 02b2cb112a2..dbd12bd831d 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItemDraft.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItemDraft.php @@ -22,26 +22,31 @@ interface ReturnItemDraft extends JsonObject public const FIELD_CUSTOM = 'custom'; /** + * @return null|int */ public function getQuantity(); /** + * @return null|string */ public function getLineItemId(); /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|string */ public function getComment(); /** + * @return null|string */ public function getShipmentState(); @@ -49,6 +54,7 @@ public function getShipmentState(); /** *

    Custom Fields of this return item.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Order/ReturnItemDraftBuilder.php b/lib/commercetools-api/src/Models/Order/ReturnItemDraftBuilder.php index ffe2b3e2225..244f66b24aa 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItemDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItemDraftBuilder.php @@ -23,36 +23,43 @@ final class ReturnItemDraftBuilder implements Builder { /** + * @var ?int */ private $quantity; /** + * @var ?string */ private $lineItemId; /** + * @var ?string */ private $customLineItemId; /** + * @var ?string */ private $comment; /** + * @var ?string */ private $shipmentState; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @return null|int */ public function getQuantity() @@ -61,6 +68,7 @@ public function getQuantity() } /** + * @return null|string */ public function getLineItemId() @@ -69,6 +77,7 @@ public function getLineItemId() } /** + * @return null|string */ public function getCustomLineItemId() @@ -77,6 +86,7 @@ public function getCustomLineItemId() } /** + * @return null|string */ public function getComment() @@ -85,6 +95,7 @@ public function getComment() } /** + * @return null|string */ public function getShipmentState() @@ -95,6 +106,7 @@ public function getShipmentState() /** *

    Custom Fields of this return item.

    * + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Order/ReturnItemDraftModel.php b/lib/commercetools-api/src/Models/Order/ReturnItemDraftModel.php index 968014df1d1..999e70daf39 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItemDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItemDraftModel.php @@ -22,31 +22,37 @@ final class ReturnItemDraftModel extends JsonObjectModel implements ReturnItemDraft { /** + * * @var ?int */ protected $quantity; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?string */ protected $comment; /** + * * @var ?string */ protected $shipmentState; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -72,6 +78,7 @@ public function __construct( } /** + * * @return null|int */ public function getQuantity() @@ -89,6 +96,7 @@ public function getQuantity() } /** + * * @return null|string */ public function getLineItemId() @@ -106,6 +114,7 @@ public function getLineItemId() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -123,6 +132,7 @@ public function getCustomLineItemId() } /** + * * @return null|string */ public function getComment() @@ -140,6 +150,7 @@ public function getComment() } /** + * * @return null|string */ public function getShipmentState() @@ -159,6 +170,7 @@ public function getShipmentState() /** *

    Custom Fields of this return item.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Order/ReturnItemModel.php b/lib/commercetools-api/src/Models/Order/ReturnItemModel.php index 15754923bcf..4c33ed246c5 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItemModel.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItemModel.php @@ -24,46 +24,55 @@ final class ReturnItemModel extends JsonObjectModel implements ReturnItem { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $quantity; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $comment; /** + * * @var ?string */ protected $shipmentState; /** + * * @var ?string */ protected $paymentState; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?DateTimeImmutable */ protected $createdAt; @@ -88,7 +97,8 @@ public function __construct( ?string $paymentState = null, ?CustomFields $custom = null, ?DateTimeImmutable $lastModifiedAt = null, - ?DateTimeImmutable $createdAt = null + ?DateTimeImmutable $createdAt = null, + ?string $type = null ) { $this->id = $id; $this->quantity = $quantity; @@ -98,12 +108,13 @@ public function __construct( $this->custom = $custom; $this->lastModifiedAt = $lastModifiedAt; $this->createdAt = $createdAt; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** *

    Unique identifier of the ReturnItem.

    * + * * @return null|string */ public function getId() @@ -121,6 +132,7 @@ public function getId() } /** + * * @return null|int */ public function getQuantity() @@ -138,6 +150,7 @@ public function getQuantity() } /** + * * @return null|string */ public function getType() @@ -155,6 +168,7 @@ public function getType() } /** + * * @return null|string */ public function getComment() @@ -172,6 +186,7 @@ public function getComment() } /** + * * @return null|string */ public function getShipmentState() @@ -189,6 +204,7 @@ public function getShipmentState() } /** + * * @return null|string */ public function getPaymentState() @@ -208,6 +224,7 @@ public function getPaymentState() /** *

    Custom Fields of this return item.

    * + * * @return null|CustomFields */ public function getCustom() @@ -226,6 +243,7 @@ public function getCustom() } /** + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -247,6 +265,7 @@ public function getLastModifiedAt() } /** + * * @return null|DateTimeImmutable */ public function getCreatedAt() diff --git a/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraft.php b/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraft.php index fcc2518f21e..6e4f1e17881 100644 --- a/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraft.php +++ b/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraft.php @@ -29,11 +29,13 @@ interface ShippingInfoImportDraft extends JsonObject public const FIELD_SHIPPING_METHOD_STATE = 'shippingMethodState'; /** + * @return null|string */ public function getShippingMethodName(); /** + * @return null|Money */ public function getPrice(); @@ -41,16 +43,19 @@ public function getPrice(); /** *

    The shipping rate used to determine the price.

    * + * @return null|ShippingRateDraft */ public function getShippingRate(); /** + * @return null|TaxRate */ public function getTaxRate(); /** + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory(); @@ -58,6 +63,7 @@ public function getTaxCategory(); /** *

    Not set if custom shipping method is used.

    * + * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod(); @@ -65,11 +71,13 @@ public function getShippingMethod(); /** *

    Deliveries are compilations of information on how the articles are being delivered to the customers.

    * - * @return null|DeliveryCollection + + * @return null|DeliveryDraftCollection */ public function getDeliveries(); /** + * @return null|DiscountedLineItemPriceDraft */ public function getDiscountedPrice(); @@ -77,6 +85,7 @@ public function getDiscountedPrice(); /** *

    Indicates whether the ShippingMethod referenced is allowed for the cart or not.

    * + * @return null|string */ public function getShippingMethodState(); @@ -112,9 +121,9 @@ public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): voi public function setShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod): void; /** - * @param ?DeliveryCollection $deliveries + * @param ?DeliveryDraftCollection $deliveries */ - public function setDeliveries(?DeliveryCollection $deliveries): void; + public function setDeliveries(?DeliveryDraftCollection $deliveries): void; /** * @param ?DiscountedLineItemPriceDraft $discountedPrice diff --git a/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraftBuilder.php b/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraftBuilder.php index 7311a611158..be50972e657 100644 --- a/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraftBuilder.php @@ -31,51 +31,61 @@ final class ShippingInfoImportDraftBuilder implements Builder { /** + * @var ?string */ private $shippingMethodName; /** + * @var null|Money|MoneyBuilder */ private $price; /** + * @var null|ShippingRateDraft|ShippingRateDraftBuilder */ private $shippingRate; /** + * @var null|TaxRate|TaxRateBuilder */ private $taxRate; /** + * @var null|TaxCategoryResourceIdentifier|TaxCategoryResourceIdentifierBuilder */ private $taxCategory; /** + * @var null|ShippingMethodResourceIdentifier|ShippingMethodResourceIdentifierBuilder */ private $shippingMethod; /** - * @var ?DeliveryCollection + + * @var ?DeliveryDraftCollection */ private $deliveries; /** + * @var null|DiscountedLineItemPriceDraft|DiscountedLineItemPriceDraftBuilder */ private $discountedPrice; /** + * @var ?string */ private $shippingMethodState; /** + * @return null|string */ public function getShippingMethodName() @@ -84,6 +94,7 @@ public function getShippingMethodName() } /** + * @return null|Money */ public function getPrice() @@ -94,6 +105,7 @@ public function getPrice() /** *

    The shipping rate used to determine the price.

    * + * @return null|ShippingRateDraft */ public function getShippingRate() @@ -102,6 +114,7 @@ public function getShippingRate() } /** + * @return null|TaxRate */ public function getTaxRate() @@ -110,6 +123,7 @@ public function getTaxRate() } /** + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -120,6 +134,7 @@ public function getTaxCategory() /** *

    Not set if custom shipping method is used.

    * + * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod() @@ -130,7 +145,8 @@ public function getShippingMethod() /** *

    Deliveries are compilations of information on how the articles are being delivered to the customers.

    * - * @return null|DeliveryCollection + + * @return null|DeliveryDraftCollection */ public function getDeliveries() { @@ -138,6 +154,7 @@ public function getDeliveries() } /** + * @return null|DiscountedLineItemPriceDraft */ public function getDiscountedPrice() @@ -148,6 +165,7 @@ public function getDiscountedPrice() /** *

    Indicates whether the ShippingMethod referenced is allowed for the cart or not.

    * + * @return null|string */ public function getShippingMethodState() @@ -222,10 +240,10 @@ public function withShippingMethod(?ShippingMethodResourceIdentifier $shippingMe } /** - * @param ?DeliveryCollection $deliveries + * @param ?DeliveryDraftCollection $deliveries * @return $this */ - public function withDeliveries(?DeliveryCollection $deliveries) + public function withDeliveries(?DeliveryDraftCollection $deliveries) { $this->deliveries = $deliveries; diff --git a/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraftModel.php b/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraftModel.php index df620a595ae..4e588752a07 100644 --- a/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraftModel.php @@ -30,46 +30,55 @@ final class ShippingInfoImportDraftModel extends JsonObjectModel implements ShippingInfoImportDraft { /** + * * @var ?string */ protected $shippingMethodName; /** + * * @var ?Money */ protected $price; /** + * * @var ?ShippingRateDraft */ protected $shippingRate; /** + * * @var ?TaxRate */ protected $taxRate; /** + * * @var ?TaxCategoryResourceIdentifier */ protected $taxCategory; /** + * * @var ?ShippingMethodResourceIdentifier */ protected $shippingMethod; /** - * @var ?DeliveryCollection + * + * @var ?DeliveryDraftCollection */ protected $deliveries; /** + * * @var ?DiscountedLineItemPriceDraft */ protected $discountedPrice; /** + * * @var ?string */ protected $shippingMethodState; @@ -85,7 +94,7 @@ public function __construct( ?TaxRate $taxRate = null, ?TaxCategoryResourceIdentifier $taxCategory = null, ?ShippingMethodResourceIdentifier $shippingMethod = null, - ?DeliveryCollection $deliveries = null, + ?DeliveryDraftCollection $deliveries = null, ?DiscountedLineItemPriceDraft $discountedPrice = null, ?string $shippingMethodState = null ) { @@ -101,6 +110,7 @@ public function __construct( } /** + * * @return null|string */ public function getShippingMethodName() @@ -118,6 +128,7 @@ public function getShippingMethodName() } /** + * * @return null|Money */ public function getPrice() @@ -138,6 +149,7 @@ public function getPrice() /** *

    The shipping rate used to determine the price.

    * + * * @return null|ShippingRateDraft */ public function getShippingRate() @@ -156,6 +168,7 @@ public function getShippingRate() } /** + * * @return null|TaxRate */ public function getTaxRate() @@ -174,6 +187,7 @@ public function getTaxRate() } /** + * * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -194,6 +208,7 @@ public function getTaxCategory() /** *

    Not set if custom shipping method is used.

    * + * * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod() @@ -214,7 +229,8 @@ public function getShippingMethod() /** *

    Deliveries are compilations of information on how the articles are being delivered to the customers.

    * - * @return null|DeliveryCollection + * + * @return null|DeliveryDraftCollection */ public function getDeliveries() { @@ -224,13 +240,14 @@ public function getDeliveries() if (is_null($data)) { return null; } - $this->deliveries = DeliveryCollection::fromArray($data); + $this->deliveries = DeliveryDraftCollection::fromArray($data); } return $this->deliveries; } /** + * * @return null|DiscountedLineItemPriceDraft */ public function getDiscountedPrice() @@ -251,6 +268,7 @@ public function getDiscountedPrice() /** *

    Indicates whether the ShippingMethod referenced is allowed for the cart or not.

    * + * * @return null|string */ public function getShippingMethodState() @@ -317,9 +335,9 @@ public function setShippingMethod(?ShippingMethodResourceIdentifier $shippingMet } /** - * @param ?DeliveryCollection $deliveries + * @param ?DeliveryDraftCollection $deliveries */ - public function setDeliveries(?DeliveryCollection $deliveries): void + public function setDeliveries(?DeliveryDraftCollection $deliveries): void { $this->deliveries = $deliveries; } diff --git a/lib/commercetools-api/src/Models/Order/StagedOrderUpdateAction.php b/lib/commercetools-api/src/Models/Order/StagedOrderUpdateAction.php index 1b4f0f74570..56f79fc39a0 100644 --- a/lib/commercetools-api/src/Models/Order/StagedOrderUpdateAction.php +++ b/lib/commercetools-api/src/Models/Order/StagedOrderUpdateAction.php @@ -102,6 +102,7 @@ interface StagedOrderUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Order/StagedOrderUpdateActionModel.php b/lib/commercetools-api/src/Models/Order/StagedOrderUpdateActionModel.php index 69a391d867e..209f410b1f3 100644 --- a/lib/commercetools-api/src/Models/Order/StagedOrderUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/StagedOrderUpdateActionModel.php @@ -191,6 +191,7 @@ final class StagedOrderUpdateActionModel extends JsonObjectModel implements Stag { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -291,11 +292,13 @@ final class StagedOrderUpdateActionModel extends JsonObjectModel implements Stag * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Order/SyncInfo.php b/lib/commercetools-api/src/Models/Order/SyncInfo.php index b01c256333c..1dbf7ba85b4 100644 --- a/lib/commercetools-api/src/Models/Order/SyncInfo.php +++ b/lib/commercetools-api/src/Models/Order/SyncInfo.php @@ -22,6 +22,7 @@ interface SyncInfo extends JsonObject /** *

    Connection to a particular synchronization destination.

    * + * @return null|ChannelReference */ public function getChannel(); @@ -29,11 +30,13 @@ public function getChannel(); /** *

    Can be used to reference an external order instance, file etc.

    * + * @return null|string */ public function getExternalId(); /** + * @return null|DateTimeImmutable */ public function getSyncedAt(); diff --git a/lib/commercetools-api/src/Models/Order/SyncInfoBuilder.php b/lib/commercetools-api/src/Models/Order/SyncInfoBuilder.php index 0404d79b4d0..dc0bf11ea3b 100644 --- a/lib/commercetools-api/src/Models/Order/SyncInfoBuilder.php +++ b/lib/commercetools-api/src/Models/Order/SyncInfoBuilder.php @@ -24,16 +24,19 @@ final class SyncInfoBuilder implements Builder { /** + * @var null|ChannelReference|ChannelReferenceBuilder */ private $channel; /** + * @var ?string */ private $externalId; /** + * @var ?DateTimeImmutable */ private $syncedAt; @@ -41,6 +44,7 @@ final class SyncInfoBuilder implements Builder /** *

    Connection to a particular synchronization destination.

    * + * @return null|ChannelReference */ public function getChannel() @@ -51,6 +55,7 @@ public function getChannel() /** *

    Can be used to reference an external order instance, file etc.

    * + * @return null|string */ public function getExternalId() @@ -59,6 +64,7 @@ public function getExternalId() } /** + * @return null|DateTimeImmutable */ public function getSyncedAt() diff --git a/lib/commercetools-api/src/Models/Order/SyncInfoModel.php b/lib/commercetools-api/src/Models/Order/SyncInfoModel.php index b884379b462..db518a30e94 100644 --- a/lib/commercetools-api/src/Models/Order/SyncInfoModel.php +++ b/lib/commercetools-api/src/Models/Order/SyncInfoModel.php @@ -23,16 +23,19 @@ final class SyncInfoModel extends JsonObjectModel implements SyncInfo { /** + * * @var ?ChannelReference */ protected $channel; /** + * * @var ?string */ protected $externalId; /** + * * @var ?DateTimeImmutable */ protected $syncedAt; @@ -54,6 +57,7 @@ public function __construct( /** *

    Connection to a particular synchronization destination.

    * + * * @return null|ChannelReference */ public function getChannel() @@ -74,6 +78,7 @@ public function getChannel() /** *

    Can be used to reference an external order instance, file etc.

    * + * * @return null|string */ public function getExternalId() @@ -91,6 +96,7 @@ public function getExternalId() } /** + * * @return null|DateTimeImmutable */ public function getSyncedAt() diff --git a/lib/commercetools-api/src/Models/Order/TaxedItemPriceDraft.php b/lib/commercetools-api/src/Models/Order/TaxedItemPriceDraft.php index d9ce8c967ee..1785d06bfc7 100644 --- a/lib/commercetools-api/src/Models/Order/TaxedItemPriceDraft.php +++ b/lib/commercetools-api/src/Models/Order/TaxedItemPriceDraft.php @@ -21,6 +21,7 @@ interface TaxedItemPriceDraft extends JsonObject *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getTotalNet(); @@ -29,6 +30,7 @@ public function getTotalNet(); *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getTotalGross(); diff --git a/lib/commercetools-api/src/Models/Order/TaxedItemPriceDraftBuilder.php b/lib/commercetools-api/src/Models/Order/TaxedItemPriceDraftBuilder.php index 3e9d7565e58..0b4f18ccfee 100644 --- a/lib/commercetools-api/src/Models/Order/TaxedItemPriceDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/TaxedItemPriceDraftBuilder.php @@ -23,11 +23,13 @@ final class TaxedItemPriceDraftBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $totalNet; /** + * @var null|Money|MoneyBuilder */ private $totalGross; @@ -36,6 +38,7 @@ final class TaxedItemPriceDraftBuilder implements Builder *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getTotalNet() @@ -47,6 +50,7 @@ public function getTotalNet() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getTotalGross() diff --git a/lib/commercetools-api/src/Models/Order/TaxedItemPriceDraftModel.php b/lib/commercetools-api/src/Models/Order/TaxedItemPriceDraftModel.php index 93026d6d6e7..dc972ea5c23 100644 --- a/lib/commercetools-api/src/Models/Order/TaxedItemPriceDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/TaxedItemPriceDraftModel.php @@ -22,11 +22,13 @@ final class TaxedItemPriceDraftModel extends JsonObjectModel implements TaxedItemPriceDraft { /** + * * @var ?Money */ protected $totalNet; /** + * * @var ?Money */ protected $totalGross; @@ -47,6 +49,7 @@ public function __construct( *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * * @return null|Money */ public function getTotalNet() @@ -68,6 +71,7 @@ public function getTotalNet() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * * @return null|Money */ public function getTotalGross() diff --git a/lib/commercetools-api/src/Models/Order/TrackingData.php b/lib/commercetools-api/src/Models/Order/TrackingData.php index cfd1cc07a3f..6951988a7fa 100644 --- a/lib/commercetools-api/src/Models/Order/TrackingData.php +++ b/lib/commercetools-api/src/Models/Order/TrackingData.php @@ -22,6 +22,7 @@ interface TrackingData extends JsonObject /** *

    The ID to track one parcel.

    * + * @return null|string */ public function getTrackingId(); @@ -29,16 +30,19 @@ public function getTrackingId(); /** *

    The carrier that delivers the parcel.

    * + * @return null|string */ public function getCarrier(); /** + * @return null|string */ public function getProvider(); /** + * @return null|string */ public function getProviderTransaction(); @@ -46,6 +50,7 @@ public function getProviderTransaction(); /** *

    Flag to distinguish if the parcel is on the way to the customer (false) or on the way back (true).

    * + * @return null|bool */ public function getIsReturn(); diff --git a/lib/commercetools-api/src/Models/Order/TrackingDataBuilder.php b/lib/commercetools-api/src/Models/Order/TrackingDataBuilder.php index e37180b0681..0a6c2258f57 100644 --- a/lib/commercetools-api/src/Models/Order/TrackingDataBuilder.php +++ b/lib/commercetools-api/src/Models/Order/TrackingDataBuilder.php @@ -21,26 +21,31 @@ final class TrackingDataBuilder implements Builder { /** + * @var ?string */ private $trackingId; /** + * @var ?string */ private $carrier; /** + * @var ?string */ private $provider; /** + * @var ?string */ private $providerTransaction; /** + * @var ?bool */ private $isReturn; @@ -48,6 +53,7 @@ final class TrackingDataBuilder implements Builder /** *

    The ID to track one parcel.

    * + * @return null|string */ public function getTrackingId() @@ -58,6 +64,7 @@ public function getTrackingId() /** *

    The carrier that delivers the parcel.

    * + * @return null|string */ public function getCarrier() @@ -66,6 +73,7 @@ public function getCarrier() } /** + * @return null|string */ public function getProvider() @@ -74,6 +82,7 @@ public function getProvider() } /** + * @return null|string */ public function getProviderTransaction() @@ -84,6 +93,7 @@ public function getProviderTransaction() /** *

    Flag to distinguish if the parcel is on the way to the customer (false) or on the way back (true).

    * + * @return null|bool */ public function getIsReturn() diff --git a/lib/commercetools-api/src/Models/Order/TrackingDataModel.php b/lib/commercetools-api/src/Models/Order/TrackingDataModel.php index 7666c8e57ef..8c70e540492 100644 --- a/lib/commercetools-api/src/Models/Order/TrackingDataModel.php +++ b/lib/commercetools-api/src/Models/Order/TrackingDataModel.php @@ -20,26 +20,31 @@ final class TrackingDataModel extends JsonObjectModel implements TrackingData { /** + * * @var ?string */ protected $trackingId; /** + * * @var ?string */ protected $carrier; /** + * * @var ?string */ protected $provider; /** + * * @var ?string */ protected $providerTransaction; /** + * * @var ?bool */ protected $isReturn; @@ -65,6 +70,7 @@ public function __construct( /** *

    The ID to track one parcel.

    * + * * @return null|string */ public function getTrackingId() @@ -84,6 +90,7 @@ public function getTrackingId() /** *

    The carrier that delivers the parcel.

    * + * * @return null|string */ public function getCarrier() @@ -101,6 +108,7 @@ public function getCarrier() } /** + * * @return null|string */ public function getProvider() @@ -118,6 +126,7 @@ public function getProvider() } /** + * * @return null|string */ public function getProviderTransaction() @@ -137,6 +146,7 @@ public function getProviderTransaction() /** *

    Flag to distinguish if the parcel is on the way to the customer (false) or on the way back (true).

    * + * * @return null|bool */ public function getIsReturn() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEdit.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEdit.php index 33d34601264..9ff87e75bff 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEdit.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEdit.php @@ -32,6 +32,7 @@ interface OrderEdit extends BaseResource /** *

    Unique identifier of the OrderEdit.

    * + * @return null|string */ public function getId(); @@ -39,16 +40,19 @@ public function getId(); /** *

    The current version of the OrderEdit.

    * + * @return null|int */ public function getVersion(); /** + * @return null|DateTimeImmutable */ public function getCreatedAt(); /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -56,6 +60,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -63,6 +68,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -70,6 +76,7 @@ public function getCreatedBy(); /** *

    User-defined unique identifier of the OrderEdit.

    * + * @return null|string */ public function getKey(); @@ -77,6 +84,7 @@ public function getKey(); /** *

    The order to be updated with this edit.

    * + * @return null|OrderReference */ public function getResource(); @@ -85,11 +93,13 @@ public function getResource(); *

    The actions to apply to the Order. * Cannot be updated after the edit has been applied.

    * + * @return null|StagedOrderUpdateActionCollection */ public function getStagedActions(); /** + * @return null|CustomFields */ public function getCustom(); @@ -98,6 +108,7 @@ public function getCustom(); *

    Contains a preview of the changes in case of unapplied edit. * For applied edits, it contains the summary of the changes.

    * + * @return null|OrderEditResult */ public function getResult(); @@ -105,6 +116,7 @@ public function getResult(); /** *

    This field can be used to add textual information regarding the edit.

    * + * @return null|string */ public function getComment(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionAction.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionAction.php index 72c5c5ad59d..abe8d426b8e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionAction.php @@ -17,6 +17,7 @@ interface OrderEditAddStagedActionAction extends OrderEditUpdateAction public const FIELD_STAGED_ACTION = 'stagedAction'; /** + * @return null|StagedOrderUpdateAction */ public function getStagedAction(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionActionBuilder.php index c8f769cec29..2c32d93f4aa 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionActionBuilder.php @@ -23,11 +23,13 @@ final class OrderEditAddStagedActionActionBuilder implements Builder { /** + * @var null|StagedOrderUpdateAction|StagedOrderUpdateActionBuilder */ private $stagedAction; /** + * @return null|StagedOrderUpdateAction */ public function getStagedAction() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionActionModel.php index 1971e26206e..2a39f112769 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionActionModel.php @@ -23,11 +23,13 @@ final class OrderEditAddStagedActionActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'addStagedAction'; /** + * * @var ?string */ protected $action; /** + * * @var ?StagedOrderUpdateAction */ protected $stagedAction; @@ -37,13 +39,15 @@ final class OrderEditAddStagedActionActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?StagedOrderUpdateAction $stagedAction = null + ?StagedOrderUpdateAction $stagedAction = null, + ?string $action = null ) { $this->stagedAction = $stagedAction; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|StagedOrderUpdateAction */ public function getStagedAction() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplied.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplied.php index b94f35dd6cc..24db5efdf24 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplied.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplied.php @@ -19,16 +19,19 @@ interface OrderEditApplied extends OrderEditResult public const FIELD_EXCERPT_AFTER_EDIT = 'excerptAfterEdit'; /** + * @return null|DateTimeImmutable */ public function getAppliedAt(); /** + * @return null|OrderExcerpt */ public function getExcerptBeforeEdit(); /** + * @return null|OrderExcerpt */ public function getExcerptAfterEdit(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAppliedBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAppliedBuilder.php index 2ff67896938..af985542489 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAppliedBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAppliedBuilder.php @@ -22,21 +22,25 @@ final class OrderEditAppliedBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $appliedAt; /** + * @var null|OrderExcerpt|OrderExcerptBuilder */ private $excerptBeforeEdit; /** + * @var null|OrderExcerpt|OrderExcerptBuilder */ private $excerptAfterEdit; /** + * @return null|DateTimeImmutable */ public function getAppliedAt() @@ -45,6 +49,7 @@ public function getAppliedAt() } /** + * @return null|OrderExcerpt */ public function getExcerptBeforeEdit() @@ -53,6 +58,7 @@ public function getExcerptBeforeEdit() } /** + * @return null|OrderExcerpt */ public function getExcerptAfterEdit() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAppliedModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAppliedModel.php index 4f8b436de60..aa0564c121f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAppliedModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAppliedModel.php @@ -22,21 +22,25 @@ final class OrderEditAppliedModel extends JsonObjectModel implements OrderEditAp { public const DISCRIMINATOR_VALUE = 'Applied'; /** + * * @var ?string */ protected $type; /** + * * @var ?DateTimeImmutable */ protected $appliedAt; /** + * * @var ?OrderExcerpt */ protected $excerptBeforeEdit; /** + * * @var ?OrderExcerpt */ protected $excerptAfterEdit; @@ -48,15 +52,17 @@ final class OrderEditAppliedModel extends JsonObjectModel implements OrderEditAp public function __construct( ?DateTimeImmutable $appliedAt = null, ?OrderExcerpt $excerptBeforeEdit = null, - ?OrderExcerpt $excerptAfterEdit = null + ?OrderExcerpt $excerptAfterEdit = null, + ?string $type = null ) { $this->appliedAt = $appliedAt; $this->excerptBeforeEdit = $excerptBeforeEdit; $this->excerptAfterEdit = $excerptAfterEdit; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -74,6 +80,7 @@ public function getType() } /** + * * @return null|DateTimeImmutable */ public function getAppliedAt() @@ -95,6 +102,7 @@ public function getAppliedAt() } /** + * * @return null|OrderExcerpt */ public function getExcerptBeforeEdit() @@ -113,6 +121,7 @@ public function getExcerptBeforeEdit() } /** + * * @return null|OrderExcerpt */ public function getExcerptAfterEdit() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditApply.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditApply.php index 4d5db136404..b926f385c87 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditApply.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditApply.php @@ -17,11 +17,13 @@ interface OrderEditApply extends JsonObject public const FIELD_RESOURCE_VERSION = 'resourceVersion'; /** + * @return null|int */ public function getEditVersion(); /** + * @return null|int */ public function getResourceVersion(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplyBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplyBuilder.php index 319dba80c57..cce3cb6a320 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplyBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplyBuilder.php @@ -21,16 +21,19 @@ final class OrderEditApplyBuilder implements Builder { /** + * @var ?int */ private $editVersion; /** + * @var ?int */ private $resourceVersion; /** + * @return null|int */ public function getEditVersion() @@ -39,6 +42,7 @@ public function getEditVersion() } /** + * @return null|int */ public function getResourceVersion() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplyModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplyModel.php index 7b72bdbeb67..3365fc9fcd0 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplyModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplyModel.php @@ -20,11 +20,13 @@ final class OrderEditApplyModel extends JsonObjectModel implements OrderEditApply { /** + * * @var ?int */ protected $editVersion; /** + * * @var ?int */ protected $resourceVersion; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|int */ public function getEditVersion() @@ -59,6 +62,7 @@ public function getEditVersion() } /** + * * @return null|int */ public function getResourceVersion() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditBuilder.php index da1f023386b..5f3a0aa7021 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditBuilder.php @@ -33,61 +33,73 @@ final class OrderEditBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $key; /** + * @var null|OrderReference|OrderReferenceBuilder */ private $resource; /** + * @var ?StagedOrderUpdateActionCollection */ private $stagedActions; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var null|OrderEditResult|OrderEditResultBuilder */ private $result; /** + * @var ?string */ private $comment; @@ -95,6 +107,7 @@ final class OrderEditBuilder implements Builder /** *

    Unique identifier of the OrderEdit.

    * + * @return null|string */ public function getId() @@ -105,6 +118,7 @@ public function getId() /** *

    The current version of the OrderEdit.

    * + * @return null|int */ public function getVersion() @@ -113,6 +127,7 @@ public function getVersion() } /** + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -121,6 +136,7 @@ public function getCreatedAt() } /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -131,6 +147,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -141,6 +158,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -151,6 +169,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the OrderEdit.

    * + * @return null|string */ public function getKey() @@ -161,6 +180,7 @@ public function getKey() /** *

    The order to be updated with this edit.

    * + * @return null|OrderReference */ public function getResource() @@ -172,6 +192,7 @@ public function getResource() *

    The actions to apply to the Order. * Cannot be updated after the edit has been applied.

    * + * @return null|StagedOrderUpdateActionCollection */ public function getStagedActions() @@ -180,6 +201,7 @@ public function getStagedActions() } /** + * @return null|CustomFields */ public function getCustom() @@ -191,6 +213,7 @@ public function getCustom() *

    Contains a preview of the changes in case of unapplied edit. * For applied edits, it contains the summary of the changes.

    * + * @return null|OrderEditResult */ public function getResult() @@ -201,6 +224,7 @@ public function getResult() /** *

    This field can be used to add textual information regarding the edit.

    * + * @return null|string */ public function getComment() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraft.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraft.php index d5bea9d5f16..910464f5daf 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraft.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraft.php @@ -26,6 +26,7 @@ interface OrderEditDraft extends JsonObject /** *

    User-defined unique identifier for the OrderEdit.

    * + * @return null|string */ public function getKey(); @@ -33,6 +34,7 @@ public function getKey(); /** *

    The order to be updated with this edit.

    * + * @return null|OrderReference */ public function getResource(); @@ -40,6 +42,7 @@ public function getResource(); /** *

    The actions to apply to resource.

    * + * @return null|StagedOrderUpdateActionCollection */ public function getStagedActions(); @@ -47,6 +50,7 @@ public function getStagedActions(); /** *

    The custom fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -54,6 +58,7 @@ public function getCustom(); /** *

    This field can be used to add additional textual information regarding the edit.

    * + * @return null|string */ public function getComment(); @@ -61,6 +66,7 @@ public function getComment(); /** *

    When set to true the edit is applied on the Order without persisting it.

    * + * @return null|bool */ public function getDryRun(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraftBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraftBuilder.php index de424f78d60..fa5527706ee 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraftBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraftBuilder.php @@ -26,31 +26,37 @@ final class OrderEditDraftBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var null|OrderReference|OrderReferenceBuilder */ private $resource; /** + * @var ?StagedOrderUpdateActionCollection */ private $stagedActions; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var ?string */ private $comment; /** + * @var ?bool */ private $dryRun; @@ -58,6 +64,7 @@ final class OrderEditDraftBuilder implements Builder /** *

    User-defined unique identifier for the OrderEdit.

    * + * @return null|string */ public function getKey() @@ -68,6 +75,7 @@ public function getKey() /** *

    The order to be updated with this edit.

    * + * @return null|OrderReference */ public function getResource() @@ -78,6 +86,7 @@ public function getResource() /** *

    The actions to apply to resource.

    * + * @return null|StagedOrderUpdateActionCollection */ public function getStagedActions() @@ -88,6 +97,7 @@ public function getStagedActions() /** *

    The custom fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -98,6 +108,7 @@ public function getCustom() /** *

    This field can be used to add additional textual information regarding the edit.

    * + * @return null|string */ public function getComment() @@ -108,6 +119,7 @@ public function getComment() /** *

    When set to true the edit is applied on the Order without persisting it.

    * + * @return null|bool */ public function getDryRun() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraftModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraftModel.php index 403f5df72cc..322e3c0cbbf 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraftModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraftModel.php @@ -25,31 +25,37 @@ final class OrderEditDraftModel extends JsonObjectModel implements OrderEditDraft { /** + * * @var ?string */ protected $key; /** + * * @var ?OrderReference */ protected $resource; /** + * * @var ?StagedOrderUpdateActionCollection */ protected $stagedActions; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?string */ protected $comment; /** + * * @var ?bool */ protected $dryRun; @@ -77,6 +83,7 @@ public function __construct( /** *

    User-defined unique identifier for the OrderEdit.

    * + * * @return null|string */ public function getKey() @@ -96,6 +103,7 @@ public function getKey() /** *

    The order to be updated with this edit.

    * + * * @return null|OrderReference */ public function getResource() @@ -116,6 +124,7 @@ public function getResource() /** *

    The actions to apply to resource.

    * + * * @return null|StagedOrderUpdateActionCollection */ public function getStagedActions() @@ -135,6 +144,7 @@ public function getStagedActions() /** *

    The custom fields.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -155,6 +165,7 @@ public function getCustom() /** *

    This field can be used to add additional textual information regarding the edit.

    * + * * @return null|string */ public function getComment() @@ -174,6 +185,7 @@ public function getComment() /** *

    When set to true the edit is applied on the Order without persisting it.

    * + * * @return null|bool */ public function getDryRun() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditModel.php index 86fb43da68f..d5d9eedbfb7 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditModel.php @@ -32,61 +32,73 @@ final class OrderEditModel extends JsonObjectModel implements OrderEdit { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $key; /** + * * @var ?OrderReference */ protected $resource; /** + * * @var ?StagedOrderUpdateActionCollection */ protected $stagedActions; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?OrderEditResult */ protected $result; /** + * * @var ?string */ protected $comment; @@ -126,6 +138,7 @@ public function __construct( /** *

    Unique identifier of the OrderEdit.

    * + * * @return null|string */ public function getId() @@ -145,6 +158,7 @@ public function getId() /** *

    The current version of the OrderEdit.

    * + * * @return null|int */ public function getVersion() @@ -162,6 +176,7 @@ public function getVersion() } /** + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -183,6 +198,7 @@ public function getCreatedAt() } /** + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -206,6 +222,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -226,6 +243,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -246,6 +264,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the OrderEdit.

    * + * * @return null|string */ public function getKey() @@ -265,6 +284,7 @@ public function getKey() /** *

    The order to be updated with this edit.

    * + * * @return null|OrderReference */ public function getResource() @@ -286,6 +306,7 @@ public function getResource() *

    The actions to apply to the Order. * Cannot be updated after the edit has been applied.

    * + * * @return null|StagedOrderUpdateActionCollection */ public function getStagedActions() @@ -303,6 +324,7 @@ public function getStagedActions() } /** + * * @return null|CustomFields */ public function getCustom() @@ -324,6 +346,7 @@ public function getCustom() *

    Contains a preview of the changes in case of unapplied edit. * For applied edits, it contains the summary of the changes.

    * + * * @return null|OrderEditResult */ public function getResult() @@ -344,6 +367,7 @@ public function getResult() /** *

    This field can be used to add textual information regarding the edit.

    * + * * @return null|string */ public function getComment() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditNotProcessedModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditNotProcessedModel.php index 00167f9f26a..8de6b80c751 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditNotProcessedModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditNotProcessedModel.php @@ -21,6 +21,7 @@ final class OrderEditNotProcessedModel extends JsonObjectModel implements OrderE { public const DISCRIMINATOR_VALUE = 'NotProcessed'; /** + * * @var ?string */ protected $type; @@ -30,11 +31,13 @@ final class OrderEditNotProcessedModel extends JsonObjectModel implements OrderE * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponse.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponse.php index 3fc503e7d95..edeb5b11d38 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponse.php @@ -22,16 +22,19 @@ interface OrderEditPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); /** + * @return null|int */ public function getCount(); /** + * @return null|int */ public function getTotal(); @@ -39,11 +42,13 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); /** + * @return null|OrderEditCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponseBuilder.php index f14390f20f5..968e4b8cf0f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class OrderEditPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?OrderEditCollection */ private $results; @@ -48,6 +53,7 @@ final class OrderEditPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -56,6 +62,7 @@ public function getLimit() } /** + * @return null|int */ public function getCount() @@ -64,6 +71,7 @@ public function getCount() } /** + * @return null|int */ public function getTotal() @@ -74,6 +82,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -82,6 +91,7 @@ public function getOffset() } /** + * @return null|OrderEditCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponseModel.php index 92b4f189da6..b962e601b3d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class OrderEditPagedQueryResponseModel extends JsonObjectModel implements OrderEditPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?OrderEditCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -82,6 +88,7 @@ public function getLimit() } /** + * * @return null|int */ public function getCount() @@ -99,6 +106,7 @@ public function getCount() } /** + * * @return null|int */ public function getTotal() @@ -118,6 +126,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -135,6 +144,7 @@ public function getOffset() } /** + * * @return null|OrderEditCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailure.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailure.php index 7bfe43f53bc..329fa1d3b3f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailure.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailure.php @@ -17,6 +17,7 @@ interface OrderEditPreviewFailure extends OrderEditResult public const FIELD_ERRORS = 'errors'; /** + * @return null|ErrorObjectCollection */ public function getErrors(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailureBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailureBuilder.php index b4fc229ba41..bb3a84ffeac 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailureBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailureBuilder.php @@ -22,11 +22,13 @@ final class OrderEditPreviewFailureBuilder implements Builder { /** + * @var ?ErrorObjectCollection */ private $errors; /** + * @return null|ErrorObjectCollection */ public function getErrors() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailureModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailureModel.php index 7fbdded077c..ab4c72d89e3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailureModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailureModel.php @@ -22,11 +22,13 @@ final class OrderEditPreviewFailureModel extends JsonObjectModel implements Orde { public const DISCRIMINATOR_VALUE = 'PreviewFailure'; /** + * * @var ?string */ protected $type; /** + * * @var ?ErrorObjectCollection */ protected $errors; @@ -36,13 +38,15 @@ final class OrderEditPreviewFailureModel extends JsonObjectModel implements Orde * @psalm-suppress MissingParamType */ public function __construct( - ?ErrorObjectCollection $errors = null + ?ErrorObjectCollection $errors = null, + ?string $type = null ) { $this->errors = $errors; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -60,6 +64,7 @@ public function getType() } /** + * * @return null|ErrorObjectCollection */ public function getErrors() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccess.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccess.php index 0675593ba58..e395a1e4582 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccess.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccess.php @@ -18,11 +18,13 @@ interface OrderEditPreviewSuccess extends OrderEditResult public const FIELD_MESSAGE_PAYLOADS = 'messagePayloads'; /** + * @return null|StagedOrder */ public function getPreview(); /** + * @return null|MessagePayloadCollection */ public function getMessagePayloads(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccessBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccessBuilder.php index 6066e00b2fe..c3c910f1999 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccessBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccessBuilder.php @@ -22,16 +22,19 @@ final class OrderEditPreviewSuccessBuilder implements Builder { /** + * @var null|StagedOrder|StagedOrderBuilder */ private $preview; /** + * @var ?MessagePayloadCollection */ private $messagePayloads; /** + * @return null|StagedOrder */ public function getPreview() @@ -40,6 +43,7 @@ public function getPreview() } /** + * @return null|MessagePayloadCollection */ public function getMessagePayloads() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccessModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccessModel.php index a086cafc435..95338c6eddf 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccessModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccessModel.php @@ -22,16 +22,19 @@ final class OrderEditPreviewSuccessModel extends JsonObjectModel implements Orde { public const DISCRIMINATOR_VALUE = 'PreviewSuccess'; /** + * * @var ?string */ protected $type; /** + * * @var ?StagedOrder */ protected $preview; /** + * * @var ?MessagePayloadCollection */ protected $messagePayloads; @@ -42,14 +45,16 @@ final class OrderEditPreviewSuccessModel extends JsonObjectModel implements Orde */ public function __construct( ?StagedOrder $preview = null, - ?MessagePayloadCollection $messagePayloads = null + ?MessagePayloadCollection $messagePayloads = null, + ?string $type = null ) { $this->preview = $preview; $this->messagePayloads = $messagePayloads; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -67,6 +72,7 @@ public function getType() } /** + * * @return null|StagedOrder */ public function getPreview() @@ -85,6 +91,7 @@ public function getPreview() } /** + * * @return null|MessagePayloadCollection */ public function getMessagePayloads() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditReference.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditReference.php index 3cf30cb9f45..aa0561376ed 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditReference.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditReference.php @@ -19,6 +19,7 @@ interface OrderEditReference extends Reference /** *

    Contains the representation of the expanded OrderEdit. Only present in responses to requests with Reference Expansion for OrderEdits.

    * + * @return null|OrderEdit */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

    Unique identifier of the referenced OrderEdit.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditReferenceBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditReferenceBuilder.php index 7d4f5acdaad..1d43e1345bf 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditReferenceBuilder.php @@ -23,11 +23,13 @@ final class OrderEditReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|OrderEdit|OrderEditBuilder */ private $obj; @@ -35,6 +37,7 @@ final class OrderEditReferenceBuilder implements Builder /** *

    Unique identifier of the referenced OrderEdit.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded OrderEdit. Only present in responses to requests with Reference Expansion for OrderEdits.

    * + * @return null|OrderEdit */ public function getObj() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditReferenceModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditReferenceModel.php index 8e522c48f52..b86801a710a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditReferenceModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditReferenceModel.php @@ -23,16 +23,19 @@ final class OrderEditReferenceModel extends JsonObjectModel implements OrderEdit { public const DISCRIMINATOR_VALUE = 'order-edit'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?OrderEdit */ protected $obj; @@ -43,16 +46,18 @@ final class OrderEditReferenceModel extends JsonObjectModel implements OrderEdit */ public function __construct( ?string $id = null, - ?OrderEdit $obj = null + ?OrderEdit $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced OrderEdit.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded OrderEdit. Only present in responses to requests with Reference Expansion for OrderEdits.

    * + * * @return null|OrderEdit */ public function getObj() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifier.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifier.php index d93ddb7cf93..6fd85a63d17 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifier.php @@ -17,6 +17,7 @@ interface OrderEditResourceIdentifier extends ResourceIdentifier /** *

    Unique identifier of the referenced OrderEdit. Either id or key is required.

    * + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

    User-defined unique identifier of the referenced OrderEdit. Either id or key is required.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifierBuilder.php index aa001c7f473..4e3dcce67ec 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class OrderEditResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class OrderEditResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced OrderEdit. Either id or key is required.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced OrderEdit. Either id or key is required.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifierModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifierModel.php index fb0de79ed0b..25dfce54861 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class OrderEditResourceIdentifierModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'order-edit'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class OrderEditResourceIdentifierModel extends JsonObjectModel implements */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced OrderEdit. Either id or key is required.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced OrderEdit. Either id or key is required.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditResult.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditResult.php index 23d638290db..10f4071b6ee 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditResult.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditResult.php @@ -17,6 +17,7 @@ interface OrderEditResult extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditResultModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditResultModel.php index 79c598be20f..dca61855dcb 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditResultModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditResultModel.php @@ -21,6 +21,7 @@ final class OrderEditResultModel extends JsonObjectModel implements OrderEditRes { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -40,11 +41,13 @@ final class OrderEditResultModel extends JsonObjectModel implements OrderEditRes * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentAction.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentAction.php index e58cef612ea..36a6b5d5319 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentAction.php @@ -16,6 +16,7 @@ interface OrderEditSetCommentAction extends OrderEditUpdateAction public const FIELD_COMMENT = 'comment'; /** + * @return null|string */ public function getComment(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentActionBuilder.php index e5d515f19e2..1edc4c9ca72 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentActionBuilder.php @@ -21,11 +21,13 @@ final class OrderEditSetCommentActionBuilder implements Builder { /** + * @var ?string */ private $comment; /** + * @return null|string */ public function getComment() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentActionModel.php index 1f1bf2e0541..e20b40c45b2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentActionModel.php @@ -21,11 +21,13 @@ final class OrderEditSetCommentActionModel extends JsonObjectModel implements Or { public const DISCRIMINATOR_VALUE = 'setComment'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $comment; @@ -35,13 +37,15 @@ final class OrderEditSetCommentActionModel extends JsonObjectModel implements Or * @psalm-suppress MissingParamType */ public function __construct( - ?string $comment = null + ?string $comment = null, + ?string $action = null ) { $this->comment = $comment; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getComment() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomFieldAction.php index 015f1b47ac4..55f217f594d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface OrderEditSetCustomFieldAction extends OrderEditUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomFieldActionBuilder.php index aa6ba76b897..183c64d32e5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class OrderEditSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class OrderEditSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomFieldActionModel.php index dc9e8d82931..65da72dfb58 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class OrderEditSetCustomFieldActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class OrderEditSetCustomFieldActionModel extends JsonObjectModel implement */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeAction.php index e2549067319..5de0628cb06 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface OrderEditSetCustomTypeAction extends OrderEditUpdateAction *

    Defines the Type that extends the OrderEdit with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the OrderEdit.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the OrderEdit.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeActionBuilder.php index 07a14ae370e..8a28e07cb79 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class OrderEditSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class OrderEditSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the OrderEdit with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the OrderEdit.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the OrderEdit.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeActionModel.php index 22a059c2f52..0b9eb0c7ae4 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class OrderEditSetCustomTypeActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class OrderEditSetCustomTypeActionModel extends JsonObjectModel implements */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the OrderEdit with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the OrderEdit.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the OrderEdit.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyAction.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyAction.php index 48ade6d0343..6fd53e4b8d5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyAction.php @@ -18,6 +18,7 @@ interface OrderEditSetKeyAction extends OrderEditUpdateAction /** *

    If key is absent or null, this field will be removed if it exists.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyActionBuilder.php index 08707b9c1af..5dc99c9b0af 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyActionBuilder.php @@ -21,6 +21,7 @@ final class OrderEditSetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; @@ -28,6 +29,7 @@ final class OrderEditSetKeyActionBuilder implements Builder /** *

    If key is absent or null, this field will be removed if it exists.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyActionModel.php index 85eab70c284..f3a9281c750 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyActionModel.php @@ -21,11 +21,13 @@ final class OrderEditSetKeyActionModel extends JsonObjectModel implements OrderE { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class OrderEditSetKeyActionModel extends JsonObjectModel implements OrderE * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    If key is absent or null, this field will be removed if it exists.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsAction.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsAction.php index 1f9ca6b7b8b..a5864c5d654 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsAction.php @@ -19,6 +19,7 @@ interface OrderEditSetStagedActionsAction extends OrderEditUpdateAction /** *

    The actions to edit the resource.

    * + * @return null|StagedOrderUpdateActionCollection */ public function getStagedActions(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsActionBuilder.php index 96012e74ca4..e894b1df871 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsActionBuilder.php @@ -22,6 +22,7 @@ final class OrderEditSetStagedActionsActionBuilder implements Builder { /** + * @var ?StagedOrderUpdateActionCollection */ private $stagedActions; @@ -29,6 +30,7 @@ final class OrderEditSetStagedActionsActionBuilder implements Builder /** *

    The actions to edit the resource.

    * + * @return null|StagedOrderUpdateActionCollection */ public function getStagedActions() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsActionModel.php index 5a5d734311f..c7d19d029a0 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsActionModel.php @@ -22,11 +22,13 @@ final class OrderEditSetStagedActionsActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setStagedActions'; /** + * * @var ?string */ protected $action; /** + * * @var ?StagedOrderUpdateActionCollection */ protected $stagedActions; @@ -36,13 +38,15 @@ final class OrderEditSetStagedActionsActionModel extends JsonObjectModel impleme * @psalm-suppress MissingParamType */ public function __construct( - ?StagedOrderUpdateActionCollection $stagedActions = null + ?StagedOrderUpdateActionCollection $stagedActions = null, + ?string $action = null ) { $this->stagedActions = $stagedActions; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() /** *

    The actions to edit the resource.

    * + * * @return null|StagedOrderUpdateActionCollection */ public function getStagedActions() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdate.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdate.php index 980d7fbc400..c16a5edbb28 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdate.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdate.php @@ -18,16 +18,19 @@ interface OrderEditUpdate extends JsonObject public const FIELD_DRY_RUN = 'dryRun'; /** + * @return null|int */ public function getVersion(); /** + * @return null|OrderEditUpdateActionCollection */ public function getActions(); /** + * @return null|bool */ public function getDryRun(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateAction.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateAction.php index 52790a9d618..22be479a931 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateAction.php @@ -17,6 +17,7 @@ interface OrderEditUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateActionModel.php index 7f867301542..0ebabb9708c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateActionModel.php @@ -21,6 +21,7 @@ final class OrderEditUpdateActionModel extends JsonObjectModel implements OrderE { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -42,11 +43,13 @@ final class OrderEditUpdateActionModel extends JsonObjectModel implements OrderE * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateBuilder.php index 681e573b2a4..1f6ae3d687f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateBuilder.php @@ -21,21 +21,25 @@ final class OrderEditUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?OrderEditUpdateActionCollection */ private $actions; /** + * @var ?bool */ private $dryRun; /** + * @return null|int */ public function getVersion() @@ -44,6 +48,7 @@ public function getVersion() } /** + * @return null|OrderEditUpdateActionCollection */ public function getActions() @@ -52,6 +57,7 @@ public function getActions() } /** + * @return null|bool */ public function getDryRun() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateModel.php index 7d15d505db9..09c9ba057ef 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateModel.php @@ -20,16 +20,19 @@ final class OrderEditUpdateModel extends JsonObjectModel implements OrderEditUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?OrderEditUpdateActionCollection */ protected $actions; /** + * * @var ?bool */ protected $dryRun; @@ -49,6 +52,7 @@ public function __construct( } /** + * * @return null|int */ public function getVersion() @@ -66,6 +70,7 @@ public function getVersion() } /** + * * @return null|OrderEditUpdateActionCollection */ public function getActions() @@ -83,6 +88,7 @@ public function getActions() } /** + * * @return null|bool */ public function getDryRun() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderExcerpt.php b/lib/commercetools-api/src/Models/OrderEdit/OrderExcerpt.php index 38007de4e38..6eec4800d20 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderExcerpt.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderExcerpt.php @@ -20,16 +20,19 @@ interface OrderExcerpt extends JsonObject public const FIELD_VERSION = 'version'; /** + * @return null|TypedMoney */ public function getTotalPrice(); /** + * @return null|TaxedPrice */ public function getTaxedPrice(); /** + * @return null|int */ public function getVersion(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderExcerptBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderExcerptBuilder.php index 35c2452afb6..0c5dd041eb0 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderExcerptBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderExcerptBuilder.php @@ -25,21 +25,25 @@ final class OrderExcerptBuilder implements Builder { /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalPrice; /** + * @var null|TaxedPrice|TaxedPriceBuilder */ private $taxedPrice; /** + * @var ?int */ private $version; /** + * @return null|TypedMoney */ public function getTotalPrice() @@ -48,6 +52,7 @@ public function getTotalPrice() } /** + * @return null|TaxedPrice */ public function getTaxedPrice() @@ -56,6 +61,7 @@ public function getTaxedPrice() } /** + * @return null|int */ public function getVersion() diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderExcerptModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderExcerptModel.php index 87a74c42574..0b204913517 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderExcerptModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderExcerptModel.php @@ -24,16 +24,19 @@ final class OrderExcerptModel extends JsonObjectModel implements OrderExcerpt { /** + * * @var ?TypedMoney */ protected $totalPrice; /** + * * @var ?TaxedPrice */ protected $taxedPrice; /** + * * @var ?int */ protected $version; @@ -53,6 +56,7 @@ public function __construct( } /** + * * @return null|TypedMoney */ public function getTotalPrice() @@ -71,6 +75,7 @@ public function getTotalPrice() } /** + * * @return null|TaxedPrice */ public function getTaxedPrice() @@ -89,6 +94,7 @@ public function getTaxedPrice() } /** + * * @return null|int */ public function getVersion() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemAction.php index 0231789f597..fb4aefdf3f6 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemAction.php @@ -26,11 +26,13 @@ interface StagedOrderAddCustomLineItemAction extends StagedOrderUpdateAction public const FIELD_TAX_CATEGORY = 'taxCategory'; public const FIELD_CUSTOM = 'custom'; public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; + public const FIELD_PRICE_MODE = 'priceMode'; /** *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getMoney(); @@ -38,16 +40,19 @@ public function getMoney(); /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getName(); /** + * @return null|int */ public function getQuantity(); /** + * @return null|string */ public function getSlug(); @@ -55,6 +60,7 @@ public function getSlug(); /** *

    ResourceIdentifier to a TaxCategory.

    * + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory(); @@ -62,15 +68,29 @@ public function getTaxCategory(); /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); + /** + *
      + *
    • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.
    • + *
    • If External, Cart Discounts are not considered on the Custom Line Item.
    • + *
    + * + + * @return null|string + */ + public function getPriceMode(); + /** * @param ?Money $money */ @@ -105,4 +125,9 @@ public function setCustom(?CustomFieldsDraft $custom): void; * @param ?ExternalTaxRateDraft $externalTaxRate */ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + + /** + * @param ?string $priceMode + */ + public function setPriceMode(?string $priceMode): void; } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionBuilder.php index 56f53dec52a..040258a41ac 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionBuilder.php @@ -33,44 +33,58 @@ final class StagedOrderAddCustomLineItemActionBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $money; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?int */ private $quantity; /** + * @var ?string */ private $slug; /** + * @var null|TaxCategoryResourceIdentifier|TaxCategoryResourceIdentifierBuilder */ private $taxCategory; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; + /** + + * @var ?string + */ + private $priceMode; + /** *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getMoney() @@ -81,6 +95,7 @@ public function getMoney() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getName() @@ -89,6 +104,7 @@ public function getName() } /** + * @return null|int */ public function getQuantity() @@ -97,6 +113,7 @@ public function getQuantity() } /** + * @return null|string */ public function getSlug() @@ -107,6 +124,7 @@ public function getSlug() /** *

    ResourceIdentifier to a TaxCategory.

    * + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -117,6 +135,7 @@ public function getTaxCategory() /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -125,6 +144,7 @@ public function getCustom() } /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() @@ -132,6 +152,21 @@ public function getExternalTaxRate() return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; } + /** + *
      + *
    • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.
    • + *
    • If External, Cart Discounts are not considered on the Custom Line Item.
    • + *
    + * + + * @return null|string + */ + public function getPriceMode() + { + return $this->priceMode; + } + /** * @param ?Money $money * @return $this @@ -209,6 +244,17 @@ public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) return $this; } + /** + * @param ?string $priceMode + * @return $this + */ + public function withPriceMode(?string $priceMode) + { + $this->priceMode = $priceMode; + + return $this; + } + /** * @deprecated use withMoney() instead * @return $this @@ -273,7 +319,8 @@ public function build(): StagedOrderAddCustomLineItemAction $this->slug, $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory, $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, - $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate + $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, + $this->priceMode ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionModel.php index 74b2da82e96..c64306a55ce 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionModel.php @@ -33,45 +33,59 @@ final class StagedOrderAddCustomLineItemActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'addCustomLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?Money */ protected $money; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?int */ protected $quantity; /** + * * @var ?string */ protected $slug; /** + * * @var ?TaxCategoryResourceIdentifier */ protected $taxCategory; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; + /** + * + * @var ?string + */ + protected $priceMode; + /** * @psalm-suppress MissingParamType @@ -83,7 +97,9 @@ public function __construct( ?string $slug = null, ?TaxCategoryResourceIdentifier $taxCategory = null, ?CustomFieldsDraft $custom = null, - ?ExternalTaxRateDraft $externalTaxRate = null + ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $priceMode = null, + ?string $action = null ) { $this->money = $money; $this->name = $name; @@ -92,10 +108,12 @@ public function __construct( $this->taxCategory = $taxCategory; $this->custom = $custom; $this->externalTaxRate = $externalTaxRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->priceMode = $priceMode; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -116,6 +134,7 @@ public function getAction() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * * @return null|Money */ public function getMoney() @@ -136,6 +155,7 @@ public function getMoney() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * * @return null|LocalizedString */ public function getName() @@ -154,6 +174,7 @@ public function getName() } /** + * * @return null|int */ public function getQuantity() @@ -171,6 +192,7 @@ public function getQuantity() } /** + * * @return null|string */ public function getSlug() @@ -190,6 +212,7 @@ public function getSlug() /** *

    ResourceIdentifier to a TaxCategory.

    * + * * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -210,6 +233,7 @@ public function getTaxCategory() /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -228,6 +252,7 @@ public function getCustom() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() @@ -245,6 +270,30 @@ public function getExternalTaxRate() return $this->externalTaxRate; } + /** + *
      + *
    • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.
    • + *
    • If External, Cart Discounts are not considered on the Custom Line Item.
    • + *
    + * + * + * @return null|string + */ + public function getPriceMode() + { + if (is_null($this->priceMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PRICE_MODE); + if (is_null($data)) { + return null; + } + $this->priceMode = (string) $data; + } + + return $this->priceMode; + } + /** * @param ?Money $money @@ -301,4 +350,12 @@ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void { $this->externalTaxRate = $externalTaxRate; } + + /** + * @param ?string $priceMode + */ + public function setPriceMode(?string $priceMode): void + { + $this->priceMode = $priceMode; + } } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php index 772a22f0bb6..3ffd52dd926 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php @@ -24,16 +24,19 @@ interface StagedOrderAddDeliveryAction extends StagedOrderUpdateAction public const FIELD_CUSTOM = 'custom'; /** + * @return null|DeliveryItemCollection */ public function getItems(); /** + * @return null|BaseAddress */ public function getAddress(); /** + * @return null|ParcelDraftCollection */ public function getParcels(); @@ -41,6 +44,7 @@ public function getParcels(); /** *

    Custom Fields for the Transaction.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php index 9181c91c5ab..c4699da39c0 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php @@ -29,26 +29,31 @@ final class StagedOrderAddDeliveryActionBuilder implements Builder { /** + * @var ?DeliveryItemCollection */ private $items; /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @var ?ParcelDraftCollection */ private $parcels; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @return null|DeliveryItemCollection */ public function getItems() @@ -57,6 +62,7 @@ public function getItems() } /** + * @return null|BaseAddress */ public function getAddress() @@ -65,6 +71,7 @@ public function getAddress() } /** + * @return null|ParcelDraftCollection */ public function getParcels() @@ -75,6 +82,7 @@ public function getParcels() /** *

    Custom Fields for the Transaction.

    * + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php index 04e9b54f80f..d4f8734e981 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php @@ -29,26 +29,31 @@ final class StagedOrderAddDeliveryActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'addDelivery'; /** + * * @var ?string */ protected $action; /** + * * @var ?DeliveryItemCollection */ protected $items; /** + * * @var ?BaseAddress */ protected $address; /** + * * @var ?ParcelDraftCollection */ protected $parcels; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -61,16 +66,18 @@ public function __construct( ?DeliveryItemCollection $items = null, ?BaseAddress $address = null, ?ParcelDraftCollection $parcels = null, - ?CustomFieldsDraft $custom = null + ?CustomFieldsDraft $custom = null, + ?string $action = null ) { $this->items = $items; $this->address = $address; $this->parcels = $parcels; $this->custom = $custom; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -88,6 +95,7 @@ public function getAction() } /** + * * @return null|DeliveryItemCollection */ public function getItems() @@ -105,6 +113,7 @@ public function getItems() } /** + * * @return null|BaseAddress */ public function getAddress() @@ -123,6 +132,7 @@ public function getAddress() } /** + * * @return null|ParcelDraftCollection */ public function getParcels() @@ -142,6 +152,7 @@ public function getParcels() /** *

    Custom Fields for the Transaction.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeAction.php index 9954cde231c..97d46e51838 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeAction.php @@ -17,6 +17,7 @@ interface StagedOrderAddDiscountCodeAction extends StagedOrderUpdateAction public const FIELD_CODE = 'code'; /** + * @return null|string */ public function getCode(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeActionBuilder.php index 34c9160cd10..febd203d3d2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderAddDiscountCodeActionBuilder implements Builder { /** + * @var ?string */ private $code; /** + * @return null|string */ public function getCode() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeActionModel.php index bd73a901dad..6659b27bc7a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeActionModel.php @@ -23,11 +23,13 @@ final class StagedOrderAddDiscountCodeActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'addDiscountCode'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $code; @@ -37,13 +39,15 @@ final class StagedOrderAddDiscountCodeActionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?string $code = null + ?string $code = null, + ?string $action = null ) { $this->code = $code; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|string */ public function getCode() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressAction.php index 2847bfa2b17..af5bedb4829 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressAction.php @@ -18,6 +18,7 @@ interface StagedOrderAddItemShippingAddressAction extends StagedOrderUpdateActio public const FIELD_ADDRESS = 'address'; /** + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionBuilder.php index 01b1659fe02..b5af2f4ae99 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionBuilder.php @@ -25,11 +25,13 @@ final class StagedOrderAddItemShippingAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionModel.php index da8bf9c5490..12613bcc461 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionModel.php @@ -25,11 +25,13 @@ final class StagedOrderAddItemShippingAddressActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'addItemShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -39,13 +41,15 @@ final class StagedOrderAddItemShippingAddressActionModel extends JsonObjectModel * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemAction.php index 6a354a59e41..22a31e3ddc0 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemAction.php @@ -37,6 +37,7 @@ interface StagedOrderAddLineItemAction extends StagedOrderUpdateAction /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -44,36 +45,43 @@ public function getCustom(); /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel(); /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); /** + * @return null|string */ public function getProductId(); /** + * @return null|int */ public function getVariantId(); /** + * @return null|string */ public function getSku(); /** + * @return null|int */ public function getQuantity(); /** + * @return null|DateTimeImmutable */ public function getAddedAt(); @@ -81,6 +89,7 @@ public function getAddedAt(); /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel(); @@ -89,16 +98,19 @@ public function getSupplyChannel(); *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getExternalPrice(); /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionBuilder.php index 02c68d9c847..273a14c58fc 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionBuilder.php @@ -36,61 +36,73 @@ final class StagedOrderAddLineItemActionBuilder implements Builder { /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $distributionChannel; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** + * @var ?string */ private $productId; /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?int */ private $quantity; /** + * @var ?DateTimeImmutable */ private $addedAt; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $supplyChannel; /** + * @var null|Money|MoneyBuilder */ private $externalPrice; /** + * @var null|ExternalLineItemTotalPrice|ExternalLineItemTotalPriceBuilder */ private $externalTotalPrice; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetails; @@ -98,6 +110,7 @@ final class StagedOrderAddLineItemActionBuilder implements Builder /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -108,6 +121,7 @@ public function getCustom() /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() @@ -116,6 +130,7 @@ public function getDistributionChannel() } /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() @@ -124,6 +139,7 @@ public function getExternalTaxRate() } /** + * @return null|string */ public function getProductId() @@ -132,6 +148,7 @@ public function getProductId() } /** + * @return null|int */ public function getVariantId() @@ -140,6 +157,7 @@ public function getVariantId() } /** + * @return null|string */ public function getSku() @@ -148,6 +166,7 @@ public function getSku() } /** + * @return null|int */ public function getQuantity() @@ -156,6 +175,7 @@ public function getQuantity() } /** + * @return null|DateTimeImmutable */ public function getAddedAt() @@ -166,6 +186,7 @@ public function getAddedAt() /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -177,6 +198,7 @@ public function getSupplyChannel() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getExternalPrice() @@ -185,6 +207,7 @@ public function getExternalPrice() } /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() @@ -193,6 +216,7 @@ public function getExternalTotalPrice() } /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionModel.php index 61e749059a1..b5e89d65598 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionModel.php @@ -36,66 +36,79 @@ final class StagedOrderAddLineItemActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'addLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?ChannelResourceIdentifier */ protected $distributionChannel; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; /** + * * @var ?string */ protected $productId; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?int */ protected $quantity; /** + * * @var ?DateTimeImmutable */ protected $addedAt; /** + * * @var ?ChannelResourceIdentifier */ protected $supplyChannel; /** + * * @var ?Money */ protected $externalPrice; /** + * * @var ?ExternalLineItemTotalPrice */ protected $externalTotalPrice; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; @@ -116,7 +129,8 @@ public function __construct( ?ChannelResourceIdentifier $supplyChannel = null, ?Money $externalPrice = null, ?ExternalLineItemTotalPrice $externalTotalPrice = null, - ?ItemShippingDetailsDraft $shippingDetails = null + ?ItemShippingDetailsDraft $shippingDetails = null, + ?string $action = null ) { $this->custom = $custom; $this->distributionChannel = $distributionChannel; @@ -130,10 +144,11 @@ public function __construct( $this->externalPrice = $externalPrice; $this->externalTotalPrice = $externalTotalPrice; $this->shippingDetails = $shippingDetails; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -153,6 +168,7 @@ public function getAction() /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -173,6 +189,7 @@ public function getCustom() /** *

    ResourceIdentifier to a Channel.

    * + * * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() @@ -191,6 +208,7 @@ public function getDistributionChannel() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() @@ -209,6 +227,7 @@ public function getExternalTaxRate() } /** + * * @return null|string */ public function getProductId() @@ -226,6 +245,7 @@ public function getProductId() } /** + * * @return null|int */ public function getVariantId() @@ -243,6 +263,7 @@ public function getVariantId() } /** + * * @return null|string */ public function getSku() @@ -260,6 +281,7 @@ public function getSku() } /** + * * @return null|int */ public function getQuantity() @@ -277,6 +299,7 @@ public function getQuantity() } /** + * * @return null|DateTimeImmutable */ public function getAddedAt() @@ -300,6 +323,7 @@ public function getAddedAt() /** *

    ResourceIdentifier to a Channel.

    * + * * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -321,6 +345,7 @@ public function getSupplyChannel() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * * @return null|Money */ public function getExternalPrice() @@ -339,6 +364,7 @@ public function getExternalPrice() } /** + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() @@ -357,6 +383,7 @@ public function getExternalTotalPrice() } /** + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryAction.php index b6ee4396164..80501268fd6 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryAction.php @@ -23,21 +23,25 @@ interface StagedOrderAddParcelToDeliveryAction extends StagedOrderUpdateAction public const FIELD_ITEMS = 'items'; /** + * @return null|string */ public function getDeliveryId(); /** + * @return null|ParcelMeasurements */ public function getMeasurements(); /** + * @return null|TrackingData */ public function getTrackingData(); /** + * @return null|DeliveryItemCollection */ public function getItems(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryActionBuilder.php index dd00a774b6b..6d0dbe531a1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryActionBuilder.php @@ -28,26 +28,31 @@ final class StagedOrderAddParcelToDeliveryActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var null|ParcelMeasurements|ParcelMeasurementsBuilder */ private $measurements; /** + * @var null|TrackingData|TrackingDataBuilder */ private $trackingData; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @return null|string */ public function getDeliveryId() @@ -56,6 +61,7 @@ public function getDeliveryId() } /** + * @return null|ParcelMeasurements */ public function getMeasurements() @@ -64,6 +70,7 @@ public function getMeasurements() } /** + * @return null|TrackingData */ public function getTrackingData() @@ -72,6 +79,7 @@ public function getTrackingData() } /** + * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryActionModel.php index e64687527c6..76ac0b18c49 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryActionModel.php @@ -28,26 +28,31 @@ final class StagedOrderAddParcelToDeliveryActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'addParcelToDelivery'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?ParcelMeasurements */ protected $measurements; /** + * * @var ?TrackingData */ protected $trackingData; /** + * * @var ?DeliveryItemCollection */ protected $items; @@ -60,16 +65,18 @@ public function __construct( ?string $deliveryId = null, ?ParcelMeasurements $measurements = null, ?TrackingData $trackingData = null, - ?DeliveryItemCollection $items = null + ?DeliveryItemCollection $items = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; $this->measurements = $measurements; $this->trackingData = $trackingData; $this->items = $items; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -87,6 +94,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() @@ -104,6 +112,7 @@ public function getDeliveryId() } /** + * * @return null|ParcelMeasurements */ public function getMeasurements() @@ -122,6 +131,7 @@ public function getMeasurements() } /** + * * @return null|TrackingData */ public function getTrackingData() @@ -140,6 +150,7 @@ public function getTrackingData() } /** + * * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentAction.php index ece2118f73a..59477e6b13d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentAction.php @@ -20,6 +20,7 @@ interface StagedOrderAddPaymentAction extends StagedOrderUpdateAction /** *

    ResourceIdentifier to a Payment.

    * + * @return null|PaymentResourceIdentifier */ public function getPayment(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentActionBuilder.php index f7609b1a0f1..5ad060449a1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentActionBuilder.php @@ -25,6 +25,7 @@ final class StagedOrderAddPaymentActionBuilder implements Builder { /** + * @var null|PaymentResourceIdentifier|PaymentResourceIdentifierBuilder */ private $payment; @@ -32,6 +33,7 @@ final class StagedOrderAddPaymentActionBuilder implements Builder /** *

    ResourceIdentifier to a Payment.

    * + * @return null|PaymentResourceIdentifier */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentActionModel.php index f5f444f0279..a650be72989 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentActionModel.php @@ -25,11 +25,13 @@ final class StagedOrderAddPaymentActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'addPayment'; /** + * * @var ?string */ protected $action; /** + * * @var ?PaymentResourceIdentifier */ protected $payment; @@ -39,13 +41,15 @@ final class StagedOrderAddPaymentActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?PaymentResourceIdentifier $payment = null + ?PaymentResourceIdentifier $payment = null, + ?string $action = null ) { $this->payment = $payment; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -65,6 +69,7 @@ public function getAction() /** *

    ResourceIdentifier to a Payment.

    * + * * @return null|PaymentResourceIdentifier */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoAction.php index 1efd0911daf..72c672e7bfb 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoAction.php @@ -21,16 +21,19 @@ interface StagedOrderAddReturnInfoAction extends StagedOrderUpdateAction public const FIELD_RETURN_DATE = 'returnDate'; /** + * @return null|string */ public function getReturnTrackingId(); /** + * @return null|ReturnItemDraftCollection */ public function getItems(); /** + * @return null|DateTimeImmutable */ public function getReturnDate(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoActionBuilder.php index f7894ee2dfa..dee4c41c7b2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoActionBuilder.php @@ -25,21 +25,25 @@ final class StagedOrderAddReturnInfoActionBuilder implements Builder { /** + * @var ?string */ private $returnTrackingId; /** + * @var ?ReturnItemDraftCollection */ private $items; /** + * @var ?DateTimeImmutable */ private $returnDate; /** + * @return null|string */ public function getReturnTrackingId() @@ -48,6 +52,7 @@ public function getReturnTrackingId() } /** + * @return null|ReturnItemDraftCollection */ public function getItems() @@ -56,6 +61,7 @@ public function getItems() } /** + * @return null|DateTimeImmutable */ public function getReturnDate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoActionModel.php index e3545413df1..7dc8b7ee134 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoActionModel.php @@ -25,21 +25,25 @@ final class StagedOrderAddReturnInfoActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'addReturnInfo'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $returnTrackingId; /** + * * @var ?ReturnItemDraftCollection */ protected $items; /** + * * @var ?DateTimeImmutable */ protected $returnDate; @@ -51,15 +55,17 @@ final class StagedOrderAddReturnInfoActionModel extends JsonObjectModel implemen public function __construct( ?string $returnTrackingId = null, ?ReturnItemDraftCollection $items = null, - ?DateTimeImmutable $returnDate = null + ?DateTimeImmutable $returnDate = null, + ?string $action = null ) { $this->returnTrackingId = $returnTrackingId; $this->items = $items; $this->returnDate = $returnDate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getReturnTrackingId() @@ -94,6 +101,7 @@ public function getReturnTrackingId() } /** + * * @return null|ReturnItemDraftCollection */ public function getItems() @@ -111,6 +119,7 @@ public function getItems() } /** + * * @return null|DateTimeImmutable */ public function getReturnDate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListAction.php index 5ee00f02f74..7999a3f66d6 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListAction.php @@ -23,6 +23,7 @@ interface StagedOrderAddShoppingListAction extends StagedOrderUpdateAction /** *

    ResourceIdentifier to a ShoppingList.

    * + * @return null|ShoppingListResourceIdentifier */ public function getShoppingList(); @@ -30,6 +31,7 @@ public function getShoppingList(); /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel(); @@ -37,6 +39,7 @@ public function getSupplyChannel(); /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListActionBuilder.php index b2becddd7c1..d292097b1d1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListActionBuilder.php @@ -27,16 +27,19 @@ final class StagedOrderAddShoppingListActionBuilder implements Builder { /** + * @var null|ShoppingListResourceIdentifier|ShoppingListResourceIdentifierBuilder */ private $shoppingList; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $supplyChannel; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $distributionChannel; @@ -44,6 +47,7 @@ final class StagedOrderAddShoppingListActionBuilder implements Builder /** *

    ResourceIdentifier to a ShoppingList.

    * + * @return null|ShoppingListResourceIdentifier */ public function getShoppingList() @@ -54,6 +58,7 @@ public function getShoppingList() /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -64,6 +69,7 @@ public function getSupplyChannel() /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListActionModel.php index e5442fe1ff2..1d22d3e3a3f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListActionModel.php @@ -27,21 +27,25 @@ final class StagedOrderAddShoppingListActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'addShoppingList'; /** + * * @var ?string */ protected $action; /** + * * @var ?ShoppingListResourceIdentifier */ protected $shoppingList; /** + * * @var ?ChannelResourceIdentifier */ protected $supplyChannel; /** + * * @var ?ChannelResourceIdentifier */ protected $distributionChannel; @@ -53,15 +57,17 @@ final class StagedOrderAddShoppingListActionModel extends JsonObjectModel implem public function __construct( ?ShoppingListResourceIdentifier $shoppingList = null, ?ChannelResourceIdentifier $supplyChannel = null, - ?ChannelResourceIdentifier $distributionChannel = null + ?ChannelResourceIdentifier $distributionChannel = null, + ?string $action = null ) { $this->shoppingList = $shoppingList; $this->supplyChannel = $supplyChannel; $this->distributionChannel = $distributionChannel; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -81,6 +87,7 @@ public function getAction() /** *

    ResourceIdentifier to a ShoppingList.

    * + * * @return null|ShoppingListResourceIdentifier */ public function getShoppingList() @@ -101,6 +108,7 @@ public function getShoppingList() /** *

    ResourceIdentifier to a Channel.

    * + * * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() @@ -121,6 +129,7 @@ public function getSupplyChannel() /** *

    ResourceIdentifier to a Channel.

    * + * * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderBuilder.php index 7182441854f..8672ad1b7eb 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderBuilder.php @@ -8,11 +8,14 @@ namespace Commercetools\Api\Models\OrderEdit; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceBuilder; use Commercetools\Api\Models\Cart\CartReference; use Commercetools\Api\Models\Cart\CartReferenceBuilder; use Commercetools\Api\Models\Cart\CustomLineItemCollection; use Commercetools\Api\Models\Cart\DiscountCodeInfoCollection; use Commercetools\Api\Models\Cart\LineItemCollection; +use Commercetools\Api\Models\Cart\ShippingCollection; use Commercetools\Api\Models\Cart\ShippingInfo; use Commercetools\Api\Models\Cart\ShippingInfoBuilder; use Commercetools\Api\Models\Cart\ShippingRateInput; @@ -59,211 +62,277 @@ final class StagedOrderBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?DateTimeImmutable */ private $completedAt; /** + * @var ?string */ private $orderNumber; /** + * @var ?string */ private $customerId; /** + * @var ?string */ private $customerEmail; /** + * @var ?string */ private $anonymousId; /** + + * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + */ + private $businessUnit; + + /** + * @var null|StoreKeyReference|StoreKeyReferenceBuilder */ private $store; /** + * @var ?LineItemCollection */ private $lineItems; /** + * @var ?CustomLineItemCollection */ private $customLineItems; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalPrice; /** + * @var null|TaxedPrice|TaxedPriceBuilder */ private $taxedPrice; /** + + * @var null|TaxedPrice|TaxedPriceBuilder + */ + private $taxedShippingPrice; + + /** + * @var null|Address|AddressBuilder */ private $shippingAddress; /** + * @var null|Address|AddressBuilder */ private $billingAddress; /** + + * @var ?string + */ + private $shippingMode; + + /** + + * @var ?ShippingCollection + */ + private $shipping; + + /** + * @var ?string */ private $taxMode; /** + * @var ?string */ private $taxRoundingMode; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $customerGroup; /** + * @var ?string */ private $country; /** + * @var ?string */ private $orderState; /** + * @var null|StateReference|StateReferenceBuilder */ private $state; /** + * @var ?string */ private $shipmentState; /** + * @var ?string */ private $paymentState; /** + * @var null|ShippingInfo|ShippingInfoBuilder */ private $shippingInfo; /** + * @var ?SyncInfoCollection */ private $syncInfo; /** + * @var ?ReturnInfoCollection */ private $returnInfo; /** + * @var ?DiscountCodeInfoCollection */ private $discountCodes; /** + * @deprecated * @var ?int */ private $lastMessageSequenceNumber; /** + * @var null|CartReference|CartReferenceBuilder */ private $cart; /** + * @var null|QuoteReference|QuoteReferenceBuilder */ private $quote; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var null|PaymentInfo|PaymentInfoBuilder */ private $paymentInfo; /** + * @var ?string */ private $locale; /** + * @var ?string */ private $inventoryMode; /** + * @var ?string */ private $origin; /** + * @var ?string */ private $taxCalculationMode; /** + * @var null|ShippingRateInput|ShippingRateInputBuilder */ private $shippingRateInput; /** + * @var ?AddressCollection */ private $itemShippingAddresses; /** + * @var ?CartDiscountReferenceCollection */ private $refusedGifts; @@ -271,6 +340,7 @@ final class StagedOrderBuilder implements Builder /** *

    Unique identifier of the Order.

    * + * @return null|string */ public function getId() @@ -281,6 +351,7 @@ public function getId() /** *

    The current version of the order.

    * + * @return null|int */ public function getVersion() @@ -289,6 +360,7 @@ public function getVersion() } /** + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -297,6 +369,7 @@ public function getCreatedAt() } /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -307,6 +380,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -317,6 +391,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -327,6 +402,7 @@ public function getCreatedBy() /** *

    This field will only be present if it was set for Order Import

    * + * @return null|DateTimeImmutable */ public function getCompletedAt() @@ -340,6 +416,7 @@ public function getCompletedAt() * It should be unique across a project. * Once it's set it cannot be changed.

    * + * @return null|string */ public function getOrderNumber() @@ -348,6 +425,7 @@ public function getOrderNumber() } /** + * @return null|string */ public function getCustomerId() @@ -356,6 +434,7 @@ public function getCustomerId() } /** + * @return null|string */ public function getCustomerEmail() @@ -366,6 +445,7 @@ public function getCustomerEmail() /** *

    Identifies carts and orders belonging to an anonymous session (the customer has not signed up/in yet).

    * + * @return null|string */ public function getAnonymousId() @@ -374,6 +454,18 @@ public function getAnonymousId() } /** + *

    The Business Unit the Order belongs to.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit() + { + return $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit; + } + + /** + * @return null|StoreKeyReference */ public function getStore() @@ -382,6 +474,7 @@ public function getStore() } /** + * @return null|LineItemCollection */ public function getLineItems() @@ -390,6 +483,7 @@ public function getLineItems() } /** + * @return null|CustomLineItemCollection */ public function getCustomLineItems() @@ -398,6 +492,7 @@ public function getCustomLineItems() } /** + * @return null|TypedMoney */ public function getTotalPrice() @@ -408,6 +503,7 @@ public function getTotalPrice() /** *

    The taxes are calculated based on the shipping address.

    * + * @return null|TaxedPrice */ public function getTaxedPrice() @@ -416,6 +512,22 @@ public function getTaxedPrice() } /** + *

    Sum of taxedPrice of ShippingInfo across all Shipping Methods. + * For Platform TaxMode, it is set automatically only if shipping address is set or Shipping Method is added to the Cart.

    + * + + * @return null|TaxedPrice + */ + public function getTaxedShippingPrice() + { + return $this->taxedShippingPrice instanceof TaxedPriceBuilder ? $this->taxedShippingPrice->build() : $this->taxedShippingPrice; + } + + /** + *

    Holds all shipping-related information per Shipping Method.

    + *

    For Multi ShippingMode, it is updated automatically after the Shipping Methods are added.

    + * + * @return null|Address */ public function getShippingAddress() @@ -424,6 +536,7 @@ public function getShippingAddress() } /** + * @return null|Address */ public function getBillingAddress() @@ -432,6 +545,30 @@ public function getBillingAddress() } /** + *

    Indicates whether one or multiple Shipping Methods are added to the Cart.

    + * + + * @return null|string + */ + public function getShippingMode() + { + return $this->shippingMode; + } + + /** + *

    Holds all shipping-related information per Shipping Method for Multi ShippingMode.

    + *

    It is updated automatically after the Shipping Method is added.

    + * + + * @return null|ShippingCollection + */ + public function getShipping() + { + return $this->shipping; + } + + /** + * @return null|string */ public function getTaxMode() @@ -442,6 +579,7 @@ public function getTaxMode() /** *

    When calculating taxes for taxedPrice, the selected mode is used for rouding.

    * + * @return null|string */ public function getTaxRoundingMode() @@ -453,6 +591,7 @@ public function getTaxRoundingMode() *

    Set when the customer is set and the customer is a member of a customer group. * Used for product variant price selection.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -464,6 +603,7 @@ public function getCustomerGroup() *

    A two-digit country code as per ISO 3166-1 alpha-2. * Used for product variant price selection.

    * + * @return null|string */ public function getCountry() @@ -474,6 +614,7 @@ public function getCountry() /** *

    One of the four predefined OrderStates.

    * + * @return null|string */ public function getOrderState() @@ -484,6 +625,7 @@ public function getOrderState() /** *

    This reference can point to a state in a custom workflow.

    * + * @return null|StateReference */ public function getState() @@ -492,6 +634,7 @@ public function getState() } /** + * @return null|string */ public function getShipmentState() @@ -500,6 +643,7 @@ public function getShipmentState() } /** + * @return null|string */ public function getPaymentState() @@ -510,6 +654,7 @@ public function getPaymentState() /** *

    Set if the ShippingMethod is set.

    * + * @return null|ShippingInfo */ public function getShippingInfo() @@ -518,6 +663,7 @@ public function getShippingInfo() } /** + * @return null|SyncInfoCollection */ public function getSyncInfo() @@ -526,6 +672,7 @@ public function getSyncInfo() } /** + * @return null|ReturnInfoCollection */ public function getReturnInfo() @@ -534,6 +681,7 @@ public function getReturnInfo() } /** + * @return null|DiscountCodeInfoCollection */ public function getDiscountCodes() @@ -544,6 +692,7 @@ public function getDiscountCodes() /** *

    Internal-only field.

    * + * @deprecated * @return null|int */ public function getLastMessageSequenceNumber() @@ -555,6 +704,7 @@ public function getLastMessageSequenceNumber() *

    Set when this order was created from a cart. * The cart will have the state Ordered.

    * + * @return null|CartReference */ public function getCart() @@ -565,6 +715,7 @@ public function getCart() /** *

    Set when this order was created from a quote.

    * + * @return null|QuoteReference */ public function getQuote() @@ -573,6 +724,7 @@ public function getQuote() } /** + * @return null|CustomFields */ public function getCustom() @@ -581,6 +733,7 @@ public function getCustom() } /** + * @return null|PaymentInfo */ public function getPaymentInfo() @@ -589,6 +742,7 @@ public function getPaymentInfo() } /** + * @return null|string */ public function getLocale() @@ -597,6 +751,7 @@ public function getLocale() } /** + * @return null|string */ public function getInventoryMode() @@ -605,6 +760,7 @@ public function getInventoryMode() } /** + * @return null|string */ public function getOrigin() @@ -615,6 +771,7 @@ public function getOrigin() /** *

    When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

    * + * @return null|string */ public function getTaxCalculationMode() @@ -625,6 +782,7 @@ public function getTaxCalculationMode() /** *

    The shippingRateInput is used as an input to select a ShippingRatePriceTier.

    * + * @return null|ShippingRateInput */ public function getShippingRateInput() @@ -635,6 +793,7 @@ public function getShippingRateInput() /** *

    Contains addresses for orders with multiple shipping addresses.

    * + * @return null|AddressCollection */ public function getItemShippingAddresses() @@ -645,6 +804,7 @@ public function getItemShippingAddresses() /** *

    Automatically filled when a line item with LineItemMode GiftLineItem is removed from this order.

    * + * @return null|CartDiscountReferenceCollection */ public function getRefusedGifts() @@ -773,6 +933,17 @@ public function withAnonymousId(?string $anonymousId) return $this; } + /** + * @param ?BusinessUnitKeyReference $businessUnit + * @return $this + */ + public function withBusinessUnit(?BusinessUnitKeyReference $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + /** * @param ?StoreKeyReference $store * @return $this @@ -828,6 +999,17 @@ public function withTaxedPrice(?TaxedPrice $taxedPrice) return $this; } + /** + * @param ?TaxedPrice $taxedShippingPrice + * @return $this + */ + public function withTaxedShippingPrice(?TaxedPrice $taxedShippingPrice) + { + $this->taxedShippingPrice = $taxedShippingPrice; + + return $this; + } + /** * @param ?Address $shippingAddress * @return $this @@ -850,6 +1032,28 @@ public function withBillingAddress(?Address $billingAddress) return $this; } + /** + * @param ?string $shippingMode + * @return $this + */ + public function withShippingMode(?string $shippingMode) + { + $this->shippingMode = $shippingMode; + + return $this; + } + + /** + * @param ?ShippingCollection $shipping + * @return $this + */ + public function withShipping(?ShippingCollection $shipping) + { + $this->shipping = $shipping; + + return $this; + } + /** * @param ?string $taxMode * @return $this @@ -1136,6 +1340,17 @@ public function withCreatedByBuilder(?CreatedByBuilder $createdBy) return $this; } + /** + * @deprecated use withBusinessUnit() instead + * @return $this + */ + public function withBusinessUnitBuilder(?BusinessUnitKeyReferenceBuilder $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + /** * @deprecated use withStore() instead * @return $this @@ -1169,6 +1384,17 @@ public function withTaxedPriceBuilder(?TaxedPriceBuilder $taxedPrice) return $this; } + /** + * @deprecated use withTaxedShippingPrice() instead + * @return $this + */ + public function withTaxedShippingPriceBuilder(?TaxedPriceBuilder $taxedShippingPrice) + { + $this->taxedShippingPrice = $taxedShippingPrice; + + return $this; + } + /** * @deprecated use withShippingAddress() instead * @return $this @@ -1293,13 +1519,17 @@ public function build(): StagedOrder $this->customerId, $this->customerEmail, $this->anonymousId, + $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit, $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store, $this->lineItems, $this->customLineItems, $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, $this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice, + $this->taxedShippingPrice instanceof TaxedPriceBuilder ? $this->taxedShippingPrice->build() : $this->taxedShippingPrice, $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress, + $this->shippingMode, + $this->shipping, $this->taxMode, $this->taxRoundingMode, $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup, diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyAction.php index 2ccd7b6da44..87526776eab 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyAction.php @@ -19,6 +19,7 @@ interface StagedOrderChangeCustomLineItemMoneyAction extends StagedOrderUpdateAc public const FIELD_MONEY = 'money'; /** + * @return null|string */ public function getCustomLineItemId(); @@ -27,6 +28,7 @@ public function getCustomLineItemId(); *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getMoney(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionBuilder.php index e491595cc0a..f0fe915d90c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionBuilder.php @@ -25,16 +25,19 @@ final class StagedOrderChangeCustomLineItemMoneyActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var null|Money|MoneyBuilder */ private $money; /** + * @return null|string */ public function getCustomLineItemId() @@ -46,6 +49,7 @@ public function getCustomLineItemId() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getMoney() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionModel.php index ddaaabbfe5f..485c96cb656 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionModel.php @@ -25,16 +25,19 @@ final class StagedOrderChangeCustomLineItemMoneyActionModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'changeCustomLineItemMoney'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?Money */ protected $money; @@ -45,14 +48,16 @@ final class StagedOrderChangeCustomLineItemMoneyActionModel extends JsonObjectMo */ public function __construct( ?string $customLineItemId = null, - ?Money $money = null + ?Money $money = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->money = $money; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -90,6 +96,7 @@ public function getCustomLineItemId() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * * @return null|Money */ public function getMoney() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityAction.php index 213504c77bc..9de14ea3c42 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityAction.php @@ -18,11 +18,13 @@ interface StagedOrderChangeCustomLineItemQuantityAction extends StagedOrderUpdat public const FIELD_QUANTITY = 'quantity'; /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionBuilder.php index b5debc99f5a..f6229755ea8 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionBuilder.php @@ -23,16 +23,19 @@ final class StagedOrderChangeCustomLineItemQuantityActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var ?int */ private $quantity; /** + * @return null|string */ public function getCustomLineItemId() @@ -41,6 +44,7 @@ public function getCustomLineItemId() } /** + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionModel.php index e38bc6539a8..bade52b5e26 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionModel.php @@ -23,16 +23,19 @@ final class StagedOrderChangeCustomLineItemQuantityActionModel extends JsonObjec { public const DISCRIMINATOR_VALUE = 'changeCustomLineItemQuantity'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?int */ protected $quantity; @@ -43,14 +46,16 @@ final class StagedOrderChangeCustomLineItemQuantityActionModel extends JsonObjec */ public function __construct( ?string $customLineItemId = null, - ?int $quantity = null + ?int $quantity = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->quantity = $quantity; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -85,6 +91,7 @@ public function getCustomLineItemId() } /** + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityAction.php index cd902f366be..99f6aad4328 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityAction.php @@ -22,11 +22,13 @@ interface StagedOrderChangeLineItemQuantityAction extends StagedOrderUpdateActio public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|int */ public function getQuantity(); @@ -35,11 +37,13 @@ public function getQuantity(); *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getExternalPrice(); /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityActionBuilder.php index e29a77ba927..a15bfc6e221 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityActionBuilder.php @@ -27,26 +27,31 @@ final class StagedOrderChangeLineItemQuantityActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?int */ private $quantity; /** + * @var null|Money|MoneyBuilder */ private $externalPrice; /** + * @var null|ExternalLineItemTotalPrice|ExternalLineItemTotalPriceBuilder */ private $externalTotalPrice; /** + * @return null|string */ public function getLineItemId() @@ -55,6 +60,7 @@ public function getLineItemId() } /** + * @return null|int */ public function getQuantity() @@ -66,6 +72,7 @@ public function getQuantity() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getExternalPrice() @@ -74,6 +81,7 @@ public function getExternalPrice() } /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityActionModel.php index f57ec8508be..30cabd394ef 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityActionModel.php @@ -27,26 +27,31 @@ final class StagedOrderChangeLineItemQuantityActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'changeLineItemQuantity'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?int */ protected $quantity; /** + * * @var ?Money */ protected $externalPrice; /** + * * @var ?ExternalLineItemTotalPrice */ protected $externalTotalPrice; @@ -59,16 +64,18 @@ public function __construct( ?string $lineItemId = null, ?int $quantity = null, ?Money $externalPrice = null, - ?ExternalLineItemTotalPrice $externalTotalPrice = null + ?ExternalLineItemTotalPrice $externalTotalPrice = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->quantity = $quantity; $this->externalPrice = $externalPrice; $this->externalTotalPrice = $externalTotalPrice; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -86,6 +93,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -103,6 +111,7 @@ public function getLineItemId() } /** + * * @return null|int */ public function getQuantity() @@ -123,6 +132,7 @@ public function getQuantity() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * * @return null|Money */ public function getExternalPrice() @@ -141,6 +151,7 @@ public function getExternalPrice() } /** + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateAction.php index 993a9f9226f..befaea14785 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateAction.php @@ -17,6 +17,7 @@ interface StagedOrderChangeOrderStateAction extends StagedOrderUpdateAction public const FIELD_ORDER_STATE = 'orderState'; /** + * @return null|string */ public function getOrderState(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateActionBuilder.php index a84c2997e04..12529ee2979 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderChangeOrderStateActionBuilder implements Builder { /** + * @var ?string */ private $orderState; /** + * @return null|string */ public function getOrderState() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateActionModel.php index 03e43ec1fcc..e7ca59b3b8d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateActionModel.php @@ -23,11 +23,13 @@ final class StagedOrderChangeOrderStateActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'changeOrderState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $orderState; @@ -37,13 +39,15 @@ final class StagedOrderChangeOrderStateActionModel extends JsonObjectModel imple * @psalm-suppress MissingParamType */ public function __construct( - ?string $orderState = null + ?string $orderState = null, + ?string $action = null ) { $this->orderState = $orderState; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|string */ public function getOrderState() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateAction.php index ae79730a61a..eedbbed6479 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateAction.php @@ -17,6 +17,7 @@ interface StagedOrderChangePaymentStateAction extends StagedOrderUpdateAction public const FIELD_PAYMENT_STATE = 'paymentState'; /** + * @return null|string */ public function getPaymentState(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateActionBuilder.php index db4846c7d9d..810264ddced 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderChangePaymentStateActionBuilder implements Builder { /** + * @var ?string */ private $paymentState; /** + * @return null|string */ public function getPaymentState() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateActionModel.php index 4bf49ba171b..fbbb0e823dc 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateActionModel.php @@ -23,11 +23,13 @@ final class StagedOrderChangePaymentStateActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'changePaymentState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $paymentState; @@ -37,13 +39,15 @@ final class StagedOrderChangePaymentStateActionModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?string $paymentState = null + ?string $paymentState = null, + ?string $action = null ) { $this->paymentState = $paymentState; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|string */ public function getPaymentState() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateAction.php index 76d453ecb79..a8ca0162111 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateAction.php @@ -17,6 +17,7 @@ interface StagedOrderChangeShipmentStateAction extends StagedOrderUpdateAction public const FIELD_SHIPMENT_STATE = 'shipmentState'; /** + * @return null|string */ public function getShipmentState(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateActionBuilder.php index 330f38a2887..4792b02197c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderChangeShipmentStateActionBuilder implements Builder { /** + * @var ?string */ private $shipmentState; /** + * @return null|string */ public function getShipmentState() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateActionModel.php index ed2866c2b16..3603a158a7e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateActionModel.php @@ -23,11 +23,13 @@ final class StagedOrderChangeShipmentStateActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'changeShipmentState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $shipmentState; @@ -37,13 +39,15 @@ final class StagedOrderChangeShipmentStateActionModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?string $shipmentState = null + ?string $shipmentState = null, + ?string $action = null ) { $this->shipmentState = $shipmentState; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|string */ public function getShipmentState() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeAction.php index a18064a7cee..892831fc72e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeAction.php @@ -17,6 +17,7 @@ interface StagedOrderChangeTaxCalculationModeAction extends StagedOrderUpdateAct public const FIELD_TAX_CALCULATION_MODE = 'taxCalculationMode'; /** + * @return null|string */ public function getTaxCalculationMode(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionBuilder.php index 88c757c282d..e0f2390a938 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderChangeTaxCalculationModeActionBuilder implements Builder { /** + * @var ?string */ private $taxCalculationMode; /** + * @return null|string */ public function getTaxCalculationMode() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionModel.php index 792174c983c..84ed950128c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionModel.php @@ -23,11 +23,13 @@ final class StagedOrderChangeTaxCalculationModeActionModel extends JsonObjectMod { public const DISCRIMINATOR_VALUE = 'changeTaxCalculationMode'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $taxCalculationMode; @@ -37,13 +39,15 @@ final class StagedOrderChangeTaxCalculationModeActionModel extends JsonObjectMod * @psalm-suppress MissingParamType */ public function __construct( - ?string $taxCalculationMode = null + ?string $taxCalculationMode = null, + ?string $action = null ) { $this->taxCalculationMode = $taxCalculationMode; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|string */ public function getTaxCalculationMode() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeAction.php index 9c2e3fb9bfa..b9efd19cc52 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeAction.php @@ -17,6 +17,7 @@ interface StagedOrderChangeTaxModeAction extends StagedOrderUpdateAction public const FIELD_TAX_MODE = 'taxMode'; /** + * @return null|string */ public function getTaxMode(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionBuilder.php index ce7d1d38391..f7f7b4f8eed 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderChangeTaxModeActionBuilder implements Builder { /** + * @var ?string */ private $taxMode; /** + * @return null|string */ public function getTaxMode() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionModel.php index 66c67d9941e..6c6afc6035f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionModel.php @@ -23,11 +23,13 @@ final class StagedOrderChangeTaxModeActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'changeTaxMode'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $taxMode; @@ -37,13 +39,15 @@ final class StagedOrderChangeTaxModeActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?string $taxMode = null + ?string $taxMode = null, + ?string $action = null ) { $this->taxMode = $taxMode; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|string */ public function getTaxMode() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeAction.php index 52e1f5277cc..29487269b0b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeAction.php @@ -17,6 +17,7 @@ interface StagedOrderChangeTaxRoundingModeAction extends StagedOrderUpdateAction public const FIELD_TAX_ROUNDING_MODE = 'taxRoundingMode'; /** + * @return null|string */ public function getTaxRoundingMode(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionBuilder.php index 48e55c11c7d..e8c6d276076 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderChangeTaxRoundingModeActionBuilder implements Builder { /** + * @var ?string */ private $taxRoundingMode; /** + * @return null|string */ public function getTaxRoundingMode() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionModel.php index 0af5fedd6f9..1266b74f67a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionModel.php @@ -23,11 +23,13 @@ final class StagedOrderChangeTaxRoundingModeActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'changeTaxRoundingMode'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $taxRoundingMode; @@ -37,13 +39,15 @@ final class StagedOrderChangeTaxRoundingModeActionModel extends JsonObjectModel * @psalm-suppress MissingParamType */ public function __construct( - ?string $taxRoundingMode = null + ?string $taxRoundingMode = null, + ?string $action = null ) { $this->taxRoundingMode = $taxRoundingMode; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|string */ public function getTaxRoundingMode() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateAction.php index 87ebb309304..133dd1590c2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateAction.php @@ -19,11 +19,13 @@ interface StagedOrderImportCustomLineItemStateAction extends StagedOrderUpdateAc public const FIELD_STATE = 'state'; /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|ItemStateCollection */ public function getState(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionBuilder.php index af63d1c3d21..2429fb6e6d3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionBuilder.php @@ -24,16 +24,19 @@ final class StagedOrderImportCustomLineItemStateActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var ?ItemStateCollection */ private $state; /** + * @return null|string */ public function getCustomLineItemId() @@ -42,6 +45,7 @@ public function getCustomLineItemId() } /** + * @return null|ItemStateCollection */ public function getState() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionModel.php index 5bb1a336d21..a95a4e474f8 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionModel.php @@ -24,16 +24,19 @@ final class StagedOrderImportCustomLineItemStateActionModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'importCustomLineItemState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?ItemStateCollection */ protected $state; @@ -44,14 +47,16 @@ final class StagedOrderImportCustomLineItemStateActionModel extends JsonObjectMo */ public function __construct( ?string $customLineItemId = null, - ?ItemStateCollection $state = null + ?ItemStateCollection $state = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->state = $state; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -69,6 +74,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -86,6 +92,7 @@ public function getCustomLineItemId() } /** + * * @return null|ItemStateCollection */ public function getState() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateAction.php index 362fc7d6ffd..b108d958047 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateAction.php @@ -19,11 +19,13 @@ interface StagedOrderImportLineItemStateAction extends StagedOrderUpdateAction public const FIELD_STATE = 'state'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|ItemStateCollection */ public function getState(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionBuilder.php index 80a5b799b9d..6cdc27fced5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionBuilder.php @@ -24,16 +24,19 @@ final class StagedOrderImportLineItemStateActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?ItemStateCollection */ private $state; /** + * @return null|string */ public function getLineItemId() @@ -42,6 +45,7 @@ public function getLineItemId() } /** + * @return null|ItemStateCollection */ public function getState() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionModel.php index a7479f8da74..32e803b8110 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionModel.php @@ -24,16 +24,19 @@ final class StagedOrderImportLineItemStateActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'importLineItemState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ItemStateCollection */ protected $state; @@ -44,14 +47,16 @@ final class StagedOrderImportLineItemStateActionModel extends JsonObjectModel im */ public function __construct( ?string $lineItemId = null, - ?ItemStateCollection $state = null + ?ItemStateCollection $state = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->state = $state; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -69,6 +74,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -86,6 +92,7 @@ public function getLineItemId() } /** + * * @return null|ItemStateCollection */ public function getState() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderModel.php index ba348721f7e..2613d074a3b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderModel.php @@ -8,11 +8,14 @@ namespace Commercetools\Api\Models\OrderEdit; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceModel; use Commercetools\Api\Models\Cart\CartReference; use Commercetools\Api\Models\Cart\CartReferenceModel; use Commercetools\Api\Models\Cart\CustomLineItemCollection; use Commercetools\Api\Models\Cart\DiscountCodeInfoCollection; use Commercetools\Api\Models\Cart\LineItemCollection; +use Commercetools\Api\Models\Cart\ShippingCollection; use Commercetools\Api\Models\Cart\ShippingInfo; use Commercetools\Api\Models\Cart\ShippingInfoModel; use Commercetools\Api\Models\Cart\ShippingRateInput; @@ -58,211 +61,277 @@ final class StagedOrderModel extends JsonObjectModel implements StagedOrder { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?DateTimeImmutable */ protected $completedAt; /** + * * @var ?string */ protected $orderNumber; /** + * * @var ?string */ protected $customerId; /** + * * @var ?string */ protected $customerEmail; /** + * * @var ?string */ protected $anonymousId; /** + * + * @var ?BusinessUnitKeyReference + */ + protected $businessUnit; + + /** + * * @var ?StoreKeyReference */ protected $store; /** + * * @var ?LineItemCollection */ protected $lineItems; /** + * * @var ?CustomLineItemCollection */ protected $customLineItems; /** + * * @var ?TypedMoney */ protected $totalPrice; /** + * * @var ?TaxedPrice */ protected $taxedPrice; /** + * + * @var ?TaxedPrice + */ + protected $taxedShippingPrice; + + /** + * * @var ?Address */ protected $shippingAddress; /** + * * @var ?Address */ protected $billingAddress; /** + * + * @var ?string + */ + protected $shippingMode; + + /** + * + * @var ?ShippingCollection + */ + protected $shipping; + + /** + * * @var ?string */ protected $taxMode; /** + * * @var ?string */ protected $taxRoundingMode; /** + * * @var ?CustomerGroupReference */ protected $customerGroup; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $orderState; /** + * * @var ?StateReference */ protected $state; /** + * * @var ?string */ protected $shipmentState; /** + * * @var ?string */ protected $paymentState; /** + * * @var ?ShippingInfo */ protected $shippingInfo; /** + * * @var ?SyncInfoCollection */ protected $syncInfo; /** + * * @var ?ReturnInfoCollection */ protected $returnInfo; /** + * * @var ?DiscountCodeInfoCollection */ protected $discountCodes; /** + * @deprecated * @var ?int */ protected $lastMessageSequenceNumber; /** + * * @var ?CartReference */ protected $cart; /** + * * @var ?QuoteReference */ protected $quote; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?PaymentInfo */ protected $paymentInfo; /** + * * @var ?string */ protected $locale; /** + * * @var ?string */ protected $inventoryMode; /** + * * @var ?string */ protected $origin; /** + * * @var ?string */ protected $taxCalculationMode; /** + * * @var ?ShippingRateInput */ protected $shippingRateInput; /** + * * @var ?AddressCollection */ protected $itemShippingAddresses; /** + * * @var ?CartDiscountReferenceCollection */ protected $refusedGifts; @@ -283,13 +352,17 @@ public function __construct( ?string $customerId = null, ?string $customerEmail = null, ?string $anonymousId = null, + ?BusinessUnitKeyReference $businessUnit = null, ?StoreKeyReference $store = null, ?LineItemCollection $lineItems = null, ?CustomLineItemCollection $customLineItems = null, ?TypedMoney $totalPrice = null, ?TaxedPrice $taxedPrice = null, + ?TaxedPrice $taxedShippingPrice = null, ?Address $shippingAddress = null, ?Address $billingAddress = null, + ?string $shippingMode = null, + ?ShippingCollection $shipping = null, ?string $taxMode = null, ?string $taxRoundingMode = null, ?CustomerGroupReference $customerGroup = null, @@ -326,13 +399,17 @@ public function __construct( $this->customerId = $customerId; $this->customerEmail = $customerEmail; $this->anonymousId = $anonymousId; + $this->businessUnit = $businessUnit; $this->store = $store; $this->lineItems = $lineItems; $this->customLineItems = $customLineItems; $this->totalPrice = $totalPrice; $this->taxedPrice = $taxedPrice; + $this->taxedShippingPrice = $taxedShippingPrice; $this->shippingAddress = $shippingAddress; $this->billingAddress = $billingAddress; + $this->shippingMode = $shippingMode; + $this->shipping = $shipping; $this->taxMode = $taxMode; $this->taxRoundingMode = $taxRoundingMode; $this->customerGroup = $customerGroup; @@ -362,6 +439,7 @@ public function __construct( /** *

    Unique identifier of the Order.

    * + * * @return null|string */ public function getId() @@ -381,6 +459,7 @@ public function getId() /** *

    The current version of the order.

    * + * * @return null|int */ public function getVersion() @@ -398,6 +477,7 @@ public function getVersion() } /** + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -419,6 +499,7 @@ public function getCreatedAt() } /** + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -442,6 +523,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -462,6 +544,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -482,6 +565,7 @@ public function getCreatedBy() /** *

    This field will only be present if it was set for Order Import

    * + * * @return null|DateTimeImmutable */ public function getCompletedAt() @@ -508,6 +592,7 @@ public function getCompletedAt() * It should be unique across a project. * Once it's set it cannot be changed.

    * + * * @return null|string */ public function getOrderNumber() @@ -525,6 +610,7 @@ public function getOrderNumber() } /** + * * @return null|string */ public function getCustomerId() @@ -542,6 +628,7 @@ public function getCustomerId() } /** + * * @return null|string */ public function getCustomerEmail() @@ -561,6 +648,7 @@ public function getCustomerEmail() /** *

    Identifies carts and orders belonging to an anonymous session (the customer has not signed up/in yet).

    * + * * @return null|string */ public function getAnonymousId() @@ -578,6 +666,28 @@ public function getAnonymousId() } /** + *

    The Business Unit the Order belongs to.

    + * + * + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit() + { + if (is_null($this->businessUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BUSINESS_UNIT); + if (is_null($data)) { + return null; + } + + $this->businessUnit = BusinessUnitKeyReferenceModel::of($data); + } + + return $this->businessUnit; + } + + /** + * * @return null|StoreKeyReference */ public function getStore() @@ -596,6 +706,7 @@ public function getStore() } /** + * * @return null|LineItemCollection */ public function getLineItems() @@ -613,6 +724,7 @@ public function getLineItems() } /** + * * @return null|CustomLineItemCollection */ public function getCustomLineItems() @@ -630,6 +742,7 @@ public function getCustomLineItems() } /** + * * @return null|TypedMoney */ public function getTotalPrice() @@ -650,6 +763,7 @@ public function getTotalPrice() /** *

    The taxes are calculated based on the shipping address.

    * + * * @return null|TaxedPrice */ public function getTaxedPrice() @@ -668,6 +782,32 @@ public function getTaxedPrice() } /** + *

    Sum of taxedPrice of ShippingInfo across all Shipping Methods. + * For Platform TaxMode, it is set automatically only if shipping address is set or Shipping Method is added to the Cart.

    + * + * + * @return null|TaxedPrice + */ + public function getTaxedShippingPrice() + { + if (is_null($this->taxedShippingPrice)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TAXED_SHIPPING_PRICE); + if (is_null($data)) { + return null; + } + + $this->taxedShippingPrice = TaxedPriceModel::of($data); + } + + return $this->taxedShippingPrice; + } + + /** + *

    Holds all shipping-related information per Shipping Method.

    + *

    For Multi ShippingMode, it is updated automatically after the Shipping Methods are added.

    + * + * * @return null|Address */ public function getShippingAddress() @@ -686,6 +826,7 @@ public function getShippingAddress() } /** + * * @return null|Address */ public function getBillingAddress() @@ -704,6 +845,48 @@ public function getBillingAddress() } /** + *

    Indicates whether one or multiple Shipping Methods are added to the Cart.

    + * + * + * @return null|string + */ + public function getShippingMode() + { + if (is_null($this->shippingMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_MODE); + if (is_null($data)) { + return null; + } + $this->shippingMode = (string) $data; + } + + return $this->shippingMode; + } + + /** + *

    Holds all shipping-related information per Shipping Method for Multi ShippingMode.

    + *

    It is updated automatically after the Shipping Method is added.

    + * + * + * @return null|ShippingCollection + */ + public function getShipping() + { + if (is_null($this->shipping)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SHIPPING); + if (is_null($data)) { + return null; + } + $this->shipping = ShippingCollection::fromArray($data); + } + + return $this->shipping; + } + + /** + * * @return null|string */ public function getTaxMode() @@ -723,6 +906,7 @@ public function getTaxMode() /** *

    When calculating taxes for taxedPrice, the selected mode is used for rouding.

    * + * * @return null|string */ public function getTaxRoundingMode() @@ -743,6 +927,7 @@ public function getTaxRoundingMode() *

    Set when the customer is set and the customer is a member of a customer group. * Used for product variant price selection.

    * + * * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -764,6 +949,7 @@ public function getCustomerGroup() *

    A two-digit country code as per ISO 3166-1 alpha-2. * Used for product variant price selection.

    * + * * @return null|string */ public function getCountry() @@ -783,6 +969,7 @@ public function getCountry() /** *

    One of the four predefined OrderStates.

    * + * * @return null|string */ public function getOrderState() @@ -802,6 +989,7 @@ public function getOrderState() /** *

    This reference can point to a state in a custom workflow.

    * + * * @return null|StateReference */ public function getState() @@ -820,6 +1008,7 @@ public function getState() } /** + * * @return null|string */ public function getShipmentState() @@ -837,6 +1026,7 @@ public function getShipmentState() } /** + * * @return null|string */ public function getPaymentState() @@ -856,6 +1046,7 @@ public function getPaymentState() /** *

    Set if the ShippingMethod is set.

    * + * * @return null|ShippingInfo */ public function getShippingInfo() @@ -874,6 +1065,7 @@ public function getShippingInfo() } /** + * * @return null|SyncInfoCollection */ public function getSyncInfo() @@ -891,6 +1083,7 @@ public function getSyncInfo() } /** + * * @return null|ReturnInfoCollection */ public function getReturnInfo() @@ -908,6 +1101,7 @@ public function getReturnInfo() } /** + * * @return null|DiscountCodeInfoCollection */ public function getDiscountCodes() @@ -927,6 +1121,7 @@ public function getDiscountCodes() /** *

    Internal-only field.

    * + * @deprecated * @return null|int */ public function getLastMessageSequenceNumber() @@ -947,6 +1142,7 @@ public function getLastMessageSequenceNumber() *

    Set when this order was created from a cart. * The cart will have the state Ordered.

    * + * * @return null|CartReference */ public function getCart() @@ -967,6 +1163,7 @@ public function getCart() /** *

    Set when this order was created from a quote.

    * + * * @return null|QuoteReference */ public function getQuote() @@ -985,6 +1182,7 @@ public function getQuote() } /** + * * @return null|CustomFields */ public function getCustom() @@ -1003,6 +1201,7 @@ public function getCustom() } /** + * * @return null|PaymentInfo */ public function getPaymentInfo() @@ -1021,6 +1220,7 @@ public function getPaymentInfo() } /** + * * @return null|string */ public function getLocale() @@ -1038,6 +1238,7 @@ public function getLocale() } /** + * * @return null|string */ public function getInventoryMode() @@ -1055,6 +1256,7 @@ public function getInventoryMode() } /** + * * @return null|string */ public function getOrigin() @@ -1074,6 +1276,7 @@ public function getOrigin() /** *

    When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

    * + * * @return null|string */ public function getTaxCalculationMode() @@ -1093,6 +1296,7 @@ public function getTaxCalculationMode() /** *

    The shippingRateInput is used as an input to select a ShippingRatePriceTier.

    * + * * @return null|ShippingRateInput */ public function getShippingRateInput() @@ -1113,6 +1317,7 @@ public function getShippingRateInput() /** *

    Contains addresses for orders with multiple shipping addresses.

    * + * * @return null|AddressCollection */ public function getItemShippingAddresses() @@ -1132,6 +1337,7 @@ public function getItemShippingAddresses() /** *

    Automatically filled when a line item with LineItemMode GiftLineItem is removed from this order.

    * + * * @return null|CartDiscountReferenceCollection */ public function getRefusedGifts() @@ -1237,6 +1443,14 @@ public function setAnonymousId(?string $anonymousId): void $this->anonymousId = $anonymousId; } + /** + * @param ?BusinessUnitKeyReference $businessUnit + */ + public function setBusinessUnit(?BusinessUnitKeyReference $businessUnit): void + { + $this->businessUnit = $businessUnit; + } + /** * @param ?StoreKeyReference $store */ @@ -1277,6 +1491,14 @@ public function setTaxedPrice(?TaxedPrice $taxedPrice): void $this->taxedPrice = $taxedPrice; } + /** + * @param ?TaxedPrice $taxedShippingPrice + */ + public function setTaxedShippingPrice(?TaxedPrice $taxedShippingPrice): void + { + $this->taxedShippingPrice = $taxedShippingPrice; + } + /** * @param ?Address $shippingAddress */ @@ -1293,6 +1515,22 @@ public function setBillingAddress(?Address $billingAddress): void $this->billingAddress = $billingAddress; } + /** + * @param ?string $shippingMode + */ + public function setShippingMode(?string $shippingMode): void + { + $this->shippingMode = $shippingMode; + } + + /** + * @param ?ShippingCollection $shipping + */ + public function setShipping(?ShippingCollection $shipping): void + { + $this->shipping = $shipping; + } + /** * @param ?string $taxMode */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemAction.php index 10c783f7e01..a3b41650d9d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemAction.php @@ -17,6 +17,7 @@ interface StagedOrderRemoveCustomLineItemAction extends StagedOrderUpdateAction public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; /** + * @return null|string */ public function getCustomLineItemId(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionBuilder.php index 1fa5b4ded57..7cdf5120a39 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderRemoveCustomLineItemActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @return null|string */ public function getCustomLineItemId() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionModel.php index 5bf9a2a4c55..96207d0c035 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionModel.php @@ -23,11 +23,13 @@ final class StagedOrderRemoveCustomLineItemActionModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'removeCustomLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; @@ -37,13 +39,15 @@ final class StagedOrderRemoveCustomLineItemActionModel extends JsonObjectModel i * @psalm-suppress MissingParamType */ public function __construct( - ?string $customLineItemId = null + ?string $customLineItemId = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryAction.php index 9ed2a90cdd1..de38df26c91 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryAction.php @@ -17,6 +17,7 @@ interface StagedOrderRemoveDeliveryAction extends StagedOrderUpdateAction public const FIELD_DELIVERY_ID = 'deliveryId'; /** + * @return null|string */ public function getDeliveryId(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryActionBuilder.php index 809852cdbf8..314975a7827 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderRemoveDeliveryActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @return null|string */ public function getDeliveryId() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryActionModel.php index 4e36ee4b627..51ffd031f34 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryActionModel.php @@ -23,11 +23,13 @@ final class StagedOrderRemoveDeliveryActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'removeDelivery'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; @@ -37,13 +39,15 @@ final class StagedOrderRemoveDeliveryActionModel extends JsonObjectModel impleme * @psalm-suppress MissingParamType */ public function __construct( - ?string $deliveryId = null + ?string $deliveryId = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeAction.php index c36174ca73f..d46d3522624 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeAction.php @@ -20,6 +20,7 @@ interface StagedOrderRemoveDiscountCodeAction extends StagedOrderUpdateAction /** *

    Reference to a DiscountCode.

    * + * @return null|DiscountCodeReference */ public function getDiscountCode(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeActionBuilder.php index 7257fef3465..28b4170d3e1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeActionBuilder.php @@ -25,6 +25,7 @@ final class StagedOrderRemoveDiscountCodeActionBuilder implements Builder { /** + * @var null|DiscountCodeReference|DiscountCodeReferenceBuilder */ private $discountCode; @@ -32,6 +33,7 @@ final class StagedOrderRemoveDiscountCodeActionBuilder implements Builder /** *

    Reference to a DiscountCode.

    * + * @return null|DiscountCodeReference */ public function getDiscountCode() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeActionModel.php index d7fa24befbc..cc2c8078c51 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeActionModel.php @@ -25,11 +25,13 @@ final class StagedOrderRemoveDiscountCodeActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'removeDiscountCode'; /** + * * @var ?string */ protected $action; /** + * * @var ?DiscountCodeReference */ protected $discountCode; @@ -39,13 +41,15 @@ final class StagedOrderRemoveDiscountCodeActionModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?DiscountCodeReference $discountCode = null + ?DiscountCodeReference $discountCode = null, + ?string $action = null ) { $this->discountCode = $discountCode; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -65,6 +69,7 @@ public function getAction() /** *

    Reference to a DiscountCode.

    * + * * @return null|DiscountCodeReference */ public function getDiscountCode() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressAction.php index 08af90accfd..8468d5d1e4b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressAction.php @@ -17,6 +17,7 @@ interface StagedOrderRemoveItemShippingAddressAction extends StagedOrderUpdateAc public const FIELD_ADDRESS_KEY = 'addressKey'; /** + * @return null|string */ public function getAddressKey(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressActionBuilder.php index f5092070e9a..ce1cefe386f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderRemoveItemShippingAddressActionBuilder implements Builder { /** + * @var ?string */ private $addressKey; /** + * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressActionModel.php index 2a1a89091c3..01e2cd4fa71 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressActionModel.php @@ -23,11 +23,13 @@ final class StagedOrderRemoveItemShippingAddressActionModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'removeItemShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressKey; @@ -37,13 +39,15 @@ final class StagedOrderRemoveItemShippingAddressActionModel extends JsonObjectMo * @psalm-suppress MissingParamType */ public function __construct( - ?string $addressKey = null + ?string $addressKey = null, + ?string $action = null ) { $this->addressKey = $addressKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|string */ public function getAddressKey() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemAction.php index 49ddf1d8d7d..e7372367ac7 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemAction.php @@ -24,11 +24,13 @@ interface StagedOrderRemoveLineItemAction extends StagedOrderUpdateAction public const FIELD_SHIPPING_DETAILS_TO_REMOVE = 'shippingDetailsToRemove'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|int */ public function getQuantity(); @@ -37,16 +39,19 @@ public function getQuantity(); *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getExternalPrice(); /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetailsToRemove(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionBuilder.php index 21537d0b270..69e18c1eae0 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionBuilder.php @@ -29,31 +29,37 @@ final class StagedOrderRemoveLineItemActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?int */ private $quantity; /** + * @var null|Money|MoneyBuilder */ private $externalPrice; /** + * @var null|ExternalLineItemTotalPrice|ExternalLineItemTotalPriceBuilder */ private $externalTotalPrice; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetailsToRemove; /** + * @return null|string */ public function getLineItemId() @@ -62,6 +68,7 @@ public function getLineItemId() } /** + * @return null|int */ public function getQuantity() @@ -73,6 +80,7 @@ public function getQuantity() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getExternalPrice() @@ -81,6 +89,7 @@ public function getExternalPrice() } /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() @@ -89,6 +98,7 @@ public function getExternalTotalPrice() } /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetailsToRemove() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionModel.php index c41c62b2b5c..cc1f6c425dd 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionModel.php @@ -29,31 +29,37 @@ final class StagedOrderRemoveLineItemActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'removeLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?int */ protected $quantity; /** + * * @var ?Money */ protected $externalPrice; /** + * * @var ?ExternalLineItemTotalPrice */ protected $externalTotalPrice; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetailsToRemove; @@ -67,17 +73,19 @@ public function __construct( ?int $quantity = null, ?Money $externalPrice = null, ?ExternalLineItemTotalPrice $externalTotalPrice = null, - ?ItemShippingDetailsDraft $shippingDetailsToRemove = null + ?ItemShippingDetailsDraft $shippingDetailsToRemove = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->quantity = $quantity; $this->externalPrice = $externalPrice; $this->externalTotalPrice = $externalTotalPrice; $this->shippingDetailsToRemove = $shippingDetailsToRemove; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -95,6 +103,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -112,6 +121,7 @@ public function getLineItemId() } /** + * * @return null|int */ public function getQuantity() @@ -132,6 +142,7 @@ public function getQuantity() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * * @return null|Money */ public function getExternalPrice() @@ -150,6 +161,7 @@ public function getExternalPrice() } /** + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() @@ -168,6 +180,7 @@ public function getExternalTotalPrice() } /** + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetailsToRemove() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryAction.php index 7499e0ce838..4de71e9db76 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryAction.php @@ -17,6 +17,7 @@ interface StagedOrderRemoveParcelFromDeliveryAction extends StagedOrderUpdateAct public const FIELD_PARCEL_ID = 'parcelId'; /** + * @return null|string */ public function getParcelId(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryActionBuilder.php index 8f4414509f9..5620c1b8303 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderRemoveParcelFromDeliveryActionBuilder implements Builder { /** + * @var ?string */ private $parcelId; /** + * @return null|string */ public function getParcelId() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryActionModel.php index e576dbe7acf..b6a6742778f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryActionModel.php @@ -23,11 +23,13 @@ final class StagedOrderRemoveParcelFromDeliveryActionModel extends JsonObjectMod { public const DISCRIMINATOR_VALUE = 'removeParcelFromDelivery'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $parcelId; @@ -37,13 +39,15 @@ final class StagedOrderRemoveParcelFromDeliveryActionModel extends JsonObjectMod * @psalm-suppress MissingParamType */ public function __construct( - ?string $parcelId = null + ?string $parcelId = null, + ?string $action = null ) { $this->parcelId = $parcelId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|string */ public function getParcelId() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentAction.php index 1e2ad181c20..4c601e6bc27 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentAction.php @@ -20,6 +20,7 @@ interface StagedOrderRemovePaymentAction extends StagedOrderUpdateAction /** *

    ResourceIdentifier to a Payment.

    * + * @return null|PaymentResourceIdentifier */ public function getPayment(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentActionBuilder.php index 7e58002122b..02174814402 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentActionBuilder.php @@ -25,6 +25,7 @@ final class StagedOrderRemovePaymentActionBuilder implements Builder { /** + * @var null|PaymentResourceIdentifier|PaymentResourceIdentifierBuilder */ private $payment; @@ -32,6 +33,7 @@ final class StagedOrderRemovePaymentActionBuilder implements Builder /** *

    ResourceIdentifier to a Payment.

    * + * @return null|PaymentResourceIdentifier */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentActionModel.php index 4e5ba32c48f..3622926ef43 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentActionModel.php @@ -25,11 +25,13 @@ final class StagedOrderRemovePaymentActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'removePayment'; /** + * * @var ?string */ protected $action; /** + * * @var ?PaymentResourceIdentifier */ protected $payment; @@ -39,13 +41,15 @@ final class StagedOrderRemovePaymentActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?PaymentResourceIdentifier $payment = null + ?PaymentResourceIdentifier $payment = null, + ?string $action = null ) { $this->payment = $payment; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -65,6 +69,7 @@ public function getAction() /** *

    ResourceIdentifier to a Payment.

    * + * * @return null|PaymentResourceIdentifier */ public function getPayment() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressAction.php index e453489bbcd..a9682d33aff 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressAction.php @@ -18,6 +18,7 @@ interface StagedOrderSetBillingAddressAction extends StagedOrderUpdateAction public const FIELD_ADDRESS = 'address'; /** + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionBuilder.php index ffe6f49e6bf..59d60d935ee 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionBuilder.php @@ -25,11 +25,13 @@ final class StagedOrderSetBillingAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionModel.php index 8dce5980680..0e35ceb9f51 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionModel.php @@ -25,11 +25,13 @@ final class StagedOrderSetBillingAddressActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setBillingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -39,13 +41,15 @@ final class StagedOrderSetBillingAddressActionModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomFieldAction.php index 7e4ba2b04b6..71ba1a85ad6 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomFieldAction.php @@ -20,6 +20,7 @@ interface StagedOrderSetBillingAddressCustomFieldAction extends StagedOrderUpdat /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -29,6 +30,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomFieldActionBuilder.php index 9338e771ba4..d3b24b64109 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomFieldActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderSetBillingAddressCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -35,6 +37,7 @@ final class StagedOrderSetBillingAddressCustomFieldActionBuilder implements Buil /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -47,6 +50,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomFieldActionModel.php index f1ed71917c2..19e1be95037 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomFieldActionModel.php @@ -23,16 +23,19 @@ final class StagedOrderSetBillingAddressCustomFieldActionModel extends JsonObjec { public const DISCRIMINATOR_VALUE = 'setBillingAddressCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -43,14 +46,16 @@ final class StagedOrderSetBillingAddressCustomFieldActionModel extends JsonObjec */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -91,6 +97,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomTypeAction.php index 3f0eee8d8a0..f9e15338085 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomTypeAction.php @@ -23,6 +23,7 @@ interface StagedOrderSetBillingAddressCustomTypeAction extends StagedOrderUpdate *

    Defines the Type that extends the billingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the billingAddress.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -30,6 +31,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the billingAddress.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomTypeActionBuilder.php index d053c27e18a..7182c6b8507 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomTypeActionBuilder.php @@ -27,11 +27,13 @@ final class StagedOrderSetBillingAddressCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -40,6 +42,7 @@ final class StagedOrderSetBillingAddressCustomTypeActionBuilder implements Build *

    Defines the Type that extends the billingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the billingAddress.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -50,6 +53,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the billingAddress.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomTypeActionModel.php index cecef45491c..d6a60ccbe09 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressCustomTypeActionModel.php @@ -27,16 +27,19 @@ final class StagedOrderSetBillingAddressCustomTypeActionModel extends JsonObject { public const DISCRIMINATOR_VALUE = 'setBillingAddressCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -47,14 +50,16 @@ final class StagedOrderSetBillingAddressCustomTypeActionModel extends JsonObject */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -75,6 +80,7 @@ public function getAction() *

    Defines the Type that extends the billingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the billingAddress.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -95,6 +101,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the billingAddress.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryAction.php index f2848d103cb..933a734a5a4 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryAction.php @@ -17,6 +17,7 @@ interface StagedOrderSetCountryAction extends StagedOrderUpdateAction public const FIELD_COUNTRY = 'country'; /** + * @return null|string */ public function getCountry(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryActionBuilder.php index 02496c5dffa..6764c6f271b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderSetCountryActionBuilder implements Builder { /** + * @var ?string */ private $country; /** + * @return null|string */ public function getCountry() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryActionModel.php index 641ef26da24..a3dc26781e9 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryActionModel.php @@ -23,11 +23,13 @@ final class StagedOrderSetCountryActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setCountry'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $country; @@ -37,13 +39,15 @@ final class StagedOrderSetCountryActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $country = null + ?string $country = null, + ?string $action = null ) { $this->country = $country; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|string */ public function getCountry() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomFieldAction.php index b5d81070ed5..ec7e2375d0e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomFieldAction.php @@ -20,6 +20,7 @@ interface StagedOrderSetCustomFieldAction extends StagedOrderUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -29,6 +30,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomFieldActionBuilder.php index 78aea692483..2ad0935a250 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomFieldActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -35,6 +37,7 @@ final class StagedOrderSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -47,6 +50,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomFieldActionModel.php index d4c2dbdbbac..14fa7958b72 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomFieldActionModel.php @@ -23,16 +23,19 @@ final class StagedOrderSetCustomFieldActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -43,14 +46,16 @@ final class StagedOrderSetCustomFieldActionModel extends JsonObjectModel impleme */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -91,6 +97,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldAction.php index b75d6ced05f..daa65a5572b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldAction.php @@ -19,6 +19,7 @@ interface StagedOrderSetCustomLineItemCustomFieldAction extends StagedOrderUpdat public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getCustomLineItemId(); @@ -26,6 +27,7 @@ public function getCustomLineItemId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -35,6 +37,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionBuilder.php index 4aeb423a159..f9b51f5f5f5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionBuilder.php @@ -23,21 +23,25 @@ final class StagedOrderSetCustomLineItemCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getCustomLineItemId() @@ -48,6 +52,7 @@ public function getCustomLineItemId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -60,6 +65,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionModel.php index d2d26c38930..8eb05a37277 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionModel.php @@ -23,21 +23,25 @@ final class StagedOrderSetCustomLineItemCustomFieldActionModel extends JsonObjec { public const DISCRIMINATOR_VALUE = 'setCustomLineItemCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -49,15 +53,17 @@ final class StagedOrderSetCustomLineItemCustomFieldActionModel extends JsonObjec public function __construct( ?string $customLineItemId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -75,6 +81,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -94,6 +101,7 @@ public function getCustomLineItemId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -115,6 +123,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeAction.php index 65897c0a084..4d784087a47 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeAction.php @@ -21,6 +21,7 @@ interface StagedOrderSetCustomLineItemCustomTypeAction extends StagedOrderUpdate public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getCustomLineItemId(); @@ -29,6 +30,7 @@ public function getCustomLineItemId(); *

    Defines the Type that extends the CustomLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -36,6 +38,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the CustomLineItem.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionBuilder.php index 1474d7eb5c7..d619022600d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionBuilder.php @@ -27,21 +27,25 @@ final class StagedOrderSetCustomLineItemCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getCustomLineItemId() @@ -53,6 +57,7 @@ public function getCustomLineItemId() *

    Defines the Type that extends the CustomLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -63,6 +68,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the CustomLineItem.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionModel.php index 765ab74f166..c47a0d3c494 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionModel.php @@ -27,21 +27,25 @@ final class StagedOrderSetCustomLineItemCustomTypeActionModel extends JsonObject { public const DISCRIMINATOR_VALUE = 'setCustomLineItemCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -53,15 +57,17 @@ final class StagedOrderSetCustomLineItemCustomTypeActionModel extends JsonObject public function __construct( ?string $customLineItemId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -79,6 +85,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -99,6 +106,7 @@ public function getCustomLineItemId() *

    Defines the Type that extends the CustomLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -119,6 +127,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the CustomLineItem.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsAction.php index 399a2fb0994..97167fa474b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsAction.php @@ -19,11 +19,13 @@ interface StagedOrderSetCustomLineItemShippingDetailsAction extends StagedOrderU public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionBuilder.php index 1841615baa9..974e669c74f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionBuilder.php @@ -25,16 +25,19 @@ final class StagedOrderSetCustomLineItemShippingDetailsActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetails; /** + * @return null|string */ public function getCustomLineItemId() @@ -43,6 +46,7 @@ public function getCustomLineItemId() } /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionModel.php index 49139f99b1c..a0910a2eb21 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionModel.php @@ -25,16 +25,19 @@ final class StagedOrderSetCustomLineItemShippingDetailsActionModel extends JsonO { public const DISCRIMINATOR_VALUE = 'setCustomLineItemShippingDetails'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; @@ -45,14 +48,16 @@ final class StagedOrderSetCustomLineItemShippingDetailsActionModel extends JsonO */ public function __construct( ?string $customLineItemId = null, - ?ItemShippingDetailsDraft $shippingDetails = null + ?ItemShippingDetailsDraft $shippingDetails = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->shippingDetails = $shippingDetails; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -87,6 +93,7 @@ public function getCustomLineItemId() } /** + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php index 204852e1e95..3e9db629329 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php @@ -19,11 +19,13 @@ interface StagedOrderSetCustomLineItemTaxAmountAction extends StagedOrderUpdateA public const FIELD_EXTERNAL_TAX_AMOUNT = 'externalTaxAmount'; /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php index 8e93ee27edf..cdc1beef9cd 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php @@ -25,16 +25,19 @@ final class StagedOrderSetCustomLineItemTaxAmountActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var null|ExternalTaxAmountDraft|ExternalTaxAmountDraftBuilder */ private $externalTaxAmount; /** + * @return null|string */ public function getCustomLineItemId() @@ -43,6 +46,7 @@ public function getCustomLineItemId() } /** + * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php index 0968ab6fb00..b6cbec56061 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php @@ -25,16 +25,19 @@ final class StagedOrderSetCustomLineItemTaxAmountActionModel extends JsonObjectM { public const DISCRIMINATOR_VALUE = 'setCustomLineItemTaxAmount'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?ExternalTaxAmountDraft */ protected $externalTaxAmount; @@ -45,14 +48,16 @@ final class StagedOrderSetCustomLineItemTaxAmountActionModel extends JsonObjectM */ public function __construct( ?string $customLineItemId = null, - ?ExternalTaxAmountDraft $externalTaxAmount = null + ?ExternalTaxAmountDraft $externalTaxAmount = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->externalTaxAmount = $externalTaxAmount; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -87,6 +93,7 @@ public function getCustomLineItemId() } /** + * * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php index b432030913c..3d480f0167e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php @@ -19,11 +19,13 @@ interface StagedOrderSetCustomLineItemTaxRateAction extends StagedOrderUpdateAct public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php index 1e9f88a1636..80867a2c68e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php @@ -25,16 +25,19 @@ final class StagedOrderSetCustomLineItemTaxRateActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** + * @return null|string */ public function getCustomLineItemId() @@ -43,6 +46,7 @@ public function getCustomLineItemId() } /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php index 3b58f668066..9de5a0498ba 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php @@ -25,16 +25,19 @@ final class StagedOrderSetCustomLineItemTaxRateActionModel extends JsonObjectMod { public const DISCRIMINATOR_VALUE = 'setCustomLineItemTaxRate'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; @@ -45,14 +48,16 @@ final class StagedOrderSetCustomLineItemTaxRateActionModel extends JsonObjectMod */ public function __construct( ?string $customLineItemId = null, - ?ExternalTaxRateDraft $externalTaxRate = null + ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->externalTaxRate = $externalTaxRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -87,6 +93,7 @@ public function getCustomLineItemId() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodAction.php index 442c8642310..605fa01c95e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodAction.php @@ -23,11 +23,13 @@ interface StagedOrderSetCustomShippingMethodAction extends StagedOrderUpdateActi public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + * @return null|string */ public function getShippingMethodName(); /** + * @return null|ShippingRateDraft */ public function getShippingRate(); @@ -35,11 +37,13 @@ public function getShippingRate(); /** *

    ResourceIdentifier to a TaxCategory.

    * + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory(); /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionBuilder.php index 484a237e45e..c2fe92c9217 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionBuilder.php @@ -29,26 +29,31 @@ final class StagedOrderSetCustomShippingMethodActionBuilder implements Builder { /** + * @var ?string */ private $shippingMethodName; /** + * @var null|ShippingRateDraft|ShippingRateDraftBuilder */ private $shippingRate; /** + * @var null|TaxCategoryResourceIdentifier|TaxCategoryResourceIdentifierBuilder */ private $taxCategory; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** + * @return null|string */ public function getShippingMethodName() @@ -57,6 +62,7 @@ public function getShippingMethodName() } /** + * @return null|ShippingRateDraft */ public function getShippingRate() @@ -67,6 +73,7 @@ public function getShippingRate() /** *

    ResourceIdentifier to a TaxCategory.

    * + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -75,6 +82,7 @@ public function getTaxCategory() } /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionModel.php index d6535999477..4df38a3a0ee 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionModel.php @@ -29,26 +29,31 @@ final class StagedOrderSetCustomShippingMethodActionModel extends JsonObjectMode { public const DISCRIMINATOR_VALUE = 'setCustomShippingMethod'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $shippingMethodName; /** + * * @var ?ShippingRateDraft */ protected $shippingRate; /** + * * @var ?TaxCategoryResourceIdentifier */ protected $taxCategory; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; @@ -61,16 +66,18 @@ public function __construct( ?string $shippingMethodName = null, ?ShippingRateDraft $shippingRate = null, ?TaxCategoryResourceIdentifier $taxCategory = null, - ?ExternalTaxRateDraft $externalTaxRate = null + ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $action = null ) { $this->shippingMethodName = $shippingMethodName; $this->shippingRate = $shippingRate; $this->taxCategory = $taxCategory; $this->externalTaxRate = $externalTaxRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -88,6 +95,7 @@ public function getAction() } /** + * * @return null|string */ public function getShippingMethodName() @@ -105,6 +113,7 @@ public function getShippingMethodName() } /** + * * @return null|ShippingRateDraft */ public function getShippingRate() @@ -125,6 +134,7 @@ public function getShippingRate() /** *

    ResourceIdentifier to a TaxCategory.

    * + * * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -143,6 +153,7 @@ public function getTaxCategory() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeAction.php index 77b4ef2c591..72e210b89ad 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeAction.php @@ -23,6 +23,7 @@ interface StagedOrderSetCustomTypeAction extends StagedOrderUpdateAction *

    Defines the Type that extends the StagedOrder with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the StagedOrder.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -30,6 +31,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the StagedOrder.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeActionBuilder.php index aea96c2c83f..aa0ce7e9adc 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeActionBuilder.php @@ -27,11 +27,13 @@ final class StagedOrderSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -40,6 +42,7 @@ final class StagedOrderSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the StagedOrder with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the StagedOrder.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -50,6 +53,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the StagedOrder.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeActionModel.php index 70742df53d5..bc3d6f4df33 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeActionModel.php @@ -27,16 +27,19 @@ final class StagedOrderSetCustomTypeActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -47,14 +50,16 @@ final class StagedOrderSetCustomTypeActionModel extends JsonObjectModel implemen */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -75,6 +80,7 @@ public function getAction() *

    Defines the Type that extends the StagedOrder with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the StagedOrder.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -95,6 +101,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the StagedOrder.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailAction.php index 2a734bc0e96..0ddafed255a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailAction.php @@ -17,6 +17,7 @@ interface StagedOrderSetCustomerEmailAction extends StagedOrderUpdateAction public const FIELD_EMAIL = 'email'; /** + * @return null|string */ public function getEmail(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailActionBuilder.php index 1911f544f38..b302f879ebd 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderSetCustomerEmailActionBuilder implements Builder { /** + * @var ?string */ private $email; /** + * @return null|string */ public function getEmail() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailActionModel.php index cc5191cf6b1..9b314e4ca11 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailActionModel.php @@ -23,11 +23,13 @@ final class StagedOrderSetCustomerEmailActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setCustomerEmail'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $email; @@ -37,13 +39,15 @@ final class StagedOrderSetCustomerEmailActionModel extends JsonObjectModel imple * @psalm-suppress MissingParamType */ public function __construct( - ?string $email = null + ?string $email = null, + ?string $action = null ) { $this->email = $email; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|string */ public function getEmail() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupAction.php index 8d17b6a6396..44bbc16cb3e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupAction.php @@ -20,6 +20,7 @@ interface StagedOrderSetCustomerGroupAction extends StagedOrderUpdateAction /** *

    ResourceIdentifier to a CustomerGroup.

    * + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupActionBuilder.php index 11165daec2b..0b3eccd0a0b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupActionBuilder.php @@ -25,6 +25,7 @@ final class StagedOrderSetCustomerGroupActionBuilder implements Builder { /** + * @var null|CustomerGroupResourceIdentifier|CustomerGroupResourceIdentifierBuilder */ private $customerGroup; @@ -32,6 +33,7 @@ final class StagedOrderSetCustomerGroupActionBuilder implements Builder /** *

    ResourceIdentifier to a CustomerGroup.

    * + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupActionModel.php index 1c9ed1f2c82..7a742a8fc16 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupActionModel.php @@ -25,11 +25,13 @@ final class StagedOrderSetCustomerGroupActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setCustomerGroup'; /** + * * @var ?string */ protected $action; /** + * * @var ?CustomerGroupResourceIdentifier */ protected $customerGroup; @@ -39,13 +41,15 @@ final class StagedOrderSetCustomerGroupActionModel extends JsonObjectModel imple * @psalm-suppress MissingParamType */ public function __construct( - ?CustomerGroupResourceIdentifier $customerGroup = null + ?CustomerGroupResourceIdentifier $customerGroup = null, + ?string $action = null ) { $this->customerGroup = $customerGroup; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -65,6 +69,7 @@ public function getAction() /** *

    ResourceIdentifier to a CustomerGroup.

    * + * * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdAction.php index 5cfecdec756..4d4b1e5f93e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdAction.php @@ -17,6 +17,7 @@ interface StagedOrderSetCustomerIdAction extends StagedOrderUpdateAction public const FIELD_CUSTOMER_ID = 'customerId'; /** + * @return null|string */ public function getCustomerId(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdActionBuilder.php index 0865765d693..8999edfe8ff 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderSetCustomerIdActionBuilder implements Builder { /** + * @var ?string */ private $customerId; /** + * @return null|string */ public function getCustomerId() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdActionModel.php index 342b60ec9ae..d2f193fc12c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdActionModel.php @@ -23,11 +23,13 @@ final class StagedOrderSetCustomerIdActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'setCustomerId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customerId; @@ -37,13 +39,15 @@ final class StagedOrderSetCustomerIdActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?string $customerId = null + ?string $customerId = null, + ?string $action = null ) { $this->customerId = $customerId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomerId() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressAction.php index d529bf9a455..d31ac0ec842 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressAction.php @@ -19,11 +19,13 @@ interface StagedOrderSetDeliveryAddressAction extends StagedOrderUpdateAction public const FIELD_ADDRESS = 'address'; /** + * @return null|string */ public function getDeliveryId(); /** + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionBuilder.php index 5dada8af0c8..02eeeabf133 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionBuilder.php @@ -25,16 +25,19 @@ final class StagedOrderSetDeliveryAddressActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @return null|string */ public function getDeliveryId() @@ -43,6 +46,7 @@ public function getDeliveryId() } /** + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionModel.php index 63d3396827e..1d541eca1c3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionModel.php @@ -25,16 +25,19 @@ final class StagedOrderSetDeliveryAddressActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'setDeliveryAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?BaseAddress */ protected $address; @@ -45,14 +48,16 @@ final class StagedOrderSetDeliveryAddressActionModel extends JsonObjectModel imp */ public function __construct( ?string $deliveryId = null, - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() @@ -87,6 +93,7 @@ public function getDeliveryId() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldAction.php index 379adf41d87..7dfcd7913ce 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldAction.php @@ -19,6 +19,7 @@ interface StagedOrderSetDeliveryAddressCustomFieldAction extends StagedOrderUpda public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getDeliveryId(); @@ -26,6 +27,7 @@ public function getDeliveryId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -35,6 +37,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldActionBuilder.php index e048dd4d010..c39e576da68 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldActionBuilder.php @@ -23,21 +23,25 @@ final class StagedOrderSetDeliveryAddressCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getDeliveryId() @@ -48,6 +52,7 @@ public function getDeliveryId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -60,6 +65,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldActionModel.php index 5d2a593a21e..0b7ea8d64cb 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldActionModel.php @@ -23,21 +23,25 @@ final class StagedOrderSetDeliveryAddressCustomFieldActionModel extends JsonObje { public const DISCRIMINATOR_VALUE = 'setDeliveryAddressCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -49,15 +53,17 @@ final class StagedOrderSetDeliveryAddressCustomFieldActionModel extends JsonObje public function __construct( ?string $deliveryId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -75,6 +81,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() @@ -94,6 +101,7 @@ public function getDeliveryId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -115,6 +123,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeAction.php index 9eeff4acfec..69c2f9c755c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeAction.php @@ -21,6 +21,7 @@ interface StagedOrderSetDeliveryAddressCustomTypeAction extends StagedOrderUpdat public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getDeliveryId(); @@ -29,6 +30,7 @@ public function getDeliveryId(); *

    Defines the Type that extends the address in a Delivery with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -36,6 +38,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the address in a Delivery.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeActionBuilder.php index 492b6a9fc29..1d14c3082f3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeActionBuilder.php @@ -27,21 +27,25 @@ final class StagedOrderSetDeliveryAddressCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getDeliveryId() @@ -53,6 +57,7 @@ public function getDeliveryId() *

    Defines the Type that extends the address in a Delivery with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -63,6 +68,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the address in a Delivery.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeActionModel.php index 6dad76eb647..e35a8095781 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeActionModel.php @@ -27,21 +27,25 @@ final class StagedOrderSetDeliveryAddressCustomTypeActionModel extends JsonObjec { public const DISCRIMINATOR_VALUE = 'setDeliveryAddressCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -53,15 +57,17 @@ final class StagedOrderSetDeliveryAddressCustomTypeActionModel extends JsonObjec public function __construct( ?string $deliveryId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -79,6 +85,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() @@ -99,6 +106,7 @@ public function getDeliveryId() *

    Defines the Type that extends the address in a Delivery with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -119,6 +127,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the address in a Delivery.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldAction.php index a3b1ce85a78..83fca93ba13 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldAction.php @@ -19,6 +19,7 @@ interface StagedOrderSetDeliveryCustomFieldAction extends StagedOrderUpdateActio public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getDeliveryId(); @@ -26,6 +27,7 @@ public function getDeliveryId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -35,6 +37,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldActionBuilder.php index dc7f00c5ead..15630b23d3d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldActionBuilder.php @@ -23,21 +23,25 @@ final class StagedOrderSetDeliveryCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getDeliveryId() @@ -48,6 +52,7 @@ public function getDeliveryId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -60,6 +65,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldActionModel.php index d12abef3e04..2a9e78da2a1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldActionModel.php @@ -23,21 +23,25 @@ final class StagedOrderSetDeliveryCustomFieldActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setDeliveryCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -49,15 +53,17 @@ final class StagedOrderSetDeliveryCustomFieldActionModel extends JsonObjectModel public function __construct( ?string $deliveryId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -75,6 +81,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() @@ -94,6 +101,7 @@ public function getDeliveryId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -115,6 +123,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeAction.php index f7a01a27df4..05cc693dadd 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeAction.php @@ -21,6 +21,7 @@ interface StagedOrderSetDeliveryCustomTypeAction extends StagedOrderUpdateAction public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getDeliveryId(); @@ -29,6 +30,7 @@ public function getDeliveryId(); *

    Defines the Type that extends the Delivery with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Delivery.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -36,6 +38,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the Delivery.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeActionBuilder.php index 228b7dcb703..482ae298bb4 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeActionBuilder.php @@ -27,21 +27,25 @@ final class StagedOrderSetDeliveryCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getDeliveryId() @@ -53,6 +57,7 @@ public function getDeliveryId() *

    Defines the Type that extends the Delivery with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Delivery.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -63,6 +68,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Delivery.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeActionModel.php index 8e39ebbddbc..e89910a11e2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeActionModel.php @@ -27,21 +27,25 @@ final class StagedOrderSetDeliveryCustomTypeActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setDeliveryCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -53,15 +57,17 @@ final class StagedOrderSetDeliveryCustomTypeActionModel extends JsonObjectModel public function __construct( ?string $deliveryId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -79,6 +85,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() @@ -99,6 +106,7 @@ public function getDeliveryId() *

    Defines the Type that extends the Delivery with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Delivery.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -119,6 +127,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Delivery.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsAction.php index e105ae974be..e902a291232 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsAction.php @@ -19,11 +19,13 @@ interface StagedOrderSetDeliveryItemsAction extends StagedOrderUpdateAction public const FIELD_ITEMS = 'items'; /** + * @return null|string */ public function getDeliveryId(); /** + * @return null|DeliveryItemCollection */ public function getItems(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsActionBuilder.php index 9b32608a828..9c518e9cfc2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsActionBuilder.php @@ -24,16 +24,19 @@ final class StagedOrderSetDeliveryItemsActionBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @return null|string */ public function getDeliveryId() @@ -42,6 +45,7 @@ public function getDeliveryId() } /** + * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsActionModel.php index 04233fe4847..d8901c9c120 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsActionModel.php @@ -24,16 +24,19 @@ final class StagedOrderSetDeliveryItemsActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setDeliveryItems'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?DeliveryItemCollection */ protected $items; @@ -44,14 +47,16 @@ final class StagedOrderSetDeliveryItemsActionModel extends JsonObjectModel imple */ public function __construct( ?string $deliveryId = null, - ?DeliveryItemCollection $items = null + ?DeliveryItemCollection $items = null, + ?string $action = null ) { $this->deliveryId = $deliveryId; $this->items = $items; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -69,6 +74,7 @@ public function getAction() } /** + * * @return null|string */ public function getDeliveryId() @@ -86,6 +92,7 @@ public function getDeliveryId() } /** + * * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldAction.php index 876d92ed384..8e1f76b5136 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldAction.php @@ -19,6 +19,7 @@ interface StagedOrderSetItemShippingAddressCustomFieldAction extends StagedOrder public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getAddressKey(); @@ -26,6 +27,7 @@ public function getAddressKey(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -35,6 +37,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldActionBuilder.php index 7962bcb4def..f11f621bb06 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldActionBuilder.php @@ -23,21 +23,25 @@ final class StagedOrderSetItemShippingAddressCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $addressKey; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getAddressKey() @@ -48,6 +52,7 @@ public function getAddressKey() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -60,6 +65,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldActionModel.php index 8a4dc311ea2..1761d95075e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldActionModel.php @@ -23,21 +23,25 @@ final class StagedOrderSetItemShippingAddressCustomFieldActionModel extends Json { public const DISCRIMINATOR_VALUE = 'setItemShippingAddressCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressKey; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -49,15 +53,17 @@ final class StagedOrderSetItemShippingAddressCustomFieldActionModel extends Json public function __construct( ?string $addressKey = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->addressKey = $addressKey; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -75,6 +81,7 @@ public function getAction() } /** + * * @return null|string */ public function getAddressKey() @@ -94,6 +101,7 @@ public function getAddressKey() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -115,6 +123,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeAction.php index 0722899c6f1..10b0e128a5c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeAction.php @@ -21,6 +21,7 @@ interface StagedOrderSetItemShippingAddressCustomTypeAction extends StagedOrderU public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getAddressKey(); @@ -29,6 +30,7 @@ public function getAddressKey(); *

    Defines the Type that extends the itemShippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the itemShippingAddress.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -36,6 +38,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the itemShippingAddress.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeActionBuilder.php index f457b354dee..64bb5f85791 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeActionBuilder.php @@ -27,21 +27,25 @@ final class StagedOrderSetItemShippingAddressCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $addressKey; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getAddressKey() @@ -53,6 +57,7 @@ public function getAddressKey() *

    Defines the Type that extends the itemShippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the itemShippingAddress.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -63,6 +68,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the itemShippingAddress.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeActionModel.php index 9aa226681d3..5ff885c42c6 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeActionModel.php @@ -27,21 +27,25 @@ final class StagedOrderSetItemShippingAddressCustomTypeActionModel extends JsonO { public const DISCRIMINATOR_VALUE = 'setItemShippingAddressCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $addressKey; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -53,15 +57,17 @@ final class StagedOrderSetItemShippingAddressCustomTypeActionModel extends JsonO public function __construct( ?string $addressKey = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->addressKey = $addressKey; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -79,6 +85,7 @@ public function getAction() } /** + * * @return null|string */ public function getAddressKey() @@ -99,6 +106,7 @@ public function getAddressKey() *

    Defines the Type that extends the itemShippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the itemShippingAddress.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -119,6 +127,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the itemShippingAddress.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomFieldAction.php index c58f5c2e89b..69ece643675 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomFieldAction.php @@ -19,6 +19,7 @@ interface StagedOrderSetLineItemCustomFieldAction extends StagedOrderUpdateActio public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getLineItemId(); @@ -26,6 +27,7 @@ public function getLineItemId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -35,6 +37,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomFieldActionBuilder.php index c07d6fb6ed2..2e4a07e25f9 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomFieldActionBuilder.php @@ -23,21 +23,25 @@ final class StagedOrderSetLineItemCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getLineItemId() @@ -48,6 +52,7 @@ public function getLineItemId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -60,6 +65,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomFieldActionModel.php index 2e1814072bf..7fc6cc92c4c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomFieldActionModel.php @@ -23,21 +23,25 @@ final class StagedOrderSetLineItemCustomFieldActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setLineItemCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -49,15 +53,17 @@ final class StagedOrderSetLineItemCustomFieldActionModel extends JsonObjectModel public function __construct( ?string $lineItemId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -75,6 +81,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -94,6 +101,7 @@ public function getLineItemId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -115,6 +123,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeAction.php index e6cd6cf17e9..1e67fa0083b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeAction.php @@ -21,6 +21,7 @@ interface StagedOrderSetLineItemCustomTypeAction extends StagedOrderUpdateAction public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getLineItemId(); @@ -29,6 +30,7 @@ public function getLineItemId(); *

    Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -36,6 +38,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the LineItem.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeActionBuilder.php index 8a6ad0a7660..77fb3c16afb 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeActionBuilder.php @@ -27,21 +27,25 @@ final class StagedOrderSetLineItemCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getLineItemId() @@ -53,6 +57,7 @@ public function getLineItemId() *

    Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -63,6 +68,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the LineItem.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeActionModel.php index a6860f9b9bc..5ba4019687d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeActionModel.php @@ -27,21 +27,25 @@ final class StagedOrderSetLineItemCustomTypeActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setLineItemCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -53,15 +57,17 @@ final class StagedOrderSetLineItemCustomTypeActionModel extends JsonObjectModel public function __construct( ?string $lineItemId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -79,6 +85,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -99,6 +106,7 @@ public function getLineItemId() *

    Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -119,6 +127,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the LineItem.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelAction.php index 495a83b96ad..b0a6b820c3f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelAction.php @@ -19,6 +19,7 @@ interface StagedOrderSetLineItemDistributionChannelAction extends StagedOrderUpd public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; /** + * @return null|string */ public function getLineItemId(); @@ -26,6 +27,7 @@ public function getLineItemId(); /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelActionBuilder.php index 8fb93f5cecc..a575eeb8eb6 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelActionBuilder.php @@ -25,16 +25,19 @@ final class StagedOrderSetLineItemDistributionChannelActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $distributionChannel; /** + * @return null|string */ public function getLineItemId() @@ -45,6 +48,7 @@ public function getLineItemId() /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelActionModel.php index 26ac0f37ec7..b1911868dde 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelActionModel.php @@ -25,16 +25,19 @@ final class StagedOrderSetLineItemDistributionChannelActionModel extends JsonObj { public const DISCRIMINATOR_VALUE = 'setLineItemDistributionChannel'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ChannelResourceIdentifier */ protected $distributionChannel; @@ -45,14 +48,16 @@ final class StagedOrderSetLineItemDistributionChannelActionModel extends JsonObj */ public function __construct( ?string $lineItemId = null, - ?ChannelResourceIdentifier $distributionChannel = null + ?ChannelResourceIdentifier $distributionChannel = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->distributionChannel = $distributionChannel; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -89,6 +95,7 @@ public function getLineItemId() /** *

    ResourceIdentifier to a Channel.

    * + * * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceAction.php index 32401a0b256..d5cd744227e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceAction.php @@ -19,6 +19,7 @@ interface StagedOrderSetLineItemPriceAction extends StagedOrderUpdateAction public const FIELD_EXTERNAL_PRICE = 'externalPrice'; /** + * @return null|string */ public function getLineItemId(); @@ -27,6 +28,7 @@ public function getLineItemId(); *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getExternalPrice(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceActionBuilder.php index be6ed88a5f3..9a8c640c881 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceActionBuilder.php @@ -25,16 +25,19 @@ final class StagedOrderSetLineItemPriceActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|Money|MoneyBuilder */ private $externalPrice; /** + * @return null|string */ public function getLineItemId() @@ -46,6 +49,7 @@ public function getLineItemId() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getExternalPrice() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceActionModel.php index dc32799a4ec..b9d1ed3f6f7 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceActionModel.php @@ -25,16 +25,19 @@ final class StagedOrderSetLineItemPriceActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setLineItemPrice'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?Money */ protected $externalPrice; @@ -45,14 +48,16 @@ final class StagedOrderSetLineItemPriceActionModel extends JsonObjectModel imple */ public function __construct( ?string $lineItemId = null, - ?Money $externalPrice = null + ?Money $externalPrice = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->externalPrice = $externalPrice; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -90,6 +96,7 @@ public function getLineItemId() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * * @return null|Money */ public function getExternalPrice() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsAction.php index 5f52fb0c0ea..5ae38a5a7b4 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsAction.php @@ -19,11 +19,13 @@ interface StagedOrderSetLineItemShippingDetailsAction extends StagedOrderUpdateA public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionBuilder.php index acec7fc705d..cd6271f6ada 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionBuilder.php @@ -25,16 +25,19 @@ final class StagedOrderSetLineItemShippingDetailsActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetails; /** + * @return null|string */ public function getLineItemId() @@ -43,6 +46,7 @@ public function getLineItemId() } /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionModel.php index e7f84449562..27fe32dd31f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionModel.php @@ -25,16 +25,19 @@ final class StagedOrderSetLineItemShippingDetailsActionModel extends JsonObjectM { public const DISCRIMINATOR_VALUE = 'setLineItemShippingDetails'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; @@ -45,14 +48,16 @@ final class StagedOrderSetLineItemShippingDetailsActionModel extends JsonObjectM */ public function __construct( ?string $lineItemId = null, - ?ItemShippingDetailsDraft $shippingDetails = null + ?ItemShippingDetailsDraft $shippingDetails = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->shippingDetails = $shippingDetails; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -87,6 +93,7 @@ public function getLineItemId() } /** + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountAction.php index 10850b56426..e127422ebab 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountAction.php @@ -19,11 +19,13 @@ interface StagedOrderSetLineItemTaxAmountAction extends StagedOrderUpdateAction public const FIELD_EXTERNAL_TAX_AMOUNT = 'externalTaxAmount'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionBuilder.php index 7b37abedc7e..3c0d761ef32 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionBuilder.php @@ -25,16 +25,19 @@ final class StagedOrderSetLineItemTaxAmountActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|ExternalTaxAmountDraft|ExternalTaxAmountDraftBuilder */ private $externalTaxAmount; /** + * @return null|string */ public function getLineItemId() @@ -43,6 +46,7 @@ public function getLineItemId() } /** + * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionModel.php index ceb397896eb..2ac90e385ec 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionModel.php @@ -25,16 +25,19 @@ final class StagedOrderSetLineItemTaxAmountActionModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'setLineItemTaxAmount'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ExternalTaxAmountDraft */ protected $externalTaxAmount; @@ -45,14 +48,16 @@ final class StagedOrderSetLineItemTaxAmountActionModel extends JsonObjectModel i */ public function __construct( ?string $lineItemId = null, - ?ExternalTaxAmountDraft $externalTaxAmount = null + ?ExternalTaxAmountDraft $externalTaxAmount = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->externalTaxAmount = $externalTaxAmount; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -87,6 +93,7 @@ public function getLineItemId() } /** + * * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateAction.php index 0b2bcc25dd7..4ac9b68fd8a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateAction.php @@ -19,11 +19,13 @@ interface StagedOrderSetLineItemTaxRateAction extends StagedOrderUpdateAction public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionBuilder.php index c094664b38c..beac7041fac 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionBuilder.php @@ -25,16 +25,19 @@ final class StagedOrderSetLineItemTaxRateActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** + * @return null|string */ public function getLineItemId() @@ -43,6 +46,7 @@ public function getLineItemId() } /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionModel.php index 8bc8c261be9..d08694c79d5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionModel.php @@ -25,16 +25,19 @@ final class StagedOrderSetLineItemTaxRateActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'setLineItemTaxRate'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; @@ -45,14 +48,16 @@ final class StagedOrderSetLineItemTaxRateActionModel extends JsonObjectModel imp */ public function __construct( ?string $lineItemId = null, - ?ExternalTaxRateDraft $externalTaxRate = null + ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->externalTaxRate = $externalTaxRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -87,6 +93,7 @@ public function getLineItemId() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceAction.php index 6c93d182432..82e041330dd 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceAction.php @@ -19,11 +19,13 @@ interface StagedOrderSetLineItemTotalPriceAction extends StagedOrderUpdateAction public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceActionBuilder.php index adde66a91e0..14df1cf3f88 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceActionBuilder.php @@ -25,16 +25,19 @@ final class StagedOrderSetLineItemTotalPriceActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|ExternalLineItemTotalPrice|ExternalLineItemTotalPriceBuilder */ private $externalTotalPrice; /** + * @return null|string */ public function getLineItemId() @@ -43,6 +46,7 @@ public function getLineItemId() } /** + * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceActionModel.php index 77eb712a836..80c36024593 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceActionModel.php @@ -25,16 +25,19 @@ final class StagedOrderSetLineItemTotalPriceActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setLineItemTotalPrice'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ExternalLineItemTotalPrice */ protected $externalTotalPrice; @@ -45,14 +48,16 @@ final class StagedOrderSetLineItemTotalPriceActionModel extends JsonObjectModel */ public function __construct( ?string $lineItemId = null, - ?ExternalLineItemTotalPrice $externalTotalPrice = null + ?ExternalLineItemTotalPrice $externalTotalPrice = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->externalTotalPrice = $externalTotalPrice; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -87,6 +93,7 @@ public function getLineItemId() } /** + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleAction.php index e16047b1a13..3e8b475cc25 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleAction.php @@ -17,6 +17,7 @@ interface StagedOrderSetLocaleAction extends StagedOrderUpdateAction public const FIELD_LOCALE = 'locale'; /** + * @return null|string */ public function getLocale(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleActionBuilder.php index d9356b1b7e8..3017eeff5ea 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderSetLocaleActionBuilder implements Builder { /** + * @var ?string */ private $locale; /** + * @return null|string */ public function getLocale() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleActionModel.php index 113bea85a52..c4f6bc9c759 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleActionModel.php @@ -23,11 +23,13 @@ final class StagedOrderSetLocaleActionModel extends JsonObjectModel implements S { public const DISCRIMINATOR_VALUE = 'setLocale'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $locale; @@ -37,13 +39,15 @@ final class StagedOrderSetLocaleActionModel extends JsonObjectModel implements S * @psalm-suppress MissingParamType */ public function __construct( - ?string $locale = null + ?string $locale = null, + ?string $action = null ) { $this->locale = $locale; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|string */ public function getLocale() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberAction.php index 89828d57bac..b50da5c3bcb 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberAction.php @@ -17,6 +17,7 @@ interface StagedOrderSetOrderNumberAction extends StagedOrderUpdateAction public const FIELD_ORDER_NUMBER = 'orderNumber'; /** + * @return null|string */ public function getOrderNumber(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberActionBuilder.php index 532446bcdd4..bbd4d4492e3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderSetOrderNumberActionBuilder implements Builder { /** + * @var ?string */ private $orderNumber; /** + * @return null|string */ public function getOrderNumber() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberActionModel.php index ddc37ffe4d0..7949830f255 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberActionModel.php @@ -23,11 +23,13 @@ final class StagedOrderSetOrderNumberActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setOrderNumber'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $orderNumber; @@ -37,13 +39,15 @@ final class StagedOrderSetOrderNumberActionModel extends JsonObjectModel impleme * @psalm-suppress MissingParamType */ public function __construct( - ?string $orderNumber = null + ?string $orderNumber = null, + ?string $action = null ) { $this->orderNumber = $orderNumber; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|string */ public function getOrderNumber() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxAction.php index 97b1105595a..d4d441824df 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxAction.php @@ -23,11 +23,13 @@ interface StagedOrderSetOrderTotalTaxAction extends StagedOrderUpdateAction *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getExternalTotalGross(); /** + * @return null|TaxPortionDraftCollection */ public function getExternalTaxPortions(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxActionBuilder.php index dc7690f72fb..9277f2d76ae 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxActionBuilder.php @@ -26,11 +26,13 @@ final class StagedOrderSetOrderTotalTaxActionBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $externalTotalGross; /** + * @var ?TaxPortionDraftCollection */ private $externalTaxPortions; @@ -39,6 +41,7 @@ final class StagedOrderSetOrderTotalTaxActionBuilder implements Builder *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getExternalTotalGross() @@ -47,6 +50,7 @@ public function getExternalTotalGross() } /** + * @return null|TaxPortionDraftCollection */ public function getExternalTaxPortions() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxActionModel.php index 49c2ff726b2..c8f59212c5d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxActionModel.php @@ -26,16 +26,19 @@ final class StagedOrderSetOrderTotalTaxActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setOrderTotalTax'; /** + * * @var ?string */ protected $action; /** + * * @var ?Money */ protected $externalTotalGross; /** + * * @var ?TaxPortionDraftCollection */ protected $externalTaxPortions; @@ -46,14 +49,16 @@ final class StagedOrderSetOrderTotalTaxActionModel extends JsonObjectModel imple */ public function __construct( ?Money $externalTotalGross = null, - ?TaxPortionDraftCollection $externalTaxPortions = null + ?TaxPortionDraftCollection $externalTaxPortions = null, + ?string $action = null ) { $this->externalTotalGross = $externalTotalGross; $this->externalTaxPortions = $externalTaxPortions; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -74,6 +79,7 @@ public function getAction() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * * @return null|Money */ public function getExternalTotalGross() @@ -92,6 +98,7 @@ public function getExternalTotalGross() } /** + * * @return null|TaxPortionDraftCollection */ public function getExternalTaxPortions() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldAction.php index 168be721b2c..a69995f5f67 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldAction.php @@ -19,6 +19,7 @@ interface StagedOrderSetParcelCustomFieldAction extends StagedOrderUpdateAction public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getParcelId(); @@ -26,6 +27,7 @@ public function getParcelId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -35,6 +37,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldActionBuilder.php index 30cb3d77e71..d6611003efd 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldActionBuilder.php @@ -23,21 +23,25 @@ final class StagedOrderSetParcelCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $parcelId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getParcelId() @@ -48,6 +52,7 @@ public function getParcelId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -60,6 +65,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldActionModel.php index 4b29ab4e362..e32542b86aa 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldActionModel.php @@ -23,21 +23,25 @@ final class StagedOrderSetParcelCustomFieldActionModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'setParcelCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $parcelId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -49,15 +53,17 @@ final class StagedOrderSetParcelCustomFieldActionModel extends JsonObjectModel i public function __construct( ?string $parcelId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->parcelId = $parcelId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -75,6 +81,7 @@ public function getAction() } /** + * * @return null|string */ public function getParcelId() @@ -94,6 +101,7 @@ public function getParcelId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -115,6 +123,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeAction.php index 9a8e635326c..267d67d2649 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeAction.php @@ -21,6 +21,7 @@ interface StagedOrderSetParcelCustomTypeAction extends StagedOrderUpdateAction public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getParcelId(); @@ -29,6 +30,7 @@ public function getParcelId(); *

    Defines the Type that extends the Parcel with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Parcel.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -36,6 +38,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the Parcel.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeActionBuilder.php index 58d02c82980..5f63f96d4e3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeActionBuilder.php @@ -27,21 +27,25 @@ final class StagedOrderSetParcelCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $parcelId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getParcelId() @@ -53,6 +57,7 @@ public function getParcelId() *

    Defines the Type that extends the Parcel with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Parcel.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -63,6 +68,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Parcel.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeActionModel.php index 47b657dcbd8..1adb4e09cb3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeActionModel.php @@ -27,21 +27,25 @@ final class StagedOrderSetParcelCustomTypeActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'setParcelCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $parcelId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -53,15 +57,17 @@ final class StagedOrderSetParcelCustomTypeActionModel extends JsonObjectModel im public function __construct( ?string $parcelId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->parcelId = $parcelId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -79,6 +85,7 @@ public function getAction() } /** + * * @return null|string */ public function getParcelId() @@ -99,6 +106,7 @@ public function getParcelId() *

    Defines the Type that extends the Parcel with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Parcel.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -119,6 +127,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Parcel.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsAction.php index 3d41e241730..993e1fdae06 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsAction.php @@ -19,11 +19,13 @@ interface StagedOrderSetParcelItemsAction extends StagedOrderUpdateAction public const FIELD_ITEMS = 'items'; /** + * @return null|string */ public function getParcelId(); /** + * @return null|DeliveryItemCollection */ public function getItems(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsActionBuilder.php index 22a1c712324..70a03c5f5bf 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsActionBuilder.php @@ -24,16 +24,19 @@ final class StagedOrderSetParcelItemsActionBuilder implements Builder { /** + * @var ?string */ private $parcelId; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @return null|string */ public function getParcelId() @@ -42,6 +45,7 @@ public function getParcelId() } /** + * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsActionModel.php index c2a84396830..c7499a19def 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsActionModel.php @@ -24,16 +24,19 @@ final class StagedOrderSetParcelItemsActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setParcelItems'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $parcelId; /** + * * @var ?DeliveryItemCollection */ protected $items; @@ -44,14 +47,16 @@ final class StagedOrderSetParcelItemsActionModel extends JsonObjectModel impleme */ public function __construct( ?string $parcelId = null, - ?DeliveryItemCollection $items = null + ?DeliveryItemCollection $items = null, + ?string $action = null ) { $this->parcelId = $parcelId; $this->items = $items; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -69,6 +74,7 @@ public function getAction() } /** + * * @return null|string */ public function getParcelId() @@ -86,6 +92,7 @@ public function getParcelId() } /** + * * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsAction.php index 6826a66233c..f4bca4e0681 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsAction.php @@ -19,11 +19,13 @@ interface StagedOrderSetParcelMeasurementsAction extends StagedOrderUpdateAction public const FIELD_MEASUREMENTS = 'measurements'; /** + * @return null|string */ public function getParcelId(); /** + * @return null|ParcelMeasurements */ public function getMeasurements(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsActionBuilder.php index 9777a6cba2b..7431c510c55 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsActionBuilder.php @@ -25,16 +25,19 @@ final class StagedOrderSetParcelMeasurementsActionBuilder implements Builder { /** + * @var ?string */ private $parcelId; /** + * @var null|ParcelMeasurements|ParcelMeasurementsBuilder */ private $measurements; /** + * @return null|string */ public function getParcelId() @@ -43,6 +46,7 @@ public function getParcelId() } /** + * @return null|ParcelMeasurements */ public function getMeasurements() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsActionModel.php index e28fc7719b2..f6fcc4773b7 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsActionModel.php @@ -25,16 +25,19 @@ final class StagedOrderSetParcelMeasurementsActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setParcelMeasurements'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $parcelId; /** + * * @var ?ParcelMeasurements */ protected $measurements; @@ -45,14 +48,16 @@ final class StagedOrderSetParcelMeasurementsActionModel extends JsonObjectModel */ public function __construct( ?string $parcelId = null, - ?ParcelMeasurements $measurements = null + ?ParcelMeasurements $measurements = null, + ?string $action = null ) { $this->parcelId = $parcelId; $this->measurements = $measurements; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() } /** + * * @return null|string */ public function getParcelId() @@ -87,6 +93,7 @@ public function getParcelId() } /** + * * @return null|ParcelMeasurements */ public function getMeasurements() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataAction.php index 6fe762acd09..17e7d3ea932 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataAction.php @@ -19,11 +19,13 @@ interface StagedOrderSetParcelTrackingDataAction extends StagedOrderUpdateAction public const FIELD_TRACKING_DATA = 'trackingData'; /** + * @return null|string */ public function getParcelId(); /** + * @return null|TrackingData */ public function getTrackingData(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataActionBuilder.php index 2482c2cc49a..d1154c01958 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataActionBuilder.php @@ -25,16 +25,19 @@ final class StagedOrderSetParcelTrackingDataActionBuilder implements Builder { /** + * @var ?string */ private $parcelId; /** + * @var null|TrackingData|TrackingDataBuilder */ private $trackingData; /** + * @return null|string */ public function getParcelId() @@ -43,6 +46,7 @@ public function getParcelId() } /** + * @return null|TrackingData */ public function getTrackingData() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataActionModel.php index 83c3f276a4a..7d0f8c53a2d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataActionModel.php @@ -25,16 +25,19 @@ final class StagedOrderSetParcelTrackingDataActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setParcelTrackingData'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $parcelId; /** + * * @var ?TrackingData */ protected $trackingData; @@ -45,14 +48,16 @@ final class StagedOrderSetParcelTrackingDataActionModel extends JsonObjectModel */ public function __construct( ?string $parcelId = null, - ?TrackingData $trackingData = null + ?TrackingData $trackingData = null, + ?string $action = null ) { $this->parcelId = $parcelId; $this->trackingData = $trackingData; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() } /** + * * @return null|string */ public function getParcelId() @@ -87,6 +93,7 @@ public function getParcelId() } /** + * * @return null|TrackingData */ public function getTrackingData() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoAction.php index 97b3a758091..96afa46ceba 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoAction.php @@ -18,6 +18,7 @@ interface StagedOrderSetReturnInfoAction extends StagedOrderUpdateAction public const FIELD_ITEMS = 'items'; /** + * @return null|ReturnInfoDraftCollection */ public function getItems(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoActionBuilder.php index f82d8835907..af094fbee12 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoActionBuilder.php @@ -24,11 +24,13 @@ final class StagedOrderSetReturnInfoActionBuilder implements Builder { /** + * @var ?ReturnInfoDraftCollection */ private $items; /** + * @return null|ReturnInfoDraftCollection */ public function getItems() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoActionModel.php index e8b7edb16f3..26a87e14e22 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoActionModel.php @@ -24,11 +24,13 @@ final class StagedOrderSetReturnInfoActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'setReturnInfo'; /** + * * @var ?string */ protected $action; /** + * * @var ?ReturnInfoDraftCollection */ protected $items; @@ -38,13 +40,15 @@ final class StagedOrderSetReturnInfoActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?ReturnInfoDraftCollection $items = null + ?ReturnInfoDraftCollection $items = null, + ?string $action = null ) { $this->items = $items; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() } /** + * * @return null|ReturnInfoDraftCollection */ public function getItems() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldAction.php index ef818d0947b..a43c49fcdd6 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldAction.php @@ -19,6 +19,7 @@ interface StagedOrderSetReturnItemCustomFieldAction extends StagedOrderUpdateAct public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getReturnItemId(); @@ -26,6 +27,7 @@ public function getReturnItemId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -35,6 +37,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionBuilder.php index bde18002939..051981c3a4a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionBuilder.php @@ -23,21 +23,25 @@ final class StagedOrderSetReturnItemCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $returnItemId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getReturnItemId() @@ -48,6 +52,7 @@ public function getReturnItemId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -60,6 +65,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionModel.php index 00d6d97eb6f..8df15f1665a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionModel.php @@ -23,21 +23,25 @@ final class StagedOrderSetReturnItemCustomFieldActionModel extends JsonObjectMod { public const DISCRIMINATOR_VALUE = 'setReturnItemCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $returnItemId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -49,15 +53,17 @@ final class StagedOrderSetReturnItemCustomFieldActionModel extends JsonObjectMod public function __construct( ?string $returnItemId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->returnItemId = $returnItemId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -75,6 +81,7 @@ public function getAction() } /** + * * @return null|string */ public function getReturnItemId() @@ -94,6 +101,7 @@ public function getReturnItemId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -115,6 +123,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeAction.php index bd989bcce56..149a0119469 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeAction.php @@ -21,6 +21,7 @@ interface StagedOrderSetReturnItemCustomTypeAction extends StagedOrderUpdateActi public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getReturnItemId(); @@ -29,6 +30,7 @@ public function getReturnItemId(); *

    Defines the Type that extends the ReturnItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ReturnItem.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -36,6 +38,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the ReturnItem.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionBuilder.php index 703ad9e6db3..3d76e782ab6 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionBuilder.php @@ -27,21 +27,25 @@ final class StagedOrderSetReturnItemCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $returnItemId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getReturnItemId() @@ -53,6 +57,7 @@ public function getReturnItemId() *

    Defines the Type that extends the ReturnItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ReturnItem.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -63,6 +68,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the ReturnItem.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionModel.php index 7aaf977c721..ce39adf2088 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionModel.php @@ -27,21 +27,25 @@ final class StagedOrderSetReturnItemCustomTypeActionModel extends JsonObjectMode { public const DISCRIMINATOR_VALUE = 'setReturnItemCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $returnItemId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -53,15 +57,17 @@ final class StagedOrderSetReturnItemCustomTypeActionModel extends JsonObjectMode public function __construct( ?string $returnItemId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->returnItemId = $returnItemId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -79,6 +85,7 @@ public function getAction() } /** + * * @return null|string */ public function getReturnItemId() @@ -99,6 +106,7 @@ public function getReturnItemId() *

    Defines the Type that extends the ReturnItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ReturnItem.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -119,6 +127,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the ReturnItem.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateAction.php index 27b735c4013..cce1da88191 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateAction.php @@ -18,11 +18,13 @@ interface StagedOrderSetReturnPaymentStateAction extends StagedOrderUpdateAction public const FIELD_PAYMENT_STATE = 'paymentState'; /** + * @return null|string */ public function getReturnItemId(); /** + * @return null|string */ public function getPaymentState(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionBuilder.php index 1133cc537fe..b5ff7557bbe 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionBuilder.php @@ -23,16 +23,19 @@ final class StagedOrderSetReturnPaymentStateActionBuilder implements Builder { /** + * @var ?string */ private $returnItemId; /** + * @var ?string */ private $paymentState; /** + * @return null|string */ public function getReturnItemId() @@ -41,6 +44,7 @@ public function getReturnItemId() } /** + * @return null|string */ public function getPaymentState() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionModel.php index bba0f4dbbfe..026948bbc12 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionModel.php @@ -23,16 +23,19 @@ final class StagedOrderSetReturnPaymentStateActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setReturnPaymentState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $returnItemId; /** + * * @var ?string */ protected $paymentState; @@ -43,14 +46,16 @@ final class StagedOrderSetReturnPaymentStateActionModel extends JsonObjectModel */ public function __construct( ?string $returnItemId = null, - ?string $paymentState = null + ?string $paymentState = null, + ?string $action = null ) { $this->returnItemId = $returnItemId; $this->paymentState = $paymentState; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|string */ public function getReturnItemId() @@ -85,6 +91,7 @@ public function getReturnItemId() } /** + * * @return null|string */ public function getPaymentState() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateAction.php index 3b18032e38f..aebc1c86945 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateAction.php @@ -18,11 +18,13 @@ interface StagedOrderSetReturnShipmentStateAction extends StagedOrderUpdateActio public const FIELD_SHIPMENT_STATE = 'shipmentState'; /** + * @return null|string */ public function getReturnItemId(); /** + * @return null|string */ public function getShipmentState(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionBuilder.php index 8a68f907364..2f94ab4d065 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionBuilder.php @@ -23,16 +23,19 @@ final class StagedOrderSetReturnShipmentStateActionBuilder implements Builder { /** + * @var ?string */ private $returnItemId; /** + * @var ?string */ private $shipmentState; /** + * @return null|string */ public function getReturnItemId() @@ -41,6 +44,7 @@ public function getReturnItemId() } /** + * @return null|string */ public function getShipmentState() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionModel.php index f4bdf26f0e1..db07eb896a7 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionModel.php @@ -23,16 +23,19 @@ final class StagedOrderSetReturnShipmentStateActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setReturnShipmentState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $returnItemId; /** + * * @var ?string */ protected $shipmentState; @@ -43,14 +46,16 @@ final class StagedOrderSetReturnShipmentStateActionModel extends JsonObjectModel */ public function __construct( ?string $returnItemId = null, - ?string $shipmentState = null + ?string $shipmentState = null, + ?string $action = null ) { $this->returnItemId = $returnItemId; $this->shipmentState = $shipmentState; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|string */ public function getReturnItemId() @@ -85,6 +91,7 @@ public function getReturnItemId() } /** + * * @return null|string */ public function getShipmentState() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAction.php index 04c90a5fab3..cc94d1e31ad 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAction.php @@ -18,6 +18,7 @@ interface StagedOrderSetShippingAddressAction extends StagedOrderUpdateAction public const FIELD_ADDRESS = 'address'; /** + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionBuilder.php index 2c6c52a7091..6a9aa00b2a4 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionBuilder.php @@ -25,11 +25,13 @@ final class StagedOrderSetShippingAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionModel.php index f2bbbe53ee3..9a0a5f8de95 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionModel.php @@ -25,11 +25,13 @@ final class StagedOrderSetShippingAddressActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'setShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -39,13 +41,15 @@ final class StagedOrderSetShippingAddressActionModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php index c98dbe14114..b72cba4a626 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php @@ -25,16 +25,19 @@ interface StagedOrderSetShippingAddressAndCustomShippingMethodAction extends Sta public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + * @return null|BaseAddress */ public function getAddress(); /** + * @return null|string */ public function getShippingMethodName(); /** + * @return null|ShippingRateDraft */ public function getShippingRate(); @@ -42,11 +45,13 @@ public function getShippingRate(); /** *

    ResourceIdentifier to a TaxCategory.

    * + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory(); /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php index cf3508f6944..ed5a3956fac 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php @@ -31,31 +31,37 @@ final class StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @var ?string */ private $shippingMethodName; /** + * @var null|ShippingRateDraft|ShippingRateDraftBuilder */ private $shippingRate; /** + * @var null|TaxCategoryResourceIdentifier|TaxCategoryResourceIdentifierBuilder */ private $taxCategory; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** + * @return null|BaseAddress */ public function getAddress() @@ -64,6 +70,7 @@ public function getAddress() } /** + * @return null|string */ public function getShippingMethodName() @@ -72,6 +79,7 @@ public function getShippingMethodName() } /** + * @return null|ShippingRateDraft */ public function getShippingRate() @@ -82,6 +90,7 @@ public function getShippingRate() /** *

    ResourceIdentifier to a TaxCategory.

    * + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -90,6 +99,7 @@ public function getTaxCategory() } /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php index fe18d91e50f..faf1ea62214 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php @@ -31,31 +31,37 @@ final class StagedOrderSetShippingAddressAndCustomShippingMethodActionModel exte { public const DISCRIMINATOR_VALUE = 'setShippingAddressAndCustomShippingMethod'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; /** + * * @var ?string */ protected $shippingMethodName; /** + * * @var ?ShippingRateDraft */ protected $shippingRate; /** + * * @var ?TaxCategoryResourceIdentifier */ protected $taxCategory; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; @@ -69,17 +75,19 @@ public function __construct( ?string $shippingMethodName = null, ?ShippingRateDraft $shippingRate = null, ?TaxCategoryResourceIdentifier $taxCategory = null, - ?ExternalTaxRateDraft $externalTaxRate = null + ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $action = null ) { $this->address = $address; $this->shippingMethodName = $shippingMethodName; $this->shippingRate = $shippingRate; $this->taxCategory = $taxCategory; $this->externalTaxRate = $externalTaxRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -97,6 +105,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() @@ -115,6 +124,7 @@ public function getAddress() } /** + * * @return null|string */ public function getShippingMethodName() @@ -132,6 +142,7 @@ public function getShippingMethodName() } /** + * * @return null|ShippingRateDraft */ public function getShippingRate() @@ -152,6 +163,7 @@ public function getShippingRate() /** *

    ResourceIdentifier to a TaxCategory.

    * + * * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -170,6 +182,7 @@ public function getTaxCategory() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodAction.php index c8d7e091c96..db11c4cf6cf 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodAction.php @@ -22,6 +22,7 @@ interface StagedOrderSetShippingAddressAndShippingMethodAction extends StagedOrd public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + * @return null|BaseAddress */ public function getAddress(); @@ -29,11 +30,13 @@ public function getAddress(); /** *

    ResourceIdentifier to a ShippingMethod.

    * + * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod(); /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionBuilder.php index 841832af6c1..547c89f12ea 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionBuilder.php @@ -29,21 +29,25 @@ final class StagedOrderSetShippingAddressAndShippingMethodActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @var null|ShippingMethodResourceIdentifier|ShippingMethodResourceIdentifierBuilder */ private $shippingMethod; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** + * @return null|BaseAddress */ public function getAddress() @@ -54,6 +58,7 @@ public function getAddress() /** *

    ResourceIdentifier to a ShippingMethod.

    * + * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod() @@ -62,6 +67,7 @@ public function getShippingMethod() } /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionModel.php index e2a95d2b333..79d7f1dad42 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionModel.php @@ -29,21 +29,25 @@ final class StagedOrderSetShippingAddressAndShippingMethodActionModel extends Js { public const DISCRIMINATOR_VALUE = 'setShippingAddressAndShippingMethod'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; /** + * * @var ?ShippingMethodResourceIdentifier */ protected $shippingMethod; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; @@ -55,15 +59,17 @@ final class StagedOrderSetShippingAddressAndShippingMethodActionModel extends Js public function __construct( ?BaseAddress $address = null, ?ShippingMethodResourceIdentifier $shippingMethod = null, - ?ExternalTaxRateDraft $externalTaxRate = null + ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $action = null ) { $this->address = $address; $this->shippingMethod = $shippingMethod; $this->externalTaxRate = $externalTaxRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -81,6 +87,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() @@ -101,6 +108,7 @@ public function getAddress() /** *

    ResourceIdentifier to a ShippingMethod.

    * + * * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod() @@ -119,6 +127,7 @@ public function getShippingMethod() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomFieldAction.php index 94e45676f82..b9bed89800b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomFieldAction.php @@ -20,6 +20,7 @@ interface StagedOrderSetShippingAddressCustomFieldAction extends StagedOrderUpda /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -29,6 +30,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomFieldActionBuilder.php index 6610a3c941b..dc59cf9dcbd 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomFieldActionBuilder.php @@ -23,11 +23,13 @@ final class StagedOrderSetShippingAddressCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -35,6 +37,7 @@ final class StagedOrderSetShippingAddressCustomFieldActionBuilder implements Bui /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -47,6 +50,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomFieldActionModel.php index 1d80bfa27a6..5473de44c35 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomFieldActionModel.php @@ -23,16 +23,19 @@ final class StagedOrderSetShippingAddressCustomFieldActionModel extends JsonObje { public const DISCRIMINATOR_VALUE = 'setShippingAddressCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -43,14 +46,16 @@ final class StagedOrderSetShippingAddressCustomFieldActionModel extends JsonObje */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -91,6 +97,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomTypeAction.php index 18292e16981..24911992e78 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomTypeAction.php @@ -23,6 +23,7 @@ interface StagedOrderSetShippingAddressCustomTypeAction extends StagedOrderUpdat *

    Defines the Type that extends the shippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the shippingAddress.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -30,6 +31,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the shippingAddress.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomTypeActionBuilder.php index f1abf022006..08274436a46 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomTypeActionBuilder.php @@ -27,11 +27,13 @@ final class StagedOrderSetShippingAddressCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -40,6 +42,7 @@ final class StagedOrderSetShippingAddressCustomTypeActionBuilder implements Buil *

    Defines the Type that extends the shippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the shippingAddress.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -50,6 +53,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the shippingAddress.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomTypeActionModel.php index 81546486e94..15add08933f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressCustomTypeActionModel.php @@ -27,16 +27,19 @@ final class StagedOrderSetShippingAddressCustomTypeActionModel extends JsonObjec { public const DISCRIMINATOR_VALUE = 'setShippingAddressCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -47,14 +50,16 @@ final class StagedOrderSetShippingAddressCustomTypeActionModel extends JsonObjec */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -75,6 +80,7 @@ public function getAction() *

    Defines the Type that extends the shippingAddress with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the shippingAddress.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -95,6 +101,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the shippingAddress.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodAction.php index 53ce11eba43..73c21e17dbf 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodAction.php @@ -22,11 +22,13 @@ interface StagedOrderSetShippingMethodAction extends StagedOrderUpdateAction /** *

    ResourceIdentifier to a ShippingMethod.

    * + * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod(); /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionBuilder.php index 4e04e6de3a9..f87fd1e5c78 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionBuilder.php @@ -27,11 +27,13 @@ final class StagedOrderSetShippingMethodActionBuilder implements Builder { /** + * @var null|ShippingMethodResourceIdentifier|ShippingMethodResourceIdentifierBuilder */ private $shippingMethod; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; @@ -39,6 +41,7 @@ final class StagedOrderSetShippingMethodActionBuilder implements Builder /** *

    ResourceIdentifier to a ShippingMethod.

    * + * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod() @@ -47,6 +50,7 @@ public function getShippingMethod() } /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionModel.php index 129a10b57ce..151019dc289 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionModel.php @@ -27,16 +27,19 @@ final class StagedOrderSetShippingMethodActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setShippingMethod'; /** + * * @var ?string */ protected $action; /** + * * @var ?ShippingMethodResourceIdentifier */ protected $shippingMethod; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; @@ -47,14 +50,16 @@ final class StagedOrderSetShippingMethodActionModel extends JsonObjectModel impl */ public function __construct( ?ShippingMethodResourceIdentifier $shippingMethod = null, - ?ExternalTaxRateDraft $externalTaxRate = null + ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $action = null ) { $this->shippingMethod = $shippingMethod; $this->externalTaxRate = $externalTaxRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -74,6 +79,7 @@ public function getAction() /** *

    ResourceIdentifier to a ShippingMethod.

    * + * * @return null|ShippingMethodResourceIdentifier */ public function getShippingMethod() @@ -92,6 +98,7 @@ public function getShippingMethod() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountAction.php index 35a5f8d3a36..cac37d0e019 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountAction.php @@ -18,6 +18,7 @@ interface StagedOrderSetShippingMethodTaxAmountAction extends StagedOrderUpdateA public const FIELD_EXTERNAL_TAX_AMOUNT = 'externalTaxAmount'; /** + * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionBuilder.php index 31f1d37e952..93e7df1f344 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionBuilder.php @@ -25,11 +25,13 @@ final class StagedOrderSetShippingMethodTaxAmountActionBuilder implements Builder { /** + * @var null|ExternalTaxAmountDraft|ExternalTaxAmountDraftBuilder */ private $externalTaxAmount; /** + * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionModel.php index 0f273f3df83..ecc6df5e50f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionModel.php @@ -25,11 +25,13 @@ final class StagedOrderSetShippingMethodTaxAmountActionModel extends JsonObjectM { public const DISCRIMINATOR_VALUE = 'setShippingMethodTaxAmount'; /** + * * @var ?string */ protected $action; /** + * * @var ?ExternalTaxAmountDraft */ protected $externalTaxAmount; @@ -39,13 +41,15 @@ final class StagedOrderSetShippingMethodTaxAmountActionModel extends JsonObjectM * @psalm-suppress MissingParamType */ public function __construct( - ?ExternalTaxAmountDraft $externalTaxAmount = null + ?ExternalTaxAmountDraft $externalTaxAmount = null, + ?string $action = null ) { $this->externalTaxAmount = $externalTaxAmount; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() } /** + * * @return null|ExternalTaxAmountDraft */ public function getExternalTaxAmount() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateAction.php index d9dd2c10575..4950d9c13bf 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateAction.php @@ -18,6 +18,7 @@ interface StagedOrderSetShippingMethodTaxRateAction extends StagedOrderUpdateAct public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionBuilder.php index c69f84dfb2c..199f083faaf 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionBuilder.php @@ -25,11 +25,13 @@ final class StagedOrderSetShippingMethodTaxRateActionBuilder implements Builder { /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionModel.php index 435a7b030cd..3cce576314e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionModel.php @@ -25,11 +25,13 @@ final class StagedOrderSetShippingMethodTaxRateActionModel extends JsonObjectMod { public const DISCRIMINATOR_VALUE = 'setShippingMethodTaxRate'; /** + * * @var ?string */ protected $action; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; @@ -39,13 +41,15 @@ final class StagedOrderSetShippingMethodTaxRateActionModel extends JsonObjectMod * @psalm-suppress MissingParamType */ public function __construct( - ?ExternalTaxRateDraft $externalTaxRate = null + ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $action = null ) { $this->externalTaxRate = $externalTaxRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputAction.php index 967be915382..3d6eacd1669 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputAction.php @@ -18,6 +18,7 @@ interface StagedOrderSetShippingRateInputAction extends StagedOrderUpdateAction public const FIELD_SHIPPING_RATE_INPUT = 'shippingRateInput'; /** + * @return null|ShippingRateInputDraft */ public function getShippingRateInput(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionBuilder.php index a2f98e429b9..da94afb071c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionBuilder.php @@ -25,11 +25,13 @@ final class StagedOrderSetShippingRateInputActionBuilder implements Builder { /** + * @var null|ShippingRateInputDraft|ShippingRateInputDraftBuilder */ private $shippingRateInput; /** + * @return null|ShippingRateInputDraft */ public function getShippingRateInput() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionModel.php index 32001031dbc..80ae410900e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionModel.php @@ -25,11 +25,13 @@ final class StagedOrderSetShippingRateInputActionModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'setShippingRateInput'; /** + * * @var ?string */ protected $action; /** + * * @var ?ShippingRateInputDraft */ protected $shippingRateInput; @@ -39,13 +41,15 @@ final class StagedOrderSetShippingRateInputActionModel extends JsonObjectModel i * @psalm-suppress MissingParamType */ public function __construct( - ?ShippingRateInputDraft $shippingRateInput = null + ?ShippingRateInputDraft $shippingRateInput = null, + ?string $action = null ) { $this->shippingRateInput = $shippingRateInput; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() } /** + * * @return null|ShippingRateInputDraft */ public function getShippingRateInput() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateAction.php index 641c04e5628..73e7d767b8b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateAction.php @@ -23,11 +23,13 @@ interface StagedOrderTransitionCustomLineItemStateAction extends StagedOrderUpda public const FIELD_ACTUAL_TRANSITION_DATE = 'actualTransitionDate'; /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|int */ public function getQuantity(); @@ -35,6 +37,7 @@ public function getQuantity(); /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getFromState(); @@ -42,11 +45,13 @@ public function getFromState(); /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getToState(); /** + * @return null|DateTimeImmutable */ public function getActualTransitionDate(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionBuilder.php index c84a4e61be4..979f1ea6231 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionBuilder.php @@ -26,31 +26,37 @@ final class StagedOrderTransitionCustomLineItemStateActionBuilder implements Builder { /** + * @var ?string */ private $customLineItemId; /** + * @var ?int */ private $quantity; /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $fromState; /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $toState; /** + * @var ?DateTimeImmutable */ private $actualTransitionDate; /** + * @return null|string */ public function getCustomLineItemId() @@ -59,6 +65,7 @@ public function getCustomLineItemId() } /** + * @return null|int */ public function getQuantity() @@ -69,6 +76,7 @@ public function getQuantity() /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getFromState() @@ -79,6 +87,7 @@ public function getFromState() /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getToState() @@ -87,6 +96,7 @@ public function getToState() } /** + * @return null|DateTimeImmutable */ public function getActualTransitionDate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionModel.php index dc635aed635..c930d439bab 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionModel.php @@ -26,31 +26,37 @@ final class StagedOrderTransitionCustomLineItemStateActionModel extends JsonObje { public const DISCRIMINATOR_VALUE = 'transitionCustomLineItemState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?int */ protected $quantity; /** + * * @var ?StateResourceIdentifier */ protected $fromState; /** + * * @var ?StateResourceIdentifier */ protected $toState; /** + * * @var ?DateTimeImmutable */ protected $actualTransitionDate; @@ -64,17 +70,19 @@ public function __construct( ?int $quantity = null, ?StateResourceIdentifier $fromState = null, ?StateResourceIdentifier $toState = null, - ?DateTimeImmutable $actualTransitionDate = null + ?DateTimeImmutable $actualTransitionDate = null, + ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->quantity = $quantity; $this->fromState = $fromState; $this->toState = $toState; $this->actualTransitionDate = $actualTransitionDate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -92,6 +100,7 @@ public function getAction() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -109,6 +118,7 @@ public function getCustomLineItemId() } /** + * * @return null|int */ public function getQuantity() @@ -128,6 +138,7 @@ public function getQuantity() /** *

    ResourceIdentifier to a State.

    * + * * @return null|StateResourceIdentifier */ public function getFromState() @@ -148,6 +159,7 @@ public function getFromState() /** *

    ResourceIdentifier to a State.

    * + * * @return null|StateResourceIdentifier */ public function getToState() @@ -166,6 +178,7 @@ public function getToState() } /** + * * @return null|DateTimeImmutable */ public function getActualTransitionDate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateAction.php index 5f6b252caec..d89d1839beb 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateAction.php @@ -23,11 +23,13 @@ interface StagedOrderTransitionLineItemStateAction extends StagedOrderUpdateActi public const FIELD_ACTUAL_TRANSITION_DATE = 'actualTransitionDate'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|int */ public function getQuantity(); @@ -35,6 +37,7 @@ public function getQuantity(); /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getFromState(); @@ -42,11 +45,13 @@ public function getFromState(); /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getToState(); /** + * @return null|DateTimeImmutable */ public function getActualTransitionDate(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionBuilder.php index 843820596ba..045bf37714c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionBuilder.php @@ -26,31 +26,37 @@ final class StagedOrderTransitionLineItemStateActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?int */ private $quantity; /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $fromState; /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $toState; /** + * @var ?DateTimeImmutable */ private $actualTransitionDate; /** + * @return null|string */ public function getLineItemId() @@ -59,6 +65,7 @@ public function getLineItemId() } /** + * @return null|int */ public function getQuantity() @@ -69,6 +76,7 @@ public function getQuantity() /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getFromState() @@ -79,6 +87,7 @@ public function getFromState() /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getToState() @@ -87,6 +96,7 @@ public function getToState() } /** + * @return null|DateTimeImmutable */ public function getActualTransitionDate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionModel.php index e238e106247..5afcda79993 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionModel.php @@ -26,31 +26,37 @@ final class StagedOrderTransitionLineItemStateActionModel extends JsonObjectMode { public const DISCRIMINATOR_VALUE = 'transitionLineItemState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?int */ protected $quantity; /** + * * @var ?StateResourceIdentifier */ protected $fromState; /** + * * @var ?StateResourceIdentifier */ protected $toState; /** + * * @var ?DateTimeImmutable */ protected $actualTransitionDate; @@ -64,17 +70,19 @@ public function __construct( ?int $quantity = null, ?StateResourceIdentifier $fromState = null, ?StateResourceIdentifier $toState = null, - ?DateTimeImmutable $actualTransitionDate = null + ?DateTimeImmutable $actualTransitionDate = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->quantity = $quantity; $this->fromState = $fromState; $this->toState = $toState; $this->actualTransitionDate = $actualTransitionDate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -92,6 +100,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -109,6 +118,7 @@ public function getLineItemId() } /** + * * @return null|int */ public function getQuantity() @@ -128,6 +138,7 @@ public function getQuantity() /** *

    ResourceIdentifier to a State.

    * + * * @return null|StateResourceIdentifier */ public function getFromState() @@ -148,6 +159,7 @@ public function getFromState() /** *

    ResourceIdentifier to a State.

    * + * * @return null|StateResourceIdentifier */ public function getToState() @@ -166,6 +178,7 @@ public function getToState() } /** + * * @return null|DateTimeImmutable */ public function getActualTransitionDate() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateAction.php index d4d40fc01f9..b12e3c1caee 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateAction.php @@ -21,11 +21,13 @@ interface StagedOrderTransitionStateAction extends StagedOrderUpdateAction /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getState(); /** + * @return null|bool */ public function getForce(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateActionBuilder.php index ab8b35a1e05..7d29cd37d62 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateActionBuilder.php @@ -25,11 +25,13 @@ final class StagedOrderTransitionStateActionBuilder implements Builder { /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $state; /** + * @var ?bool */ private $force; @@ -37,6 +39,7 @@ final class StagedOrderTransitionStateActionBuilder implements Builder /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getState() @@ -45,6 +48,7 @@ public function getState() } /** + * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateActionModel.php index 1c77575de46..2671d10fe97 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateActionModel.php @@ -25,16 +25,19 @@ final class StagedOrderTransitionStateActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'transitionState'; /** + * * @var ?string */ protected $action; /** + * * @var ?StateResourceIdentifier */ protected $state; /** + * * @var ?bool */ protected $force; @@ -45,14 +48,16 @@ final class StagedOrderTransitionStateActionModel extends JsonObjectModel implem */ public function __construct( ?StateResourceIdentifier $state = null, - ?bool $force = null + ?bool $force = null, + ?string $action = null ) { $this->state = $state; $this->force = $force; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -72,6 +77,7 @@ public function getAction() /** *

    ResourceIdentifier to a State.

    * + * * @return null|StateResourceIdentifier */ public function getState() @@ -90,6 +96,7 @@ public function getState() } /** + * * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressAction.php index d24480a2809..f9d6e9a4642 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressAction.php @@ -18,6 +18,7 @@ interface StagedOrderUpdateItemShippingAddressAction extends StagedOrderUpdateAc public const FIELD_ADDRESS = 'address'; /** + * @return null|BaseAddress */ public function getAddress(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionBuilder.php index 22c45006c81..5bdaa79b265 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionBuilder.php @@ -25,11 +25,13 @@ final class StagedOrderUpdateItemShippingAddressActionBuilder implements Builder { /** + * @var null|BaseAddress|BaseAddressBuilder */ private $address; /** + * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionModel.php index 8289041d98c..c9946468d8a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionModel.php @@ -25,11 +25,13 @@ final class StagedOrderUpdateItemShippingAddressActionModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'updateItemShippingAddress'; /** + * * @var ?string */ protected $action; /** + * * @var ?BaseAddress */ protected $address; @@ -39,13 +41,15 @@ final class StagedOrderUpdateItemShippingAddressActionModel extends JsonObjectMo * @psalm-suppress MissingParamType */ public function __construct( - ?BaseAddress $address = null + ?BaseAddress $address = null, + ?string $action = null ) { $this->address = $address; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() } /** + * * @return null|BaseAddress */ public function getAddress() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoAction.php index 1652da8983a..d5a1dcdd0fd 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoAction.php @@ -23,16 +23,19 @@ interface StagedOrderUpdateSyncInfoAction extends StagedOrderUpdateAction /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getChannel(); /** + * @return null|string */ public function getExternalId(); /** + * @return null|DateTimeImmutable */ public function getSyncedAt(); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoActionBuilder.php index 2232223df06..91409805290 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoActionBuilder.php @@ -26,16 +26,19 @@ final class StagedOrderUpdateSyncInfoActionBuilder implements Builder { /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $channel; /** + * @var ?string */ private $externalId; /** + * @var ?DateTimeImmutable */ private $syncedAt; @@ -43,6 +46,7 @@ final class StagedOrderUpdateSyncInfoActionBuilder implements Builder /** *

    ResourceIdentifier to a Channel.

    * + * @return null|ChannelResourceIdentifier */ public function getChannel() @@ -51,6 +55,7 @@ public function getChannel() } /** + * @return null|string */ public function getExternalId() @@ -59,6 +64,7 @@ public function getExternalId() } /** + * @return null|DateTimeImmutable */ public function getSyncedAt() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoActionModel.php index 2986e8cfdd6..8c917d935d5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoActionModel.php @@ -26,21 +26,25 @@ final class StagedOrderUpdateSyncInfoActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'updateSyncInfo'; /** + * * @var ?string */ protected $action; /** + * * @var ?ChannelResourceIdentifier */ protected $channel; /** + * * @var ?string */ protected $externalId; /** + * * @var ?DateTimeImmutable */ protected $syncedAt; @@ -52,15 +56,17 @@ final class StagedOrderUpdateSyncInfoActionModel extends JsonObjectModel impleme public function __construct( ?ChannelResourceIdentifier $channel = null, ?string $externalId = null, - ?DateTimeImmutable $syncedAt = null + ?DateTimeImmutable $syncedAt = null, + ?string $action = null ) { $this->channel = $channel; $this->externalId = $externalId; $this->syncedAt = $syncedAt; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -80,6 +86,7 @@ public function getAction() /** *

    ResourceIdentifier to a Channel.

    * + * * @return null|ChannelResourceIdentifier */ public function getChannel() @@ -98,6 +105,7 @@ public function getChannel() } /** + * * @return null|string */ public function getExternalId() @@ -115,6 +123,7 @@ public function getExternalId() } /** + * * @return null|DateTimeImmutable */ public function getSyncedAt() diff --git a/lib/commercetools-api/src/Models/Payment/Payment.php b/lib/commercetools-api/src/Models/Payment/Payment.php index 12e13ae4fe1..74256e609a1 100644 --- a/lib/commercetools-api/src/Models/Payment/Payment.php +++ b/lib/commercetools-api/src/Models/Payment/Payment.php @@ -37,21 +37,25 @@ interface Payment extends BaseResource /** *

    Unique identifier of the Payment.

    * + * @return null|string */ public function getId(); /** + * @return null|int */ public function getVersion(); /** + * @return null|DateTimeImmutable */ public function getCreatedAt(); /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -59,6 +63,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -66,6 +71,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -73,6 +79,7 @@ public function getCreatedBy(); /** *

    A reference to the customer this payment belongs to.

    * + * @return null|CustomerReference */ public function getCustomer(); @@ -80,6 +87,7 @@ public function getCustomer(); /** *

    Identifies payments belonging to an anonymous session (the customer has not signed up/in yet).

    * + * @return null|string */ public function getAnonymousId(); @@ -89,6 +97,7 @@ public function getAnonymousId(); * Cannot be changed once it has been set. * The combination of this ID and the PaymentMethodInfo paymentInterface must be unique.

    * + * @return null|string */ public function getInterfaceId(); @@ -97,16 +106,19 @@ public function getInterfaceId(); *

    How much money this payment intends to receive from the customer. * The value usually matches the cart or order gross total.

    * + * @return null|TypedMoney */ public function getAmountPlanned(); /** + * @return null|PaymentMethodInfo */ public function getPaymentMethodInfo(); /** + * @return null|PaymentStatus */ public function getPaymentStatus(); @@ -114,6 +126,7 @@ public function getPaymentStatus(); /** *

    A list of financial transactions of different TransactionTypes with different TransactionStates.

    * + * @return null|TransactionCollection */ public function getTransactions(); @@ -124,11 +137,13 @@ public function getTransactions(); * If so, the interactionId in the Transaction should be set to match the ID of the PSP for the interaction. * Interactions are managed by the PSP integration and are usually neither written nor read by the user facing frontends or other services.

    * + * @return null|CustomFieldsCollection */ public function getInterfaceInteractions(); /** + * @return null|CustomFields */ public function getCustom(); @@ -136,6 +151,7 @@ public function getCustom(); /** *

    User-defined unique identifier of the Payment.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentAddInterfaceInteractionAction.php b/lib/commercetools-api/src/Models/Payment/PaymentAddInterfaceInteractionAction.php index e891735bc38..b56292527ed 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentAddInterfaceInteractionAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentAddInterfaceInteractionAction.php @@ -19,11 +19,13 @@ interface PaymentAddInterfaceInteractionAction extends PaymentUpdateAction public const FIELD_FIELDS = 'fields'; /** + * @return null|TypeResourceIdentifier */ public function getType(); /** + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentAddInterfaceInteractionActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentAddInterfaceInteractionActionBuilder.php index 2b27a7359e3..795d18504db 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentAddInterfaceInteractionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentAddInterfaceInteractionActionBuilder.php @@ -25,16 +25,19 @@ final class PaymentAddInterfaceInteractionActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|TypeResourceIdentifier */ public function getType() @@ -43,6 +46,7 @@ public function getType() } /** + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentAddInterfaceInteractionActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentAddInterfaceInteractionActionModel.php index 0399b61baa6..f1ccc1fada8 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentAddInterfaceInteractionActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentAddInterfaceInteractionActionModel.php @@ -25,16 +25,19 @@ final class PaymentAddInterfaceInteractionActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'addInterfaceInteraction'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class PaymentAddInterfaceInteractionActionModel extends JsonObjectModel im */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() } /** + * * @return null|TypeResourceIdentifier */ public function getType() @@ -88,6 +94,7 @@ public function getType() } /** + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentAddTransactionAction.php b/lib/commercetools-api/src/Models/Payment/PaymentAddTransactionAction.php index 7db5bb12e71..8a944469cf9 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentAddTransactionAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentAddTransactionAction.php @@ -16,6 +16,7 @@ interface PaymentAddTransactionAction extends PaymentUpdateAction public const FIELD_TRANSACTION = 'transaction'; /** + * @return null|TransactionDraft */ public function getTransaction(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentAddTransactionActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentAddTransactionActionBuilder.php index 4094274d745..c4a7c00bcb7 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentAddTransactionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentAddTransactionActionBuilder.php @@ -21,11 +21,13 @@ final class PaymentAddTransactionActionBuilder implements Builder { /** + * @var null|TransactionDraft|TransactionDraftBuilder */ private $transaction; /** + * @return null|TransactionDraft */ public function getTransaction() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentAddTransactionActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentAddTransactionActionModel.php index a85ab1590fc..51962e9578b 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentAddTransactionActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentAddTransactionActionModel.php @@ -21,11 +21,13 @@ final class PaymentAddTransactionActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'addTransaction'; /** + * * @var ?string */ protected $action; /** + * * @var ?TransactionDraft */ protected $transaction; @@ -35,13 +37,15 @@ final class PaymentAddTransactionActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?TransactionDraft $transaction = null + ?TransactionDraft $transaction = null, + ?string $action = null ) { $this->transaction = $transaction; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|TransactionDraft */ public function getTransaction() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentBuilder.php index 755f77a378f..c0294fdc005 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentBuilder.php @@ -35,81 +35,97 @@ final class PaymentBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var null|CustomerReference|CustomerReferenceBuilder */ private $customer; /** + * @var ?string */ private $anonymousId; /** + * @var ?string */ private $interfaceId; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $amountPlanned; /** + * @var null|PaymentMethodInfo|PaymentMethodInfoBuilder */ private $paymentMethodInfo; /** + * @var null|PaymentStatus|PaymentStatusBuilder */ private $paymentStatus; /** + * @var ?TransactionCollection */ private $transactions; /** + * @var ?CustomFieldsCollection */ private $interfaceInteractions; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var ?string */ private $key; @@ -117,6 +133,7 @@ final class PaymentBuilder implements Builder /** *

    Unique identifier of the Payment.

    * + * @return null|string */ public function getId() @@ -125,6 +142,7 @@ public function getId() } /** + * @return null|int */ public function getVersion() @@ -133,6 +151,7 @@ public function getVersion() } /** + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -141,6 +160,7 @@ public function getCreatedAt() } /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -151,6 +171,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -161,6 +182,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -171,6 +193,7 @@ public function getCreatedBy() /** *

    A reference to the customer this payment belongs to.

    * + * @return null|CustomerReference */ public function getCustomer() @@ -181,6 +204,7 @@ public function getCustomer() /** *

    Identifies payments belonging to an anonymous session (the customer has not signed up/in yet).

    * + * @return null|string */ public function getAnonymousId() @@ -193,6 +217,7 @@ public function getAnonymousId() * Cannot be changed once it has been set. * The combination of this ID and the PaymentMethodInfo paymentInterface must be unique.

    * + * @return null|string */ public function getInterfaceId() @@ -204,6 +229,7 @@ public function getInterfaceId() *

    How much money this payment intends to receive from the customer. * The value usually matches the cart or order gross total.

    * + * @return null|TypedMoney */ public function getAmountPlanned() @@ -212,6 +238,7 @@ public function getAmountPlanned() } /** + * @return null|PaymentMethodInfo */ public function getPaymentMethodInfo() @@ -220,6 +247,7 @@ public function getPaymentMethodInfo() } /** + * @return null|PaymentStatus */ public function getPaymentStatus() @@ -230,6 +258,7 @@ public function getPaymentStatus() /** *

    A list of financial transactions of different TransactionTypes with different TransactionStates.

    * + * @return null|TransactionCollection */ public function getTransactions() @@ -243,6 +272,7 @@ public function getTransactions() * If so, the interactionId in the Transaction should be set to match the ID of the PSP for the interaction. * Interactions are managed by the PSP integration and are usually neither written nor read by the user facing frontends or other services.

    * + * @return null|CustomFieldsCollection */ public function getInterfaceInteractions() @@ -251,6 +281,7 @@ public function getInterfaceInteractions() } /** + * @return null|CustomFields */ public function getCustom() @@ -261,6 +292,7 @@ public function getCustom() /** *

    User-defined unique identifier of the Payment.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentChangeAmountPlannedAction.php b/lib/commercetools-api/src/Models/Payment/PaymentChangeAmountPlannedAction.php index ae3f7dc88d8..410aa3d197d 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentChangeAmountPlannedAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentChangeAmountPlannedAction.php @@ -17,6 +17,7 @@ interface PaymentChangeAmountPlannedAction extends PaymentUpdateAction public const FIELD_AMOUNT = 'amount'; /** + * @return null|Money */ public function getAmount(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentChangeAmountPlannedActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentChangeAmountPlannedActionBuilder.php index 7ce00cacbb7..5e39e28b51a 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentChangeAmountPlannedActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentChangeAmountPlannedActionBuilder.php @@ -23,11 +23,13 @@ final class PaymentChangeAmountPlannedActionBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $amount; /** + * @return null|Money */ public function getAmount() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentChangeAmountPlannedActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentChangeAmountPlannedActionModel.php index f5a19628dc4..03a7c6dcffc 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentChangeAmountPlannedActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentChangeAmountPlannedActionModel.php @@ -23,11 +23,13 @@ final class PaymentChangeAmountPlannedActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'changeAmountPlanned'; /** + * * @var ?string */ protected $action; /** + * * @var ?Money */ protected $amount; @@ -37,13 +39,15 @@ final class PaymentChangeAmountPlannedActionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?Money $amount = null + ?Money $amount = null, + ?string $action = null ) { $this->amount = $amount; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|Money */ public function getAmount() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionInteractionIdAction.php b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionInteractionIdAction.php index 17cec30fc44..8736a90bf62 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionInteractionIdAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionInteractionIdAction.php @@ -17,11 +17,13 @@ interface PaymentChangeTransactionInteractionIdAction extends PaymentUpdateActio public const FIELD_INTERACTION_ID = 'interactionId'; /** + * @return null|string */ public function getTransactionId(); /** + * @return null|string */ public function getInteractionId(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionInteractionIdActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionInteractionIdActionBuilder.php index 8619caeb644..e7ceabfff2a 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionInteractionIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionInteractionIdActionBuilder.php @@ -21,16 +21,19 @@ final class PaymentChangeTransactionInteractionIdActionBuilder implements Builder { /** + * @var ?string */ private $transactionId; /** + * @var ?string */ private $interactionId; /** + * @return null|string */ public function getTransactionId() @@ -39,6 +42,7 @@ public function getTransactionId() } /** + * @return null|string */ public function getInteractionId() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionInteractionIdActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionInteractionIdActionModel.php index cb1adeeb416..c202057b4f7 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionInteractionIdActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionInteractionIdActionModel.php @@ -21,16 +21,19 @@ final class PaymentChangeTransactionInteractionIdActionModel extends JsonObjectM { public const DISCRIMINATOR_VALUE = 'changeTransactionInteractionId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $transactionId; /** + * * @var ?string */ protected $interactionId; @@ -41,14 +44,16 @@ final class PaymentChangeTransactionInteractionIdActionModel extends JsonObjectM */ public function __construct( ?string $transactionId = null, - ?string $interactionId = null + ?string $interactionId = null, + ?string $action = null ) { $this->transactionId = $transactionId; $this->interactionId = $interactionId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getTransactionId() @@ -83,6 +89,7 @@ public function getTransactionId() } /** + * * @return null|string */ public function getInteractionId() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionStateAction.php b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionStateAction.php index e0f96834758..e6effbccba4 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionStateAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionStateAction.php @@ -17,11 +17,13 @@ interface PaymentChangeTransactionStateAction extends PaymentUpdateAction public const FIELD_STATE = 'state'; /** + * @return null|string */ public function getTransactionId(); /** + * @return null|string */ public function getState(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionStateActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionStateActionBuilder.php index e796f4e8e6a..1fc1080c9b3 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionStateActionBuilder.php @@ -21,16 +21,19 @@ final class PaymentChangeTransactionStateActionBuilder implements Builder { /** + * @var ?string */ private $transactionId; /** + * @var ?string */ private $state; /** + * @return null|string */ public function getTransactionId() @@ -39,6 +42,7 @@ public function getTransactionId() } /** + * @return null|string */ public function getState() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionStateActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionStateActionModel.php index 525cc01a219..5d5ed0d880f 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionStateActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionStateActionModel.php @@ -21,16 +21,19 @@ final class PaymentChangeTransactionStateActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'changeTransactionState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $transactionId; /** + * * @var ?string */ protected $state; @@ -41,14 +44,16 @@ final class PaymentChangeTransactionStateActionModel extends JsonObjectModel imp */ public function __construct( ?string $transactionId = null, - ?string $state = null + ?string $state = null, + ?string $action = null ) { $this->transactionId = $transactionId; $this->state = $state; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getTransactionId() @@ -83,6 +89,7 @@ public function getTransactionId() } /** + * * @return null|string */ public function getState() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionTimestampAction.php b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionTimestampAction.php index 58be7b5ec86..9e8d3a970d9 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionTimestampAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionTimestampAction.php @@ -18,11 +18,13 @@ interface PaymentChangeTransactionTimestampAction extends PaymentUpdateAction public const FIELD_TIMESTAMP = 'timestamp'; /** + * @return null|string */ public function getTransactionId(); /** + * @return null|DateTimeImmutable */ public function getTimestamp(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionTimestampActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionTimestampActionBuilder.php index ec89103ec82..23c7a87b375 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionTimestampActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionTimestampActionBuilder.php @@ -22,16 +22,19 @@ final class PaymentChangeTransactionTimestampActionBuilder implements Builder { /** + * @var ?string */ private $transactionId; /** + * @var ?DateTimeImmutable */ private $timestamp; /** + * @return null|string */ public function getTransactionId() @@ -40,6 +43,7 @@ public function getTransactionId() } /** + * @return null|DateTimeImmutable */ public function getTimestamp() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionTimestampActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionTimestampActionModel.php index 8100a89b673..f798314c200 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionTimestampActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentChangeTransactionTimestampActionModel.php @@ -22,16 +22,19 @@ final class PaymentChangeTransactionTimestampActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'changeTransactionTimestamp'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $transactionId; /** + * * @var ?DateTimeImmutable */ protected $timestamp; @@ -42,14 +45,16 @@ final class PaymentChangeTransactionTimestampActionModel extends JsonObjectModel */ public function __construct( ?string $transactionId = null, - ?DateTimeImmutable $timestamp = null + ?DateTimeImmutable $timestamp = null, + ?string $action = null ) { $this->transactionId = $transactionId; $this->timestamp = $timestamp; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -67,6 +72,7 @@ public function getAction() } /** + * * @return null|string */ public function getTransactionId() @@ -84,6 +90,7 @@ public function getTransactionId() } /** + * * @return null|DateTimeImmutable */ public function getTimestamp() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentDraft.php b/lib/commercetools-api/src/Models/Payment/PaymentDraft.php index cb28bc1abf2..183f51a8c9f 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentDraft.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentDraft.php @@ -36,6 +36,7 @@ interface PaymentDraft extends JsonObject /** *

    A reference to the customer this payment belongs to.

    * + * @return null|CustomerResourceIdentifier */ public function getCustomer(); @@ -43,11 +44,13 @@ public function getCustomer(); /** *

    Identifies payments belonging to an anonymous session (the customer has not signed up/in yet).

    * + * @return null|string */ public function getAnonymousId(); /** + * @deprecated * @return null|string */ public function getExternalId(); @@ -57,6 +60,7 @@ public function getExternalId(); * Cannot be changed once it has been set. * The combination of this ID and the PaymentMethodInfo paymentInterface must be unique.

    * + * @return null|string */ public function getInterfaceId(); @@ -65,6 +69,7 @@ public function getInterfaceId(); *

    How much money this payment intends to receive from the customer. * The value usually matches the cart or order gross total.

    * + * @return null|Money */ public function getAmountPlanned(); @@ -73,11 +78,13 @@ public function getAmountPlanned(); *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getAmountAuthorized(); /** + * @return null|string */ public function getAuthorizedUntil(); @@ -86,6 +93,7 @@ public function getAuthorizedUntil(); *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getAmountPaid(); @@ -94,16 +102,19 @@ public function getAmountPaid(); *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getAmountRefunded(); /** + * @return null|PaymentMethodInfo */ public function getPaymentMethodInfo(); /** + * @return null|PaymentStatusDraft */ public function getPaymentStatus(); @@ -111,6 +122,7 @@ public function getPaymentStatus(); /** *

    A list of financial transactions of different TransactionTypes with different TransactionStates.

    * + * @return null|TransactionDraftCollection */ public function getTransactions(); @@ -121,11 +133,13 @@ public function getTransactions(); * If so, the interactionId in the Transaction should be set to match the ID of the PSP for the interaction. * Interactions are managed by the PSP integration and are usually neither written nor read by the user facing frontends or other services.

    * + * @return null|CustomFieldsDraftCollection */ public function getInterfaceInteractions(); /** + * @return null|CustomFieldsDraft */ public function getCustom(); @@ -133,6 +147,7 @@ public function getCustom(); /** *

    User-defined unique identifier for the Payment.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentDraftBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentDraftBuilder.php index 83f26bf8e1b..2df541eea07 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentDraftBuilder.php @@ -28,76 +28,91 @@ final class PaymentDraftBuilder implements Builder { /** + * @var null|CustomerResourceIdentifier|CustomerResourceIdentifierBuilder */ private $customer; /** + * @var ?string */ private $anonymousId; /** + * @deprecated * @var ?string */ private $externalId; /** + * @var ?string */ private $interfaceId; /** + * @var null|Money|MoneyBuilder */ private $amountPlanned; /** + * @var null|Money|MoneyBuilder */ private $amountAuthorized; /** + * @var ?string */ private $authorizedUntil; /** + * @var null|Money|MoneyBuilder */ private $amountPaid; /** + * @var null|Money|MoneyBuilder */ private $amountRefunded; /** + * @var null|PaymentMethodInfo|PaymentMethodInfoBuilder */ private $paymentMethodInfo; /** + * @var null|PaymentStatusDraft|PaymentStatusDraftBuilder */ private $paymentStatus; /** + * @var ?TransactionDraftCollection */ private $transactions; /** + * @var ?CustomFieldsDraftCollection */ private $interfaceInteractions; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var ?string */ private $key; @@ -105,6 +120,7 @@ final class PaymentDraftBuilder implements Builder /** *

    A reference to the customer this payment belongs to.

    * + * @return null|CustomerResourceIdentifier */ public function getCustomer() @@ -115,6 +131,7 @@ public function getCustomer() /** *

    Identifies payments belonging to an anonymous session (the customer has not signed up/in yet).

    * + * @return null|string */ public function getAnonymousId() @@ -123,6 +140,7 @@ public function getAnonymousId() } /** + * @deprecated * @return null|string */ public function getExternalId() @@ -135,6 +153,7 @@ public function getExternalId() * Cannot be changed once it has been set. * The combination of this ID and the PaymentMethodInfo paymentInterface must be unique.

    * + * @return null|string */ public function getInterfaceId() @@ -146,6 +165,7 @@ public function getInterfaceId() *

    How much money this payment intends to receive from the customer. * The value usually matches the cart or order gross total.

    * + * @return null|Money */ public function getAmountPlanned() @@ -157,6 +177,7 @@ public function getAmountPlanned() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getAmountAuthorized() @@ -165,6 +186,7 @@ public function getAmountAuthorized() } /** + * @return null|string */ public function getAuthorizedUntil() @@ -176,6 +198,7 @@ public function getAuthorizedUntil() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getAmountPaid() @@ -187,6 +210,7 @@ public function getAmountPaid() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * @return null|Money */ public function getAmountRefunded() @@ -195,6 +219,7 @@ public function getAmountRefunded() } /** + * @return null|PaymentMethodInfo */ public function getPaymentMethodInfo() @@ -203,6 +228,7 @@ public function getPaymentMethodInfo() } /** + * @return null|PaymentStatusDraft */ public function getPaymentStatus() @@ -213,6 +239,7 @@ public function getPaymentStatus() /** *

    A list of financial transactions of different TransactionTypes with different TransactionStates.

    * + * @return null|TransactionDraftCollection */ public function getTransactions() @@ -226,6 +253,7 @@ public function getTransactions() * If so, the interactionId in the Transaction should be set to match the ID of the PSP for the interaction. * Interactions are managed by the PSP integration and are usually neither written nor read by the user facing frontends or other services.

    * + * @return null|CustomFieldsDraftCollection */ public function getInterfaceInteractions() @@ -234,6 +262,7 @@ public function getInterfaceInteractions() } /** + * @return null|CustomFieldsDraft */ public function getCustom() @@ -244,6 +273,7 @@ public function getCustom() /** *

    User-defined unique identifier for the Payment.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentDraftModel.php b/lib/commercetools-api/src/Models/Payment/PaymentDraftModel.php index 75f78494082..81fc0768d1e 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentDraftModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentDraftModel.php @@ -27,76 +27,91 @@ final class PaymentDraftModel extends JsonObjectModel implements PaymentDraft { /** + * * @var ?CustomerResourceIdentifier */ protected $customer; /** + * * @var ?string */ protected $anonymousId; /** + * @deprecated * @var ?string */ protected $externalId; /** + * * @var ?string */ protected $interfaceId; /** + * * @var ?Money */ protected $amountPlanned; /** + * * @var ?Money */ protected $amountAuthorized; /** + * * @var ?string */ protected $authorizedUntil; /** + * * @var ?Money */ protected $amountPaid; /** + * * @var ?Money */ protected $amountRefunded; /** + * * @var ?PaymentMethodInfo */ protected $paymentMethodInfo; /** + * * @var ?PaymentStatusDraft */ protected $paymentStatus; /** + * * @var ?TransactionDraftCollection */ protected $transactions; /** + * * @var ?CustomFieldsDraftCollection */ protected $interfaceInteractions; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?string */ protected $key; @@ -142,6 +157,7 @@ public function __construct( /** *

    A reference to the customer this payment belongs to.

    * + * * @return null|CustomerResourceIdentifier */ public function getCustomer() @@ -162,6 +178,7 @@ public function getCustomer() /** *

    Identifies payments belonging to an anonymous session (the customer has not signed up/in yet).

    * + * * @return null|string */ public function getAnonymousId() @@ -179,6 +196,7 @@ public function getAnonymousId() } /** + * @deprecated * @return null|string */ public function getExternalId() @@ -200,6 +218,7 @@ public function getExternalId() * Cannot be changed once it has been set. * The combination of this ID and the PaymentMethodInfo paymentInterface must be unique.

    * + * * @return null|string */ public function getInterfaceId() @@ -220,6 +239,7 @@ public function getInterfaceId() *

    How much money this payment intends to receive from the customer. * The value usually matches the cart or order gross total.

    * + * * @return null|Money */ public function getAmountPlanned() @@ -241,6 +261,7 @@ public function getAmountPlanned() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * * @return null|Money */ public function getAmountAuthorized() @@ -259,6 +280,7 @@ public function getAmountAuthorized() } /** + * * @return null|string */ public function getAuthorizedUntil() @@ -279,6 +301,7 @@ public function getAuthorizedUntil() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * * @return null|Money */ public function getAmountPaid() @@ -300,6 +323,7 @@ public function getAmountPaid() *

    Draft type that stores amounts in cent precision for the specified currency.

    *

    For storing money values in fractions of the minor unit in a currency, use HighPrecisionMoneyDraft instead.

    * + * * @return null|Money */ public function getAmountRefunded() @@ -318,6 +342,7 @@ public function getAmountRefunded() } /** + * * @return null|PaymentMethodInfo */ public function getPaymentMethodInfo() @@ -336,6 +361,7 @@ public function getPaymentMethodInfo() } /** + * * @return null|PaymentStatusDraft */ public function getPaymentStatus() @@ -356,6 +382,7 @@ public function getPaymentStatus() /** *

    A list of financial transactions of different TransactionTypes with different TransactionStates.

    * + * * @return null|TransactionDraftCollection */ public function getTransactions() @@ -378,6 +405,7 @@ public function getTransactions() * If so, the interactionId in the Transaction should be set to match the ID of the PSP for the interaction. * Interactions are managed by the PSP integration and are usually neither written nor read by the user facing frontends or other services.

    * + * * @return null|CustomFieldsDraftCollection */ public function getInterfaceInteractions() @@ -395,6 +423,7 @@ public function getInterfaceInteractions() } /** + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -415,6 +444,7 @@ public function getCustom() /** *

    User-defined unique identifier for the Payment.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentMethodInfo.php b/lib/commercetools-api/src/Models/Payment/PaymentMethodInfo.php index 5dc0ce7bd4c..88a26928e5a 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentMethodInfo.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentMethodInfo.php @@ -23,6 +23,7 @@ interface PaymentMethodInfo extends JsonObject * Cannot be changed once it has been set. * The combination of PaymentinterfaceId and this field must be unique.

    * + * @return null|string */ public function getPaymentInterface(); @@ -32,6 +33,7 @@ public function getPaymentInterface(); * e.g. * a conventional string representing Credit Card, Cash Advance etc.

    * + * @return null|string */ public function getMethod(); @@ -40,6 +42,7 @@ public function getMethod(); *

    A human-readable, localized name for the payment method, e.g. * 'Credit Card'.

    * + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentMethodInfoBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentMethodInfoBuilder.php index 15377c9ddc4..3237c713d03 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentMethodInfoBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentMethodInfoBuilder.php @@ -23,16 +23,19 @@ final class PaymentMethodInfoBuilder implements Builder { /** + * @var ?string */ private $paymentInterface; /** + * @var ?string */ private $method; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; @@ -42,6 +45,7 @@ final class PaymentMethodInfoBuilder implements Builder * Cannot be changed once it has been set. * The combination of PaymentinterfaceId and this field must be unique.

    * + * @return null|string */ public function getPaymentInterface() @@ -54,6 +58,7 @@ public function getPaymentInterface() * e.g. * a conventional string representing Credit Card, Cash Advance etc.

    * + * @return null|string */ public function getMethod() @@ -65,6 +70,7 @@ public function getMethod() *

    A human-readable, localized name for the payment method, e.g. * 'Credit Card'.

    * + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentMethodInfoModel.php b/lib/commercetools-api/src/Models/Payment/PaymentMethodInfoModel.php index c8ffefdd98d..91a7c909e88 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentMethodInfoModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentMethodInfoModel.php @@ -22,16 +22,19 @@ final class PaymentMethodInfoModel extends JsonObjectModel implements PaymentMethodInfo { /** + * * @var ?string */ protected $paymentInterface; /** + * * @var ?string */ protected $method; /** + * * @var ?LocalizedString */ protected $name; @@ -55,6 +58,7 @@ public function __construct( * Cannot be changed once it has been set. * The combination of PaymentinterfaceId and this field must be unique.

    * + * * @return null|string */ public function getPaymentInterface() @@ -76,6 +80,7 @@ public function getPaymentInterface() * e.g. * a conventional string representing Credit Card, Cash Advance etc.

    * + * * @return null|string */ public function getMethod() @@ -96,6 +101,7 @@ public function getMethod() *

    A human-readable, localized name for the payment method, e.g. * 'Credit Card'.

    * + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentModel.php b/lib/commercetools-api/src/Models/Payment/PaymentModel.php index 72300e2ae82..65f5ff54b17 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentModel.php @@ -34,106 +34,127 @@ final class PaymentModel extends JsonObjectModel implements Payment { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?CustomerReference */ protected $customer; /** + * * @var ?string */ protected $anonymousId; /** + * * @var ?string */ protected $externalId; /** + * * @var ?string */ protected $interfaceId; /** + * * @var ?TypedMoney */ protected $amountPlanned; /** + * * @var ?TypedMoney */ protected $amountAuthorized; /** + * * @var ?string */ protected $authorizedUntil; /** + * * @var ?TypedMoney */ protected $amountPaid; /** + * * @var ?TypedMoney */ protected $amountRefunded; /** + * * @var ?PaymentMethodInfo */ protected $paymentMethodInfo; /** + * * @var ?PaymentStatus */ protected $paymentStatus; /** + * * @var ?TransactionCollection */ protected $transactions; /** + * * @var ?CustomFieldsCollection */ protected $interfaceInteractions; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?string */ protected $key; @@ -181,6 +202,7 @@ public function __construct( /** *

    Unique identifier of the Payment.

    * + * * @return null|string */ public function getId() @@ -198,6 +220,7 @@ public function getId() } /** + * * @return null|int */ public function getVersion() @@ -215,6 +238,7 @@ public function getVersion() } /** + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -236,6 +260,7 @@ public function getCreatedAt() } /** + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -259,6 +284,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -279,6 +305,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -299,6 +326,7 @@ public function getCreatedBy() /** *

    A reference to the customer this payment belongs to.

    * + * * @return null|CustomerReference */ public function getCustomer() @@ -319,6 +347,7 @@ public function getCustomer() /** *

    Identifies payments belonging to an anonymous session (the customer has not signed up/in yet).

    * + * * @return null|string */ public function getAnonymousId() @@ -340,6 +369,7 @@ public function getAnonymousId() * Cannot be changed once it has been set. * The combination of this ID and the PaymentMethodInfo paymentInterface must be unique.

    * + * * @return null|string */ public function getInterfaceId() @@ -360,6 +390,7 @@ public function getInterfaceId() *

    How much money this payment intends to receive from the customer. * The value usually matches the cart or order gross total.

    * + * * @return null|TypedMoney */ public function getAmountPlanned() @@ -378,6 +409,7 @@ public function getAmountPlanned() } /** + * * @return null|PaymentMethodInfo */ public function getPaymentMethodInfo() @@ -396,6 +428,7 @@ public function getPaymentMethodInfo() } /** + * * @return null|PaymentStatus */ public function getPaymentStatus() @@ -416,6 +449,7 @@ public function getPaymentStatus() /** *

    A list of financial transactions of different TransactionTypes with different TransactionStates.

    * + * * @return null|TransactionCollection */ public function getTransactions() @@ -438,6 +472,7 @@ public function getTransactions() * If so, the interactionId in the Transaction should be set to match the ID of the PSP for the interaction. * Interactions are managed by the PSP integration and are usually neither written nor read by the user facing frontends or other services.

    * + * * @return null|CustomFieldsCollection */ public function getInterfaceInteractions() @@ -455,6 +490,7 @@ public function getInterfaceInteractions() } /** + * * @return null|CustomFields */ public function getCustom() @@ -475,6 +511,7 @@ public function getCustom() /** *

    User-defined unique identifier of the Payment.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentPagedQueryResponse.php b/lib/commercetools-api/src/Models/Payment/PaymentPagedQueryResponse.php index 46b4e1db4ff..200fe497143 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentPagedQueryResponse.php @@ -22,16 +22,19 @@ interface PaymentPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); /** + * @return null|int */ public function getCount(); /** + * @return null|int */ public function getTotal(); @@ -39,11 +42,13 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); /** + * @return null|PaymentCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentPagedQueryResponseBuilder.php index 17197d5dbd8..74c0897dc6f 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class PaymentPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?PaymentCollection */ private $results; @@ -48,6 +53,7 @@ final class PaymentPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -56,6 +62,7 @@ public function getLimit() } /** + * @return null|int */ public function getCount() @@ -64,6 +71,7 @@ public function getCount() } /** + * @return null|int */ public function getTotal() @@ -74,6 +82,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -82,6 +91,7 @@ public function getOffset() } /** + * @return null|PaymentCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Payment/PaymentPagedQueryResponseModel.php index c8246d52691..e9868abf517 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class PaymentPagedQueryResponseModel extends JsonObjectModel implements PaymentPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?PaymentCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -82,6 +88,7 @@ public function getLimit() } /** + * * @return null|int */ public function getCount() @@ -99,6 +106,7 @@ public function getCount() } /** + * * @return null|int */ public function getTotal() @@ -118,6 +126,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -135,6 +144,7 @@ public function getOffset() } /** + * * @return null|PaymentCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentReference.php b/lib/commercetools-api/src/Models/Payment/PaymentReference.php index d6956e2bf22..b44fe030e37 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentReference.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentReference.php @@ -19,6 +19,7 @@ interface PaymentReference extends Reference /** *

    Contains the representation of the expanded Payment. Only present in responses to requests with Reference Expansion for Payments.

    * + * @return null|Payment */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

    Unique identifier of the referenced Payment.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentReferenceBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentReferenceBuilder.php index d3e0379e037..8e6e4d2e190 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentReferenceBuilder.php @@ -23,11 +23,13 @@ final class PaymentReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|Payment|PaymentBuilder */ private $obj; @@ -35,6 +37,7 @@ final class PaymentReferenceBuilder implements Builder /** *

    Unique identifier of the referenced Payment.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded Payment. Only present in responses to requests with Reference Expansion for Payments.

    * + * @return null|Payment */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentReferenceModel.php b/lib/commercetools-api/src/Models/Payment/PaymentReferenceModel.php index e904021d10f..cf3e5c636cb 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentReferenceModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentReferenceModel.php @@ -23,16 +23,19 @@ final class PaymentReferenceModel extends JsonObjectModel implements PaymentRefe { public const DISCRIMINATOR_VALUE = 'payment'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?Payment */ protected $obj; @@ -43,16 +46,18 @@ final class PaymentReferenceModel extends JsonObjectModel implements PaymentRefe */ public function __construct( ?string $id = null, - ?Payment $obj = null + ?Payment $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced Payment.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded Payment. Only present in responses to requests with Reference Expansion for Payments.

    * + * * @return null|Payment */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentResourceIdentifier.php b/lib/commercetools-api/src/Models/Payment/PaymentResourceIdentifier.php index ae638d78530..e528eb5fa4f 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentResourceIdentifier.php @@ -17,6 +17,7 @@ interface PaymentResourceIdentifier extends ResourceIdentifier /** *

    Unique identifier of the referenced Payment. Either id or key is required.

    * + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

    User-defined unique identifier of the referenced Payment. Either id or key is required.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentResourceIdentifierBuilder.php index 0d32b4b104f..c37a99b9a98 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class PaymentResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class PaymentResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced Payment. Either id or key is required.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced Payment. Either id or key is required.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentResourceIdentifierModel.php b/lib/commercetools-api/src/Models/Payment/PaymentResourceIdentifierModel.php index 770d18d97ba..1d0e4a79937 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class PaymentResourceIdentifierModel extends JsonObjectModel implements Pa { public const DISCRIMINATOR_VALUE = 'payment'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class PaymentResourceIdentifierModel extends JsonObjectModel implements Pa */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced Payment. Either id or key is required.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced Payment. Either id or key is required.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetAnonymousIdAction.php b/lib/commercetools-api/src/Models/Payment/PaymentSetAnonymousIdAction.php index a1f7eb23e5b..dec4cc24ba9 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetAnonymousIdAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetAnonymousIdAction.php @@ -19,6 +19,7 @@ interface PaymentSetAnonymousIdAction extends PaymentUpdateAction *

    Anonymous ID of the anonymous customer that this payment belongs to. * If this field is not set any existing anonymousId is removed.

    * + * @return null|string */ public function getAnonymousId(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetAnonymousIdActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentSetAnonymousIdActionBuilder.php index d8de9f33ed3..7b3e0459fe2 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetAnonymousIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetAnonymousIdActionBuilder.php @@ -21,6 +21,7 @@ final class PaymentSetAnonymousIdActionBuilder implements Builder { /** + * @var ?string */ private $anonymousId; @@ -29,6 +30,7 @@ final class PaymentSetAnonymousIdActionBuilder implements Builder *

    Anonymous ID of the anonymous customer that this payment belongs to. * If this field is not set any existing anonymousId is removed.

    * + * @return null|string */ public function getAnonymousId() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetAnonymousIdActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentSetAnonymousIdActionModel.php index 93bbfd4941d..23883f7e0d1 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetAnonymousIdActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetAnonymousIdActionModel.php @@ -21,11 +21,13 @@ final class PaymentSetAnonymousIdActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setAnonymousId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $anonymousId; @@ -35,13 +37,15 @@ final class PaymentSetAnonymousIdActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $anonymousId = null + ?string $anonymousId = null, + ?string $action = null ) { $this->anonymousId = $anonymousId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() *

    Anonymous ID of the anonymous customer that this payment belongs to. * If this field is not set any existing anonymousId is removed.

    * + * * @return null|string */ public function getAnonymousId() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomFieldAction.php b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomFieldAction.php index 21099df666e..4968a42bc11 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface PaymentSetCustomFieldAction extends PaymentUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomFieldActionBuilder.php index 9a80d01bbf3..61391f06eda 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class PaymentSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class PaymentSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomFieldActionModel.php index 83b8aa15225..418c1660462 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class PaymentSetCustomFieldActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class PaymentSetCustomFieldActionModel extends JsonObjectModel implements */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomTypeAction.php b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomTypeAction.php index 49eb2a8ffd4..c8b85bfb347 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface PaymentSetCustomTypeAction extends PaymentUpdateAction *

    Defines the Type that extends the Payment with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Payment.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the Payment.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomTypeActionBuilder.php index be81e0a463d..c190e040173 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class PaymentSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class PaymentSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the Payment with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Payment.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Payment.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomTypeActionModel.php index 459baa4b765..d5f4c921691 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class PaymentSetCustomTypeActionModel extends JsonObjectModel implements P { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class PaymentSetCustomTypeActionModel extends JsonObjectModel implements P */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the Payment with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Payment.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Payment.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomerAction.php b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomerAction.php index c972c356a81..2675a02ad61 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomerAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomerAction.php @@ -19,6 +19,7 @@ interface PaymentSetCustomerAction extends PaymentUpdateAction /** *

    A reference to the customer this payment belongs to.

    * + * @return null|CustomerResourceIdentifier */ public function getCustomer(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomerActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomerActionBuilder.php index 9946a144f92..9208dc208c4 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomerActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomerActionBuilder.php @@ -23,6 +23,7 @@ final class PaymentSetCustomerActionBuilder implements Builder { /** + * @var null|CustomerResourceIdentifier|CustomerResourceIdentifierBuilder */ private $customer; @@ -30,6 +31,7 @@ final class PaymentSetCustomerActionBuilder implements Builder /** *

    A reference to the customer this payment belongs to.

    * + * @return null|CustomerResourceIdentifier */ public function getCustomer() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomerActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomerActionModel.php index 482bbdfe78d..583b498ce72 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetCustomerActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetCustomerActionModel.php @@ -23,11 +23,13 @@ final class PaymentSetCustomerActionModel extends JsonObjectModel implements Pay { public const DISCRIMINATOR_VALUE = 'setCustomer'; /** + * * @var ?string */ protected $action; /** + * * @var ?CustomerResourceIdentifier */ protected $customer; @@ -37,13 +39,15 @@ final class PaymentSetCustomerActionModel extends JsonObjectModel implements Pay * @psalm-suppress MissingParamType */ public function __construct( - ?CustomerResourceIdentifier $customer = null + ?CustomerResourceIdentifier $customer = null, + ?string $action = null ) { $this->customer = $customer; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    A reference to the customer this payment belongs to.

    * + * * @return null|CustomerResourceIdentifier */ public function getCustomer() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetInterfaceIdAction.php b/lib/commercetools-api/src/Models/Payment/PaymentSetInterfaceIdAction.php index 9a51e0cb855..1492ec02b8c 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetInterfaceIdAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetInterfaceIdAction.php @@ -16,6 +16,7 @@ interface PaymentSetInterfaceIdAction extends PaymentUpdateAction public const FIELD_INTERFACE_ID = 'interfaceId'; /** + * @return null|string */ public function getInterfaceId(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetInterfaceIdActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentSetInterfaceIdActionBuilder.php index eb705fa44f4..7e13da22600 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetInterfaceIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetInterfaceIdActionBuilder.php @@ -21,11 +21,13 @@ final class PaymentSetInterfaceIdActionBuilder implements Builder { /** + * @var ?string */ private $interfaceId; /** + * @return null|string */ public function getInterfaceId() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetInterfaceIdActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentSetInterfaceIdActionModel.php index 5be4c00bd14..017c49b98e4 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetInterfaceIdActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetInterfaceIdActionModel.php @@ -21,11 +21,13 @@ final class PaymentSetInterfaceIdActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setInterfaceId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $interfaceId; @@ -35,13 +37,15 @@ final class PaymentSetInterfaceIdActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $interfaceId = null + ?string $interfaceId = null, + ?string $action = null ) { $this->interfaceId = $interfaceId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getInterfaceId() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetKeyAction.php b/lib/commercetools-api/src/Models/Payment/PaymentSetKeyAction.php index 5b303b2dec1..fc53f6ab8ee 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetKeyAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetKeyAction.php @@ -20,6 +20,7 @@ interface PaymentSetKeyAction extends PaymentUpdateAction * 256 characters). * If not provided an existing key will be removed.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentSetKeyActionBuilder.php index 7cea5dedaf0..a749983d90d 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetKeyActionBuilder.php @@ -21,6 +21,7 @@ final class PaymentSetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; @@ -30,6 +31,7 @@ final class PaymentSetKeyActionBuilder implements Builder * 256 characters). * If not provided an existing key will be removed.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetKeyActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentSetKeyActionModel.php index ff2a6f02bac..32245065194 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetKeyActionModel.php @@ -21,11 +21,13 @@ final class PaymentSetKeyActionModel extends JsonObjectModel implements PaymentS { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class PaymentSetKeyActionModel extends JsonObjectModel implements PaymentS * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() * 256 characters). * If not provided an existing key will be removed.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoInterfaceAction.php b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoInterfaceAction.php index 88b34d60549..0614063d4fd 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoInterfaceAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoInterfaceAction.php @@ -16,6 +16,7 @@ interface PaymentSetMethodInfoInterfaceAction extends PaymentUpdateAction public const FIELD_INTERFACE = 'interface'; /** + * @return null|string */ public function getInterface(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoInterfaceActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoInterfaceActionBuilder.php index c5bbd023562..af7d7f4136f 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoInterfaceActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoInterfaceActionBuilder.php @@ -21,11 +21,13 @@ final class PaymentSetMethodInfoInterfaceActionBuilder implements Builder { /** + * @var ?string */ private $interface; /** + * @return null|string */ public function getInterface() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoInterfaceActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoInterfaceActionModel.php index 61190d3067b..f09429c95d8 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoInterfaceActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoInterfaceActionModel.php @@ -21,11 +21,13 @@ final class PaymentSetMethodInfoInterfaceActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'setMethodInfoInterface'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $interface; @@ -35,13 +37,15 @@ final class PaymentSetMethodInfoInterfaceActionModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?string $interface = null + ?string $interface = null, + ?string $action = null ) { $this->interface = $interface; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getInterface() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoMethodAction.php b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoMethodAction.php index 1f9b0c7ced8..34b360c1e28 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoMethodAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoMethodAction.php @@ -18,6 +18,7 @@ interface PaymentSetMethodInfoMethodAction extends PaymentUpdateAction /** *

    If not provided, the method is unset.

    * + * @return null|string */ public function getMethod(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoMethodActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoMethodActionBuilder.php index 43ebba56b53..5116f1d4087 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoMethodActionBuilder.php @@ -21,6 +21,7 @@ final class PaymentSetMethodInfoMethodActionBuilder implements Builder { /** + * @var ?string */ private $method; @@ -28,6 +29,7 @@ final class PaymentSetMethodInfoMethodActionBuilder implements Builder /** *

    If not provided, the method is unset.

    * + * @return null|string */ public function getMethod() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoMethodActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoMethodActionModel.php index a223dff819c..fa0021db519 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoMethodActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoMethodActionModel.php @@ -21,11 +21,13 @@ final class PaymentSetMethodInfoMethodActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setMethodInfoMethod'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $method; @@ -35,13 +37,15 @@ final class PaymentSetMethodInfoMethodActionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?string $method = null + ?string $method = null, + ?string $action = null ) { $this->method = $method; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    If not provided, the method is unset.

    * + * * @return null|string */ public function getMethod() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoNameAction.php b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoNameAction.php index e88a6845663..ee69dd94895 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoNameAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoNameAction.php @@ -19,6 +19,7 @@ interface PaymentSetMethodInfoNameAction extends PaymentUpdateAction /** *

    If not provided, the name is unset.

    * + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoNameActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoNameActionBuilder.php index 43da5341d76..1b7acaa15a1 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoNameActionBuilder.php @@ -23,6 +23,7 @@ final class PaymentSetMethodInfoNameActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; @@ -30,6 +31,7 @@ final class PaymentSetMethodInfoNameActionBuilder implements Builder /** *

    If not provided, the name is unset.

    * + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoNameActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoNameActionModel.php index 4e53885e5d2..370fc4576cc 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoNameActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetMethodInfoNameActionModel.php @@ -23,11 +23,13 @@ final class PaymentSetMethodInfoNameActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'setMethodInfoName'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $name; @@ -37,13 +39,15 @@ final class PaymentSetMethodInfoNameActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    If not provided, the name is unset.

    * + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceCodeAction.php b/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceCodeAction.php index 55142a641ee..d775a055f35 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceCodeAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceCodeAction.php @@ -16,6 +16,7 @@ interface PaymentSetStatusInterfaceCodeAction extends PaymentUpdateAction public const FIELD_INTERFACE_CODE = 'interfaceCode'; /** + * @return null|string */ public function getInterfaceCode(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceCodeActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceCodeActionBuilder.php index 23d556b8743..7a79391bf2c 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceCodeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceCodeActionBuilder.php @@ -21,11 +21,13 @@ final class PaymentSetStatusInterfaceCodeActionBuilder implements Builder { /** + * @var ?string */ private $interfaceCode; /** + * @return null|string */ public function getInterfaceCode() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceCodeActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceCodeActionModel.php index b12f834da55..31cf61c8406 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceCodeActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceCodeActionModel.php @@ -21,11 +21,13 @@ final class PaymentSetStatusInterfaceCodeActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'setStatusInterfaceCode'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $interfaceCode; @@ -35,13 +37,15 @@ final class PaymentSetStatusInterfaceCodeActionModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?string $interfaceCode = null + ?string $interfaceCode = null, + ?string $action = null ) { $this->interfaceCode = $interfaceCode; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getInterfaceCode() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceTextAction.php b/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceTextAction.php index a8ae97f80db..3b7f3e25880 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceTextAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceTextAction.php @@ -16,6 +16,7 @@ interface PaymentSetStatusInterfaceTextAction extends PaymentUpdateAction public const FIELD_INTERFACE_TEXT = 'interfaceText'; /** + * @return null|string */ public function getInterfaceText(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceTextActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceTextActionBuilder.php index 016fd2edbbb..364d2ba1c15 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceTextActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceTextActionBuilder.php @@ -21,11 +21,13 @@ final class PaymentSetStatusInterfaceTextActionBuilder implements Builder { /** + * @var ?string */ private $interfaceText; /** + * @return null|string */ public function getInterfaceText() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceTextActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceTextActionModel.php index 07a256d20e2..39e01aeef65 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceTextActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetStatusInterfaceTextActionModel.php @@ -21,11 +21,13 @@ final class PaymentSetStatusInterfaceTextActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'setStatusInterfaceText'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $interfaceText; @@ -35,13 +37,15 @@ final class PaymentSetStatusInterfaceTextActionModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?string $interfaceText = null + ?string $interfaceText = null, + ?string $action = null ) { $this->interfaceText = $interfaceText; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getInterfaceText() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomFieldAction.php b/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomFieldAction.php index efd6f80ce4c..58bda59e1b9 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomFieldAction.php @@ -18,6 +18,7 @@ interface PaymentSetTransactionCustomFieldAction extends PaymentUpdateAction public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getTransactionId(); @@ -26,6 +27,7 @@ public function getTransactionId(); *

    description: | * Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -35,6 +37,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomFieldActionBuilder.php index b8ff5acc08a..a4c0a2901c4 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class PaymentSetTransactionCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $transactionId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getTransactionId() @@ -47,6 +51,7 @@ public function getTransactionId() *

    description: | * Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -59,6 +64,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomFieldActionModel.php index 8a2e7ce5e1c..7e3826735f4 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class PaymentSetTransactionCustomFieldActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setTransactionCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $transactionId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class PaymentSetTransactionCustomFieldActionModel extends JsonObjectModel public function __construct( ?string $transactionId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->transactionId = $transactionId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,7 @@ public function getAction() } /** + * * @return null|string */ public function getTransactionId() @@ -93,6 +100,7 @@ public function getTransactionId() *

    description: | * Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -114,6 +122,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomTypeAction.php b/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomTypeAction.php index 7c35471d663..a112ae927fc 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomTypeAction.php @@ -20,6 +20,7 @@ interface PaymentSetTransactionCustomTypeAction extends PaymentUpdateAction public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getTransactionId(); @@ -28,6 +29,7 @@ public function getTransactionId(); *

    Defines the Type that extends the Transaction with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Transaction.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -35,6 +37,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the Transaction.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomTypeActionBuilder.php index b8772ff3cfc..b0975c19186 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class PaymentSetTransactionCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $transactionId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getTransactionId() @@ -51,6 +55,7 @@ public function getTransactionId() *

    Defines the Type that extends the Transaction with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Transaction.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -61,6 +66,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Transaction.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomTypeActionModel.php index 87d22a1c6ea..2dd946ccf70 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentSetTransactionCustomTypeActionModel.php @@ -25,21 +25,25 @@ final class PaymentSetTransactionCustomTypeActionModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'setTransactionCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $transactionId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -51,15 +55,17 @@ final class PaymentSetTransactionCustomTypeActionModel extends JsonObjectModel i public function __construct( ?string $transactionId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->transactionId = $transactionId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getTransactionId() @@ -97,6 +104,7 @@ public function getTransactionId() *

    Defines the Type that extends the Transaction with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Transaction.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Transaction.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentStatus.php b/lib/commercetools-api/src/Models/Payment/PaymentStatus.php index a9f37f18248..2f90363cb80 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentStatus.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentStatus.php @@ -21,6 +21,7 @@ interface PaymentStatus extends JsonObject /** *

    A code describing the current status returned by the interface that processes the payment.

    * + * @return null|string */ public function getInterfaceCode(); @@ -28,11 +29,13 @@ public function getInterfaceCode(); /** *

    A text describing the current status returned by the interface that processes the payment.

    * + * @return null|string */ public function getInterfaceText(); /** + * @return null|StateReference */ public function getState(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentStatusBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentStatusBuilder.php index 897b0df3d2f..ba22613daab 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentStatusBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentStatusBuilder.php @@ -23,16 +23,19 @@ final class PaymentStatusBuilder implements Builder { /** + * @var ?string */ private $interfaceCode; /** + * @var ?string */ private $interfaceText; /** + * @var null|StateReference|StateReferenceBuilder */ private $state; @@ -40,6 +43,7 @@ final class PaymentStatusBuilder implements Builder /** *

    A code describing the current status returned by the interface that processes the payment.

    * + * @return null|string */ public function getInterfaceCode() @@ -50,6 +54,7 @@ public function getInterfaceCode() /** *

    A text describing the current status returned by the interface that processes the payment.

    * + * @return null|string */ public function getInterfaceText() @@ -58,6 +63,7 @@ public function getInterfaceText() } /** + * @return null|StateReference */ public function getState() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentStatusDraft.php b/lib/commercetools-api/src/Models/Payment/PaymentStatusDraft.php index 4943c1f9a21..4ecca4fd01c 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentStatusDraft.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentStatusDraft.php @@ -19,11 +19,13 @@ interface PaymentStatusDraft extends JsonObject public const FIELD_STATE = 'state'; /** + * @return null|string */ public function getInterfaceCode(); /** + * @return null|string */ public function getInterfaceText(); @@ -31,6 +33,7 @@ public function getInterfaceText(); /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getState(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentStatusDraftBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentStatusDraftBuilder.php index 5829767b50f..b34758d4123 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentStatusDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentStatusDraftBuilder.php @@ -23,21 +23,25 @@ final class PaymentStatusDraftBuilder implements Builder { /** + * @var ?string */ private $interfaceCode; /** + * @var ?string */ private $interfaceText; /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $state; /** + * @return null|string */ public function getInterfaceCode() @@ -46,6 +50,7 @@ public function getInterfaceCode() } /** + * @return null|string */ public function getInterfaceText() @@ -56,6 +61,7 @@ public function getInterfaceText() /** *

    ResourceIdentifier to a State.

    * + * @return null|StateResourceIdentifier */ public function getState() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentStatusDraftModel.php b/lib/commercetools-api/src/Models/Payment/PaymentStatusDraftModel.php index b732df58d06..5239cd2fecf 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentStatusDraftModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentStatusDraftModel.php @@ -22,16 +22,19 @@ final class PaymentStatusDraftModel extends JsonObjectModel implements PaymentStatusDraft { /** + * * @var ?string */ protected $interfaceCode; /** + * * @var ?string */ protected $interfaceText; /** + * * @var ?StateResourceIdentifier */ protected $state; @@ -51,6 +54,7 @@ public function __construct( } /** + * * @return null|string */ public function getInterfaceCode() @@ -68,6 +72,7 @@ public function getInterfaceCode() } /** + * * @return null|string */ public function getInterfaceText() @@ -87,6 +92,7 @@ public function getInterfaceText() /** *

    ResourceIdentifier to a State.

    * + * * @return null|StateResourceIdentifier */ public function getState() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentStatusModel.php b/lib/commercetools-api/src/Models/Payment/PaymentStatusModel.php index 0ee35914e09..6f1cc082a19 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentStatusModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentStatusModel.php @@ -22,16 +22,19 @@ final class PaymentStatusModel extends JsonObjectModel implements PaymentStatus { /** + * * @var ?string */ protected $interfaceCode; /** + * * @var ?string */ protected $interfaceText; /** + * * @var ?StateReference */ protected $state; @@ -53,6 +56,7 @@ public function __construct( /** *

    A code describing the current status returned by the interface that processes the payment.

    * + * * @return null|string */ public function getInterfaceCode() @@ -72,6 +76,7 @@ public function getInterfaceCode() /** *

    A text describing the current status returned by the interface that processes the payment.

    * + * * @return null|string */ public function getInterfaceText() @@ -89,6 +94,7 @@ public function getInterfaceText() } /** + * * @return null|StateReference */ public function getState() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentTransitionStateAction.php b/lib/commercetools-api/src/Models/Payment/PaymentTransitionStateAction.php index 305d3cc2ed9..fe5d56efcb1 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentTransitionStateAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentTransitionStateAction.php @@ -18,11 +18,13 @@ interface PaymentTransitionStateAction extends PaymentUpdateAction public const FIELD_FORCE = 'force'; /** + * @return null|StateResourceIdentifier */ public function getState(); /** + * @return null|bool */ public function getForce(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentTransitionStateActionBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentTransitionStateActionBuilder.php index 330de095723..a76d3fe0092 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentTransitionStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentTransitionStateActionBuilder.php @@ -23,16 +23,19 @@ final class PaymentTransitionStateActionBuilder implements Builder { /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $state; /** + * @var ?bool */ private $force; /** + * @return null|StateResourceIdentifier */ public function getState() @@ -41,6 +44,7 @@ public function getState() } /** + * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentTransitionStateActionModel.php b/lib/commercetools-api/src/Models/Payment/PaymentTransitionStateActionModel.php index f3f2f31d9ca..09d24158807 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentTransitionStateActionModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentTransitionStateActionModel.php @@ -23,16 +23,19 @@ final class PaymentTransitionStateActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'transitionState'; /** + * * @var ?string */ protected $action; /** + * * @var ?StateResourceIdentifier */ protected $state; /** + * * @var ?bool */ protected $force; @@ -43,14 +46,16 @@ final class PaymentTransitionStateActionModel extends JsonObjectModel implements */ public function __construct( ?StateResourceIdentifier $state = null, - ?bool $force = null + ?bool $force = null, + ?string $action = null ) { $this->state = $state; $this->force = $force; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|StateResourceIdentifier */ public function getState() @@ -86,6 +92,7 @@ public function getState() } /** + * * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentUpdate.php b/lib/commercetools-api/src/Models/Payment/PaymentUpdate.php index b062a0f0ee2..74ff52d5bcd 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentUpdate.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentUpdate.php @@ -17,11 +17,13 @@ interface PaymentUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + * @return null|int */ public function getVersion(); /** + * @return null|PaymentUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentUpdateAction.php b/lib/commercetools-api/src/Models/Payment/PaymentUpdateAction.php index 0ecb2a6af94..1eae75ef88e 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentUpdateAction.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentUpdateAction.php @@ -17,6 +17,7 @@ interface PaymentUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Payment/PaymentUpdateBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentUpdateBuilder.php index 3ca2e9ddeb9..fb5da77a37d 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentUpdateBuilder.php @@ -21,16 +21,19 @@ final class PaymentUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?PaymentUpdateActionCollection */ private $actions; /** + * @return null|int */ public function getVersion() @@ -39,6 +42,7 @@ public function getVersion() } /** + * @return null|PaymentUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Payment/PaymentUpdateModel.php b/lib/commercetools-api/src/Models/Payment/PaymentUpdateModel.php index e113edbc7d2..ba1ec835fe0 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentUpdateModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentUpdateModel.php @@ -20,11 +20,13 @@ final class PaymentUpdateModel extends JsonObjectModel implements PaymentUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?PaymentUpdateActionCollection */ protected $actions; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|int */ public function getVersion() @@ -59,6 +62,7 @@ public function getVersion() } /** + * * @return null|PaymentUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Payment/Transaction.php b/lib/commercetools-api/src/Models/Payment/Transaction.php index 14a141ada82..580d3e7c871 100644 --- a/lib/commercetools-api/src/Models/Payment/Transaction.php +++ b/lib/commercetools-api/src/Models/Payment/Transaction.php @@ -27,6 +27,7 @@ interface Transaction extends JsonObject /** *

    Unique identifier of the Transaction.

    * + * @return null|string */ public function getId(); @@ -34,6 +35,7 @@ public function getId(); /** *

    The time at which the transaction took place.

    * + * @return null|DateTimeImmutable */ public function getTimestamp(); @@ -41,11 +43,13 @@ public function getTimestamp(); /** *

    The type of this transaction.

    * + * @return null|string */ public function getType(); /** + * @return null|TypedMoney */ public function getAmount(); @@ -54,6 +58,7 @@ public function getAmount(); *

    The identifier that is used by the interface that managed the transaction (usually the PSP). * If a matching interaction was logged in the interfaceInteractions array, the corresponding interaction should be findable with this ID.

    * + * @return null|string */ public function getInteractionId(); @@ -61,6 +66,7 @@ public function getInteractionId(); /** *

    The state of this transaction.

    * + * @return null|string */ public function getState(); @@ -68,6 +74,7 @@ public function getState(); /** *

    Custom Fields for the Transaction.

    * + * @return null|CustomFields */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Payment/TransactionBuilder.php b/lib/commercetools-api/src/Models/Payment/TransactionBuilder.php index 4bbbd507749..9eeb0347611 100644 --- a/lib/commercetools-api/src/Models/Payment/TransactionBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/TransactionBuilder.php @@ -26,36 +26,43 @@ final class TransactionBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?DateTimeImmutable */ private $timestamp; /** + * @var ?string */ private $type; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $amount; /** + * @var ?string */ private $interactionId; /** + * @var ?string */ private $state; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; @@ -63,6 +70,7 @@ final class TransactionBuilder implements Builder /** *

    Unique identifier of the Transaction.

    * + * @return null|string */ public function getId() @@ -73,6 +81,7 @@ public function getId() /** *

    The time at which the transaction took place.

    * + * @return null|DateTimeImmutable */ public function getTimestamp() @@ -83,6 +92,7 @@ public function getTimestamp() /** *

    The type of this transaction.

    * + * @return null|string */ public function getType() @@ -91,6 +101,7 @@ public function getType() } /** + * @return null|TypedMoney */ public function getAmount() @@ -102,6 +113,7 @@ public function getAmount() *

    The identifier that is used by the interface that managed the transaction (usually the PSP). * If a matching interaction was logged in the interfaceInteractions array, the corresponding interaction should be findable with this ID.

    * + * @return null|string */ public function getInteractionId() @@ -112,6 +124,7 @@ public function getInteractionId() /** *

    The state of this transaction.

    * + * @return null|string */ public function getState() @@ -122,6 +135,7 @@ public function getState() /** *

    Custom Fields for the Transaction.

    * + * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Payment/TransactionDraft.php b/lib/commercetools-api/src/Models/Payment/TransactionDraft.php index 9ec0dbc7995..7fa79d95e94 100644 --- a/lib/commercetools-api/src/Models/Payment/TransactionDraft.php +++ b/lib/commercetools-api/src/Models/Payment/TransactionDraft.php @@ -26,6 +26,7 @@ interface TransactionDraft extends JsonObject /** *

    The time at which the transaction took place.

    * + * @return null|DateTimeImmutable */ public function getTimestamp(); @@ -33,11 +34,13 @@ public function getTimestamp(); /** *

    The type of this transaction.

    * + * @return null|string */ public function getType(); /** + * @return null|Money */ public function getAmount(); @@ -46,6 +49,7 @@ public function getAmount(); *

    The identifier that is used by the interface that managed the transaction (usually the PSP). * If a matching interaction was logged in the interfaceInteractions array, the corresponding interaction should be findable with this ID.

    * + * @return null|string */ public function getInteractionId(); @@ -54,6 +58,7 @@ public function getInteractionId(); *

    The state of this transaction. * If not set, defaults to Initial.

    * + * @return null|string */ public function getState(); @@ -61,6 +66,7 @@ public function getState(); /** *

    Custom Fields for the Transaction.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Payment/TransactionDraftBuilder.php b/lib/commercetools-api/src/Models/Payment/TransactionDraftBuilder.php index 91cfe16a220..abb764a3d33 100644 --- a/lib/commercetools-api/src/Models/Payment/TransactionDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/TransactionDraftBuilder.php @@ -26,31 +26,37 @@ final class TransactionDraftBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $timestamp; /** + * @var ?string */ private $type; /** + * @var null|Money|MoneyBuilder */ private $amount; /** + * @var ?string */ private $interactionId; /** + * @var ?string */ private $state; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; @@ -58,6 +64,7 @@ final class TransactionDraftBuilder implements Builder /** *

    The time at which the transaction took place.

    * + * @return null|DateTimeImmutable */ public function getTimestamp() @@ -68,6 +75,7 @@ public function getTimestamp() /** *

    The type of this transaction.

    * + * @return null|string */ public function getType() @@ -76,6 +84,7 @@ public function getType() } /** + * @return null|Money */ public function getAmount() @@ -87,6 +96,7 @@ public function getAmount() *

    The identifier that is used by the interface that managed the transaction (usually the PSP). * If a matching interaction was logged in the interfaceInteractions array, the corresponding interaction should be findable with this ID.

    * + * @return null|string */ public function getInteractionId() @@ -98,6 +108,7 @@ public function getInteractionId() *

    The state of this transaction. * If not set, defaults to Initial.

    * + * @return null|string */ public function getState() @@ -108,6 +119,7 @@ public function getState() /** *

    Custom Fields for the Transaction.

    * + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Payment/TransactionDraftModel.php b/lib/commercetools-api/src/Models/Payment/TransactionDraftModel.php index cd9f6fb94cb..9ecc553ecc4 100644 --- a/lib/commercetools-api/src/Models/Payment/TransactionDraftModel.php +++ b/lib/commercetools-api/src/Models/Payment/TransactionDraftModel.php @@ -25,31 +25,37 @@ final class TransactionDraftModel extends JsonObjectModel implements TransactionDraft { /** + * * @var ?DateTimeImmutable */ protected $timestamp; /** + * * @var ?string */ protected $type; /** + * * @var ?Money */ protected $amount; /** + * * @var ?string */ protected $interactionId; /** + * * @var ?string */ protected $state; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -77,6 +83,7 @@ public function __construct( /** *

    The time at which the transaction took place.

    * + * * @return null|DateTimeImmutable */ public function getTimestamp() @@ -100,6 +107,7 @@ public function getTimestamp() /** *

    The type of this transaction.

    * + * * @return null|string */ public function getType() @@ -117,6 +125,7 @@ public function getType() } /** + * * @return null|Money */ public function getAmount() @@ -138,6 +147,7 @@ public function getAmount() *

    The identifier that is used by the interface that managed the transaction (usually the PSP). * If a matching interaction was logged in the interfaceInteractions array, the corresponding interaction should be findable with this ID.

    * + * * @return null|string */ public function getInteractionId() @@ -158,6 +168,7 @@ public function getInteractionId() *

    The state of this transaction. * If not set, defaults to Initial.

    * + * * @return null|string */ public function getState() @@ -177,6 +188,7 @@ public function getState() /** *

    Custom Fields for the Transaction.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Payment/TransactionModel.php b/lib/commercetools-api/src/Models/Payment/TransactionModel.php index d720280740b..50cfbdbcd84 100644 --- a/lib/commercetools-api/src/Models/Payment/TransactionModel.php +++ b/lib/commercetools-api/src/Models/Payment/TransactionModel.php @@ -25,36 +25,43 @@ final class TransactionModel extends JsonObjectModel implements Transaction { /** + * * @var ?string */ protected $id; /** + * * @var ?DateTimeImmutable */ protected $timestamp; /** + * * @var ?string */ protected $type; /** + * * @var ?TypedMoney */ protected $amount; /** + * * @var ?string */ protected $interactionId; /** + * * @var ?string */ protected $state; /** + * * @var ?CustomFields */ protected $custom; @@ -84,6 +91,7 @@ public function __construct( /** *

    Unique identifier of the Transaction.

    * + * * @return null|string */ public function getId() @@ -103,6 +111,7 @@ public function getId() /** *

    The time at which the transaction took place.

    * + * * @return null|DateTimeImmutable */ public function getTimestamp() @@ -126,6 +135,7 @@ public function getTimestamp() /** *

    The type of this transaction.

    * + * * @return null|string */ public function getType() @@ -143,6 +153,7 @@ public function getType() } /** + * * @return null|TypedMoney */ public function getAmount() @@ -164,6 +175,7 @@ public function getAmount() *

    The identifier that is used by the interface that managed the transaction (usually the PSP). * If a matching interaction was logged in the interfaceInteractions array, the corresponding interaction should be findable with this ID.

    * + * * @return null|string */ public function getInteractionId() @@ -183,6 +195,7 @@ public function getInteractionId() /** *

    The state of this transaction.

    * + * * @return null|string */ public function getState() @@ -202,6 +215,7 @@ public function getState() /** *

    Custom Fields for the Transaction.

    * + * * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Product/Attribute.php b/lib/commercetools-api/src/Models/Product/Attribute.php index 354ab4a716d..1f929754d78 100644 --- a/lib/commercetools-api/src/Models/Product/Attribute.php +++ b/lib/commercetools-api/src/Models/Product/Attribute.php @@ -17,13 +17,27 @@ interface Attribute extends JsonObject public const FIELD_VALUE = 'value'; /** + *

    Name of the Attribute.

    + * + * @return null|string */ public function getName(); /** - *

    A valid JSON value, based on an AttributeDefinition.

    + *

    The AttributeType determines the format of the Attribute value to be provided:

    + * * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Product/AttributeBuilder.php b/lib/commercetools-api/src/Models/Product/AttributeBuilder.php index f7f21b213b9..a6822118555 100644 --- a/lib/commercetools-api/src/Models/Product/AttributeBuilder.php +++ b/lib/commercetools-api/src/Models/Product/AttributeBuilder.php @@ -21,16 +21,21 @@ final class AttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + *

    Name of the Attribute.

    + * + * @return null|string */ public function getName() @@ -39,8 +44,19 @@ public function getName() } /** - *

    A valid JSON value, based on an AttributeDefinition.

    + *

    The AttributeType determines the format of the Attribute value to be provided:

    + * * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Product/AttributeModel.php b/lib/commercetools-api/src/Models/Product/AttributeModel.php index faaf6f8c5a0..a4ade3fef36 100644 --- a/lib/commercetools-api/src/Models/Product/AttributeModel.php +++ b/lib/commercetools-api/src/Models/Product/AttributeModel.php @@ -20,11 +20,13 @@ final class AttributeModel extends JsonObjectModel implements Attribute { /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -42,6 +44,9 @@ public function __construct( } /** + *

    Name of the Attribute.

    + * + * * @return null|string */ public function getName() @@ -59,7 +64,18 @@ public function getName() } /** - *

    A valid JSON value, based on an AttributeDefinition.

    + *

    The AttributeType determines the format of the Attribute value to be provided:

    + * + * * * @return null|mixed */ diff --git a/lib/commercetools-api/src/Models/Product/CustomTokenizer.php b/lib/commercetools-api/src/Models/Product/CustomTokenizer.php index 0bd9914081f..0a920936536 100644 --- a/lib/commercetools-api/src/Models/Product/CustomTokenizer.php +++ b/lib/commercetools-api/src/Models/Product/CustomTokenizer.php @@ -16,6 +16,9 @@ interface CustomTokenizer extends SuggestTokenizer public const FIELD_INPUTS = 'inputs'; /** + *

    Contains custom tokens.

    + * + * @return null|array */ public function getInputs(); diff --git a/lib/commercetools-api/src/Models/Product/CustomTokenizerBuilder.php b/lib/commercetools-api/src/Models/Product/CustomTokenizerBuilder.php index b2efe3ea2da..4c3fc917986 100644 --- a/lib/commercetools-api/src/Models/Product/CustomTokenizerBuilder.php +++ b/lib/commercetools-api/src/Models/Product/CustomTokenizerBuilder.php @@ -21,11 +21,15 @@ final class CustomTokenizerBuilder implements Builder { /** + * @var ?array */ private $inputs; /** + *

    Contains custom tokens.

    + * + * @return null|array */ public function getInputs() diff --git a/lib/commercetools-api/src/Models/Product/CustomTokenizerModel.php b/lib/commercetools-api/src/Models/Product/CustomTokenizerModel.php index d20e41f90b9..5de290813e0 100644 --- a/lib/commercetools-api/src/Models/Product/CustomTokenizerModel.php +++ b/lib/commercetools-api/src/Models/Product/CustomTokenizerModel.php @@ -21,11 +21,13 @@ final class CustomTokenizerModel extends JsonObjectModel implements CustomTokeni { public const DISCRIMINATOR_VALUE = 'custom'; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $inputs; @@ -35,13 +37,15 @@ final class CustomTokenizerModel extends JsonObjectModel implements CustomTokeni * @psalm-suppress MissingParamType */ public function __construct( - ?array $inputs = null + ?array $inputs = null, + ?string $type = null ) { $this->inputs = $inputs; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,6 +63,9 @@ public function getType() } /** + *

    Contains custom tokens.

    + * + * * @return null|array */ public function getInputs() diff --git a/lib/commercetools-api/src/Models/Product/FacetRange.php b/lib/commercetools-api/src/Models/Product/FacetRange.php index 8469b0b1298..a05a61f2de4 100644 --- a/lib/commercetools-api/src/Models/Product/FacetRange.php +++ b/lib/commercetools-api/src/Models/Product/FacetRange.php @@ -25,51 +25,61 @@ interface FacetRange extends JsonObject public const FIELD_MEAN = 'mean'; /** + * @return null|float */ public function getFrom(); /** + * @return null|string */ public function getFromStr(); /** + * @return null|float */ public function getTo(); /** + * @return null|string */ public function getToStr(); /** + * @return null|int */ public function getCount(); /** + * @return null|int */ public function getProductCount(); /** + * @return null|float */ public function getTotal(); /** + * @return null|float */ public function getMin(); /** + * @return null|float */ public function getMax(); /** + * @return null|float */ public function getMean(); diff --git a/lib/commercetools-api/src/Models/Product/FacetRangeBuilder.php b/lib/commercetools-api/src/Models/Product/FacetRangeBuilder.php index cb0afcc0351..ec9c818a00b 100644 --- a/lib/commercetools-api/src/Models/Product/FacetRangeBuilder.php +++ b/lib/commercetools-api/src/Models/Product/FacetRangeBuilder.php @@ -21,56 +21,67 @@ final class FacetRangeBuilder implements Builder { /** + * @var ?float */ private $from; /** + * @var ?string */ private $fromStr; /** + * @var ?float */ private $to; /** + * @var ?string */ private $toStr; /** + * @var ?int */ private $count; /** + * @var ?int */ private $productCount; /** + * @var ?float */ private $total; /** + * @var ?float */ private $min; /** + * @var ?float */ private $max; /** + * @var ?float */ private $mean; /** + * @return null|float */ public function getFrom() @@ -79,6 +90,7 @@ public function getFrom() } /** + * @return null|string */ public function getFromStr() @@ -87,6 +99,7 @@ public function getFromStr() } /** + * @return null|float */ public function getTo() @@ -95,6 +108,7 @@ public function getTo() } /** + * @return null|string */ public function getToStr() @@ -103,6 +117,7 @@ public function getToStr() } /** + * @return null|int */ public function getCount() @@ -111,6 +126,7 @@ public function getCount() } /** + * @return null|int */ public function getProductCount() @@ -119,6 +135,7 @@ public function getProductCount() } /** + * @return null|float */ public function getTotal() @@ -127,6 +144,7 @@ public function getTotal() } /** + * @return null|float */ public function getMin() @@ -135,6 +153,7 @@ public function getMin() } /** + * @return null|float */ public function getMax() @@ -143,6 +162,7 @@ public function getMax() } /** + * @return null|float */ public function getMean() diff --git a/lib/commercetools-api/src/Models/Product/FacetRangeModel.php b/lib/commercetools-api/src/Models/Product/FacetRangeModel.php index 2b21568cfab..b312c795aee 100644 --- a/lib/commercetools-api/src/Models/Product/FacetRangeModel.php +++ b/lib/commercetools-api/src/Models/Product/FacetRangeModel.php @@ -20,51 +20,61 @@ final class FacetRangeModel extends JsonObjectModel implements FacetRange { /** + * * @var ?float */ protected $from; /** + * * @var ?string */ protected $fromStr; /** + * * @var ?float */ protected $to; /** + * * @var ?string */ protected $toStr; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $productCount; /** + * * @var ?float */ protected $total; /** + * * @var ?float */ protected $min; /** + * * @var ?float */ protected $max; /** + * * @var ?float */ protected $mean; @@ -98,6 +108,7 @@ public function __construct( } /** + * * @return null|float */ public function getFrom() @@ -115,6 +126,7 @@ public function getFrom() } /** + * * @return null|string */ public function getFromStr() @@ -132,6 +144,7 @@ public function getFromStr() } /** + * * @return null|float */ public function getTo() @@ -149,6 +162,7 @@ public function getTo() } /** + * * @return null|string */ public function getToStr() @@ -166,6 +180,7 @@ public function getToStr() } /** + * * @return null|int */ public function getCount() @@ -183,6 +198,7 @@ public function getCount() } /** + * * @return null|int */ public function getProductCount() @@ -200,6 +216,7 @@ public function getProductCount() } /** + * * @return null|float */ public function getTotal() @@ -217,6 +234,7 @@ public function getTotal() } /** + * * @return null|float */ public function getMin() @@ -234,6 +252,7 @@ public function getMin() } /** + * * @return null|float */ public function getMax() @@ -251,6 +270,7 @@ public function getMax() } /** + * * @return null|float */ public function getMean() diff --git a/lib/commercetools-api/src/Models/Product/FacetResult.php b/lib/commercetools-api/src/Models/Product/FacetResult.php index 390782f46dd..72bea2d91b1 100644 --- a/lib/commercetools-api/src/Models/Product/FacetResult.php +++ b/lib/commercetools-api/src/Models/Product/FacetResult.php @@ -17,6 +17,7 @@ interface FacetResult extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/Product/FacetResultModel.php b/lib/commercetools-api/src/Models/Product/FacetResultModel.php index a7f11730046..4011f9b5ed8 100644 --- a/lib/commercetools-api/src/Models/Product/FacetResultModel.php +++ b/lib/commercetools-api/src/Models/Product/FacetResultModel.php @@ -21,6 +21,7 @@ final class FacetResultModel extends JsonObjectModel implements FacetResult { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -39,11 +40,13 @@ final class FacetResultModel extends JsonObjectModel implements FacetResult * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Product/FacetTerm.php b/lib/commercetools-api/src/Models/Product/FacetTerm.php index 2dd72351218..d0607a71605 100644 --- a/lib/commercetools-api/src/Models/Product/FacetTerm.php +++ b/lib/commercetools-api/src/Models/Product/FacetTerm.php @@ -18,16 +18,19 @@ interface FacetTerm extends JsonObject public const FIELD_PRODUCT_COUNT = 'productCount'; /** + * @return null|mixed */ public function getTerm(); /** + * @return null|int */ public function getCount(); /** + * @return null|int */ public function getProductCount(); diff --git a/lib/commercetools-api/src/Models/Product/FacetTermBuilder.php b/lib/commercetools-api/src/Models/Product/FacetTermBuilder.php index a0b02e471d1..18a684c362b 100644 --- a/lib/commercetools-api/src/Models/Product/FacetTermBuilder.php +++ b/lib/commercetools-api/src/Models/Product/FacetTermBuilder.php @@ -21,21 +21,25 @@ final class FacetTermBuilder implements Builder { /** + * @var null|mixed|mixed */ private $term; /** + * @var ?int */ private $count; /** + * @var ?int */ private $productCount; /** + * @return null|mixed */ public function getTerm() @@ -44,6 +48,7 @@ public function getTerm() } /** + * @return null|int */ public function getCount() @@ -52,6 +57,7 @@ public function getCount() } /** + * @return null|int */ public function getProductCount() diff --git a/lib/commercetools-api/src/Models/Product/FacetTermModel.php b/lib/commercetools-api/src/Models/Product/FacetTermModel.php index 3af9c27e728..98380ddc7af 100644 --- a/lib/commercetools-api/src/Models/Product/FacetTermModel.php +++ b/lib/commercetools-api/src/Models/Product/FacetTermModel.php @@ -20,16 +20,19 @@ final class FacetTermModel extends JsonObjectModel implements FacetTerm { /** + * * @var ?mixed */ protected $term; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $productCount; @@ -49,6 +52,7 @@ public function __construct( } /** + * * @return null|mixed */ public function getTerm() @@ -66,6 +70,7 @@ public function getTerm() } /** + * * @return null|int */ public function getCount() @@ -83,6 +88,7 @@ public function getCount() } /** + * * @return null|int */ public function getProductCount() diff --git a/lib/commercetools-api/src/Models/Product/FilteredFacetResult.php b/lib/commercetools-api/src/Models/Product/FilteredFacetResult.php index bb54f3c1d58..0845c885c37 100644 --- a/lib/commercetools-api/src/Models/Product/FilteredFacetResult.php +++ b/lib/commercetools-api/src/Models/Product/FilteredFacetResult.php @@ -17,11 +17,13 @@ interface FilteredFacetResult extends FacetResult public const FIELD_PRODUCT_COUNT = 'productCount'; /** + * @return null|int */ public function getCount(); /** + * @return null|int */ public function getProductCount(); diff --git a/lib/commercetools-api/src/Models/Product/FilteredFacetResultBuilder.php b/lib/commercetools-api/src/Models/Product/FilteredFacetResultBuilder.php index ff9f7f8680f..32549c27d3a 100644 --- a/lib/commercetools-api/src/Models/Product/FilteredFacetResultBuilder.php +++ b/lib/commercetools-api/src/Models/Product/FilteredFacetResultBuilder.php @@ -21,16 +21,19 @@ final class FilteredFacetResultBuilder implements Builder { /** + * @var ?int */ private $count; /** + * @var ?int */ private $productCount; /** + * @return null|int */ public function getCount() @@ -39,6 +42,7 @@ public function getCount() } /** + * @return null|int */ public function getProductCount() diff --git a/lib/commercetools-api/src/Models/Product/FilteredFacetResultModel.php b/lib/commercetools-api/src/Models/Product/FilteredFacetResultModel.php index 37c330cd6eb..7ed9d8d6bc4 100644 --- a/lib/commercetools-api/src/Models/Product/FilteredFacetResultModel.php +++ b/lib/commercetools-api/src/Models/Product/FilteredFacetResultModel.php @@ -21,16 +21,19 @@ final class FilteredFacetResultModel extends JsonObjectModel implements Filtered { public const DISCRIMINATOR_VALUE = 'filter'; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $productCount; @@ -41,14 +44,16 @@ final class FilteredFacetResultModel extends JsonObjectModel implements Filtered */ public function __construct( ?int $count = null, - ?int $productCount = null + ?int $productCount = null, + ?string $type = null ) { $this->count = $count; $this->productCount = $productCount; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -66,6 +71,7 @@ public function getType() } /** + * * @return null|int */ public function getCount() @@ -83,6 +89,7 @@ public function getCount() } /** + * * @return null|int */ public function getProductCount() diff --git a/lib/commercetools-api/src/Models/Product/Product.php b/lib/commercetools-api/src/Models/Product/Product.php index 26f0336463e..201bae008e0 100644 --- a/lib/commercetools-api/src/Models/Product/Product.php +++ b/lib/commercetools-api/src/Models/Product/Product.php @@ -34,81 +34,104 @@ interface Product extends BaseResource /** *

    Unique identifier of the Product.

    * + * @return null|string */ public function getId(); /** - *

    The current version of the product.

    + *

    Current version of the Product.

    * + * @return null|int */ public function getVersion(); /** + *

    Date and time (UTC) the Product was initially created.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt(); /** + *

    Date and time (UTC) the Product was last updated.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); /** - *

    User-defined unique identifier of the Product. - * Product keys are different from ProductVariant keys.

    + *

    User-defined unique identifier of the Product.

    + *

    This is different from the key of a ProductVariant.

    * + * @return null|string */ public function getKey(); /** + *

    The Product Type defining the Attributes of the Product. Cannot be changed.

    + * + * @return null|ProductTypeReference */ public function getProductType(); /** - *

    The product data in the master catalog.

    + *

    Contains the current and the staged representation of the product information.

    * + * @return null|ProductCatalogData */ public function getMasterData(); /** + *

    The TaxCategory of the Product.

    + * + * @return null|TaxCategoryReference */ public function getTaxCategory(); /** + *

    State of the Product.

    + * + * @return null|StateReference */ public function getState(); /** - *

    Statistics about the review ratings taken into account for this product.

    + *

    Review statistics of the Product.

    * + * @return null|ReviewRatingStatistics */ public function getReviewRatingStatistics(); /** - *

    Specifies which type of prices should be used when looking up a price for this product. If not set, Embedded ProductPriceMode is used.

    + *

    Type of Price to be used when looking up a price for the Product.

    * + * @return null|string */ public function getPriceMode(); diff --git a/lib/commercetools-api/src/Models/Product/ProductAddAssetAction.php b/lib/commercetools-api/src/Models/Product/ProductAddAssetAction.php index 756b4c9dee2..2cafa5c0d20 100644 --- a/lib/commercetools-api/src/Models/Product/ProductAddAssetAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductAddAssetAction.php @@ -21,28 +21,41 @@ interface ProductAddAssetAction extends ProductUpdateAction public const FIELD_POSITION = 'position'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** + *

    If true, only the staged assets are updated. If false, both the current and staged assets are updated.

    + * + * @return null|bool */ public function getStaged(); /** + *

    Value to append.

    + * + * @return null|AssetDraft */ public function getAsset(); /** - *

    Position of the new asset inside the existing list (from 0 to the size of the list)

    + *

    Position in assets where the Asset should be put. When specified, the value must be between 0 and the total number of Assets minus 1.

    * + * @return null|int */ public function getPosition(); diff --git a/lib/commercetools-api/src/Models/Product/ProductAddAssetActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductAddAssetActionBuilder.php index 23b41c2bcb1..f0b54188b41 100644 --- a/lib/commercetools-api/src/Models/Product/ProductAddAssetActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductAddAssetActionBuilder.php @@ -23,31 +23,39 @@ final class ProductAddAssetActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?bool */ private $staged; /** + * @var null|AssetDraft|AssetDraftBuilder */ private $asset; /** + * @var ?int */ private $position; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -56,6 +64,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -64,6 +75,9 @@ public function getSku() } /** + *

    If true, only the staged assets are updated. If false, both the current and staged assets are updated.

    + * + * @return null|bool */ public function getStaged() @@ -72,6 +86,9 @@ public function getStaged() } /** + *

    Value to append.

    + * + * @return null|AssetDraft */ public function getAsset() @@ -80,8 +97,9 @@ public function getAsset() } /** - *

    Position of the new asset inside the existing list (from 0 to the size of the list)

    + *

    Position in assets where the Asset should be put. When specified, the value must be between 0 and the total number of Assets minus 1.

    * + * @return null|int */ public function getPosition() diff --git a/lib/commercetools-api/src/Models/Product/ProductAddAssetActionModel.php b/lib/commercetools-api/src/Models/Product/ProductAddAssetActionModel.php index c1473dcba6f..86c6d5cc360 100644 --- a/lib/commercetools-api/src/Models/Product/ProductAddAssetActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductAddAssetActionModel.php @@ -23,31 +23,37 @@ final class ProductAddAssetActionModel extends JsonObjectModel implements Produc { public const DISCRIMINATOR_VALUE = 'addAsset'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?bool */ protected $staged; /** + * * @var ?AssetDraft */ protected $asset; /** + * * @var ?int */ protected $position; @@ -61,17 +67,19 @@ public function __construct( ?string $sku = null, ?bool $staged = null, ?AssetDraft $asset = null, - ?int $position = null + ?int $position = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; $this->staged = $staged; $this->asset = $asset; $this->position = $position; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -89,6 +97,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -106,6 +117,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -123,6 +137,9 @@ public function getSku() } /** + *

    If true, only the staged assets are updated. If false, both the current and staged assets are updated.

    + * + * * @return null|bool */ public function getStaged() @@ -140,6 +157,9 @@ public function getStaged() } /** + *

    Value to append.

    + * + * * @return null|AssetDraft */ public function getAsset() @@ -158,7 +178,8 @@ public function getAsset() } /** - *

    Position of the new asset inside the existing list (from 0 to the size of the list)

    + *

    Position in assets where the Asset should be put. When specified, the value must be between 0 and the total number of Assets minus 1.

    + * * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Product/ProductAddExternalImageAction.php b/lib/commercetools-api/src/Models/Product/ProductAddExternalImageAction.php index 894ae586105..95f64853661 100644 --- a/lib/commercetools-api/src/Models/Product/ProductAddExternalImageAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductAddExternalImageAction.php @@ -20,21 +20,33 @@ interface ProductAddExternalImageAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** + *

    Value to add to images.

    + * + * @return null|Image */ public function getImage(); /** + *

    If true, only the staged images is updated. If false, both the current and staged images is updated.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductAddExternalImageActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductAddExternalImageActionBuilder.php index a4befb0f5a4..6d23472bf2a 100644 --- a/lib/commercetools-api/src/Models/Product/ProductAddExternalImageActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductAddExternalImageActionBuilder.php @@ -23,26 +23,33 @@ final class ProductAddExternalImageActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var null|Image|ImageBuilder */ private $image; /** + * @var ?bool */ private $staged; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -51,6 +58,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -59,6 +69,9 @@ public function getSku() } /** + *

    Value to add to images.

    + * + * @return null|Image */ public function getImage() @@ -67,6 +80,9 @@ public function getImage() } /** + *

    If true, only the staged images is updated. If false, both the current and staged images is updated.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductAddExternalImageActionModel.php b/lib/commercetools-api/src/Models/Product/ProductAddExternalImageActionModel.php index fc0b3a61123..38c86ff48b8 100644 --- a/lib/commercetools-api/src/Models/Product/ProductAddExternalImageActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductAddExternalImageActionModel.php @@ -23,26 +23,31 @@ final class ProductAddExternalImageActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'addExternalImage'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?Image */ protected $image; /** + * * @var ?bool */ protected $staged; @@ -55,16 +60,18 @@ public function __construct( ?int $variantId = null, ?string $sku = null, ?Image $image = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; $this->image = $image; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -82,6 +89,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -99,6 +109,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -116,6 +129,9 @@ public function getSku() } /** + *

    Value to add to images.

    + * + * * @return null|Image */ public function getImage() @@ -134,6 +150,9 @@ public function getImage() } /** + *

    If true, only the staged images is updated. If false, both the current and staged images is updated.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductAddPriceAction.php b/lib/commercetools-api/src/Models/Product/ProductAddPriceAction.php index 88fc6a54b8c..246f664600c 100644 --- a/lib/commercetools-api/src/Models/Product/ProductAddPriceAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductAddPriceAction.php @@ -20,21 +20,33 @@ interface ProductAddPriceAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** + *

    Embedded Price to add to the Product Variant.

    + * + * @return null|PriceDraft */ public function getPrice(); /** + *

    If true, only the staged prices is updated. If false, both the current and staged prices are updated.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductAddPriceActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductAddPriceActionBuilder.php index cbf276e951e..633797df2b2 100644 --- a/lib/commercetools-api/src/Models/Product/ProductAddPriceActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductAddPriceActionBuilder.php @@ -23,26 +23,33 @@ final class ProductAddPriceActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var null|PriceDraft|PriceDraftBuilder */ private $price; /** + * @var ?bool */ private $staged; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -51,6 +58,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -59,6 +69,9 @@ public function getSku() } /** + *

    Embedded Price to add to the Product Variant.

    + * + * @return null|PriceDraft */ public function getPrice() @@ -67,6 +80,9 @@ public function getPrice() } /** + *

    If true, only the staged prices is updated. If false, both the current and staged prices are updated.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductAddPriceActionModel.php b/lib/commercetools-api/src/Models/Product/ProductAddPriceActionModel.php index bc2f2c1ac45..7d2263c43d2 100644 --- a/lib/commercetools-api/src/Models/Product/ProductAddPriceActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductAddPriceActionModel.php @@ -23,26 +23,31 @@ final class ProductAddPriceActionModel extends JsonObjectModel implements Produc { public const DISCRIMINATOR_VALUE = 'addPrice'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?PriceDraft */ protected $price; /** + * * @var ?bool */ protected $staged; @@ -55,16 +60,18 @@ public function __construct( ?int $variantId = null, ?string $sku = null, ?PriceDraft $price = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; $this->price = $price; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -82,6 +89,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -99,6 +109,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -116,6 +129,9 @@ public function getSku() } /** + *

    Embedded Price to add to the Product Variant.

    + * + * * @return null|PriceDraft */ public function getPrice() @@ -134,6 +150,9 @@ public function getPrice() } /** + *

    If true, only the staged prices is updated. If false, both the current and staged prices are updated.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductAddToCategoryAction.php b/lib/commercetools-api/src/Models/Product/ProductAddToCategoryAction.php index 8f933d96796..a5378cbb92c 100644 --- a/lib/commercetools-api/src/Models/Product/ProductAddToCategoryAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductAddToCategoryAction.php @@ -19,16 +19,25 @@ interface ProductAddToCategoryAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    The Category to add.

    + * + * @return null|CategoryResourceIdentifier */ public function getCategory(); /** + *

    A string representing a number between 0 and 1. Must start with 0. and cannot end with 0. If empty, any existing value will be removed.

    + * + * @return null|string */ public function getOrderHint(); /** + *

    If true, only the staged categories and categoryOrderHints are updated. If false, both the current and staged categories and categoryOrderHints are updated.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductAddToCategoryActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductAddToCategoryActionBuilder.php index 86ce6a920cc..e73e8cc62b3 100644 --- a/lib/commercetools-api/src/Models/Product/ProductAddToCategoryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductAddToCategoryActionBuilder.php @@ -23,21 +23,27 @@ final class ProductAddToCategoryActionBuilder implements Builder { /** + * @var null|CategoryResourceIdentifier|CategoryResourceIdentifierBuilder */ private $category; /** + * @var ?string */ private $orderHint; /** + * @var ?bool */ private $staged; /** + *

    The Category to add.

    + * + * @return null|CategoryResourceIdentifier */ public function getCategory() @@ -46,6 +52,9 @@ public function getCategory() } /** + *

    A string representing a number between 0 and 1. Must start with 0. and cannot end with 0. If empty, any existing value will be removed.

    + * + * @return null|string */ public function getOrderHint() @@ -54,6 +63,9 @@ public function getOrderHint() } /** + *

    If true, only the staged categories and categoryOrderHints are updated. If false, both the current and staged categories and categoryOrderHints are updated.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductAddToCategoryActionModel.php b/lib/commercetools-api/src/Models/Product/ProductAddToCategoryActionModel.php index f7ef4a6eec8..bb9b4a8ecc9 100644 --- a/lib/commercetools-api/src/Models/Product/ProductAddToCategoryActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductAddToCategoryActionModel.php @@ -23,21 +23,25 @@ final class ProductAddToCategoryActionModel extends JsonObjectModel implements P { public const DISCRIMINATOR_VALUE = 'addToCategory'; /** + * * @var ?string */ protected $action; /** + * * @var ?CategoryResourceIdentifier */ protected $category; /** + * * @var ?string */ protected $orderHint; /** + * * @var ?bool */ protected $staged; @@ -49,15 +53,17 @@ final class ProductAddToCategoryActionModel extends JsonObjectModel implements P public function __construct( ?CategoryResourceIdentifier $category = null, ?string $orderHint = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->category = $category; $this->orderHint = $orderHint; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -75,6 +81,9 @@ public function getAction() } /** + *

    The Category to add.

    + * + * * @return null|CategoryResourceIdentifier */ public function getCategory() @@ -93,6 +102,9 @@ public function getCategory() } /** + *

    A string representing a number between 0 and 1. Must start with 0. and cannot end with 0. If empty, any existing value will be removed.

    + * + * * @return null|string */ public function getOrderHint() @@ -110,6 +122,9 @@ public function getOrderHint() } /** + *

    If true, only the staged categories and categoryOrderHints are updated. If false, both the current and staged categories and categoryOrderHints are updated.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductAddVariantAction.php b/lib/commercetools-api/src/Models/Product/ProductAddVariantAction.php index 4d243070abe..95b5c2f864a 100644 --- a/lib/commercetools-api/src/Models/Product/ProductAddVariantAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductAddVariantAction.php @@ -25,36 +25,57 @@ interface ProductAddVariantAction extends ProductUpdateAction public const FIELD_ASSETS = 'assets'; /** + *

    Value to set. Must be unique.

    + * + * @return null|string */ public function getSku(); /** + *

    Value to set. Must be unique.

    + * + * @return null|string */ public function getKey(); /** + *

    Embedded Prices for the Product Variant.

    + * + * @return null|PriceDraftCollection */ public function getPrices(); /** + *

    Images for the Product Variant.

    + * + * @return null|ImageCollection */ public function getImages(); /** + *

    Attributes for the Product Variant.

    + * + * @return null|AttributeCollection */ public function getAttributes(); /** + *

    If true the new Product Variant is only staged. If false the new Product Variant is both current and staged.

    + * + * @return null|bool */ public function getStaged(); /** + *

    Media assets for the Product Variant.

    + * + * @return null|AssetCollection */ public function getAssets(); diff --git a/lib/commercetools-api/src/Models/Product/ProductAddVariantActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductAddVariantActionBuilder.php index 092c71da38f..f2cd9566f65 100644 --- a/lib/commercetools-api/src/Models/Product/ProductAddVariantActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductAddVariantActionBuilder.php @@ -24,41 +24,51 @@ final class ProductAddVariantActionBuilder implements Builder { /** + * @var ?string */ private $sku; /** + * @var ?string */ private $key; /** + * @var ?PriceDraftCollection */ private $prices; /** + * @var ?ImageCollection */ private $images; /** + * @var ?AttributeCollection */ private $attributes; /** + * @var ?bool */ private $staged; /** + * @var ?AssetCollection */ private $assets; /** + *

    Value to set. Must be unique.

    + * + * @return null|string */ public function getSku() @@ -67,6 +77,9 @@ public function getSku() } /** + *

    Value to set. Must be unique.

    + * + * @return null|string */ public function getKey() @@ -75,6 +88,9 @@ public function getKey() } /** + *

    Embedded Prices for the Product Variant.

    + * + * @return null|PriceDraftCollection */ public function getPrices() @@ -83,6 +99,9 @@ public function getPrices() } /** + *

    Images for the Product Variant.

    + * + * @return null|ImageCollection */ public function getImages() @@ -91,6 +110,9 @@ public function getImages() } /** + *

    Attributes for the Product Variant.

    + * + * @return null|AttributeCollection */ public function getAttributes() @@ -99,6 +121,9 @@ public function getAttributes() } /** + *

    If true the new Product Variant is only staged. If false the new Product Variant is both current and staged.

    + * + * @return null|bool */ public function getStaged() @@ -107,6 +132,9 @@ public function getStaged() } /** + *

    Media assets for the Product Variant.

    + * + * @return null|AssetCollection */ public function getAssets() diff --git a/lib/commercetools-api/src/Models/Product/ProductAddVariantActionModel.php b/lib/commercetools-api/src/Models/Product/ProductAddVariantActionModel.php index 2a1f20e1652..1b2c1cf15aa 100644 --- a/lib/commercetools-api/src/Models/Product/ProductAddVariantActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductAddVariantActionModel.php @@ -24,41 +24,49 @@ final class ProductAddVariantActionModel extends JsonObjectModel implements Prod { public const DISCRIMINATOR_VALUE = 'addVariant'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $key; /** + * * @var ?PriceDraftCollection */ protected $prices; /** + * * @var ?ImageCollection */ protected $images; /** + * * @var ?AttributeCollection */ protected $attributes; /** + * * @var ?bool */ protected $staged; /** + * * @var ?AssetCollection */ protected $assets; @@ -74,7 +82,8 @@ public function __construct( ?ImageCollection $images = null, ?AttributeCollection $attributes = null, ?bool $staged = null, - ?AssetCollection $assets = null + ?AssetCollection $assets = null, + ?string $action = null ) { $this->sku = $sku; $this->key = $key; @@ -83,10 +92,11 @@ public function __construct( $this->attributes = $attributes; $this->staged = $staged; $this->assets = $assets; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -104,6 +114,9 @@ public function getAction() } /** + *

    Value to set. Must be unique.

    + * + * * @return null|string */ public function getSku() @@ -121,6 +134,9 @@ public function getSku() } /** + *

    Value to set. Must be unique.

    + * + * * @return null|string */ public function getKey() @@ -138,6 +154,9 @@ public function getKey() } /** + *

    Embedded Prices for the Product Variant.

    + * + * * @return null|PriceDraftCollection */ public function getPrices() @@ -155,6 +174,9 @@ public function getPrices() } /** + *

    Images for the Product Variant.

    + * + * * @return null|ImageCollection */ public function getImages() @@ -172,6 +194,9 @@ public function getImages() } /** + *

    Attributes for the Product Variant.

    + * + * * @return null|AttributeCollection */ public function getAttributes() @@ -189,6 +214,9 @@ public function getAttributes() } /** + *

    If true the new Product Variant is only staged. If false the new Product Variant is both current and staged.

    + * + * * @return null|bool */ public function getStaged() @@ -206,6 +234,9 @@ public function getStaged() } /** + *

    Media assets for the Product Variant.

    + * + * * @return null|AssetCollection */ public function getAssets() diff --git a/lib/commercetools-api/src/Models/Product/ProductBuilder.php b/lib/commercetools-api/src/Models/Product/ProductBuilder.php index 2c60f89e52f..54d2f1eb6a9 100644 --- a/lib/commercetools-api/src/Models/Product/ProductBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductBuilder.php @@ -36,66 +36,79 @@ final class ProductBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $key; /** + * @var null|ProductTypeReference|ProductTypeReferenceBuilder */ private $productType; /** + * @var null|ProductCatalogData|ProductCatalogDataBuilder */ private $masterData; /** + * @var null|TaxCategoryReference|TaxCategoryReferenceBuilder */ private $taxCategory; /** + * @var null|StateReference|StateReferenceBuilder */ private $state; /** + * @var null|ReviewRatingStatistics|ReviewRatingStatisticsBuilder */ private $reviewRatingStatistics; /** + * @var ?string */ private $priceMode; @@ -103,6 +116,7 @@ final class ProductBuilder implements Builder /** *

    Unique identifier of the Product.

    * + * @return null|string */ public function getId() @@ -111,8 +125,9 @@ public function getId() } /** - *

    The current version of the product.

    + *

    Current version of the Product.

    * + * @return null|int */ public function getVersion() @@ -121,6 +136,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Product was initially created.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -129,6 +147,9 @@ public function getCreatedAt() } /** + *

    Date and time (UTC) the Product was last updated.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -137,8 +158,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -147,8 +169,9 @@ public function getLastModifiedBy() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -157,9 +180,10 @@ public function getCreatedBy() } /** - *

    User-defined unique identifier of the Product. - * Product keys are different from ProductVariant keys.

    + *

    User-defined unique identifier of the Product.

    + *

    This is different from the key of a ProductVariant.

    * + * @return null|string */ public function getKey() @@ -168,6 +192,9 @@ public function getKey() } /** + *

    The Product Type defining the Attributes of the Product. Cannot be changed.

    + * + * @return null|ProductTypeReference */ public function getProductType() @@ -176,8 +203,9 @@ public function getProductType() } /** - *

    The product data in the master catalog.

    + *

    Contains the current and the staged representation of the product information.

    * + * @return null|ProductCatalogData */ public function getMasterData() @@ -186,6 +214,9 @@ public function getMasterData() } /** + *

    The TaxCategory of the Product.

    + * + * @return null|TaxCategoryReference */ public function getTaxCategory() @@ -194,6 +225,9 @@ public function getTaxCategory() } /** + *

    State of the Product.

    + * + * @return null|StateReference */ public function getState() @@ -202,8 +236,9 @@ public function getState() } /** - *

    Statistics about the review ratings taken into account for this product.

    + *

    Review statistics of the Product.

    * + * @return null|ReviewRatingStatistics */ public function getReviewRatingStatistics() @@ -212,8 +247,9 @@ public function getReviewRatingStatistics() } /** - *

    Specifies which type of prices should be used when looking up a price for this product. If not set, Embedded ProductPriceMode is used.

    + *

    Type of Price to be used when looking up a price for the Product.

    * + * @return null|string */ public function getPriceMode() diff --git a/lib/commercetools-api/src/Models/Product/ProductCatalogData.php b/lib/commercetools-api/src/Models/Product/ProductCatalogData.php index 93df56f9a87..7408e6a91e5 100644 --- a/lib/commercetools-api/src/Models/Product/ProductCatalogData.php +++ b/lib/commercetools-api/src/Models/Product/ProductCatalogData.php @@ -19,21 +19,33 @@ interface ProductCatalogData extends JsonObject public const FIELD_HAS_STAGED_CHANGES = 'hasStagedChanges'; /** + *

    true if the Product is published.

    + * + * @return null|bool */ public function getPublished(); /** + *

    Current (published) data of the Product.

    + * + * @return null|ProductData */ public function getCurrent(); /** + *

    Staged (unpublished) data of the Product.

    + * + * @return null|ProductData */ public function getStaged(); /** + *

    true if the staged data is different from the current data.

    + * + * @return null|bool */ public function getHasStagedChanges(); diff --git a/lib/commercetools-api/src/Models/Product/ProductCatalogDataBuilder.php b/lib/commercetools-api/src/Models/Product/ProductCatalogDataBuilder.php index 7e8cc87bbd8..94ef72dde5a 100644 --- a/lib/commercetools-api/src/Models/Product/ProductCatalogDataBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductCatalogDataBuilder.php @@ -21,26 +21,33 @@ final class ProductCatalogDataBuilder implements Builder { /** + * @var ?bool */ private $published; /** + * @var null|ProductData|ProductDataBuilder */ private $current; /** + * @var null|ProductData|ProductDataBuilder */ private $staged; /** + * @var ?bool */ private $hasStagedChanges; /** + *

    true if the Product is published.

    + * + * @return null|bool */ public function getPublished() @@ -49,6 +56,9 @@ public function getPublished() } /** + *

    Current (published) data of the Product.

    + * + * @return null|ProductData */ public function getCurrent() @@ -57,6 +67,9 @@ public function getCurrent() } /** + *

    Staged (unpublished) data of the Product.

    + * + * @return null|ProductData */ public function getStaged() @@ -65,6 +78,9 @@ public function getStaged() } /** + *

    true if the staged data is different from the current data.

    + * + * @return null|bool */ public function getHasStagedChanges() diff --git a/lib/commercetools-api/src/Models/Product/ProductCatalogDataModel.php b/lib/commercetools-api/src/Models/Product/ProductCatalogDataModel.php index 108c94949c6..60cb7c27950 100644 --- a/lib/commercetools-api/src/Models/Product/ProductCatalogDataModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductCatalogDataModel.php @@ -20,21 +20,25 @@ final class ProductCatalogDataModel extends JsonObjectModel implements ProductCatalogData { /** + * * @var ?bool */ protected $published; /** + * * @var ?ProductData */ protected $current; /** + * * @var ?ProductData */ protected $staged; /** + * * @var ?bool */ protected $hasStagedChanges; @@ -56,6 +60,9 @@ public function __construct( } /** + *

    true if the Product is published.

    + * + * * @return null|bool */ public function getPublished() @@ -73,6 +80,9 @@ public function getPublished() } /** + *

    Current (published) data of the Product.

    + * + * * @return null|ProductData */ public function getCurrent() @@ -91,6 +101,9 @@ public function getCurrent() } /** + *

    Staged (unpublished) data of the Product.

    + * + * * @return null|ProductData */ public function getStaged() @@ -109,6 +122,9 @@ public function getStaged() } /** + *

    true if the staged data is different from the current data.

    + * + * * @return null|bool */ public function getHasStagedChanges() diff --git a/lib/commercetools-api/src/Models/Product/ProductChangeAssetNameAction.php b/lib/commercetools-api/src/Models/Product/ProductChangeAssetNameAction.php index 4a95356b5e8..b497945b960 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangeAssetNameAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangeAssetNameAction.php @@ -22,31 +22,49 @@ interface ProductChangeAssetNameAction extends ProductUpdateAction public const FIELD_NAME = 'name'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * @return null|bool */ public function getStaged(); /** + *

    The id of the Asset to update.

    + * + * @return null|string */ public function getAssetId(); /** + *

    The key of the Asset to update.

    + * + * @return null|string */ public function getAssetKey(); /** + *

    New value to set. Must not be empty.

    + * + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/Product/ProductChangeAssetNameActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductChangeAssetNameActionBuilder.php index 21bb4855bc1..c311b6b1059 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangeAssetNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangeAssetNameActionBuilder.php @@ -23,36 +23,45 @@ final class ProductChangeAssetNameActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?bool */ private $staged; /** + * @var ?string */ private $assetId; /** + * @var ?string */ private $assetKey; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -61,6 +70,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -69,6 +81,9 @@ public function getSku() } /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * @return null|bool */ public function getStaged() @@ -77,6 +92,9 @@ public function getStaged() } /** + *

    The id of the Asset to update.

    + * + * @return null|string */ public function getAssetId() @@ -85,6 +103,9 @@ public function getAssetId() } /** + *

    The key of the Asset to update.

    + * + * @return null|string */ public function getAssetKey() @@ -93,6 +114,9 @@ public function getAssetKey() } /** + *

    New value to set. Must not be empty.

    + * + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Product/ProductChangeAssetNameActionModel.php b/lib/commercetools-api/src/Models/Product/ProductChangeAssetNameActionModel.php index ffd770a2444..bdb36f4b67f 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangeAssetNameActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangeAssetNameActionModel.php @@ -23,36 +23,43 @@ final class ProductChangeAssetNameActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'changeAssetName'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?bool */ protected $staged; /** + * * @var ?string */ protected $assetId; /** + * * @var ?string */ protected $assetKey; /** + * * @var ?LocalizedString */ protected $name; @@ -67,7 +74,8 @@ public function __construct( ?bool $staged = null, ?string $assetId = null, ?string $assetKey = null, - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; @@ -75,10 +83,11 @@ public function __construct( $this->assetId = $assetId; $this->assetKey = $assetKey; $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -96,6 +105,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -113,6 +125,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -130,6 +145,9 @@ public function getSku() } /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * * @return null|bool */ public function getStaged() @@ -147,6 +165,9 @@ public function getStaged() } /** + *

    The id of the Asset to update.

    + * + * * @return null|string */ public function getAssetId() @@ -164,6 +185,9 @@ public function getAssetId() } /** + *

    The key of the Asset to update.

    + * + * * @return null|string */ public function getAssetKey() @@ -181,6 +205,9 @@ public function getAssetKey() } /** + *

    New value to set. Must not be empty.

    + * + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Product/ProductChangeAssetOrderAction.php b/lib/commercetools-api/src/Models/Product/ProductChangeAssetOrderAction.php index a2c22ebb849..7446b94b579 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangeAssetOrderAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangeAssetOrderAction.php @@ -19,21 +19,33 @@ interface ProductChangeAssetOrderAction extends ProductUpdateAction public const FIELD_ASSET_ORDER = 'assetOrder'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** + *

    If true, only the staged assets is updated. If false, both the current and staged assets are updated.

    + * + * @return null|bool */ public function getStaged(); /** + *

    All existing Asset ids of the ProductVariant in the desired new order.

    + * + * @return null|array */ public function getAssetOrder(); diff --git a/lib/commercetools-api/src/Models/Product/ProductChangeAssetOrderActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductChangeAssetOrderActionBuilder.php index 6f0afcf1431..36d31248a1f 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangeAssetOrderActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangeAssetOrderActionBuilder.php @@ -21,26 +21,33 @@ final class ProductChangeAssetOrderActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?bool */ private $staged; /** + * @var ?array */ private $assetOrder; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -49,6 +56,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -57,6 +67,9 @@ public function getSku() } /** + *

    If true, only the staged assets is updated. If false, both the current and staged assets are updated.

    + * + * @return null|bool */ public function getStaged() @@ -65,6 +78,9 @@ public function getStaged() } /** + *

    All existing Asset ids of the ProductVariant in the desired new order.

    + * + * @return null|array */ public function getAssetOrder() diff --git a/lib/commercetools-api/src/Models/Product/ProductChangeAssetOrderActionModel.php b/lib/commercetools-api/src/Models/Product/ProductChangeAssetOrderActionModel.php index 7a84551833f..1a2d76cff97 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangeAssetOrderActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangeAssetOrderActionModel.php @@ -21,26 +21,31 @@ final class ProductChangeAssetOrderActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'changeAssetOrder'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?bool */ protected $staged; /** + * * @var ?array */ protected $assetOrder; @@ -53,16 +58,18 @@ public function __construct( ?int $variantId = null, ?string $sku = null, ?bool $staged = null, - ?array $assetOrder = null + ?array $assetOrder = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; $this->staged = $staged; $this->assetOrder = $assetOrder; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -80,6 +87,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -97,6 +107,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -114,6 +127,9 @@ public function getSku() } /** + *

    If true, only the staged assets is updated. If false, both the current and staged assets are updated.

    + * + * * @return null|bool */ public function getStaged() @@ -131,6 +147,9 @@ public function getStaged() } /** + *

    All existing Asset ids of the ProductVariant in the desired new order.

    + * + * * @return null|array */ public function getAssetOrder() diff --git a/lib/commercetools-api/src/Models/Product/ProductChangeMasterVariantAction.php b/lib/commercetools-api/src/Models/Product/ProductChangeMasterVariantAction.php index 92c4fee3108..8092d9cd52a 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangeMasterVariantAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangeMasterVariantAction.php @@ -18,16 +18,25 @@ interface ProductChangeMasterVariantAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    The id of the ProductVariant to become the Master Variant.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to become the Master Variant.

    + * + * @return null|string */ public function getSku(); /** + *

    If true, only the staged Master Variant is changed. If false, both the current and staged Master Variant are changed.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductChangeMasterVariantActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductChangeMasterVariantActionBuilder.php index 90274d2339c..7392ecf99e0 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangeMasterVariantActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangeMasterVariantActionBuilder.php @@ -21,21 +21,27 @@ final class ProductChangeMasterVariantActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?bool */ private $staged; /** + *

    The id of the ProductVariant to become the Master Variant.

    + * + * @return null|int */ public function getVariantId() @@ -44,6 +50,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to become the Master Variant.

    + * + * @return null|string */ public function getSku() @@ -52,6 +61,9 @@ public function getSku() } /** + *

    If true, only the staged Master Variant is changed. If false, both the current and staged Master Variant are changed.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductChangeMasterVariantActionModel.php b/lib/commercetools-api/src/Models/Product/ProductChangeMasterVariantActionModel.php index 19fdcd96206..3decd99ff8f 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangeMasterVariantActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangeMasterVariantActionModel.php @@ -21,21 +21,25 @@ final class ProductChangeMasterVariantActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'changeMasterVariant'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?bool */ protected $staged; @@ -47,15 +51,17 @@ final class ProductChangeMasterVariantActionModel extends JsonObjectModel implem public function __construct( ?int $variantId = null, ?string $sku = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to become the Master Variant.

    + * + * * @return null|int */ public function getVariantId() @@ -90,6 +99,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to become the Master Variant.

    + * + * * @return null|string */ public function getSku() @@ -107,6 +119,9 @@ public function getSku() } /** + *

    If true, only the staged Master Variant is changed. If false, both the current and staged Master Variant are changed.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductChangeNameAction.php b/lib/commercetools-api/src/Models/Product/ProductChangeNameAction.php index 7172bc84269..bc5d8253e1f 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangeNameAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangeNameAction.php @@ -18,11 +18,17 @@ interface ProductChangeNameAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    Value to set. Must not be empty.

    + * + * @return null|LocalizedString */ public function getName(); /** + *

    If true, only the staged name is updated. If false, both the current and staged name are updated.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductChangeNameActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductChangeNameActionBuilder.php index 116f6e00355..db8a98c4dec 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangeNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangeNameActionBuilder.php @@ -23,16 +23,21 @@ final class ProductChangeNameActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?bool */ private $staged; /** + *

    Value to set. Must not be empty.

    + * + * @return null|LocalizedString */ public function getName() @@ -41,6 +46,9 @@ public function getName() } /** + *

    If true, only the staged name is updated. If false, both the current and staged name are updated.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductChangeNameActionModel.php b/lib/commercetools-api/src/Models/Product/ProductChangeNameActionModel.php index 5fb2496a3a9..35e10bd681c 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangeNameActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangeNameActionModel.php @@ -23,16 +23,19 @@ final class ProductChangeNameActionModel extends JsonObjectModel implements Prod { public const DISCRIMINATOR_VALUE = 'changeName'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?bool */ protected $staged; @@ -43,14 +46,16 @@ final class ProductChangeNameActionModel extends JsonObjectModel implements Prod */ public function __construct( ?LocalizedString $name = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->name = $name; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,9 @@ public function getAction() } /** + *

    Value to set. Must not be empty.

    + * + * * @return null|LocalizedString */ public function getName() @@ -86,6 +94,9 @@ public function getName() } /** + *

    If true, only the staged name is updated. If false, both the current and staged name are updated.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductChangePriceAction.php b/lib/commercetools-api/src/Models/Product/ProductChangePriceAction.php index 71e90c3589f..f27ce178e4a 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangePriceAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangePriceAction.php @@ -19,18 +19,25 @@ interface ProductChangePriceAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** - *

    ID of the EmbeddedPrice

    + *

    The id of the Embedded Price to update.

    * + * @return null|string */ public function getPriceId(); /** + *

    Value to set.

    + * + * @return null|PriceDraft */ public function getPrice(); /** + *

    If true, only the staged Embedded Price is updated. If false, both the current and staged Embedded Price are updated.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductChangePriceActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductChangePriceActionBuilder.php index 2aac1d0d8b6..7f462290ae2 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangePriceActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangePriceActionBuilder.php @@ -23,23 +23,27 @@ final class ProductChangePriceActionBuilder implements Builder { /** + * @var ?string */ private $priceId; /** + * @var null|PriceDraft|PriceDraftBuilder */ private $price; /** + * @var ?bool */ private $staged; /** - *

    ID of the EmbeddedPrice

    + *

    The id of the Embedded Price to update.

    * + * @return null|string */ public function getPriceId() @@ -48,6 +52,9 @@ public function getPriceId() } /** + *

    Value to set.

    + * + * @return null|PriceDraft */ public function getPrice() @@ -56,6 +63,9 @@ public function getPrice() } /** + *

    If true, only the staged Embedded Price is updated. If false, both the current and staged Embedded Price are updated.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductChangePriceActionModel.php b/lib/commercetools-api/src/Models/Product/ProductChangePriceActionModel.php index 57628f1b4eb..68a1b6dcc9d 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangePriceActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangePriceActionModel.php @@ -23,21 +23,25 @@ final class ProductChangePriceActionModel extends JsonObjectModel implements Pro { public const DISCRIMINATOR_VALUE = 'changePrice'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $priceId; /** + * * @var ?PriceDraft */ protected $price; /** + * * @var ?bool */ protected $staged; @@ -49,15 +53,17 @@ final class ProductChangePriceActionModel extends JsonObjectModel implements Pro public function __construct( ?string $priceId = null, ?PriceDraft $price = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->priceId = $priceId; $this->price = $price; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -75,7 +81,8 @@ public function getAction() } /** - *

    ID of the EmbeddedPrice

    + *

    The id of the Embedded Price to update.

    + * * * @return null|string */ @@ -94,6 +101,9 @@ public function getPriceId() } /** + *

    Value to set.

    + * + * * @return null|PriceDraft */ public function getPrice() @@ -112,6 +122,9 @@ public function getPrice() } /** + *

    If true, only the staged Embedded Price is updated. If false, both the current and staged Embedded Price are updated.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductChangeSlugAction.php b/lib/commercetools-api/src/Models/Product/ProductChangeSlugAction.php index e47bc43e051..9710062d7b6 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangeSlugAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangeSlugAction.php @@ -18,15 +18,17 @@ interface ProductChangeSlugAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** - *

    Every slug must be unique across a project, but a product can have the same slug for different languages. - * Allowed are alphabetic, numeric, underscore (_) and hyphen (-) characters. - * Maximum size is 256.

    + *

    Value to set. Must not be empty. A Product can have the same slug for different Locales, but it must be unique across the Project. Must match the pattern ^[A-Za-z0-9_-]{2,256}+$.

    * + * @return null|LocalizedString */ public function getSlug(); /** + *

    If true, only the staged slug is updated. If false, both the current and staged slug are updated.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductChangeSlugActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductChangeSlugActionBuilder.php index 45a004d5a16..bb8fee86439 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangeSlugActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangeSlugActionBuilder.php @@ -23,20 +23,21 @@ final class ProductChangeSlugActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @var ?bool */ private $staged; /** - *

    Every slug must be unique across a project, but a product can have the same slug for different languages. - * Allowed are alphabetic, numeric, underscore (_) and hyphen (-) characters. - * Maximum size is 256.

    + *

    Value to set. Must not be empty. A Product can have the same slug for different Locales, but it must be unique across the Project. Must match the pattern ^[A-Za-z0-9_-]{2,256}+$.

    * + * @return null|LocalizedString */ public function getSlug() @@ -45,6 +46,9 @@ public function getSlug() } /** + *

    If true, only the staged slug is updated. If false, both the current and staged slug are updated.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductChangeSlugActionModel.php b/lib/commercetools-api/src/Models/Product/ProductChangeSlugActionModel.php index 7ae3f053e1a..eea05bdeadc 100644 --- a/lib/commercetools-api/src/Models/Product/ProductChangeSlugActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductChangeSlugActionModel.php @@ -23,16 +23,19 @@ final class ProductChangeSlugActionModel extends JsonObjectModel implements Prod { public const DISCRIMINATOR_VALUE = 'changeSlug'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $slug; /** + * * @var ?bool */ protected $staged; @@ -43,14 +46,16 @@ final class ProductChangeSlugActionModel extends JsonObjectModel implements Prod */ public function __construct( ?LocalizedString $slug = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->slug = $slug; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,9 +73,8 @@ public function getAction() } /** - *

    Every slug must be unique across a project, but a product can have the same slug for different languages. - * Allowed are alphabetic, numeric, underscore (_) and hyphen (-) characters. - * Maximum size is 256.

    + *

    Value to set. Must not be empty. A Product can have the same slug for different Locales, but it must be unique across the Project. Must match the pattern ^[A-Za-z0-9_-]{2,256}+$.

    + * * * @return null|LocalizedString */ @@ -90,6 +94,9 @@ public function getSlug() } /** + *

    If true, only the staged slug is updated. If false, both the current and staged slug are updated.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductData.php b/lib/commercetools-api/src/Models/Product/ProductData.php index 449f48a4e48..6bbfd493834 100644 --- a/lib/commercetools-api/src/Models/Product/ProductData.php +++ b/lib/commercetools-api/src/Models/Product/ProductData.php @@ -28,68 +28,91 @@ interface ProductData extends JsonObject public const FIELD_SEARCH_KEYWORDS = 'searchKeywords'; /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Name of the Product.

    * + * @return null|LocalizedString */ public function getName(); /** + *

    Categories assigned to the Product.

    + * + * @return null|CategoryReferenceCollection */ public function getCategories(); /** + *

    Numerical values to allow ordering of Products within a specified Category.

    + * + * @return null|CategoryOrderHints */ public function getCategoryOrderHints(); /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Description of the Product.

    * + * @return null|LocalizedString */ public function getDescription(); /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    User-defined identifier used in a deep-link URL for the Product. + * Must be unique across a Project, but can be the same for Products in different Locales. + * Matches the pattern [a-zA-Z0-9_-]{2,256}.

    * + * @return null|LocalizedString */ public function getSlug(); /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Title of the Product displayed in search results.

    * + * @return null|LocalizedString */ public function getMetaTitle(); /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Description of the Product displayed in search results below the meta title.

    * + * @return null|LocalizedString */ public function getMetaDescription(); /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Keywords that give additional information about the Product to search engines.

    * + * @return null|LocalizedString */ public function getMetaKeywords(); /** + *

    The Master Variant of the Product.

    + * + * @return null|ProductVariant */ public function getMasterVariant(); /** + *

    Additional Product Variants.

    + * + * @return null|ProductVariantCollection */ public function getVariants(); /** + *

    Used by Product Suggestions, but is also considered for a full text search.

    + * + * @return null|SearchKeywords */ public function getSearchKeywords(); diff --git a/lib/commercetools-api/src/Models/Product/ProductDataBuilder.php b/lib/commercetools-api/src/Models/Product/ProductDataBuilder.php index 7898c208af7..a7fc1401dda 100644 --- a/lib/commercetools-api/src/Models/Product/ProductDataBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductDataBuilder.php @@ -24,63 +24,75 @@ final class ProductDataBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?CategoryReferenceCollection */ private $categories; /** + * @var null|CategoryOrderHints|CategoryOrderHintsBuilder */ private $categoryOrderHints; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaTitle; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaDescription; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaKeywords; /** + * @var null|ProductVariant|ProductVariantBuilder */ private $masterVariant; /** + * @var ?ProductVariantCollection */ private $variants; /** + * @var null|SearchKeywords|SearchKeywordsBuilder */ private $searchKeywords; /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Name of the Product.

    * + * @return null|LocalizedString */ public function getName() @@ -89,6 +101,9 @@ public function getName() } /** + *

    Categories assigned to the Product.

    + * + * @return null|CategoryReferenceCollection */ public function getCategories() @@ -97,6 +112,9 @@ public function getCategories() } /** + *

    Numerical values to allow ordering of Products within a specified Category.

    + * + * @return null|CategoryOrderHints */ public function getCategoryOrderHints() @@ -105,8 +123,9 @@ public function getCategoryOrderHints() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Description of the Product.

    * + * @return null|LocalizedString */ public function getDescription() @@ -115,8 +134,11 @@ public function getDescription() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    User-defined identifier used in a deep-link URL for the Product. + * Must be unique across a Project, but can be the same for Products in different Locales. + * Matches the pattern [a-zA-Z0-9_-]{2,256}.

    * + * @return null|LocalizedString */ public function getSlug() @@ -125,8 +147,9 @@ public function getSlug() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Title of the Product displayed in search results.

    * + * @return null|LocalizedString */ public function getMetaTitle() @@ -135,8 +158,9 @@ public function getMetaTitle() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Description of the Product displayed in search results below the meta title.

    * + * @return null|LocalizedString */ public function getMetaDescription() @@ -145,8 +169,9 @@ public function getMetaDescription() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Keywords that give additional information about the Product to search engines.

    * + * @return null|LocalizedString */ public function getMetaKeywords() @@ -155,6 +180,9 @@ public function getMetaKeywords() } /** + *

    The Master Variant of the Product.

    + * + * @return null|ProductVariant */ public function getMasterVariant() @@ -163,6 +191,9 @@ public function getMasterVariant() } /** + *

    Additional Product Variants.

    + * + * @return null|ProductVariantCollection */ public function getVariants() @@ -171,6 +202,9 @@ public function getVariants() } /** + *

    Used by Product Suggestions, but is also considered for a full text search.

    + * + * @return null|SearchKeywords */ public function getSearchKeywords() diff --git a/lib/commercetools-api/src/Models/Product/ProductDataModel.php b/lib/commercetools-api/src/Models/Product/ProductDataModel.php index 699bd3640f9..6b15c140a43 100644 --- a/lib/commercetools-api/src/Models/Product/ProductDataModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductDataModel.php @@ -23,56 +23,67 @@ final class ProductDataModel extends JsonObjectModel implements ProductData { /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?CategoryReferenceCollection */ protected $categories; /** + * * @var ?CategoryOrderHints */ protected $categoryOrderHints; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?LocalizedString */ protected $slug; /** + * * @var ?LocalizedString */ protected $metaTitle; /** + * * @var ?LocalizedString */ protected $metaDescription; /** + * * @var ?LocalizedString */ protected $metaKeywords; /** + * * @var ?ProductVariant */ protected $masterVariant; /** + * * @var ?ProductVariantCollection */ protected $variants; /** + * * @var ?SearchKeywords */ protected $searchKeywords; @@ -108,7 +119,8 @@ public function __construct( } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Name of the Product.

    + * * * @return null|LocalizedString */ @@ -128,6 +140,9 @@ public function getName() } /** + *

    Categories assigned to the Product.

    + * + * * @return null|CategoryReferenceCollection */ public function getCategories() @@ -145,6 +160,9 @@ public function getCategories() } /** + *

    Numerical values to allow ordering of Products within a specified Category.

    + * + * * @return null|CategoryOrderHints */ public function getCategoryOrderHints() @@ -163,7 +181,8 @@ public function getCategoryOrderHints() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Description of the Product.

    + * * * @return null|LocalizedString */ @@ -183,7 +202,10 @@ public function getDescription() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    User-defined identifier used in a deep-link URL for the Product. + * Must be unique across a Project, but can be the same for Products in different Locales. + * Matches the pattern [a-zA-Z0-9_-]{2,256}.

    + * * * @return null|LocalizedString */ @@ -203,7 +225,8 @@ public function getSlug() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Title of the Product displayed in search results.

    + * * * @return null|LocalizedString */ @@ -223,7 +246,8 @@ public function getMetaTitle() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Description of the Product displayed in search results below the meta title.

    + * * * @return null|LocalizedString */ @@ -243,7 +267,8 @@ public function getMetaDescription() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Keywords that give additional information about the Product to search engines.

    + * * * @return null|LocalizedString */ @@ -263,6 +288,9 @@ public function getMetaKeywords() } /** + *

    The Master Variant of the Product.

    + * + * * @return null|ProductVariant */ public function getMasterVariant() @@ -281,6 +309,9 @@ public function getMasterVariant() } /** + *

    Additional Product Variants.

    + * + * * @return null|ProductVariantCollection */ public function getVariants() @@ -298,6 +329,9 @@ public function getVariants() } /** + *

    Used by Product Suggestions, but is also considered for a full text search.

    + * + * * @return null|SearchKeywords */ public function getSearchKeywords() diff --git a/lib/commercetools-api/src/Models/Product/ProductDraft.php b/lib/commercetools-api/src/Models/Product/ProductDraft.php index 9a3f7603485..79a67ee4410 100644 --- a/lib/commercetools-api/src/Models/Product/ProductDraft.php +++ b/lib/commercetools-api/src/Models/Product/ProductDraft.php @@ -37,24 +37,27 @@ interface ProductDraft extends JsonObject public const FIELD_PRICE_MODE = 'priceMode'; /** - *

    A predefined product type assigned to the product. - * All products must have a product type.

    + *

    The Product Type defining the Attributes for the Product. Cannot be changed later.

    * + * @return null|ProductTypeResourceIdentifier */ public function getProductType(); /** + *

    Name of the Product.

    + * + * @return null|LocalizedString */ public function getName(); /** - *

    Human-readable identifiers usually used as deep-link URLs for the product. - * A slug must be unique across a project, but a product can have the same slug for different languages. - * Slugs have a maximum size of 256. - * Valid characters are: alphabetic characters (A-Z, a-z), numeric characters (0-9), underscores (_) and hyphens (-).

    + *

    User-defined identifier used in a deep-link URL for the Product. + * It must be unique across a Project, but a Product can have the same slug in different Locales. + * It must match the pattern [a-zA-Z0-9_-]{2,256}.

    * + * @return null|LocalizedString */ public function getSlug(); @@ -62,82 +65,111 @@ public function getSlug(); /** *

    User-defined unique identifier for the Product.

    * + * @return null|string */ public function getKey(); /** + *

    Description of the Product.

    + * + * @return null|LocalizedString */ public function getDescription(); /** - *

    Categories assigned to the product.

    + *

    Categories assigned to the Product.

    * + * @return null|CategoryResourceIdentifierCollection */ public function getCategories(); /** + *

    Numerical values to allow ordering of Products within a specified Category.

    + * + * @return null|CategoryOrderHints */ public function getCategoryOrderHints(); /** + *

    Title of the Product displayed in search results.

    + * + * @return null|LocalizedString */ public function getMetaTitle(); /** + *

    Description of the Product displayed in search results.

    + * + * @return null|LocalizedString */ public function getMetaDescription(); /** + *

    Keywords that give additional information about the Product to search engines.

    + * + * @return null|LocalizedString */ public function getMetaKeywords(); /** - *

    The master product variant. - * Required if the variants array has product variants.

    + *

    The Product Variant to be the Master Variant for the Product. Required if variants are provided also.

    * + * @return null|ProductVariantDraft */ public function getMasterVariant(); /** - *

    An array of related product variants.

    + *

    The additional Product Variants for the Product.

    * + * @return null|ProductVariantDraftCollection */ public function getVariants(); /** + *

    The Tax Category to be assigned to the Product.

    + * + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory(); /** + *

    Used by Product Suggestions, but is also considered for a full text search.

    + * + * @return null|SearchKeywords */ public function getSearchKeywords(); /** + *

    State to be assigned to the Product.

    + * + * @return null|StateResourceIdentifier */ public function getState(); /** - *

    If true, the product is published immediately.

    + *

    If true, the Product is published immediately to the current projection.

    * + * @return null|bool */ public function getPublish(); /** - *

    Specifies which type of prices should be used when looking up a price for this product. If not set, Embedded ProductPriceMode is used.

    + *

    Specifies the type of prices used when looking up a price for the Product.

    * + * @return null|string */ public function getPriceMode(); diff --git a/lib/commercetools-api/src/Models/Product/ProductDraftBuilder.php b/lib/commercetools-api/src/Models/Product/ProductDraftBuilder.php index bbad51ce413..e0b8f0d59b9 100644 --- a/lib/commercetools-api/src/Models/Product/ProductDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductDraftBuilder.php @@ -30,94 +30,111 @@ final class ProductDraftBuilder implements Builder { /** + * @var null|ProductTypeResourceIdentifier|ProductTypeResourceIdentifierBuilder */ private $productType; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?CategoryResourceIdentifierCollection */ private $categories; /** + * @var null|CategoryOrderHints|CategoryOrderHintsBuilder */ private $categoryOrderHints; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaTitle; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaDescription; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaKeywords; /** + * @var null|ProductVariantDraft|ProductVariantDraftBuilder */ private $masterVariant; /** + * @var ?ProductVariantDraftCollection */ private $variants; /** + * @var null|TaxCategoryResourceIdentifier|TaxCategoryResourceIdentifierBuilder */ private $taxCategory; /** + * @var null|SearchKeywords|SearchKeywordsBuilder */ private $searchKeywords; /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $state; /** + * @var ?bool */ private $publish; /** + * @var ?string */ private $priceMode; /** - *

    A predefined product type assigned to the product. - * All products must have a product type.

    + *

    The Product Type defining the Attributes for the Product. Cannot be changed later.

    * + * @return null|ProductTypeResourceIdentifier */ public function getProductType() @@ -126,6 +143,9 @@ public function getProductType() } /** + *

    Name of the Product.

    + * + * @return null|LocalizedString */ public function getName() @@ -134,11 +154,11 @@ public function getName() } /** - *

    Human-readable identifiers usually used as deep-link URLs for the product. - * A slug must be unique across a project, but a product can have the same slug for different languages. - * Slugs have a maximum size of 256. - * Valid characters are: alphabetic characters (A-Z, a-z), numeric characters (0-9), underscores (_) and hyphens (-).

    + *

    User-defined identifier used in a deep-link URL for the Product. + * It must be unique across a Project, but a Product can have the same slug in different Locales. + * It must match the pattern [a-zA-Z0-9_-]{2,256}.

    * + * @return null|LocalizedString */ public function getSlug() @@ -149,6 +169,7 @@ public function getSlug() /** *

    User-defined unique identifier for the Product.

    * + * @return null|string */ public function getKey() @@ -157,6 +178,9 @@ public function getKey() } /** + *

    Description of the Product.

    + * + * @return null|LocalizedString */ public function getDescription() @@ -165,8 +189,9 @@ public function getDescription() } /** - *

    Categories assigned to the product.

    + *

    Categories assigned to the Product.

    * + * @return null|CategoryResourceIdentifierCollection */ public function getCategories() @@ -175,6 +200,9 @@ public function getCategories() } /** + *

    Numerical values to allow ordering of Products within a specified Category.

    + * + * @return null|CategoryOrderHints */ public function getCategoryOrderHints() @@ -183,6 +211,9 @@ public function getCategoryOrderHints() } /** + *

    Title of the Product displayed in search results.

    + * + * @return null|LocalizedString */ public function getMetaTitle() @@ -191,6 +222,9 @@ public function getMetaTitle() } /** + *

    Description of the Product displayed in search results.

    + * + * @return null|LocalizedString */ public function getMetaDescription() @@ -199,6 +233,9 @@ public function getMetaDescription() } /** + *

    Keywords that give additional information about the Product to search engines.

    + * + * @return null|LocalizedString */ public function getMetaKeywords() @@ -207,9 +244,9 @@ public function getMetaKeywords() } /** - *

    The master product variant. - * Required if the variants array has product variants.

    + *

    The Product Variant to be the Master Variant for the Product. Required if variants are provided also.

    * + * @return null|ProductVariantDraft */ public function getMasterVariant() @@ -218,8 +255,9 @@ public function getMasterVariant() } /** - *

    An array of related product variants.

    + *

    The additional Product Variants for the Product.

    * + * @return null|ProductVariantDraftCollection */ public function getVariants() @@ -228,6 +266,9 @@ public function getVariants() } /** + *

    The Tax Category to be assigned to the Product.

    + * + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -236,6 +277,9 @@ public function getTaxCategory() } /** + *

    Used by Product Suggestions, but is also considered for a full text search.

    + * + * @return null|SearchKeywords */ public function getSearchKeywords() @@ -244,6 +288,9 @@ public function getSearchKeywords() } /** + *

    State to be assigned to the Product.

    + * + * @return null|StateResourceIdentifier */ public function getState() @@ -252,8 +299,9 @@ public function getState() } /** - *

    If true, the product is published immediately.

    + *

    If true, the Product is published immediately to the current projection.

    * + * @return null|bool */ public function getPublish() @@ -262,8 +310,9 @@ public function getPublish() } /** - *

    Specifies which type of prices should be used when looking up a price for this product. If not set, Embedded ProductPriceMode is used.

    + *

    Specifies the type of prices used when looking up a price for the Product.

    * + * @return null|string */ public function getPriceMode() diff --git a/lib/commercetools-api/src/Models/Product/ProductDraftModel.php b/lib/commercetools-api/src/Models/Product/ProductDraftModel.php index 8caffbf104c..f3cf3ae0131 100644 --- a/lib/commercetools-api/src/Models/Product/ProductDraftModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductDraftModel.php @@ -29,86 +29,103 @@ final class ProductDraftModel extends JsonObjectModel implements ProductDraft { /** + * * @var ?ProductTypeResourceIdentifier */ protected $productType; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $slug; /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?CategoryResourceIdentifierCollection */ protected $categories; /** + * * @var ?CategoryOrderHints */ protected $categoryOrderHints; /** + * * @var ?LocalizedString */ protected $metaTitle; /** + * * @var ?LocalizedString */ protected $metaDescription; /** + * * @var ?LocalizedString */ protected $metaKeywords; /** + * * @var ?ProductVariantDraft */ protected $masterVariant; /** + * * @var ?ProductVariantDraftCollection */ protected $variants; /** + * * @var ?TaxCategoryResourceIdentifier */ protected $taxCategory; /** + * * @var ?SearchKeywords */ protected $searchKeywords; /** + * * @var ?StateResourceIdentifier */ protected $state; /** + * * @var ?bool */ protected $publish; /** + * * @var ?string */ protected $priceMode; @@ -156,8 +173,8 @@ public function __construct( } /** - *

    A predefined product type assigned to the product. - * All products must have a product type.

    + *

    The Product Type defining the Attributes for the Product. Cannot be changed later.

    + * * * @return null|ProductTypeResourceIdentifier */ @@ -177,6 +194,9 @@ public function getProductType() } /** + *

    Name of the Product.

    + * + * * @return null|LocalizedString */ public function getName() @@ -195,10 +215,10 @@ public function getName() } /** - *

    Human-readable identifiers usually used as deep-link URLs for the product. - * A slug must be unique across a project, but a product can have the same slug for different languages. - * Slugs have a maximum size of 256. - * Valid characters are: alphabetic characters (A-Z, a-z), numeric characters (0-9), underscores (_) and hyphens (-).

    + *

    User-defined identifier used in a deep-link URL for the Product. + * It must be unique across a Project, but a Product can have the same slug in different Locales. + * It must match the pattern [a-zA-Z0-9_-]{2,256}.

    + * * * @return null|LocalizedString */ @@ -220,6 +240,7 @@ public function getSlug() /** *

    User-defined unique identifier for the Product.

    * + * * @return null|string */ public function getKey() @@ -237,6 +258,9 @@ public function getKey() } /** + *

    Description of the Product.

    + * + * * @return null|LocalizedString */ public function getDescription() @@ -255,7 +279,8 @@ public function getDescription() } /** - *

    Categories assigned to the product.

    + *

    Categories assigned to the Product.

    + * * * @return null|CategoryResourceIdentifierCollection */ @@ -274,6 +299,9 @@ public function getCategories() } /** + *

    Numerical values to allow ordering of Products within a specified Category.

    + * + * * @return null|CategoryOrderHints */ public function getCategoryOrderHints() @@ -292,6 +320,9 @@ public function getCategoryOrderHints() } /** + *

    Title of the Product displayed in search results.

    + * + * * @return null|LocalizedString */ public function getMetaTitle() @@ -310,6 +341,9 @@ public function getMetaTitle() } /** + *

    Description of the Product displayed in search results.

    + * + * * @return null|LocalizedString */ public function getMetaDescription() @@ -328,6 +362,9 @@ public function getMetaDescription() } /** + *

    Keywords that give additional information about the Product to search engines.

    + * + * * @return null|LocalizedString */ public function getMetaKeywords() @@ -346,8 +383,8 @@ public function getMetaKeywords() } /** - *

    The master product variant. - * Required if the variants array has product variants.

    + *

    The Product Variant to be the Master Variant for the Product. Required if variants are provided also.

    + * * * @return null|ProductVariantDraft */ @@ -367,7 +404,8 @@ public function getMasterVariant() } /** - *

    An array of related product variants.

    + *

    The additional Product Variants for the Product.

    + * * * @return null|ProductVariantDraftCollection */ @@ -386,6 +424,9 @@ public function getVariants() } /** + *

    The Tax Category to be assigned to the Product.

    + * + * * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -404,6 +445,9 @@ public function getTaxCategory() } /** + *

    Used by Product Suggestions, but is also considered for a full text search.

    + * + * * @return null|SearchKeywords */ public function getSearchKeywords() @@ -422,6 +466,9 @@ public function getSearchKeywords() } /** + *

    State to be assigned to the Product.

    + * + * * @return null|StateResourceIdentifier */ public function getState() @@ -440,7 +487,8 @@ public function getState() } /** - *

    If true, the product is published immediately.

    + *

    If true, the Product is published immediately to the current projection.

    + * * * @return null|bool */ @@ -459,7 +507,8 @@ public function getPublish() } /** - *

    Specifies which type of prices should be used when looking up a price for this product. If not set, Embedded ProductPriceMode is used.

    + *

    Specifies the type of prices used when looking up a price for the Product.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Product/ProductLegacySetSkuAction.php b/lib/commercetools-api/src/Models/Product/ProductLegacySetSkuAction.php index 2c494a9b30b..8bcce652959 100644 --- a/lib/commercetools-api/src/Models/Product/ProductLegacySetSkuAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductLegacySetSkuAction.php @@ -17,11 +17,13 @@ interface ProductLegacySetSkuAction extends ProductUpdateAction public const FIELD_VARIANT_ID = 'variantId'; /** + * @return null|string */ public function getSku(); /** + * @return null|int */ public function getVariantId(); diff --git a/lib/commercetools-api/src/Models/Product/ProductLegacySetSkuActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductLegacySetSkuActionBuilder.php index 44c35e13f67..a0ace1c36e3 100644 --- a/lib/commercetools-api/src/Models/Product/ProductLegacySetSkuActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductLegacySetSkuActionBuilder.php @@ -21,16 +21,19 @@ final class ProductLegacySetSkuActionBuilder implements Builder { /** + * @var ?string */ private $sku; /** + * @var ?int */ private $variantId; /** + * @return null|string */ public function getSku() @@ -39,6 +42,7 @@ public function getSku() } /** + * @return null|int */ public function getVariantId() diff --git a/lib/commercetools-api/src/Models/Product/ProductLegacySetSkuActionModel.php b/lib/commercetools-api/src/Models/Product/ProductLegacySetSkuActionModel.php index 207105fde10..59fadf6fe0f 100644 --- a/lib/commercetools-api/src/Models/Product/ProductLegacySetSkuActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductLegacySetSkuActionModel.php @@ -21,16 +21,19 @@ final class ProductLegacySetSkuActionModel extends JsonObjectModel implements Pr { public const DISCRIMINATOR_VALUE = 'legacySetSku'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $sku; /** + * * @var ?int */ protected $variantId; @@ -41,14 +44,16 @@ final class ProductLegacySetSkuActionModel extends JsonObjectModel implements Pr */ public function __construct( ?string $sku = null, - ?int $variantId = null + ?int $variantId = null, + ?string $action = null ) { $this->sku = $sku; $this->variantId = $variantId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getSku() @@ -83,6 +89,7 @@ public function getSku() } /** + * * @return null|int */ public function getVariantId() diff --git a/lib/commercetools-api/src/Models/Product/ProductModel.php b/lib/commercetools-api/src/Models/Product/ProductModel.php index e097524ddd9..ef65e4325c3 100644 --- a/lib/commercetools-api/src/Models/Product/ProductModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductModel.php @@ -35,66 +35,79 @@ final class ProductModel extends JsonObjectModel implements Product { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $key; /** + * * @var ?ProductTypeReference */ protected $productType; /** + * * @var ?ProductCatalogData */ protected $masterData; /** + * * @var ?TaxCategoryReference */ protected $taxCategory; /** + * * @var ?StateReference */ protected $state; /** + * * @var ?ReviewRatingStatistics */ protected $reviewRatingStatistics; /** + * * @var ?string */ protected $priceMode; @@ -136,6 +149,7 @@ public function __construct( /** *

    Unique identifier of the Product.

    * + * * @return null|string */ public function getId() @@ -153,7 +167,8 @@ public function getId() } /** - *

    The current version of the product.

    + *

    Current version of the Product.

    + * * * @return null|int */ @@ -172,6 +187,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Product was initially created.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -193,6 +211,9 @@ public function getCreatedAt() } /** + *

    Date and time (UTC) the Product was last updated.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -214,7 +235,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * * * @return null|LastModifiedBy */ @@ -234,7 +256,8 @@ public function getLastModifiedBy() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * * * @return null|CreatedBy */ @@ -254,8 +277,9 @@ public function getCreatedBy() } /** - *

    User-defined unique identifier of the Product. - * Product keys are different from ProductVariant keys.

    + *

    User-defined unique identifier of the Product.

    + *

    This is different from the key of a ProductVariant.

    + * * * @return null|string */ @@ -274,6 +298,9 @@ public function getKey() } /** + *

    The Product Type defining the Attributes of the Product. Cannot be changed.

    + * + * * @return null|ProductTypeReference */ public function getProductType() @@ -292,7 +319,8 @@ public function getProductType() } /** - *

    The product data in the master catalog.

    + *

    Contains the current and the staged representation of the product information.

    + * * * @return null|ProductCatalogData */ @@ -312,6 +340,9 @@ public function getMasterData() } /** + *

    The TaxCategory of the Product.

    + * + * * @return null|TaxCategoryReference */ public function getTaxCategory() @@ -330,6 +361,9 @@ public function getTaxCategory() } /** + *

    State of the Product.

    + * + * * @return null|StateReference */ public function getState() @@ -348,7 +382,8 @@ public function getState() } /** - *

    Statistics about the review ratings taken into account for this product.

    + *

    Review statistics of the Product.

    + * * * @return null|ReviewRatingStatistics */ @@ -368,7 +403,8 @@ public function getReviewRatingStatistics() } /** - *

    Specifies which type of prices should be used when looking up a price for this product. If not set, Embedded ProductPriceMode is used.

    + *

    Type of Price to be used when looking up a price for the Product.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Product/ProductMoveImageToPositionAction.php b/lib/commercetools-api/src/Models/Product/ProductMoveImageToPositionAction.php index ddb59e040c8..78ac76d8d77 100644 --- a/lib/commercetools-api/src/Models/Product/ProductMoveImageToPositionAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductMoveImageToPositionAction.php @@ -20,28 +20,41 @@ interface ProductMoveImageToPositionAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** - *

    The URL of the image

    + *

    The URL of the image to update.

    * + * @return null|string */ public function getImageUrl(); /** + *

    Position in images where the image should be moved. Must be between 0 and the total number of images minus 1.

    + * + * @return null|int */ public function getPosition(); /** + *

    If true, only the staged images is updated. If false, both the current and staged images is updated.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductMoveImageToPositionActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductMoveImageToPositionActionBuilder.php index b54b704a1d7..6442b5cd949 100644 --- a/lib/commercetools-api/src/Models/Product/ProductMoveImageToPositionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductMoveImageToPositionActionBuilder.php @@ -21,31 +21,39 @@ final class ProductMoveImageToPositionActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?string */ private $imageUrl; /** + * @var ?int */ private $position; /** + * @var ?bool */ private $staged; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -54,6 +62,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -62,8 +73,9 @@ public function getSku() } /** - *

    The URL of the image

    + *

    The URL of the image to update.

    * + * @return null|string */ public function getImageUrl() @@ -72,6 +84,9 @@ public function getImageUrl() } /** + *

    Position in images where the image should be moved. Must be between 0 and the total number of images minus 1.

    + * + * @return null|int */ public function getPosition() @@ -80,6 +95,9 @@ public function getPosition() } /** + *

    If true, only the staged images is updated. If false, both the current and staged images is updated.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductMoveImageToPositionActionModel.php b/lib/commercetools-api/src/Models/Product/ProductMoveImageToPositionActionModel.php index 6e5b12229bb..c2e218c0d47 100644 --- a/lib/commercetools-api/src/Models/Product/ProductMoveImageToPositionActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductMoveImageToPositionActionModel.php @@ -21,31 +21,37 @@ final class ProductMoveImageToPositionActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'moveImageToPosition'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $imageUrl; /** + * * @var ?int */ protected $position; /** + * * @var ?bool */ protected $staged; @@ -59,17 +65,19 @@ public function __construct( ?string $sku = null, ?string $imageUrl = null, ?int $position = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; $this->imageUrl = $imageUrl; $this->position = $position; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -87,6 +95,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -104,6 +115,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -121,7 +135,8 @@ public function getSku() } /** - *

    The URL of the image

    + *

    The URL of the image to update.

    + * * * @return null|string */ @@ -140,6 +155,9 @@ public function getImageUrl() } /** + *

    Position in images where the image should be moved. Must be between 0 and the total number of images minus 1.

    + * + * * @return null|int */ public function getPosition() @@ -157,6 +175,9 @@ public function getPosition() } /** + *

    If true, only the staged images is updated. If false, both the current and staged images is updated.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductPagedQueryResponse.php b/lib/commercetools-api/src/Models/Product/ProductPagedQueryResponse.php index e58c0ee4236..5f4502b3594 100644 --- a/lib/commercetools-api/src/Models/Product/ProductPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Product/ProductPagedQueryResponse.php @@ -14,36 +14,51 @@ interface ProductPagedQueryResponse extends JsonObject { public const FIELD_LIMIT = 'limit'; + public const FIELD_OFFSET = 'offset'; public const FIELD_COUNT = 'count'; public const FIELD_TOTAL = 'total'; - public const FIELD_OFFSET = 'offset'; public const FIELD_RESULTS = 'results'; /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); /** + *

    Number of elements skipped.

    + * + * @return null|int */ - public function getCount(); + public function getOffset(); /** + *

    Actual number of results returned.

    + * + * @return null|int */ - public function getTotal(); + public function getCount(); /** - *

    Number of elements skipped.

    + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ - public function getOffset(); + public function getTotal(); /** + *

    Products matching the query.

    + * + * @return null|ProductCollection */ public function getResults(); @@ -53,6 +68,11 @@ public function getResults(); */ public function setLimit(?int $limit): void; + /** + * @param ?int $offset + */ + public function setOffset(?int $offset): void; + /** * @param ?int $count */ @@ -63,11 +83,6 @@ public function setCount(?int $count): void; */ public function setTotal(?int $total): void; - /** - * @param ?int $offset - */ - public function setOffset(?int $offset): void; - /** * @param ?ProductCollection $results */ diff --git a/lib/commercetools-api/src/Models/Product/ProductPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Product/ProductPagedQueryResponseBuilder.php index fc6afeeb7a8..0a3150d8915 100644 --- a/lib/commercetools-api/src/Models/Product/ProductPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class ProductPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ - private $count; + private $offset; /** + * @var ?int */ - private $total; + private $count; /** + * @var ?int */ - private $offset; + private $total; /** + * @var ?ProductCollection */ private $results; @@ -48,6 +53,7 @@ final class ProductPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -56,32 +62,46 @@ public function getLimit() } /** + *

    Number of elements skipped.

    + * + * @return null|int */ - public function getCount() + public function getOffset() { - return $this->count; + return $this->offset; } /** + *

    Actual number of results returned.

    + * + * @return null|int */ - public function getTotal() + public function getCount() { - return $this->total; + return $this->count; } /** - *

    Number of elements skipped.

    + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ - public function getOffset() + public function getTotal() { - return $this->offset; + return $this->total; } /** + *

    Products matching the query.

    + * + * @return null|ProductCollection */ public function getResults() @@ -101,34 +121,34 @@ public function withLimit(?int $limit) } /** - * @param ?int $count + * @param ?int $offset * @return $this */ - public function withCount(?int $count) + public function withOffset(?int $offset) { - $this->count = $count; + $this->offset = $offset; return $this; } /** - * @param ?int $total + * @param ?int $count * @return $this */ - public function withTotal(?int $total) + public function withCount(?int $count) { - $this->total = $total; + $this->count = $count; return $this; } /** - * @param ?int $offset + * @param ?int $total * @return $this */ - public function withOffset(?int $offset) + public function withTotal(?int $total) { - $this->offset = $offset; + $this->total = $total; return $this; } @@ -149,9 +169,9 @@ public function build(): ProductPagedQueryResponse { return new ProductPagedQueryResponseModel( $this->limit, + $this->offset, $this->count, $this->total, - $this->offset, $this->results ); } diff --git a/lib/commercetools-api/src/Models/Product/ProductPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Product/ProductPagedQueryResponseModel.php index f6a1331bbe3..2db2113e8c8 100644 --- a/lib/commercetools-api/src/Models/Product/ProductPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class ProductPagedQueryResponseModel extends JsonObjectModel implements ProductPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ - protected $count; + protected $offset; /** + * * @var ?int */ - protected $total; + protected $count; /** + * * @var ?int */ - protected $offset; + protected $total; /** + * * @var ?ProductCollection */ protected $results; @@ -50,21 +55,22 @@ final class ProductPagedQueryResponseModel extends JsonObjectModel implements Pr */ public function __construct( ?int $limit = null, + ?int $offset = null, ?int $count = null, ?int $total = null, - ?int $offset = null, ?ProductCollection $results = null ) { $this->limit = $limit; + $this->offset = $offset; $this->count = $count; $this->total = $total; - $this->offset = $offset; $this->results = $results; } /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -82,59 +88,73 @@ public function getLimit() } /** + *

    Number of elements skipped.

    + * + * * @return null|int */ - public function getCount() + public function getOffset() { - if (is_null($this->count)) { + if (is_null($this->offset)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_COUNT); + $data = $this->raw(self::FIELD_OFFSET); if (is_null($data)) { return null; } - $this->count = (int) $data; + $this->offset = (int) $data; } - return $this->count; + return $this->offset; } /** + *

    Actual number of results returned.

    + * + * * @return null|int */ - public function getTotal() + public function getCount() { - if (is_null($this->total)) { + if (is_null($this->count)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_TOTAL); + $data = $this->raw(self::FIELD_COUNT); if (is_null($data)) { return null; } - $this->total = (int) $data; + $this->count = (int) $data; } - return $this->total; + return $this->count; } /** - *

    Number of elements skipped.

    + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    + * * * @return null|int */ - public function getOffset() + public function getTotal() { - if (is_null($this->offset)) { + if (is_null($this->total)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_OFFSET); + $data = $this->raw(self::FIELD_TOTAL); if (is_null($data)) { return null; } - $this->offset = (int) $data; + $this->total = (int) $data; } - return $this->offset; + return $this->total; } /** + *

    Products matching the query.

    + * + * * @return null|ProductCollection */ public function getResults() @@ -160,6 +180,14 @@ public function setLimit(?int $limit): void $this->limit = $limit; } + /** + * @param ?int $offset + */ + public function setOffset(?int $offset): void + { + $this->offset = $offset; + } + /** * @param ?int $count */ @@ -176,14 +204,6 @@ public function setTotal(?int $total): void $this->total = $total; } - /** - * @param ?int $offset - */ - public function setOffset(?int $offset): void - { - $this->offset = $offset; - } - /** * @param ?ProductCollection $results */ diff --git a/lib/commercetools-api/src/Models/Product/ProductProjection.php b/lib/commercetools-api/src/Models/Product/ProductProjection.php index 8ea17c3c6f4..b0a4dfd4fdf 100644 --- a/lib/commercetools-api/src/Models/Product/ProductProjection.php +++ b/lib/commercetools-api/src/Models/Product/ProductProjection.php @@ -42,6 +42,7 @@ interface ProductProjection extends BaseResource /** *

    The unique ID of the Product.

    * + * @return null|string */ public function getId(); @@ -49,6 +50,7 @@ public function getId(); /** *

    The current version of the Product.

    * + * @return null|int */ public function getVersion(); @@ -56,26 +58,31 @@ public function getVersion(); /** *

    User-specific unique identifier of the Product.

    * + * @return null|string */ public function getKey(); /** + * @return null|ProductTypeReference */ public function getProductType(); /** + * @return null|LocalizedString */ public function getName(); /** + * @return null|LocalizedString */ public function getDescription(); /** + * @return null|LocalizedString */ public function getSlug(); @@ -83,61 +90,73 @@ public function getSlug(); /** *

    References to categories the product is in.

    * + * @return null|CategoryReferenceCollection */ public function getCategories(); /** + * @return null|CategoryOrderHints */ public function getCategoryOrderHints(); /** + * @return null|LocalizedString */ public function getMetaTitle(); /** + * @return null|LocalizedString */ public function getMetaDescription(); /** + * @return null|LocalizedString */ public function getMetaKeywords(); /** + * @return null|SearchKeywords */ public function getSearchKeywords(); /** + * @return null|bool */ public function getHasStagedChanges(); /** + * @return null|bool */ public function getPublished(); /** + * @return null|ProductVariant */ public function getMasterVariant(); /** + * @return null|ProductVariantCollection */ public function getVariants(); /** + * @return null|TaxCategoryReference */ public function getTaxCategory(); /** + * @return null|StateReference */ public function getState(); @@ -145,6 +164,7 @@ public function getState(); /** *

    Statistics about the review ratings taken into account for this product.

    * + * @return null|ReviewRatingStatistics */ public function getReviewRatingStatistics(); diff --git a/lib/commercetools-api/src/Models/Product/ProductProjectionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductProjectionBuilder.php index 3ac3380ce77..61c7f9856e8 100644 --- a/lib/commercetools-api/src/Models/Product/ProductProjectionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductProjectionBuilder.php @@ -35,111 +35,133 @@ final class ProductProjectionBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var ?string */ private $key; /** + * @var null|ProductTypeReference|ProductTypeReferenceBuilder */ private $productType; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @var ?CategoryReferenceCollection */ private $categories; /** + * @var null|CategoryOrderHints|CategoryOrderHintsBuilder */ private $categoryOrderHints; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaTitle; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaDescription; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaKeywords; /** + * @var null|SearchKeywords|SearchKeywordsBuilder */ private $searchKeywords; /** + * @var ?bool */ private $hasStagedChanges; /** + * @var ?bool */ private $published; /** + * @var null|ProductVariant|ProductVariantBuilder */ private $masterVariant; /** + * @var ?ProductVariantCollection */ private $variants; /** + * @var null|TaxCategoryReference|TaxCategoryReferenceBuilder */ private $taxCategory; /** + * @var null|StateReference|StateReferenceBuilder */ private $state; /** + * @var null|ReviewRatingStatistics|ReviewRatingStatisticsBuilder */ private $reviewRatingStatistics; @@ -147,6 +169,7 @@ final class ProductProjectionBuilder implements Builder /** *

    The unique ID of the Product.

    * + * @return null|string */ public function getId() @@ -157,6 +180,7 @@ public function getId() /** *

    The current version of the Product.

    * + * @return null|int */ public function getVersion() @@ -165,6 +189,7 @@ public function getVersion() } /** + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -173,6 +198,7 @@ public function getCreatedAt() } /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -183,6 +209,7 @@ public function getLastModifiedAt() /** *

    User-specific unique identifier of the Product.

    * + * @return null|string */ public function getKey() @@ -191,6 +218,7 @@ public function getKey() } /** + * @return null|ProductTypeReference */ public function getProductType() @@ -199,6 +227,7 @@ public function getProductType() } /** + * @return null|LocalizedString */ public function getName() @@ -207,6 +236,7 @@ public function getName() } /** + * @return null|LocalizedString */ public function getDescription() @@ -215,6 +245,7 @@ public function getDescription() } /** + * @return null|LocalizedString */ public function getSlug() @@ -225,6 +256,7 @@ public function getSlug() /** *

    References to categories the product is in.

    * + * @return null|CategoryReferenceCollection */ public function getCategories() @@ -233,6 +265,7 @@ public function getCategories() } /** + * @return null|CategoryOrderHints */ public function getCategoryOrderHints() @@ -241,6 +274,7 @@ public function getCategoryOrderHints() } /** + * @return null|LocalizedString */ public function getMetaTitle() @@ -249,6 +283,7 @@ public function getMetaTitle() } /** + * @return null|LocalizedString */ public function getMetaDescription() @@ -257,6 +292,7 @@ public function getMetaDescription() } /** + * @return null|LocalizedString */ public function getMetaKeywords() @@ -265,6 +301,7 @@ public function getMetaKeywords() } /** + * @return null|SearchKeywords */ public function getSearchKeywords() @@ -273,6 +310,7 @@ public function getSearchKeywords() } /** + * @return null|bool */ public function getHasStagedChanges() @@ -281,6 +319,7 @@ public function getHasStagedChanges() } /** + * @return null|bool */ public function getPublished() @@ -289,6 +328,7 @@ public function getPublished() } /** + * @return null|ProductVariant */ public function getMasterVariant() @@ -297,6 +337,7 @@ public function getMasterVariant() } /** + * @return null|ProductVariantCollection */ public function getVariants() @@ -305,6 +346,7 @@ public function getVariants() } /** + * @return null|TaxCategoryReference */ public function getTaxCategory() @@ -313,6 +355,7 @@ public function getTaxCategory() } /** + * @return null|StateReference */ public function getState() @@ -323,6 +366,7 @@ public function getState() /** *

    Statistics about the review ratings taken into account for this product.

    * + * @return null|ReviewRatingStatistics */ public function getReviewRatingStatistics() diff --git a/lib/commercetools-api/src/Models/Product/ProductProjectionModel.php b/lib/commercetools-api/src/Models/Product/ProductProjectionModel.php index 156c83ceaf2..0b183c35892 100644 --- a/lib/commercetools-api/src/Models/Product/ProductProjectionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductProjectionModel.php @@ -34,111 +34,133 @@ final class ProductProjectionModel extends JsonObjectModel implements ProductProjection { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?string */ protected $key; /** + * * @var ?ProductTypeReference */ protected $productType; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?LocalizedString */ protected $slug; /** + * * @var ?CategoryReferenceCollection */ protected $categories; /** + * * @var ?CategoryOrderHints */ protected $categoryOrderHints; /** + * * @var ?LocalizedString */ protected $metaTitle; /** + * * @var ?LocalizedString */ protected $metaDescription; /** + * * @var ?LocalizedString */ protected $metaKeywords; /** + * * @var ?SearchKeywords */ protected $searchKeywords; /** + * * @var ?bool */ protected $hasStagedChanges; /** + * * @var ?bool */ protected $published; /** + * * @var ?ProductVariant */ protected $masterVariant; /** + * * @var ?ProductVariantCollection */ protected $variants; /** + * * @var ?TaxCategoryReference */ protected $taxCategory; /** + * * @var ?StateReference */ protected $state; /** + * * @var ?ReviewRatingStatistics */ protected $reviewRatingStatistics; @@ -198,6 +220,7 @@ public function __construct( /** *

    The unique ID of the Product.

    * + * * @return null|string */ public function getId() @@ -217,6 +240,7 @@ public function getId() /** *

    The current version of the Product.

    * + * * @return null|int */ public function getVersion() @@ -234,6 +258,7 @@ public function getVersion() } /** + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -255,6 +280,7 @@ public function getCreatedAt() } /** + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -278,6 +304,7 @@ public function getLastModifiedAt() /** *

    User-specific unique identifier of the Product.

    * + * * @return null|string */ public function getKey() @@ -295,6 +322,7 @@ public function getKey() } /** + * * @return null|ProductTypeReference */ public function getProductType() @@ -313,6 +341,7 @@ public function getProductType() } /** + * * @return null|LocalizedString */ public function getName() @@ -331,6 +360,7 @@ public function getName() } /** + * * @return null|LocalizedString */ public function getDescription() @@ -349,6 +379,7 @@ public function getDescription() } /** + * * @return null|LocalizedString */ public function getSlug() @@ -369,6 +400,7 @@ public function getSlug() /** *

    References to categories the product is in.

    * + * * @return null|CategoryReferenceCollection */ public function getCategories() @@ -386,6 +418,7 @@ public function getCategories() } /** + * * @return null|CategoryOrderHints */ public function getCategoryOrderHints() @@ -404,6 +437,7 @@ public function getCategoryOrderHints() } /** + * * @return null|LocalizedString */ public function getMetaTitle() @@ -422,6 +456,7 @@ public function getMetaTitle() } /** + * * @return null|LocalizedString */ public function getMetaDescription() @@ -440,6 +475,7 @@ public function getMetaDescription() } /** + * * @return null|LocalizedString */ public function getMetaKeywords() @@ -458,6 +494,7 @@ public function getMetaKeywords() } /** + * * @return null|SearchKeywords */ public function getSearchKeywords() @@ -476,6 +513,7 @@ public function getSearchKeywords() } /** + * * @return null|bool */ public function getHasStagedChanges() @@ -493,6 +531,7 @@ public function getHasStagedChanges() } /** + * * @return null|bool */ public function getPublished() @@ -510,6 +549,7 @@ public function getPublished() } /** + * * @return null|ProductVariant */ public function getMasterVariant() @@ -528,6 +568,7 @@ public function getMasterVariant() } /** + * * @return null|ProductVariantCollection */ public function getVariants() @@ -545,6 +586,7 @@ public function getVariants() } /** + * * @return null|TaxCategoryReference */ public function getTaxCategory() @@ -563,6 +605,7 @@ public function getTaxCategory() } /** + * * @return null|StateReference */ public function getState() @@ -583,6 +626,7 @@ public function getState() /** *

    Statistics about the review ratings taken into account for this product.

    * + * * @return null|ReviewRatingStatistics */ public function getReviewRatingStatistics() diff --git a/lib/commercetools-api/src/Models/Product/ProductProjectionPagedQueryResponse.php b/lib/commercetools-api/src/Models/Product/ProductProjectionPagedQueryResponse.php index cfa879fffba..a6097e7ce35 100644 --- a/lib/commercetools-api/src/Models/Product/ProductProjectionPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Product/ProductProjectionPagedQueryResponse.php @@ -22,16 +22,19 @@ interface ProductProjectionPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); /** + * @return null|int */ public function getCount(); /** + * @return null|int */ public function getTotal(); @@ -39,11 +42,13 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); /** + * @return null|ProductProjectionCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/Product/ProductProjectionPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Product/ProductProjectionPagedQueryResponseBuilder.php index 772f0854224..5360fe4176f 100644 --- a/lib/commercetools-api/src/Models/Product/ProductProjectionPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductProjectionPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class ProductProjectionPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?ProductProjectionCollection */ private $results; @@ -48,6 +53,7 @@ final class ProductProjectionPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -56,6 +62,7 @@ public function getLimit() } /** + * @return null|int */ public function getCount() @@ -64,6 +71,7 @@ public function getCount() } /** + * @return null|int */ public function getTotal() @@ -74,6 +82,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -82,6 +91,7 @@ public function getOffset() } /** + * @return null|ProductProjectionCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Product/ProductProjectionPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Product/ProductProjectionPagedQueryResponseModel.php index 11204758721..43b57d48c0e 100644 --- a/lib/commercetools-api/src/Models/Product/ProductProjectionPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductProjectionPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class ProductProjectionPagedQueryResponseModel extends JsonObjectModel implements ProductProjectionPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?ProductProjectionCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -82,6 +88,7 @@ public function getLimit() } /** + * * @return null|int */ public function getCount() @@ -99,6 +106,7 @@ public function getCount() } /** + * * @return null|int */ public function getTotal() @@ -118,6 +126,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -135,6 +144,7 @@ public function getOffset() } /** + * * @return null|ProductProjectionCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Product/ProductProjectionPagedSearchResponse.php b/lib/commercetools-api/src/Models/Product/ProductProjectionPagedSearchResponse.php index e08f24aef93..e0f30794f99 100644 --- a/lib/commercetools-api/src/Models/Product/ProductProjectionPagedSearchResponse.php +++ b/lib/commercetools-api/src/Models/Product/ProductProjectionPagedSearchResponse.php @@ -23,16 +23,19 @@ interface ProductProjectionPagedSearchResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); /** + * @return null|int */ public function getCount(); /** + * @return null|int */ public function getTotal(); @@ -40,16 +43,19 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); /** + * @return null|ProductProjectionCollection */ public function getResults(); /** + * @return null|FacetResults */ public function getFacets(); diff --git a/lib/commercetools-api/src/Models/Product/ProductProjectionPagedSearchResponseBuilder.php b/lib/commercetools-api/src/Models/Product/ProductProjectionPagedSearchResponseBuilder.php index 8e2e284ef24..3b4f9956762 100644 --- a/lib/commercetools-api/src/Models/Product/ProductProjectionPagedSearchResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductProjectionPagedSearchResponseBuilder.php @@ -21,31 +21,37 @@ final class ProductProjectionPagedSearchResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?ProductProjectionCollection */ private $results; /** + * @var null|FacetResults|FacetResultsBuilder */ private $facets; @@ -53,6 +59,7 @@ final class ProductProjectionPagedSearchResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -61,6 +68,7 @@ public function getLimit() } /** + * @return null|int */ public function getCount() @@ -69,6 +77,7 @@ public function getCount() } /** + * @return null|int */ public function getTotal() @@ -79,6 +88,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -87,6 +97,7 @@ public function getOffset() } /** + * @return null|ProductProjectionCollection */ public function getResults() @@ -95,6 +106,7 @@ public function getResults() } /** + * @return null|FacetResults */ public function getFacets() diff --git a/lib/commercetools-api/src/Models/Product/ProductProjectionPagedSearchResponseModel.php b/lib/commercetools-api/src/Models/Product/ProductProjectionPagedSearchResponseModel.php index 09ef8ad51f4..c442ca98038 100644 --- a/lib/commercetools-api/src/Models/Product/ProductProjectionPagedSearchResponseModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductProjectionPagedSearchResponseModel.php @@ -20,31 +20,37 @@ final class ProductProjectionPagedSearchResponseModel extends JsonObjectModel implements ProductProjectionPagedSearchResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?ProductProjectionCollection */ protected $results; /** + * * @var ?FacetResults */ protected $facets; @@ -72,6 +78,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -89,6 +96,7 @@ public function getLimit() } /** + * * @return null|int */ public function getCount() @@ -106,6 +114,7 @@ public function getCount() } /** + * * @return null|int */ public function getTotal() @@ -125,6 +134,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -142,6 +152,7 @@ public function getOffset() } /** + * * @return null|ProductProjectionCollection */ public function getResults() @@ -159,6 +170,7 @@ public function getResults() } /** + * * @return null|FacetResults */ public function getFacets() diff --git a/lib/commercetools-api/src/Models/Product/ProductPublishAction.php b/lib/commercetools-api/src/Models/Product/ProductPublishAction.php index 46852d8a3ce..eb1902b084b 100644 --- a/lib/commercetools-api/src/Models/Product/ProductPublishAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductPublishAction.php @@ -16,6 +16,9 @@ interface ProductPublishAction extends ProductUpdateAction public const FIELD_SCOPE = 'scope'; /** + *

    All or Prices

    + * + * @return null|string */ public function getScope(); diff --git a/lib/commercetools-api/src/Models/Product/ProductPublishActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductPublishActionBuilder.php index d7b096dc128..7bd2f95a4ba 100644 --- a/lib/commercetools-api/src/Models/Product/ProductPublishActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductPublishActionBuilder.php @@ -21,11 +21,15 @@ final class ProductPublishActionBuilder implements Builder { /** + * @var ?string */ private $scope; /** + *

    All or Prices

    + * + * @return null|string */ public function getScope() diff --git a/lib/commercetools-api/src/Models/Product/ProductPublishActionModel.php b/lib/commercetools-api/src/Models/Product/ProductPublishActionModel.php index f486a5139c1..634f5fb776b 100644 --- a/lib/commercetools-api/src/Models/Product/ProductPublishActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductPublishActionModel.php @@ -21,11 +21,13 @@ final class ProductPublishActionModel extends JsonObjectModel implements Product { public const DISCRIMINATOR_VALUE = 'publish'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $scope; @@ -35,13 +37,15 @@ final class ProductPublishActionModel extends JsonObjectModel implements Product * @psalm-suppress MissingParamType */ public function __construct( - ?string $scope = null + ?string $scope = null, + ?string $action = null ) { $this->scope = $scope; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,9 @@ public function getAction() } /** + *

    All or Prices

    + * + * * @return null|string */ public function getScope() diff --git a/lib/commercetools-api/src/Models/Product/ProductReference.php b/lib/commercetools-api/src/Models/Product/ProductReference.php index 0ce4b50a16a..bc0c5a4c4a3 100644 --- a/lib/commercetools-api/src/Models/Product/ProductReference.php +++ b/lib/commercetools-api/src/Models/Product/ProductReference.php @@ -19,6 +19,7 @@ interface ProductReference extends Reference /** *

    Contains the representation of the expanded Product. Only present in responses to requests with Reference Expansion for Products.

    * + * @return null|Product */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

    Unique identifier of the referenced Product.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/Product/ProductReferenceBuilder.php b/lib/commercetools-api/src/Models/Product/ProductReferenceBuilder.php index 87a50169c93..7c0e2a0fd3f 100644 --- a/lib/commercetools-api/src/Models/Product/ProductReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductReferenceBuilder.php @@ -23,11 +23,13 @@ final class ProductReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|Product|ProductBuilder */ private $obj; @@ -35,6 +37,7 @@ final class ProductReferenceBuilder implements Builder /** *

    Unique identifier of the referenced Product.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded Product. Only present in responses to requests with Reference Expansion for Products.

    * + * @return null|Product */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Product/ProductReferenceModel.php b/lib/commercetools-api/src/Models/Product/ProductReferenceModel.php index f078c5640d5..0cbc930864c 100644 --- a/lib/commercetools-api/src/Models/Product/ProductReferenceModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductReferenceModel.php @@ -23,16 +23,19 @@ final class ProductReferenceModel extends JsonObjectModel implements ProductRefe { public const DISCRIMINATOR_VALUE = 'product'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?Product */ protected $obj; @@ -43,16 +46,18 @@ final class ProductReferenceModel extends JsonObjectModel implements ProductRefe */ public function __construct( ?string $id = null, - ?Product $obj = null + ?Product $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced Product.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded Product. Only present in responses to requests with Reference Expansion for Products.

    * + * * @return null|Product */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Product/ProductRemoveAssetAction.php b/lib/commercetools-api/src/Models/Product/ProductRemoveAssetAction.php index 78d6f3f9f85..d9fd4fb1806 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemoveAssetAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemoveAssetAction.php @@ -20,26 +20,41 @@ interface ProductRemoveAssetAction extends ProductUpdateAction public const FIELD_ASSET_KEY = 'assetKey'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** + *

    If true, only the staged Asset is removed. If false, both the current and staged Asset is removed.

    + * + * @return null|bool */ public function getStaged(); /** + *

    The id of the Asset to remove.

    + * + * @return null|string */ public function getAssetId(); /** + *

    The key of the Asset to remove.

    + * + * @return null|string */ public function getAssetKey(); diff --git a/lib/commercetools-api/src/Models/Product/ProductRemoveAssetActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductRemoveAssetActionBuilder.php index 21686ab6286..01a43653904 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemoveAssetActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemoveAssetActionBuilder.php @@ -21,31 +21,39 @@ final class ProductRemoveAssetActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?bool */ private $staged; /** + * @var ?string */ private $assetId; /** + * @var ?string */ private $assetKey; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -54,6 +62,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -62,6 +73,9 @@ public function getSku() } /** + *

    If true, only the staged Asset is removed. If false, both the current and staged Asset is removed.

    + * + * @return null|bool */ public function getStaged() @@ -70,6 +84,9 @@ public function getStaged() } /** + *

    The id of the Asset to remove.

    + * + * @return null|string */ public function getAssetId() @@ -78,6 +95,9 @@ public function getAssetId() } /** + *

    The key of the Asset to remove.

    + * + * @return null|string */ public function getAssetKey() diff --git a/lib/commercetools-api/src/Models/Product/ProductRemoveAssetActionModel.php b/lib/commercetools-api/src/Models/Product/ProductRemoveAssetActionModel.php index 8e58222d90f..e869680d9a0 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemoveAssetActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemoveAssetActionModel.php @@ -21,31 +21,37 @@ final class ProductRemoveAssetActionModel extends JsonObjectModel implements Pro { public const DISCRIMINATOR_VALUE = 'removeAsset'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?bool */ protected $staged; /** + * * @var ?string */ protected $assetId; /** + * * @var ?string */ protected $assetKey; @@ -59,17 +65,19 @@ public function __construct( ?string $sku = null, ?bool $staged = null, ?string $assetId = null, - ?string $assetKey = null + ?string $assetKey = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; $this->staged = $staged; $this->assetId = $assetId; $this->assetKey = $assetKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -87,6 +95,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -104,6 +115,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -121,6 +135,9 @@ public function getSku() } /** + *

    If true, only the staged Asset is removed. If false, both the current and staged Asset is removed.

    + * + * * @return null|bool */ public function getStaged() @@ -138,6 +155,9 @@ public function getStaged() } /** + *

    The id of the Asset to remove.

    + * + * * @return null|string */ public function getAssetId() @@ -155,6 +175,9 @@ public function getAssetId() } /** + *

    The key of the Asset to remove.

    + * + * * @return null|string */ public function getAssetKey() diff --git a/lib/commercetools-api/src/Models/Product/ProductRemoveFromCategoryAction.php b/lib/commercetools-api/src/Models/Product/ProductRemoveFromCategoryAction.php index 3be79543b2b..efe2a909375 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemoveFromCategoryAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemoveFromCategoryAction.php @@ -18,11 +18,17 @@ interface ProductRemoveFromCategoryAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    The Category to remove.

    + * + * @return null|CategoryResourceIdentifier */ public function getCategory(); /** + *

    If true, only the staged categories and categoryOrderHints are removed. If false, both the current and staged categories and categoryOrderHints are removed.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductRemoveFromCategoryActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductRemoveFromCategoryActionBuilder.php index 9d5de615e23..bd984759294 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemoveFromCategoryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemoveFromCategoryActionBuilder.php @@ -23,16 +23,21 @@ final class ProductRemoveFromCategoryActionBuilder implements Builder { /** + * @var null|CategoryResourceIdentifier|CategoryResourceIdentifierBuilder */ private $category; /** + * @var ?bool */ private $staged; /** + *

    The Category to remove.

    + * + * @return null|CategoryResourceIdentifier */ public function getCategory() @@ -41,6 +46,9 @@ public function getCategory() } /** + *

    If true, only the staged categories and categoryOrderHints are removed. If false, both the current and staged categories and categoryOrderHints are removed.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductRemoveFromCategoryActionModel.php b/lib/commercetools-api/src/Models/Product/ProductRemoveFromCategoryActionModel.php index 8a2999cfdea..852355e9ea0 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemoveFromCategoryActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemoveFromCategoryActionModel.php @@ -23,16 +23,19 @@ final class ProductRemoveFromCategoryActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'removeFromCategory'; /** + * * @var ?string */ protected $action; /** + * * @var ?CategoryResourceIdentifier */ protected $category; /** + * * @var ?bool */ protected $staged; @@ -43,14 +46,16 @@ final class ProductRemoveFromCategoryActionModel extends JsonObjectModel impleme */ public function __construct( ?CategoryResourceIdentifier $category = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->category = $category; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,9 @@ public function getAction() } /** + *

    The Category to remove.

    + * + * * @return null|CategoryResourceIdentifier */ public function getCategory() @@ -86,6 +94,9 @@ public function getCategory() } /** + *

    If true, only the staged categories and categoryOrderHints are removed. If false, both the current and staged categories and categoryOrderHints are removed.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductRemoveImageAction.php b/lib/commercetools-api/src/Models/Product/ProductRemoveImageAction.php index 4706905d5a1..46e9f78d650 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemoveImageAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemoveImageAction.php @@ -19,23 +19,33 @@ interface ProductRemoveImageAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** - *

    The URL of the image.

    + *

    The URL of the image to remove.

    * + * @return null|string */ public function getImageUrl(); /** + *

    If true, only the staged image is removed. If false, both the current and staged image is removed.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductRemoveImageActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductRemoveImageActionBuilder.php index fffae554df5..19854b850b6 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemoveImageActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemoveImageActionBuilder.php @@ -21,26 +21,33 @@ final class ProductRemoveImageActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?string */ private $imageUrl; /** + * @var ?bool */ private $staged; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -49,6 +56,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -57,8 +67,9 @@ public function getSku() } /** - *

    The URL of the image.

    + *

    The URL of the image to remove.

    * + * @return null|string */ public function getImageUrl() @@ -67,6 +78,9 @@ public function getImageUrl() } /** + *

    If true, only the staged image is removed. If false, both the current and staged image is removed.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductRemoveImageActionModel.php b/lib/commercetools-api/src/Models/Product/ProductRemoveImageActionModel.php index b2c03d87f1e..4d2a3a04a04 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemoveImageActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemoveImageActionModel.php @@ -21,26 +21,31 @@ final class ProductRemoveImageActionModel extends JsonObjectModel implements Pro { public const DISCRIMINATOR_VALUE = 'removeImage'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $imageUrl; /** + * * @var ?bool */ protected $staged; @@ -53,16 +58,18 @@ public function __construct( ?int $variantId = null, ?string $sku = null, ?string $imageUrl = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; $this->imageUrl = $imageUrl; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -80,6 +87,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -97,6 +107,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -114,7 +127,8 @@ public function getSku() } /** - *

    The URL of the image.

    + *

    The URL of the image to remove.

    + * * * @return null|string */ @@ -133,6 +147,9 @@ public function getImageUrl() } /** + *

    If true, only the staged image is removed. If false, both the current and staged image is removed.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductRemovePriceAction.php b/lib/commercetools-api/src/Models/Product/ProductRemovePriceAction.php index ecced5dd2af..8639b85feef 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemovePriceAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemovePriceAction.php @@ -17,13 +17,17 @@ interface ProductRemovePriceAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** - *

    ID of the EmbeddedPrice

    + *

    The id of the Embedded Price to remove.

    * + * @return null|string */ public function getPriceId(); /** + *

    If true, only the staged Embedded Price is removed. If false, both the current and staged Embedded Price are removed.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductRemovePriceActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductRemovePriceActionBuilder.php index 735b332ceef..56ecc515501 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemovePriceActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemovePriceActionBuilder.php @@ -21,18 +21,21 @@ final class ProductRemovePriceActionBuilder implements Builder { /** + * @var ?string */ private $priceId; /** + * @var ?bool */ private $staged; /** - *

    ID of the EmbeddedPrice

    + *

    The id of the Embedded Price to remove.

    * + * @return null|string */ public function getPriceId() @@ -41,6 +44,9 @@ public function getPriceId() } /** + *

    If true, only the staged Embedded Price is removed. If false, both the current and staged Embedded Price are removed.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductRemovePriceActionModel.php b/lib/commercetools-api/src/Models/Product/ProductRemovePriceActionModel.php index 4abcb1b3364..a6515bbbc8e 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemovePriceActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemovePriceActionModel.php @@ -21,16 +21,19 @@ final class ProductRemovePriceActionModel extends JsonObjectModel implements Pro { public const DISCRIMINATOR_VALUE = 'removePrice'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $priceId; /** + * * @var ?bool */ protected $staged; @@ -41,14 +44,16 @@ final class ProductRemovePriceActionModel extends JsonObjectModel implements Pro */ public function __construct( ?string $priceId = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->priceId = $priceId; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,7 +71,8 @@ public function getAction() } /** - *

    ID of the EmbeddedPrice

    + *

    The id of the Embedded Price to remove.

    + * * * @return null|string */ @@ -85,6 +91,9 @@ public function getPriceId() } /** + *

    If true, only the staged Embedded Price is removed. If false, both the current and staged Embedded Price are removed.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductRemoveVariantAction.php b/lib/commercetools-api/src/Models/Product/ProductRemoveVariantAction.php index 6d72df39a24..595dddc435f 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemoveVariantAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemoveVariantAction.php @@ -18,16 +18,25 @@ interface ProductRemoveVariantAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    The id of the ProductVariant to remove.

    + * + * @return null|int */ public function getId(); /** + *

    The sku of the ProductVariant to remove.

    + * + * @return null|string */ public function getSku(); /** + *

    If true, only the staged ProductVariant is removed. If false, both the current and staged ProductVariant is removed.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductRemoveVariantActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductRemoveVariantActionBuilder.php index 92891c88e95..f18ccdcaaec 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemoveVariantActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemoveVariantActionBuilder.php @@ -21,21 +21,27 @@ final class ProductRemoveVariantActionBuilder implements Builder { /** + * @var ?int */ private $id; /** + * @var ?string */ private $sku; /** + * @var ?bool */ private $staged; /** + *

    The id of the ProductVariant to remove.

    + * + * @return null|int */ public function getId() @@ -44,6 +50,9 @@ public function getId() } /** + *

    The sku of the ProductVariant to remove.

    + * + * @return null|string */ public function getSku() @@ -52,6 +61,9 @@ public function getSku() } /** + *

    If true, only the staged ProductVariant is removed. If false, both the current and staged ProductVariant is removed.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductRemoveVariantActionModel.php b/lib/commercetools-api/src/Models/Product/ProductRemoveVariantActionModel.php index 07d536ec66a..47c33fb21b3 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemoveVariantActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemoveVariantActionModel.php @@ -21,21 +21,25 @@ final class ProductRemoveVariantActionModel extends JsonObjectModel implements P { public const DISCRIMINATOR_VALUE = 'removeVariant'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $id; /** + * * @var ?string */ protected $sku; /** + * * @var ?bool */ protected $staged; @@ -47,15 +51,17 @@ final class ProductRemoveVariantActionModel extends JsonObjectModel implements P public function __construct( ?int $id = null, ?string $sku = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->id = $id; $this->sku = $sku; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to remove.

    + * + * * @return null|int */ public function getId() @@ -90,6 +99,9 @@ public function getId() } /** + *

    The sku of the ProductVariant to remove.

    + * + * * @return null|string */ public function getSku() @@ -107,6 +119,9 @@ public function getSku() } /** + *

    If true, only the staged ProductVariant is removed. If false, both the current and staged ProductVariant is removed.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductResourceIdentifier.php b/lib/commercetools-api/src/Models/Product/ProductResourceIdentifier.php index a09d0013e6d..5b1ee535867 100644 --- a/lib/commercetools-api/src/Models/Product/ProductResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/Product/ProductResourceIdentifier.php @@ -15,15 +15,17 @@ interface ProductResourceIdentifier extends ResourceIdentifier { /** - *

    Unique identifier of the referenced Product. Either id or key is required.

    + *

    Unique identifier of the referenced Product.

    * + * @return null|string */ public function getId(); /** - *

    User-defined unique identifier of the referenced Product. Either id or key is required.

    + *

    User-defined unique identifier of the referenced Product.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Product/ProductResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/Product/ProductResourceIdentifierBuilder.php index f22d3bc91c7..fe5a27ffb52 100644 --- a/lib/commercetools-api/src/Models/Product/ProductResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductResourceIdentifierBuilder.php @@ -23,18 +23,21 @@ final class ProductResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; /** - *

    Unique identifier of the referenced Product. Either id or key is required.

    + *

    Unique identifier of the referenced Product.

    * + * @return null|string */ public function getId() @@ -43,8 +46,9 @@ public function getId() } /** - *

    User-defined unique identifier of the referenced Product. Either id or key is required.

    + *

    User-defined unique identifier of the referenced Product.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Product/ProductResourceIdentifierModel.php b/lib/commercetools-api/src/Models/Product/ProductResourceIdentifierModel.php index 2550e684e15..38eac90545a 100644 --- a/lib/commercetools-api/src/Models/Product/ProductResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class ProductResourceIdentifierModel extends JsonObjectModel implements Pr { public const DISCRIMINATOR_VALUE = 'product'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class ProductResourceIdentifierModel extends JsonObjectModel implements Pr */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -70,7 +75,8 @@ public function getTypeId() } /** - *

    Unique identifier of the referenced Product. Either id or key is required.

    + *

    Unique identifier of the referenced Product.

    + * * * @return null|string */ @@ -89,7 +95,8 @@ public function getId() } /** - *

    User-defined unique identifier of the referenced Product. Either id or key is required.

    + *

    User-defined unique identifier of the referenced Product.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Product/ProductRevertStagedChangesActionModel.php b/lib/commercetools-api/src/Models/Product/ProductRevertStagedChangesActionModel.php index 5050afa7e02..932fd4020ff 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRevertStagedChangesActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductRevertStagedChangesActionModel.php @@ -21,6 +21,7 @@ final class ProductRevertStagedChangesActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'revertStagedChanges'; /** + * * @var ?string */ protected $action; @@ -30,11 +31,13 @@ final class ProductRevertStagedChangesActionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Product/ProductRevertStagedVariantChangesAction.php b/lib/commercetools-api/src/Models/Product/ProductRevertStagedVariantChangesAction.php index 91856f34f02..66e06f8b3a2 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRevertStagedVariantChangesAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductRevertStagedVariantChangesAction.php @@ -16,6 +16,9 @@ interface ProductRevertStagedVariantChangesAction extends ProductUpdateAction public const FIELD_VARIANT_ID = 'variantId'; /** + *

    The id of the ProductVariant to revert.

    + * + * @return null|int */ public function getVariantId(); diff --git a/lib/commercetools-api/src/Models/Product/ProductRevertStagedVariantChangesActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductRevertStagedVariantChangesActionBuilder.php index d9d4407883e..135d5edcb19 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRevertStagedVariantChangesActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductRevertStagedVariantChangesActionBuilder.php @@ -21,11 +21,15 @@ final class ProductRevertStagedVariantChangesActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + *

    The id of the ProductVariant to revert.

    + * + * @return null|int */ public function getVariantId() diff --git a/lib/commercetools-api/src/Models/Product/ProductRevertStagedVariantChangesActionModel.php b/lib/commercetools-api/src/Models/Product/ProductRevertStagedVariantChangesActionModel.php index a696cc63367..679a4121314 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRevertStagedVariantChangesActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductRevertStagedVariantChangesActionModel.php @@ -21,11 +21,13 @@ final class ProductRevertStagedVariantChangesActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'revertStagedVariantChanges'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; @@ -35,13 +37,15 @@ final class ProductRevertStagedVariantChangesActionModel extends JsonObjectModel * @psalm-suppress MissingParamType */ public function __construct( - ?int $variantId = null + ?int $variantId = null, + ?string $action = null ) { $this->variantId = $variantId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to revert.

    + * + * * @return null|int */ public function getVariantId() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomFieldAction.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomFieldAction.php index 73529385dfa..583643972f6 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomFieldAction.php @@ -22,26 +22,41 @@ interface ProductSetAssetCustomFieldAction extends ProductUpdateAction public const FIELD_VALUE = 'value'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * @return null|bool */ public function getStaged(); /** + *

    The id of the Asset to update.

    + * + * @return null|string */ public function getAssetId(); /** + *

    The key of the Asset to update.

    + * + * @return null|string */ public function getAssetKey(); @@ -49,6 +64,7 @@ public function getAssetKey(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -58,6 +74,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomFieldActionBuilder.php index c40cb3cd892..3c84c7625c2 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomFieldActionBuilder.php @@ -21,41 +21,51 @@ final class ProductSetAssetCustomFieldActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?bool */ private $staged; /** + * @var ?string */ private $assetId; /** + * @var ?string */ private $assetKey; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -64,6 +74,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -72,6 +85,9 @@ public function getSku() } /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * @return null|bool */ public function getStaged() @@ -80,6 +96,9 @@ public function getStaged() } /** + *

    The id of the Asset to update.

    + * + * @return null|string */ public function getAssetId() @@ -88,6 +107,9 @@ public function getAssetId() } /** + *

    The key of the Asset to update.

    + * + * @return null|string */ public function getAssetKey() @@ -98,6 +120,7 @@ public function getAssetKey() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -110,6 +133,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomFieldActionModel.php index 8c1e436efd7..44da040f5d6 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomFieldActionModel.php @@ -21,41 +21,49 @@ final class ProductSetAssetCustomFieldActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setAssetCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?bool */ protected $staged; /** + * * @var ?string */ protected $assetId; /** + * * @var ?string */ protected $assetKey; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -71,7 +79,8 @@ public function __construct( ?string $assetId = null, ?string $assetKey = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; @@ -80,10 +89,11 @@ public function __construct( $this->assetKey = $assetKey; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -101,6 +111,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -118,6 +131,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -135,6 +151,9 @@ public function getSku() } /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * * @return null|bool */ public function getStaged() @@ -152,6 +171,9 @@ public function getStaged() } /** + *

    The id of the Asset to update.

    + * + * * @return null|string */ public function getAssetId() @@ -169,6 +191,9 @@ public function getAssetId() } /** + *

    The key of the Asset to update.

    + * + * * @return null|string */ public function getAssetKey() @@ -188,6 +213,7 @@ public function getAssetKey() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -209,6 +235,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomTypeAction.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomTypeAction.php index 2ebbc33c692..aac4082f370 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomTypeAction.php @@ -24,26 +24,41 @@ interface ProductSetAssetCustomTypeAction extends ProductUpdateAction public const FIELD_FIELDS = 'fields'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * @return null|bool */ public function getStaged(); /** + *

    The id of the Asset to update.

    + * + * @return null|string */ public function getAssetId(); /** + *

    The key of the Asset to update.

    + * + * @return null|string */ public function getAssetKey(); @@ -52,6 +67,7 @@ public function getAssetKey(); *

    Defines the Type that extends the Asset with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Asset.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -59,6 +75,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the Asset.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomTypeActionBuilder.php index 07a27b16b5a..f89f58f58cc 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomTypeActionBuilder.php @@ -25,41 +25,51 @@ final class ProductSetAssetCustomTypeActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?bool */ private $staged; /** + * @var ?string */ private $assetId; /** + * @var ?string */ private $assetKey; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -68,6 +78,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -76,6 +89,9 @@ public function getSku() } /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * @return null|bool */ public function getStaged() @@ -84,6 +100,9 @@ public function getStaged() } /** + *

    The id of the Asset to update.

    + * + * @return null|string */ public function getAssetId() @@ -92,6 +111,9 @@ public function getAssetId() } /** + *

    The key of the Asset to update.

    + * + * @return null|string */ public function getAssetKey() @@ -103,6 +125,7 @@ public function getAssetKey() *

    Defines the Type that extends the Asset with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Asset.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -113,6 +136,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Asset.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomTypeActionModel.php index e744f721bf2..09bdc529517 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetCustomTypeActionModel.php @@ -25,41 +25,49 @@ final class ProductSetAssetCustomTypeActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setAssetCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?bool */ protected $staged; /** + * * @var ?string */ protected $assetId; /** + * * @var ?string */ protected $assetKey; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -75,7 +83,8 @@ public function __construct( ?string $assetId = null, ?string $assetKey = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; @@ -84,10 +93,11 @@ public function __construct( $this->assetKey = $assetKey; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -105,6 +115,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -122,6 +135,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -139,6 +155,9 @@ public function getSku() } /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * * @return null|bool */ public function getStaged() @@ -156,6 +175,9 @@ public function getStaged() } /** + *

    The id of the Asset to update.

    + * + * * @return null|string */ public function getAssetId() @@ -173,6 +195,9 @@ public function getAssetId() } /** + *

    The key of the Asset to update.

    + * + * * @return null|string */ public function getAssetKey() @@ -193,6 +218,7 @@ public function getAssetKey() *

    Defines the Type that extends the Asset with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Asset.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -213,6 +239,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Asset.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetDescriptionAction.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetDescriptionAction.php index 58de7d2e984..1827892ee65 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetDescriptionAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetDescriptionAction.php @@ -22,31 +22,49 @@ interface ProductSetAssetDescriptionAction extends ProductUpdateAction public const FIELD_DESCRIPTION = 'description'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * @return null|bool */ public function getStaged(); /** + *

    The id of the Asset to update.

    + * + * @return null|string */ public function getAssetId(); /** + *

    The key of the Asset to update.

    + * + * @return null|string */ public function getAssetKey(); /** + *

    Value to set. If empty, any existing value will be removed.

    + * + * @return null|LocalizedString */ public function getDescription(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetDescriptionActionBuilder.php index 3911a32b98b..45fed7923fe 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetDescriptionActionBuilder.php @@ -23,36 +23,45 @@ final class ProductSetAssetDescriptionActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?bool */ private $staged; /** + * @var ?string */ private $assetId; /** + * @var ?string */ private $assetKey; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -61,6 +70,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -69,6 +81,9 @@ public function getSku() } /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * @return null|bool */ public function getStaged() @@ -77,6 +92,9 @@ public function getStaged() } /** + *

    The id of the Asset to update.

    + * + * @return null|string */ public function getAssetId() @@ -85,6 +103,9 @@ public function getAssetId() } /** + *

    The key of the Asset to update.

    + * + * @return null|string */ public function getAssetKey() @@ -93,6 +114,9 @@ public function getAssetKey() } /** + *

    Value to set. If empty, any existing value will be removed.

    + * + * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetDescriptionActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetDescriptionActionModel.php index 2f01651598e..cbaaf195f73 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetDescriptionActionModel.php @@ -23,36 +23,43 @@ final class ProductSetAssetDescriptionActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setAssetDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?bool */ protected $staged; /** + * * @var ?string */ protected $assetId; /** + * * @var ?string */ protected $assetKey; /** + * * @var ?LocalizedString */ protected $description; @@ -67,7 +74,8 @@ public function __construct( ?bool $staged = null, ?string $assetId = null, ?string $assetKey = null, - ?LocalizedString $description = null + ?LocalizedString $description = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; @@ -75,10 +83,11 @@ public function __construct( $this->assetId = $assetId; $this->assetKey = $assetKey; $this->description = $description; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -96,6 +105,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -113,6 +125,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -130,6 +145,9 @@ public function getSku() } /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * * @return null|bool */ public function getStaged() @@ -147,6 +165,9 @@ public function getStaged() } /** + *

    The id of the Asset to update.

    + * + * * @return null|string */ public function getAssetId() @@ -164,6 +185,9 @@ public function getAssetId() } /** + *

    The key of the Asset to update.

    + * + * * @return null|string */ public function getAssetKey() @@ -181,6 +205,9 @@ public function getAssetKey() } /** + *

    Value to set. If empty, any existing value will be removed.

    + * + * * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetKeyAction.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetKeyAction.php index 248d29b8db1..466956718c9 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetKeyAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetKeyAction.php @@ -20,29 +20,41 @@ interface ProductSetAssetKeyAction extends ProductUpdateAction public const FIELD_ASSET_KEY = 'assetKey'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * @return null|bool */ public function getStaged(); /** + *

    The id of the Asset to update.

    + * + * @return null|string */ public function getAssetId(); /** - *

    User-defined identifier for the asset. - * If left blank or set to null, the asset key is unset/removed.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getAssetKey(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetKeyActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetKeyActionBuilder.php index 4787a899be5..38e2642f964 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetKeyActionBuilder.php @@ -21,31 +21,39 @@ final class ProductSetAssetKeyActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?bool */ private $staged; /** + * @var ?string */ private $assetId; /** + * @var ?string */ private $assetKey; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -54,6 +62,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -62,6 +73,9 @@ public function getSku() } /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * @return null|bool */ public function getStaged() @@ -70,6 +84,9 @@ public function getStaged() } /** + *

    The id of the Asset to update.

    + * + * @return null|string */ public function getAssetId() @@ -78,9 +95,9 @@ public function getAssetId() } /** - *

    User-defined identifier for the asset. - * If left blank or set to null, the asset key is unset/removed.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getAssetKey() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetKeyActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetKeyActionModel.php index d11c2a9e4ba..d6f4e15974f 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetKeyActionModel.php @@ -21,31 +21,37 @@ final class ProductSetAssetKeyActionModel extends JsonObjectModel implements Pro { public const DISCRIMINATOR_VALUE = 'setAssetKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?bool */ protected $staged; /** + * * @var ?string */ protected $assetId; /** + * * @var ?string */ protected $assetKey; @@ -59,17 +65,19 @@ public function __construct( ?string $sku = null, ?bool $staged = null, ?string $assetId = null, - ?string $assetKey = null + ?string $assetKey = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; $this->staged = $staged; $this->assetId = $assetId; $this->assetKey = $assetKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -87,6 +95,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -104,6 +115,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -121,6 +135,9 @@ public function getSku() } /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * * @return null|bool */ public function getStaged() @@ -138,6 +155,9 @@ public function getStaged() } /** + *

    The id of the Asset to update.

    + * + * * @return null|string */ public function getAssetId() @@ -155,8 +175,8 @@ public function getAssetId() } /** - *

    User-defined identifier for the asset. - * If left blank or set to null, the asset key is unset/removed.

    + *

    Value to set. If empty, any existing value will be removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetSourcesAction.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetSourcesAction.php index 07bb2185706..278ce1f8ad9 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetSourcesAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetSourcesAction.php @@ -22,31 +22,49 @@ interface ProductSetAssetSourcesAction extends ProductUpdateAction public const FIELD_SOURCES = 'sources'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** + *

    If true, only the staged Asset is updated. If false both the current and staged Asset is updated.

    + * + * @return null|bool */ public function getStaged(); /** + *

    The id of the Asset to update.

    + * + * @return null|string */ public function getAssetId(); /** + *

    The key of the Asset to update.

    + * + * @return null|string */ public function getAssetKey(); /** + *

    Value to set.

    + * + * @return null|AssetSourceCollection */ public function getSources(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetSourcesActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetSourcesActionBuilder.php index c778053fd29..117cc25d4a3 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetSourcesActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetSourcesActionBuilder.php @@ -22,36 +22,45 @@ final class ProductSetAssetSourcesActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?bool */ private $staged; /** + * @var ?string */ private $assetId; /** + * @var ?string */ private $assetKey; /** + * @var ?AssetSourceCollection */ private $sources; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -60,6 +69,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -68,6 +80,9 @@ public function getSku() } /** + *

    If true, only the staged Asset is updated. If false both the current and staged Asset is updated.

    + * + * @return null|bool */ public function getStaged() @@ -76,6 +91,9 @@ public function getStaged() } /** + *

    The id of the Asset to update.

    + * + * @return null|string */ public function getAssetId() @@ -84,6 +102,9 @@ public function getAssetId() } /** + *

    The key of the Asset to update.

    + * + * @return null|string */ public function getAssetKey() @@ -92,6 +113,9 @@ public function getAssetKey() } /** + *

    Value to set.

    + * + * @return null|AssetSourceCollection */ public function getSources() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetSourcesActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetSourcesActionModel.php index 176cf3db794..b56f2465f6d 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetSourcesActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetSourcesActionModel.php @@ -22,36 +22,43 @@ final class ProductSetAssetSourcesActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setAssetSources'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?bool */ protected $staged; /** + * * @var ?string */ protected $assetId; /** + * * @var ?string */ protected $assetKey; /** + * * @var ?AssetSourceCollection */ protected $sources; @@ -66,7 +73,8 @@ public function __construct( ?bool $staged = null, ?string $assetId = null, ?string $assetKey = null, - ?AssetSourceCollection $sources = null + ?AssetSourceCollection $sources = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; @@ -74,10 +82,11 @@ public function __construct( $this->assetId = $assetId; $this->assetKey = $assetKey; $this->sources = $sources; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -95,6 +104,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -112,6 +124,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -129,6 +144,9 @@ public function getSku() } /** + *

    If true, only the staged Asset is updated. If false both the current and staged Asset is updated.

    + * + * * @return null|bool */ public function getStaged() @@ -146,6 +164,9 @@ public function getStaged() } /** + *

    The id of the Asset to update.

    + * + * * @return null|string */ public function getAssetId() @@ -163,6 +184,9 @@ public function getAssetId() } /** + *

    The key of the Asset to update.

    + * + * * @return null|string */ public function getAssetKey() @@ -180,6 +204,9 @@ public function getAssetKey() } /** + *

    Value to set.

    + * + * * @return null|AssetSourceCollection */ public function getSources() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetTagsAction.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetTagsAction.php index fa9cf467713..7657dc83ad3 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetTagsAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetTagsAction.php @@ -21,31 +21,49 @@ interface ProductSetAssetTagsAction extends ProductUpdateAction public const FIELD_TAGS = 'tags'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * @return null|bool */ public function getStaged(); /** + *

    The id of the Asset to update.

    + * + * @return null|string */ public function getAssetId(); /** + *

    The key of the Asset to update.

    + * + * @return null|string */ public function getAssetKey(); /** + *

    Keywords for categorizing and organizing Assets.

    + * + * @return null|array */ public function getTags(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetTagsActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetTagsActionBuilder.php index 113f4f1fae4..940d1d7374e 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetTagsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetTagsActionBuilder.php @@ -21,36 +21,45 @@ final class ProductSetAssetTagsActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?bool */ private $staged; /** + * @var ?string */ private $assetId; /** + * @var ?string */ private $assetKey; /** + * @var ?array */ private $tags; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -59,6 +68,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -67,6 +79,9 @@ public function getSku() } /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * @return null|bool */ public function getStaged() @@ -75,6 +90,9 @@ public function getStaged() } /** + *

    The id of the Asset to update.

    + * + * @return null|string */ public function getAssetId() @@ -83,6 +101,9 @@ public function getAssetId() } /** + *

    The key of the Asset to update.

    + * + * @return null|string */ public function getAssetKey() @@ -91,6 +112,9 @@ public function getAssetKey() } /** + *

    Keywords for categorizing and organizing Assets.

    + * + * @return null|array */ public function getTags() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAssetTagsActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetAssetTagsActionModel.php index b401650faee..429ecfd93f4 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAssetTagsActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAssetTagsActionModel.php @@ -21,36 +21,43 @@ final class ProductSetAssetTagsActionModel extends JsonObjectModel implements Pr { public const DISCRIMINATOR_VALUE = 'setAssetTags'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?bool */ protected $staged; /** + * * @var ?string */ protected $assetId; /** + * * @var ?string */ protected $assetKey; /** + * * @var ?array */ protected $tags; @@ -65,7 +72,8 @@ public function __construct( ?bool $staged = null, ?string $assetId = null, ?string $assetKey = null, - ?array $tags = null + ?array $tags = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; @@ -73,10 +81,11 @@ public function __construct( $this->assetId = $assetId; $this->assetKey = $assetKey; $this->tags = $tags; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -94,6 +103,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -111,6 +123,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -128,6 +143,9 @@ public function getSku() } /** + *

    If true, only the staged Asset is updated. If false, both the current and staged Asset is updated.

    + * + * * @return null|bool */ public function getStaged() @@ -145,6 +163,9 @@ public function getStaged() } /** + *

    The id of the Asset to update.

    + * + * * @return null|string */ public function getAssetId() @@ -162,6 +183,9 @@ public function getAssetId() } /** + *

    The key of the Asset to update.

    + * + * * @return null|string */ public function getAssetKey() @@ -179,6 +203,9 @@ public function getAssetKey() } /** + *

    Keywords for categorizing and organizing Assets.

    + * + * * @return null|array */ public function getTags() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAttributeAction.php b/lib/commercetools-api/src/Models/Product/ProductSetAttributeAction.php index a230a209f3e..163bf11ea39 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAttributeAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAttributeAction.php @@ -20,30 +20,52 @@ interface ProductSetAttributeAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** + *

    The name of the Attribute to set.

    + * + * @return null|string */ public function getName(); /** - *

    If the attribute exists and the value is omitted or set to null, the attribute is removed. - * If the attribute exists and a value is provided, the new value is applied. - * If the attribute does not exist and a value is provided, it is added as a new attribute.

    + *

    Value to set for the Attribute. If empty, any existing value will be removed.

    + *

    The AttributeType determines the format of the Attribute value to be provided:

    + * * + * @return null|mixed */ public function getValue(); /** + *

    If true, only the staged Attribute is set. If false, both current and staged Attribute is set.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAttributeActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetAttributeActionBuilder.php index 23143a7023d..07641dfc0ec 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAttributeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAttributeActionBuilder.php @@ -21,31 +21,39 @@ final class ProductSetAttributeActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @var ?bool */ private $staged; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -54,6 +62,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -62,6 +73,9 @@ public function getSku() } /** + *

    The name of the Attribute to set.

    + * + * @return null|string */ public function getName() @@ -70,10 +84,20 @@ public function getName() } /** - *

    If the attribute exists and the value is omitted or set to null, the attribute is removed. - * If the attribute exists and a value is provided, the new value is applied. - * If the attribute does not exist and a value is provided, it is added as a new attribute.

    + *

    Value to set for the Attribute. If empty, any existing value will be removed.

    + *

    The AttributeType determines the format of the Attribute value to be provided:

    + * * + * @return null|mixed */ public function getValue() @@ -82,6 +106,9 @@ public function getValue() } /** + *

    If true, only the staged Attribute is set. If false, both current and staged Attribute is set.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAttributeActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetAttributeActionModel.php index ad44789ba6a..d006f7d874b 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAttributeActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAttributeActionModel.php @@ -21,31 +21,37 @@ final class ProductSetAttributeActionModel extends JsonObjectModel implements Pr { public const DISCRIMINATOR_VALUE = 'setAttribute'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; /** + * * @var ?bool */ protected $staged; @@ -59,17 +65,19 @@ public function __construct( ?string $sku = null, ?string $name = null, $value = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; $this->name = $name; $this->value = $value; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -87,6 +95,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -104,6 +115,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -121,6 +135,9 @@ public function getSku() } /** + *

    The name of the Attribute to set.

    + * + * * @return null|string */ public function getName() @@ -138,9 +155,19 @@ public function getName() } /** - *

    If the attribute exists and the value is omitted or set to null, the attribute is removed. - * If the attribute exists and a value is provided, the new value is applied. - * If the attribute does not exist and a value is provided, it is added as a new attribute.

    + *

    Value to set for the Attribute. If empty, any existing value will be removed.

    + *

    The AttributeType determines the format of the Attribute value to be provided:

    + * + * * * @return null|mixed */ @@ -159,6 +186,9 @@ public function getValue() } /** + *

    If true, only the staged Attribute is set. If false, both current and staged Attribute is set.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAttributeInAllVariantsAction.php b/lib/commercetools-api/src/Models/Product/ProductSetAttributeInAllVariantsAction.php index 8d43f24d759..b8278c9a2d0 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAttributeInAllVariantsAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAttributeInAllVariantsAction.php @@ -18,18 +18,36 @@ interface ProductSetAttributeInAllVariantsAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    The name of the Attribute to set.

    + * + * @return null|string */ public function getName(); /** - *

    The same update behavior as for Set Attribute applies.

    + *

    Value to set for the Attributes. If empty, any existing value will be removed.

    + *

    The AttributeType determines the format of the Attribute value to be provided:

    + * * + * @return null|mixed */ public function getValue(); /** + *

    If true, only the staged Attributes are set. If false, both the current and staged Attributes are set.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAttributeInAllVariantsActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetAttributeInAllVariantsActionBuilder.php index b2856207092..c6ceb4b73ec 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAttributeInAllVariantsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAttributeInAllVariantsActionBuilder.php @@ -21,21 +21,27 @@ final class ProductSetAttributeInAllVariantsActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @var ?bool */ private $staged; /** + *

    The name of the Attribute to set.

    + * + * @return null|string */ public function getName() @@ -44,8 +50,20 @@ public function getName() } /** - *

    The same update behavior as for Set Attribute applies.

    + *

    Value to set for the Attributes. If empty, any existing value will be removed.

    + *

    The AttributeType determines the format of the Attribute value to be provided:

    + * * + * @return null|mixed */ public function getValue() @@ -54,6 +72,9 @@ public function getValue() } /** + *

    If true, only the staged Attributes are set. If false, both the current and staged Attributes are set.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetAttributeInAllVariantsActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetAttributeInAllVariantsActionModel.php index d093e5d3360..3a24a58dd10 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetAttributeInAllVariantsActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetAttributeInAllVariantsActionModel.php @@ -21,21 +21,25 @@ final class ProductSetAttributeInAllVariantsActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setAttributeInAllVariants'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; /** + * * @var ?bool */ protected $staged; @@ -47,15 +51,17 @@ final class ProductSetAttributeInAllVariantsActionModel extends JsonObjectModel public function __construct( ?string $name = null, $value = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,9 @@ public function getAction() } /** + *

    The name of the Attribute to set.

    + * + * * @return null|string */ public function getName() @@ -90,7 +99,19 @@ public function getName() } /** - *

    The same update behavior as for Set Attribute applies.

    + *

    Value to set for the Attributes. If empty, any existing value will be removed.

    + *

    The AttributeType determines the format of the Attribute value to be provided:

    + * + * * * @return null|mixed */ @@ -109,6 +130,9 @@ public function getValue() } /** + *

    If true, only the staged Attributes are set. If false, both the current and staged Attributes are set.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetCategoryOrderHintAction.php b/lib/commercetools-api/src/Models/Product/ProductSetCategoryOrderHintAction.php index 8324e25390f..ad07be0432d 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetCategoryOrderHintAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetCategoryOrderHintAction.php @@ -18,16 +18,25 @@ interface ProductSetCategoryOrderHintAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    The id of the Category to add the orderHint.

    + * + * @return null|string */ public function getCategoryId(); /** + *

    A string representing a number between 0 and 1. Must start with 0. and cannot end with 0. If empty, any existing value will be removed.

    + * + * @return null|string */ public function getOrderHint(); /** + *

    If true, only the staged categoryOrderHints is updated. If false, both the current and staged categoryOrderHints are updated.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetCategoryOrderHintActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetCategoryOrderHintActionBuilder.php index 45d8f92f703..b5f8d8ed529 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetCategoryOrderHintActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetCategoryOrderHintActionBuilder.php @@ -21,21 +21,27 @@ final class ProductSetCategoryOrderHintActionBuilder implements Builder { /** + * @var ?string */ private $categoryId; /** + * @var ?string */ private $orderHint; /** + * @var ?bool */ private $staged; /** + *

    The id of the Category to add the orderHint.

    + * + * @return null|string */ public function getCategoryId() @@ -44,6 +50,9 @@ public function getCategoryId() } /** + *

    A string representing a number between 0 and 1. Must start with 0. and cannot end with 0. If empty, any existing value will be removed.

    + * + * @return null|string */ public function getOrderHint() @@ -52,6 +61,9 @@ public function getOrderHint() } /** + *

    If true, only the staged categoryOrderHints is updated. If false, both the current and staged categoryOrderHints are updated.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetCategoryOrderHintActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetCategoryOrderHintActionModel.php index 0473d28585a..70820628b4c 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetCategoryOrderHintActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetCategoryOrderHintActionModel.php @@ -21,21 +21,25 @@ final class ProductSetCategoryOrderHintActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setCategoryOrderHint'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $categoryId; /** + * * @var ?string */ protected $orderHint; /** + * * @var ?bool */ protected $staged; @@ -47,15 +51,17 @@ final class ProductSetCategoryOrderHintActionModel extends JsonObjectModel imple public function __construct( ?string $categoryId = null, ?string $orderHint = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->categoryId = $categoryId; $this->orderHint = $orderHint; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,9 @@ public function getAction() } /** + *

    The id of the Category to add the orderHint.

    + * + * * @return null|string */ public function getCategoryId() @@ -90,6 +99,9 @@ public function getCategoryId() } /** + *

    A string representing a number between 0 and 1. Must start with 0. and cannot end with 0. If empty, any existing value will be removed.

    + * + * * @return null|string */ public function getOrderHint() @@ -107,6 +119,9 @@ public function getOrderHint() } /** + *

    If true, only the staged categoryOrderHints is updated. If false, both the current and staged categoryOrderHints are updated.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetDescriptionAction.php b/lib/commercetools-api/src/Models/Product/ProductSetDescriptionAction.php index 8e01465e03d..d1fbdee5b79 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetDescriptionAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetDescriptionAction.php @@ -18,11 +18,17 @@ interface ProductSetDescriptionAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    Value to set. If empty, any existing value will be removed.

    + * + * @return null|LocalizedString */ public function getDescription(); /** + *

    If true, only the staged description is updated. If false, both the current and staged description are updated.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetDescriptionActionBuilder.php index 41920f5a47f..390b25038f7 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetDescriptionActionBuilder.php @@ -23,16 +23,21 @@ final class ProductSetDescriptionActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?bool */ private $staged; /** + *

    Value to set. If empty, any existing value will be removed.

    + * + * @return null|LocalizedString */ public function getDescription() @@ -41,6 +46,9 @@ public function getDescription() } /** + *

    If true, only the staged description is updated. If false, both the current and staged description are updated.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetDescriptionActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetDescriptionActionModel.php index 18cf6aff270..7d5061a0d73 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetDescriptionActionModel.php @@ -23,16 +23,19 @@ final class ProductSetDescriptionActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?bool */ protected $staged; @@ -43,14 +46,16 @@ final class ProductSetDescriptionActionModel extends JsonObjectModel implements */ public function __construct( ?LocalizedString $description = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->description = $description; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,9 @@ public function getAction() } /** + *

    Value to set. If empty, any existing value will be removed.

    + * + * * @return null|LocalizedString */ public function getDescription() @@ -86,6 +94,9 @@ public function getDescription() } /** + *

    If true, only the staged description is updated. If false, both the current and staged description are updated.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetDiscountedPriceAction.php b/lib/commercetools-api/src/Models/Product/ProductSetDiscountedPriceAction.php index 72a10ab18b1..001ffe36758 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetDiscountedPriceAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetDiscountedPriceAction.php @@ -19,16 +19,26 @@ interface ProductSetDiscountedPriceAction extends ProductUpdateAction public const FIELD_DISCOUNTED = 'discounted'; /** + *

    The id of the Embedded Price to set the Discount.

    + * + * @return null|string */ public function getPriceId(); /** + *

    If true, only the staged Embedded Price is updated. If false, both the current and staged Embedded Price are updated.

    + * + * @return null|bool */ public function getStaged(); /** + *

    Value to set. If empty, any existing value will be removed. + * The referenced ProductDiscount must have the Type external, be active, and its predicate must match the referenced Price.

    + * + * @return null|DiscountedPriceDraft */ public function getDiscounted(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetDiscountedPriceActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetDiscountedPriceActionBuilder.php index f2d7ec84355..9942c8135cc 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetDiscountedPriceActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetDiscountedPriceActionBuilder.php @@ -23,21 +23,27 @@ final class ProductSetDiscountedPriceActionBuilder implements Builder { /** + * @var ?string */ private $priceId; /** + * @var ?bool */ private $staged; /** + * @var null|DiscountedPriceDraft|DiscountedPriceDraftBuilder */ private $discounted; /** + *

    The id of the Embedded Price to set the Discount.

    + * + * @return null|string */ public function getPriceId() @@ -46,6 +52,9 @@ public function getPriceId() } /** + *

    If true, only the staged Embedded Price is updated. If false, both the current and staged Embedded Price are updated.

    + * + * @return null|bool */ public function getStaged() @@ -54,6 +63,10 @@ public function getStaged() } /** + *

    Value to set. If empty, any existing value will be removed. + * The referenced ProductDiscount must have the Type external, be active, and its predicate must match the referenced Price.

    + * + * @return null|DiscountedPriceDraft */ public function getDiscounted() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetDiscountedPriceActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetDiscountedPriceActionModel.php index 2c4abcd2ea4..a8a9c5bc908 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetDiscountedPriceActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetDiscountedPriceActionModel.php @@ -23,21 +23,25 @@ final class ProductSetDiscountedPriceActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setDiscountedPrice'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $priceId; /** + * * @var ?bool */ protected $staged; /** + * * @var ?DiscountedPriceDraft */ protected $discounted; @@ -49,15 +53,17 @@ final class ProductSetDiscountedPriceActionModel extends JsonObjectModel impleme public function __construct( ?string $priceId = null, ?bool $staged = null, - ?DiscountedPriceDraft $discounted = null + ?DiscountedPriceDraft $discounted = null, + ?string $action = null ) { $this->priceId = $priceId; $this->staged = $staged; $this->discounted = $discounted; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -75,6 +81,9 @@ public function getAction() } /** + *

    The id of the Embedded Price to set the Discount.

    + * + * * @return null|string */ public function getPriceId() @@ -92,6 +101,9 @@ public function getPriceId() } /** + *

    If true, only the staged Embedded Price is updated. If false, both the current and staged Embedded Price are updated.

    + * + * * @return null|bool */ public function getStaged() @@ -109,6 +121,10 @@ public function getStaged() } /** + *

    Value to set. If empty, any existing value will be removed. + * The referenced ProductDiscount must have the Type external, be active, and its predicate must match the referenced Price.

    + * + * * @return null|DiscountedPriceDraft */ public function getDiscounted() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetImageLabelAction.php b/lib/commercetools-api/src/Models/Product/ProductSetImageLabelAction.php index d6a743ea8f7..4ef7f0824e6 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetImageLabelAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetImageLabelAction.php @@ -20,31 +20,41 @@ interface ProductSetImageLabelAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** - *

    The URL of the image.

    + *

    The URL of the image to set the label.

    * + * @return null|string */ public function getImageUrl(); /** - *

    The new image label. - * If left blank or set to null, the label is removed.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getLabel(); /** + *

    If true, only the staged image is updated. If false, both the current and staged image is updated.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetImageLabelActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetImageLabelActionBuilder.php index 2e658d42f5c..6d772598570 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetImageLabelActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetImageLabelActionBuilder.php @@ -21,31 +21,39 @@ final class ProductSetImageLabelActionBuilder implements Builder { /** + * @var ?string */ private $sku; /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $imageUrl; /** + * @var ?string */ private $label; /** + * @var ?bool */ private $staged; /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -54,6 +62,9 @@ public function getSku() } /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -62,8 +73,9 @@ public function getVariantId() } /** - *

    The URL of the image.

    + *

    The URL of the image to set the label.

    * + * @return null|string */ public function getImageUrl() @@ -72,9 +84,9 @@ public function getImageUrl() } /** - *

    The new image label. - * If left blank or set to null, the label is removed.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getLabel() @@ -83,6 +95,9 @@ public function getLabel() } /** + *

    If true, only the staged image is updated. If false, both the current and staged image is updated.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetImageLabelActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetImageLabelActionModel.php index 9e99a560a44..d9fa9f94739 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetImageLabelActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetImageLabelActionModel.php @@ -21,31 +21,37 @@ final class ProductSetImageLabelActionModel extends JsonObjectModel implements P { public const DISCRIMINATOR_VALUE = 'setImageLabel'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $sku; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $imageUrl; /** + * * @var ?string */ protected $label; /** + * * @var ?bool */ protected $staged; @@ -59,17 +65,19 @@ public function __construct( ?int $variantId = null, ?string $imageUrl = null, ?string $label = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->sku = $sku; $this->variantId = $variantId; $this->imageUrl = $imageUrl; $this->label = $label; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -87,6 +95,9 @@ public function getAction() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -104,6 +115,9 @@ public function getSku() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -121,7 +135,8 @@ public function getVariantId() } /** - *

    The URL of the image.

    + *

    The URL of the image to set the label.

    + * * * @return null|string */ @@ -140,8 +155,8 @@ public function getImageUrl() } /** - *

    The new image label. - * If left blank or set to null, the label is removed.

    + *

    Value to set. If empty, any existing value will be removed.

    + * * * @return null|string */ @@ -160,6 +175,9 @@ public function getLabel() } /** + *

    If true, only the staged image is updated. If false, both the current and staged image is updated.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetKeyAction.php b/lib/commercetools-api/src/Models/Product/ProductSetKeyAction.php index 367288d4a12..512f5c48c12 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetKeyAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetKeyAction.php @@ -16,9 +16,9 @@ interface ProductSetKeyAction extends ProductUpdateAction public const FIELD_KEY = 'key'; /** - *

    User-specific unique identifier for the product. - * If left blank or set to null, the product key is unset/removed.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetKeyActionBuilder.php index 4c501ea3822..26ecdaeeb92 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetKeyActionBuilder.php @@ -21,14 +21,15 @@ final class ProductSetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; /** - *

    User-specific unique identifier for the product. - * If left blank or set to null, the product key is unset/removed.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetKeyActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetKeyActionModel.php index 2ea3e05ee8a..78ef1b03733 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetKeyActionModel.php @@ -21,11 +21,13 @@ final class ProductSetKeyActionModel extends JsonObjectModel implements ProductS { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class ProductSetKeyActionModel extends JsonObjectModel implements ProductS * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,8 +63,8 @@ public function getAction() } /** - *

    User-specific unique identifier for the product. - * If left blank or set to null, the product key is unset/removed.

    + *

    Value to set. If empty, any existing value will be removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Product/ProductSetMetaDescriptionAction.php b/lib/commercetools-api/src/Models/Product/ProductSetMetaDescriptionAction.php index 41d6d997363..435729718a8 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetMetaDescriptionAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetMetaDescriptionAction.php @@ -18,11 +18,17 @@ interface ProductSetMetaDescriptionAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    Value to set. If empty, any existing value will be removed.

    + * + * @return null|LocalizedString */ public function getMetaDescription(); /** + *

    If true, only the staged metaDescription is updated. If false, both the current and staged metaDescription are updated.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetMetaDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetMetaDescriptionActionBuilder.php index ee79626e5cb..844a8d80dc4 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetMetaDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetMetaDescriptionActionBuilder.php @@ -23,16 +23,21 @@ final class ProductSetMetaDescriptionActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaDescription; /** + * @var ?bool */ private $staged; /** + *

    Value to set. If empty, any existing value will be removed.

    + * + * @return null|LocalizedString */ public function getMetaDescription() @@ -41,6 +46,9 @@ public function getMetaDescription() } /** + *

    If true, only the staged metaDescription is updated. If false, both the current and staged metaDescription are updated.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetMetaDescriptionActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetMetaDescriptionActionModel.php index 58ac9333131..d7397d79f0e 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetMetaDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetMetaDescriptionActionModel.php @@ -23,16 +23,19 @@ final class ProductSetMetaDescriptionActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setMetaDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $metaDescription; /** + * * @var ?bool */ protected $staged; @@ -43,14 +46,16 @@ final class ProductSetMetaDescriptionActionModel extends JsonObjectModel impleme */ public function __construct( ?LocalizedString $metaDescription = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->metaDescription = $metaDescription; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,9 @@ public function getAction() } /** + *

    Value to set. If empty, any existing value will be removed.

    + * + * * @return null|LocalizedString */ public function getMetaDescription() @@ -86,6 +94,9 @@ public function getMetaDescription() } /** + *

    If true, only the staged metaDescription is updated. If false, both the current and staged metaDescription are updated.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetMetaKeywordsAction.php b/lib/commercetools-api/src/Models/Product/ProductSetMetaKeywordsAction.php index 21c94a698fe..19baa33a63d 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetMetaKeywordsAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetMetaKeywordsAction.php @@ -18,11 +18,17 @@ interface ProductSetMetaKeywordsAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    Value to set. If empty, any existing value will be removed.

    + * + * @return null|LocalizedString */ public function getMetaKeywords(); /** + *

    If true, only the staged metaKeywords is updated. If false, both the current and staged metaKeywords are updated.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetMetaKeywordsActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetMetaKeywordsActionBuilder.php index 86138fa161b..5bea740cb1c 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetMetaKeywordsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetMetaKeywordsActionBuilder.php @@ -23,16 +23,21 @@ final class ProductSetMetaKeywordsActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaKeywords; /** + * @var ?bool */ private $staged; /** + *

    Value to set. If empty, any existing value will be removed.

    + * + * @return null|LocalizedString */ public function getMetaKeywords() @@ -41,6 +46,9 @@ public function getMetaKeywords() } /** + *

    If true, only the staged metaKeywords is updated. If false, both the current and staged metaKeywords are updated.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetMetaKeywordsActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetMetaKeywordsActionModel.php index 9a503257d12..a2131b9e749 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetMetaKeywordsActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetMetaKeywordsActionModel.php @@ -23,16 +23,19 @@ final class ProductSetMetaKeywordsActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setMetaKeywords'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $metaKeywords; /** + * * @var ?bool */ protected $staged; @@ -43,14 +46,16 @@ final class ProductSetMetaKeywordsActionModel extends JsonObjectModel implements */ public function __construct( ?LocalizedString $metaKeywords = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->metaKeywords = $metaKeywords; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,9 @@ public function getAction() } /** + *

    Value to set. If empty, any existing value will be removed.

    + * + * * @return null|LocalizedString */ public function getMetaKeywords() @@ -86,6 +94,9 @@ public function getMetaKeywords() } /** + *

    If true, only the staged metaKeywords is updated. If false, both the current and staged metaKeywords are updated.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetMetaTitleAction.php b/lib/commercetools-api/src/Models/Product/ProductSetMetaTitleAction.php index 15bad076920..879f7022bbc 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetMetaTitleAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetMetaTitleAction.php @@ -18,11 +18,17 @@ interface ProductSetMetaTitleAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    Value to set. If empty, any existing value will be removed.

    + * + * @return null|LocalizedString */ public function getMetaTitle(); /** + *

    If true, only the staged metaTitle is updated. If false, both the current and staged metaTitle are updated.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetMetaTitleActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetMetaTitleActionBuilder.php index f63368d3a67..9399cadce22 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetMetaTitleActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetMetaTitleActionBuilder.php @@ -23,16 +23,21 @@ final class ProductSetMetaTitleActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaTitle; /** + * @var ?bool */ private $staged; /** + *

    Value to set. If empty, any existing value will be removed.

    + * + * @return null|LocalizedString */ public function getMetaTitle() @@ -41,6 +46,9 @@ public function getMetaTitle() } /** + *

    If true, only the staged metaTitle is updated. If false, both the current and staged metaTitle are updated.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetMetaTitleActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetMetaTitleActionModel.php index 2cd76b4e0f8..a7a74eb603e 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetMetaTitleActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetMetaTitleActionModel.php @@ -23,16 +23,19 @@ final class ProductSetMetaTitleActionModel extends JsonObjectModel implements Pr { public const DISCRIMINATOR_VALUE = 'setMetaTitle'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $metaTitle; /** + * * @var ?bool */ protected $staged; @@ -43,14 +46,16 @@ final class ProductSetMetaTitleActionModel extends JsonObjectModel implements Pr */ public function __construct( ?LocalizedString $metaTitle = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->metaTitle = $metaTitle; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,9 @@ public function getAction() } /** + *

    Value to set. If empty, any existing value will be removed.

    + * + * * @return null|LocalizedString */ public function getMetaTitle() @@ -86,6 +94,9 @@ public function getMetaTitle() } /** + *

    If true, only the staged metaTitle is updated. If false, both the current and staged metaTitle are updated.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetPriceModeAction.php b/lib/commercetools-api/src/Models/Product/ProductSetPriceModeAction.php index 5ab355434c4..f78b8fa9874 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetPriceModeAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetPriceModeAction.php @@ -16,8 +16,9 @@ interface ProductSetPriceModeAction extends ProductUpdateAction public const FIELD_PRICE_MODE = 'priceMode'; /** - *

    Specifies which type of prices should be used when looking up a price for this product. If not set, Embedded ProductPriceMode is used.

    + *

    Specifies which type of Prices should be used when looking up a price for the Product.

    * + * @return null|string */ public function getPriceMode(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetPriceModeActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetPriceModeActionBuilder.php index 36fbf2f1d55..2423fe1fe81 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetPriceModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetPriceModeActionBuilder.php @@ -21,13 +21,15 @@ final class ProductSetPriceModeActionBuilder implements Builder { /** + * @var ?string */ private $priceMode; /** - *

    Specifies which type of prices should be used when looking up a price for this product. If not set, Embedded ProductPriceMode is used.

    + *

    Specifies which type of Prices should be used when looking up a price for the Product.

    * + * @return null|string */ public function getPriceMode() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetPriceModeActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetPriceModeActionModel.php index 46ca3c3401d..f3113e12a18 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetPriceModeActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetPriceModeActionModel.php @@ -21,11 +21,13 @@ final class ProductSetPriceModeActionModel extends JsonObjectModel implements Pr { public const DISCRIMINATOR_VALUE = 'setPriceMode'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $priceMode; @@ -35,13 +37,15 @@ final class ProductSetPriceModeActionModel extends JsonObjectModel implements Pr * @psalm-suppress MissingParamType */ public function __construct( - ?string $priceMode = null + ?string $priceMode = null, + ?string $action = null ) { $this->priceMode = $priceMode; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,7 +63,8 @@ public function getAction() } /** - *

    Specifies which type of prices should be used when looking up a price for this product. If not set, Embedded ProductPriceMode is used.

    + *

    Specifies which type of Prices should be used when looking up a price for the Product.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Product/ProductSetPricesAction.php b/lib/commercetools-api/src/Models/Product/ProductSetPricesAction.php index b7e8d42c1bb..d22bd864830 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetPricesAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetPricesAction.php @@ -20,21 +20,34 @@ interface ProductSetPricesAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** + *

    The Embedded Prices to set. + * Each Price must have its unique Price scope (with same currency, country, Customer Group, Channel, validFrom and validUntil).

    + * + * @return null|PriceDraftCollection */ public function getPrices(); /** + *

    If true, only the staged ProductVariant is updated. If false, both the current and staged ProductVariant are updated.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetPricesActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetPricesActionBuilder.php index fac8bfe4dcb..605eff110a2 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetPricesActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetPricesActionBuilder.php @@ -22,26 +22,33 @@ final class ProductSetPricesActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?PriceDraftCollection */ private $prices; /** + * @var ?bool */ private $staged; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -50,6 +57,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -58,6 +68,10 @@ public function getSku() } /** + *

    The Embedded Prices to set. + * Each Price must have its unique Price scope (with same currency, country, Customer Group, Channel, validFrom and validUntil).

    + * + * @return null|PriceDraftCollection */ public function getPrices() @@ -66,6 +80,9 @@ public function getPrices() } /** + *

    If true, only the staged ProductVariant is updated. If false, both the current and staged ProductVariant are updated.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetPricesActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetPricesActionModel.php index a4b982f3feb..990cc220b3d 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetPricesActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetPricesActionModel.php @@ -22,26 +22,31 @@ final class ProductSetPricesActionModel extends JsonObjectModel implements Produ { public const DISCRIMINATOR_VALUE = 'setPrices'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?PriceDraftCollection */ protected $prices; /** + * * @var ?bool */ protected $staged; @@ -54,16 +59,18 @@ public function __construct( ?int $variantId = null, ?string $sku = null, ?PriceDraftCollection $prices = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; $this->prices = $prices; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -81,6 +88,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -98,6 +108,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -115,6 +128,10 @@ public function getSku() } /** + *

    The Embedded Prices to set. + * Each Price must have its unique Price scope (with same currency, country, Customer Group, Channel, validFrom and validUntil).

    + * + * * @return null|PriceDraftCollection */ public function getPrices() @@ -132,6 +149,9 @@ public function getPrices() } /** + *

    If true, only the staged ProductVariant is updated. If false, both the current and staged ProductVariant are updated.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomFieldAction.php b/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomFieldAction.php index 0eb8eaa1f8e..c97915a6ce5 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomFieldAction.php @@ -19,11 +19,17 @@ interface ProductSetProductPriceCustomFieldAction extends ProductUpdateAction public const FIELD_VALUE = 'value'; /** + *

    The id of the Embedded Price to update.

    + * + * @return null|string */ public function getPriceId(); /** + *

    If true, only the staged Embedded Price Custom Field is updated. If false, both the current and staged Embedded Price Custom Field are updated.

    + * + * @return null|bool */ public function getStaged(); @@ -31,15 +37,17 @@ public function getStaged(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); /** *

    If value is absent or null, this field will be removed if it exists. - * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomFieldActionBuilder.php index 8d8b0aca59e..b4b78ecc487 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomFieldActionBuilder.php @@ -21,26 +21,33 @@ final class ProductSetProductPriceCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $priceId; /** + * @var ?bool */ private $staged; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + *

    The id of the Embedded Price to update.

    + * + * @return null|string */ public function getPriceId() @@ -49,6 +56,9 @@ public function getPriceId() } /** + *

    If true, only the staged Embedded Price Custom Field is updated. If false, both the current and staged Embedded Price Custom Field are updated.

    + * + * @return null|bool */ public function getStaged() @@ -59,6 +69,7 @@ public function getStaged() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -68,9 +79,10 @@ public function getName() /** *

    If value is absent or null, this field will be removed if it exists. - * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomFieldActionModel.php index b0e94da870c..45444ee7910 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomFieldActionModel.php @@ -21,26 +21,31 @@ final class ProductSetProductPriceCustomFieldActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setProductPriceCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $priceId; /** + * * @var ?bool */ protected $staged; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -53,16 +58,18 @@ public function __construct( ?string $priceId = null, ?bool $staged = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->priceId = $priceId; $this->staged = $staged; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -80,6 +87,9 @@ public function getAction() } /** + *

    The id of the Embedded Price to update.

    + * + * * @return null|string */ public function getPriceId() @@ -97,6 +107,9 @@ public function getPriceId() } /** + *

    If true, only the staged Embedded Price Custom Field is updated. If false, both the current and staged Embedded Price Custom Field are updated.

    + * + * * @return null|bool */ public function getStaged() @@ -116,6 +129,7 @@ public function getStaged() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -134,9 +148,10 @@ public function getName() /** *

    If value is absent or null, this field will be removed if it exists. - * Trying to remove a field that does not exist will fail with an InvalidOperation error. + * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomTypeAction.php b/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomTypeAction.php index 0ba888fecea..347f9e6f5c6 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomTypeAction.php @@ -21,26 +21,34 @@ interface ProductSetProductPriceCustomTypeAction extends ProductUpdateAction public const FIELD_FIELDS = 'fields'; /** + *

    The id of the Embedded Price to update.

    + * + * @return null|string */ public function getPriceId(); /** + *

    If true, only the staged Embedded Price is updated. If false, both the current and staged Embedded Price is updated.

    + * + * @return null|bool */ public function getStaged(); /** *

    Defines the Type that extends the Price with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the Price.

    + * If absent, any existing Type and Custom Fields are removed from the Embedded Price.

    * + * @return null|TypeResourceIdentifier */ public function getType(); /** - *

    Sets the Custom Fields fields for the Price.

    + *

    Sets the Custom Fields fields for the Embedded Price.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomTypeActionBuilder.php index 3a154786ec6..d46ddb042df 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomTypeActionBuilder.php @@ -25,26 +25,33 @@ final class ProductSetProductPriceCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $priceId; /** + * @var ?bool */ private $staged; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + *

    The id of the Embedded Price to update.

    + * + * @return null|string */ public function getPriceId() @@ -53,6 +60,9 @@ public function getPriceId() } /** + *

    If true, only the staged Embedded Price is updated. If false, both the current and staged Embedded Price is updated.

    + * + * @return null|bool */ public function getStaged() @@ -62,8 +72,9 @@ public function getStaged() /** *

    Defines the Type that extends the Price with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the Price.

    + * If absent, any existing Type and Custom Fields are removed from the Embedded Price.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -72,8 +83,9 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the Price.

    + *

    Sets the Custom Fields fields for the Embedded Price.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomTypeActionModel.php index d7b31625fe3..e9931a14a42 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetProductPriceCustomTypeActionModel.php @@ -25,26 +25,31 @@ final class ProductSetProductPriceCustomTypeActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setProductPriceCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $priceId; /** + * * @var ?bool */ protected $staged; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -57,16 +62,18 @@ public function __construct( ?string $priceId = null, ?bool $staged = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->priceId = $priceId; $this->staged = $staged; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -84,6 +91,9 @@ public function getAction() } /** + *

    The id of the Embedded Price to update.

    + * + * * @return null|string */ public function getPriceId() @@ -101,6 +111,9 @@ public function getPriceId() } /** + *

    If true, only the staged Embedded Price is updated. If false, both the current and staged Embedded Price is updated.

    + * + * * @return null|bool */ public function getStaged() @@ -119,7 +132,8 @@ public function getStaged() /** *

    Defines the Type that extends the Price with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the Price.

    + * If absent, any existing Type and Custom Fields are removed from the Embedded Price.

    + * * * @return null|TypeResourceIdentifier */ @@ -139,7 +153,8 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the Price.

    + *

    Sets the Custom Fields fields for the Embedded Price.

    + * * * @return null|FieldContainer */ diff --git a/lib/commercetools-api/src/Models/Product/ProductSetProductVariantKeyAction.php b/lib/commercetools-api/src/Models/Product/ProductSetProductVariantKeyAction.php index 1dcb8832745..1cf4cce5dbe 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetProductVariantKeyAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetProductVariantKeyAction.php @@ -19,23 +19,33 @@ interface ProductSetProductVariantKeyAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku(); /** - *

    If left blank or set to null, the key is unset/removed.

    + *

    Value to set. Must be unique. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey(); /** + *

    If true, only the staged key is set. If false, both the current and staged key are set.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetProductVariantKeyActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetProductVariantKeyActionBuilder.php index 81bfb9dd54b..da6acf727b5 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetProductVariantKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetProductVariantKeyActionBuilder.php @@ -21,26 +21,33 @@ final class ProductSetProductVariantKeyActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?string */ private $key; /** + * @var ?bool */ private $staged; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -49,6 +56,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * @return null|string */ public function getSku() @@ -57,8 +67,9 @@ public function getSku() } /** - *

    If left blank or set to null, the key is unset/removed.

    + *

    Value to set. Must be unique. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey() @@ -67,6 +78,9 @@ public function getKey() } /** + *

    If true, only the staged key is set. If false, both the current and staged key are set.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetProductVariantKeyActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetProductVariantKeyActionModel.php index b7fae630104..bf024d270db 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetProductVariantKeyActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetProductVariantKeyActionModel.php @@ -21,26 +21,31 @@ final class ProductSetProductVariantKeyActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setProductVariantKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $key; /** + * * @var ?bool */ protected $staged; @@ -53,16 +58,18 @@ public function __construct( ?int $variantId = null, ?string $sku = null, ?string $key = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; $this->key = $key; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -80,6 +87,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -97,6 +107,9 @@ public function getVariantId() } /** + *

    The sku of the ProductVariant to update.

    + * + * * @return null|string */ public function getSku() @@ -114,7 +127,8 @@ public function getSku() } /** - *

    If left blank or set to null, the key is unset/removed.

    + *

    Value to set. Must be unique. If empty, any existing value will be removed.

    + * * * @return null|string */ @@ -133,6 +147,9 @@ public function getKey() } /** + *

    If true, only the staged key is set. If false, both the current and staged key are set.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetSearchKeywordsAction.php b/lib/commercetools-api/src/Models/Product/ProductSetSearchKeywordsAction.php index 0d85121d8c5..227e9612f5c 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetSearchKeywordsAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetSearchKeywordsAction.php @@ -17,11 +17,17 @@ interface ProductSetSearchKeywordsAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    Value to set.

    + * + * @return null|SearchKeywords */ public function getSearchKeywords(); /** + *

    If true, only the staged searchKeywords is updated. If false, both the current and staged searchKeywords are updated.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetSearchKeywordsActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetSearchKeywordsActionBuilder.php index 15aedebb977..1cc86eab200 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetSearchKeywordsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetSearchKeywordsActionBuilder.php @@ -21,16 +21,21 @@ final class ProductSetSearchKeywordsActionBuilder implements Builder { /** + * @var null|SearchKeywords|SearchKeywordsBuilder */ private $searchKeywords; /** + * @var ?bool */ private $staged; /** + *

    Value to set.

    + * + * @return null|SearchKeywords */ public function getSearchKeywords() @@ -39,6 +44,9 @@ public function getSearchKeywords() } /** + *

    If true, only the staged searchKeywords is updated. If false, both the current and staged searchKeywords are updated.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetSearchKeywordsActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetSearchKeywordsActionModel.php index b2d8bec875b..a759ccbcbc4 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetSearchKeywordsActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetSearchKeywordsActionModel.php @@ -21,16 +21,19 @@ final class ProductSetSearchKeywordsActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'setSearchKeywords'; /** + * * @var ?string */ protected $action; /** + * * @var ?SearchKeywords */ protected $searchKeywords; /** + * * @var ?bool */ protected $staged; @@ -41,14 +44,16 @@ final class ProductSetSearchKeywordsActionModel extends JsonObjectModel implemen */ public function __construct( ?SearchKeywords $searchKeywords = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->searchKeywords = $searchKeywords; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,9 @@ public function getAction() } /** + *

    Value to set.

    + * + * * @return null|SearchKeywords */ public function getSearchKeywords() @@ -84,6 +92,9 @@ public function getSearchKeywords() } /** + *

    If true, only the staged searchKeywords is updated. If false, both the current and staged searchKeywords are updated.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetSkuAction.php b/lib/commercetools-api/src/Models/Product/ProductSetSkuAction.php index 57e50a62d7a..b13e755b943 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetSkuAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetSkuAction.php @@ -18,19 +18,25 @@ interface ProductSetSkuAction extends ProductUpdateAction public const FIELD_STAGED = 'staged'; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId(); /** - *

    SKU must be unique. - * If left blank or set to null, the sku is unset/removed.

    + *

    Value to set. Must be unique. If empty, any existing value will be removed.

    * + * @return null|string */ public function getSku(); /** + *

    If true, only the staged sku is updated. If false, both the current and staged sku are updated.

    + * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetSkuActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetSkuActionBuilder.php index 6653fd32bfa..07311ce8e8d 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetSkuActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetSkuActionBuilder.php @@ -21,21 +21,27 @@ final class ProductSetSkuActionBuilder implements Builder { /** + * @var ?int */ private $variantId; /** + * @var ?string */ private $sku; /** + * @var ?bool */ private $staged; /** + *

    The id of the ProductVariant to update.

    + * + * @return null|int */ public function getVariantId() @@ -44,9 +50,9 @@ public function getVariantId() } /** - *

    SKU must be unique. - * If left blank or set to null, the sku is unset/removed.

    + *

    Value to set. Must be unique. If empty, any existing value will be removed.

    * + * @return null|string */ public function getSku() @@ -55,6 +61,9 @@ public function getSku() } /** + *

    If true, only the staged sku is updated. If false, both the current and staged sku are updated.

    + * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetSkuActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetSkuActionModel.php index d9ed253409b..8dc4bb4f7ac 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetSkuActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetSkuActionModel.php @@ -21,21 +21,25 @@ final class ProductSetSkuActionModel extends JsonObjectModel implements ProductS { public const DISCRIMINATOR_VALUE = 'setSku'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $variantId; /** + * * @var ?string */ protected $sku; /** + * * @var ?bool */ protected $staged; @@ -47,15 +51,17 @@ final class ProductSetSkuActionModel extends JsonObjectModel implements ProductS public function __construct( ?int $variantId = null, ?string $sku = null, - ?bool $staged = null + ?bool $staged = null, + ?string $action = null ) { $this->variantId = $variantId; $this->sku = $sku; $this->staged = $staged; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,9 @@ public function getAction() } /** + *

    The id of the ProductVariant to update.

    + * + * * @return null|int */ public function getVariantId() @@ -90,8 +99,8 @@ public function getVariantId() } /** - *

    SKU must be unique. - * If left blank or set to null, the sku is unset/removed.

    + *

    Value to set. Must be unique. If empty, any existing value will be removed.

    + * * * @return null|string */ @@ -110,6 +119,9 @@ public function getSku() } /** + *

    If true, only the staged sku is updated. If false, both the current and staged sku are updated.

    + * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetTaxCategoryAction.php b/lib/commercetools-api/src/Models/Product/ProductSetTaxCategoryAction.php index e604d2769f8..ff60b1bbbe8 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetTaxCategoryAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetTaxCategoryAction.php @@ -17,8 +17,9 @@ interface ProductSetTaxCategoryAction extends ProductUpdateAction public const FIELD_TAX_CATEGORY = 'taxCategory'; /** - *

    If left blank or set to null, the tax category is unset/removed.

    + *

    The Tax Category to set. If empty, any existing value will be removed.

    * + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory(); diff --git a/lib/commercetools-api/src/Models/Product/ProductSetTaxCategoryActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductSetTaxCategoryActionBuilder.php index ec5eb9e56b3..4c263b566ce 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetTaxCategoryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetTaxCategoryActionBuilder.php @@ -23,13 +23,15 @@ final class ProductSetTaxCategoryActionBuilder implements Builder { /** + * @var null|TaxCategoryResourceIdentifier|TaxCategoryResourceIdentifierBuilder */ private $taxCategory; /** - *

    If left blank or set to null, the tax category is unset/removed.

    + *

    The Tax Category to set. If empty, any existing value will be removed.

    * + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() diff --git a/lib/commercetools-api/src/Models/Product/ProductSetTaxCategoryActionModel.php b/lib/commercetools-api/src/Models/Product/ProductSetTaxCategoryActionModel.php index 5fd029e244e..d0c2d6b0966 100644 --- a/lib/commercetools-api/src/Models/Product/ProductSetTaxCategoryActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductSetTaxCategoryActionModel.php @@ -23,11 +23,13 @@ final class ProductSetTaxCategoryActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setTaxCategory'; /** + * * @var ?string */ protected $action; /** + * * @var ?TaxCategoryResourceIdentifier */ protected $taxCategory; @@ -37,13 +39,15 @@ final class ProductSetTaxCategoryActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?TaxCategoryResourceIdentifier $taxCategory = null + ?TaxCategoryResourceIdentifier $taxCategory = null, + ?string $action = null ) { $this->taxCategory = $taxCategory; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,7 +65,8 @@ public function getAction() } /** - *

    If left blank or set to null, the tax category is unset/removed.

    + *

    The Tax Category to set. If empty, any existing value will be removed.

    + * * * @return null|TaxCategoryResourceIdentifier */ diff --git a/lib/commercetools-api/src/Models/Product/ProductTransitionStateAction.php b/lib/commercetools-api/src/Models/Product/ProductTransitionStateAction.php index 01312087edf..f3f475aec1c 100644 --- a/lib/commercetools-api/src/Models/Product/ProductTransitionStateAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductTransitionStateAction.php @@ -18,11 +18,17 @@ interface ProductTransitionStateAction extends ProductUpdateAction public const FIELD_FORCE = 'force'; /** + *

    The State to transition to. If there is no existing State, this must be an initial State.

    + * + * @return null|StateResourceIdentifier */ public function getState(); /** + *

    If true, validations are disabled.

    + * + * @return null|bool */ public function getForce(); diff --git a/lib/commercetools-api/src/Models/Product/ProductTransitionStateActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductTransitionStateActionBuilder.php index af836195bb6..278135b74dc 100644 --- a/lib/commercetools-api/src/Models/Product/ProductTransitionStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductTransitionStateActionBuilder.php @@ -23,16 +23,21 @@ final class ProductTransitionStateActionBuilder implements Builder { /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $state; /** + * @var ?bool */ private $force; /** + *

    The State to transition to. If there is no existing State, this must be an initial State.

    + * + * @return null|StateResourceIdentifier */ public function getState() @@ -41,6 +46,9 @@ public function getState() } /** + *

    If true, validations are disabled.

    + * + * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Product/ProductTransitionStateActionModel.php b/lib/commercetools-api/src/Models/Product/ProductTransitionStateActionModel.php index ba473ae4641..c4de3c77756 100644 --- a/lib/commercetools-api/src/Models/Product/ProductTransitionStateActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductTransitionStateActionModel.php @@ -23,16 +23,19 @@ final class ProductTransitionStateActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'transitionState'; /** + * * @var ?string */ protected $action; /** + * * @var ?StateResourceIdentifier */ protected $state; /** + * * @var ?bool */ protected $force; @@ -43,14 +46,16 @@ final class ProductTransitionStateActionModel extends JsonObjectModel implements */ public function __construct( ?StateResourceIdentifier $state = null, - ?bool $force = null + ?bool $force = null, + ?string $action = null ) { $this->state = $state; $this->force = $force; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,9 @@ public function getAction() } /** + *

    The State to transition to. If there is no existing State, this must be an initial State.

    + * + * * @return null|StateResourceIdentifier */ public function getState() @@ -86,6 +94,9 @@ public function getState() } /** + *

    If true, validations are disabled.

    + * + * * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Product/ProductUnpublishActionModel.php b/lib/commercetools-api/src/Models/Product/ProductUnpublishActionModel.php index 7dca9aae192..9f5b10d6c49 100644 --- a/lib/commercetools-api/src/Models/Product/ProductUnpublishActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductUnpublishActionModel.php @@ -21,6 +21,7 @@ final class ProductUnpublishActionModel extends JsonObjectModel implements Produ { public const DISCRIMINATOR_VALUE = 'unpublish'; /** + * * @var ?string */ protected $action; @@ -30,11 +31,13 @@ final class ProductUnpublishActionModel extends JsonObjectModel implements Produ * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Product/ProductUpdate.php b/lib/commercetools-api/src/Models/Product/ProductUpdate.php index c08ff68d913..b1196bc10ee 100644 --- a/lib/commercetools-api/src/Models/Product/ProductUpdate.php +++ b/lib/commercetools-api/src/Models/Product/ProductUpdate.php @@ -17,11 +17,17 @@ interface ProductUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + *

    Expected version of the Product on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    + * + * @return null|int */ public function getVersion(); /** + *

    Update actions to be performed on the Product.

    + * + * @return null|ProductUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Product/ProductUpdateAction.php b/lib/commercetools-api/src/Models/Product/ProductUpdateAction.php index 5737f25b438..2551ffa17de 100644 --- a/lib/commercetools-api/src/Models/Product/ProductUpdateAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductUpdateAction.php @@ -17,6 +17,7 @@ interface ProductUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Product/ProductUpdateActionModel.php b/lib/commercetools-api/src/Models/Product/ProductUpdateActionModel.php index 9bcf9fc765e..e9658c004e0 100644 --- a/lib/commercetools-api/src/Models/Product/ProductUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductUpdateActionModel.php @@ -21,6 +21,7 @@ final class ProductUpdateActionModel extends JsonObjectModel implements ProductU { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -83,11 +84,13 @@ final class ProductUpdateActionModel extends JsonObjectModel implements ProductU * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Product/ProductUpdateBuilder.php b/lib/commercetools-api/src/Models/Product/ProductUpdateBuilder.php index 261c1157ea9..f5a98973aa4 100644 --- a/lib/commercetools-api/src/Models/Product/ProductUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductUpdateBuilder.php @@ -21,16 +21,21 @@ final class ProductUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?ProductUpdateActionCollection */ private $actions; /** + *

    Expected version of the Product on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    + * + * @return null|int */ public function getVersion() @@ -39,6 +44,9 @@ public function getVersion() } /** + *

    Update actions to be performed on the Product.

    + * + * @return null|ProductUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Product/ProductUpdateModel.php b/lib/commercetools-api/src/Models/Product/ProductUpdateModel.php index 072ef661288..1fdbb3957dd 100644 --- a/lib/commercetools-api/src/Models/Product/ProductUpdateModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductUpdateModel.php @@ -20,11 +20,13 @@ final class ProductUpdateModel extends JsonObjectModel implements ProductUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?ProductUpdateActionCollection */ protected $actions; @@ -42,6 +44,9 @@ public function __construct( } /** + *

    Expected version of the Product on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    + * + * * @return null|int */ public function getVersion() @@ -59,6 +64,9 @@ public function getVersion() } /** + *

    Update actions to be performed on the Product.

    + * + * * @return null|ProductUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Product/ProductVariant.php b/lib/commercetools-api/src/Models/Product/ProductVariant.php index 688473eff69..60d8e8e6268 100644 --- a/lib/commercetools-api/src/Models/Product/ProductVariant.php +++ b/lib/commercetools-api/src/Models/Product/ProductVariant.php @@ -32,66 +32,106 @@ interface ProductVariant extends JsonObject public const FIELD_SCOPED_PRICE_DISCOUNTED = 'scopedPriceDiscounted'; /** - *

    A unique, sequential identifier of the ProductVariant within the Product.

    + *

    A unique, sequential identifier of the Product Variant within the Product.

    * + * @return null|int */ public function getId(); /** + *

    User-defined unique SKU of the Product Variant.

    + * + * @return null|string */ public function getSku(); /** - *

    User-defined unique identifier of the ProductVariant. - * ProductVariant keys are different from Product keys.

    + *

    User-defined unique identifier of the ProductVariant.

    + *

    This is different from Product key.

    * + * @return null|string */ public function getKey(); /** + *

    The Embedded Prices of the Product Variant. + * Cannot contain two Prices of the same Price scope (with same currency, country, Customer Group, Channel, validFrom and validUntil).

    + * + * @return null|PriceCollection */ public function getPrices(); /** + *

    Attributes of the Product Variant.

    + * + * @return null|AttributeCollection */ public function getAttributes(); /** + *

    Only available when Price selection is used. + * Cannot be used in a Query Predicate.

    + * + * @return null|Price */ public function getPrice(); /** + *

    Images of the Product Variant.

    + * + * @return null|ImageCollection */ public function getImages(); /** + *

    Media assets of the Product Variant.

    + * + * @return null|AssetCollection */ public function getAssets(); /** + *

    Set if the Product Variant is tracked by Inventory. + * Can be used as an optimization to reduce calls to the Inventory service. + * May not contain the latest Inventory State (it is eventually consistent).

    + * + * @return null|ProductVariantAvailability */ public function getAvailability(); /** + *

    true if the Product Variant matches the search query. + * Only available in response to a Product Projection Search request.

    + * + * @return null|bool */ public function getIsMatchingVariant(); /** + *

    Only available in response to a Product Projection Search request + * with price selection. + * Can be used to sort, filter, and facet.

    + * + * @return null|ScopedPrice */ public function getScopedPrice(); /** + *

    Only available in response to a Product Projection Search request + * with price selection.

    + * + * @return null|bool */ public function getScopedPriceDiscounted(); diff --git a/lib/commercetools-api/src/Models/Product/ProductVariantAvailability.php b/lib/commercetools-api/src/Models/Product/ProductVariantAvailability.php index b39770fbc11..c2bc4171c4f 100644 --- a/lib/commercetools-api/src/Models/Product/ProductVariantAvailability.php +++ b/lib/commercetools-api/src/Models/Product/ProductVariantAvailability.php @@ -13,30 +13,47 @@ interface ProductVariantAvailability extends JsonObject { + public const FIELD_CHANNELS = 'channels'; public const FIELD_IS_ON_STOCK = 'isOnStock'; public const FIELD_RESTOCKABLE_IN_DAYS = 'restockableInDays'; public const FIELD_AVAILABLE_QUANTITY = 'availableQuantity'; - public const FIELD_CHANNELS = 'channels'; /** + *

    For each InventoryEntry with a supply Channel, an entry is added to channels.

    + * + + * @return null|ProductVariantChannelAvailabilityMap + */ + public function getChannels(); + + /** + *

    Indicates whether a Product Variant is in stock.

    + * + * @return null|bool */ public function getIsOnStock(); /** + *

    Number of days to restock a Product Variant once it is out of stock.

    + * + * @return null|int */ public function getRestockableInDays(); /** + *

    Number of items of the Product Variant that are in stock.

    + * + * @return null|int */ public function getAvailableQuantity(); /** - * @return null|ProductVariantChannelAvailabilityMap + * @param ?ProductVariantChannelAvailabilityMap $channels */ - public function getChannels(); + public function setChannels(?ProductVariantChannelAvailabilityMap $channels): void; /** * @param ?bool $isOnStock @@ -52,9 +69,4 @@ public function setRestockableInDays(?int $restockableInDays): void; * @param ?int $availableQuantity */ public function setAvailableQuantity(?int $availableQuantity): void; - - /** - * @param ?ProductVariantChannelAvailabilityMap $channels - */ - public function setChannels(?ProductVariantChannelAvailabilityMap $channels): void; } diff --git a/lib/commercetools-api/src/Models/Product/ProductVariantAvailabilityBuilder.php b/lib/commercetools-api/src/Models/Product/ProductVariantAvailabilityBuilder.php index cd88f587363..194e1cdf4fa 100644 --- a/lib/commercetools-api/src/Models/Product/ProductVariantAvailabilityBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductVariantAvailabilityBuilder.php @@ -21,26 +21,44 @@ final class ProductVariantAvailabilityBuilder implements Builder { /** + + * @var null|ProductVariantChannelAvailabilityMap|ProductVariantChannelAvailabilityMapBuilder + */ + private $channels; + + /** + * @var ?bool */ private $isOnStock; /** + * @var ?int */ private $restockableInDays; /** + * @var ?int */ private $availableQuantity; /** - * @var null|ProductVariantChannelAvailabilityMap|ProductVariantChannelAvailabilityMapBuilder + *

    For each InventoryEntry with a supply Channel, an entry is added to channels.

    + * + + * @return null|ProductVariantChannelAvailabilityMap */ - private $channels; + public function getChannels() + { + return $this->channels instanceof ProductVariantChannelAvailabilityMapBuilder ? $this->channels->build() : $this->channels; + } /** + *

    Indicates whether a Product Variant is in stock.

    + * + * @return null|bool */ public function getIsOnStock() @@ -49,6 +67,9 @@ public function getIsOnStock() } /** + *

    Number of days to restock a Product Variant once it is out of stock.

    + * + * @return null|int */ public function getRestockableInDays() @@ -57,6 +78,9 @@ public function getRestockableInDays() } /** + *

    Number of items of the Product Variant that are in stock.

    + * + * @return null|int */ public function getAvailableQuantity() @@ -65,11 +89,14 @@ public function getAvailableQuantity() } /** - * @return null|ProductVariantChannelAvailabilityMap + * @param ?ProductVariantChannelAvailabilityMap $channels + * @return $this */ - public function getChannels() + public function withChannels(?ProductVariantChannelAvailabilityMap $channels) { - return $this->channels instanceof ProductVariantChannelAvailabilityMapBuilder ? $this->channels->build() : $this->channels; + $this->channels = $channels; + + return $this; } /** @@ -105,17 +132,6 @@ public function withAvailableQuantity(?int $availableQuantity) return $this; } - /** - * @param ?ProductVariantChannelAvailabilityMap $channels - * @return $this - */ - public function withChannels(?ProductVariantChannelAvailabilityMap $channels) - { - $this->channels = $channels; - - return $this; - } - /** * @deprecated use withChannels() instead * @return $this @@ -130,10 +146,10 @@ public function withChannelsBuilder(?ProductVariantChannelAvailabilityMapBuilder public function build(): ProductVariantAvailability { return new ProductVariantAvailabilityModel( + $this->channels instanceof ProductVariantChannelAvailabilityMapBuilder ? $this->channels->build() : $this->channels, $this->isOnStock, $this->restockableInDays, - $this->availableQuantity, - $this->channels instanceof ProductVariantChannelAvailabilityMapBuilder ? $this->channels->build() : $this->channels + $this->availableQuantity ); } diff --git a/lib/commercetools-api/src/Models/Product/ProductVariantAvailabilityModel.php b/lib/commercetools-api/src/Models/Product/ProductVariantAvailabilityModel.php index d7e38d879e2..d0f84059da8 100644 --- a/lib/commercetools-api/src/Models/Product/ProductVariantAvailabilityModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductVariantAvailabilityModel.php @@ -20,42 +20,70 @@ final class ProductVariantAvailabilityModel extends JsonObjectModel implements ProductVariantAvailability { /** + * + * @var ?ProductVariantChannelAvailabilityMap + */ + protected $channels; + + /** + * * @var ?bool */ protected $isOnStock; /** + * * @var ?int */ protected $restockableInDays; /** + * * @var ?int */ protected $availableQuantity; - /** - * @var ?ProductVariantChannelAvailabilityMap - */ - protected $channels; - /** * @psalm-suppress MissingParamType */ public function __construct( + ?ProductVariantChannelAvailabilityMap $channels = null, ?bool $isOnStock = null, ?int $restockableInDays = null, - ?int $availableQuantity = null, - ?ProductVariantChannelAvailabilityMap $channels = null + ?int $availableQuantity = null ) { + $this->channels = $channels; $this->isOnStock = $isOnStock; $this->restockableInDays = $restockableInDays; $this->availableQuantity = $availableQuantity; - $this->channels = $channels; } /** + *

    For each InventoryEntry with a supply Channel, an entry is added to channels.

    + * + * + * @return null|ProductVariantChannelAvailabilityMap + */ + public function getChannels() + { + if (is_null($this->channels)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CHANNELS); + if (is_null($data)) { + return null; + } + + $this->channels = ProductVariantChannelAvailabilityMapModel::of($data); + } + + return $this->channels; + } + + /** + *

    Indicates whether a Product Variant is in stock.

    + * + * * @return null|bool */ public function getIsOnStock() @@ -73,6 +101,9 @@ public function getIsOnStock() } /** + *

    Number of days to restock a Product Variant once it is out of stock.

    + * + * * @return null|int */ public function getRestockableInDays() @@ -90,6 +121,9 @@ public function getRestockableInDays() } /** + *

    Number of items of the Product Variant that are in stock.

    + * + * * @return null|int */ public function getAvailableQuantity() @@ -106,25 +140,15 @@ public function getAvailableQuantity() return $this->availableQuantity; } + /** - * @return null|ProductVariantChannelAvailabilityMap + * @param ?ProductVariantChannelAvailabilityMap $channels */ - public function getChannels() + public function setChannels(?ProductVariantChannelAvailabilityMap $channels): void { - if (is_null($this->channels)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CHANNELS); - if (is_null($data)) { - return null; - } - - $this->channels = ProductVariantChannelAvailabilityMapModel::of($data); - } - - return $this->channels; + $this->channels = $channels; } - /** * @param ?bool $isOnStock */ @@ -148,12 +172,4 @@ public function setAvailableQuantity(?int $availableQuantity): void { $this->availableQuantity = $availableQuantity; } - - /** - * @param ?ProductVariantChannelAvailabilityMap $channels - */ - public function setChannels(?ProductVariantChannelAvailabilityMap $channels): void - { - $this->channels = $channels; - } } diff --git a/lib/commercetools-api/src/Models/Product/ProductVariantBuilder.php b/lib/commercetools-api/src/Models/Product/ProductVariantBuilder.php index ddb64848a1d..bdb8058ffcc 100644 --- a/lib/commercetools-api/src/Models/Product/ProductVariantBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductVariantBuilder.php @@ -28,68 +28,81 @@ final class ProductVariantBuilder implements Builder { /** + * @var ?int */ private $id; /** + * @var ?string */ private $sku; /** + * @var ?string */ private $key; /** + * @var ?PriceCollection */ private $prices; /** + * @var ?AttributeCollection */ private $attributes; /** + * @var null|Price|PriceBuilder */ private $price; /** + * @var ?ImageCollection */ private $images; /** + * @var ?AssetCollection */ private $assets; /** + * @var null|ProductVariantAvailability|ProductVariantAvailabilityBuilder */ private $availability; /** + * @var ?bool */ private $isMatchingVariant; /** + * @var null|ScopedPrice|ScopedPriceBuilder */ private $scopedPrice; /** + * @var ?bool */ private $scopedPriceDiscounted; /** - *

    A unique, sequential identifier of the ProductVariant within the Product.

    + *

    A unique, sequential identifier of the Product Variant within the Product.

    * + * @return null|int */ public function getId() @@ -98,6 +111,9 @@ public function getId() } /** + *

    User-defined unique SKU of the Product Variant.

    + * + * @return null|string */ public function getSku() @@ -106,9 +122,10 @@ public function getSku() } /** - *

    User-defined unique identifier of the ProductVariant. - * ProductVariant keys are different from Product keys.

    + *

    User-defined unique identifier of the ProductVariant.

    + *

    This is different from Product key.

    * + * @return null|string */ public function getKey() @@ -117,6 +134,10 @@ public function getKey() } /** + *

    The Embedded Prices of the Product Variant. + * Cannot contain two Prices of the same Price scope (with same currency, country, Customer Group, Channel, validFrom and validUntil).

    + * + * @return null|PriceCollection */ public function getPrices() @@ -125,6 +146,9 @@ public function getPrices() } /** + *

    Attributes of the Product Variant.

    + * + * @return null|AttributeCollection */ public function getAttributes() @@ -133,6 +157,10 @@ public function getAttributes() } /** + *

    Only available when Price selection is used. + * Cannot be used in a Query Predicate.

    + * + * @return null|Price */ public function getPrice() @@ -141,6 +169,9 @@ public function getPrice() } /** + *

    Images of the Product Variant.

    + * + * @return null|ImageCollection */ public function getImages() @@ -149,6 +180,9 @@ public function getImages() } /** + *

    Media assets of the Product Variant.

    + * + * @return null|AssetCollection */ public function getAssets() @@ -157,6 +191,11 @@ public function getAssets() } /** + *

    Set if the Product Variant is tracked by Inventory. + * Can be used as an optimization to reduce calls to the Inventory service. + * May not contain the latest Inventory State (it is eventually consistent).

    + * + * @return null|ProductVariantAvailability */ public function getAvailability() @@ -165,6 +204,10 @@ public function getAvailability() } /** + *

    true if the Product Variant matches the search query. + * Only available in response to a Product Projection Search request.

    + * + * @return null|bool */ public function getIsMatchingVariant() @@ -173,6 +216,11 @@ public function getIsMatchingVariant() } /** + *

    Only available in response to a Product Projection Search request + * with price selection. + * Can be used to sort, filter, and facet.

    + * + * @return null|ScopedPrice */ public function getScopedPrice() @@ -181,6 +229,10 @@ public function getScopedPrice() } /** + *

    Only available in response to a Product Projection Search request + * with price selection.

    + * + * @return null|bool */ public function getScopedPriceDiscounted() diff --git a/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailability.php b/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailability.php index 29595fd9673..c6e7103f675 100644 --- a/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailability.php +++ b/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailability.php @@ -16,22 +16,49 @@ interface ProductVariantChannelAvailability extends JsonObject public const FIELD_IS_ON_STOCK = 'isOnStock'; public const FIELD_RESTOCKABLE_IN_DAYS = 'restockableInDays'; public const FIELD_AVAILABLE_QUANTITY = 'availableQuantity'; + public const FIELD_ID = 'id'; + public const FIELD_VERSION = 'version'; /** + *

    Indicates whether a Product Variant is in stock in a specified Channel.

    + * + * @return null|bool */ public function getIsOnStock(); /** + *

    Number of days to restock a Product Variant once it is out of stock in a specified Channel.

    + * + * @return null|int */ public function getRestockableInDays(); /** + *

    Number of items of this Product Variant that are in stock in a specified Channel.

    + * + * @return null|int */ public function getAvailableQuantity(); + /** + *

    Unique identifier of the InventoryEntry.

    + * + + * @return null|string + */ + public function getId(); + + /** + *

    Current version of the InventoryEntry.

    + * + + * @return null|int + */ + public function getVersion(); + /** * @param ?bool $isOnStock */ @@ -46,4 +73,14 @@ public function setRestockableInDays(?int $restockableInDays): void; * @param ?int $availableQuantity */ public function setAvailableQuantity(?int $availableQuantity): void; + + /** + * @param ?string $id + */ + public function setId(?string $id): void; + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void; } diff --git a/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityBuilder.php b/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityBuilder.php index 3616ee36c75..9946736b96d 100644 --- a/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityBuilder.php @@ -21,21 +21,39 @@ final class ProductVariantChannelAvailabilityBuilder implements Builder { /** + * @var ?bool */ private $isOnStock; /** + * @var ?int */ private $restockableInDays; /** + * @var ?int */ private $availableQuantity; /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + *

    Indicates whether a Product Variant is in stock in a specified Channel.

    + * + * @return null|bool */ public function getIsOnStock() @@ -44,6 +62,9 @@ public function getIsOnStock() } /** + *

    Number of days to restock a Product Variant once it is out of stock in a specified Channel.

    + * + * @return null|int */ public function getRestockableInDays() @@ -52,6 +73,9 @@ public function getRestockableInDays() } /** + *

    Number of items of this Product Variant that are in stock in a specified Channel.

    + * + * @return null|int */ public function getAvailableQuantity() @@ -59,6 +83,28 @@ public function getAvailableQuantity() return $this->availableQuantity; } + /** + *

    Unique identifier of the InventoryEntry.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    Current version of the InventoryEntry.

    + * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + /** * @param ?bool $isOnStock * @return $this @@ -92,13 +138,37 @@ public function withAvailableQuantity(?int $availableQuantity) return $this; } + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + public function build(): ProductVariantChannelAvailability { return new ProductVariantChannelAvailabilityModel( $this->isOnStock, $this->restockableInDays, - $this->availableQuantity + $this->availableQuantity, + $this->id, + $this->version ); } diff --git a/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityMap.php b/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityMap.php index 8ebe1a0734b..0c0c2a9a665 100644 --- a/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityMap.php +++ b/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityMap.php @@ -8,10 +8,8 @@ namespace Commercetools\Api\Models\Product; -use Commercetools\Base\DateTimeImmutableCollection; -use Commercetools\Base\JsonObject; +use Commercetools\Base\CMap; -interface ProductVariantChannelAvailabilityMap extends JsonObject +interface ProductVariantChannelAvailabilityMap extends CMap { - public const FIELD_PATTERN0 = '//'; } diff --git a/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityMapBuilder.php b/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityMapBuilder.php index 2be87a53031..39feb1745bc 100644 --- a/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityMapBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityMapBuilder.php @@ -9,25 +9,38 @@ namespace Commercetools\Api\Models\Product; use Commercetools\Base\Builder; -use Commercetools\Base\DateTimeImmutableCollection; -use Commercetools\Base\JsonObject; -use Commercetools\Base\JsonObjectModel; -use Commercetools\Base\MapperFactory; +use Commercetools\Base\MapperMap; use stdClass; /** * @implements Builder + * @extends MapperMap */ -final class ProductVariantChannelAvailabilityMapBuilder implements Builder +final class ProductVariantChannelAvailabilityMapBuilder extends MapperMap implements Builder { - public function build(): ProductVariantChannelAvailabilityMap + /** + * @psalm-return callable(string):?ProductVariantChannelAvailabilityMap + */ + protected function mapper() { - return new ProductVariantChannelAvailabilityMapModel( - ); + return + /** + * @psalm-return ?ProductVariantChannelAvailabilityMap + */ + function (string $key) { + $data = $this->get($key); + if ($data instanceof stdClass) { + $data = ProductVariantChannelAvailabilityMapModel::of($data); + } + return $data; + }; } - public static function of(): ProductVariantChannelAvailabilityMapBuilder + /** + * @return ProductVariantChannelAvailabilityMap + */ + public function build() { - return new self(); + return new ProductVariantChannelAvailabilityMapModel($this->toArray()); } } diff --git a/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityMapModel.php b/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityMapModel.php index 2ec8befe37d..7aa1b6b506b 100644 --- a/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityMapModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityMapModel.php @@ -8,42 +8,24 @@ namespace Commercetools\Api\Models\Product; -use Commercetools\Base\DateTimeImmutableCollection; -use Commercetools\Base\JsonObject; -use Commercetools\Base\JsonObjectModel; -use Commercetools\Base\MapperFactory; -use stdClass; +use Commercetools\Base\MapperMap; /** * @internal */ -final class ProductVariantChannelAvailabilityMapModel extends JsonObjectModel implements ProductVariantChannelAvailabilityMap +final class ProductVariantChannelAvailabilityMapModel extends MapperMap implements ProductVariantChannelAvailabilityMap { /** - * @psalm-suppress MissingParamType + * @psalm-return callable(string):?mixed */ - public function __construct( - ) { - } - - - - - /** - * @return mixed - */ - public function by(string $key) + protected function mapper() { - $data = $this->raw($key); - if (is_null($data)) { - return null; - } - if (preg_match(ProductVariantChannelAvailabilityMap::FIELD_PATTERN0, $key) === 1) { - /** @psalm-var stdClass|array $data */ - - return ProductVariantChannelAvailabilityModel::of($data); - } - - return $data; + return + /** + * @psalm-return ?mixed + */ + function (string $key) { + return $this->get($key); + }; } } diff --git a/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityModel.php b/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityModel.php index b409d47b7f0..357bd412a9a 100644 --- a/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductVariantChannelAvailabilityModel.php @@ -20,20 +20,35 @@ final class ProductVariantChannelAvailabilityModel extends JsonObjectModel implements ProductVariantChannelAvailability { /** + * * @var ?bool */ protected $isOnStock; /** + * * @var ?int */ protected $restockableInDays; /** + * * @var ?int */ protected $availableQuantity; + /** + * + * @var ?string + */ + protected $id; + + /** + * + * @var ?int + */ + protected $version; + /** * @psalm-suppress MissingParamType @@ -41,14 +56,21 @@ final class ProductVariantChannelAvailabilityModel extends JsonObjectModel imple public function __construct( ?bool $isOnStock = null, ?int $restockableInDays = null, - ?int $availableQuantity = null + ?int $availableQuantity = null, + ?string $id = null, + ?int $version = null ) { $this->isOnStock = $isOnStock; $this->restockableInDays = $restockableInDays; $this->availableQuantity = $availableQuantity; + $this->id = $id; + $this->version = $version; } /** + *

    Indicates whether a Product Variant is in stock in a specified Channel.

    + * + * * @return null|bool */ public function getIsOnStock() @@ -66,6 +88,9 @@ public function getIsOnStock() } /** + *

    Number of days to restock a Product Variant once it is out of stock in a specified Channel.

    + * + * * @return null|int */ public function getRestockableInDays() @@ -83,6 +108,9 @@ public function getRestockableInDays() } /** + *

    Number of items of this Product Variant that are in stock in a specified Channel.

    + * + * * @return null|int */ public function getAvailableQuantity() @@ -99,6 +127,46 @@ public function getAvailableQuantity() return $this->availableQuantity; } + /** + *

    Unique identifier of the InventoryEntry.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    Current version of the InventoryEntry.

    + * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + /** * @param ?bool $isOnStock @@ -123,4 +191,20 @@ public function setAvailableQuantity(?int $availableQuantity): void { $this->availableQuantity = $availableQuantity; } + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } } diff --git a/lib/commercetools-api/src/Models/Product/ProductVariantDraft.php b/lib/commercetools-api/src/Models/Product/ProductVariantDraft.php index 94c918307e1..ac22cc18f2f 100644 --- a/lib/commercetools-api/src/Models/Product/ProductVariantDraft.php +++ b/lib/commercetools-api/src/Models/Product/ProductVariantDraft.php @@ -24,34 +24,50 @@ interface ProductVariantDraft extends JsonObject public const FIELD_ASSETS = 'assets'; /** + *

    User-defined unique SKU of the Product Variant.

    + * + * @return null|string */ public function getSku(); /** - *

    User-defined unique identifier for the ProductVariant. - * ProductVariant keys are different from Product keys.

    + *

    User-defined unique identifier for the ProductVariant.

    * + * @return null|string */ public function getKey(); /** + *

    The Embedded Prices for the Product Variant. + * Each Price must have its unique Price scope (with same currency, country, Customer Group, Channel, validFrom and validUntil).

    + * + * @return null|PriceDraftCollection */ public function getPrices(); /** + *

    Attributes according to the respective AttributeDefinition.

    + * + * @return null|AttributeCollection */ public function getAttributes(); /** + *

    Images for the Product Variant.

    + * + * @return null|ImageCollection */ public function getImages(); /** + *

    Media assets for the Product Variant.

    + * + * @return null|AssetDraftCollection */ public function getAssets(); diff --git a/lib/commercetools-api/src/Models/Product/ProductVariantDraftBuilder.php b/lib/commercetools-api/src/Models/Product/ProductVariantDraftBuilder.php index 04efa1a770f..125eee2ae9f 100644 --- a/lib/commercetools-api/src/Models/Product/ProductVariantDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductVariantDraftBuilder.php @@ -24,36 +24,45 @@ final class ProductVariantDraftBuilder implements Builder { /** + * @var ?string */ private $sku; /** + * @var ?string */ private $key; /** + * @var ?PriceDraftCollection */ private $prices; /** + * @var ?AttributeCollection */ private $attributes; /** + * @var ?ImageCollection */ private $images; /** + * @var ?AssetDraftCollection */ private $assets; /** + *

    User-defined unique SKU of the Product Variant.

    + * + * @return null|string */ public function getSku() @@ -62,9 +71,9 @@ public function getSku() } /** - *

    User-defined unique identifier for the ProductVariant. - * ProductVariant keys are different from Product keys.

    + *

    User-defined unique identifier for the ProductVariant.

    * + * @return null|string */ public function getKey() @@ -73,6 +82,10 @@ public function getKey() } /** + *

    The Embedded Prices for the Product Variant. + * Each Price must have its unique Price scope (with same currency, country, Customer Group, Channel, validFrom and validUntil).

    + * + * @return null|PriceDraftCollection */ public function getPrices() @@ -81,6 +94,9 @@ public function getPrices() } /** + *

    Attributes according to the respective AttributeDefinition.

    + * + * @return null|AttributeCollection */ public function getAttributes() @@ -89,6 +105,9 @@ public function getAttributes() } /** + *

    Images for the Product Variant.

    + * + * @return null|ImageCollection */ public function getImages() @@ -97,6 +116,9 @@ public function getImages() } /** + *

    Media assets for the Product Variant.

    + * + * @return null|AssetDraftCollection */ public function getAssets() diff --git a/lib/commercetools-api/src/Models/Product/ProductVariantDraftModel.php b/lib/commercetools-api/src/Models/Product/ProductVariantDraftModel.php index 5b73204502f..0b50fa3662e 100644 --- a/lib/commercetools-api/src/Models/Product/ProductVariantDraftModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductVariantDraftModel.php @@ -23,31 +23,37 @@ final class ProductVariantDraftModel extends JsonObjectModel implements ProductVariantDraft { /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $key; /** + * * @var ?PriceDraftCollection */ protected $prices; /** + * * @var ?AttributeCollection */ protected $attributes; /** + * * @var ?ImageCollection */ protected $images; /** + * * @var ?AssetDraftCollection */ protected $assets; @@ -73,6 +79,9 @@ public function __construct( } /** + *

    User-defined unique SKU of the Product Variant.

    + * + * * @return null|string */ public function getSku() @@ -90,8 +99,8 @@ public function getSku() } /** - *

    User-defined unique identifier for the ProductVariant. - * ProductVariant keys are different from Product keys.

    + *

    User-defined unique identifier for the ProductVariant.

    + * * * @return null|string */ @@ -110,6 +119,10 @@ public function getKey() } /** + *

    The Embedded Prices for the Product Variant. + * Each Price must have its unique Price scope (with same currency, country, Customer Group, Channel, validFrom and validUntil).

    + * + * * @return null|PriceDraftCollection */ public function getPrices() @@ -127,6 +140,9 @@ public function getPrices() } /** + *

    Attributes according to the respective AttributeDefinition.

    + * + * * @return null|AttributeCollection */ public function getAttributes() @@ -144,6 +160,9 @@ public function getAttributes() } /** + *

    Images for the Product Variant.

    + * + * * @return null|ImageCollection */ public function getImages() @@ -161,6 +180,9 @@ public function getImages() } /** + *

    Media assets for the Product Variant.

    + * + * * @return null|AssetDraftCollection */ public function getAssets() diff --git a/lib/commercetools-api/src/Models/Product/ProductVariantModel.php b/lib/commercetools-api/src/Models/Product/ProductVariantModel.php index 6805327093b..5731c7575fb 100644 --- a/lib/commercetools-api/src/Models/Product/ProductVariantModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductVariantModel.php @@ -27,61 +27,73 @@ final class ProductVariantModel extends JsonObjectModel implements ProductVariant { /** + * * @var ?int */ protected $id; /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $key; /** + * * @var ?PriceCollection */ protected $prices; /** + * * @var ?AttributeCollection */ protected $attributes; /** + * * @var ?Price */ protected $price; /** + * * @var ?ImageCollection */ protected $images; /** + * * @var ?AssetCollection */ protected $assets; /** + * * @var ?ProductVariantAvailability */ protected $availability; /** + * * @var ?bool */ protected $isMatchingVariant; /** + * * @var ?ScopedPrice */ protected $scopedPrice; /** + * * @var ?bool */ protected $scopedPriceDiscounted; @@ -119,7 +131,8 @@ public function __construct( } /** - *

    A unique, sequential identifier of the ProductVariant within the Product.

    + *

    A unique, sequential identifier of the Product Variant within the Product.

    + * * * @return null|int */ @@ -138,6 +151,9 @@ public function getId() } /** + *

    User-defined unique SKU of the Product Variant.

    + * + * * @return null|string */ public function getSku() @@ -155,8 +171,9 @@ public function getSku() } /** - *

    User-defined unique identifier of the ProductVariant. - * ProductVariant keys are different from Product keys.

    + *

    User-defined unique identifier of the ProductVariant.

    + *

    This is different from Product key.

    + * * * @return null|string */ @@ -175,6 +192,10 @@ public function getKey() } /** + *

    The Embedded Prices of the Product Variant. + * Cannot contain two Prices of the same Price scope (with same currency, country, Customer Group, Channel, validFrom and validUntil).

    + * + * * @return null|PriceCollection */ public function getPrices() @@ -192,6 +213,9 @@ public function getPrices() } /** + *

    Attributes of the Product Variant.

    + * + * * @return null|AttributeCollection */ public function getAttributes() @@ -209,6 +233,10 @@ public function getAttributes() } /** + *

    Only available when Price selection is used. + * Cannot be used in a Query Predicate.

    + * + * * @return null|Price */ public function getPrice() @@ -227,6 +255,9 @@ public function getPrice() } /** + *

    Images of the Product Variant.

    + * + * * @return null|ImageCollection */ public function getImages() @@ -244,6 +275,9 @@ public function getImages() } /** + *

    Media assets of the Product Variant.

    + * + * * @return null|AssetCollection */ public function getAssets() @@ -261,6 +295,11 @@ public function getAssets() } /** + *

    Set if the Product Variant is tracked by Inventory. + * Can be used as an optimization to reduce calls to the Inventory service. + * May not contain the latest Inventory State (it is eventually consistent).

    + * + * * @return null|ProductVariantAvailability */ public function getAvailability() @@ -279,6 +318,10 @@ public function getAvailability() } /** + *

    true if the Product Variant matches the search query. + * Only available in response to a Product Projection Search request.

    + * + * * @return null|bool */ public function getIsMatchingVariant() @@ -296,6 +339,11 @@ public function getIsMatchingVariant() } /** + *

    Only available in response to a Product Projection Search request + * with price selection. + * Can be used to sort, filter, and facet.

    + * + * * @return null|ScopedPrice */ public function getScopedPrice() @@ -314,6 +362,10 @@ public function getScopedPrice() } /** + *

    Only available in response to a Product Projection Search request + * with price selection.

    + * + * * @return null|bool */ public function getScopedPriceDiscounted() diff --git a/lib/commercetools-api/src/Models/Product/RangeFacetResult.php b/lib/commercetools-api/src/Models/Product/RangeFacetResult.php index c50e0f21821..f407844c0e0 100644 --- a/lib/commercetools-api/src/Models/Product/RangeFacetResult.php +++ b/lib/commercetools-api/src/Models/Product/RangeFacetResult.php @@ -16,6 +16,7 @@ interface RangeFacetResult extends FacetResult public const FIELD_RANGES = 'ranges'; /** + * @return null|FacetRangeCollection */ public function getRanges(); diff --git a/lib/commercetools-api/src/Models/Product/RangeFacetResultBuilder.php b/lib/commercetools-api/src/Models/Product/RangeFacetResultBuilder.php index 6016d17a7b1..af97b637a48 100644 --- a/lib/commercetools-api/src/Models/Product/RangeFacetResultBuilder.php +++ b/lib/commercetools-api/src/Models/Product/RangeFacetResultBuilder.php @@ -21,11 +21,13 @@ final class RangeFacetResultBuilder implements Builder { /** + * @var ?FacetRangeCollection */ private $ranges; /** + * @return null|FacetRangeCollection */ public function getRanges() diff --git a/lib/commercetools-api/src/Models/Product/RangeFacetResultModel.php b/lib/commercetools-api/src/Models/Product/RangeFacetResultModel.php index a4a84b0496d..e5aa7023fee 100644 --- a/lib/commercetools-api/src/Models/Product/RangeFacetResultModel.php +++ b/lib/commercetools-api/src/Models/Product/RangeFacetResultModel.php @@ -21,11 +21,13 @@ final class RangeFacetResultModel extends JsonObjectModel implements RangeFacetR { public const DISCRIMINATOR_VALUE = 'range'; /** + * * @var ?string */ protected $type; /** + * * @var ?FacetRangeCollection */ protected $ranges; @@ -35,13 +37,15 @@ final class RangeFacetResultModel extends JsonObjectModel implements RangeFacetR * @psalm-suppress MissingParamType */ public function __construct( - ?FacetRangeCollection $ranges = null + ?FacetRangeCollection $ranges = null, + ?string $type = null ) { $this->ranges = $ranges; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,6 +63,7 @@ public function getType() } /** + * * @return null|FacetRangeCollection */ public function getRanges() diff --git a/lib/commercetools-api/src/Models/Product/SearchKeyword.php b/lib/commercetools-api/src/Models/Product/SearchKeyword.php index 4d0027bf310..7dc409bca01 100644 --- a/lib/commercetools-api/src/Models/Product/SearchKeyword.php +++ b/lib/commercetools-api/src/Models/Product/SearchKeyword.php @@ -17,11 +17,17 @@ interface SearchKeyword extends JsonObject public const FIELD_SUGGEST_TOKENIZER = 'suggestTokenizer'; /** + *

    Text to return in the result of a suggest query.

    + * + * @return null|string */ public function getText(); /** + *

    If no tokenizer is defined, the text is used as a single token.

    + * + * @return null|SuggestTokenizer */ public function getSuggestTokenizer(); diff --git a/lib/commercetools-api/src/Models/Product/SearchKeywordBuilder.php b/lib/commercetools-api/src/Models/Product/SearchKeywordBuilder.php index fd5b05e9c20..38873dcbf2c 100644 --- a/lib/commercetools-api/src/Models/Product/SearchKeywordBuilder.php +++ b/lib/commercetools-api/src/Models/Product/SearchKeywordBuilder.php @@ -21,16 +21,21 @@ final class SearchKeywordBuilder implements Builder { /** + * @var ?string */ private $text; /** + * @var null|SuggestTokenizer|SuggestTokenizerBuilder */ private $suggestTokenizer; /** + *

    Text to return in the result of a suggest query.

    + * + * @return null|string */ public function getText() @@ -39,6 +44,9 @@ public function getText() } /** + *

    If no tokenizer is defined, the text is used as a single token.

    + * + * @return null|SuggestTokenizer */ public function getSuggestTokenizer() diff --git a/lib/commercetools-api/src/Models/Product/SearchKeywordModel.php b/lib/commercetools-api/src/Models/Product/SearchKeywordModel.php index a17acf024b0..45a5471c86d 100644 --- a/lib/commercetools-api/src/Models/Product/SearchKeywordModel.php +++ b/lib/commercetools-api/src/Models/Product/SearchKeywordModel.php @@ -20,11 +20,13 @@ final class SearchKeywordModel extends JsonObjectModel implements SearchKeyword { /** + * * @var ?string */ protected $text; /** + * * @var ?SuggestTokenizer */ protected $suggestTokenizer; @@ -42,6 +44,9 @@ public function __construct( } /** + *

    Text to return in the result of a suggest query.

    + * + * * @return null|string */ public function getText() @@ -59,6 +64,9 @@ public function getText() } /** + *

    If no tokenizer is defined, the text is used as a single token.

    + * + * * @return null|SuggestTokenizer */ public function getSuggestTokenizer() @@ -69,8 +77,8 @@ public function getSuggestTokenizer() if (is_null($data)) { return null; } - $className = SuggestTokenizerModel::resolveDiscriminatorClass($data); - $this->suggestTokenizer = $className::of($data); + + $this->suggestTokenizer = SuggestTokenizerModel::of($data); } return $this->suggestTokenizer; diff --git a/lib/commercetools-api/src/Models/Product/SearchKeywords.php b/lib/commercetools-api/src/Models/Product/SearchKeywords.php index f0c6b57ab94..616fcb11534 100644 --- a/lib/commercetools-api/src/Models/Product/SearchKeywords.php +++ b/lib/commercetools-api/src/Models/Product/SearchKeywords.php @@ -8,10 +8,8 @@ namespace Commercetools\Api\Models\Product; -use Commercetools\Base\DateTimeImmutableCollection; -use Commercetools\Base\JsonObject; +use Commercetools\Base\CMap; -interface SearchKeywords extends JsonObject +interface SearchKeywords extends CMap { - public const FIELD_PATTERN0 = '/^[a-z]{2}(-[A-Z]{2})?$/'; } diff --git a/lib/commercetools-api/src/Models/Product/SearchKeywordsBuilder.php b/lib/commercetools-api/src/Models/Product/SearchKeywordsBuilder.php index fc5d4edc252..c18026e5a40 100644 --- a/lib/commercetools-api/src/Models/Product/SearchKeywordsBuilder.php +++ b/lib/commercetools-api/src/Models/Product/SearchKeywordsBuilder.php @@ -9,25 +9,38 @@ namespace Commercetools\Api\Models\Product; use Commercetools\Base\Builder; -use Commercetools\Base\DateTimeImmutableCollection; -use Commercetools\Base\JsonObject; -use Commercetools\Base\JsonObjectModel; -use Commercetools\Base\MapperFactory; +use Commercetools\Base\MapperMap; use stdClass; /** * @implements Builder + * @extends MapperMap */ -final class SearchKeywordsBuilder implements Builder +final class SearchKeywordsBuilder extends MapperMap implements Builder { - public function build(): SearchKeywords + /** + * @psalm-return callable(string):?SearchKeywords + */ + protected function mapper() { - return new SearchKeywordsModel( - ); + return + /** + * @psalm-return ?SearchKeywords + */ + function (string $key) { + $data = $this->get($key); + if ($data instanceof stdClass) { + $data = SearchKeywordsModel::of($data); + } + return $data; + }; } - public static function of(): SearchKeywordsBuilder + /** + * @return SearchKeywords + */ + public function build() { - return new self(); + return new SearchKeywordsModel($this->toArray()); } } diff --git a/lib/commercetools-api/src/Models/Product/SearchKeywordsModel.php b/lib/commercetools-api/src/Models/Product/SearchKeywordsModel.php index 46c50e253e9..995ab8042a2 100644 --- a/lib/commercetools-api/src/Models/Product/SearchKeywordsModel.php +++ b/lib/commercetools-api/src/Models/Product/SearchKeywordsModel.php @@ -8,41 +8,24 @@ namespace Commercetools\Api\Models\Product; -use Commercetools\Base\DateTimeImmutableCollection; -use Commercetools\Base\JsonObject; -use Commercetools\Base\JsonObjectModel; -use Commercetools\Base\MapperFactory; -use stdClass; +use Commercetools\Base\MapperMap; /** * @internal */ -final class SearchKeywordsModel extends JsonObjectModel implements SearchKeywords +final class SearchKeywordsModel extends MapperMap implements SearchKeywords { /** - * @psalm-suppress MissingParamType + * @psalm-return callable(string):?mixed */ - public function __construct( - ) { - } - - - - - /** - * @return mixed - */ - public function by(string $key) + protected function mapper() { - $data = $this->raw($key); - if (is_null($data)) { - return null; - } - if (preg_match(SearchKeywords::FIELD_PATTERN0, $key) === 1) { - /** @psalm-var list $data */ - return new SearchKeywordCollection($data); - } - - return $data; + return + /** + * @psalm-return ?mixed + */ + function (string $key) { + return $this->get($key); + }; } } diff --git a/lib/commercetools-api/src/Models/Product/SuggestTokenizer.php b/lib/commercetools-api/src/Models/Product/SuggestTokenizer.php index 4753a3e42fc..a6242f83071 100644 --- a/lib/commercetools-api/src/Models/Product/SuggestTokenizer.php +++ b/lib/commercetools-api/src/Models/Product/SuggestTokenizer.php @@ -17,6 +17,7 @@ interface SuggestTokenizer extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/Product/SuggestTokenizerModel.php b/lib/commercetools-api/src/Models/Product/SuggestTokenizerModel.php index ebcbe5ea8aa..229d480b036 100644 --- a/lib/commercetools-api/src/Models/Product/SuggestTokenizerModel.php +++ b/lib/commercetools-api/src/Models/Product/SuggestTokenizerModel.php @@ -21,6 +21,7 @@ final class SuggestTokenizerModel extends JsonObjectModel implements SuggestToke { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -38,11 +39,13 @@ final class SuggestTokenizerModel extends JsonObjectModel implements SuggestToke * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Product/Suggestion.php b/lib/commercetools-api/src/Models/Product/Suggestion.php index 06c32d85e86..3af4c2c5b51 100644 --- a/lib/commercetools-api/src/Models/Product/Suggestion.php +++ b/lib/commercetools-api/src/Models/Product/Suggestion.php @@ -18,6 +18,7 @@ interface Suggestion extends JsonObject /** *

    The suggested text.

    * + * @return null|string */ public function getText(); diff --git a/lib/commercetools-api/src/Models/Product/SuggestionBuilder.php b/lib/commercetools-api/src/Models/Product/SuggestionBuilder.php index ac2ec33eccd..cbcbfcefeeb 100644 --- a/lib/commercetools-api/src/Models/Product/SuggestionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/SuggestionBuilder.php @@ -21,6 +21,7 @@ final class SuggestionBuilder implements Builder { /** + * @var ?string */ private $text; @@ -28,6 +29,7 @@ final class SuggestionBuilder implements Builder /** *

    The suggested text.

    * + * @return null|string */ public function getText() diff --git a/lib/commercetools-api/src/Models/Product/SuggestionModel.php b/lib/commercetools-api/src/Models/Product/SuggestionModel.php index ecfa2ca3466..2cfe8518b46 100644 --- a/lib/commercetools-api/src/Models/Product/SuggestionModel.php +++ b/lib/commercetools-api/src/Models/Product/SuggestionModel.php @@ -20,6 +20,7 @@ final class SuggestionModel extends JsonObjectModel implements Suggestion { /** + * * @var ?string */ protected $text; @@ -37,6 +38,7 @@ public function __construct( /** *

    The suggested text.

    * + * * @return null|string */ public function getText() diff --git a/lib/commercetools-api/src/Models/Product/TermFacetResult.php b/lib/commercetools-api/src/Models/Product/TermFacetResult.php index 53d3917cc29..519f20f77cb 100644 --- a/lib/commercetools-api/src/Models/Product/TermFacetResult.php +++ b/lib/commercetools-api/src/Models/Product/TermFacetResult.php @@ -20,26 +20,31 @@ interface TermFacetResult extends FacetResult public const FIELD_TERMS = 'terms'; /** + * @return null|string */ public function getDataType(); /** + * @return null|int */ public function getMissing(); /** + * @return null|int */ public function getTotal(); /** + * @return null|int */ public function getOther(); /** + * @return null|FacetTermCollection */ public function getTerms(); diff --git a/lib/commercetools-api/src/Models/Product/TermFacetResultBuilder.php b/lib/commercetools-api/src/Models/Product/TermFacetResultBuilder.php index 8b19ab7fd66..da9e35ed0f2 100644 --- a/lib/commercetools-api/src/Models/Product/TermFacetResultBuilder.php +++ b/lib/commercetools-api/src/Models/Product/TermFacetResultBuilder.php @@ -21,31 +21,37 @@ final class TermFacetResultBuilder implements Builder { /** + * @var ?string */ private $dataType; /** + * @var ?int */ private $missing; /** + * @var ?int */ private $total; /** + * @var ?int */ private $other; /** + * @var ?FacetTermCollection */ private $terms; /** + * @return null|string */ public function getDataType() @@ -54,6 +60,7 @@ public function getDataType() } /** + * @return null|int */ public function getMissing() @@ -62,6 +69,7 @@ public function getMissing() } /** + * @return null|int */ public function getTotal() @@ -70,6 +78,7 @@ public function getTotal() } /** + * @return null|int */ public function getOther() @@ -78,6 +87,7 @@ public function getOther() } /** + * @return null|FacetTermCollection */ public function getTerms() diff --git a/lib/commercetools-api/src/Models/Product/TermFacetResultModel.php b/lib/commercetools-api/src/Models/Product/TermFacetResultModel.php index c85984c7460..b6513162320 100644 --- a/lib/commercetools-api/src/Models/Product/TermFacetResultModel.php +++ b/lib/commercetools-api/src/Models/Product/TermFacetResultModel.php @@ -21,31 +21,37 @@ final class TermFacetResultModel extends JsonObjectModel implements TermFacetRes { public const DISCRIMINATOR_VALUE = 'terms'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $dataType; /** + * * @var ?int */ protected $missing; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $other; /** + * * @var ?FacetTermCollection */ protected $terms; @@ -59,17 +65,19 @@ public function __construct( ?int $missing = null, ?int $total = null, ?int $other = null, - ?FacetTermCollection $terms = null + ?FacetTermCollection $terms = null, + ?string $type = null ) { $this->dataType = $dataType; $this->missing = $missing; $this->total = $total; $this->other = $other; $this->terms = $terms; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -87,6 +95,7 @@ public function getType() } /** + * * @return null|string */ public function getDataType() @@ -104,6 +113,7 @@ public function getDataType() } /** + * * @return null|int */ public function getMissing() @@ -121,6 +131,7 @@ public function getMissing() } /** + * * @return null|int */ public function getTotal() @@ -138,6 +149,7 @@ public function getTotal() } /** + * * @return null|int */ public function getOther() @@ -155,6 +167,7 @@ public function getOther() } /** + * * @return null|FacetTermCollection */ public function getTerms() diff --git a/lib/commercetools-api/src/Models/Product/WhitespaceTokenizerModel.php b/lib/commercetools-api/src/Models/Product/WhitespaceTokenizerModel.php index 94e060321fe..a9db3bf09b4 100644 --- a/lib/commercetools-api/src/Models/Product/WhitespaceTokenizerModel.php +++ b/lib/commercetools-api/src/Models/Product/WhitespaceTokenizerModel.php @@ -21,6 +21,7 @@ final class WhitespaceTokenizerModel extends JsonObjectModel implements Whitespa { public const DISCRIMINATOR_VALUE = 'whitespace'; /** + * * @var ?string */ protected $type; @@ -30,11 +31,13 @@ final class WhitespaceTokenizerModel extends JsonObjectModel implements Whitespa * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscount.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscount.php index 955026467bc..be2982d1dc4 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscount.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscount.php @@ -35,6 +35,7 @@ interface ProductDiscount extends BaseResource /** *

    Unique identifier of the ProductDiscount.

    * + * @return null|string */ public function getId(); @@ -42,6 +43,7 @@ public function getId(); /** *

    Current version of the ProductDiscount.

    * + * @return null|int */ public function getVersion(); @@ -49,6 +51,7 @@ public function getVersion(); /** *

    Date and time (UTC) the ProductDiscount was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -56,6 +59,7 @@ public function getCreatedAt(); /** *

    Date and time (UTC) the ProductDiscount was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -63,6 +67,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -70,6 +75,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -77,6 +83,7 @@ public function getCreatedBy(); /** *

    Name of the ProductDiscount.

    * + * @return null|LocalizedString */ public function getName(); @@ -84,6 +91,7 @@ public function getName(); /** *

    User-defined unique identifier of the ProductDiscount.

    * + * @return null|string */ public function getKey(); @@ -91,6 +99,7 @@ public function getKey(); /** *

    Description of the ProductDiscount.

    * + * @return null|LocalizedString */ public function getDescription(); @@ -98,6 +107,7 @@ public function getDescription(); /** *

    Type of Discount and its corresponding value.

    * + * @return null|ProductDiscountValue */ public function getValue(); @@ -105,6 +115,7 @@ public function getValue(); /** *

    Valid ProductDiscount predicate.

    * + * @return null|string */ public function getPredicate(); @@ -113,6 +124,7 @@ public function getPredicate(); *

    Unique decimal value between 0 and 1 (stored as String literal) defining the order of Product Discounts to apply in case more than one is applicable and active. * A Product Discount with a higher value is prioritized.

    * + * @return null|string */ public function getSortOrder(); @@ -120,6 +132,7 @@ public function getSortOrder(); /** *

    If true the Product Discount is applied to Products matching the predicate.

    * + * @return null|bool */ public function getIsActive(); @@ -127,6 +140,7 @@ public function getIsActive(); /** *

    References of all the resources that are addressed in the predicate.

    * + * @return null|ReferenceCollection */ public function getReferences(); @@ -135,6 +149,7 @@ public function getReferences(); *

    Date and time (UTC) from which the Discount is effective. * Take Eventual Consistency into account for calculated discount values.

    * + * @return null|DateTimeImmutable */ public function getValidFrom(); @@ -143,6 +158,7 @@ public function getValidFrom(); *

    Date and time (UTC) until which the Discount is effective. * Take Eventual Consistency into account for calculated undiscounted values.

    * + * @return null|DateTimeImmutable */ public function getValidUntil(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountBuilder.php index fd143d2c01a..3a20333b412 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountBuilder.php @@ -31,81 +31,97 @@ final class ProductDiscountBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var null|ProductDiscountValue|ProductDiscountValueBuilder */ private $value; /** + * @var ?string */ private $predicate; /** + * @var ?string */ private $sortOrder; /** + * @var ?bool */ private $isActive; /** + * @var ?ReferenceCollection */ private $references; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; @@ -113,6 +129,7 @@ final class ProductDiscountBuilder implements Builder /** *

    Unique identifier of the ProductDiscount.

    * + * @return null|string */ public function getId() @@ -123,6 +140,7 @@ public function getId() /** *

    Current version of the ProductDiscount.

    * + * @return null|int */ public function getVersion() @@ -133,6 +151,7 @@ public function getVersion() /** *

    Date and time (UTC) the ProductDiscount was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -143,6 +162,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the ProductDiscount was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -153,6 +173,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -163,6 +184,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -173,6 +195,7 @@ public function getCreatedBy() /** *

    Name of the ProductDiscount.

    * + * @return null|LocalizedString */ public function getName() @@ -183,6 +206,7 @@ public function getName() /** *

    User-defined unique identifier of the ProductDiscount.

    * + * @return null|string */ public function getKey() @@ -193,6 +217,7 @@ public function getKey() /** *

    Description of the ProductDiscount.

    * + * @return null|LocalizedString */ public function getDescription() @@ -203,6 +228,7 @@ public function getDescription() /** *

    Type of Discount and its corresponding value.

    * + * @return null|ProductDiscountValue */ public function getValue() @@ -213,6 +239,7 @@ public function getValue() /** *

    Valid ProductDiscount predicate.

    * + * @return null|string */ public function getPredicate() @@ -224,6 +251,7 @@ public function getPredicate() *

    Unique decimal value between 0 and 1 (stored as String literal) defining the order of Product Discounts to apply in case more than one is applicable and active. * A Product Discount with a higher value is prioritized.

    * + * @return null|string */ public function getSortOrder() @@ -234,6 +262,7 @@ public function getSortOrder() /** *

    If true the Product Discount is applied to Products matching the predicate.

    * + * @return null|bool */ public function getIsActive() @@ -244,6 +273,7 @@ public function getIsActive() /** *

    References of all the resources that are addressed in the predicate.

    * + * @return null|ReferenceCollection */ public function getReferences() @@ -255,6 +285,7 @@ public function getReferences() *

    Date and time (UTC) from which the Discount is effective. * Take Eventual Consistency into account for calculated discount values.

    * + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -266,6 +297,7 @@ public function getValidFrom() *

    Date and time (UTC) until which the Discount is effective. * Take Eventual Consistency into account for calculated undiscounted values.

    * + * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeIsActiveAction.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeIsActiveAction.php index 1dafd811517..a3291725c59 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeIsActiveAction.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeIsActiveAction.php @@ -19,6 +19,7 @@ interface ProductDiscountChangeIsActiveAction extends ProductDiscountUpdateActio *

    New value to set. * If set to true, the Discount will be applied to Product Prices.

    * + * @return null|bool */ public function getIsActive(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeIsActiveActionBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeIsActiveActionBuilder.php index a93787feeae..3a32bfe57ee 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeIsActiveActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeIsActiveActionBuilder.php @@ -21,6 +21,7 @@ final class ProductDiscountChangeIsActiveActionBuilder implements Builder { /** + * @var ?bool */ private $isActive; @@ -29,6 +30,7 @@ final class ProductDiscountChangeIsActiveActionBuilder implements Builder *

    New value to set. * If set to true, the Discount will be applied to Product Prices.

    * + * @return null|bool */ public function getIsActive() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeIsActiveActionModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeIsActiveActionModel.php index a1f3f60db32..1d50f7da330 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeIsActiveActionModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeIsActiveActionModel.php @@ -21,11 +21,13 @@ final class ProductDiscountChangeIsActiveActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'changeIsActive'; /** + * * @var ?string */ protected $action; /** + * * @var ?bool */ protected $isActive; @@ -35,13 +37,15 @@ final class ProductDiscountChangeIsActiveActionModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?bool $isActive = null + ?bool $isActive = null, + ?string $action = null ) { $this->isActive = $isActive; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() *

    New value to set. * If set to true, the Discount will be applied to Product Prices.

    * + * * @return null|bool */ public function getIsActive() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeNameAction.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeNameAction.php index 89c51ef1e7b..8d79cb761a2 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeNameAction.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeNameAction.php @@ -19,6 +19,7 @@ interface ProductDiscountChangeNameAction extends ProductDiscountUpdateAction /** *

    New value to set. Must not be empty.

    * + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeNameActionBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeNameActionBuilder.php index f2a3600adca..c1023c6a788 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeNameActionBuilder.php @@ -23,6 +23,7 @@ final class ProductDiscountChangeNameActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; @@ -30,6 +31,7 @@ final class ProductDiscountChangeNameActionBuilder implements Builder /** *

    New value to set. Must not be empty.

    * + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeNameActionModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeNameActionModel.php index 1e8ad077082..963ac2f55ee 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeNameActionModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeNameActionModel.php @@ -23,11 +23,13 @@ final class ProductDiscountChangeNameActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'changeName'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $name; @@ -37,13 +39,15 @@ final class ProductDiscountChangeNameActionModel extends JsonObjectModel impleme * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    New value to set. Must not be empty.

    * + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangePredicateAction.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangePredicateAction.php index 0c70293033a..56da2be195f 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangePredicateAction.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangePredicateAction.php @@ -18,6 +18,7 @@ interface ProductDiscountChangePredicateAction extends ProductDiscountUpdateActi /** *

    New value to set. Must be a valid ProductDiscount predicate.

    * + * @return null|string */ public function getPredicate(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangePredicateActionBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangePredicateActionBuilder.php index 83473d11cc1..8432bf471fb 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangePredicateActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangePredicateActionBuilder.php @@ -21,6 +21,7 @@ final class ProductDiscountChangePredicateActionBuilder implements Builder { /** + * @var ?string */ private $predicate; @@ -28,6 +29,7 @@ final class ProductDiscountChangePredicateActionBuilder implements Builder /** *

    New value to set. Must be a valid ProductDiscount predicate.

    * + * @return null|string */ public function getPredicate() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangePredicateActionModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangePredicateActionModel.php index 527590fa8a6..3b133b5937e 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangePredicateActionModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangePredicateActionModel.php @@ -21,11 +21,13 @@ final class ProductDiscountChangePredicateActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'changePredicate'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $predicate; @@ -35,13 +37,15 @@ final class ProductDiscountChangePredicateActionModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?string $predicate = null + ?string $predicate = null, + ?string $action = null ) { $this->predicate = $predicate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    New value to set. Must be a valid ProductDiscount predicate.

    * + * * @return null|string */ public function getPredicate() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeSortOrderAction.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeSortOrderAction.php index 0b934fbd6ef..8bd3b464eb6 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeSortOrderAction.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeSortOrderAction.php @@ -21,6 +21,7 @@ interface ProductDiscountChangeSortOrderAction extends ProductDiscountUpdateActi * The string value must be a number between 0 and 1. * A Discount with a higher sortOrder is prioritized.

    * + * @return null|string */ public function getSortOrder(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeSortOrderActionBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeSortOrderActionBuilder.php index b1428de2934..35818c7dfbf 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeSortOrderActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeSortOrderActionBuilder.php @@ -21,6 +21,7 @@ final class ProductDiscountChangeSortOrderActionBuilder implements Builder { /** + * @var ?string */ private $sortOrder; @@ -31,6 +32,7 @@ final class ProductDiscountChangeSortOrderActionBuilder implements Builder * The string value must be a number between 0 and 1. * A Discount with a higher sortOrder is prioritized.

    * + * @return null|string */ public function getSortOrder() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeSortOrderActionModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeSortOrderActionModel.php index 54d9f2f006c..7a9b86a6daa 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeSortOrderActionModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeSortOrderActionModel.php @@ -21,11 +21,13 @@ final class ProductDiscountChangeSortOrderActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'changeSortOrder'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $sortOrder; @@ -35,13 +37,15 @@ final class ProductDiscountChangeSortOrderActionModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?string $sortOrder = null + ?string $sortOrder = null, + ?string $action = null ) { $this->sortOrder = $sortOrder; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -64,6 +68,7 @@ public function getAction() * The string value must be a number between 0 and 1. * A Discount with a higher sortOrder is prioritized.

    * + * * @return null|string */ public function getSortOrder() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeValueAction.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeValueAction.php index 88d91124d3c..15902436e65 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeValueAction.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeValueAction.php @@ -18,6 +18,7 @@ interface ProductDiscountChangeValueAction extends ProductDiscountUpdateAction /** *

    New value to set. Must not be empty.

    * + * @return null|ProductDiscountValueDraft */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeValueActionBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeValueActionBuilder.php index 5aff73a1cc5..8c798f0ea7b 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeValueActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeValueActionBuilder.php @@ -21,6 +21,7 @@ final class ProductDiscountChangeValueActionBuilder implements Builder { /** + * @var null|ProductDiscountValueDraft|ProductDiscountValueDraftBuilder */ private $value; @@ -28,6 +29,7 @@ final class ProductDiscountChangeValueActionBuilder implements Builder /** *

    New value to set. Must not be empty.

    * + * @return null|ProductDiscountValueDraft */ public function getValue() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeValueActionModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeValueActionModel.php index eccaa25c0ca..ee5381f3649 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeValueActionModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountChangeValueActionModel.php @@ -21,11 +21,13 @@ final class ProductDiscountChangeValueActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'changeValue'; /** + * * @var ?string */ protected $action; /** + * * @var ?ProductDiscountValueDraft */ protected $value; @@ -35,13 +37,15 @@ final class ProductDiscountChangeValueActionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?ProductDiscountValueDraft $value = null + ?ProductDiscountValueDraft $value = null, + ?string $action = null ) { $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    New value to set. Must not be empty.

    * + * * @return null|ProductDiscountValueDraft */ public function getValue() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountDraft.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountDraft.php index 2ca03281ed3..12271033795 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountDraft.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountDraft.php @@ -28,6 +28,7 @@ interface ProductDiscountDraft extends JsonObject /** *

    Name of the ProductDiscount.

    * + * @return null|LocalizedString */ public function getName(); @@ -35,6 +36,7 @@ public function getName(); /** *

    User-defined unique identifier for the ProductDiscount.

    * + * @return null|string */ public function getKey(); @@ -42,6 +44,7 @@ public function getKey(); /** *

    Description of the ProductDiscount.

    * + * @return null|LocalizedString */ public function getDescription(); @@ -49,6 +52,7 @@ public function getDescription(); /** *

    Type of Discount and its corresponding value.

    * + * @return null|ProductDiscountValueDraft */ public function getValue(); @@ -56,6 +60,7 @@ public function getValue(); /** *

    Valid ProductDiscount predicate.

    * + * @return null|string */ public function getPredicate(); @@ -64,6 +69,7 @@ public function getPredicate(); *

    Decimal value between 0 and 1 (passed as String literal) that defines the order of ProductDiscounts to apply in case more than one is applicable and active. A ProductDiscount with a higher sortOrder is prioritized. * The value must be unique among all ProductDiscounts in the Project.

    * + * @return null|string */ public function getSortOrder(); @@ -71,6 +77,7 @@ public function getSortOrder(); /** *

    Set to true to activate the ProductDiscount, set to false to deactivate it (even though the predicate matches).

    * + * @return null|bool */ public function getIsActive(); @@ -79,6 +86,7 @@ public function getIsActive(); *

    Date and time (UTC) from which the Discount is effective. * Take Eventual Consistency into account for calculated discount values.

    * + * @return null|DateTimeImmutable */ public function getValidFrom(); @@ -87,6 +95,7 @@ public function getValidFrom(); *

    Date and time (UTC) until which the Discount is effective. * Take Eventual Consistency into account for calculated undiscounted values.

    * + * @return null|DateTimeImmutable */ public function getValidUntil(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountDraftBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountDraftBuilder.php index 6edaa52e20a..c02485a7c0c 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountDraftBuilder.php @@ -24,46 +24,55 @@ final class ProductDiscountDraftBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var null|ProductDiscountValueDraft|ProductDiscountValueDraftBuilder */ private $value; /** + * @var ?string */ private $predicate; /** + * @var ?string */ private $sortOrder; /** + * @var ?bool */ private $isActive; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; @@ -71,6 +80,7 @@ final class ProductDiscountDraftBuilder implements Builder /** *

    Name of the ProductDiscount.

    * + * @return null|LocalizedString */ public function getName() @@ -81,6 +91,7 @@ public function getName() /** *

    User-defined unique identifier for the ProductDiscount.

    * + * @return null|string */ public function getKey() @@ -91,6 +102,7 @@ public function getKey() /** *

    Description of the ProductDiscount.

    * + * @return null|LocalizedString */ public function getDescription() @@ -101,6 +113,7 @@ public function getDescription() /** *

    Type of Discount and its corresponding value.

    * + * @return null|ProductDiscountValueDraft */ public function getValue() @@ -111,6 +124,7 @@ public function getValue() /** *

    Valid ProductDiscount predicate.

    * + * @return null|string */ public function getPredicate() @@ -122,6 +136,7 @@ public function getPredicate() *

    Decimal value between 0 and 1 (passed as String literal) that defines the order of ProductDiscounts to apply in case more than one is applicable and active. A ProductDiscount with a higher sortOrder is prioritized. * The value must be unique among all ProductDiscounts in the Project.

    * + * @return null|string */ public function getSortOrder() @@ -132,6 +147,7 @@ public function getSortOrder() /** *

    Set to true to activate the ProductDiscount, set to false to deactivate it (even though the predicate matches).

    * + * @return null|bool */ public function getIsActive() @@ -143,6 +159,7 @@ public function getIsActive() *

    Date and time (UTC) from which the Discount is effective. * Take Eventual Consistency into account for calculated discount values.

    * + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -154,6 +171,7 @@ public function getValidFrom() *

    Date and time (UTC) until which the Discount is effective. * Take Eventual Consistency into account for calculated undiscounted values.

    * + * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountDraftModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountDraftModel.php index 544289151b0..b2fe7d9c854 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountDraftModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountDraftModel.php @@ -23,46 +23,55 @@ final class ProductDiscountDraftModel extends JsonObjectModel implements ProductDiscountDraft { /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?ProductDiscountValueDraft */ protected $value; /** + * * @var ?string */ protected $predicate; /** + * * @var ?string */ protected $sortOrder; /** + * * @var ?bool */ protected $isActive; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; @@ -96,6 +105,7 @@ public function __construct( /** *

    Name of the ProductDiscount.

    * + * * @return null|LocalizedString */ public function getName() @@ -116,6 +126,7 @@ public function getName() /** *

    User-defined unique identifier for the ProductDiscount.

    * + * * @return null|string */ public function getKey() @@ -135,6 +146,7 @@ public function getKey() /** *

    Description of the ProductDiscount.

    * + * * @return null|LocalizedString */ public function getDescription() @@ -155,6 +167,7 @@ public function getDescription() /** *

    Type of Discount and its corresponding value.

    * + * * @return null|ProductDiscountValueDraft */ public function getValue() @@ -175,6 +188,7 @@ public function getValue() /** *

    Valid ProductDiscount predicate.

    * + * * @return null|string */ public function getPredicate() @@ -195,6 +209,7 @@ public function getPredicate() *

    Decimal value between 0 and 1 (passed as String literal) that defines the order of ProductDiscounts to apply in case more than one is applicable and active. A ProductDiscount with a higher sortOrder is prioritized. * The value must be unique among all ProductDiscounts in the Project.

    * + * * @return null|string */ public function getSortOrder() @@ -214,6 +229,7 @@ public function getSortOrder() /** *

    Set to true to activate the ProductDiscount, set to false to deactivate it (even though the predicate matches).

    * + * * @return null|bool */ public function getIsActive() @@ -234,6 +250,7 @@ public function getIsActive() *

    Date and time (UTC) from which the Discount is effective. * Take Eventual Consistency into account for calculated discount values.

    * + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -258,6 +275,7 @@ public function getValidFrom() *

    Date and time (UTC) until which the Discount is effective. * Take Eventual Consistency into account for calculated undiscounted values.

    * + * * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountMatchQuery.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountMatchQuery.php index beb72403f6f..27efaef762f 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountMatchQuery.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountMatchQuery.php @@ -22,6 +22,7 @@ interface ProductDiscountMatchQuery extends JsonObject /** *

    ID of the specified Product.

    * + * @return null|string */ public function getProductId(); @@ -29,6 +30,7 @@ public function getProductId(); /** *

    ID of the specified Product Variant.

    * + * @return null|int */ public function getVariantId(); @@ -37,6 +39,7 @@ public function getVariantId(); *

    Controls which projected representation is applied for the query. * Set to true for the staged Product Projection of the specified Product Variant, set to false for the current one.

    * + * @return null|bool */ public function getStaged(); @@ -44,6 +47,7 @@ public function getStaged(); /** *

    Specified Price of the specified Product Variant.

    * + * @return null|QueryPrice */ public function getPrice(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountMatchQueryBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountMatchQueryBuilder.php index 6b473ecda5b..4c38cd6b952 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountMatchQueryBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountMatchQueryBuilder.php @@ -23,21 +23,25 @@ final class ProductDiscountMatchQueryBuilder implements Builder { /** + * @var ?string */ private $productId; /** + * @var ?int */ private $variantId; /** + * @var ?bool */ private $staged; /** + * @var null|QueryPrice|QueryPriceBuilder */ private $price; @@ -45,6 +49,7 @@ final class ProductDiscountMatchQueryBuilder implements Builder /** *

    ID of the specified Product.

    * + * @return null|string */ public function getProductId() @@ -55,6 +60,7 @@ public function getProductId() /** *

    ID of the specified Product Variant.

    * + * @return null|int */ public function getVariantId() @@ -66,6 +72,7 @@ public function getVariantId() *

    Controls which projected representation is applied for the query. * Set to true for the staged Product Projection of the specified Product Variant, set to false for the current one.

    * + * @return null|bool */ public function getStaged() @@ -76,6 +83,7 @@ public function getStaged() /** *

    Specified Price of the specified Product Variant.

    * + * @return null|QueryPrice */ public function getPrice() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountMatchQueryModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountMatchQueryModel.php index 36548a45e41..dbbcb080202 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountMatchQueryModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountMatchQueryModel.php @@ -22,21 +22,25 @@ final class ProductDiscountMatchQueryModel extends JsonObjectModel implements ProductDiscountMatchQuery { /** + * * @var ?string */ protected $productId; /** + * * @var ?int */ protected $variantId; /** + * * @var ?bool */ protected $staged; /** + * * @var ?QueryPrice */ protected $price; @@ -60,6 +64,7 @@ public function __construct( /** *

    ID of the specified Product.

    * + * * @return null|string */ public function getProductId() @@ -79,6 +84,7 @@ public function getProductId() /** *

    ID of the specified Product Variant.

    * + * * @return null|int */ public function getVariantId() @@ -99,6 +105,7 @@ public function getVariantId() *

    Controls which projected representation is applied for the query. * Set to true for the staged Product Projection of the specified Product Variant, set to false for the current one.

    * + * * @return null|bool */ public function getStaged() @@ -118,6 +125,7 @@ public function getStaged() /** *

    Specified Price of the specified Product Variant.

    * + * * @return null|QueryPrice */ public function getPrice() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountModel.php index 90b01a6f8a9..7c5cdf5b61b 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountModel.php @@ -30,81 +30,97 @@ final class ProductDiscountModel extends JsonObjectModel implements ProductDiscount { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?ProductDiscountValue */ protected $value; /** + * * @var ?string */ protected $predicate; /** + * * @var ?string */ protected $sortOrder; /** + * * @var ?bool */ protected $isActive; /** + * * @var ?ReferenceCollection */ protected $references; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; @@ -152,6 +168,7 @@ public function __construct( /** *

    Unique identifier of the ProductDiscount.

    * + * * @return null|string */ public function getId() @@ -171,6 +188,7 @@ public function getId() /** *

    Current version of the ProductDiscount.

    * + * * @return null|int */ public function getVersion() @@ -190,6 +208,7 @@ public function getVersion() /** *

    Date and time (UTC) the ProductDiscount was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -213,6 +232,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the ProductDiscount was last updated.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -236,6 +256,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -256,6 +277,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -276,6 +298,7 @@ public function getCreatedBy() /** *

    Name of the ProductDiscount.

    * + * * @return null|LocalizedString */ public function getName() @@ -296,6 +319,7 @@ public function getName() /** *

    User-defined unique identifier of the ProductDiscount.

    * + * * @return null|string */ public function getKey() @@ -315,6 +339,7 @@ public function getKey() /** *

    Description of the ProductDiscount.

    * + * * @return null|LocalizedString */ public function getDescription() @@ -335,6 +360,7 @@ public function getDescription() /** *

    Type of Discount and its corresponding value.

    * + * * @return null|ProductDiscountValue */ public function getValue() @@ -355,6 +381,7 @@ public function getValue() /** *

    Valid ProductDiscount predicate.

    * + * * @return null|string */ public function getPredicate() @@ -375,6 +402,7 @@ public function getPredicate() *

    Unique decimal value between 0 and 1 (stored as String literal) defining the order of Product Discounts to apply in case more than one is applicable and active. * A Product Discount with a higher value is prioritized.

    * + * * @return null|string */ public function getSortOrder() @@ -394,6 +422,7 @@ public function getSortOrder() /** *

    If true the Product Discount is applied to Products matching the predicate.

    * + * * @return null|bool */ public function getIsActive() @@ -413,6 +442,7 @@ public function getIsActive() /** *

    References of all the resources that are addressed in the predicate.

    * + * * @return null|ReferenceCollection */ public function getReferences() @@ -433,6 +463,7 @@ public function getReferences() *

    Date and time (UTC) from which the Discount is effective. * Take Eventual Consistency into account for calculated discount values.

    * + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -457,6 +488,7 @@ public function getValidFrom() *

    Date and time (UTC) until which the Discount is effective. * Take Eventual Consistency into account for calculated undiscounted values.

    * + * * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountPagedQueryResponse.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountPagedQueryResponse.php index 368ba776981..1a61b61444e 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountPagedQueryResponse.php @@ -22,6 +22,7 @@ interface ProductDiscountPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    ProductDiscounts matching the query.

    * + * @return null|ProductDiscountCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountPagedQueryResponseBuilder.php index e1c4e50445a..924a196f81e 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class ProductDiscountPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?ProductDiscountCollection */ private $results; @@ -48,6 +53,7 @@ final class ProductDiscountPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    ProductDiscounts matching the query.

    * + * @return null|ProductDiscountCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountPagedQueryResponseModel.php index 9435dc362c2..3feb7271093 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class ProductDiscountPagedQueryResponseModel extends JsonObjectModel implements ProductDiscountPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?ProductDiscountCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    ProductDiscounts matching the query.

    * + * * @return null|ProductDiscountCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountReference.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountReference.php index 1eac0b71239..3fb598622be 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountReference.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountReference.php @@ -19,6 +19,7 @@ interface ProductDiscountReference extends Reference /** *

    Contains the representation of the expanded ProductDiscount. Only present in responses to requests with Reference Expansion for ProductDiscounts.

    * + * @return null|ProductDiscount */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

    Unique identifier of the referenced ProductDiscount.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountReferenceBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountReferenceBuilder.php index b822299c75e..d097b5cae45 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountReferenceBuilder.php @@ -23,11 +23,13 @@ final class ProductDiscountReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|ProductDiscount|ProductDiscountBuilder */ private $obj; @@ -35,6 +37,7 @@ final class ProductDiscountReferenceBuilder implements Builder /** *

    Unique identifier of the referenced ProductDiscount.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded ProductDiscount. Only present in responses to requests with Reference Expansion for ProductDiscounts.

    * + * @return null|ProductDiscount */ public function getObj() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountReferenceModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountReferenceModel.php index a817662909c..ecc2a1c82b6 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountReferenceModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountReferenceModel.php @@ -23,16 +23,19 @@ final class ProductDiscountReferenceModel extends JsonObjectModel implements Pro { public const DISCRIMINATOR_VALUE = 'product-discount'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?ProductDiscount */ protected $obj; @@ -43,16 +46,18 @@ final class ProductDiscountReferenceModel extends JsonObjectModel implements Pro */ public function __construct( ?string $id = null, - ?ProductDiscount $obj = null + ?ProductDiscount $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced ProductDiscount.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded ProductDiscount. Only present in responses to requests with Reference Expansion for ProductDiscounts.

    * + * * @return null|ProductDiscount */ public function getObj() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountResourceIdentifier.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountResourceIdentifier.php index b6f040eae27..e5913857eb5 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountResourceIdentifier.php @@ -17,6 +17,7 @@ interface ProductDiscountResourceIdentifier extends ResourceIdentifier /** *

    Unique identifier of the referenced ProductDiscount. Either id or key is required.

    * + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

    User-defined unique identifier of the referenced ProductDiscount. Either id or key is required.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountResourceIdentifierBuilder.php index 0f6e96b7156..c955d20ad46 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class ProductDiscountResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class ProductDiscountResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced ProductDiscount. Either id or key is required.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced ProductDiscount. Either id or key is required.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountResourceIdentifierModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountResourceIdentifierModel.php index 6e4790ad043..9545c744370 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class ProductDiscountResourceIdentifierModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'product-discount'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class ProductDiscountResourceIdentifierModel extends JsonObjectModel imple */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced ProductDiscount. Either id or key is required.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced ProductDiscount. Either id or key is required.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetDescriptionAction.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetDescriptionAction.php index a6709b2395b..16a9e770bb4 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetDescriptionAction.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetDescriptionAction.php @@ -19,6 +19,7 @@ interface ProductDiscountSetDescriptionAction extends ProductDiscountUpdateActio /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getDescription(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetDescriptionActionBuilder.php index e74f827b766..64ea7c33e2d 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetDescriptionActionBuilder.php @@ -23,6 +23,7 @@ final class ProductDiscountSetDescriptionActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; @@ -30,6 +31,7 @@ final class ProductDiscountSetDescriptionActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetDescriptionActionModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetDescriptionActionModel.php index c9ed9cd7828..ae4b59e5db2 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetDescriptionActionModel.php @@ -23,11 +23,13 @@ final class ProductDiscountSetDescriptionActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'setDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $description; @@ -37,13 +39,15 @@ final class ProductDiscountSetDescriptionActionModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $description = null + ?LocalizedString $description = null, + ?string $action = null ) { $this->description = $description; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetKeyAction.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetKeyAction.php index 32afaeecac6..ec30036d57d 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetKeyAction.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetKeyAction.php @@ -18,6 +18,7 @@ interface ProductDiscountSetKeyAction extends ProductDiscountUpdateAction /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetKeyActionBuilder.php index 13fc613aef2..e83d94067e9 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetKeyActionBuilder.php @@ -21,6 +21,7 @@ final class ProductDiscountSetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; @@ -28,6 +29,7 @@ final class ProductDiscountSetKeyActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetKeyActionModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetKeyActionModel.php index c2789cbd217..35ce6303e75 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetKeyActionModel.php @@ -21,11 +21,13 @@ final class ProductDiscountSetKeyActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class ProductDiscountSetKeyActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromAction.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromAction.php index e36ddf8cfff..f39aee4bcb0 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromAction.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromAction.php @@ -21,6 +21,7 @@ interface ProductDiscountSetValidFromAction extends ProductDiscountUpdateAction * If empty, any existing value will be removed. * Take Eventual Consistency into account for calculated discount values.

    * + * @return null|DateTimeImmutable */ public function getValidFrom(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromActionBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromActionBuilder.php index 0cbf3ca0843..22e0a6daed3 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromActionBuilder.php @@ -22,6 +22,7 @@ final class ProductDiscountSetValidFromActionBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $validFrom; @@ -31,6 +32,7 @@ final class ProductDiscountSetValidFromActionBuilder implements Builder * If empty, any existing value will be removed. * Take Eventual Consistency into account for calculated discount values.

    * + * @return null|DateTimeImmutable */ public function getValidFrom() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromActionModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromActionModel.php index 787475fcfa7..3acbcbb8426 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromActionModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromActionModel.php @@ -22,11 +22,13 @@ final class ProductDiscountSetValidFromActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setValidFrom'; /** + * * @var ?string */ protected $action; /** + * * @var ?DateTimeImmutable */ protected $validFrom; @@ -36,13 +38,15 @@ final class ProductDiscountSetValidFromActionModel extends JsonObjectModel imple * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutable $validFrom = null + ?DateTimeImmutable $validFrom = null, + ?string $action = null ) { $this->validFrom = $validFrom; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -64,6 +68,7 @@ public function getAction() * If empty, any existing value will be removed. * Take Eventual Consistency into account for calculated discount values.

    * + * * @return null|DateTimeImmutable */ public function getValidFrom() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromAndUntilAction.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromAndUntilAction.php index 509c9c64213..d58dcc6c775 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromAndUntilAction.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromAndUntilAction.php @@ -21,6 +21,7 @@ interface ProductDiscountSetValidFromAndUntilAction extends ProductDiscountUpdat *

    Value to set. * Take Eventual Consistency into account for calculated undiscounted values.

    * + * @return null|DateTimeImmutable */ public function getValidFrom(); @@ -29,6 +30,7 @@ public function getValidFrom(); *

    Value to set. * Take Eventual Consistency into account for calculated undiscounted values.

    * + * @return null|DateTimeImmutable */ public function getValidUntil(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromAndUntilActionBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromAndUntilActionBuilder.php index 2f314025781..317f4747c96 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromAndUntilActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromAndUntilActionBuilder.php @@ -22,11 +22,13 @@ final class ProductDiscountSetValidFromAndUntilActionBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; @@ -35,6 +37,7 @@ final class ProductDiscountSetValidFromAndUntilActionBuilder implements Builder *

    Value to set. * Take Eventual Consistency into account for calculated undiscounted values.

    * + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -46,6 +49,7 @@ public function getValidFrom() *

    Value to set. * Take Eventual Consistency into account for calculated undiscounted values.

    * + * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromAndUntilActionModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromAndUntilActionModel.php index 86b24195e53..0692191f2b1 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromAndUntilActionModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidFromAndUntilActionModel.php @@ -22,16 +22,19 @@ final class ProductDiscountSetValidFromAndUntilActionModel extends JsonObjectMod { public const DISCRIMINATOR_VALUE = 'setValidFromAndUntil'; /** + * * @var ?string */ protected $action; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; @@ -42,14 +45,16 @@ final class ProductDiscountSetValidFromAndUntilActionModel extends JsonObjectMod */ public function __construct( ?DateTimeImmutable $validFrom = null, - ?DateTimeImmutable $validUntil = null + ?DateTimeImmutable $validUntil = null, + ?string $action = null ) { $this->validFrom = $validFrom; $this->validUntil = $validUntil; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() *

    Value to set. * Take Eventual Consistency into account for calculated undiscounted values.

    * + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -94,6 +100,7 @@ public function getValidFrom() *

    Value to set. * Take Eventual Consistency into account for calculated undiscounted values.

    * + * * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidUntilAction.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidUntilAction.php index 6448018a5d9..38a109a97f6 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidUntilAction.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidUntilAction.php @@ -21,6 +21,7 @@ interface ProductDiscountSetValidUntilAction extends ProductDiscountUpdateAction * If empty, any existing value will be removed. * Take Eventual Consistency into account for calculated undiscounted values.

    * + * @return null|DateTimeImmutable */ public function getValidUntil(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidUntilActionBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidUntilActionBuilder.php index 0534071b6f7..cf55bc620db 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidUntilActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidUntilActionBuilder.php @@ -22,6 +22,7 @@ final class ProductDiscountSetValidUntilActionBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $validUntil; @@ -31,6 +32,7 @@ final class ProductDiscountSetValidUntilActionBuilder implements Builder * If empty, any existing value will be removed. * Take Eventual Consistency into account for calculated undiscounted values.

    * + * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidUntilActionModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidUntilActionModel.php index 3c9776f47c3..cca498d5f4a 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidUntilActionModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountSetValidUntilActionModel.php @@ -22,11 +22,13 @@ final class ProductDiscountSetValidUntilActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setValidUntil'; /** + * * @var ?string */ protected $action; /** + * * @var ?DateTimeImmutable */ protected $validUntil; @@ -36,13 +38,15 @@ final class ProductDiscountSetValidUntilActionModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutable $validUntil = null + ?DateTimeImmutable $validUntil = null, + ?string $action = null ) { $this->validUntil = $validUntil; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -64,6 +68,7 @@ public function getAction() * If empty, any existing value will be removed. * Take Eventual Consistency into account for calculated undiscounted values.

    * + * * @return null|DateTimeImmutable */ public function getValidUntil() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdate.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdate.php index 76026da6cff..c42d5e903f0 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdate.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdate.php @@ -19,6 +19,7 @@ interface ProductDiscountUpdate extends JsonObject /** *

    Expected version of the ProductDiscount on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion(); @@ -26,6 +27,7 @@ public function getVersion(); /** *

    Update actions to be performed on the ProductDiscount.

    * + * @return null|ProductDiscountUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdateAction.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdateAction.php index f3c6adfadbc..f3df57195ec 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdateAction.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdateAction.php @@ -17,6 +17,7 @@ interface ProductDiscountUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdateActionModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdateActionModel.php index 704ab1a81a5..82ef3c98015 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdateActionModel.php @@ -21,6 +21,7 @@ final class ProductDiscountUpdateActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -46,11 +47,13 @@ final class ProductDiscountUpdateActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdateBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdateBuilder.php index f9e61370fb2..6cc217cb425 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdateBuilder.php @@ -21,11 +21,13 @@ final class ProductDiscountUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?ProductDiscountUpdateActionCollection */ private $actions; @@ -33,6 +35,7 @@ final class ProductDiscountUpdateBuilder implements Builder /** *

    Expected version of the ProductDiscount on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion() @@ -43,6 +46,7 @@ public function getVersion() /** *

    Update actions to be performed on the ProductDiscount.

    * + * @return null|ProductDiscountUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdateModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdateModel.php index 2d95dbd2000..d392efa1a60 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdateModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountUpdateModel.php @@ -20,11 +20,13 @@ final class ProductDiscountUpdateModel extends JsonObjectModel implements ProductDiscountUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?ProductDiscountUpdateActionCollection */ protected $actions; @@ -44,6 +46,7 @@ public function __construct( /** *

    Expected version of the ProductDiscount on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * * @return null|int */ public function getVersion() @@ -63,6 +66,7 @@ public function getVersion() /** *

    Update actions to be performed on the ProductDiscount.

    * + * * @return null|ProductDiscountUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValue.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValue.php index 3984be248a6..c57fc13e79b 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValue.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValue.php @@ -17,6 +17,7 @@ interface ProductDiscountValue extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsolute.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsolute.php index 67832981319..ce5aa9e61f6 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsolute.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsolute.php @@ -19,6 +19,7 @@ interface ProductDiscountValueAbsolute extends ProductDiscountValue /** *

    Money values in different currencies. An absolute ProductDiscount will only match a price if this array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.

    * + * @return null|CentPrecisionMoneyCollection */ public function getMoney(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteBuilder.php index eb310e7873c..13ec98550b3 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteBuilder.php @@ -22,6 +22,7 @@ final class ProductDiscountValueAbsoluteBuilder implements Builder { /** + * @var ?CentPrecisionMoneyCollection */ private $money; @@ -29,6 +30,7 @@ final class ProductDiscountValueAbsoluteBuilder implements Builder /** *

    Money values in different currencies. An absolute ProductDiscount will only match a price if this array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.

    * + * @return null|CentPrecisionMoneyCollection */ public function getMoney() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteDraft.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteDraft.php index 293ceb25093..ce4f2f3215b 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteDraft.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteDraft.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\ProductDiscount; -use Commercetools\Api\Models\Common\CentPrecisionMoneyDraftCollection; +use Commercetools\Api\Models\Common\MoneyCollection; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -19,12 +19,13 @@ interface ProductDiscountValueAbsoluteDraft extends ProductDiscountValueDraft /** *

    Money values in different currencies. An absolute ProductDiscount will only match a price if this array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.

    * - * @return null|CentPrecisionMoneyDraftCollection + + * @return null|MoneyCollection */ public function getMoney(); /** - * @param ?CentPrecisionMoneyDraftCollection $money + * @param ?MoneyCollection $money */ - public function setMoney(?CentPrecisionMoneyDraftCollection $money): void; + public function setMoney(?MoneyCollection $money): void; } diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteDraftBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteDraftBuilder.php index b6a050d49c7..faacfc6ee7b 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteDraftBuilder.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\ProductDiscount; -use Commercetools\Api\Models\Common\CentPrecisionMoneyDraftCollection; +use Commercetools\Api\Models\Common\MoneyCollection; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -22,14 +22,16 @@ final class ProductDiscountValueAbsoluteDraftBuilder implements Builder { /** - * @var ?CentPrecisionMoneyDraftCollection + + * @var ?MoneyCollection */ private $money; /** *

    Money values in different currencies. An absolute ProductDiscount will only match a price if this array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.

    * - * @return null|CentPrecisionMoneyDraftCollection + + * @return null|MoneyCollection */ public function getMoney() { @@ -37,10 +39,10 @@ public function getMoney() } /** - * @param ?CentPrecisionMoneyDraftCollection $money + * @param ?MoneyCollection $money * @return $this */ - public function withMoney(?CentPrecisionMoneyDraftCollection $money) + public function withMoney(?MoneyCollection $money) { $this->money = $money; diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteDraftModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteDraftModel.php index c5528002587..d2aebb5fb8b 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteDraftModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteDraftModel.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\ProductDiscount; -use Commercetools\Api\Models\Common\CentPrecisionMoneyDraftCollection; +use Commercetools\Api\Models\Common\MoneyCollection; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -22,12 +22,14 @@ final class ProductDiscountValueAbsoluteDraftModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'absolute'; /** + * * @var ?string */ protected $type; /** - * @var ?CentPrecisionMoneyDraftCollection + * + * @var ?MoneyCollection */ protected $money; @@ -36,13 +38,15 @@ final class ProductDiscountValueAbsoluteDraftModel extends JsonObjectModel imple * @psalm-suppress MissingParamType */ public function __construct( - ?CentPrecisionMoneyDraftCollection $money = null + ?MoneyCollection $money = null, + ?string $type = null ) { $this->money = $money; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -62,7 +66,8 @@ public function getType() /** *

    Money values in different currencies. An absolute ProductDiscount will only match a price if this array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.

    * - * @return null|CentPrecisionMoneyDraftCollection + * + * @return null|MoneyCollection */ public function getMoney() { @@ -72,7 +77,7 @@ public function getMoney() if (is_null($data)) { return null; } - $this->money = CentPrecisionMoneyDraftCollection::fromArray($data); + $this->money = MoneyCollection::fromArray($data); } return $this->money; @@ -80,9 +85,9 @@ public function getMoney() /** - * @param ?CentPrecisionMoneyDraftCollection $money + * @param ?MoneyCollection $money */ - public function setMoney(?CentPrecisionMoneyDraftCollection $money): void + public function setMoney(?MoneyCollection $money): void { $this->money = $money; } diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteModel.php index e5de2ebfd9e..b6f17bcfb88 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueAbsoluteModel.php @@ -22,11 +22,13 @@ final class ProductDiscountValueAbsoluteModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'absolute'; /** + * * @var ?string */ protected $type; /** + * * @var ?CentPrecisionMoneyCollection */ protected $money; @@ -36,13 +38,15 @@ final class ProductDiscountValueAbsoluteModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?CentPrecisionMoneyCollection $money = null + ?CentPrecisionMoneyCollection $money = null, + ?string $type = null ) { $this->money = $money; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -62,6 +66,7 @@ public function getType() /** *

    Money values in different currencies. An absolute ProductDiscount will only match a price if this array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.

    * + * * @return null|CentPrecisionMoneyCollection */ public function getMoney() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueDraft.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueDraft.php index 50f6c12cc96..cfcf968d0c0 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueDraft.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueDraft.php @@ -17,6 +17,7 @@ interface ProductDiscountValueDraft extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueDraftModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueDraftModel.php index 5bf5ba7f243..1b506faa587 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueDraftModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueDraftModel.php @@ -21,6 +21,7 @@ final class ProductDiscountValueDraftModel extends JsonObjectModel implements Pr { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -39,11 +40,13 @@ final class ProductDiscountValueDraftModel extends JsonObjectModel implements Pr * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueExternalDraftModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueExternalDraftModel.php index c8710b82ae1..0f276da2c30 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueExternalDraftModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueExternalDraftModel.php @@ -21,6 +21,7 @@ final class ProductDiscountValueExternalDraftModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'external'; /** + * * @var ?string */ protected $type; @@ -30,11 +31,13 @@ final class ProductDiscountValueExternalDraftModel extends JsonObjectModel imple * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueExternalModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueExternalModel.php index 7e042077f4f..0be86a58bf7 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueExternalModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueExternalModel.php @@ -21,6 +21,7 @@ final class ProductDiscountValueExternalModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'external'; /** + * * @var ?string */ protected $type; @@ -30,11 +31,13 @@ final class ProductDiscountValueExternalModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueModel.php index c080981dc31..365e3915220 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueModel.php @@ -21,6 +21,7 @@ final class ProductDiscountValueModel extends JsonObjectModel implements Product { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -39,11 +40,13 @@ final class ProductDiscountValueModel extends JsonObjectModel implements Product * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelative.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelative.php index 868afb5ede2..1303bd94d47 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelative.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelative.php @@ -18,6 +18,7 @@ interface ProductDiscountValueRelative extends ProductDiscountValue /** *

    Fraction (per ten thousand) the price is reduced by. For example, 1000 will result in a 10% price reduction.

    * + * @return null|int */ public function getPermyriad(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeBuilder.php index 89be9572c01..25dec36271d 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeBuilder.php @@ -21,6 +21,7 @@ final class ProductDiscountValueRelativeBuilder implements Builder { /** + * @var ?int */ private $permyriad; @@ -28,6 +29,7 @@ final class ProductDiscountValueRelativeBuilder implements Builder /** *

    Fraction (per ten thousand) the price is reduced by. For example, 1000 will result in a 10% price reduction.

    * + * @return null|int */ public function getPermyriad() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeDraft.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeDraft.php index 6e4290d562b..0e1c0742943 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeDraft.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeDraft.php @@ -18,6 +18,7 @@ interface ProductDiscountValueRelativeDraft extends ProductDiscountValueDraft /** *

    Fraction (per ten thousand) the price is reduced by. For example, 1000 will result in a 10% price reduction.

    * + * @return null|int */ public function getPermyriad(); diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeDraftBuilder.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeDraftBuilder.php index 2c3ad6eb481..fe129869aa3 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeDraftBuilder.php @@ -21,6 +21,7 @@ final class ProductDiscountValueRelativeDraftBuilder implements Builder { /** + * @var ?int */ private $permyriad; @@ -28,6 +29,7 @@ final class ProductDiscountValueRelativeDraftBuilder implements Builder /** *

    Fraction (per ten thousand) the price is reduced by. For example, 1000 will result in a 10% price reduction.

    * + * @return null|int */ public function getPermyriad() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeDraftModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeDraftModel.php index 3fa58e531a7..8bc4b3f4fb2 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeDraftModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeDraftModel.php @@ -21,11 +21,13 @@ final class ProductDiscountValueRelativeDraftModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'relative'; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $permyriad; @@ -35,13 +37,15 @@ final class ProductDiscountValueRelativeDraftModel extends JsonObjectModel imple * @psalm-suppress MissingParamType */ public function __construct( - ?int $permyriad = null + ?int $permyriad = null, + ?string $type = null ) { $this->permyriad = $permyriad; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() /** *

    Fraction (per ten thousand) the price is reduced by. For example, 1000 will result in a 10% price reduction.

    * + * * @return null|int */ public function getPermyriad() diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeModel.php index beac5ba9a2f..908cb19c296 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountValueRelativeModel.php @@ -21,11 +21,13 @@ final class ProductDiscountValueRelativeModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'relative'; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $permyriad; @@ -35,13 +37,15 @@ final class ProductDiscountValueRelativeModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?int $permyriad = null + ?int $permyriad = null, + ?string $type = null ) { $this->permyriad = $permyriad; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() /** *

    Fraction (per ten thousand) the price is reduced by. For example, 1000 will result in a 10% price reduction.

    * + * * @return null|int */ public function getPermyriad() diff --git a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductReference.php b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductReference.php index 50fe7f701fd..63f1a22563b 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductReference.php +++ b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductReference.php @@ -20,6 +20,7 @@ interface AssignedProductReference extends JsonObject /** *

    Reference to a Product that is assigned to the Product Selection.

    * + * @return null|ProductReference */ public function getProduct(); @@ -28,6 +29,7 @@ public function getProduct(); *

    The Variants of the Product that are included, or excluded, from the Product Selection. * In absence of this field, all Variants are deemed to be included.

    * + * @return null|ProductVariantSelection */ public function getVariantSelection(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductReferenceBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductReferenceBuilder.php index a1847db0e08..27b60f7acdf 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductReferenceBuilder.php @@ -23,11 +23,13 @@ final class AssignedProductReferenceBuilder implements Builder { /** + * @var null|ProductReference|ProductReferenceBuilder */ private $product; /** + * @var null|ProductVariantSelection|ProductVariantSelectionBuilder */ private $variantSelection; @@ -35,6 +37,7 @@ final class AssignedProductReferenceBuilder implements Builder /** *

    Reference to a Product that is assigned to the Product Selection.

    * + * @return null|ProductReference */ public function getProduct() @@ -46,6 +49,7 @@ public function getProduct() *

    The Variants of the Product that are included, or excluded, from the Product Selection. * In absence of this field, all Variants are deemed to be included.

    * + * @return null|ProductVariantSelection */ public function getVariantSelection() diff --git a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductReferenceModel.php b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductReferenceModel.php index 6682ecac7de..455592b2acc 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductReferenceModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductReferenceModel.php @@ -22,11 +22,13 @@ final class AssignedProductReferenceModel extends JsonObjectModel implements AssignedProductReference { /** + * * @var ?ProductReference */ protected $product; /** + * * @var ?ProductVariantSelection */ protected $variantSelection; @@ -46,6 +48,7 @@ public function __construct( /** *

    Reference to a Product that is assigned to the Product Selection.

    * + * * @return null|ProductReference */ public function getProduct() @@ -67,6 +70,7 @@ public function getProduct() *

    The Variants of the Product that are included, or excluded, from the Product Selection. * In absence of this field, all Variants are deemed to be included.

    * + * * @return null|ProductVariantSelection */ public function getVariantSelection() diff --git a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelection.php b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelection.php index 38ef21b5575..5f80edcaa0a 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelection.php +++ b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelection.php @@ -19,6 +19,7 @@ interface AssignedProductSelection extends JsonObject /** *

    Reference to the Product Selection that this assignment is part of.

    * + * @return null|ProductSelectionReference */ public function getProductSelection(); @@ -26,6 +27,7 @@ public function getProductSelection(); /** *

    Selects which Variants of the newly added Product will be included, or excluded, from the Product Selection.

    * + * @return null|ProductVariantSelection */ public function getVariantSelection(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionBuilder.php index 5f36c5fd039..f22ff43d38c 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionBuilder.php @@ -21,11 +21,13 @@ final class AssignedProductSelectionBuilder implements Builder { /** + * @var null|ProductSelectionReference|ProductSelectionReferenceBuilder */ private $productSelection; /** + * @var null|ProductVariantSelection|ProductVariantSelectionBuilder */ private $variantSelection; @@ -33,6 +35,7 @@ final class AssignedProductSelectionBuilder implements Builder /** *

    Reference to the Product Selection that this assignment is part of.

    * + * @return null|ProductSelectionReference */ public function getProductSelection() @@ -43,6 +46,7 @@ public function getProductSelection() /** *

    Selects which Variants of the newly added Product will be included, or excluded, from the Product Selection.

    * + * @return null|ProductVariantSelection */ public function getVariantSelection() diff --git a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionModel.php b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionModel.php index b77b1eb304e..e0e6b6a9491 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionModel.php @@ -20,11 +20,13 @@ final class AssignedProductSelectionModel extends JsonObjectModel implements AssignedProductSelection { /** + * * @var ?ProductSelectionReference */ protected $productSelection; /** + * * @var ?ProductVariantSelection */ protected $variantSelection; @@ -44,6 +46,7 @@ public function __construct( /** *

    Reference to the Product Selection that this assignment is part of.

    * + * * @return null|ProductSelectionReference */ public function getProductSelection() @@ -64,6 +67,7 @@ public function getProductSelection() /** *

    Selects which Variants of the newly added Product will be included, or excluded, from the Product Selection.

    * + * * @return null|ProductVariantSelection */ public function getVariantSelection() diff --git a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionPagedQueryResponse.php b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionPagedQueryResponse.php index 5d09c9cb2a3..3fe91a533e1 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionPagedQueryResponse.php @@ -22,6 +22,7 @@ interface AssignedProductSelectionPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * To get total, pass the query parameter withTotal set to true. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    References to ProductSelection that are assigned to the Product.

    * + * @return null|AssignedProductSelectionCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionPagedQueryResponseBuilder.php index c8d03209953..ef1eb339e5c 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class AssignedProductSelectionPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?AssignedProductSelectionCollection */ private $results; @@ -48,6 +53,7 @@ final class AssignedProductSelectionPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * To get total, pass the query parameter withTotal set to true. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    References to ProductSelection that are assigned to the Product.

    * + * @return null|AssignedProductSelectionCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionPagedQueryResponseModel.php index bace3bd6e69..820c953cad2 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class AssignedProductSelectionPagedQueryResponseModel extends JsonObjectModel implements AssignedProductSelectionPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?AssignedProductSelectionCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * To get total, pass the query parameter withTotal set to true. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    References to ProductSelection that are assigned to the Product.

    * + * * @return null|AssignedProductSelectionCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionType.php b/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionType.php index d7a2bebecb3..d6251a8c0b0 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionType.php +++ b/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionType.php @@ -19,6 +19,7 @@ interface IndividualProductSelectionType extends ProductSelectionType /** *

    The name of the ProductSelection which is recommended to be unique.

    * + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeBuilder.php index 18f7176db53..579a3a0cdcd 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeBuilder.php @@ -23,6 +23,7 @@ final class IndividualProductSelectionTypeBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; @@ -30,6 +31,7 @@ final class IndividualProductSelectionTypeBuilder implements Builder /** *

    The name of the ProductSelection which is recommended to be unique.

    * + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeModel.php b/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeModel.php index 114e9bf29db..5382d426ada 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeModel.php @@ -23,11 +23,13 @@ final class IndividualProductSelectionTypeModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'individual'; /** + * * @var ?string */ protected $type; /** + * * @var ?LocalizedString */ protected $name; @@ -37,15 +39,17 @@ final class IndividualProductSelectionTypeModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $type = null ) { $this->name = $name; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The following type of Product Selections is supported:

    * + * * @return null|string */ public function getType() @@ -65,6 +69,7 @@ public function getType() /** *

    The name of the ProductSelection which is recommended to be unique.

    * + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelection.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelection.php index 2d51f5bf747..8650421832a 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelection.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelection.php @@ -30,6 +30,7 @@ interface ProductSelection extends BaseResource /** *

    Unique identifier of the ProductSelection.

    * + * @return null|string */ public function getId(); @@ -37,6 +38,7 @@ public function getId(); /** *

    Current version of the ProductSelection.

    * + * @return null|int */ public function getVersion(); @@ -44,6 +46,7 @@ public function getVersion(); /** *

    Date and time (UTC) the ProductSelection was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -51,6 +54,7 @@ public function getCreatedAt(); /** *

    Date and time (UTC) the ProductSelection was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -58,6 +62,7 @@ public function getLastModifiedAt(); /** *

    Present on resources updated after 1/02/2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -65,6 +70,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1/02/2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -72,6 +78,7 @@ public function getCreatedBy(); /** *

    User-defined unique identifier of the ProductSelection.

    * + * @return null|string */ public function getKey(); @@ -79,6 +86,7 @@ public function getKey(); /** *

    Name of the ProductSelection.

    * + * @return null|LocalizedString */ public function getName(); @@ -86,6 +94,7 @@ public function getName(); /** *

    Number of Products that are currently assigned to this ProductSelection.

    * + * @return null|int */ public function getProductCount(); @@ -93,6 +102,7 @@ public function getProductCount(); /** *

    Specifies in which way the Products are assigned to the ProductSelection. Currently, the only way of doing this is to specify each Product individually. Hence, the type is fixed to individual for now, but we have plans to add other types in the future.

    * + * @return null|string */ public function getType(); @@ -100,6 +110,7 @@ public function getType(); /** *

    Custom Fields of this ProductSelection.

    * + * @return null|CustomFields */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAddProductAction.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAddProductAction.php index 43565f8e251..c6e281921d5 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAddProductAction.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAddProductAction.php @@ -18,8 +18,9 @@ interface ProductSelectionAddProductAction extends ProductSelectionUpdateAction public const FIELD_VARIANT_SELECTION = 'variantSelection'; /** - *

    ResourceIdentifier to Product

    + *

    ResourceIdentifier of the Product

    * + * @return null|ProductResourceIdentifier */ public function getProduct(); @@ -28,6 +29,7 @@ public function getProduct(); *

    Selects which Variants of the newly added Product will be included, or excluded, from the Product Selection. * If not supplied all Variants are deemed to be included.

    * + * @return null|ProductVariantSelection */ public function getVariantSelection(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAddProductActionBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAddProductActionBuilder.php index e43940a1866..8df39da3fe5 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAddProductActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAddProductActionBuilder.php @@ -23,18 +23,21 @@ final class ProductSelectionAddProductActionBuilder implements Builder { /** + * @var null|ProductResourceIdentifier|ProductResourceIdentifierBuilder */ private $product; /** + * @var null|ProductVariantSelection|ProductVariantSelectionBuilder */ private $variantSelection; /** - *

    ResourceIdentifier to Product

    + *

    ResourceIdentifier of the Product

    * + * @return null|ProductResourceIdentifier */ public function getProduct() @@ -46,6 +49,7 @@ public function getProduct() *

    Selects which Variants of the newly added Product will be included, or excluded, from the Product Selection. * If not supplied all Variants are deemed to be included.

    * + * @return null|ProductVariantSelection */ public function getVariantSelection() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAddProductActionModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAddProductActionModel.php index 8644bec4d73..d52441e5320 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAddProductActionModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAddProductActionModel.php @@ -23,16 +23,19 @@ final class ProductSelectionAddProductActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'addProduct'; /** + * * @var ?string */ protected $action; /** + * * @var ?ProductResourceIdentifier */ protected $product; /** + * * @var ?ProductVariantSelection */ protected $variantSelection; @@ -43,14 +46,16 @@ final class ProductSelectionAddProductActionModel extends JsonObjectModel implem */ public function __construct( ?ProductResourceIdentifier $product = null, - ?ProductVariantSelection $variantSelection = null + ?ProductVariantSelection $variantSelection = null, + ?string $action = null ) { $this->product = $product; $this->variantSelection = $variantSelection; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,7 +73,8 @@ public function getAction() } /** - *

    ResourceIdentifier to Product

    + *

    ResourceIdentifier of the Product

    + * * * @return null|ProductResourceIdentifier */ @@ -91,6 +97,7 @@ public function getProduct() *

    Selects which Variants of the newly added Product will be included, or excluded, from the Product Selection. * If not supplied all Variants are deemed to be included.

    * + * * @return null|ProductVariantSelection */ public function getVariantSelection() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAssignment.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAssignment.php index 3595dc8d10f..c609386e427 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAssignment.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAssignment.php @@ -21,6 +21,7 @@ interface ProductSelectionAssignment extends JsonObject /** *

    Reference to a Product that is assigned to the ProductSelection.

    * + * @return null|ProductReference */ public function getProduct(); @@ -28,6 +29,7 @@ public function getProduct(); /** *

    Reference to the Product Selection that this assignment is part of.

    * + * @return null|ProductSelectionReference */ public function getProductSelection(); @@ -35,6 +37,7 @@ public function getProductSelection(); /** *

    Selects which Variants of the newly added Product will be included, or excluded, from the Product Selection.

    * + * @return null|ProductVariantSelection */ public function getVariantSelection(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAssignmentBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAssignmentBuilder.php index 1e648496d0a..b6c10f69118 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAssignmentBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAssignmentBuilder.php @@ -23,16 +23,19 @@ final class ProductSelectionAssignmentBuilder implements Builder { /** + * @var null|ProductReference|ProductReferenceBuilder */ private $product; /** + * @var null|ProductSelectionReference|ProductSelectionReferenceBuilder */ private $productSelection; /** + * @var null|ProductVariantSelection|ProductVariantSelectionBuilder */ private $variantSelection; @@ -40,6 +43,7 @@ final class ProductSelectionAssignmentBuilder implements Builder /** *

    Reference to a Product that is assigned to the ProductSelection.

    * + * @return null|ProductReference */ public function getProduct() @@ -50,6 +54,7 @@ public function getProduct() /** *

    Reference to the Product Selection that this assignment is part of.

    * + * @return null|ProductSelectionReference */ public function getProductSelection() @@ -60,6 +65,7 @@ public function getProductSelection() /** *

    Selects which Variants of the newly added Product will be included, or excluded, from the Product Selection.

    * + * @return null|ProductVariantSelection */ public function getVariantSelection() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAssignmentModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAssignmentModel.php index b06a61ed1e0..04af46af8a3 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAssignmentModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAssignmentModel.php @@ -22,16 +22,19 @@ final class ProductSelectionAssignmentModel extends JsonObjectModel implements ProductSelectionAssignment { /** + * * @var ?ProductReference */ protected $product; /** + * * @var ?ProductSelectionReference */ protected $productSelection; /** + * * @var ?ProductVariantSelection */ protected $variantSelection; @@ -53,6 +56,7 @@ public function __construct( /** *

    Reference to a Product that is assigned to the ProductSelection.

    * + * * @return null|ProductReference */ public function getProduct() @@ -73,6 +77,7 @@ public function getProduct() /** *

    Reference to the Product Selection that this assignment is part of.

    * + * * @return null|ProductSelectionReference */ public function getProductSelection() @@ -93,6 +98,7 @@ public function getProductSelection() /** *

    Selects which Variants of the newly added Product will be included, or excluded, from the Product Selection.

    * + * * @return null|ProductVariantSelection */ public function getVariantSelection() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionBuilder.php index 528e1b870a2..01f99c9f5fb 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionBuilder.php @@ -32,56 +32,67 @@ final class ProductSelectionBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?int */ private $productCount; /** + * @var ?string */ private $type; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; @@ -89,6 +100,7 @@ final class ProductSelectionBuilder implements Builder /** *

    Unique identifier of the ProductSelection.

    * + * @return null|string */ public function getId() @@ -99,6 +111,7 @@ public function getId() /** *

    Current version of the ProductSelection.

    * + * @return null|int */ public function getVersion() @@ -109,6 +122,7 @@ public function getVersion() /** *

    Date and time (UTC) the ProductSelection was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -119,6 +133,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the ProductSelection was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -129,6 +144,7 @@ public function getLastModifiedAt() /** *

    Present on resources updated after 1/02/2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -139,6 +155,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1/02/2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -149,6 +166,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the ProductSelection.

    * + * @return null|string */ public function getKey() @@ -159,6 +177,7 @@ public function getKey() /** *

    Name of the ProductSelection.

    * + * @return null|LocalizedString */ public function getName() @@ -169,6 +188,7 @@ public function getName() /** *

    Number of Products that are currently assigned to this ProductSelection.

    * + * @return null|int */ public function getProductCount() @@ -179,6 +199,7 @@ public function getProductCount() /** *

    Specifies in which way the Products are assigned to the ProductSelection. Currently, the only way of doing this is to specify each Product individually. Hence, the type is fixed to individual for now, but we have plans to add other types in the future.

    * + * @return null|string */ public function getType() @@ -189,6 +210,7 @@ public function getType() /** *

    Custom Fields of this ProductSelection.

    * + * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionChangeNameAction.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionChangeNameAction.php index 811be5b87ea..1c25ececb1e 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionChangeNameAction.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionChangeNameAction.php @@ -19,6 +19,7 @@ interface ProductSelectionChangeNameAction extends ProductSelectionUpdateAction /** *

    The new name to be set for the ProductSelection.

    * + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionChangeNameActionBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionChangeNameActionBuilder.php index 7d199d8c1bb..f2d531a6885 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionChangeNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionChangeNameActionBuilder.php @@ -23,6 +23,7 @@ final class ProductSelectionChangeNameActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; @@ -30,6 +31,7 @@ final class ProductSelectionChangeNameActionBuilder implements Builder /** *

    The new name to be set for the ProductSelection.

    * + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionChangeNameActionModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionChangeNameActionModel.php index c20cd079c45..293d496cedd 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionChangeNameActionModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionChangeNameActionModel.php @@ -23,11 +23,13 @@ final class ProductSelectionChangeNameActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'changeName'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $name; @@ -37,13 +39,15 @@ final class ProductSelectionChangeNameActionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    The new name to be set for the ProductSelection.

    * + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraft.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraft.php index ae09c2572de..2cc4d734d74 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraft.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraft.php @@ -22,6 +22,7 @@ interface ProductSelectionDraft extends JsonObject /** *

    User-defined unique identifier for the ProductSelection.

    * + * @return null|string */ public function getKey(); @@ -29,6 +30,7 @@ public function getKey(); /** *

    Name of the ProductSelection. Not checked for uniqueness, but distinct names are recommended.

    * + * @return null|LocalizedString */ public function getName(); @@ -36,6 +38,7 @@ public function getName(); /** *

    Custom Fields of this ProductSelection.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftBuilder.php index 9b0c5991c0b..3089bcab129 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftBuilder.php @@ -25,16 +25,19 @@ final class ProductSelectionDraftBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; @@ -42,6 +45,7 @@ final class ProductSelectionDraftBuilder implements Builder /** *

    User-defined unique identifier for the ProductSelection.

    * + * @return null|string */ public function getKey() @@ -52,6 +56,7 @@ public function getKey() /** *

    Name of the ProductSelection. Not checked for uniqueness, but distinct names are recommended.

    * + * @return null|LocalizedString */ public function getName() @@ -62,6 +67,7 @@ public function getName() /** *

    Custom Fields of this ProductSelection.

    * + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftModel.php index bb91ac6aee5..bb8e9428188 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftModel.php @@ -24,16 +24,19 @@ final class ProductSelectionDraftModel extends JsonObjectModel implements ProductSelectionDraft { /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -55,6 +58,7 @@ public function __construct( /** *

    User-defined unique identifier for the ProductSelection.

    * + * * @return null|string */ public function getKey() @@ -74,6 +78,7 @@ public function getKey() /** *

    Name of the ProductSelection. Not checked for uniqueness, but distinct names are recommended.

    * + * * @return null|LocalizedString */ public function getName() @@ -94,6 +99,7 @@ public function getName() /** *

    Custom Fields of this ProductSelection.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionModel.php index 1c9b36a129d..aee6a0256b8 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionModel.php @@ -31,56 +31,67 @@ final class ProductSelectionModel extends JsonObjectModel implements ProductSelection { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?int */ protected $productCount; /** + * * @var ?string */ protected $type; /** + * * @var ?CustomFields */ protected $custom; @@ -118,6 +129,7 @@ public function __construct( /** *

    Unique identifier of the ProductSelection.

    * + * * @return null|string */ public function getId() @@ -137,6 +149,7 @@ public function getId() /** *

    Current version of the ProductSelection.

    * + * * @return null|int */ public function getVersion() @@ -156,6 +169,7 @@ public function getVersion() /** *

    Date and time (UTC) the ProductSelection was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -179,6 +193,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the ProductSelection was last updated.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -202,6 +217,7 @@ public function getLastModifiedAt() /** *

    Present on resources updated after 1/02/2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -222,6 +238,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1/02/2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -242,6 +259,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the ProductSelection.

    * + * * @return null|string */ public function getKey() @@ -261,6 +279,7 @@ public function getKey() /** *

    Name of the ProductSelection.

    * + * * @return null|LocalizedString */ public function getName() @@ -281,6 +300,7 @@ public function getName() /** *

    Number of Products that are currently assigned to this ProductSelection.

    * + * * @return null|int */ public function getProductCount() @@ -300,6 +320,7 @@ public function getProductCount() /** *

    Specifies in which way the Products are assigned to the ProductSelection. Currently, the only way of doing this is to specify each Product individually. Hence, the type is fixed to individual for now, but we have plans to add other types in the future.

    * + * * @return null|string */ public function getType() @@ -319,6 +340,7 @@ public function getType() /** *

    Custom Fields of this ProductSelection.

    * + * * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionPagedQueryResponse.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionPagedQueryResponse.php index 60e79e9d0c0..ed348d48bef 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionPagedQueryResponse.php @@ -22,6 +22,7 @@ interface ProductSelectionPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * To get total, pass the query parameter withTotal set to true. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    ProductSelections matching the query.

    * + * @return null|ProductSelectionCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionPagedQueryResponseBuilder.php index a1bee91fdf9..c5bfe846194 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class ProductSelectionPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?ProductSelectionCollection */ private $results; @@ -48,6 +53,7 @@ final class ProductSelectionPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * To get total, pass the query parameter withTotal set to true. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    ProductSelections matching the query.

    * + * @return null|ProductSelectionCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionPagedQueryResponseModel.php index c93c02ddb72..92ec71cbe0f 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class ProductSelectionPagedQueryResponseModel extends JsonObjectModel implements ProductSelectionPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?ProductSelectionCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * To get total, pass the query parameter withTotal set to true. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    ProductSelections matching the query.

    * + * * @return null|ProductSelectionCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionProductPagedQueryResponse.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionProductPagedQueryResponse.php index e06cd92fa0c..8572cb2a47a 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionProductPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionProductPagedQueryResponse.php @@ -22,6 +22,7 @@ interface ProductSelectionProductPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * To get total, pass the query parameter withTotal set to true. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    References to Products that are assigned to the ProductSelection.

    * + * @return null|AssignedProductReferenceCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionProductPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionProductPagedQueryResponseBuilder.php index bab6c499961..a01ed590a8a 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionProductPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionProductPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class ProductSelectionProductPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?AssignedProductReferenceCollection */ private $results; @@ -48,6 +53,7 @@ final class ProductSelectionProductPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * To get total, pass the query parameter withTotal set to true. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    References to Products that are assigned to the ProductSelection.

    * + * @return null|AssignedProductReferenceCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionProductPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionProductPagedQueryResponseModel.php index 06ae219d62c..6b479b32f56 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionProductPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionProductPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class ProductSelectionProductPagedQueryResponseModel extends JsonObjectModel implements ProductSelectionProductPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?AssignedProductReferenceCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * To get total, pass the query parameter withTotal set to true. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    References to Products that are assigned to the ProductSelection.

    * + * * @return null|AssignedProductReferenceCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionReference.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionReference.php index 52df43cc5ae..0bf8e5cd9c5 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionReference.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionReference.php @@ -19,6 +19,7 @@ interface ProductSelectionReference extends Reference /** *

    Unique identifier of the referenced ProductSelection.

    * + * @return null|string */ public function getId(); @@ -26,6 +27,7 @@ public function getId(); /** *

    Contains the representation of the expanded ProductSelection. Only present in responses to requests with Reference Expansion for ProductSelections.

    * + * @return null|ProductSelection */ public function getObj(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionReferenceBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionReferenceBuilder.php index b4760cadf12..3ae6c5df783 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionReferenceBuilder.php @@ -23,11 +23,13 @@ final class ProductSelectionReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|ProductSelection|ProductSelectionBuilder */ private $obj; @@ -35,6 +37,7 @@ final class ProductSelectionReferenceBuilder implements Builder /** *

    Unique identifier of the referenced ProductSelection.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded ProductSelection. Only present in responses to requests with Reference Expansion for ProductSelections.

    * + * @return null|ProductSelection */ public function getObj() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionReferenceModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionReferenceModel.php index dee5c6d5b1e..bd1406c7323 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionReferenceModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionReferenceModel.php @@ -23,16 +23,19 @@ final class ProductSelectionReferenceModel extends JsonObjectModel implements Pr { public const DISCRIMINATOR_VALUE = 'product-selection'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?ProductSelection */ protected $obj; @@ -43,16 +46,18 @@ final class ProductSelectionReferenceModel extends JsonObjectModel implements Pr */ public function __construct( ?string $id = null, - ?ProductSelection $obj = null + ?ProductSelection $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced ProductSelection.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded ProductSelection. Only present in responses to requests with Reference Expansion for ProductSelections.

    * + * * @return null|ProductSelection */ public function getObj() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionRemoveProductAction.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionRemoveProductAction.php index 9b3547dab2b..be64beba74c 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionRemoveProductAction.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionRemoveProductAction.php @@ -17,8 +17,9 @@ interface ProductSelectionRemoveProductAction extends ProductSelectionUpdateActi public const FIELD_PRODUCT = 'product'; /** - *

    ResourceIdentifier to Product

    + *

    ResourceIdentifier of the Product

    * + * @return null|ProductResourceIdentifier */ public function getProduct(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionRemoveProductActionBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionRemoveProductActionBuilder.php index 954d8be560e..5bd5fd65af1 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionRemoveProductActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionRemoveProductActionBuilder.php @@ -23,13 +23,15 @@ final class ProductSelectionRemoveProductActionBuilder implements Builder { /** + * @var null|ProductResourceIdentifier|ProductResourceIdentifierBuilder */ private $product; /** - *

    ResourceIdentifier to Product

    + *

    ResourceIdentifier of the Product

    * + * @return null|ProductResourceIdentifier */ public function getProduct() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionRemoveProductActionModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionRemoveProductActionModel.php index e94b0e895d6..bac67255aba 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionRemoveProductActionModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionRemoveProductActionModel.php @@ -23,11 +23,13 @@ final class ProductSelectionRemoveProductActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'removeProduct'; /** + * * @var ?string */ protected $action; /** + * * @var ?ProductResourceIdentifier */ protected $product; @@ -37,13 +39,15 @@ final class ProductSelectionRemoveProductActionModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?ProductResourceIdentifier $product = null + ?ProductResourceIdentifier $product = null, + ?string $action = null ) { $this->product = $product; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,7 +65,8 @@ public function getAction() } /** - *

    ResourceIdentifier to Product

    + *

    ResourceIdentifier of the Product

    + * * * @return null|ProductResourceIdentifier */ diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionResourceIdentifier.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionResourceIdentifier.php index 6bf3745e56a..524e8d7ae86 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionResourceIdentifier.php @@ -17,6 +17,7 @@ interface ProductSelectionResourceIdentifier extends ResourceIdentifier /** *

    Unique identifier of the referenced ProductSelection. Either id or key is required.

    * + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

    User-defined unique identifier of the referenced ProductSelection. Either id or key is required.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionResourceIdentifierBuilder.php index 07ac6068b63..25d595683e6 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class ProductSelectionResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class ProductSelectionResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced ProductSelection. Either id or key is required.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced ProductSelection. Either id or key is required.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionResourceIdentifierModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionResourceIdentifierModel.php index 90de0d37fd8..6f1ae32ece2 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class ProductSelectionResourceIdentifierModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'product-selection'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class ProductSelectionResourceIdentifierModel extends JsonObjectModel impl */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced ProductSelection. Either id or key is required.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced ProductSelection. Either id or key is required.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomFieldAction.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomFieldAction.php index 9ccf58b2ded..bdcc5ecf3e1 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface ProductSelectionSetCustomFieldAction extends ProductSelectionUpdateAct /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomFieldActionBuilder.php index 84d6c6839da..a9802cd4961 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class ProductSelectionSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class ProductSelectionSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomFieldActionModel.php index 936228c8795..8c11e937c1b 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class ProductSelectionSetCustomFieldActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class ProductSelectionSetCustomFieldActionModel extends JsonObjectModel im */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomTypeAction.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomTypeAction.php index d5c5715689f..08da3ee4adf 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface ProductSelectionSetCustomTypeAction extends ProductSelectionUpdateActi *

    Defines the Type that extends the ProductSelection with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ProductSelection.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the ProductSelection.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomTypeActionBuilder.php index fb41d4b5040..d880255708d 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class ProductSelectionSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class ProductSelectionSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the ProductSelection with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ProductSelection.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the ProductSelection.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomTypeActionModel.php index 30debdce30b..10b2bef4fe5 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class ProductSelectionSetCustomTypeActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class ProductSelectionSetCustomTypeActionModel extends JsonObjectModel imp */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the ProductSelection with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ProductSelection.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the ProductSelection.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetKeyAction.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetKeyAction.php index a6c668316b2..de62b3bb423 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetKeyAction.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetKeyAction.php @@ -18,6 +18,7 @@ interface ProductSelectionSetKeyAction extends ProductSelectionUpdateAction /** *

    If key is absent or null, the existing key, if any, will be removed.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetKeyActionBuilder.php index 991fae9bcd5..ac19271ae24 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetKeyActionBuilder.php @@ -21,6 +21,7 @@ final class ProductSelectionSetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; @@ -28,6 +29,7 @@ final class ProductSelectionSetKeyActionBuilder implements Builder /** *

    If key is absent or null, the existing key, if any, will be removed.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetKeyActionModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetKeyActionModel.php index 4fec33eed51..936e5919e05 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetKeyActionModel.php @@ -21,11 +21,13 @@ final class ProductSelectionSetKeyActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class ProductSelectionSetKeyActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    If key is absent or null, the existing key, if any, will be removed.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetVariantSelectionAction.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetVariantSelectionAction.php index ebbac777771..d1a188a7422 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetVariantSelectionAction.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetVariantSelectionAction.php @@ -18,8 +18,9 @@ interface ProductSelectionSetVariantSelectionAction extends ProductSelectionUpda public const FIELD_VARIANT_SELECTION = 'variantSelection'; /** - *

    ResourceIdentifier to Product

    + *

    ResourceIdentifier of the Product

    * + * @return null|ProductResourceIdentifier */ public function getProduct(); @@ -28,6 +29,7 @@ public function getProduct(); *

    Determines which Variants of the previously added Product are to be included in, or excluded from, the Product Selection. * Leave it empty to unset an existing Variant Selection.

    * + * @return null|ProductVariantSelection */ public function getVariantSelection(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetVariantSelectionActionBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetVariantSelectionActionBuilder.php index 22f7e1b6db0..d071906c619 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetVariantSelectionActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetVariantSelectionActionBuilder.php @@ -23,18 +23,21 @@ final class ProductSelectionSetVariantSelectionActionBuilder implements Builder { /** + * @var null|ProductResourceIdentifier|ProductResourceIdentifierBuilder */ private $product; /** + * @var null|ProductVariantSelection|ProductVariantSelectionBuilder */ private $variantSelection; /** - *

    ResourceIdentifier to Product

    + *

    ResourceIdentifier of the Product

    * + * @return null|ProductResourceIdentifier */ public function getProduct() @@ -46,6 +49,7 @@ public function getProduct() *

    Determines which Variants of the previously added Product are to be included in, or excluded from, the Product Selection. * Leave it empty to unset an existing Variant Selection.

    * + * @return null|ProductVariantSelection */ public function getVariantSelection() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetVariantSelectionActionModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetVariantSelectionActionModel.php index e60fb7411de..b16f46f534e 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetVariantSelectionActionModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionSetVariantSelectionActionModel.php @@ -23,16 +23,19 @@ final class ProductSelectionSetVariantSelectionActionModel extends JsonObjectMod { public const DISCRIMINATOR_VALUE = 'setVariantSelection'; /** + * * @var ?string */ protected $action; /** + * * @var ?ProductResourceIdentifier */ protected $product; /** + * * @var ?ProductVariantSelection */ protected $variantSelection; @@ -43,14 +46,16 @@ final class ProductSelectionSetVariantSelectionActionModel extends JsonObjectMod */ public function __construct( ?ProductResourceIdentifier $product = null, - ?ProductVariantSelection $variantSelection = null + ?ProductVariantSelection $variantSelection = null, + ?string $action = null ) { $this->product = $product; $this->variantSelection = $variantSelection; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,7 +73,8 @@ public function getAction() } /** - *

    ResourceIdentifier to Product

    + *

    ResourceIdentifier of the Product

    + * * * @return null|ProductResourceIdentifier */ @@ -91,6 +97,7 @@ public function getProduct() *

    Determines which Variants of the previously added Product are to be included in, or excluded from, the Product Selection. * Leave it empty to unset an existing Variant Selection.

    * + * * @return null|ProductVariantSelection */ public function getVariantSelection() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionType.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionType.php index 1a19ce065e5..fe4864db25d 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionType.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionType.php @@ -19,6 +19,7 @@ interface ProductSelectionType extends JsonObject /** *

    The following type of Product Selections is supported:

    * + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionTypeModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionTypeModel.php index f5e02fe910f..79e2de8812f 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionTypeModel.php @@ -21,6 +21,7 @@ final class ProductSelectionTypeModel extends JsonObjectModel implements Product { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -37,13 +38,15 @@ final class ProductSelectionTypeModel extends JsonObjectModel implements Product * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** *

    The following type of Product Selections is supported:

    * + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdate.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdate.php index 61d605bef90..c057ac01a6e 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdate.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdate.php @@ -17,11 +17,13 @@ interface ProductSelectionUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + * @return null|int */ public function getVersion(); /** + * @return null|ProductSelectionUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdateAction.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdateAction.php index 06c0cdc685a..f99be7a3499 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdateAction.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdateAction.php @@ -17,6 +17,7 @@ interface ProductSelectionUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdateActionModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdateActionModel.php index 93e84354fb3..be139e73319 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdateActionModel.php @@ -21,6 +21,7 @@ final class ProductSelectionUpdateActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -43,11 +44,13 @@ final class ProductSelectionUpdateActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdateBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdateBuilder.php index b2322a1131d..9dca50fb4da 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdateBuilder.php @@ -21,16 +21,19 @@ final class ProductSelectionUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?ProductSelectionUpdateActionCollection */ private $actions; /** + * @return null|int */ public function getVersion() @@ -39,6 +42,7 @@ public function getVersion() } /** + * @return null|ProductSelectionUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdateModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdateModel.php index e31dd1152c9..2b4dc1ff795 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdateModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionUpdateModel.php @@ -20,11 +20,13 @@ final class ProductSelectionUpdateModel extends JsonObjectModel implements ProductSelectionUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?ProductSelectionUpdateActionCollection */ protected $actions; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|int */ public function getVersion() @@ -59,6 +62,7 @@ public function getVersion() } /** + * * @return null|ProductSelectionUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelection.php b/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelection.php index a95da026054..c6430a55bdf 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelection.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelection.php @@ -19,6 +19,7 @@ interface ProductVariantSelection extends JsonObject /** *

    Determines whether the SKUs are to be included in, or excluded from, the Product Selection.

    * + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionExclusion.php b/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionExclusion.php index bd535eebab6..17aee3fbcb6 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionExclusion.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionExclusion.php @@ -16,6 +16,7 @@ interface ProductVariantSelectionExclusion extends ProductVariantSelection public const FIELD_SKUS = 'skus'; /** + * @return null|string */ public function getType(); @@ -23,6 +24,7 @@ public function getType(); /** *

    Non-empty array of SKUs representing Product Variants to be excluded from the Product Selection.

    * + * @return null|array */ public function getSkus(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionExclusionBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionExclusionBuilder.php index 906b64fced0..2033e8f7746 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionExclusionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionExclusionBuilder.php @@ -21,6 +21,7 @@ final class ProductVariantSelectionExclusionBuilder implements Builder { /** + * @var ?array */ private $skus; @@ -28,6 +29,7 @@ final class ProductVariantSelectionExclusionBuilder implements Builder /** *

    Non-empty array of SKUs representing Product Variants to be excluded from the Product Selection.

    * + * @return null|array */ public function getSkus() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionExclusionModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionExclusionModel.php index ac124e688b0..baa03975718 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionExclusionModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionExclusionModel.php @@ -21,11 +21,13 @@ final class ProductVariantSelectionExclusionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'exclusion'; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $skus; @@ -35,13 +37,15 @@ final class ProductVariantSelectionExclusionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?array $skus = null + ?array $skus = null, + ?string $type = null ) { $this->skus = $skus; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() /** *

    Non-empty array of SKUs representing Product Variants to be excluded from the Product Selection.

    * + * * @return null|array */ public function getSkus() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionInclusion.php b/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionInclusion.php index 5b7a052675d..8fa8de48250 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionInclusion.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionInclusion.php @@ -16,6 +16,7 @@ interface ProductVariantSelectionInclusion extends ProductVariantSelection public const FIELD_SKUS = 'skus'; /** + * @return null|string */ public function getType(); @@ -23,6 +24,7 @@ public function getType(); /** *

    Non-empty array of SKUs representing Product Variants to be included into the Product Selection.

    * + * @return null|array */ public function getSkus(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionInclusionBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionInclusionBuilder.php index bc032e298b6..8eff9aeda5d 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionInclusionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionInclusionBuilder.php @@ -21,6 +21,7 @@ final class ProductVariantSelectionInclusionBuilder implements Builder { /** + * @var ?array */ private $skus; @@ -28,6 +29,7 @@ final class ProductVariantSelectionInclusionBuilder implements Builder /** *

    Non-empty array of SKUs representing Product Variants to be included into the Product Selection.

    * + * @return null|array */ public function getSkus() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionInclusionModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionInclusionModel.php index b53c73c9a48..afeda3caa33 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionInclusionModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionInclusionModel.php @@ -21,11 +21,13 @@ final class ProductVariantSelectionInclusionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'inclusion'; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $skus; @@ -35,13 +37,15 @@ final class ProductVariantSelectionInclusionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?array $skus = null + ?array $skus = null, + ?string $type = null ) { $this->skus = $skus; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() /** *

    Non-empty array of SKUs representing Product Variants to be included into the Product Selection.

    * + * * @return null|array */ public function getSkus() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionModel.php index 8560f3ac52c..868dbd1d020 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductVariantSelectionModel.php @@ -21,6 +21,7 @@ final class ProductVariantSelectionModel extends JsonObjectModel implements Prod { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -38,13 +39,15 @@ final class ProductVariantSelectionModel extends JsonObjectModel implements Prod * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** *

    Determines whether the SKUs are to be included in, or excluded from, the Product Selection.

    * + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductsInStorePagedQueryResponse.php b/lib/commercetools-api/src/Models/ProductSelection/ProductsInStorePagedQueryResponse.php index 496c7b92e3d..29acab3816f 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductsInStorePagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductsInStorePagedQueryResponse.php @@ -22,6 +22,7 @@ interface ProductsInStorePagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * To get total, pass the query parameter withTotal set to true. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    ProductSelectionAssignments matching the query.

    * + * @return null|ProductSelectionAssignmentCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductsInStorePagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductsInStorePagedQueryResponseBuilder.php index 9f4922196f5..785c51e2ea8 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductsInStorePagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductsInStorePagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class ProductsInStorePagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?ProductSelectionAssignmentCollection */ private $results; @@ -48,6 +53,7 @@ final class ProductsInStorePagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * To get total, pass the query parameter withTotal set to true. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    ProductSelectionAssignments matching the query.

    * + * @return null|ProductSelectionAssignmentCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductsInStorePagedQueryResponseModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductsInStorePagedQueryResponseModel.php index e34c27bc1c1..1e4115865e6 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductsInStorePagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductsInStorePagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class ProductsInStorePagedQueryResponseModel extends JsonObjectModel implements ProductsInStorePagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?ProductSelectionAssignmentCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * To get total, pass the query parameter withTotal set to true. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    ProductSelectionAssignments matching the query.

    * + * * @return null|ProductSelectionAssignmentCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeBooleanTypeModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeBooleanTypeModel.php index 2eaa3f5705f..3d565c86e88 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeBooleanTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeBooleanTypeModel.php @@ -21,6 +21,7 @@ final class AttributeBooleanTypeModel extends JsonObjectModel implements Attribu { public const DISCRIMINATOR_VALUE = 'boolean'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class AttributeBooleanTypeModel extends JsonObjectModel implements Attribu * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeDateTimeTypeModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeDateTimeTypeModel.php index 004b8bb16ac..696ca9369b5 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeDateTimeTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeDateTimeTypeModel.php @@ -21,6 +21,7 @@ final class AttributeDateTimeTypeModel extends JsonObjectModel implements Attrib { public const DISCRIMINATOR_VALUE = 'datetime'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class AttributeDateTimeTypeModel extends JsonObjectModel implements Attrib * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeDateTypeModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeDateTypeModel.php index 3c21f6fa121..ae4cd184b55 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeDateTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeDateTypeModel.php @@ -21,6 +21,7 @@ final class AttributeDateTypeModel extends JsonObjectModel implements AttributeD { public const DISCRIMINATOR_VALUE = 'date'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class AttributeDateTypeModel extends JsonObjectModel implements AttributeD * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeDefinition.php b/lib/commercetools-api/src/Models/ProductType/AttributeDefinition.php index cd69132b64f..61d38b538fd 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeDefinition.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeDefinition.php @@ -26,6 +26,7 @@ interface AttributeDefinition extends JsonObject /** *

    Describes the Type of the Attribute.

    * + * @return null|AttributeType */ public function getType(); @@ -33,6 +34,7 @@ public function getType(); /** *

    User-defined name of the Attribute that is unique within the Project.

    * + * @return null|string */ public function getName(); @@ -40,6 +42,7 @@ public function getName(); /** *

    Human-readable label for the Attribute.

    * + * @return null|LocalizedString */ public function getLabel(); @@ -47,6 +50,7 @@ public function getLabel(); /** *

    If true, the Attribute must have a value on a ProductVariant.

    * + * @return null|bool */ public function getIsRequired(); @@ -54,6 +58,7 @@ public function getIsRequired(); /** *

    Specifies how Attributes are validated across all variants of a Product.

    * + * @return null|string */ public function getAttributeConstraint(); @@ -61,6 +66,7 @@ public function getAttributeConstraint(); /** *

    Provides additional Attribute information to aid content managers configure Product details.

    * + * @return null|LocalizedString */ public function getInputTip(); @@ -68,6 +74,7 @@ public function getInputTip(); /** *

    Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).

    * + * @return null|string */ public function getInputHint(); @@ -76,9 +83,10 @@ public function getInputHint(); *

    If true, the Attribute's values are available for the Product Projections Search API for use in full-text search queries, filters, and facets.

    *

    Which exact features are available with this flag depends on the specific AttributeType. * The maximum size of a searchable field is restricted by the Field content size limit. - * This constraint is enforced at both Product creation and Product update. + * This constraint is enforced at both Product creation and Product update. * If the length of the input exceeds the maximum size, an InvalidFieldError is returned.

    * + * @return null|bool */ public function getIsSearchable(); diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionBuilder.php b/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionBuilder.php index 5decfc94a4a..ce61c02e999 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionBuilder.php @@ -23,41 +23,49 @@ final class AttributeDefinitionBuilder implements Builder { /** + * @var null|AttributeType|AttributeTypeBuilder */ private $type; /** + * @var ?string */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; /** + * @var ?bool */ private $isRequired; /** + * @var ?string */ private $attributeConstraint; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $inputTip; /** + * @var ?string */ private $inputHint; /** + * @var ?bool */ private $isSearchable; @@ -65,6 +73,7 @@ final class AttributeDefinitionBuilder implements Builder /** *

    Describes the Type of the Attribute.

    * + * @return null|AttributeType */ public function getType() @@ -75,6 +84,7 @@ public function getType() /** *

    User-defined name of the Attribute that is unique within the Project.

    * + * @return null|string */ public function getName() @@ -85,6 +95,7 @@ public function getName() /** *

    Human-readable label for the Attribute.

    * + * @return null|LocalizedString */ public function getLabel() @@ -95,6 +106,7 @@ public function getLabel() /** *

    If true, the Attribute must have a value on a ProductVariant.

    * + * @return null|bool */ public function getIsRequired() @@ -105,6 +117,7 @@ public function getIsRequired() /** *

    Specifies how Attributes are validated across all variants of a Product.

    * + * @return null|string */ public function getAttributeConstraint() @@ -115,6 +128,7 @@ public function getAttributeConstraint() /** *

    Provides additional Attribute information to aid content managers configure Product details.

    * + * @return null|LocalizedString */ public function getInputTip() @@ -125,6 +139,7 @@ public function getInputTip() /** *

    Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).

    * + * @return null|string */ public function getInputHint() @@ -136,9 +151,10 @@ public function getInputHint() *

    If true, the Attribute's values are available for the Product Projections Search API for use in full-text search queries, filters, and facets.

    *

    Which exact features are available with this flag depends on the specific AttributeType. * The maximum size of a searchable field is restricted by the Field content size limit. - * This constraint is enforced at both Product creation and Product update. + * This constraint is enforced at both Product creation and Product update. * If the length of the input exceeds the maximum size, an InvalidFieldError is returned.

    * + * @return null|bool */ public function getIsSearchable() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionDraft.php b/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionDraft.php index 62940aba3b4..ec12923ca3e 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionDraft.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionDraft.php @@ -26,6 +26,7 @@ interface AttributeDefinitionDraft extends JsonObject /** *

    Describes the Type of the Attribute.

    * + * @return null|AttributeType */ public function getType(); @@ -35,6 +36,7 @@ public function getType(); * When using the same name for an Attribute in multiple ProductTypes, all fields of the AttributeDefinition of this Attribute must be the same across the ProductTypes. Otherwise an AttributeDefinitionAlreadyExistsError will be returned. * An exception to this are the values of an enum or lenum Type and sets thereof.

    * + * @return null|string */ public function getName(); @@ -42,6 +44,7 @@ public function getName(); /** *

    Human-readable label for the Attribute.

    * + * @return null|LocalizedString */ public function getLabel(); @@ -49,6 +52,7 @@ public function getLabel(); /** *

    Set to true if the Attribute is required to have a value on a ProductVariant.

    * + * @return null|bool */ public function getIsRequired(); @@ -56,6 +60,7 @@ public function getIsRequired(); /** *

    Specifies how an Attribute or a combination of Attributes should be validated across all variants of a Product.

    * + * @return null|string */ public function getAttributeConstraint(); @@ -63,6 +68,7 @@ public function getAttributeConstraint(); /** *

    Provides additional information about the Attribute that aids content managers when setting Product details.

    * + * @return null|LocalizedString */ public function getInputTip(); @@ -70,6 +76,7 @@ public function getInputTip(); /** *

    Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).

    * + * @return null|string */ public function getInputHint(); @@ -81,6 +88,7 @@ public function getInputHint(); * This constraint is enforced at both Product creation and Product update. * If the length of the input exceeds the maximum size, an InvalidField error is returned.

    * + * @return null|bool */ public function getIsSearchable(); diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionDraftBuilder.php b/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionDraftBuilder.php index 43c1e4326e0..062cf396874 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionDraftBuilder.php @@ -23,41 +23,49 @@ final class AttributeDefinitionDraftBuilder implements Builder { /** + * @var null|AttributeType|AttributeTypeBuilder */ private $type; /** + * @var ?string */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; /** + * @var ?bool */ private $isRequired; /** + * @var ?string */ private $attributeConstraint; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $inputTip; /** + * @var ?string */ private $inputHint; /** + * @var ?bool */ private $isSearchable; @@ -65,6 +73,7 @@ final class AttributeDefinitionDraftBuilder implements Builder /** *

    Describes the Type of the Attribute.

    * + * @return null|AttributeType */ public function getType() @@ -77,6 +86,7 @@ public function getType() * When using the same name for an Attribute in multiple ProductTypes, all fields of the AttributeDefinition of this Attribute must be the same across the ProductTypes. Otherwise an AttributeDefinitionAlreadyExistsError will be returned. * An exception to this are the values of an enum or lenum Type and sets thereof.

    * + * @return null|string */ public function getName() @@ -87,6 +97,7 @@ public function getName() /** *

    Human-readable label for the Attribute.

    * + * @return null|LocalizedString */ public function getLabel() @@ -97,6 +108,7 @@ public function getLabel() /** *

    Set to true if the Attribute is required to have a value on a ProductVariant.

    * + * @return null|bool */ public function getIsRequired() @@ -107,6 +119,7 @@ public function getIsRequired() /** *

    Specifies how an Attribute or a combination of Attributes should be validated across all variants of a Product.

    * + * @return null|string */ public function getAttributeConstraint() @@ -117,6 +130,7 @@ public function getAttributeConstraint() /** *

    Provides additional information about the Attribute that aids content managers when setting Product details.

    * + * @return null|LocalizedString */ public function getInputTip() @@ -127,6 +141,7 @@ public function getInputTip() /** *

    Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).

    * + * @return null|string */ public function getInputHint() @@ -141,6 +156,7 @@ public function getInputHint() * This constraint is enforced at both Product creation and Product update. * If the length of the input exceeds the maximum size, an InvalidField error is returned.

    * + * @return null|bool */ public function getIsSearchable() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionDraftModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionDraftModel.php index dd0b4049cbf..9da4d37d7b9 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionDraftModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionDraftModel.php @@ -22,41 +22,49 @@ final class AttributeDefinitionDraftModel extends JsonObjectModel implements AttributeDefinitionDraft { /** + * * @var ?AttributeType */ protected $type; /** + * * @var ?string */ protected $name; /** + * * @var ?LocalizedString */ protected $label; /** + * * @var ?bool */ protected $isRequired; /** + * * @var ?string */ protected $attributeConstraint; /** + * * @var ?LocalizedString */ protected $inputTip; /** + * * @var ?string */ protected $inputHint; /** + * * @var ?bool */ protected $isSearchable; @@ -88,6 +96,7 @@ public function __construct( /** *

    Describes the Type of the Attribute.

    * + * * @return null|AttributeType */ public function getType() @@ -110,6 +119,7 @@ public function getType() * When using the same name for an Attribute in multiple ProductTypes, all fields of the AttributeDefinition of this Attribute must be the same across the ProductTypes. Otherwise an AttributeDefinitionAlreadyExistsError will be returned. * An exception to this are the values of an enum or lenum Type and sets thereof.

    * + * * @return null|string */ public function getName() @@ -129,6 +139,7 @@ public function getName() /** *

    Human-readable label for the Attribute.

    * + * * @return null|LocalizedString */ public function getLabel() @@ -149,6 +160,7 @@ public function getLabel() /** *

    Set to true if the Attribute is required to have a value on a ProductVariant.

    * + * * @return null|bool */ public function getIsRequired() @@ -168,6 +180,7 @@ public function getIsRequired() /** *

    Specifies how an Attribute or a combination of Attributes should be validated across all variants of a Product.

    * + * * @return null|string */ public function getAttributeConstraint() @@ -187,6 +200,7 @@ public function getAttributeConstraint() /** *

    Provides additional information about the Attribute that aids content managers when setting Product details.

    * + * * @return null|LocalizedString */ public function getInputTip() @@ -207,6 +221,7 @@ public function getInputTip() /** *

    Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).

    * + * * @return null|string */ public function getInputHint() @@ -230,6 +245,7 @@ public function getInputHint() * This constraint is enforced at both Product creation and Product update. * If the length of the input exceeds the maximum size, an InvalidField error is returned.

    * + * * @return null|bool */ public function getIsSearchable() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionModel.php index 1771f9ddba2..0de18dec9bc 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionModel.php @@ -22,41 +22,49 @@ final class AttributeDefinitionModel extends JsonObjectModel implements AttributeDefinition { /** + * * @var ?AttributeType */ protected $type; /** + * * @var ?string */ protected $name; /** + * * @var ?LocalizedString */ protected $label; /** + * * @var ?bool */ protected $isRequired; /** + * * @var ?string */ protected $attributeConstraint; /** + * * @var ?LocalizedString */ protected $inputTip; /** + * * @var ?string */ protected $inputHint; /** + * * @var ?bool */ protected $isSearchable; @@ -88,6 +96,7 @@ public function __construct( /** *

    Describes the Type of the Attribute.

    * + * * @return null|AttributeType */ public function getType() @@ -108,6 +117,7 @@ public function getType() /** *

    User-defined name of the Attribute that is unique within the Project.

    * + * * @return null|string */ public function getName() @@ -127,6 +137,7 @@ public function getName() /** *

    Human-readable label for the Attribute.

    * + * * @return null|LocalizedString */ public function getLabel() @@ -147,6 +158,7 @@ public function getLabel() /** *

    If true, the Attribute must have a value on a ProductVariant.

    * + * * @return null|bool */ public function getIsRequired() @@ -166,6 +178,7 @@ public function getIsRequired() /** *

    Specifies how Attributes are validated across all variants of a Product.

    * + * * @return null|string */ public function getAttributeConstraint() @@ -185,6 +198,7 @@ public function getAttributeConstraint() /** *

    Provides additional Attribute information to aid content managers configure Product details.

    * + * * @return null|LocalizedString */ public function getInputTip() @@ -205,6 +219,7 @@ public function getInputTip() /** *

    Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).

    * + * * @return null|string */ public function getInputHint() @@ -225,9 +240,10 @@ public function getInputHint() *

    If true, the Attribute's values are available for the Product Projections Search API for use in full-text search queries, filters, and facets.

    *

    Which exact features are available with this flag depends on the specific AttributeType. * The maximum size of a searchable field is restricted by the Field content size limit. - * This constraint is enforced at both Product creation and Product update. + * This constraint is enforced at both Product creation and Product update. * If the length of the input exceeds the maximum size, an InvalidFieldError is returned.

    * + * * @return null|bool */ public function getIsSearchable() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeEnumType.php b/lib/commercetools-api/src/Models/ProductType/AttributeEnumType.php index 89e74bfa913..3de25c77708 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeEnumType.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeEnumType.php @@ -18,6 +18,7 @@ interface AttributeEnumType extends AttributeType /** *

    Available values that can be assigned to Products.

    * + * @return null|AttributePlainEnumValueCollection */ public function getValues(); diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeEnumTypeBuilder.php b/lib/commercetools-api/src/Models/ProductType/AttributeEnumTypeBuilder.php index 16389ab03d3..01176d2c7cb 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeEnumTypeBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeEnumTypeBuilder.php @@ -21,6 +21,7 @@ final class AttributeEnumTypeBuilder implements Builder { /** + * @var ?AttributePlainEnumValueCollection */ private $values; @@ -28,6 +29,7 @@ final class AttributeEnumTypeBuilder implements Builder /** *

    Available values that can be assigned to Products.

    * + * @return null|AttributePlainEnumValueCollection */ public function getValues() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeEnumTypeModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeEnumTypeModel.php index ac2f1f2e3cc..3b7a32a9ced 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeEnumTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeEnumTypeModel.php @@ -21,11 +21,13 @@ final class AttributeEnumTypeModel extends JsonObjectModel implements AttributeE { public const DISCRIMINATOR_VALUE = 'enum'; /** + * * @var ?string */ protected $name; /** + * * @var ?AttributePlainEnumValueCollection */ protected $values; @@ -35,13 +37,15 @@ final class AttributeEnumTypeModel extends JsonObjectModel implements AttributeE * @psalm-suppress MissingParamType */ public function __construct( - ?AttributePlainEnumValueCollection $values = null + ?AttributePlainEnumValueCollection $values = null, + ?string $name = null ) { $this->values = $values; - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() @@ -61,6 +65,7 @@ public function getName() /** *

    Available values that can be assigned to Products.

    * + * * @return null|AttributePlainEnumValueCollection */ public function getValues() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeLocalizableTextTypeModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeLocalizableTextTypeModel.php index 5ea56b96fc2..7b12fd74988 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeLocalizableTextTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeLocalizableTextTypeModel.php @@ -21,6 +21,7 @@ final class AttributeLocalizableTextTypeModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'ltext'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class AttributeLocalizableTextTypeModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumType.php b/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumType.php index ce064d10f67..2bbe6d46867 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumType.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumType.php @@ -18,6 +18,7 @@ interface AttributeLocalizedEnumType extends AttributeType /** *

    Available values that can be assigned to Products.

    * + * @return null|AttributeLocalizedEnumValueCollection */ public function getValues(); diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumTypeBuilder.php b/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumTypeBuilder.php index aaef738e8cc..93f8de8222a 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumTypeBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumTypeBuilder.php @@ -21,6 +21,7 @@ final class AttributeLocalizedEnumTypeBuilder implements Builder { /** + * @var ?AttributeLocalizedEnumValueCollection */ private $values; @@ -28,6 +29,7 @@ final class AttributeLocalizedEnumTypeBuilder implements Builder /** *

    Available values that can be assigned to Products.

    * + * @return null|AttributeLocalizedEnumValueCollection */ public function getValues() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumTypeModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumTypeModel.php index ba6d0d59ff4..06ef76d2807 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumTypeModel.php @@ -21,11 +21,13 @@ final class AttributeLocalizedEnumTypeModel extends JsonObjectModel implements A { public const DISCRIMINATOR_VALUE = 'lenum'; /** + * * @var ?string */ protected $name; /** + * * @var ?AttributeLocalizedEnumValueCollection */ protected $values; @@ -35,13 +37,15 @@ final class AttributeLocalizedEnumTypeModel extends JsonObjectModel implements A * @psalm-suppress MissingParamType */ public function __construct( - ?AttributeLocalizedEnumValueCollection $values = null + ?AttributeLocalizedEnumValueCollection $values = null, + ?string $name = null ) { $this->values = $values; - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() @@ -61,6 +65,7 @@ public function getName() /** *

    Available values that can be assigned to Products.

    * + * * @return null|AttributeLocalizedEnumValueCollection */ public function getValues() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumValue.php b/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumValue.php index 4709d802834..7c8b9d72272 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumValue.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumValue.php @@ -20,6 +20,7 @@ interface AttributeLocalizedEnumValue extends JsonObject /** *

    Key of the value used as a programmatic identifier, for example in facets & filters.

    * + * @return null|string */ public function getKey(); @@ -27,6 +28,7 @@ public function getKey(); /** *

    Descriptive, localized label of the value.

    * + * @return null|LocalizedString */ public function getLabel(); diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumValueBuilder.php b/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumValueBuilder.php index d607c72cee5..6e2b32da3ff 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumValueBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumValueBuilder.php @@ -23,11 +23,13 @@ final class AttributeLocalizedEnumValueBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; @@ -35,6 +37,7 @@ final class AttributeLocalizedEnumValueBuilder implements Builder /** *

    Key of the value used as a programmatic identifier, for example in facets & filters.

    * + * @return null|string */ public function getKey() @@ -45,6 +48,7 @@ public function getKey() /** *

    Descriptive, localized label of the value.

    * + * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumValueModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumValueModel.php index 482858bad12..5fbf7005041 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumValueModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeLocalizedEnumValueModel.php @@ -22,11 +22,13 @@ final class AttributeLocalizedEnumValueModel extends JsonObjectModel implements AttributeLocalizedEnumValue { /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $label; @@ -46,6 +48,7 @@ public function __construct( /** *

    Key of the value used as a programmatic identifier, for example in facets & filters.

    * + * * @return null|string */ public function getKey() @@ -65,6 +68,7 @@ public function getKey() /** *

    Descriptive, localized label of the value.

    * + * * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeMoneyTypeModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeMoneyTypeModel.php index b8469b0545b..c53e898e9c8 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeMoneyTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeMoneyTypeModel.php @@ -21,6 +21,7 @@ final class AttributeMoneyTypeModel extends JsonObjectModel implements Attribute { public const DISCRIMINATOR_VALUE = 'money'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class AttributeMoneyTypeModel extends JsonObjectModel implements Attribute * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeNestedType.php b/lib/commercetools-api/src/Models/ProductType/AttributeNestedType.php index e56a0020e2d..4e811ab00a8 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeNestedType.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeNestedType.php @@ -18,6 +18,7 @@ interface AttributeNestedType extends AttributeType /** *

    Attributes that can be stored as nested Attributes of the current Attribute.

    * + * @return null|ProductTypeReference */ public function getTypeReference(); diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeNestedTypeBuilder.php b/lib/commercetools-api/src/Models/ProductType/AttributeNestedTypeBuilder.php index e21745c54f1..d67617e18d7 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeNestedTypeBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeNestedTypeBuilder.php @@ -21,6 +21,7 @@ final class AttributeNestedTypeBuilder implements Builder { /** + * @var null|ProductTypeReference|ProductTypeReferenceBuilder */ private $typeReference; @@ -28,6 +29,7 @@ final class AttributeNestedTypeBuilder implements Builder /** *

    Attributes that can be stored as nested Attributes of the current Attribute.

    * + * @return null|ProductTypeReference */ public function getTypeReference() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeNestedTypeModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeNestedTypeModel.php index b4d0560f603..3f102ce5de6 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeNestedTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeNestedTypeModel.php @@ -21,11 +21,13 @@ final class AttributeNestedTypeModel extends JsonObjectModel implements Attribut { public const DISCRIMINATOR_VALUE = 'nested'; /** + * * @var ?string */ protected $name; /** + * * @var ?ProductTypeReference */ protected $typeReference; @@ -35,13 +37,15 @@ final class AttributeNestedTypeModel extends JsonObjectModel implements Attribut * @psalm-suppress MissingParamType */ public function __construct( - ?ProductTypeReference $typeReference = null + ?ProductTypeReference $typeReference = null, + ?string $name = null ) { $this->typeReference = $typeReference; - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() @@ -61,6 +65,7 @@ public function getName() /** *

    Attributes that can be stored as nested Attributes of the current Attribute.

    * + * * @return null|ProductTypeReference */ public function getTypeReference() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeNumberTypeModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeNumberTypeModel.php index 2be677e1ef8..fc8c827c7f8 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeNumberTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeNumberTypeModel.php @@ -21,6 +21,7 @@ final class AttributeNumberTypeModel extends JsonObjectModel implements Attribut { public const DISCRIMINATOR_VALUE = 'number'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class AttributeNumberTypeModel extends JsonObjectModel implements Attribut * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributePlainEnumValue.php b/lib/commercetools-api/src/Models/ProductType/AttributePlainEnumValue.php index ae87d2f12a7..fcb62b99472 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributePlainEnumValue.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributePlainEnumValue.php @@ -19,6 +19,7 @@ interface AttributePlainEnumValue extends JsonObject /** *

    Key of the value used as a programmatic identifier, for example in facets & filters.

    * + * @return null|string */ public function getKey(); @@ -26,6 +27,7 @@ public function getKey(); /** *

    Descriptive label of the value.

    * + * @return null|string */ public function getLabel(); diff --git a/lib/commercetools-api/src/Models/ProductType/AttributePlainEnumValueBuilder.php b/lib/commercetools-api/src/Models/ProductType/AttributePlainEnumValueBuilder.php index 19d4755ccf5..d8a586e6175 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributePlainEnumValueBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributePlainEnumValueBuilder.php @@ -21,11 +21,13 @@ final class AttributePlainEnumValueBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $label; @@ -33,6 +35,7 @@ final class AttributePlainEnumValueBuilder implements Builder /** *

    Key of the value used as a programmatic identifier, for example in facets & filters.

    * + * @return null|string */ public function getKey() @@ -43,6 +46,7 @@ public function getKey() /** *

    Descriptive label of the value.

    * + * @return null|string */ public function getLabel() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributePlainEnumValueModel.php b/lib/commercetools-api/src/Models/ProductType/AttributePlainEnumValueModel.php index 507c9a46356..e7601e7f488 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributePlainEnumValueModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributePlainEnumValueModel.php @@ -20,11 +20,13 @@ final class AttributePlainEnumValueModel extends JsonObjectModel implements AttributePlainEnumValue { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $label; @@ -44,6 +46,7 @@ public function __construct( /** *

    Key of the value used as a programmatic identifier, for example in facets & filters.

    * + * * @return null|string */ public function getKey() @@ -63,6 +66,7 @@ public function getKey() /** *

    Descriptive label of the value.

    * + * * @return null|string */ public function getLabel() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeReferenceType.php b/lib/commercetools-api/src/Models/ProductType/AttributeReferenceType.php index ee7feddea96..515aac83e8a 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeReferenceType.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeReferenceType.php @@ -18,6 +18,7 @@ interface AttributeReferenceType extends AttributeType /** *

    Name of the resource type that the value should reference.

    * + * @return null|string */ public function getReferenceTypeId(); diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeReferenceTypeBuilder.php b/lib/commercetools-api/src/Models/ProductType/AttributeReferenceTypeBuilder.php index 014e28eded7..68d5839c3e5 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeReferenceTypeBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeReferenceTypeBuilder.php @@ -21,6 +21,7 @@ final class AttributeReferenceTypeBuilder implements Builder { /** + * @var ?string */ private $referenceTypeId; @@ -28,6 +29,7 @@ final class AttributeReferenceTypeBuilder implements Builder /** *

    Name of the resource type that the value should reference.

    * + * @return null|string */ public function getReferenceTypeId() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeReferenceTypeModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeReferenceTypeModel.php index 819000b813e..fb0ec2ceb62 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeReferenceTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeReferenceTypeModel.php @@ -21,11 +21,13 @@ final class AttributeReferenceTypeModel extends JsonObjectModel implements Attri { public const DISCRIMINATOR_VALUE = 'reference'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $referenceTypeId; @@ -35,13 +37,15 @@ final class AttributeReferenceTypeModel extends JsonObjectModel implements Attri * @psalm-suppress MissingParamType */ public function __construct( - ?string $referenceTypeId = null + ?string $referenceTypeId = null, + ?string $name = null ) { $this->referenceTypeId = $referenceTypeId; - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() @@ -61,6 +65,7 @@ public function getName() /** *

    Name of the resource type that the value should reference.

    * + * * @return null|string */ public function getReferenceTypeId() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeSetType.php b/lib/commercetools-api/src/Models/ProductType/AttributeSetType.php index 47018f56394..b73e1fbb8b7 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeSetType.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeSetType.php @@ -18,6 +18,7 @@ interface AttributeSetType extends AttributeType /** *

    Attribute type of the elements in the set.

    * + * @return null|AttributeType */ public function getElementType(); diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeSetTypeBuilder.php b/lib/commercetools-api/src/Models/ProductType/AttributeSetTypeBuilder.php index f4f117a7c12..39695c30cf6 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeSetTypeBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeSetTypeBuilder.php @@ -21,6 +21,7 @@ final class AttributeSetTypeBuilder implements Builder { /** + * @var null|AttributeType|AttributeTypeBuilder */ private $elementType; @@ -28,6 +29,7 @@ final class AttributeSetTypeBuilder implements Builder /** *

    Attribute type of the elements in the set.

    * + * @return null|AttributeType */ public function getElementType() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeSetTypeModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeSetTypeModel.php index 1414770c1f8..ef7535dbaf7 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeSetTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeSetTypeModel.php @@ -21,11 +21,13 @@ final class AttributeSetTypeModel extends JsonObjectModel implements AttributeSe { public const DISCRIMINATOR_VALUE = 'set'; /** + * * @var ?string */ protected $name; /** + * * @var ?AttributeType */ protected $elementType; @@ -35,13 +37,15 @@ final class AttributeSetTypeModel extends JsonObjectModel implements AttributeSe * @psalm-suppress MissingParamType */ public function __construct( - ?AttributeType $elementType = null + ?AttributeType $elementType = null, + ?string $name = null ) { $this->elementType = $elementType; - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() @@ -61,6 +65,7 @@ public function getName() /** *

    Attribute type of the elements in the set.

    * + * * @return null|AttributeType */ public function getElementType() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeTextTypeModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeTextTypeModel.php index 100a0a34e74..9e82c8f76ce 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeTextTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeTextTypeModel.php @@ -21,6 +21,7 @@ final class AttributeTextTypeModel extends JsonObjectModel implements AttributeT { public const DISCRIMINATOR_VALUE = 'text'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class AttributeTextTypeModel extends JsonObjectModel implements AttributeT * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeTimeTypeModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeTimeTypeModel.php index fc661970fe1..b16cd5aaad3 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeTimeTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeTimeTypeModel.php @@ -21,6 +21,7 @@ final class AttributeTimeTypeModel extends JsonObjectModel implements AttributeT { public const DISCRIMINATOR_VALUE = 'time'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class AttributeTimeTypeModel extends JsonObjectModel implements AttributeT * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeType.php b/lib/commercetools-api/src/Models/ProductType/AttributeType.php index 5f3b67d6442..f44dd1691d3 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeType.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeType.php @@ -17,6 +17,7 @@ interface AttributeType extends JsonObject public const FIELD_NAME = 'name'; /** + * @return null|string */ public function getName(); diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeTypeModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeTypeModel.php index 50895bd100c..f81833cec67 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeTypeModel.php @@ -21,6 +21,7 @@ final class AttributeTypeModel extends JsonObjectModel implements AttributeType { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $name; @@ -49,11 +50,13 @@ final class AttributeTypeModel extends JsonObjectModel implements AttributeType * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductType.php b/lib/commercetools-api/src/Models/ProductType/ProductType.php index e093b61810a..be3e1535ade 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductType.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductType.php @@ -27,6 +27,7 @@ interface ProductType extends BaseResource /** *

    Unique identifier of the ProductType.

    * + * @return null|string */ public function getId(); @@ -34,6 +35,7 @@ public function getId(); /** *

    Current version of the ProductType.

    * + * @return null|int */ public function getVersion(); @@ -41,13 +43,15 @@ public function getVersion(); /** *

    Date and time (UTC) the ProductType was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); /** - *

    Date and time (UTC) the Channel was last updated.

    + *

    Date and time (UTC) the ProductType was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -55,6 +59,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -62,6 +67,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -69,6 +75,7 @@ public function getCreatedBy(); /** *

    User-defined unique identifier of the ProductType.

    * + * @return null|string */ public function getKey(); @@ -76,6 +83,7 @@ public function getKey(); /** *

    Name of the ProductType.

    * + * @return null|string */ public function getName(); @@ -83,6 +91,7 @@ public function getName(); /** *

    Description of the ProductType.

    * + * @return null|string */ public function getDescription(); @@ -90,6 +99,7 @@ public function getDescription(); /** *

    Attributes specified for the ProductType.

    * + * @return null|AttributeDefinitionCollection */ public function getAttributes(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddAttributeDefinitionAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddAttributeDefinitionAction.php index f749028c2e4..666a8e1f5fd 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddAttributeDefinitionAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddAttributeDefinitionAction.php @@ -18,6 +18,7 @@ interface ProductTypeAddAttributeDefinitionAction extends ProductTypeUpdateActio /** *

    Value to append to attributes.

    * + * @return null|AttributeDefinitionDraft */ public function getAttribute(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddAttributeDefinitionActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddAttributeDefinitionActionBuilder.php index d7c11fe38a2..47360a8784c 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddAttributeDefinitionActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddAttributeDefinitionActionBuilder.php @@ -21,6 +21,7 @@ final class ProductTypeAddAttributeDefinitionActionBuilder implements Builder { /** + * @var null|AttributeDefinitionDraft|AttributeDefinitionDraftBuilder */ private $attribute; @@ -28,6 +29,7 @@ final class ProductTypeAddAttributeDefinitionActionBuilder implements Builder /** *

    Value to append to attributes.

    * + * @return null|AttributeDefinitionDraft */ public function getAttribute() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddAttributeDefinitionActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddAttributeDefinitionActionModel.php index a6790e31ca2..09dae74ca5c 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddAttributeDefinitionActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddAttributeDefinitionActionModel.php @@ -21,11 +21,13 @@ final class ProductTypeAddAttributeDefinitionActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'addAttributeDefinition'; /** + * * @var ?string */ protected $action; /** + * * @var ?AttributeDefinitionDraft */ protected $attribute; @@ -35,13 +37,15 @@ final class ProductTypeAddAttributeDefinitionActionModel extends JsonObjectModel * @psalm-suppress MissingParamType */ public function __construct( - ?AttributeDefinitionDraft $attribute = null + ?AttributeDefinitionDraft $attribute = null, + ?string $action = null ) { $this->attribute = $attribute; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to append to attributes.

    * + * * @return null|AttributeDefinitionDraft */ public function getAttribute() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddLocalizedEnumValueAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddLocalizedEnumValueAction.php index 98902593811..37c8046ea30 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddLocalizedEnumValueAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddLocalizedEnumValueAction.php @@ -19,6 +19,7 @@ interface ProductTypeAddLocalizedEnumValueAction extends ProductTypeUpdateAction /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName(); @@ -26,6 +27,7 @@ public function getAttributeName(); /** *

    Value to append to the array.

    * + * @return null|AttributeLocalizedEnumValue */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddLocalizedEnumValueActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddLocalizedEnumValueActionBuilder.php index 70bb5fbf0a0..9389017d6b6 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddLocalizedEnumValueActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddLocalizedEnumValueActionBuilder.php @@ -21,11 +21,13 @@ final class ProductTypeAddLocalizedEnumValueActionBuilder implements Builder { /** + * @var ?string */ private $attributeName; /** + * @var null|AttributeLocalizedEnumValue|AttributeLocalizedEnumValueBuilder */ private $value; @@ -33,6 +35,7 @@ final class ProductTypeAddLocalizedEnumValueActionBuilder implements Builder /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName() @@ -43,6 +46,7 @@ public function getAttributeName() /** *

    Value to append to the array.

    * + * @return null|AttributeLocalizedEnumValue */ public function getValue() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddLocalizedEnumValueActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddLocalizedEnumValueActionModel.php index f274c4d74f2..7ec3b27bae6 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddLocalizedEnumValueActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddLocalizedEnumValueActionModel.php @@ -21,16 +21,19 @@ final class ProductTypeAddLocalizedEnumValueActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'addLocalizedEnumValue'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?AttributeLocalizedEnumValue */ protected $value; @@ -41,14 +44,16 @@ final class ProductTypeAddLocalizedEnumValueActionModel extends JsonObjectModel */ public function __construct( ?string $attributeName = null, - ?AttributeLocalizedEnumValue $value = null + ?AttributeLocalizedEnumValue $value = null, + ?string $action = null ) { $this->attributeName = $attributeName; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the AttributeDefinition to update.

    * + * * @return null|string */ public function getAttributeName() @@ -87,6 +93,7 @@ public function getAttributeName() /** *

    Value to append to the array.

    * + * * @return null|AttributeLocalizedEnumValue */ public function getValue() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddPlainEnumValueAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddPlainEnumValueAction.php index 2b950e61714..bc4c9ba0459 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddPlainEnumValueAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddPlainEnumValueAction.php @@ -19,6 +19,7 @@ interface ProductTypeAddPlainEnumValueAction extends ProductTypeUpdateAction /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName(); @@ -26,6 +27,7 @@ public function getAttributeName(); /** *

    Value to append to the array.

    * + * @return null|AttributePlainEnumValue */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddPlainEnumValueActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddPlainEnumValueActionBuilder.php index 819f4c2b5e4..c97682eca22 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddPlainEnumValueActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddPlainEnumValueActionBuilder.php @@ -21,11 +21,13 @@ final class ProductTypeAddPlainEnumValueActionBuilder implements Builder { /** + * @var ?string */ private $attributeName; /** + * @var null|AttributePlainEnumValue|AttributePlainEnumValueBuilder */ private $value; @@ -33,6 +35,7 @@ final class ProductTypeAddPlainEnumValueActionBuilder implements Builder /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName() @@ -43,6 +46,7 @@ public function getAttributeName() /** *

    Value to append to the array.

    * + * @return null|AttributePlainEnumValue */ public function getValue() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddPlainEnumValueActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddPlainEnumValueActionModel.php index ca25c92adb1..da6796505a0 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeAddPlainEnumValueActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeAddPlainEnumValueActionModel.php @@ -21,16 +21,19 @@ final class ProductTypeAddPlainEnumValueActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'addPlainEnumValue'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?AttributePlainEnumValue */ protected $value; @@ -41,14 +44,16 @@ final class ProductTypeAddPlainEnumValueActionModel extends JsonObjectModel impl */ public function __construct( ?string $attributeName = null, - ?AttributePlainEnumValue $value = null + ?AttributePlainEnumValue $value = null, + ?string $action = null ) { $this->attributeName = $attributeName; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the AttributeDefinition to update.

    * + * * @return null|string */ public function getAttributeName() @@ -87,6 +93,7 @@ public function getAttributeName() /** *

    Value to append to the array.

    * + * * @return null|AttributePlainEnumValue */ public function getValue() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeBuilder.php index c5cc36c8aa4..f887d233d5b 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeBuilder.php @@ -28,51 +28,61 @@ final class ProductTypeBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $key; /** + * @var ?string */ private $name; /** + * @var ?string */ private $description; /** + * @var ?AttributeDefinitionCollection */ private $attributes; @@ -80,6 +90,7 @@ final class ProductTypeBuilder implements Builder /** *

    Unique identifier of the ProductType.

    * + * @return null|string */ public function getId() @@ -90,6 +101,7 @@ public function getId() /** *

    Current version of the ProductType.

    * + * @return null|int */ public function getVersion() @@ -100,6 +112,7 @@ public function getVersion() /** *

    Date and time (UTC) the ProductType was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -108,8 +121,9 @@ public function getCreatedAt() } /** - *

    Date and time (UTC) the Channel was last updated.

    + *

    Date and time (UTC) the ProductType was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -120,6 +134,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -130,6 +145,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -140,6 +156,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the ProductType.

    * + * @return null|string */ public function getKey() @@ -150,6 +167,7 @@ public function getKey() /** *

    Name of the ProductType.

    * + * @return null|string */ public function getName() @@ -160,6 +178,7 @@ public function getName() /** *

    Description of the ProductType.

    * + * @return null|string */ public function getDescription() @@ -170,6 +189,7 @@ public function getDescription() /** *

    Attributes specified for the ProductType.

    * + * @return null|AttributeDefinitionCollection */ public function getAttributes() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeConstraintAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeConstraintAction.php index 9f6eb14c790..a877c5e24ba 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeConstraintAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeConstraintAction.php @@ -19,6 +19,7 @@ interface ProductTypeChangeAttributeConstraintAction extends ProductTypeUpdateAc /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName(); @@ -26,6 +27,7 @@ public function getAttributeName(); /** *

    None

    * + * @return null|string */ public function getNewValue(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeConstraintActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeConstraintActionBuilder.php index 82d56cbfa83..95fd441563d 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeConstraintActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeConstraintActionBuilder.php @@ -21,11 +21,13 @@ final class ProductTypeChangeAttributeConstraintActionBuilder implements Builder { /** + * @var ?string */ private $attributeName; /** + * @var ?string */ private $newValue; @@ -33,6 +35,7 @@ final class ProductTypeChangeAttributeConstraintActionBuilder implements Builder /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName() @@ -43,6 +46,7 @@ public function getAttributeName() /** *

    None

    * + * @return null|string */ public function getNewValue() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeConstraintActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeConstraintActionModel.php index 70b09670cc9..45f50891a9d 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeConstraintActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeConstraintActionModel.php @@ -21,16 +21,19 @@ final class ProductTypeChangeAttributeConstraintActionModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'changeAttributeConstraint'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?string */ protected $newValue; @@ -41,14 +44,16 @@ final class ProductTypeChangeAttributeConstraintActionModel extends JsonObjectMo */ public function __construct( ?string $attributeName = null, - ?string $newValue = null + ?string $newValue = null, + ?string $action = null ) { $this->attributeName = $attributeName; $this->newValue = $newValue; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the AttributeDefinition to update.

    * + * * @return null|string */ public function getAttributeName() @@ -87,6 +93,7 @@ public function getAttributeName() /** *

    None

    * + * * @return null|string */ public function getNewValue() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeNameAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeNameAction.php index c51363a9de9..b1ae07831eb 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeNameAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeNameAction.php @@ -19,6 +19,7 @@ interface ProductTypeChangeAttributeNameAction extends ProductTypeUpdateAction /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName(); @@ -28,6 +29,7 @@ public function getAttributeName(); * When using the same name for an Attribute in two or more ProductTypes all fields of the AttributeDefinition of this Attribute need to be the same across the ProductTypes, otherwise an AttributeDefinitionAlreadyExistsError will be returned. * An exception to this are the values of an enum or lenum type and sets thereof.

    * + * @return null|string */ public function getNewAttributeName(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeNameActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeNameActionBuilder.php index b6d6b1a2ce1..30e99373331 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeNameActionBuilder.php @@ -21,11 +21,13 @@ final class ProductTypeChangeAttributeNameActionBuilder implements Builder { /** + * @var ?string */ private $attributeName; /** + * @var ?string */ private $newAttributeName; @@ -33,6 +35,7 @@ final class ProductTypeChangeAttributeNameActionBuilder implements Builder /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName() @@ -45,6 +48,7 @@ public function getAttributeName() * When using the same name for an Attribute in two or more ProductTypes all fields of the AttributeDefinition of this Attribute need to be the same across the ProductTypes, otherwise an AttributeDefinitionAlreadyExistsError will be returned. * An exception to this are the values of an enum or lenum type and sets thereof.

    * + * @return null|string */ public function getNewAttributeName() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeNameActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeNameActionModel.php index 61e47c4d2f8..49981afa3d1 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeNameActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeNameActionModel.php @@ -21,16 +21,19 @@ final class ProductTypeChangeAttributeNameActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'changeAttributeName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?string */ protected $newAttributeName; @@ -41,14 +44,16 @@ final class ProductTypeChangeAttributeNameActionModel extends JsonObjectModel im */ public function __construct( ?string $attributeName = null, - ?string $newAttributeName = null + ?string $newAttributeName = null, + ?string $action = null ) { $this->attributeName = $attributeName; $this->newAttributeName = $newAttributeName; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the AttributeDefinition to update.

    * + * * @return null|string */ public function getAttributeName() @@ -89,6 +95,7 @@ public function getAttributeName() * When using the same name for an Attribute in two or more ProductTypes all fields of the AttributeDefinition of this Attribute need to be the same across the ProductTypes, otherwise an AttributeDefinitionAlreadyExistsError will be returned. * An exception to this are the values of an enum or lenum type and sets thereof.

    * + * * @return null|string */ public function getNewAttributeName() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeOrderByNameAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeOrderByNameAction.php index be12b9e20b4..ea553d768c7 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeOrderByNameAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeOrderByNameAction.php @@ -18,6 +18,7 @@ interface ProductTypeChangeAttributeOrderByNameAction extends ProductTypeUpdateA /** *

    Names of Attributes to reorder. This array must include all Attributes currently present on a ProductType in a different order.

    * + * @return null|array */ public function getAttributeNames(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeOrderByNameActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeOrderByNameActionBuilder.php index d8b7db80bfa..eeef0610928 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeOrderByNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeOrderByNameActionBuilder.php @@ -21,6 +21,7 @@ final class ProductTypeChangeAttributeOrderByNameActionBuilder implements Builder { /** + * @var ?array */ private $attributeNames; @@ -28,6 +29,7 @@ final class ProductTypeChangeAttributeOrderByNameActionBuilder implements Builde /** *

    Names of Attributes to reorder. This array must include all Attributes currently present on a ProductType in a different order.

    * + * @return null|array */ public function getAttributeNames() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeOrderByNameActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeOrderByNameActionModel.php index 0ca24cf082e..1e9d52ad92c 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeOrderByNameActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeAttributeOrderByNameActionModel.php @@ -21,11 +21,13 @@ final class ProductTypeChangeAttributeOrderByNameActionModel extends JsonObjectM { public const DISCRIMINATOR_VALUE = 'changeAttributeOrderByName'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $attributeNames; @@ -35,13 +37,15 @@ final class ProductTypeChangeAttributeOrderByNameActionModel extends JsonObjectM * @psalm-suppress MissingParamType */ public function __construct( - ?array $attributeNames = null + ?array $attributeNames = null, + ?string $action = null ) { $this->attributeNames = $attributeNames; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Names of Attributes to reorder. This array must include all Attributes currently present on a ProductType in a different order.

    * + * * @return null|array */ public function getAttributeNames() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeDescriptionAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeDescriptionAction.php index 64d8d8fd050..2e816023d8b 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeDescriptionAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeDescriptionAction.php @@ -18,6 +18,7 @@ interface ProductTypeChangeDescriptionAction extends ProductTypeUpdateAction /** *

    New value to set.

    * + * @return null|string */ public function getDescription(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeDescriptionActionBuilder.php index 1eeb562eb3d..a83429c7742 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeDescriptionActionBuilder.php @@ -21,6 +21,7 @@ final class ProductTypeChangeDescriptionActionBuilder implements Builder { /** + * @var ?string */ private $description; @@ -28,6 +29,7 @@ final class ProductTypeChangeDescriptionActionBuilder implements Builder /** *

    New value to set.

    * + * @return null|string */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeDescriptionActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeDescriptionActionModel.php index 7c231db8951..067455ff8d5 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeDescriptionActionModel.php @@ -21,11 +21,13 @@ final class ProductTypeChangeDescriptionActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'changeDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $description; @@ -35,13 +37,15 @@ final class ProductTypeChangeDescriptionActionModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?string $description = null + ?string $description = null, + ?string $action = null ) { $this->description = $description; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    New value to set.

    * + * * @return null|string */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeEnumKeyAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeEnumKeyAction.php index 5a479320298..f3a99ca2f0a 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeEnumKeyAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeEnumKeyAction.php @@ -20,6 +20,7 @@ interface ProductTypeChangeEnumKeyAction extends ProductTypeUpdateAction /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName(); @@ -27,6 +28,7 @@ public function getAttributeName(); /** *

    Existing key to be changed.

    * + * @return null|string */ public function getKey(); @@ -34,6 +36,7 @@ public function getKey(); /** *

    New key to be set.

    * + * @return null|string */ public function getNewKey(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeEnumKeyActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeEnumKeyActionBuilder.php index 805cc006e28..f10aedc5d57 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeEnumKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeEnumKeyActionBuilder.php @@ -21,16 +21,19 @@ final class ProductTypeChangeEnumKeyActionBuilder implements Builder { /** + * @var ?string */ private $attributeName; /** + * @var ?string */ private $key; /** + * @var ?string */ private $newKey; @@ -38,6 +41,7 @@ final class ProductTypeChangeEnumKeyActionBuilder implements Builder /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName() @@ -48,6 +52,7 @@ public function getAttributeName() /** *

    Existing key to be changed.

    * + * @return null|string */ public function getKey() @@ -58,6 +63,7 @@ public function getKey() /** *

    New key to be set.

    * + * @return null|string */ public function getNewKey() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeEnumKeyActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeEnumKeyActionModel.php index 8c89c267a0a..9e7de73f8c3 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeEnumKeyActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeEnumKeyActionModel.php @@ -21,21 +21,25 @@ final class ProductTypeChangeEnumKeyActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'changeEnumKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $newKey; @@ -47,15 +51,17 @@ final class ProductTypeChangeEnumKeyActionModel extends JsonObjectModel implemen public function __construct( ?string $attributeName = null, ?string $key = null, - ?string $newKey = null + ?string $newKey = null, + ?string $action = null ) { $this->attributeName = $attributeName; $this->key = $key; $this->newKey = $newKey; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -75,6 +81,7 @@ public function getAction() /** *

    Name of the AttributeDefinition to update.

    * + * * @return null|string */ public function getAttributeName() @@ -94,6 +101,7 @@ public function getAttributeName() /** *

    Existing key to be changed.

    * + * * @return null|string */ public function getKey() @@ -113,6 +121,7 @@ public function getKey() /** *

    New key to be set.

    * + * * @return null|string */ public function getNewKey() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeInputHintAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeInputHintAction.php index bbe55362ac6..649814337b7 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeInputHintAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeInputHintAction.php @@ -19,6 +19,7 @@ interface ProductTypeChangeInputHintAction extends ProductTypeUpdateAction /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName(); @@ -26,6 +27,7 @@ public function getAttributeName(); /** *

    SingleLine or MultiLine

    * + * @return null|string */ public function getNewValue(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeInputHintActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeInputHintActionBuilder.php index c994bb1ecb0..36933fdb919 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeInputHintActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeInputHintActionBuilder.php @@ -21,11 +21,13 @@ final class ProductTypeChangeInputHintActionBuilder implements Builder { /** + * @var ?string */ private $attributeName; /** + * @var ?string */ private $newValue; @@ -33,6 +35,7 @@ final class ProductTypeChangeInputHintActionBuilder implements Builder /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName() @@ -43,6 +46,7 @@ public function getAttributeName() /** *

    SingleLine or MultiLine

    * + * @return null|string */ public function getNewValue() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeInputHintActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeInputHintActionModel.php index be783ae511d..a02075b95f2 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeInputHintActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeInputHintActionModel.php @@ -21,16 +21,19 @@ final class ProductTypeChangeInputHintActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'changeInputHint'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?string */ protected $newValue; @@ -41,14 +44,16 @@ final class ProductTypeChangeInputHintActionModel extends JsonObjectModel implem */ public function __construct( ?string $attributeName = null, - ?string $newValue = null + ?string $newValue = null, + ?string $action = null ) { $this->attributeName = $attributeName; $this->newValue = $newValue; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the AttributeDefinition to update.

    * + * * @return null|string */ public function getAttributeName() @@ -87,6 +93,7 @@ public function getAttributeName() /** *

    SingleLine or MultiLine

    * + * * @return null|string */ public function getNewValue() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeIsSearchableAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeIsSearchableAction.php index 33efe7cb182..2c4efea9bd6 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeIsSearchableAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeIsSearchableAction.php @@ -19,6 +19,7 @@ interface ProductTypeChangeIsSearchableAction extends ProductTypeUpdateAction /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName(); @@ -26,6 +27,7 @@ public function getAttributeName(); /** *

    Determines whether the Attribute's values can be used in full-text search queries, filters, and facets. See AttributeDefinition for details.

    * + * @return null|bool */ public function getIsSearchable(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeIsSearchableActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeIsSearchableActionBuilder.php index 9a6a444a9b6..45d717e17e8 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeIsSearchableActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeIsSearchableActionBuilder.php @@ -21,11 +21,13 @@ final class ProductTypeChangeIsSearchableActionBuilder implements Builder { /** + * @var ?string */ private $attributeName; /** + * @var ?bool */ private $isSearchable; @@ -33,6 +35,7 @@ final class ProductTypeChangeIsSearchableActionBuilder implements Builder /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName() @@ -43,6 +46,7 @@ public function getAttributeName() /** *

    Determines whether the Attribute's values can be used in full-text search queries, filters, and facets. See AttributeDefinition for details.

    * + * @return null|bool */ public function getIsSearchable() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeIsSearchableActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeIsSearchableActionModel.php index c67f3620013..990f957dbed 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeIsSearchableActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeIsSearchableActionModel.php @@ -21,16 +21,19 @@ final class ProductTypeChangeIsSearchableActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'changeIsSearchable'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?bool */ protected $isSearchable; @@ -41,14 +44,16 @@ final class ProductTypeChangeIsSearchableActionModel extends JsonObjectModel imp */ public function __construct( ?string $attributeName = null, - ?bool $isSearchable = null + ?bool $isSearchable = null, + ?string $action = null ) { $this->attributeName = $attributeName; $this->isSearchable = $isSearchable; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the AttributeDefinition to update.

    * + * * @return null|string */ public function getAttributeName() @@ -87,6 +93,7 @@ public function getAttributeName() /** *

    Determines whether the Attribute's values can be used in full-text search queries, filters, and facets. See AttributeDefinition for details.

    * + * * @return null|bool */ public function getIsSearchable() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLabelAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLabelAction.php index 5206e67d845..305613bda20 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLabelAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLabelAction.php @@ -20,6 +20,7 @@ interface ProductTypeChangeLabelAction extends ProductTypeUpdateAction /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName(); @@ -27,6 +28,7 @@ public function getAttributeName(); /** *

    New value to set. Must not be empty.

    * + * @return null|LocalizedString */ public function getLabel(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLabelActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLabelActionBuilder.php index 978ee5c40c4..fe91b799acb 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLabelActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLabelActionBuilder.php @@ -23,11 +23,13 @@ final class ProductTypeChangeLabelActionBuilder implements Builder { /** + * @var ?string */ private $attributeName; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; @@ -35,6 +37,7 @@ final class ProductTypeChangeLabelActionBuilder implements Builder /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName() @@ -45,6 +48,7 @@ public function getAttributeName() /** *

    New value to set. Must not be empty.

    * + * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLabelActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLabelActionModel.php index 0a40f1a74ac..80e5277d9ce 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLabelActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLabelActionModel.php @@ -23,16 +23,19 @@ final class ProductTypeChangeLabelActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'changeLabel'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?LocalizedString */ protected $label; @@ -43,14 +46,16 @@ final class ProductTypeChangeLabelActionModel extends JsonObjectModel implements */ public function __construct( ?string $attributeName = null, - ?LocalizedString $label = null + ?LocalizedString $label = null, + ?string $action = null ) { $this->attributeName = $attributeName; $this->label = $label; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() /** *

    Name of the AttributeDefinition to update.

    * + * * @return null|string */ public function getAttributeName() @@ -89,6 +95,7 @@ public function getAttributeName() /** *

    New value to set. Must not be empty.

    * + * * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueLabelAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueLabelAction.php index 83654a3b36e..f62ddf85d77 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueLabelAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueLabelAction.php @@ -19,6 +19,7 @@ interface ProductTypeChangeLocalizedEnumValueLabelAction extends ProductTypeUpda /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName(); @@ -26,6 +27,7 @@ public function getAttributeName(); /** *

    New value to set. Must be different from the existing value.

    * + * @return null|AttributeLocalizedEnumValue */ public function getNewValue(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueLabelActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueLabelActionBuilder.php index c09465cdbf4..23a8441435b 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueLabelActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueLabelActionBuilder.php @@ -21,11 +21,13 @@ final class ProductTypeChangeLocalizedEnumValueLabelActionBuilder implements Builder { /** + * @var ?string */ private $attributeName; /** + * @var null|AttributeLocalizedEnumValue|AttributeLocalizedEnumValueBuilder */ private $newValue; @@ -33,6 +35,7 @@ final class ProductTypeChangeLocalizedEnumValueLabelActionBuilder implements Bui /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName() @@ -43,6 +46,7 @@ public function getAttributeName() /** *

    New value to set. Must be different from the existing value.

    * + * @return null|AttributeLocalizedEnumValue */ public function getNewValue() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueLabelActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueLabelActionModel.php index ce8c417c6e3..089371bc15e 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueLabelActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueLabelActionModel.php @@ -21,16 +21,19 @@ final class ProductTypeChangeLocalizedEnumValueLabelActionModel extends JsonObje { public const DISCRIMINATOR_VALUE = 'changeLocalizedEnumValueLabel'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?AttributeLocalizedEnumValue */ protected $newValue; @@ -41,14 +44,16 @@ final class ProductTypeChangeLocalizedEnumValueLabelActionModel extends JsonObje */ public function __construct( ?string $attributeName = null, - ?AttributeLocalizedEnumValue $newValue = null + ?AttributeLocalizedEnumValue $newValue = null, + ?string $action = null ) { $this->attributeName = $attributeName; $this->newValue = $newValue; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the AttributeDefinition to update.

    * + * * @return null|string */ public function getAttributeName() @@ -87,6 +93,7 @@ public function getAttributeName() /** *

    New value to set. Must be different from the existing value.

    * + * * @return null|AttributeLocalizedEnumValue */ public function getNewValue() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueOrderAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueOrderAction.php index d82a53262b8..c362865bcfd 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueOrderAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueOrderAction.php @@ -19,6 +19,7 @@ interface ProductTypeChangeLocalizedEnumValueOrderAction extends ProductTypeUpda /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName(); @@ -26,6 +27,7 @@ public function getAttributeName(); /** *

    Values must be equal to the values of the Attribute enum values (except for the order). If not, an EnumValuesMustMatch error code will be returned.

    * + * @return null|AttributeLocalizedEnumValueCollection */ public function getValues(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueOrderActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueOrderActionBuilder.php index 3eb85f005be..f7e68091fb7 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueOrderActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueOrderActionBuilder.php @@ -21,11 +21,13 @@ final class ProductTypeChangeLocalizedEnumValueOrderActionBuilder implements Builder { /** + * @var ?string */ private $attributeName; /** + * @var ?AttributeLocalizedEnumValueCollection */ private $values; @@ -33,6 +35,7 @@ final class ProductTypeChangeLocalizedEnumValueOrderActionBuilder implements Bui /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName() @@ -43,6 +46,7 @@ public function getAttributeName() /** *

    Values must be equal to the values of the Attribute enum values (except for the order). If not, an EnumValuesMustMatch error code will be returned.

    * + * @return null|AttributeLocalizedEnumValueCollection */ public function getValues() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueOrderActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueOrderActionModel.php index 94b0bfbc4da..2fb5d2a45e8 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueOrderActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeLocalizedEnumValueOrderActionModel.php @@ -21,16 +21,19 @@ final class ProductTypeChangeLocalizedEnumValueOrderActionModel extends JsonObje { public const DISCRIMINATOR_VALUE = 'changeLocalizedEnumValueOrder'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?AttributeLocalizedEnumValueCollection */ protected $values; @@ -41,14 +44,16 @@ final class ProductTypeChangeLocalizedEnumValueOrderActionModel extends JsonObje */ public function __construct( ?string $attributeName = null, - ?AttributeLocalizedEnumValueCollection $values = null + ?AttributeLocalizedEnumValueCollection $values = null, + ?string $action = null ) { $this->attributeName = $attributeName; $this->values = $values; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the AttributeDefinition to update.

    * + * * @return null|string */ public function getAttributeName() @@ -87,6 +93,7 @@ public function getAttributeName() /** *

    Values must be equal to the values of the Attribute enum values (except for the order). If not, an EnumValuesMustMatch error code will be returned.

    * + * * @return null|AttributeLocalizedEnumValueCollection */ public function getValues() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeNameAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeNameAction.php index 3d845a94b56..4d2a1766077 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeNameAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeNameAction.php @@ -18,6 +18,7 @@ interface ProductTypeChangeNameAction extends ProductTypeUpdateAction /** *

    New value to set.

    * + * @return null|string */ public function getName(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeNameActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeNameActionBuilder.php index f07ae250480..86d29fd9b93 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeNameActionBuilder.php @@ -21,6 +21,7 @@ final class ProductTypeChangeNameActionBuilder implements Builder { /** + * @var ?string */ private $name; @@ -28,6 +29,7 @@ final class ProductTypeChangeNameActionBuilder implements Builder /** *

    New value to set.

    * + * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeNameActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeNameActionModel.php index 6b20b064d20..dc8c5d5fdda 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeNameActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangeNameActionModel.php @@ -21,11 +21,13 @@ final class ProductTypeChangeNameActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'changeName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; @@ -35,13 +37,15 @@ final class ProductTypeChangeNameActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $name = null + ?string $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    New value to set.

    * + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueLabelAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueLabelAction.php index 514c97be435..cf6c0c39f23 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueLabelAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueLabelAction.php @@ -19,6 +19,7 @@ interface ProductTypeChangePlainEnumValueLabelAction extends ProductTypeUpdateAc /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName(); @@ -26,6 +27,7 @@ public function getAttributeName(); /** *

    New value to set. Must be different from the existing value.

    * + * @return null|AttributePlainEnumValue */ public function getNewValue(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueLabelActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueLabelActionBuilder.php index 76e54511bde..26d134bd970 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueLabelActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueLabelActionBuilder.php @@ -21,11 +21,13 @@ final class ProductTypeChangePlainEnumValueLabelActionBuilder implements Builder { /** + * @var ?string */ private $attributeName; /** + * @var null|AttributePlainEnumValue|AttributePlainEnumValueBuilder */ private $newValue; @@ -33,6 +35,7 @@ final class ProductTypeChangePlainEnumValueLabelActionBuilder implements Builder /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName() @@ -43,6 +46,7 @@ public function getAttributeName() /** *

    New value to set. Must be different from the existing value.

    * + * @return null|AttributePlainEnumValue */ public function getNewValue() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueLabelActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueLabelActionModel.php index 68b9967c47d..e662e954ead 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueLabelActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueLabelActionModel.php @@ -21,16 +21,19 @@ final class ProductTypeChangePlainEnumValueLabelActionModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'changePlainEnumValueLabel'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?AttributePlainEnumValue */ protected $newValue; @@ -41,14 +44,16 @@ final class ProductTypeChangePlainEnumValueLabelActionModel extends JsonObjectMo */ public function __construct( ?string $attributeName = null, - ?AttributePlainEnumValue $newValue = null + ?AttributePlainEnumValue $newValue = null, + ?string $action = null ) { $this->attributeName = $attributeName; $this->newValue = $newValue; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the AttributeDefinition to update.

    * + * * @return null|string */ public function getAttributeName() @@ -87,6 +93,7 @@ public function getAttributeName() /** *

    New value to set. Must be different from the existing value.

    * + * * @return null|AttributePlainEnumValue */ public function getNewValue() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueOrderAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueOrderAction.php index b1ec096cdee..085454e9619 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueOrderAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueOrderAction.php @@ -19,6 +19,7 @@ interface ProductTypeChangePlainEnumValueOrderAction extends ProductTypeUpdateAc /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName(); @@ -26,6 +27,7 @@ public function getAttributeName(); /** *

    Values must be equal to the values of the Attribute enum values (except for the order). If not, an EnumValuesMustMatch error code will be returned.

    * + * @return null|AttributePlainEnumValueCollection */ public function getValues(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueOrderActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueOrderActionBuilder.php index ca561f31fdd..9204df48569 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueOrderActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueOrderActionBuilder.php @@ -21,11 +21,13 @@ final class ProductTypeChangePlainEnumValueOrderActionBuilder implements Builder { /** + * @var ?string */ private $attributeName; /** + * @var ?AttributePlainEnumValueCollection */ private $values; @@ -33,6 +35,7 @@ final class ProductTypeChangePlainEnumValueOrderActionBuilder implements Builder /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName() @@ -43,6 +46,7 @@ public function getAttributeName() /** *

    Values must be equal to the values of the Attribute enum values (except for the order). If not, an EnumValuesMustMatch error code will be returned.

    * + * @return null|AttributePlainEnumValueCollection */ public function getValues() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueOrderActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueOrderActionModel.php index fd366d49b92..1dfc65f10de 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueOrderActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeChangePlainEnumValueOrderActionModel.php @@ -21,16 +21,19 @@ final class ProductTypeChangePlainEnumValueOrderActionModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'changePlainEnumValueOrder'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?AttributePlainEnumValueCollection */ protected $values; @@ -41,14 +44,16 @@ final class ProductTypeChangePlainEnumValueOrderActionModel extends JsonObjectMo */ public function __construct( ?string $attributeName = null, - ?AttributePlainEnumValueCollection $values = null + ?AttributePlainEnumValueCollection $values = null, + ?string $action = null ) { $this->attributeName = $attributeName; $this->values = $values; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the AttributeDefinition to update.

    * + * * @return null|string */ public function getAttributeName() @@ -87,6 +93,7 @@ public function getAttributeName() /** *

    Values must be equal to the values of the Attribute enum values (except for the order). If not, an EnumValuesMustMatch error code will be returned.

    * + * * @return null|AttributePlainEnumValueCollection */ public function getValues() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeDraft.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeDraft.php index f75bf9d304f..6d05001997f 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeDraft.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeDraft.php @@ -21,6 +21,7 @@ interface ProductTypeDraft extends JsonObject /** *

    User-defined unique identifier for the ProductType.

    * + * @return null|string */ public function getKey(); @@ -28,6 +29,7 @@ public function getKey(); /** *

    Name of the ProductType.

    * + * @return null|string */ public function getName(); @@ -35,6 +37,7 @@ public function getName(); /** *

    Description of the ProductType.

    * + * @return null|string */ public function getDescription(); @@ -42,6 +45,7 @@ public function getDescription(); /** *

    Attributes to specify for the ProductType. Products of this ProductType have these Attributes available on their ProductVariants.

    * + * @return null|AttributeDefinitionDraftCollection */ public function getAttributes(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeDraftBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeDraftBuilder.php index 2f9197a6bbb..e5fc3b92c76 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeDraftBuilder.php @@ -21,21 +21,25 @@ final class ProductTypeDraftBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $name; /** + * @var ?string */ private $description; /** + * @var ?AttributeDefinitionDraftCollection */ private $attributes; @@ -43,6 +47,7 @@ final class ProductTypeDraftBuilder implements Builder /** *

    User-defined unique identifier for the ProductType.

    * + * @return null|string */ public function getKey() @@ -53,6 +58,7 @@ public function getKey() /** *

    Name of the ProductType.

    * + * @return null|string */ public function getName() @@ -63,6 +69,7 @@ public function getName() /** *

    Description of the ProductType.

    * + * @return null|string */ public function getDescription() @@ -73,6 +80,7 @@ public function getDescription() /** *

    Attributes to specify for the ProductType. Products of this ProductType have these Attributes available on their ProductVariants.

    * + * @return null|AttributeDefinitionDraftCollection */ public function getAttributes() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeDraftModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeDraftModel.php index 2a69161c8f8..94960d08492 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeDraftModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeDraftModel.php @@ -20,21 +20,25 @@ final class ProductTypeDraftModel extends JsonObjectModel implements ProductTypeDraft { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $description; /** + * * @var ?AttributeDefinitionDraftCollection */ protected $attributes; @@ -58,6 +62,7 @@ public function __construct( /** *

    User-defined unique identifier for the ProductType.

    * + * * @return null|string */ public function getKey() @@ -77,6 +82,7 @@ public function getKey() /** *

    Name of the ProductType.

    * + * * @return null|string */ public function getName() @@ -96,6 +102,7 @@ public function getName() /** *

    Description of the ProductType.

    * + * * @return null|string */ public function getDescription() @@ -115,6 +122,7 @@ public function getDescription() /** *

    Attributes to specify for the ProductType. Products of this ProductType have these Attributes available on their ProductVariants.

    * + * * @return null|AttributeDefinitionDraftCollection */ public function getAttributes() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeModel.php index d05fa264249..57136b1f1a0 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeModel.php @@ -27,51 +27,61 @@ final class ProductTypeModel extends JsonObjectModel implements ProductType { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $description; /** + * * @var ?AttributeDefinitionCollection */ protected $attributes; @@ -107,6 +117,7 @@ public function __construct( /** *

    Unique identifier of the ProductType.

    * + * * @return null|string */ public function getId() @@ -126,6 +137,7 @@ public function getId() /** *

    Current version of the ProductType.

    * + * * @return null|int */ public function getVersion() @@ -145,6 +157,7 @@ public function getVersion() /** *

    Date and time (UTC) the ProductType was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -166,7 +179,8 @@ public function getCreatedAt() } /** - *

    Date and time (UTC) the Channel was last updated.

    + *

    Date and time (UTC) the ProductType was last updated.

    + * * * @return null|DateTimeImmutable */ @@ -191,6 +205,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -211,6 +226,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -231,6 +247,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the ProductType.

    * + * * @return null|string */ public function getKey() @@ -250,6 +267,7 @@ public function getKey() /** *

    Name of the ProductType.

    * + * * @return null|string */ public function getName() @@ -269,6 +287,7 @@ public function getName() /** *

    Description of the ProductType.

    * + * * @return null|string */ public function getDescription() @@ -288,6 +307,7 @@ public function getDescription() /** *

    Attributes specified for the ProductType.

    * + * * @return null|AttributeDefinitionCollection */ public function getAttributes() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypePagedQueryResponse.php b/lib/commercetools-api/src/Models/ProductType/ProductTypePagedQueryResponse.php index 0b05c2bc2df..0722f991b2a 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypePagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypePagedQueryResponse.php @@ -22,6 +22,7 @@ interface ProductTypePagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    ProductTypes matching the query.

    * + * @return null|ProductTypeCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypePagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypePagedQueryResponseBuilder.php index f00324ed078..427192c85f5 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypePagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypePagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class ProductTypePagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?ProductTypeCollection */ private $results; @@ -48,6 +53,7 @@ final class ProductTypePagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    ProductTypes matching the query.

    * + * @return null|ProductTypeCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypePagedQueryResponseModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypePagedQueryResponseModel.php index 3cf17d85a73..4a3fb2ae93f 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypePagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypePagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class ProductTypePagedQueryResponseModel extends JsonObjectModel implements ProductTypePagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?ProductTypeCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    ProductTypes matching the query.

    * + * * @return null|ProductTypeCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeReference.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeReference.php index 05c6e4f9d34..4d1215ca790 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeReference.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeReference.php @@ -19,6 +19,7 @@ interface ProductTypeReference extends Reference /** *

    Contains the representation of the expanded ProductType. Only present in responses to requests with Reference Expansion for ProductTypes.

    * + * @return null|ProductType */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

    Unique identifier of the referenced ProductType.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeReferenceBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeReferenceBuilder.php index 8ee22e303c3..ea29bb63314 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeReferenceBuilder.php @@ -23,11 +23,13 @@ final class ProductTypeReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|ProductType|ProductTypeBuilder */ private $obj; @@ -35,6 +37,7 @@ final class ProductTypeReferenceBuilder implements Builder /** *

    Unique identifier of the referenced ProductType.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded ProductType. Only present in responses to requests with Reference Expansion for ProductTypes.

    * + * @return null|ProductType */ public function getObj() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeReferenceModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeReferenceModel.php index f68d5bbe8cc..b543d8edb94 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeReferenceModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeReferenceModel.php @@ -23,16 +23,19 @@ final class ProductTypeReferenceModel extends JsonObjectModel implements Product { public const DISCRIMINATOR_VALUE = 'product-type'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?ProductType */ protected $obj; @@ -43,16 +46,18 @@ final class ProductTypeReferenceModel extends JsonObjectModel implements Product */ public function __construct( ?string $id = null, - ?ProductType $obj = null + ?ProductType $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced ProductType.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded ProductType. Only present in responses to requests with Reference Expansion for ProductTypes.

    * + * * @return null|ProductType */ public function getObj() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveAttributeDefinitionAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveAttributeDefinitionAction.php index d505c85a1dc..457993002ab 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveAttributeDefinitionAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveAttributeDefinitionAction.php @@ -18,6 +18,7 @@ interface ProductTypeRemoveAttributeDefinitionAction extends ProductTypeUpdateAc /** *

    Name of the Attribute to remove.

    * + * @return null|string */ public function getName(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveAttributeDefinitionActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveAttributeDefinitionActionBuilder.php index ba9c7a396a3..2f7e9ced330 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveAttributeDefinitionActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveAttributeDefinitionActionBuilder.php @@ -21,6 +21,7 @@ final class ProductTypeRemoveAttributeDefinitionActionBuilder implements Builder { /** + * @var ?string */ private $name; @@ -28,6 +29,7 @@ final class ProductTypeRemoveAttributeDefinitionActionBuilder implements Builder /** *

    Name of the Attribute to remove.

    * + * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveAttributeDefinitionActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveAttributeDefinitionActionModel.php index 48a0c67a92b..0ce843d1e17 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveAttributeDefinitionActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveAttributeDefinitionActionModel.php @@ -21,11 +21,13 @@ final class ProductTypeRemoveAttributeDefinitionActionModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'removeAttributeDefinition'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; @@ -35,13 +37,15 @@ final class ProductTypeRemoveAttributeDefinitionActionModel extends JsonObjectMo * @psalm-suppress MissingParamType */ public function __construct( - ?string $name = null + ?string $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Name of the Attribute to remove.

    * + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveEnumValuesAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveEnumValuesAction.php index 381118ccfd6..b1b6de6331c 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveEnumValuesAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveEnumValuesAction.php @@ -19,6 +19,7 @@ interface ProductTypeRemoveEnumValuesAction extends ProductTypeUpdateAction /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName(); @@ -26,6 +27,7 @@ public function getAttributeName(); /** *

    Keys of AttributeEnumType or AttributeLocalizedEnumType to remove.

    * + * @return null|array */ public function getKeys(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveEnumValuesActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveEnumValuesActionBuilder.php index 7a8423747d6..9dba6d8888f 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveEnumValuesActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveEnumValuesActionBuilder.php @@ -21,11 +21,13 @@ final class ProductTypeRemoveEnumValuesActionBuilder implements Builder { /** + * @var ?string */ private $attributeName; /** + * @var ?array */ private $keys; @@ -33,6 +35,7 @@ final class ProductTypeRemoveEnumValuesActionBuilder implements Builder /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName() @@ -43,6 +46,7 @@ public function getAttributeName() /** *

    Keys of AttributeEnumType or AttributeLocalizedEnumType to remove.

    * + * @return null|array */ public function getKeys() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveEnumValuesActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveEnumValuesActionModel.php index 92112503da6..f7763a3dab1 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveEnumValuesActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeRemoveEnumValuesActionModel.php @@ -21,16 +21,19 @@ final class ProductTypeRemoveEnumValuesActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'removeEnumValues'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?array */ protected $keys; @@ -41,14 +44,16 @@ final class ProductTypeRemoveEnumValuesActionModel extends JsonObjectModel imple */ public function __construct( ?string $attributeName = null, - ?array $keys = null + ?array $keys = null, + ?string $action = null ) { $this->attributeName = $attributeName; $this->keys = $keys; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the AttributeDefinition to update.

    * + * * @return null|string */ public function getAttributeName() @@ -87,6 +93,7 @@ public function getAttributeName() /** *

    Keys of AttributeEnumType or AttributeLocalizedEnumType to remove.

    * + * * @return null|array */ public function getKeys() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeResourceIdentifier.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeResourceIdentifier.php index a00cf84f7e6..1d8e9726f0e 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeResourceIdentifier.php @@ -17,6 +17,7 @@ interface ProductTypeResourceIdentifier extends ResourceIdentifier /** *

    Unique identifier of the referenced ProductType. Either id or key is required.

    * + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

    User-defined unique identifier of the referenced ProductType. Either id or key is required.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeResourceIdentifierBuilder.php index 7a8f3464fac..6eb50ecab13 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class ProductTypeResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class ProductTypeResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced ProductType. Either id or key is required.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced ProductType. Either id or key is required.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeResourceIdentifierModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeResourceIdentifierModel.php index f76bc9b117d..7545732cc08 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class ProductTypeResourceIdentifierModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'product-type'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class ProductTypeResourceIdentifierModel extends JsonObjectModel implement */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced ProductType. Either id or key is required.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced ProductType. Either id or key is required.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeSetInputTipAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeSetInputTipAction.php index 1e722d61029..4162021fda6 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeSetInputTipAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeSetInputTipAction.php @@ -20,6 +20,7 @@ interface ProductTypeSetInputTipAction extends ProductTypeUpdateAction /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName(); @@ -27,6 +28,7 @@ public function getAttributeName(); /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getInputTip(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeSetInputTipActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeSetInputTipActionBuilder.php index 7fd50f28f49..86f6ba95b96 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeSetInputTipActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeSetInputTipActionBuilder.php @@ -23,11 +23,13 @@ final class ProductTypeSetInputTipActionBuilder implements Builder { /** + * @var ?string */ private $attributeName; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $inputTip; @@ -35,6 +37,7 @@ final class ProductTypeSetInputTipActionBuilder implements Builder /** *

    Name of the AttributeDefinition to update.

    * + * @return null|string */ public function getAttributeName() @@ -45,6 +48,7 @@ public function getAttributeName() /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getInputTip() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeSetInputTipActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeSetInputTipActionModel.php index 30476df4669..fc1048950b4 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeSetInputTipActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeSetInputTipActionModel.php @@ -23,16 +23,19 @@ final class ProductTypeSetInputTipActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setInputTip'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?LocalizedString */ protected $inputTip; @@ -43,14 +46,16 @@ final class ProductTypeSetInputTipActionModel extends JsonObjectModel implements */ public function __construct( ?string $attributeName = null, - ?LocalizedString $inputTip = null + ?LocalizedString $inputTip = null, + ?string $action = null ) { $this->attributeName = $attributeName; $this->inputTip = $inputTip; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() /** *

    Name of the AttributeDefinition to update.

    * + * * @return null|string */ public function getAttributeName() @@ -89,6 +95,7 @@ public function getAttributeName() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|LocalizedString */ public function getInputTip() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeSetKeyAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeSetKeyAction.php index 197b39e313f..04db6fff653 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeSetKeyAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeSetKeyAction.php @@ -18,6 +18,7 @@ interface ProductTypeSetKeyAction extends ProductTypeUpdateAction /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeSetKeyActionBuilder.php index e36f47c2c1a..1a4c1b45321 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeSetKeyActionBuilder.php @@ -21,6 +21,7 @@ final class ProductTypeSetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; @@ -28,6 +29,7 @@ final class ProductTypeSetKeyActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeSetKeyActionModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeSetKeyActionModel.php index 7684fe060a0..566b581d1bb 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeSetKeyActionModel.php @@ -21,11 +21,13 @@ final class ProductTypeSetKeyActionModel extends JsonObjectModel implements Prod { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class ProductTypeSetKeyActionModel extends JsonObjectModel implements Prod * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeUpdate.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeUpdate.php index faf3a798d8a..aebf6ca8cb0 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeUpdate.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeUpdate.php @@ -19,6 +19,7 @@ interface ProductTypeUpdate extends JsonObject /** *

    Expected version of the ProductType on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion(); @@ -26,6 +27,7 @@ public function getVersion(); /** *

    Update actions to be performed on the ProductType.

    * + * @return null|ProductTypeUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeUpdateAction.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeUpdateAction.php index 4f563881af9..b8d990ea85b 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeUpdateAction.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeUpdateAction.php @@ -17,6 +17,7 @@ interface ProductTypeUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeUpdateBuilder.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeUpdateBuilder.php index 5e574f103a2..bab62682a2e 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeUpdateBuilder.php @@ -21,11 +21,13 @@ final class ProductTypeUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?ProductTypeUpdateActionCollection */ private $actions; @@ -33,6 +35,7 @@ final class ProductTypeUpdateBuilder implements Builder /** *

    Expected version of the ProductType on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion() @@ -43,6 +46,7 @@ public function getVersion() /** *

    Update actions to be performed on the ProductType.

    * + * @return null|ProductTypeUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/ProductType/ProductTypeUpdateModel.php b/lib/commercetools-api/src/Models/ProductType/ProductTypeUpdateModel.php index e2bf12c3bf8..abc5682b076 100644 --- a/lib/commercetools-api/src/Models/ProductType/ProductTypeUpdateModel.php +++ b/lib/commercetools-api/src/Models/ProductType/ProductTypeUpdateModel.php @@ -20,11 +20,13 @@ final class ProductTypeUpdateModel extends JsonObjectModel implements ProductTypeUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?ProductTypeUpdateActionCollection */ protected $actions; @@ -44,6 +46,7 @@ public function __construct( /** *

    Expected version of the ProductType on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * * @return null|int */ public function getVersion() @@ -63,6 +66,7 @@ public function getVersion() /** *

    Update actions to be performed on the ProductType.

    * + * * @return null|ProductTypeUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Project/BusinessUnitConfiguration.php b/lib/commercetools-api/src/Models/Project/BusinessUnitConfiguration.php new file mode 100644 index 00000000000..b4c63968cce --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/BusinessUnitConfiguration.php @@ -0,0 +1,30 @@ +Status of Business Units created using the My Business Unit endpoint.

    + * + + * @return null|string + */ + public function getMyBusinessUnitStatusOnCreation(); + + /** + * @param ?string $myBusinessUnitStatusOnCreation + */ + public function setMyBusinessUnitStatusOnCreation(?string $myBusinessUnitStatusOnCreation): void; +} diff --git a/lib/commercetools-api/src/Models/Project/BusinessUnitConfigurationBuilder.php b/lib/commercetools-api/src/Models/Project/BusinessUnitConfigurationBuilder.php new file mode 100644 index 00000000000..66243f67bad --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/BusinessUnitConfigurationBuilder.php @@ -0,0 +1,63 @@ + + */ +final class BusinessUnitConfigurationBuilder implements Builder +{ + /** + + * @var ?string + */ + private $myBusinessUnitStatusOnCreation; + + /** + *

    Status of Business Units created using the My Business Unit endpoint.

    + * + + * @return null|string + */ + public function getMyBusinessUnitStatusOnCreation() + { + return $this->myBusinessUnitStatusOnCreation; + } + + /** + * @param ?string $myBusinessUnitStatusOnCreation + * @return $this + */ + public function withMyBusinessUnitStatusOnCreation(?string $myBusinessUnitStatusOnCreation) + { + $this->myBusinessUnitStatusOnCreation = $myBusinessUnitStatusOnCreation; + + return $this; + } + + + public function build(): BusinessUnitConfiguration + { + return new BusinessUnitConfigurationModel( + $this->myBusinessUnitStatusOnCreation + ); + } + + public static function of(): BusinessUnitConfigurationBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Project/BusinessUnitConfigurationCollection.php b/lib/commercetools-api/src/Models/Project/BusinessUnitConfigurationCollection.php new file mode 100644 index 00000000000..ba38970d075 --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/BusinessUnitConfigurationCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitConfiguration current() + * @method BusinessUnitConfiguration end() + * @method BusinessUnitConfiguration at($offset) + */ +class BusinessUnitConfigurationCollection extends MapperSequence +{ + /** + * @psalm-assert BusinessUnitConfiguration $value + * @psalm-param BusinessUnitConfiguration|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitConfigurationCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitConfiguration) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitConfiguration + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitConfiguration { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitConfiguration $data */ + $data = BusinessUnitConfigurationModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Project/BusinessUnitConfigurationModel.php b/lib/commercetools-api/src/Models/Project/BusinessUnitConfigurationModel.php new file mode 100644 index 00000000000..f64989e3dea --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/BusinessUnitConfigurationModel.php @@ -0,0 +1,66 @@ +myBusinessUnitStatusOnCreation = $myBusinessUnitStatusOnCreation; + } + + /** + *

    Status of Business Units created using the My Business Unit endpoint.

    + * + * + * @return null|string + */ + public function getMyBusinessUnitStatusOnCreation() + { + if (is_null($this->myBusinessUnitStatusOnCreation)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_MY_BUSINESS_UNIT_STATUS_ON_CREATION); + if (is_null($data)) { + return null; + } + $this->myBusinessUnitStatusOnCreation = (string) $data; + } + + return $this->myBusinessUnitStatusOnCreation; + } + + + /** + * @param ?string $myBusinessUnitStatusOnCreation + */ + public function setMyBusinessUnitStatusOnCreation(?string $myBusinessUnitStatusOnCreation): void + { + $this->myBusinessUnitStatusOnCreation = $myBusinessUnitStatusOnCreation; + } +} diff --git a/lib/commercetools-api/src/Models/Project/CartClassificationType.php b/lib/commercetools-api/src/Models/Project/CartClassificationType.php index 3e80725be27..dc6b2fe95b6 100644 --- a/lib/commercetools-api/src/Models/Project/CartClassificationType.php +++ b/lib/commercetools-api/src/Models/Project/CartClassificationType.php @@ -17,8 +17,9 @@ interface CartClassificationType extends ShippingRateInputType public const FIELD_VALUES = 'values'; /** - *

    The classification items that can be used for specifiying any ShippingRatePriceTier.

    + *

    The classification items that can be used for specifying any ShippingRatePriceTier.

    * + * @return null|CustomFieldLocalizedEnumValueCollection */ public function getValues(); diff --git a/lib/commercetools-api/src/Models/Project/CartClassificationTypeBuilder.php b/lib/commercetools-api/src/Models/Project/CartClassificationTypeBuilder.php index e5500c247f6..7d83036e969 100644 --- a/lib/commercetools-api/src/Models/Project/CartClassificationTypeBuilder.php +++ b/lib/commercetools-api/src/Models/Project/CartClassificationTypeBuilder.php @@ -22,13 +22,15 @@ final class CartClassificationTypeBuilder implements Builder { /** + * @var ?CustomFieldLocalizedEnumValueCollection */ private $values; /** - *

    The classification items that can be used for specifiying any ShippingRatePriceTier.

    + *

    The classification items that can be used for specifying any ShippingRatePriceTier.

    * + * @return null|CustomFieldLocalizedEnumValueCollection */ public function getValues() diff --git a/lib/commercetools-api/src/Models/Project/CartClassificationTypeModel.php b/lib/commercetools-api/src/Models/Project/CartClassificationTypeModel.php index 7ba4b59b690..01511c8ca66 100644 --- a/lib/commercetools-api/src/Models/Project/CartClassificationTypeModel.php +++ b/lib/commercetools-api/src/Models/Project/CartClassificationTypeModel.php @@ -22,11 +22,13 @@ final class CartClassificationTypeModel extends JsonObjectModel implements CartC { public const DISCRIMINATOR_VALUE = 'CartClassification'; /** + * * @var ?string */ protected $type; /** + * * @var ?CustomFieldLocalizedEnumValueCollection */ protected $values; @@ -36,13 +38,15 @@ final class CartClassificationTypeModel extends JsonObjectModel implements CartC * @psalm-suppress MissingParamType */ public function __construct( - ?CustomFieldLocalizedEnumValueCollection $values = null + ?CustomFieldLocalizedEnumValueCollection $values = null, + ?string $type = null ) { $this->values = $values; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -60,7 +64,8 @@ public function getType() } /** - *

    The classification items that can be used for specifiying any ShippingRatePriceTier.

    + *

    The classification items that can be used for specifying any ShippingRatePriceTier.

    + * * * @return null|CustomFieldLocalizedEnumValueCollection */ diff --git a/lib/commercetools-api/src/Models/Project/CartScoreTypeModel.php b/lib/commercetools-api/src/Models/Project/CartScoreTypeModel.php index 79e462afee3..20400e22830 100644 --- a/lib/commercetools-api/src/Models/Project/CartScoreTypeModel.php +++ b/lib/commercetools-api/src/Models/Project/CartScoreTypeModel.php @@ -21,6 +21,7 @@ final class CartScoreTypeModel extends JsonObjectModel implements CartScoreType { public const DISCRIMINATOR_VALUE = 'CartScore'; /** + * * @var ?string */ protected $type; @@ -30,11 +31,13 @@ final class CartScoreTypeModel extends JsonObjectModel implements CartScoreType * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Project/CartValueTypeModel.php b/lib/commercetools-api/src/Models/Project/CartValueTypeModel.php index 2f2b5e2bee3..414b897a710 100644 --- a/lib/commercetools-api/src/Models/Project/CartValueTypeModel.php +++ b/lib/commercetools-api/src/Models/Project/CartValueTypeModel.php @@ -21,6 +21,7 @@ final class CartValueTypeModel extends JsonObjectModel implements CartValueType { public const DISCRIMINATOR_VALUE = 'CartValue'; /** + * * @var ?string */ protected $type; @@ -30,11 +31,13 @@ final class CartValueTypeModel extends JsonObjectModel implements CartValueType * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Project/CartsConfiguration.php b/lib/commercetools-api/src/Models/Project/CartsConfiguration.php index ff3b1b1021f..36940af9ac2 100644 --- a/lib/commercetools-api/src/Models/Project/CartsConfiguration.php +++ b/lib/commercetools-api/src/Models/Project/CartsConfiguration.php @@ -19,6 +19,7 @@ interface CartsConfiguration extends JsonObject /** *

    Default value for the deleteDaysAfterLastModification parameter of the CartDraft. This field may not be present on Projects created before January 2020.

    * + * @return null|int */ public function getDeleteDaysAfterLastModification(); @@ -26,6 +27,7 @@ public function getDeleteDaysAfterLastModification(); /** *

    Indicates if country - no state Tax Rate fallback should be used when a shipping address state is not explicitly covered in the rates lists of all Tax Categories of a Cart Line Items. This field may not be present on Projects created before June 2020.

    * + * @return null|bool */ public function getCountryTaxRateFallbackEnabled(); diff --git a/lib/commercetools-api/src/Models/Project/CartsConfigurationBuilder.php b/lib/commercetools-api/src/Models/Project/CartsConfigurationBuilder.php index b0aa0559614..d1129b9d601 100644 --- a/lib/commercetools-api/src/Models/Project/CartsConfigurationBuilder.php +++ b/lib/commercetools-api/src/Models/Project/CartsConfigurationBuilder.php @@ -21,11 +21,13 @@ final class CartsConfigurationBuilder implements Builder { /** + * @var ?int */ private $deleteDaysAfterLastModification; /** + * @var ?bool */ private $countryTaxRateFallbackEnabled; @@ -33,6 +35,7 @@ final class CartsConfigurationBuilder implements Builder /** *

    Default value for the deleteDaysAfterLastModification parameter of the CartDraft. This field may not be present on Projects created before January 2020.

    * + * @return null|int */ public function getDeleteDaysAfterLastModification() @@ -43,6 +46,7 @@ public function getDeleteDaysAfterLastModification() /** *

    Indicates if country - no state Tax Rate fallback should be used when a shipping address state is not explicitly covered in the rates lists of all Tax Categories of a Cart Line Items. This field may not be present on Projects created before June 2020.

    * + * @return null|bool */ public function getCountryTaxRateFallbackEnabled() diff --git a/lib/commercetools-api/src/Models/Project/CartsConfigurationModel.php b/lib/commercetools-api/src/Models/Project/CartsConfigurationModel.php index afa4ab88106..351757356ef 100644 --- a/lib/commercetools-api/src/Models/Project/CartsConfigurationModel.php +++ b/lib/commercetools-api/src/Models/Project/CartsConfigurationModel.php @@ -20,11 +20,13 @@ final class CartsConfigurationModel extends JsonObjectModel implements CartsConfiguration { /** + * * @var ?int */ protected $deleteDaysAfterLastModification; /** + * * @var ?bool */ protected $countryTaxRateFallbackEnabled; @@ -44,6 +46,7 @@ public function __construct( /** *

    Default value for the deleteDaysAfterLastModification parameter of the CartDraft. This field may not be present on Projects created before January 2020.

    * + * * @return null|int */ public function getDeleteDaysAfterLastModification() @@ -63,6 +66,7 @@ public function getDeleteDaysAfterLastModification() /** *

    Indicates if country - no state Tax Rate fallback should be used when a shipping address state is not explicitly covered in the rates lists of all Tax Categories of a Cart Line Items. This field may not be present on Projects created before June 2020.

    * + * * @return null|bool */ public function getCountryTaxRateFallbackEnabled() diff --git a/lib/commercetools-api/src/Models/Project/ExternalOAuth.php b/lib/commercetools-api/src/Models/Project/ExternalOAuth.php index 8f00eafb1c5..fbfc7cbbb79 100644 --- a/lib/commercetools-api/src/Models/Project/ExternalOAuth.php +++ b/lib/commercetools-api/src/Models/Project/ExternalOAuth.php @@ -19,6 +19,7 @@ interface ExternalOAuth extends JsonObject /** *

    URL with authorization header.

    * + * @return null|string */ public function getUrl(); @@ -26,6 +27,7 @@ public function getUrl(); /** *

    Partially hidden on retrieval.

    * + * @return null|string */ public function getAuthorizationHeader(); diff --git a/lib/commercetools-api/src/Models/Project/ExternalOAuthBuilder.php b/lib/commercetools-api/src/Models/Project/ExternalOAuthBuilder.php index 79910b893d3..02ad1d79524 100644 --- a/lib/commercetools-api/src/Models/Project/ExternalOAuthBuilder.php +++ b/lib/commercetools-api/src/Models/Project/ExternalOAuthBuilder.php @@ -21,11 +21,13 @@ final class ExternalOAuthBuilder implements Builder { /** + * @var ?string */ private $url; /** + * @var ?string */ private $authorizationHeader; @@ -33,6 +35,7 @@ final class ExternalOAuthBuilder implements Builder /** *

    URL with authorization header.

    * + * @return null|string */ public function getUrl() @@ -43,6 +46,7 @@ public function getUrl() /** *

    Partially hidden on retrieval.

    * + * @return null|string */ public function getAuthorizationHeader() diff --git a/lib/commercetools-api/src/Models/Project/ExternalOAuthModel.php b/lib/commercetools-api/src/Models/Project/ExternalOAuthModel.php index 30eee500465..52f535360d8 100644 --- a/lib/commercetools-api/src/Models/Project/ExternalOAuthModel.php +++ b/lib/commercetools-api/src/Models/Project/ExternalOAuthModel.php @@ -20,11 +20,13 @@ final class ExternalOAuthModel extends JsonObjectModel implements ExternalOAuth { /** + * * @var ?string */ protected $url; /** + * * @var ?string */ protected $authorizationHeader; @@ -44,6 +46,7 @@ public function __construct( /** *

    URL with authorization header.

    * + * * @return null|string */ public function getUrl() @@ -63,6 +66,7 @@ public function getUrl() /** *

    Partially hidden on retrieval.

    * + * * @return null|string */ public function getAuthorizationHeader() diff --git a/lib/commercetools-api/src/Models/Project/Project.php b/lib/commercetools-api/src/Models/Project/Project.php index d8ece28708f..6f5cf14bbb5 100644 --- a/lib/commercetools-api/src/Models/Project/Project.php +++ b/lib/commercetools-api/src/Models/Project/Project.php @@ -29,10 +29,12 @@ interface Project extends JsonObject public const FIELD_SHIPPING_RATE_INPUT_TYPE = 'shippingRateInputType'; public const FIELD_EXTERNAL_O_AUTH = 'externalOAuth'; public const FIELD_SEARCH_INDEXING = 'searchIndexing'; + public const FIELD_BUSINESS_UNITS = 'businessUnits'; /** *

    Current version of the Project.

    * + * @return null|int */ public function getVersion(); @@ -40,6 +42,7 @@ public function getVersion(); /** *

    User-defined unique identifier of the Project.

    * + * @return null|string */ public function getKey(); @@ -47,6 +50,7 @@ public function getKey(); /** *

    Name of the Project.

    * + * @return null|string */ public function getName(); @@ -54,6 +58,7 @@ public function getName(); /** *

    Country code of the geographic location.

    * + * @return null|array */ public function getCountries(); @@ -61,6 +66,7 @@ public function getCountries(); /** *

    Currency code of the country. A Project must have at least one currency.

    * + * @return null|array */ public function getCurrencies(); @@ -68,6 +74,7 @@ public function getCurrencies(); /** *

    Language of the country. A Project must have at least one language.

    * + * @return null|array */ public function getLanguages(); @@ -75,6 +82,7 @@ public function getLanguages(); /** *

    Date and time (UTC) the Project was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -82,6 +90,7 @@ public function getCreatedAt(); /** *

    Date in YYYY-MM format specifying when the trial period for the Project ends. Only present on Projects in trial period.

    * + * @return null|string */ public function getTrialUntil(); @@ -89,6 +98,7 @@ public function getTrialUntil(); /** *

    Holds the configuration for the Messages Query feature.

    * + * @return null|MessagesConfiguration */ public function getMessages(); @@ -96,6 +106,7 @@ public function getMessages(); /** *

    Holds the configuration for the Carts feature.

    * + * @return null|CartsConfiguration */ public function getCarts(); @@ -103,6 +114,7 @@ public function getCarts(); /** *

    Holds the configuration for the Shopping Lists feature. This field may not be present on Projects created before January 2020.

    * + * @return null|ShoppingListsConfiguration */ public function getShoppingLists(); @@ -110,6 +122,7 @@ public function getShoppingLists(); /** *

    Holds the configuration for the tiered shipping rates feature.

    * + * @return null|ShippingRateInputType */ public function getShippingRateInputType(); @@ -117,6 +130,7 @@ public function getShippingRateInputType(); /** *

    Represents a RFC 7662 compliant OAuth 2.0 Token Introspection endpoint.

    * + * @return null|ExternalOAuth */ public function getExternalOAuth(); @@ -124,10 +138,19 @@ public function getExternalOAuth(); /** *

    Controls indexing of resources to be provided on high performance read-only search endpoints.

    * + * @return null|SearchIndexingConfiguration */ public function getSearchIndexing(); + /** + *

    Holds configuration specific to Business Units.

    + * + + * @return null|BusinessUnitConfiguration + */ + public function getBusinessUnits(); + /** * @param ?int $version */ @@ -197,4 +220,9 @@ public function setExternalOAuth(?ExternalOAuth $externalOAuth): void; * @param ?SearchIndexingConfiguration $searchIndexing */ public function setSearchIndexing(?SearchIndexingConfiguration $searchIndexing): void; + + /** + * @param ?BusinessUnitConfiguration $businessUnits + */ + public function setBusinessUnits(?BusinessUnitConfiguration $businessUnits): void; } diff --git a/lib/commercetools-api/src/Models/Project/ProjectBuilder.php b/lib/commercetools-api/src/Models/Project/ProjectBuilder.php index 8d0a72dd819..76d0fdca6d7 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectBuilder.php +++ b/lib/commercetools-api/src/Models/Project/ProjectBuilder.php @@ -24,78 +24,99 @@ final class ProjectBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?string */ private $key; /** + * @var ?string */ private $name; /** + * @var ?array */ private $countries; /** + * @var ?array */ private $currencies; /** + * @var ?array */ private $languages; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?string */ private $trialUntil; /** + * @var null|MessagesConfiguration|MessagesConfigurationBuilder */ private $messages; /** + * @var null|CartsConfiguration|CartsConfigurationBuilder */ private $carts; /** + * @var null|ShoppingListsConfiguration|ShoppingListsConfigurationBuilder */ private $shoppingLists; /** + * @var null|ShippingRateInputType|ShippingRateInputTypeBuilder */ private $shippingRateInputType; /** + * @var null|ExternalOAuth|ExternalOAuthBuilder */ private $externalOAuth; /** + * @var null|SearchIndexingConfiguration|SearchIndexingConfigurationBuilder */ private $searchIndexing; + /** + + * @var null|BusinessUnitConfiguration|BusinessUnitConfigurationBuilder + */ + private $businessUnits; + /** *

    Current version of the Project.

    * + * @return null|int */ public function getVersion() @@ -106,6 +127,7 @@ public function getVersion() /** *

    User-defined unique identifier of the Project.

    * + * @return null|string */ public function getKey() @@ -116,6 +138,7 @@ public function getKey() /** *

    Name of the Project.

    * + * @return null|string */ public function getName() @@ -126,6 +149,7 @@ public function getName() /** *

    Country code of the geographic location.

    * + * @return null|array */ public function getCountries() @@ -136,6 +160,7 @@ public function getCountries() /** *

    Currency code of the country. A Project must have at least one currency.

    * + * @return null|array */ public function getCurrencies() @@ -146,6 +171,7 @@ public function getCurrencies() /** *

    Language of the country. A Project must have at least one language.

    * + * @return null|array */ public function getLanguages() @@ -156,6 +182,7 @@ public function getLanguages() /** *

    Date and time (UTC) the Project was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -166,6 +193,7 @@ public function getCreatedAt() /** *

    Date in YYYY-MM format specifying when the trial period for the Project ends. Only present on Projects in trial period.

    * + * @return null|string */ public function getTrialUntil() @@ -176,6 +204,7 @@ public function getTrialUntil() /** *

    Holds the configuration for the Messages Query feature.

    * + * @return null|MessagesConfiguration */ public function getMessages() @@ -186,6 +215,7 @@ public function getMessages() /** *

    Holds the configuration for the Carts feature.

    * + * @return null|CartsConfiguration */ public function getCarts() @@ -196,6 +226,7 @@ public function getCarts() /** *

    Holds the configuration for the Shopping Lists feature. This field may not be present on Projects created before January 2020.

    * + * @return null|ShoppingListsConfiguration */ public function getShoppingLists() @@ -206,6 +237,7 @@ public function getShoppingLists() /** *

    Holds the configuration for the tiered shipping rates feature.

    * + * @return null|ShippingRateInputType */ public function getShippingRateInputType() @@ -216,6 +248,7 @@ public function getShippingRateInputType() /** *

    Represents a RFC 7662 compliant OAuth 2.0 Token Introspection endpoint.

    * + * @return null|ExternalOAuth */ public function getExternalOAuth() @@ -226,6 +259,7 @@ public function getExternalOAuth() /** *

    Controls indexing of resources to be provided on high performance read-only search endpoints.

    * + * @return null|SearchIndexingConfiguration */ public function getSearchIndexing() @@ -233,6 +267,17 @@ public function getSearchIndexing() return $this->searchIndexing instanceof SearchIndexingConfigurationBuilder ? $this->searchIndexing->build() : $this->searchIndexing; } + /** + *

    Holds configuration specific to Business Units.

    + * + + * @return null|BusinessUnitConfiguration + */ + public function getBusinessUnits() + { + return $this->businessUnits instanceof BusinessUnitConfigurationBuilder ? $this->businessUnits->build() : $this->businessUnits; + } + /** * @param ?int $version * @return $this @@ -387,6 +432,17 @@ public function withSearchIndexing(?SearchIndexingConfiguration $searchIndexing) return $this; } + /** + * @param ?BusinessUnitConfiguration $businessUnits + * @return $this + */ + public function withBusinessUnits(?BusinessUnitConfiguration $businessUnits) + { + $this->businessUnits = $businessUnits; + + return $this; + } + /** * @deprecated use withMessages() instead * @return $this @@ -453,6 +509,17 @@ public function withSearchIndexingBuilder(?SearchIndexingConfigurationBuilder $s return $this; } + /** + * @deprecated use withBusinessUnits() instead + * @return $this + */ + public function withBusinessUnitsBuilder(?BusinessUnitConfigurationBuilder $businessUnits) + { + $this->businessUnits = $businessUnits; + + return $this; + } + public function build(): Project { return new ProjectModel( @@ -469,7 +536,8 @@ public function build(): Project $this->shoppingLists instanceof ShoppingListsConfigurationBuilder ? $this->shoppingLists->build() : $this->shoppingLists, $this->shippingRateInputType instanceof ShippingRateInputTypeBuilder ? $this->shippingRateInputType->build() : $this->shippingRateInputType, $this->externalOAuth instanceof ExternalOAuthBuilder ? $this->externalOAuth->build() : $this->externalOAuth, - $this->searchIndexing instanceof SearchIndexingConfigurationBuilder ? $this->searchIndexing->build() : $this->searchIndexing + $this->searchIndexing instanceof SearchIndexingConfigurationBuilder ? $this->searchIndexing->build() : $this->searchIndexing, + $this->businessUnits instanceof BusinessUnitConfigurationBuilder ? $this->businessUnits->build() : $this->businessUnits ); } diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitStatusOnCreationAction.php b/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitStatusOnCreationAction.php new file mode 100644 index 00000000000..b48af6b525c --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitStatusOnCreationAction.php @@ -0,0 +1,30 @@ +Status for Business Units created using the My Business Unit endpoint.

    + * + + * @return null|string + */ + public function getStatus(); + + /** + * @param ?string $status + */ + public function setStatus(?string $status): void; +} diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitStatusOnCreationActionBuilder.php b/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitStatusOnCreationActionBuilder.php new file mode 100644 index 00000000000..56490f98752 --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitStatusOnCreationActionBuilder.php @@ -0,0 +1,63 @@ + + */ +final class ProjectChangeBusinessUnitStatusOnCreationActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $status; + + /** + *

    Status for Business Units created using the My Business Unit endpoint.

    + * + + * @return null|string + */ + public function getStatus() + { + return $this->status; + } + + /** + * @param ?string $status + * @return $this + */ + public function withStatus(?string $status) + { + $this->status = $status; + + return $this; + } + + + public function build(): ProjectChangeBusinessUnitStatusOnCreationAction + { + return new ProjectChangeBusinessUnitStatusOnCreationActionModel( + $this->status + ); + } + + public static function of(): ProjectChangeBusinessUnitStatusOnCreationActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitStatusOnCreationActionCollection.php b/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitStatusOnCreationActionCollection.php new file mode 100644 index 00000000000..a2596dc12b5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitStatusOnCreationActionCollection.php @@ -0,0 +1,56 @@ + + * @method ProjectChangeBusinessUnitStatusOnCreationAction current() + * @method ProjectChangeBusinessUnitStatusOnCreationAction end() + * @method ProjectChangeBusinessUnitStatusOnCreationAction at($offset) + */ +class ProjectChangeBusinessUnitStatusOnCreationActionCollection extends ProjectUpdateActionCollection +{ + /** + * @psalm-assert ProjectChangeBusinessUnitStatusOnCreationAction $value + * @psalm-param ProjectChangeBusinessUnitStatusOnCreationAction|stdClass $value + * @throws InvalidArgumentException + * + * @return ProjectChangeBusinessUnitStatusOnCreationActionCollection + */ + public function add($value) + { + if (!$value instanceof ProjectChangeBusinessUnitStatusOnCreationAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ProjectChangeBusinessUnitStatusOnCreationAction + */ + protected function mapper() + { + return function (?int $index): ?ProjectChangeBusinessUnitStatusOnCreationAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ProjectChangeBusinessUnitStatusOnCreationAction $data */ + $data = ProjectChangeBusinessUnitStatusOnCreationActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitStatusOnCreationActionModel.php b/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitStatusOnCreationActionModel.php new file mode 100644 index 00000000000..11d096a1848 --- /dev/null +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeBusinessUnitStatusOnCreationActionModel.php @@ -0,0 +1,93 @@ +status = $status; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    Status for Business Units created using the My Business Unit endpoint.

    + * + * + * @return null|string + */ + public function getStatus() + { + if (is_null($this->status)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_STATUS); + if (is_null($data)) { + return null; + } + $this->status = (string) $data; + } + + return $this->status; + } + + + /** + * @param ?string $status + */ + public function setStatus(?string $status): void + { + $this->status = $status; + } +} diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeCartsConfigurationAction.php b/lib/commercetools-api/src/Models/Project/ProjectChangeCartsConfigurationAction.php index f644d782229..cfb4265fd1b 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeCartsConfigurationAction.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeCartsConfigurationAction.php @@ -18,6 +18,7 @@ interface ProjectChangeCartsConfigurationAction extends ProjectUpdateAction /** *

    Configuration for the Carts feature.

    * + * @return null|CartsConfiguration */ public function getCartsConfiguration(); diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeCartsConfigurationActionBuilder.php b/lib/commercetools-api/src/Models/Project/ProjectChangeCartsConfigurationActionBuilder.php index 90f4c0f5e59..f712baae818 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeCartsConfigurationActionBuilder.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeCartsConfigurationActionBuilder.php @@ -21,6 +21,7 @@ final class ProjectChangeCartsConfigurationActionBuilder implements Builder { /** + * @var null|CartsConfiguration|CartsConfigurationBuilder */ private $cartsConfiguration; @@ -28,6 +29,7 @@ final class ProjectChangeCartsConfigurationActionBuilder implements Builder /** *

    Configuration for the Carts feature.

    * + * @return null|CartsConfiguration */ public function getCartsConfiguration() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeCartsConfigurationActionModel.php b/lib/commercetools-api/src/Models/Project/ProjectChangeCartsConfigurationActionModel.php index 78c2095b470..265b5b9e33c 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeCartsConfigurationActionModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeCartsConfigurationActionModel.php @@ -21,11 +21,13 @@ final class ProjectChangeCartsConfigurationActionModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'changeCartsConfiguration'; /** + * * @var ?string */ protected $action; /** + * * @var ?CartsConfiguration */ protected $cartsConfiguration; @@ -35,13 +37,15 @@ final class ProjectChangeCartsConfigurationActionModel extends JsonObjectModel i * @psalm-suppress MissingParamType */ public function __construct( - ?CartsConfiguration $cartsConfiguration = null + ?CartsConfiguration $cartsConfiguration = null, + ?string $action = null ) { $this->cartsConfiguration = $cartsConfiguration; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Configuration for the Carts feature.

    * + * * @return null|CartsConfiguration */ public function getCartsConfiguration() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeCountriesAction.php b/lib/commercetools-api/src/Models/Project/ProjectChangeCountriesAction.php index 12972ca3805..9e470358bfc 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeCountriesAction.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeCountriesAction.php @@ -18,6 +18,7 @@ interface ProjectChangeCountriesAction extends ProjectUpdateAction /** *

    New value to set. Must not be empty.

    * + * @return null|array */ public function getCountries(); diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeCountriesActionBuilder.php b/lib/commercetools-api/src/Models/Project/ProjectChangeCountriesActionBuilder.php index d1a2a95b914..0a74aed2b90 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeCountriesActionBuilder.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeCountriesActionBuilder.php @@ -21,6 +21,7 @@ final class ProjectChangeCountriesActionBuilder implements Builder { /** + * @var ?array */ private $countries; @@ -28,6 +29,7 @@ final class ProjectChangeCountriesActionBuilder implements Builder /** *

    New value to set. Must not be empty.

    * + * @return null|array */ public function getCountries() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeCountriesActionModel.php b/lib/commercetools-api/src/Models/Project/ProjectChangeCountriesActionModel.php index f15a794fcac..7ed519d3d88 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeCountriesActionModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeCountriesActionModel.php @@ -21,11 +21,13 @@ final class ProjectChangeCountriesActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'changeCountries'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $countries; @@ -35,13 +37,15 @@ final class ProjectChangeCountriesActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?array $countries = null + ?array $countries = null, + ?string $action = null ) { $this->countries = $countries; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    New value to set. Must not be empty.

    * + * * @return null|array */ public function getCountries() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeCountryTaxRateFallbackEnabledAction.php b/lib/commercetools-api/src/Models/Project/ProjectChangeCountryTaxRateFallbackEnabledAction.php index 36fe6f3f0e5..234df41040a 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeCountryTaxRateFallbackEnabledAction.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeCountryTaxRateFallbackEnabledAction.php @@ -18,6 +18,7 @@ interface ProjectChangeCountryTaxRateFallbackEnabledAction extends ProjectUpdate /** *

    When true, country - no state Tax Rate is used as fallback. See CartsConfiguration.

    * + * @return null|bool */ public function getCountryTaxRateFallbackEnabled(); diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeCountryTaxRateFallbackEnabledActionBuilder.php b/lib/commercetools-api/src/Models/Project/ProjectChangeCountryTaxRateFallbackEnabledActionBuilder.php index bdba46c0d87..a33b764b105 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeCountryTaxRateFallbackEnabledActionBuilder.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeCountryTaxRateFallbackEnabledActionBuilder.php @@ -21,6 +21,7 @@ final class ProjectChangeCountryTaxRateFallbackEnabledActionBuilder implements Builder { /** + * @var ?bool */ private $countryTaxRateFallbackEnabled; @@ -28,6 +29,7 @@ final class ProjectChangeCountryTaxRateFallbackEnabledActionBuilder implements B /** *

    When true, country - no state Tax Rate is used as fallback. See CartsConfiguration.

    * + * @return null|bool */ public function getCountryTaxRateFallbackEnabled() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeCountryTaxRateFallbackEnabledActionModel.php b/lib/commercetools-api/src/Models/Project/ProjectChangeCountryTaxRateFallbackEnabledActionModel.php index 62bb83b9ab0..724102df404 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeCountryTaxRateFallbackEnabledActionModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeCountryTaxRateFallbackEnabledActionModel.php @@ -21,11 +21,13 @@ final class ProjectChangeCountryTaxRateFallbackEnabledActionModel extends JsonOb { public const DISCRIMINATOR_VALUE = 'changeCountryTaxRateFallbackEnabled'; /** + * * @var ?string */ protected $action; /** + * * @var ?bool */ protected $countryTaxRateFallbackEnabled; @@ -35,13 +37,15 @@ final class ProjectChangeCountryTaxRateFallbackEnabledActionModel extends JsonOb * @psalm-suppress MissingParamType */ public function __construct( - ?bool $countryTaxRateFallbackEnabled = null + ?bool $countryTaxRateFallbackEnabled = null, + ?string $action = null ) { $this->countryTaxRateFallbackEnabled = $countryTaxRateFallbackEnabled; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    When true, country - no state Tax Rate is used as fallback. See CartsConfiguration.

    * + * * @return null|bool */ public function getCountryTaxRateFallbackEnabled() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeCurrenciesAction.php b/lib/commercetools-api/src/Models/Project/ProjectChangeCurrenciesAction.php index 88652f8390d..df44c685139 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeCurrenciesAction.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeCurrenciesAction.php @@ -18,6 +18,7 @@ interface ProjectChangeCurrenciesAction extends ProjectUpdateAction /** *

    New value to set. Must not be empty.

    * + * @return null|array */ public function getCurrencies(); diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeCurrenciesActionBuilder.php b/lib/commercetools-api/src/Models/Project/ProjectChangeCurrenciesActionBuilder.php index 39eaa90936c..7b22b5dcb20 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeCurrenciesActionBuilder.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeCurrenciesActionBuilder.php @@ -21,6 +21,7 @@ final class ProjectChangeCurrenciesActionBuilder implements Builder { /** + * @var ?array */ private $currencies; @@ -28,6 +29,7 @@ final class ProjectChangeCurrenciesActionBuilder implements Builder /** *

    New value to set. Must not be empty.

    * + * @return null|array */ public function getCurrencies() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeCurrenciesActionModel.php b/lib/commercetools-api/src/Models/Project/ProjectChangeCurrenciesActionModel.php index e808f2ad30f..126bc103f59 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeCurrenciesActionModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeCurrenciesActionModel.php @@ -21,11 +21,13 @@ final class ProjectChangeCurrenciesActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'changeCurrencies'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $currencies; @@ -35,13 +37,15 @@ final class ProjectChangeCurrenciesActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?array $currencies = null + ?array $currencies = null, + ?string $action = null ) { $this->currencies = $currencies; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    New value to set. Must not be empty.

    * + * * @return null|array */ public function getCurrencies() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeLanguagesAction.php b/lib/commercetools-api/src/Models/Project/ProjectChangeLanguagesAction.php index b33c4df45ec..bfb952052a2 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeLanguagesAction.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeLanguagesAction.php @@ -18,6 +18,7 @@ interface ProjectChangeLanguagesAction extends ProjectUpdateAction /** *

    New value to set. Must not be empty.

    * + * @return null|array */ public function getLanguages(); diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeLanguagesActionBuilder.php b/lib/commercetools-api/src/Models/Project/ProjectChangeLanguagesActionBuilder.php index f070e881b6c..4762eab9c93 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeLanguagesActionBuilder.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeLanguagesActionBuilder.php @@ -21,6 +21,7 @@ final class ProjectChangeLanguagesActionBuilder implements Builder { /** + * @var ?array */ private $languages; @@ -28,6 +29,7 @@ final class ProjectChangeLanguagesActionBuilder implements Builder /** *

    New value to set. Must not be empty.

    * + * @return null|array */ public function getLanguages() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeLanguagesActionModel.php b/lib/commercetools-api/src/Models/Project/ProjectChangeLanguagesActionModel.php index 18223e7f54b..039bcb67512 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeLanguagesActionModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeLanguagesActionModel.php @@ -21,11 +21,13 @@ final class ProjectChangeLanguagesActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'changeLanguages'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $languages; @@ -35,13 +37,15 @@ final class ProjectChangeLanguagesActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?array $languages = null + ?array $languages = null, + ?string $action = null ) { $this->languages = $languages; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    New value to set. Must not be empty.

    * + * * @return null|array */ public function getLanguages() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeMessagesConfigurationAction.php b/lib/commercetools-api/src/Models/Project/ProjectChangeMessagesConfigurationAction.php index 0d72dada364..cd90426c200 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeMessagesConfigurationAction.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeMessagesConfigurationAction.php @@ -19,6 +19,7 @@ interface ProjectChangeMessagesConfigurationAction extends ProjectUpdateAction /** *

    Configuration for the Messages Query feature.

    * + * @return null|MessagesConfigurationDraft */ public function getMessagesConfiguration(); diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeMessagesConfigurationActionBuilder.php b/lib/commercetools-api/src/Models/Project/ProjectChangeMessagesConfigurationActionBuilder.php index 946461e9635..f6cf8e420a1 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeMessagesConfigurationActionBuilder.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeMessagesConfigurationActionBuilder.php @@ -23,6 +23,7 @@ final class ProjectChangeMessagesConfigurationActionBuilder implements Builder { /** + * @var null|MessagesConfigurationDraft|MessagesConfigurationDraftBuilder */ private $messagesConfiguration; @@ -30,6 +31,7 @@ final class ProjectChangeMessagesConfigurationActionBuilder implements Builder /** *

    Configuration for the Messages Query feature.

    * + * @return null|MessagesConfigurationDraft */ public function getMessagesConfiguration() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeMessagesConfigurationActionModel.php b/lib/commercetools-api/src/Models/Project/ProjectChangeMessagesConfigurationActionModel.php index cdd71bb6cfa..120c3dca36b 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeMessagesConfigurationActionModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeMessagesConfigurationActionModel.php @@ -23,11 +23,13 @@ final class ProjectChangeMessagesConfigurationActionModel extends JsonObjectMode { public const DISCRIMINATOR_VALUE = 'changeMessagesConfiguration'; /** + * * @var ?string */ protected $action; /** + * * @var ?MessagesConfigurationDraft */ protected $messagesConfiguration; @@ -37,13 +39,15 @@ final class ProjectChangeMessagesConfigurationActionModel extends JsonObjectMode * @psalm-suppress MissingParamType */ public function __construct( - ?MessagesConfigurationDraft $messagesConfiguration = null + ?MessagesConfigurationDraft $messagesConfiguration = null, + ?string $action = null ) { $this->messagesConfiguration = $messagesConfiguration; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Configuration for the Messages Query feature.

    * + * * @return null|MessagesConfigurationDraft */ public function getMessagesConfiguration() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeNameAction.php b/lib/commercetools-api/src/Models/Project/ProjectChangeNameAction.php index 13b130091b9..83ea534b416 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeNameAction.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeNameAction.php @@ -18,6 +18,7 @@ interface ProjectChangeNameAction extends ProjectUpdateAction /** *

    New value to set. Must not be empty.

    * + * @return null|string */ public function getName(); diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeNameActionBuilder.php b/lib/commercetools-api/src/Models/Project/ProjectChangeNameActionBuilder.php index f9d7b81ab38..e42a50bebaa 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeNameActionBuilder.php @@ -21,6 +21,7 @@ final class ProjectChangeNameActionBuilder implements Builder { /** + * @var ?string */ private $name; @@ -28,6 +29,7 @@ final class ProjectChangeNameActionBuilder implements Builder /** *

    New value to set. Must not be empty.

    * + * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeNameActionModel.php b/lib/commercetools-api/src/Models/Project/ProjectChangeNameActionModel.php index 6fd430bf888..2a9f21c3216 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeNameActionModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeNameActionModel.php @@ -21,11 +21,13 @@ final class ProjectChangeNameActionModel extends JsonObjectModel implements Proj { public const DISCRIMINATOR_VALUE = 'changeName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; @@ -35,13 +37,15 @@ final class ProjectChangeNameActionModel extends JsonObjectModel implements Proj * @psalm-suppress MissingParamType */ public function __construct( - ?string $name = null + ?string $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    New value to set. Must not be empty.

    * + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeOrderSearchStatusAction.php b/lib/commercetools-api/src/Models/Project/ProjectChangeOrderSearchStatusAction.php index 93cc48e9460..0d4ff26fc53 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeOrderSearchStatusAction.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeOrderSearchStatusAction.php @@ -18,6 +18,7 @@ interface ProjectChangeOrderSearchStatusAction extends ProjectUpdateAction /** *

    Activates or deactivates the Order Search feature. Activation will trigger building a search index for the Orders in the Project.

    * + * @return null|string */ public function getStatus(); diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeOrderSearchStatusActionBuilder.php b/lib/commercetools-api/src/Models/Project/ProjectChangeOrderSearchStatusActionBuilder.php index ba77aba36ad..2ad3910415a 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeOrderSearchStatusActionBuilder.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeOrderSearchStatusActionBuilder.php @@ -21,6 +21,7 @@ final class ProjectChangeOrderSearchStatusActionBuilder implements Builder { /** + * @var ?string */ private $status; @@ -28,6 +29,7 @@ final class ProjectChangeOrderSearchStatusActionBuilder implements Builder /** *

    Activates or deactivates the Order Search feature. Activation will trigger building a search index for the Orders in the Project.

    * + * @return null|string */ public function getStatus() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeOrderSearchStatusActionModel.php b/lib/commercetools-api/src/Models/Project/ProjectChangeOrderSearchStatusActionModel.php index fb0f9044c84..00937a106e3 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeOrderSearchStatusActionModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeOrderSearchStatusActionModel.php @@ -21,11 +21,13 @@ final class ProjectChangeOrderSearchStatusActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'changeOrderSearchStatus'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $status; @@ -35,13 +37,15 @@ final class ProjectChangeOrderSearchStatusActionModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?string $status = null + ?string $status = null, + ?string $action = null ) { $this->status = $status; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Activates or deactivates the Order Search feature. Activation will trigger building a search index for the Orders in the Project.

    * + * * @return null|string */ public function getStatus() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeProductSearchIndexingEnabledAction.php b/lib/commercetools-api/src/Models/Project/ProjectChangeProductSearchIndexingEnabledAction.php index 08f39791b85..a89c375aa58 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeProductSearchIndexingEnabledAction.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeProductSearchIndexingEnabledAction.php @@ -19,6 +19,7 @@ interface ProjectChangeProductSearchIndexingEnabledAction extends ProjectUpdateA *

    If false, the indexing of Product information will stop and the Product Projection Search as well as the Product Suggestions endpoint will not be available anymore for this Project. The Project's SearchIndexingConfiguration status for products will be changed to "Deactivated".

    *

    If true, the indexing of Product information will start and the Product Projection Search as well as the Product Suggestions endpoint will become available soon after for this Project. Proportional to the amount of information being indexed, the Project's SearchIndexingConfiguration status for products will be shown as "Indexing" during this time. As soon as the indexing has finished, the configuration status will be changed to "Activated" making the aforementioned endpoints fully available for this Project.

    * + * @return null|bool */ public function getEnabled(); diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeProductSearchIndexingEnabledActionBuilder.php b/lib/commercetools-api/src/Models/Project/ProjectChangeProductSearchIndexingEnabledActionBuilder.php index 96af728d73d..a5a2c719335 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeProductSearchIndexingEnabledActionBuilder.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeProductSearchIndexingEnabledActionBuilder.php @@ -21,6 +21,7 @@ final class ProjectChangeProductSearchIndexingEnabledActionBuilder implements Builder { /** + * @var ?bool */ private $enabled; @@ -29,6 +30,7 @@ final class ProjectChangeProductSearchIndexingEnabledActionBuilder implements Bu *

    If false, the indexing of Product information will stop and the Product Projection Search as well as the Product Suggestions endpoint will not be available anymore for this Project. The Project's SearchIndexingConfiguration status for products will be changed to "Deactivated".

    *

    If true, the indexing of Product information will start and the Product Projection Search as well as the Product Suggestions endpoint will become available soon after for this Project. Proportional to the amount of information being indexed, the Project's SearchIndexingConfiguration status for products will be shown as "Indexing" during this time. As soon as the indexing has finished, the configuration status will be changed to "Activated" making the aforementioned endpoints fully available for this Project.

    * + * @return null|bool */ public function getEnabled() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeProductSearchIndexingEnabledActionModel.php b/lib/commercetools-api/src/Models/Project/ProjectChangeProductSearchIndexingEnabledActionModel.php index dac7d5e76ca..771b9615ab5 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeProductSearchIndexingEnabledActionModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeProductSearchIndexingEnabledActionModel.php @@ -21,11 +21,13 @@ final class ProjectChangeProductSearchIndexingEnabledActionModel extends JsonObj { public const DISCRIMINATOR_VALUE = 'changeProductSearchIndexingEnabled'; /** + * * @var ?string */ protected $action; /** + * * @var ?bool */ protected $enabled; @@ -35,13 +37,15 @@ final class ProjectChangeProductSearchIndexingEnabledActionModel extends JsonObj * @psalm-suppress MissingParamType */ public function __construct( - ?bool $enabled = null + ?bool $enabled = null, + ?string $action = null ) { $this->enabled = $enabled; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() *

    If false, the indexing of Product information will stop and the Product Projection Search as well as the Product Suggestions endpoint will not be available anymore for this Project. The Project's SearchIndexingConfiguration status for products will be changed to "Deactivated".

    *

    If true, the indexing of Product information will start and the Product Projection Search as well as the Product Suggestions endpoint will become available soon after for this Project. Proportional to the amount of information being indexed, the Project's SearchIndexingConfiguration status for products will be shown as "Indexing" during this time. As soon as the indexing has finished, the configuration status will be changed to "Activated" making the aforementioned endpoints fully available for this Project.

    * + * * @return null|bool */ public function getEnabled() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationAction.php b/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationAction.php index faad58d009f..e3df7864876 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationAction.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationAction.php @@ -18,6 +18,7 @@ interface ProjectChangeShoppingListsConfigurationAction extends ProjectUpdateAct /** *

    Configuration for the Shopping Lists feature.

    * + * @return null|ShoppingListsConfiguration */ public function getShoppingListsConfiguration(); diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationActionBuilder.php b/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationActionBuilder.php index d1f2488c74b..41dd184c10f 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationActionBuilder.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationActionBuilder.php @@ -21,6 +21,7 @@ final class ProjectChangeShoppingListsConfigurationActionBuilder implements Builder { /** + * @var null|ShoppingListsConfiguration|ShoppingListsConfigurationBuilder */ private $shoppingListsConfiguration; @@ -28,6 +29,7 @@ final class ProjectChangeShoppingListsConfigurationActionBuilder implements Buil /** *

    Configuration for the Shopping Lists feature.

    * + * @return null|ShoppingListsConfiguration */ public function getShoppingListsConfiguration() diff --git a/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationActionModel.php b/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationActionModel.php index 94ab4a4d1d8..2a0c5734f4b 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationActionModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectChangeShoppingListsConfigurationActionModel.php @@ -21,11 +21,13 @@ final class ProjectChangeShoppingListsConfigurationActionModel extends JsonObjec { public const DISCRIMINATOR_VALUE = 'changeShoppingListsConfiguration'; /** + * * @var ?string */ protected $action; /** + * * @var ?ShoppingListsConfiguration */ protected $shoppingListsConfiguration; @@ -35,13 +37,15 @@ final class ProjectChangeShoppingListsConfigurationActionModel extends JsonObjec * @psalm-suppress MissingParamType */ public function __construct( - ?ShoppingListsConfiguration $shoppingListsConfiguration = null + ?ShoppingListsConfiguration $shoppingListsConfiguration = null, + ?string $action = null ) { $this->shoppingListsConfiguration = $shoppingListsConfiguration; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Configuration for the Shopping Lists feature.

    * + * * @return null|ShoppingListsConfiguration */ public function getShoppingListsConfiguration() diff --git a/lib/commercetools-api/src/Models/Project/ProjectModel.php b/lib/commercetools-api/src/Models/Project/ProjectModel.php index 76a35ee8462..f6cf8c523a3 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectModel.php @@ -23,75 +23,95 @@ final class ProjectModel extends JsonObjectModel implements Project { /** + * * @var ?int */ protected $version; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $name; /** + * * @var ?array */ protected $countries; /** + * * @var ?array */ protected $currencies; /** + * * @var ?array */ protected $languages; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?string */ protected $trialUntil; /** + * * @var ?MessagesConfiguration */ protected $messages; /** + * * @var ?CartsConfiguration */ protected $carts; /** + * * @var ?ShoppingListsConfiguration */ protected $shoppingLists; /** + * * @var ?ShippingRateInputType */ protected $shippingRateInputType; /** + * * @var ?ExternalOAuth */ protected $externalOAuth; /** + * * @var ?SearchIndexingConfiguration */ protected $searchIndexing; + /** + * + * @var ?BusinessUnitConfiguration + */ + protected $businessUnits; + /** * @psalm-suppress MissingParamType @@ -110,7 +130,8 @@ public function __construct( ?ShoppingListsConfiguration $shoppingLists = null, ?ShippingRateInputType $shippingRateInputType = null, ?ExternalOAuth $externalOAuth = null, - ?SearchIndexingConfiguration $searchIndexing = null + ?SearchIndexingConfiguration $searchIndexing = null, + ?BusinessUnitConfiguration $businessUnits = null ) { $this->version = $version; $this->key = $key; @@ -126,11 +147,13 @@ public function __construct( $this->shippingRateInputType = $shippingRateInputType; $this->externalOAuth = $externalOAuth; $this->searchIndexing = $searchIndexing; + $this->businessUnits = $businessUnits; } /** *

    Current version of the Project.

    * + * * @return null|int */ public function getVersion() @@ -150,6 +173,7 @@ public function getVersion() /** *

    User-defined unique identifier of the Project.

    * + * * @return null|string */ public function getKey() @@ -169,6 +193,7 @@ public function getKey() /** *

    Name of the Project.

    * + * * @return null|string */ public function getName() @@ -188,6 +213,7 @@ public function getName() /** *

    Country code of the geographic location.

    * + * * @return null|array */ public function getCountries() @@ -207,6 +233,7 @@ public function getCountries() /** *

    Currency code of the country. A Project must have at least one currency.

    * + * * @return null|array */ public function getCurrencies() @@ -226,6 +253,7 @@ public function getCurrencies() /** *

    Language of the country. A Project must have at least one language.

    * + * * @return null|array */ public function getLanguages() @@ -245,6 +273,7 @@ public function getLanguages() /** *

    Date and time (UTC) the Project was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -268,6 +297,7 @@ public function getCreatedAt() /** *

    Date in YYYY-MM format specifying when the trial period for the Project ends. Only present on Projects in trial period.

    * + * * @return null|string */ public function getTrialUntil() @@ -287,6 +317,7 @@ public function getTrialUntil() /** *

    Holds the configuration for the Messages Query feature.

    * + * * @return null|MessagesConfiguration */ public function getMessages() @@ -307,6 +338,7 @@ public function getMessages() /** *

    Holds the configuration for the Carts feature.

    * + * * @return null|CartsConfiguration */ public function getCarts() @@ -327,6 +359,7 @@ public function getCarts() /** *

    Holds the configuration for the Shopping Lists feature. This field may not be present on Projects created before January 2020.

    * + * * @return null|ShoppingListsConfiguration */ public function getShoppingLists() @@ -347,6 +380,7 @@ public function getShoppingLists() /** *

    Holds the configuration for the tiered shipping rates feature.

    * + * * @return null|ShippingRateInputType */ public function getShippingRateInputType() @@ -367,6 +401,7 @@ public function getShippingRateInputType() /** *

    Represents a RFC 7662 compliant OAuth 2.0 Token Introspection endpoint.

    * + * * @return null|ExternalOAuth */ public function getExternalOAuth() @@ -387,6 +422,7 @@ public function getExternalOAuth() /** *

    Controls indexing of resources to be provided on high performance read-only search endpoints.

    * + * * @return null|SearchIndexingConfiguration */ public function getSearchIndexing() @@ -404,6 +440,27 @@ public function getSearchIndexing() return $this->searchIndexing; } + /** + *

    Holds configuration specific to Business Units.

    + * + * + * @return null|BusinessUnitConfiguration + */ + public function getBusinessUnits() + { + if (is_null($this->businessUnits)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BUSINESS_UNITS); + if (is_null($data)) { + return null; + } + + $this->businessUnits = BusinessUnitConfigurationModel::of($data); + } + + return $this->businessUnits; + } + /** * @param ?int $version @@ -517,6 +574,14 @@ public function setSearchIndexing(?SearchIndexingConfiguration $searchIndexing): $this->searchIndexing = $searchIndexing; } + /** + * @param ?BusinessUnitConfiguration $businessUnits + */ + public function setBusinessUnits(?BusinessUnitConfiguration $businessUnits): void + { + $this->businessUnits = $businessUnits; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Project/ProjectSetExternalOAuthAction.php b/lib/commercetools-api/src/Models/Project/ProjectSetExternalOAuthAction.php index c09cab72e3f..41eca668634 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectSetExternalOAuthAction.php +++ b/lib/commercetools-api/src/Models/Project/ProjectSetExternalOAuthAction.php @@ -18,6 +18,7 @@ interface ProjectSetExternalOAuthAction extends ProjectUpdateAction /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|ExternalOAuth */ public function getExternalOAuth(); diff --git a/lib/commercetools-api/src/Models/Project/ProjectSetExternalOAuthActionBuilder.php b/lib/commercetools-api/src/Models/Project/ProjectSetExternalOAuthActionBuilder.php index bdc7011a7ae..fbf397a7219 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectSetExternalOAuthActionBuilder.php +++ b/lib/commercetools-api/src/Models/Project/ProjectSetExternalOAuthActionBuilder.php @@ -21,6 +21,7 @@ final class ProjectSetExternalOAuthActionBuilder implements Builder { /** + * @var null|ExternalOAuth|ExternalOAuthBuilder */ private $externalOAuth; @@ -28,6 +29,7 @@ final class ProjectSetExternalOAuthActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|ExternalOAuth */ public function getExternalOAuth() diff --git a/lib/commercetools-api/src/Models/Project/ProjectSetExternalOAuthActionModel.php b/lib/commercetools-api/src/Models/Project/ProjectSetExternalOAuthActionModel.php index 42cbb2392cd..80673382ab0 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectSetExternalOAuthActionModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectSetExternalOAuthActionModel.php @@ -21,11 +21,13 @@ final class ProjectSetExternalOAuthActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'setExternalOAuth'; /** + * * @var ?string */ protected $action; /** + * * @var ?ExternalOAuth */ protected $externalOAuth; @@ -35,13 +37,15 @@ final class ProjectSetExternalOAuthActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?ExternalOAuth $externalOAuth = null + ?ExternalOAuth $externalOAuth = null, + ?string $action = null ) { $this->externalOAuth = $externalOAuth; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|ExternalOAuth */ public function getExternalOAuth() diff --git a/lib/commercetools-api/src/Models/Project/ProjectSetShippingRateInputTypeAction.php b/lib/commercetools-api/src/Models/Project/ProjectSetShippingRateInputTypeAction.php index 036589fe4e7..bb0e31c1b49 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectSetShippingRateInputTypeAction.php +++ b/lib/commercetools-api/src/Models/Project/ProjectSetShippingRateInputTypeAction.php @@ -18,6 +18,7 @@ interface ProjectSetShippingRateInputTypeAction extends ProjectUpdateAction /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|ShippingRateInputType */ public function getShippingRateInputType(); diff --git a/lib/commercetools-api/src/Models/Project/ProjectSetShippingRateInputTypeActionBuilder.php b/lib/commercetools-api/src/Models/Project/ProjectSetShippingRateInputTypeActionBuilder.php index 2939b67b604..780d75880cf 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectSetShippingRateInputTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Project/ProjectSetShippingRateInputTypeActionBuilder.php @@ -21,6 +21,7 @@ final class ProjectSetShippingRateInputTypeActionBuilder implements Builder { /** + * @var null|ShippingRateInputType|ShippingRateInputTypeBuilder */ private $shippingRateInputType; @@ -28,6 +29,7 @@ final class ProjectSetShippingRateInputTypeActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|ShippingRateInputType */ public function getShippingRateInputType() diff --git a/lib/commercetools-api/src/Models/Project/ProjectSetShippingRateInputTypeActionModel.php b/lib/commercetools-api/src/Models/Project/ProjectSetShippingRateInputTypeActionModel.php index 68f3d2928b9..0ec20378fde 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectSetShippingRateInputTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectSetShippingRateInputTypeActionModel.php @@ -21,11 +21,13 @@ final class ProjectSetShippingRateInputTypeActionModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'setShippingRateInputType'; /** + * * @var ?string */ protected $action; /** + * * @var ?ShippingRateInputType */ protected $shippingRateInputType; @@ -35,13 +37,15 @@ final class ProjectSetShippingRateInputTypeActionModel extends JsonObjectModel i * @psalm-suppress MissingParamType */ public function __construct( - ?ShippingRateInputType $shippingRateInputType = null + ?ShippingRateInputType $shippingRateInputType = null, + ?string $action = null ) { $this->shippingRateInputType = $shippingRateInputType; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|ShippingRateInputType */ public function getShippingRateInputType() diff --git a/lib/commercetools-api/src/Models/Project/ProjectUpdate.php b/lib/commercetools-api/src/Models/Project/ProjectUpdate.php index da296e9433e..34a76fe5135 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectUpdate.php +++ b/lib/commercetools-api/src/Models/Project/ProjectUpdate.php @@ -19,6 +19,7 @@ interface ProjectUpdate extends JsonObject /** *

    Expected version of the Project on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion(); @@ -26,6 +27,7 @@ public function getVersion(); /** *

    Update actions to be performed on the Project.

    * + * @return null|ProjectUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Project/ProjectUpdateAction.php b/lib/commercetools-api/src/Models/Project/ProjectUpdateAction.php index 69841e026f0..cd45f9b29d5 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectUpdateAction.php +++ b/lib/commercetools-api/src/Models/Project/ProjectUpdateAction.php @@ -17,6 +17,7 @@ interface ProjectUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Project/ProjectUpdateActionModel.php b/lib/commercetools-api/src/Models/Project/ProjectUpdateActionModel.php index a133e9ac03a..19e64ed4154 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectUpdateActionModel.php @@ -37,6 +37,7 @@ final class ProjectUpdateActionModel extends JsonObjectModel implements ProjectU 'changeCurrencies' => ProjectChangeCurrenciesActionModel::class, 'changeLanguages' => ProjectChangeLanguagesActionModel::class, 'changeMessagesConfiguration' => ProjectChangeMessagesConfigurationActionModel::class, + 'changeMyBusinessUnitStatusOnCreation' => ProjectChangeBusinessUnitStatusOnCreationActionModel::class, 'changeName' => ProjectChangeNameActionModel::class, 'changeOrderSearchStatus' => ProjectChangeOrderSearchStatusActionModel::class, 'changeProductSearchIndexingEnabled' => ProjectChangeProductSearchIndexingEnabledActionModel::class, diff --git a/lib/commercetools-api/src/Models/Project/ProjectUpdateBuilder.php b/lib/commercetools-api/src/Models/Project/ProjectUpdateBuilder.php index 29141bb3d7a..123a7006a97 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Project/ProjectUpdateBuilder.php @@ -21,11 +21,13 @@ final class ProjectUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?ProjectUpdateActionCollection */ private $actions; @@ -33,6 +35,7 @@ final class ProjectUpdateBuilder implements Builder /** *

    Expected version of the Project on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion() @@ -43,6 +46,7 @@ public function getVersion() /** *

    Update actions to be performed on the Project.

    * + * @return null|ProjectUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Project/ProjectUpdateModel.php b/lib/commercetools-api/src/Models/Project/ProjectUpdateModel.php index 091c8cd4689..860a482b811 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectUpdateModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectUpdateModel.php @@ -20,11 +20,13 @@ final class ProjectUpdateModel extends JsonObjectModel implements ProjectUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?ProjectUpdateActionCollection */ protected $actions; @@ -44,6 +46,7 @@ public function __construct( /** *

    Expected version of the Project on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * * @return null|int */ public function getVersion() @@ -63,6 +66,7 @@ public function getVersion() /** *

    Update actions to be performed on the Project.

    * + * * @return null|ProjectUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Project/SearchIndexingConfiguration.php b/lib/commercetools-api/src/Models/Project/SearchIndexingConfiguration.php index 248bf340fdb..b9bc461741a 100644 --- a/lib/commercetools-api/src/Models/Project/SearchIndexingConfiguration.php +++ b/lib/commercetools-api/src/Models/Project/SearchIndexingConfiguration.php @@ -19,6 +19,7 @@ interface SearchIndexingConfiguration extends JsonObject /** *

    Configuration for the Product Projection Search and Product Suggestions endpoints.

    * + * @return null|SearchIndexingConfigurationValues */ public function getProducts(); @@ -26,6 +27,7 @@ public function getProducts(); /** *

    Configuration for the Order Search feature.

    * + * @return null|SearchIndexingConfigurationValues */ public function getOrders(); diff --git a/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationBuilder.php b/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationBuilder.php index dc735f24f7a..ec5edf6f42c 100644 --- a/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationBuilder.php +++ b/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationBuilder.php @@ -21,11 +21,13 @@ final class SearchIndexingConfigurationBuilder implements Builder { /** + * @var null|SearchIndexingConfigurationValues|SearchIndexingConfigurationValuesBuilder */ private $products; /** + * @var null|SearchIndexingConfigurationValues|SearchIndexingConfigurationValuesBuilder */ private $orders; @@ -33,6 +35,7 @@ final class SearchIndexingConfigurationBuilder implements Builder /** *

    Configuration for the Product Projection Search and Product Suggestions endpoints.

    * + * @return null|SearchIndexingConfigurationValues */ public function getProducts() @@ -43,6 +46,7 @@ public function getProducts() /** *

    Configuration for the Order Search feature.

    * + * @return null|SearchIndexingConfigurationValues */ public function getOrders() diff --git a/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationModel.php b/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationModel.php index e804263091f..eb141a0297c 100644 --- a/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationModel.php +++ b/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationModel.php @@ -20,11 +20,13 @@ final class SearchIndexingConfigurationModel extends JsonObjectModel implements SearchIndexingConfiguration { /** + * * @var ?SearchIndexingConfigurationValues */ protected $products; /** + * * @var ?SearchIndexingConfigurationValues */ protected $orders; @@ -44,6 +46,7 @@ public function __construct( /** *

    Configuration for the Product Projection Search and Product Suggestions endpoints.

    * + * * @return null|SearchIndexingConfigurationValues */ public function getProducts() @@ -64,6 +67,7 @@ public function getProducts() /** *

    Configuration for the Order Search feature.

    * + * * @return null|SearchIndexingConfigurationValues */ public function getOrders() diff --git a/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationValues.php b/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationValues.php index 7efa4167517..abe1d372eb5 100644 --- a/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationValues.php +++ b/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationValues.php @@ -22,6 +22,7 @@ interface SearchIndexingConfigurationValues extends JsonObject /** *

    Current status of resource indexing. Present on Projects from 1 February 2019.

    * + * @return null|string */ public function getStatus(); @@ -29,6 +30,7 @@ public function getStatus(); /** *

    Date and time (UTC) the Project was last updated. Only present on Projects last modified after 1 February 2019.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -36,6 +38,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); diff --git a/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationValuesBuilder.php b/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationValuesBuilder.php index 02bbba01c24..c9b4c109c8f 100644 --- a/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationValuesBuilder.php +++ b/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationValuesBuilder.php @@ -24,16 +24,19 @@ final class SearchIndexingConfigurationValuesBuilder implements Builder { /** + * @var ?string */ private $status; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; @@ -41,6 +44,7 @@ final class SearchIndexingConfigurationValuesBuilder implements Builder /** *

    Current status of resource indexing. Present on Projects from 1 February 2019.

    * + * @return null|string */ public function getStatus() @@ -51,6 +55,7 @@ public function getStatus() /** *

    Date and time (UTC) the Project was last updated. Only present on Projects last modified after 1 February 2019.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -61,6 +66,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() diff --git a/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationValuesModel.php b/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationValuesModel.php index 025cdc088d3..a6744420847 100644 --- a/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationValuesModel.php +++ b/lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationValuesModel.php @@ -23,16 +23,19 @@ final class SearchIndexingConfigurationValuesModel extends JsonObjectModel implements SearchIndexingConfigurationValues { /** + * * @var ?string */ protected $status; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; @@ -54,6 +57,7 @@ public function __construct( /** *

    Current status of resource indexing. Present on Projects from 1 February 2019.

    * + * * @return null|string */ public function getStatus() @@ -73,6 +77,7 @@ public function getStatus() /** *

    Date and time (UTC) the Project was last updated. Only present on Projects last modified after 1 February 2019.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -96,6 +101,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() diff --git a/lib/commercetools-api/src/Models/Project/ShippingRateInputType.php b/lib/commercetools-api/src/Models/Project/ShippingRateInputType.php index 47e08d82f96..3ab29bf816a 100644 --- a/lib/commercetools-api/src/Models/Project/ShippingRateInputType.php +++ b/lib/commercetools-api/src/Models/Project/ShippingRateInputType.php @@ -17,6 +17,7 @@ interface ShippingRateInputType extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/Project/ShippingRateInputTypeModel.php b/lib/commercetools-api/src/Models/Project/ShippingRateInputTypeModel.php index 857b0581293..9efdf767258 100644 --- a/lib/commercetools-api/src/Models/Project/ShippingRateInputTypeModel.php +++ b/lib/commercetools-api/src/Models/Project/ShippingRateInputTypeModel.php @@ -21,6 +21,7 @@ final class ShippingRateInputTypeModel extends JsonObjectModel implements Shippi { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -39,11 +40,13 @@ final class ShippingRateInputTypeModel extends JsonObjectModel implements Shippi * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Project/ShoppingListsConfiguration.php b/lib/commercetools-api/src/Models/Project/ShoppingListsConfiguration.php index c15d6158c9b..8d8553f53c1 100644 --- a/lib/commercetools-api/src/Models/Project/ShoppingListsConfiguration.php +++ b/lib/commercetools-api/src/Models/Project/ShoppingListsConfiguration.php @@ -19,6 +19,7 @@ interface ShoppingListsConfiguration extends JsonObject *

    Default value for the deleteDaysAfterLastModification parameter of the ShoppingListDraft. * This field may not be present on Projects created before January 2020.

    * + * @return null|int */ public function getDeleteDaysAfterLastModification(); diff --git a/lib/commercetools-api/src/Models/Project/ShoppingListsConfigurationBuilder.php b/lib/commercetools-api/src/Models/Project/ShoppingListsConfigurationBuilder.php index 4828ca16fa8..9f631a41eda 100644 --- a/lib/commercetools-api/src/Models/Project/ShoppingListsConfigurationBuilder.php +++ b/lib/commercetools-api/src/Models/Project/ShoppingListsConfigurationBuilder.php @@ -21,6 +21,7 @@ final class ShoppingListsConfigurationBuilder implements Builder { /** + * @var ?int */ private $deleteDaysAfterLastModification; @@ -29,6 +30,7 @@ final class ShoppingListsConfigurationBuilder implements Builder *

    Default value for the deleteDaysAfterLastModification parameter of the ShoppingListDraft. * This field may not be present on Projects created before January 2020.

    * + * @return null|int */ public function getDeleteDaysAfterLastModification() diff --git a/lib/commercetools-api/src/Models/Project/ShoppingListsConfigurationModel.php b/lib/commercetools-api/src/Models/Project/ShoppingListsConfigurationModel.php index cee9250545a..61c45e9fc54 100644 --- a/lib/commercetools-api/src/Models/Project/ShoppingListsConfigurationModel.php +++ b/lib/commercetools-api/src/Models/Project/ShoppingListsConfigurationModel.php @@ -20,6 +20,7 @@ final class ShoppingListsConfigurationModel extends JsonObjectModel implements ShoppingListsConfiguration { /** + * * @var ?int */ protected $deleteDaysAfterLastModification; @@ -38,6 +39,7 @@ public function __construct( *

    Default value for the deleteDaysAfterLastModification parameter of the ShoppingListDraft. * This field may not be present on Projects created before January 2020.

    * + * * @return null|int */ public function getDeleteDaysAfterLastModification() diff --git a/lib/commercetools-api/src/Models/Quote/Quote.php b/lib/commercetools-api/src/Models/Quote/Quote.php index 8df1e150c41..ec66e70de0b 100644 --- a/lib/commercetools-api/src/Models/Quote/Quote.php +++ b/lib/commercetools-api/src/Models/Quote/Quote.php @@ -8,6 +8,7 @@ namespace Commercetools\Api\Models\Quote; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; use Commercetools\Api\Models\Cart\CustomLineItemCollection; use Commercetools\Api\Models\Cart\DirectDiscountCollection; use Commercetools\Api\Models\Cart\LineItemCollection; @@ -25,6 +26,7 @@ use Commercetools\Api\Models\Order\PaymentInfo; use Commercetools\Api\Models\QuoteRequest\QuoteRequestReference; use Commercetools\Api\Models\StagedQuote\StagedQuoteReference; +use Commercetools\Api\Models\State\StateReference; use Commercetools\Api\Models\Store\StoreKeyReference; use Commercetools\Api\Models\Type\CustomFields; use Commercetools\Base\DateTimeImmutableCollection; @@ -42,6 +44,7 @@ interface Quote extends BaseResource public const FIELD_CUSTOMER_GROUP = 'customerGroup'; public const FIELD_VALID_TO = 'validTo'; public const FIELD_SELLER_COMMENT = 'sellerComment'; + public const FIELD_BUYER_COMMENT = 'buyerComment'; public const FIELD_STORE = 'store'; public const FIELD_LINE_ITEMS = 'lineItems'; public const FIELD_CUSTOM_LINE_ITEMS = 'customLineItems'; @@ -60,10 +63,13 @@ interface Quote extends BaseResource public const FIELD_ITEM_SHIPPING_ADDRESSES = 'itemShippingAddresses'; public const FIELD_DIRECT_DISCOUNTS = 'directDiscounts'; public const FIELD_CUSTOM = 'custom'; + public const FIELD_STATE = 'state'; + public const FIELD_BUSINESS_UNIT = 'businessUnit'; /** *

    Unique identifier of the Quote.

    * + * @return null|string */ public function getId(); @@ -71,6 +77,7 @@ public function getId(); /** *

    Current version of the Quote.

    * + * @return null|int */ public function getVersion(); @@ -78,6 +85,7 @@ public function getVersion(); /** *

    User-defined unique identifier of the Quote.

    * + * @return null|string */ public function getKey(); @@ -85,6 +93,7 @@ public function getKey(); /** *

    Date and time (UTC) the Quote was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -92,6 +101,7 @@ public function getCreatedAt(); /** *

    Date and time (UTC) the Quote was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -99,6 +109,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -106,27 +117,31 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); /** - *

    The Quote Request related to this Quote.

    + *

    Quote Request related to the Quote.

    * + * @return null|QuoteRequestReference */ public function getQuoteRequest(); /** - *

    The Staged Quote related to this Quote.

    + *

    Staged Quote related to the Quote.

    * + * @return null|StagedQuoteReference */ public function getStagedQuote(); /** - *

    The Buyer who requested this Quote.

    + *

    The Buyer who requested the Quote.

    * + * @return null|CustomerReference */ public function getCustomer(); @@ -135,6 +150,7 @@ public function getCustomer(); *

    Set automatically when customer is set and the Customer is a member of a Customer Group. * Used for Product Variant price selection.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup(); @@ -142,20 +158,31 @@ public function getCustomerGroup(); /** *

    Expiration date for the Quote.

    * + * @return null|DateTimeImmutable */ public function getValidTo(); /** - *

    The text message included in the offer from the Seller.

    + *

    Message from the Seller included in the offer.

    * + * @return null|string */ public function getSellerComment(); + /** + *

    Message from the Buyer included in the renegotiation request.

    + * + + * @return null|string + */ + public function getBuyerComment(); + /** *

    The Store to which the Buyer belongs.

    * + * @return null|StoreKeyReference */ public function getStore(); @@ -163,6 +190,7 @@ public function getStore(); /** *

    The Line Items for which the Quote is requested.

    * + * @return null|LineItemCollection */ public function getLineItems(); @@ -170,14 +198,16 @@ public function getLineItems(); /** *

    The Custom Line Items for which the Quote is requested.

    * + * @return null|CustomLineItemCollection */ public function getCustomLineItems(); /** - *

    The sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). + *

    Sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property of each price.

    * + * @return null|TypedMoney */ public function getTotalPrice(); @@ -187,6 +217,7 @@ public function getTotalPrice(); * Will be set automatically in the Platform TaxMode. * For the External tax mode it will be set as soon as the external tax rates for all line items, custom line items, and shipping in the cart are set.

    * + * @return null|TaxedPrice */ public function getTaxedPrice(); @@ -195,27 +226,31 @@ public function getTaxedPrice(); *

    Used to determine the eligible ShippingMethods * and rates as well as the tax rate of the Line Items.

    * + * @return null|Address */ public function getShippingAddress(); /** - *

    The address used for invoicing.

    + *

    Address used for invoicing.

    * + * @return null|Address */ public function getBillingAddress(); /** - *

    The inventory mode of the Cart referenced in the QuoteRequestDraft.

    + *

    Inventory mode of the Cart referenced in the QuoteRequestDraft.

    * + * @return null|string */ public function getInventoryMode(); /** - *

    The tax mode of the Cart referenced in the QuoteRequestDraft.

    + *

    Tax mode of the Cart referenced in the QuoteRequestDraft.

    * + * @return null|string */ public function getTaxMode(); @@ -223,6 +258,7 @@ public function getTaxMode(); /** *

    When calculating taxes for taxedPrice, the selected mode is used for rounding.

    * + * @return null|string */ public function getTaxRoundingMode(); @@ -230,6 +266,7 @@ public function getTaxRoundingMode(); /** *

    When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

    * + * @return null|string */ public function getTaxCalculationMode(); @@ -237,6 +274,7 @@ public function getTaxCalculationMode(); /** *

    Used for Product Variant price selection.

    * + * @return null|string */ public function getCountry(); @@ -244,13 +282,15 @@ public function getCountry(); /** *

    Set automatically once the ShippingMethod is set.

    * + * @return null|ShippingInfo */ public function getShippingInfo(); /** - *

    Log of payment transactions related to this quote.

    + *

    Log of payment transactions related to the Quote.

    * + * @return null|PaymentInfo */ public function getPaymentInfo(); @@ -258,6 +298,7 @@ public function getPaymentInfo(); /** *

    Used to select a ShippingRatePriceTier.

    * + * @return null|ShippingRateInput */ public function getShippingRateInput(); @@ -268,24 +309,44 @@ public function getShippingRateInput(); * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. * Only the cart's shippingAddress is used for this.

    * + * @return null|AddressCollection */ public function getItemShippingAddresses(); /** - *

    Discounts only valid for this Quote, those cannot be associated to any other Cart or Order.

    + *

    Discounts that are only valid for the Quote and cannot be associated to any other Cart or Order.

    * + * @return null|DirectDiscountCollection */ public function getDirectDiscounts(); /** - *

    Custom Fields of this Quote.

    + *

    Custom Fields on the Quote.

    * + * @return null|CustomFields */ public function getCustom(); + /** + *

    State of the Quote. + * This reference can point to a State in a custom workflow.

    + * + + * @return null|StateReference + */ + public function getState(); + + /** + *

    The BusinessUnit for the Quote.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit(); + /** * @param ?string $id */ @@ -351,6 +412,11 @@ public function setValidTo(?DateTimeImmutable $validTo): void; */ public function setSellerComment(?string $sellerComment): void; + /** + * @param ?string $buyerComment + */ + public function setBuyerComment(?string $buyerComment): void; + /** * @param ?StoreKeyReference $store */ @@ -440,4 +506,14 @@ public function setDirectDiscounts(?DirectDiscountCollection $directDiscounts): * @param ?CustomFields $custom */ public function setCustom(?CustomFields $custom): void; + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void; + + /** + * @param ?BusinessUnitKeyReference $businessUnit + */ + public function setBusinessUnit(?BusinessUnitKeyReference $businessUnit): void; } diff --git a/lib/commercetools-api/src/Models/Quote/QuoteBuilder.php b/lib/commercetools-api/src/Models/Quote/QuoteBuilder.php index 15afde1c6fc..c9838877ac9 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteBuilder.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteBuilder.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Quote; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceBuilder; use Commercetools\Api\Models\Cart\CustomLineItemCollection; use Commercetools\Api\Models\Cart\DirectDiscountCollection; use Commercetools\Api\Models\Cart\LineItemCollection; @@ -38,6 +40,8 @@ use Commercetools\Api\Models\QuoteRequest\QuoteRequestReferenceBuilder; use Commercetools\Api\Models\StagedQuote\StagedQuoteReference; use Commercetools\Api\Models\StagedQuote\StagedQuoteReferenceBuilder; +use Commercetools\Api\Models\State\StateReference; +use Commercetools\Api\Models\State\StateReferenceBuilder; use Commercetools\Api\Models\Store\StoreKeyReference; use Commercetools\Api\Models\Store\StoreKeyReferenceBuilder; use Commercetools\Api\Models\Type\CustomFields; @@ -56,163 +60,213 @@ final class QuoteBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var ?string */ private $key; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var null|QuoteRequestReference|QuoteRequestReferenceBuilder */ private $quoteRequest; /** + * @var null|StagedQuoteReference|StagedQuoteReferenceBuilder */ private $stagedQuote; /** + * @var null|CustomerReference|CustomerReferenceBuilder */ private $customer; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $customerGroup; /** + * @var ?DateTimeImmutable */ private $validTo; /** + * @var ?string */ private $sellerComment; /** + + * @var ?string + */ + private $buyerComment; + + /** + * @var null|StoreKeyReference|StoreKeyReferenceBuilder */ private $store; /** + * @var ?LineItemCollection */ private $lineItems; /** + * @var ?CustomLineItemCollection */ private $customLineItems; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalPrice; /** + * @var null|TaxedPrice|TaxedPriceBuilder */ private $taxedPrice; /** + * @var null|Address|AddressBuilder */ private $shippingAddress; /** + * @var null|Address|AddressBuilder */ private $billingAddress; /** + * @var ?string */ private $inventoryMode; /** + * @var ?string */ private $taxMode; /** + * @var ?string */ private $taxRoundingMode; /** + * @var ?string */ private $taxCalculationMode; /** + * @var ?string */ private $country; /** + * @var null|ShippingInfo|ShippingInfoBuilder */ private $shippingInfo; /** + * @var null|PaymentInfo|PaymentInfoBuilder */ private $paymentInfo; /** + * @var null|ShippingRateInput|ShippingRateInputBuilder */ private $shippingRateInput; /** + * @var ?AddressCollection */ private $itemShippingAddresses; /** + * @var ?DirectDiscountCollection */ private $directDiscounts; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; + /** + + * @var null|StateReference|StateReferenceBuilder + */ + private $state; + + /** + + * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + */ + private $businessUnit; + /** *

    Unique identifier of the Quote.

    * + * @return null|string */ public function getId() @@ -223,6 +277,7 @@ public function getId() /** *

    Current version of the Quote.

    * + * @return null|int */ public function getVersion() @@ -233,6 +288,7 @@ public function getVersion() /** *

    Date and time (UTC) the Quote was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -243,6 +299,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the Quote was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -253,6 +310,7 @@ public function getLastModifiedAt() /** *

    User-defined unique identifier of the Quote.

    * + * @return null|string */ public function getKey() @@ -263,6 +321,7 @@ public function getKey() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -273,6 +332,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -281,8 +341,9 @@ public function getCreatedBy() } /** - *

    The Quote Request related to this Quote.

    + *

    Quote Request related to the Quote.

    * + * @return null|QuoteRequestReference */ public function getQuoteRequest() @@ -291,8 +352,9 @@ public function getQuoteRequest() } /** - *

    The Staged Quote related to this Quote.

    + *

    Staged Quote related to the Quote.

    * + * @return null|StagedQuoteReference */ public function getStagedQuote() @@ -301,8 +363,9 @@ public function getStagedQuote() } /** - *

    The Buyer who requested this Quote.

    + *

    The Buyer who requested the Quote.

    * + * @return null|CustomerReference */ public function getCustomer() @@ -314,6 +377,7 @@ public function getCustomer() *

    Set automatically when customer is set and the Customer is a member of a Customer Group. * Used for Product Variant price selection.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -324,6 +388,7 @@ public function getCustomerGroup() /** *

    Expiration date for the Quote.

    * + * @return null|DateTimeImmutable */ public function getValidTo() @@ -332,8 +397,9 @@ public function getValidTo() } /** - *

    The text message included in the offer from the Seller.

    + *

    Message from the Seller included in the offer.

    * + * @return null|string */ public function getSellerComment() @@ -341,9 +407,21 @@ public function getSellerComment() return $this->sellerComment; } + /** + *

    Message from the Buyer included in the renegotiation request.

    + * + + * @return null|string + */ + public function getBuyerComment() + { + return $this->buyerComment; + } + /** *

    The Store to which the Buyer belongs.

    * + * @return null|StoreKeyReference */ public function getStore() @@ -354,6 +432,7 @@ public function getStore() /** *

    The Line Items for which the Quote is requested.

    * + * @return null|LineItemCollection */ public function getLineItems() @@ -364,6 +443,7 @@ public function getLineItems() /** *

    The Custom Line Items for which the Quote is requested.

    * + * @return null|CustomLineItemCollection */ public function getCustomLineItems() @@ -372,9 +452,10 @@ public function getCustomLineItems() } /** - *

    The sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). + *

    Sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property of each price.

    * + * @return null|TypedMoney */ public function getTotalPrice() @@ -387,6 +468,7 @@ public function getTotalPrice() * Will be set automatically in the Platform TaxMode. * For the External tax mode it will be set as soon as the external tax rates for all line items, custom line items, and shipping in the cart are set.

    * + * @return null|TaxedPrice */ public function getTaxedPrice() @@ -398,6 +480,7 @@ public function getTaxedPrice() *

    Used to determine the eligible ShippingMethods * and rates as well as the tax rate of the Line Items.

    * + * @return null|Address */ public function getShippingAddress() @@ -406,8 +489,9 @@ public function getShippingAddress() } /** - *

    The address used for invoicing.

    + *

    Address used for invoicing.

    * + * @return null|Address */ public function getBillingAddress() @@ -416,8 +500,9 @@ public function getBillingAddress() } /** - *

    The inventory mode of the Cart referenced in the QuoteRequestDraft.

    + *

    Inventory mode of the Cart referenced in the QuoteRequestDraft.

    * + * @return null|string */ public function getInventoryMode() @@ -426,8 +511,9 @@ public function getInventoryMode() } /** - *

    The tax mode of the Cart referenced in the QuoteRequestDraft.

    + *

    Tax mode of the Cart referenced in the QuoteRequestDraft.

    * + * @return null|string */ public function getTaxMode() @@ -438,6 +524,7 @@ public function getTaxMode() /** *

    When calculating taxes for taxedPrice, the selected mode is used for rounding.

    * + * @return null|string */ public function getTaxRoundingMode() @@ -448,6 +535,7 @@ public function getTaxRoundingMode() /** *

    When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

    * + * @return null|string */ public function getTaxCalculationMode() @@ -458,6 +546,7 @@ public function getTaxCalculationMode() /** *

    Used for Product Variant price selection.

    * + * @return null|string */ public function getCountry() @@ -468,6 +557,7 @@ public function getCountry() /** *

    Set automatically once the ShippingMethod is set.

    * + * @return null|ShippingInfo */ public function getShippingInfo() @@ -476,8 +566,9 @@ public function getShippingInfo() } /** - *

    Log of payment transactions related to this quote.

    + *

    Log of payment transactions related to the Quote.

    * + * @return null|PaymentInfo */ public function getPaymentInfo() @@ -488,6 +579,7 @@ public function getPaymentInfo() /** *

    Used to select a ShippingRatePriceTier.

    * + * @return null|ShippingRateInput */ public function getShippingRateInput() @@ -501,6 +593,7 @@ public function getShippingRateInput() * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. * Only the cart's shippingAddress is used for this.

    * + * @return null|AddressCollection */ public function getItemShippingAddresses() @@ -509,8 +602,9 @@ public function getItemShippingAddresses() } /** - *

    Discounts only valid for this Quote, those cannot be associated to any other Cart or Order.

    + *

    Discounts that are only valid for the Quote and cannot be associated to any other Cart or Order.

    * + * @return null|DirectDiscountCollection */ public function getDirectDiscounts() @@ -519,8 +613,9 @@ public function getDirectDiscounts() } /** - *

    Custom Fields of this Quote.

    + *

    Custom Fields on the Quote.

    * + * @return null|CustomFields */ public function getCustom() @@ -528,6 +623,29 @@ public function getCustom() return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; } + /** + *

    State of the Quote. + * This reference can point to a State in a custom workflow.

    + * + + * @return null|StateReference + */ + public function getState() + { + return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; + } + + /** + *

    The BusinessUnit for the Quote.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit() + { + return $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit; + } + /** * @param ?string $id * @return $this @@ -671,6 +789,17 @@ public function withSellerComment(?string $sellerComment) return $this; } + /** + * @param ?string $buyerComment + * @return $this + */ + public function withBuyerComment(?string $buyerComment) + { + $this->buyerComment = $buyerComment; + + return $this; + } + /** * @param ?StoreKeyReference $store * @return $this @@ -869,6 +998,28 @@ public function withCustom(?CustomFields $custom) return $this; } + /** + * @param ?StateReference $state + * @return $this + */ + public function withState(?StateReference $state) + { + $this->state = $state; + + return $this; + } + + /** + * @param ?BusinessUnitKeyReference $businessUnit + * @return $this + */ + public function withBusinessUnit(?BusinessUnitKeyReference $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -1034,6 +1185,28 @@ public function withCustomBuilder(?CustomFieldsBuilder $custom) return $this; } + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateReferenceBuilder $state) + { + $this->state = $state; + + return $this; + } + + /** + * @deprecated use withBusinessUnit() instead + * @return $this + */ + public function withBusinessUnitBuilder(?BusinessUnitKeyReferenceBuilder $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + public function build(): Quote { return new QuoteModel( @@ -1050,6 +1223,7 @@ public function build(): Quote $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup, $this->validTo, $this->sellerComment, + $this->buyerComment, $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store, $this->lineItems, $this->customLineItems, @@ -1067,7 +1241,9 @@ public function build(): Quote $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, $this->itemShippingAddresses, $this->directDiscounts, - $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom + $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, + $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state, + $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit ); } diff --git a/lib/commercetools-api/src/Models/Quote/QuoteChangeQuoteStateAction.php b/lib/commercetools-api/src/Models/Quote/QuoteChangeQuoteStateAction.php index fa414b69fae..ddd0fb048f7 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteChangeQuoteStateAction.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteChangeQuoteStateAction.php @@ -16,8 +16,9 @@ interface QuoteChangeQuoteStateAction extends QuoteUpdateAction public const FIELD_QUOTE_STATE = 'quoteState'; /** - *

    The new quote state to be set for the Quote.

    + *

    New state to be set for the Quote.

    * + * @return null|string */ public function getQuoteState(); diff --git a/lib/commercetools-api/src/Models/Quote/QuoteChangeQuoteStateActionBuilder.php b/lib/commercetools-api/src/Models/Quote/QuoteChangeQuoteStateActionBuilder.php index 25d2bb4a143..414c53f8c4f 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteChangeQuoteStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteChangeQuoteStateActionBuilder.php @@ -21,13 +21,15 @@ final class QuoteChangeQuoteStateActionBuilder implements Builder { /** + * @var ?string */ private $quoteState; /** - *

    The new quote state to be set for the Quote.

    + *

    New state to be set for the Quote.

    * + * @return null|string */ public function getQuoteState() diff --git a/lib/commercetools-api/src/Models/Quote/QuoteChangeQuoteStateActionModel.php b/lib/commercetools-api/src/Models/Quote/QuoteChangeQuoteStateActionModel.php index 0d4e4cfed2e..851c5d83e88 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteChangeQuoteStateActionModel.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteChangeQuoteStateActionModel.php @@ -21,11 +21,13 @@ final class QuoteChangeQuoteStateActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'changeQuoteState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $quoteState; @@ -35,13 +37,15 @@ final class QuoteChangeQuoteStateActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $quoteState = null + ?string $quoteState = null, + ?string $action = null ) { $this->quoteState = $quoteState; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,7 +63,8 @@ public function getAction() } /** - *

    The new quote state to be set for the Quote.

    + *

    New state to be set for the Quote.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Quote/QuoteDraft.php b/lib/commercetools-api/src/Models/Quote/QuoteDraft.php index fc7129a58b7..b27a8c19608 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteDraft.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteDraft.php @@ -9,6 +9,7 @@ namespace Commercetools\Api\Models\Quote; use Commercetools\Api\Models\StagedQuote\StagedQuoteResourceIdentifier; +use Commercetools\Api\Models\State\StateReference; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -17,12 +18,15 @@ interface QuoteDraft extends JsonObject { public const FIELD_STAGED_QUOTE = 'stagedQuote'; public const FIELD_STAGED_QUOTE_VERSION = 'stagedQuoteVersion'; + public const FIELD_STAGED_QUOTE_STATE_TO_SENT = 'stagedQuoteStateToSent'; public const FIELD_KEY = 'key'; public const FIELD_CUSTOM = 'custom'; + public const FIELD_STATE = 'state'; /** - *

    The StagedQuote from which this Quote is created.

    + *

    StagedQuote from which the Quote is created.

    * + * @return null|StagedQuoteResourceIdentifier */ public function getStagedQuote(); @@ -30,13 +34,23 @@ public function getStagedQuote(); /** *

    Current version of the StagedQuote.

    * + * @return null|int */ public function getStagedQuoteVersion(); + /** + *

    If true, the stagedQuoteState of the referenced StagedQuote will be set to Sent.

    + * + + * @return null|bool + */ + public function getStagedQuoteStateToSent(); + /** *

    User-defined unique identifier for the Quote.

    * + * @return null|string */ public function getKey(); @@ -48,10 +62,20 @@ public function getKey(); *
  • If empty, the Custom Fields on the referenced StagedQuote are added to the Quote automatically.
  • * * + * @return null|CustomFieldsDraft */ public function getCustom(); + /** + *

    State of the Quote. + * This reference can point to a State in a custom workflow.

    + * + + * @return null|StateReference + */ + public function getState(); + /** * @param ?StagedQuoteResourceIdentifier $stagedQuote */ @@ -62,6 +86,11 @@ public function setStagedQuote(?StagedQuoteResourceIdentifier $stagedQuote): voi */ public function setStagedQuoteVersion(?int $stagedQuoteVersion): void; + /** + * @param ?bool $stagedQuoteStateToSent + */ + public function setStagedQuoteStateToSent(?bool $stagedQuoteStateToSent): void; + /** * @param ?string $key */ @@ -71,4 +100,9 @@ public function setKey(?string $key): void; * @param ?CustomFieldsDraft $custom */ public function setCustom(?CustomFieldsDraft $custom): void; + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void; } diff --git a/lib/commercetools-api/src/Models/Quote/QuoteDraftBuilder.php b/lib/commercetools-api/src/Models/Quote/QuoteDraftBuilder.php index d235384646a..a8ee2349275 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteDraftBuilder.php @@ -10,6 +10,8 @@ use Commercetools\Api\Models\StagedQuote\StagedQuoteResourceIdentifier; use Commercetools\Api\Models\StagedQuote\StagedQuoteResourceIdentifierBuilder; +use Commercetools\Api\Models\State\StateReference; +use Commercetools\Api\Models\State\StateReferenceBuilder; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Api\Models\Type\CustomFieldsDraftBuilder; use Commercetools\Base\Builder; @@ -25,28 +27,45 @@ final class QuoteDraftBuilder implements Builder { /** + * @var null|StagedQuoteResourceIdentifier|StagedQuoteResourceIdentifierBuilder */ private $stagedQuote; /** + * @var ?int */ private $stagedQuoteVersion; /** + + * @var ?bool + */ + private $stagedQuoteStateToSent; + + /** + * @var ?string */ private $key; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** - *

    The StagedQuote from which this Quote is created.

    + + * @var null|StateReference|StateReferenceBuilder + */ + private $state; + + /** + *

    StagedQuote from which the Quote is created.

    * + * @return null|StagedQuoteResourceIdentifier */ public function getStagedQuote() @@ -57,6 +76,7 @@ public function getStagedQuote() /** *

    Current version of the StagedQuote.

    * + * @return null|int */ public function getStagedQuoteVersion() @@ -64,9 +84,21 @@ public function getStagedQuoteVersion() return $this->stagedQuoteVersion; } + /** + *

    If true, the stagedQuoteState of the referenced StagedQuote will be set to Sent.

    + * + + * @return null|bool + */ + public function getStagedQuoteStateToSent() + { + return $this->stagedQuoteStateToSent; + } + /** *

    User-defined unique identifier for the Quote.

    * + * @return null|string */ public function getKey() @@ -81,6 +113,7 @@ public function getKey() *
  • If empty, the Custom Fields on the referenced StagedQuote are added to the Quote automatically.
  • * * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -88,6 +121,18 @@ public function getCustom() return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } + /** + *

    State of the Quote. + * This reference can point to a State in a custom workflow.

    + * + + * @return null|StateReference + */ + public function getState() + { + return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; + } + /** * @param ?StagedQuoteResourceIdentifier $stagedQuote * @return $this @@ -110,6 +155,17 @@ public function withStagedQuoteVersion(?int $stagedQuoteVersion) return $this; } + /** + * @param ?bool $stagedQuoteStateToSent + * @return $this + */ + public function withStagedQuoteStateToSent(?bool $stagedQuoteStateToSent) + { + $this->stagedQuoteStateToSent = $stagedQuoteStateToSent; + + return $this; + } + /** * @param ?string $key * @return $this @@ -132,6 +188,17 @@ public function withCustom(?CustomFieldsDraft $custom) return $this; } + /** + * @param ?StateReference $state + * @return $this + */ + public function withState(?StateReference $state) + { + $this->state = $state; + + return $this; + } + /** * @deprecated use withStagedQuote() instead * @return $this @@ -154,13 +221,26 @@ public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) return $this; } + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateReferenceBuilder $state) + { + $this->state = $state; + + return $this; + } + public function build(): QuoteDraft { return new QuoteDraftModel( $this->stagedQuote instanceof StagedQuoteResourceIdentifierBuilder ? $this->stagedQuote->build() : $this->stagedQuote, $this->stagedQuoteVersion, + $this->stagedQuoteStateToSent, $this->key, - $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, + $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state ); } diff --git a/lib/commercetools-api/src/Models/Quote/QuoteDraftModel.php b/lib/commercetools-api/src/Models/Quote/QuoteDraftModel.php index d55ffa28744..7a967c02306 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteDraftModel.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteDraftModel.php @@ -10,6 +10,8 @@ use Commercetools\Api\Models\StagedQuote\StagedQuoteResourceIdentifier; use Commercetools\Api\Models\StagedQuote\StagedQuoteResourceIdentifierModel; +use Commercetools\Api\Models\State\StateReference; +use Commercetools\Api\Models\State\StateReferenceModel; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Api\Models\Type\CustomFieldsDraftModel; use Commercetools\Base\DateTimeImmutableCollection; @@ -24,25 +26,41 @@ final class QuoteDraftModel extends JsonObjectModel implements QuoteDraft { /** + * * @var ?StagedQuoteResourceIdentifier */ protected $stagedQuote; /** + * * @var ?int */ protected $stagedQuoteVersion; /** + * + * @var ?bool + */ + protected $stagedQuoteStateToSent; + + /** + * * @var ?string */ protected $key; /** + * * @var ?CustomFieldsDraft */ protected $custom; + /** + * + * @var ?StateReference + */ + protected $state; + /** * @psalm-suppress MissingParamType @@ -50,17 +68,22 @@ final class QuoteDraftModel extends JsonObjectModel implements QuoteDraft public function __construct( ?StagedQuoteResourceIdentifier $stagedQuote = null, ?int $stagedQuoteVersion = null, + ?bool $stagedQuoteStateToSent = null, ?string $key = null, - ?CustomFieldsDraft $custom = null + ?CustomFieldsDraft $custom = null, + ?StateReference $state = null ) { $this->stagedQuote = $stagedQuote; $this->stagedQuoteVersion = $stagedQuoteVersion; + $this->stagedQuoteStateToSent = $stagedQuoteStateToSent; $this->key = $key; $this->custom = $custom; + $this->state = $state; } /** - *

    The StagedQuote from which this Quote is created.

    + *

    StagedQuote from which the Quote is created.

    + * * * @return null|StagedQuoteResourceIdentifier */ @@ -82,6 +105,7 @@ public function getStagedQuote() /** *

    Current version of the StagedQuote.

    * + * * @return null|int */ public function getStagedQuoteVersion() @@ -98,9 +122,30 @@ public function getStagedQuoteVersion() return $this->stagedQuoteVersion; } + /** + *

    If true, the stagedQuoteState of the referenced StagedQuote will be set to Sent.

    + * + * + * @return null|bool + */ + public function getStagedQuoteStateToSent() + { + if (is_null($this->stagedQuoteStateToSent)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_STAGED_QUOTE_STATE_TO_SENT); + if (is_null($data)) { + return null; + } + $this->stagedQuoteStateToSent = (bool) $data; + } + + return $this->stagedQuoteStateToSent; + } + /** *

    User-defined unique identifier for the Quote.

    * + * * @return null|string */ public function getKey() @@ -124,6 +169,7 @@ public function getKey() *
  • If empty, the Custom Fields on the referenced StagedQuote are added to the Quote automatically.
  • * * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -141,6 +187,28 @@ public function getCustom() return $this->custom; } + /** + *

    State of the Quote. + * This reference can point to a State in a custom workflow.

    + * + * + * @return null|StateReference + */ + public function getState() + { + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); + if (is_null($data)) { + return null; + } + + $this->state = StateReferenceModel::of($data); + } + + return $this->state; + } + /** * @param ?StagedQuoteResourceIdentifier $stagedQuote @@ -158,6 +226,14 @@ public function setStagedQuoteVersion(?int $stagedQuoteVersion): void $this->stagedQuoteVersion = $stagedQuoteVersion; } + /** + * @param ?bool $stagedQuoteStateToSent + */ + public function setStagedQuoteStateToSent(?bool $stagedQuoteStateToSent): void + { + $this->stagedQuoteStateToSent = $stagedQuoteStateToSent; + } + /** * @param ?string $key */ @@ -173,4 +249,12 @@ public function setCustom(?CustomFieldsDraft $custom): void { $this->custom = $custom; } + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void + { + $this->state = $state; + } } diff --git a/lib/commercetools-api/src/Models/Quote/QuoteModel.php b/lib/commercetools-api/src/Models/Quote/QuoteModel.php index 5da92223f1a..6cc1fd7e0d3 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteModel.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteModel.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\Quote; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceModel; use Commercetools\Api\Models\Cart\CustomLineItemCollection; use Commercetools\Api\Models\Cart\DirectDiscountCollection; use Commercetools\Api\Models\Cart\LineItemCollection; @@ -38,6 +40,8 @@ use Commercetools\Api\Models\QuoteRequest\QuoteRequestReferenceModel; use Commercetools\Api\Models\StagedQuote\StagedQuoteReference; use Commercetools\Api\Models\StagedQuote\StagedQuoteReferenceModel; +use Commercetools\Api\Models\State\StateReference; +use Commercetools\Api\Models\State\StateReferenceModel; use Commercetools\Api\Models\Store\StoreKeyReference; use Commercetools\Api\Models\Store\StoreKeyReferenceModel; use Commercetools\Api\Models\Type\CustomFields; @@ -55,160 +59,209 @@ final class QuoteModel extends JsonObjectModel implements Quote { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?string */ protected $key; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?QuoteRequestReference */ protected $quoteRequest; /** + * * @var ?StagedQuoteReference */ protected $stagedQuote; /** + * * @var ?CustomerReference */ protected $customer; /** + * * @var ?CustomerGroupReference */ protected $customerGroup; /** + * * @var ?DateTimeImmutable */ protected $validTo; /** + * * @var ?string */ protected $sellerComment; /** + * + * @var ?string + */ + protected $buyerComment; + + /** + * * @var ?StoreKeyReference */ protected $store; /** + * * @var ?LineItemCollection */ protected $lineItems; /** + * * @var ?CustomLineItemCollection */ protected $customLineItems; /** + * * @var ?TypedMoney */ protected $totalPrice; /** + * * @var ?TaxedPrice */ protected $taxedPrice; /** + * * @var ?Address */ protected $shippingAddress; /** + * * @var ?Address */ protected $billingAddress; /** + * * @var ?string */ protected $inventoryMode; /** + * * @var ?string */ protected $taxMode; /** + * * @var ?string */ protected $taxRoundingMode; /** + * * @var ?string */ protected $taxCalculationMode; /** + * * @var ?string */ protected $country; /** + * * @var ?ShippingInfo */ protected $shippingInfo; /** + * * @var ?PaymentInfo */ protected $paymentInfo; /** + * * @var ?ShippingRateInput */ protected $shippingRateInput; /** + * * @var ?AddressCollection */ protected $itemShippingAddresses; /** + * * @var ?DirectDiscountCollection */ protected $directDiscounts; /** + * * @var ?CustomFields */ protected $custom; + /** + * + * @var ?StateReference + */ + protected $state; + + /** + * + * @var ?BusinessUnitKeyReference + */ + protected $businessUnit; + /** * @psalm-suppress MissingParamType @@ -227,6 +280,7 @@ public function __construct( ?CustomerGroupReference $customerGroup = null, ?DateTimeImmutable $validTo = null, ?string $sellerComment = null, + ?string $buyerComment = null, ?StoreKeyReference $store = null, ?LineItemCollection $lineItems = null, ?CustomLineItemCollection $customLineItems = null, @@ -244,7 +298,9 @@ public function __construct( ?ShippingRateInput $shippingRateInput = null, ?AddressCollection $itemShippingAddresses = null, ?DirectDiscountCollection $directDiscounts = null, - ?CustomFields $custom = null + ?CustomFields $custom = null, + ?StateReference $state = null, + ?BusinessUnitKeyReference $businessUnit = null ) { $this->id = $id; $this->version = $version; @@ -259,6 +315,7 @@ public function __construct( $this->customerGroup = $customerGroup; $this->validTo = $validTo; $this->sellerComment = $sellerComment; + $this->buyerComment = $buyerComment; $this->store = $store; $this->lineItems = $lineItems; $this->customLineItems = $customLineItems; @@ -277,11 +334,14 @@ public function __construct( $this->itemShippingAddresses = $itemShippingAddresses; $this->directDiscounts = $directDiscounts; $this->custom = $custom; + $this->state = $state; + $this->businessUnit = $businessUnit; } /** *

    Unique identifier of the Quote.

    * + * * @return null|string */ public function getId() @@ -301,6 +361,7 @@ public function getId() /** *

    Current version of the Quote.

    * + * * @return null|int */ public function getVersion() @@ -320,6 +381,7 @@ public function getVersion() /** *

    Date and time (UTC) the Quote was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -343,6 +405,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the Quote was last updated.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -366,6 +429,7 @@ public function getLastModifiedAt() /** *

    User-defined unique identifier of the Quote.

    * + * * @return null|string */ public function getKey() @@ -385,6 +449,7 @@ public function getKey() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -405,6 +470,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -423,7 +489,8 @@ public function getCreatedBy() } /** - *

    The Quote Request related to this Quote.

    + *

    Quote Request related to the Quote.

    + * * * @return null|QuoteRequestReference */ @@ -443,7 +510,8 @@ public function getQuoteRequest() } /** - *

    The Staged Quote related to this Quote.

    + *

    Staged Quote related to the Quote.

    + * * * @return null|StagedQuoteReference */ @@ -463,7 +531,8 @@ public function getStagedQuote() } /** - *

    The Buyer who requested this Quote.

    + *

    The Buyer who requested the Quote.

    + * * * @return null|CustomerReference */ @@ -486,6 +555,7 @@ public function getCustomer() *

    Set automatically when customer is set and the Customer is a member of a Customer Group. * Used for Product Variant price selection.

    * + * * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -506,6 +576,7 @@ public function getCustomerGroup() /** *

    Expiration date for the Quote.

    * + * * @return null|DateTimeImmutable */ public function getValidTo() @@ -527,7 +598,8 @@ public function getValidTo() } /** - *

    The text message included in the offer from the Seller.

    + *

    Message from the Seller included in the offer.

    + * * * @return null|string */ @@ -545,9 +617,30 @@ public function getSellerComment() return $this->sellerComment; } + /** + *

    Message from the Buyer included in the renegotiation request.

    + * + * + * @return null|string + */ + public function getBuyerComment() + { + if (is_null($this->buyerComment)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_BUYER_COMMENT); + if (is_null($data)) { + return null; + } + $this->buyerComment = (string) $data; + } + + return $this->buyerComment; + } + /** *

    The Store to which the Buyer belongs.

    * + * * @return null|StoreKeyReference */ public function getStore() @@ -568,6 +661,7 @@ public function getStore() /** *

    The Line Items for which the Quote is requested.

    * + * * @return null|LineItemCollection */ public function getLineItems() @@ -587,6 +681,7 @@ public function getLineItems() /** *

    The Custom Line Items for which the Quote is requested.

    * + * * @return null|CustomLineItemCollection */ public function getCustomLineItems() @@ -604,9 +699,10 @@ public function getCustomLineItems() } /** - *

    The sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). + *

    Sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property of each price.

    * + * * @return null|TypedMoney */ public function getTotalPrice() @@ -629,6 +725,7 @@ public function getTotalPrice() * Will be set automatically in the Platform TaxMode. * For the External tax mode it will be set as soon as the external tax rates for all line items, custom line items, and shipping in the cart are set.

    * + * * @return null|TaxedPrice */ public function getTaxedPrice() @@ -650,6 +747,7 @@ public function getTaxedPrice() *

    Used to determine the eligible ShippingMethods * and rates as well as the tax rate of the Line Items.

    * + * * @return null|Address */ public function getShippingAddress() @@ -668,7 +766,8 @@ public function getShippingAddress() } /** - *

    The address used for invoicing.

    + *

    Address used for invoicing.

    + * * * @return null|Address */ @@ -688,7 +787,8 @@ public function getBillingAddress() } /** - *

    The inventory mode of the Cart referenced in the QuoteRequestDraft.

    + *

    Inventory mode of the Cart referenced in the QuoteRequestDraft.

    + * * * @return null|string */ @@ -707,7 +807,8 @@ public function getInventoryMode() } /** - *

    The tax mode of the Cart referenced in the QuoteRequestDraft.

    + *

    Tax mode of the Cart referenced in the QuoteRequestDraft.

    + * * * @return null|string */ @@ -728,6 +829,7 @@ public function getTaxMode() /** *

    When calculating taxes for taxedPrice, the selected mode is used for rounding.

    * + * * @return null|string */ public function getTaxRoundingMode() @@ -747,6 +849,7 @@ public function getTaxRoundingMode() /** *

    When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

    * + * * @return null|string */ public function getTaxCalculationMode() @@ -766,6 +869,7 @@ public function getTaxCalculationMode() /** *

    Used for Product Variant price selection.

    * + * * @return null|string */ public function getCountry() @@ -785,6 +889,7 @@ public function getCountry() /** *

    Set automatically once the ShippingMethod is set.

    * + * * @return null|ShippingInfo */ public function getShippingInfo() @@ -803,7 +908,8 @@ public function getShippingInfo() } /** - *

    Log of payment transactions related to this quote.

    + *

    Log of payment transactions related to the Quote.

    + * * * @return null|PaymentInfo */ @@ -825,6 +931,7 @@ public function getPaymentInfo() /** *

    Used to select a ShippingRatePriceTier.

    * + * * @return null|ShippingRateInput */ public function getShippingRateInput() @@ -848,6 +955,7 @@ public function getShippingRateInput() * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. * Only the cart's shippingAddress is used for this.

    * + * * @return null|AddressCollection */ public function getItemShippingAddresses() @@ -865,7 +973,8 @@ public function getItemShippingAddresses() } /** - *

    Discounts only valid for this Quote, those cannot be associated to any other Cart or Order.

    + *

    Discounts that are only valid for the Quote and cannot be associated to any other Cart or Order.

    + * * * @return null|DirectDiscountCollection */ @@ -884,7 +993,8 @@ public function getDirectDiscounts() } /** - *

    Custom Fields of this Quote.

    + *

    Custom Fields on the Quote.

    + * * * @return null|CustomFields */ @@ -903,6 +1013,49 @@ public function getCustom() return $this->custom; } + /** + *

    State of the Quote. + * This reference can point to a State in a custom workflow.

    + * + * + * @return null|StateReference + */ + public function getState() + { + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); + if (is_null($data)) { + return null; + } + + $this->state = StateReferenceModel::of($data); + } + + return $this->state; + } + + /** + *

    The BusinessUnit for the Quote.

    + * + * + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit() + { + if (is_null($this->businessUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BUSINESS_UNIT); + if (is_null($data)) { + return null; + } + + $this->businessUnit = BusinessUnitKeyReferenceModel::of($data); + } + + return $this->businessUnit; + } + /** * @param ?string $id @@ -1008,6 +1161,14 @@ public function setSellerComment(?string $sellerComment): void $this->sellerComment = $sellerComment; } + /** + * @param ?string $buyerComment + */ + public function setBuyerComment(?string $buyerComment): void + { + $this->buyerComment = $buyerComment; + } + /** * @param ?StoreKeyReference $store */ @@ -1152,6 +1313,22 @@ public function setCustom(?CustomFields $custom): void $this->custom = $custom; } + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void + { + $this->state = $state; + } + + /** + * @param ?BusinessUnitKeyReference $businessUnit + */ + public function setBusinessUnit(?BusinessUnitKeyReference $businessUnit): void + { + $this->businessUnit = $businessUnit; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/Quote/QuotePagedQueryResponse.php b/lib/commercetools-api/src/Models/Quote/QuotePagedQueryResponse.php index 730b877852a..05c8340c907 100644 --- a/lib/commercetools-api/src/Models/Quote/QuotePagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Quote/QuotePagedQueryResponse.php @@ -22,6 +22,7 @@ interface QuotePagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    Quotes matching the query.

    * + * @return null|QuoteCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/Quote/QuotePagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Quote/QuotePagedQueryResponseBuilder.php index 3ef80a62e22..62caf0eaa86 100644 --- a/lib/commercetools-api/src/Models/Quote/QuotePagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Quote/QuotePagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class QuotePagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?QuoteCollection */ private $results; @@ -48,6 +53,7 @@ final class QuotePagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    Quotes matching the query.

    * + * @return null|QuoteCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Quote/QuotePagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Quote/QuotePagedQueryResponseModel.php index 4468fd769c2..8e931c16877 100644 --- a/lib/commercetools-api/src/Models/Quote/QuotePagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Quote/QuotePagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class QuotePagedQueryResponseModel extends JsonObjectModel implements QuotePagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?QuoteCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    Quotes matching the query.

    * + * * @return null|QuoteCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Quote/QuoteReference.php b/lib/commercetools-api/src/Models/Quote/QuoteReference.php index 4d4f6cedfb4..4b0f69fac21 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteReference.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteReference.php @@ -20,6 +20,7 @@ interface QuoteReference extends Reference *

    Contains the representation of the expanded Quote. * Only present in responses to requests with Reference Expansion for Quote.

    * + * @return null|Quote */ public function getObj(); diff --git a/lib/commercetools-api/src/Models/Quote/QuoteReferenceBuilder.php b/lib/commercetools-api/src/Models/Quote/QuoteReferenceBuilder.php index e2583aec891..45cd1ee85d9 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteReferenceBuilder.php @@ -23,11 +23,13 @@ final class QuoteReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|Quote|QuoteBuilder */ private $obj; @@ -35,6 +37,7 @@ final class QuoteReferenceBuilder implements Builder /** *

    Unique ID of the referenced resource.

    * + * @return null|string */ public function getId() @@ -46,6 +49,7 @@ public function getId() *

    Contains the representation of the expanded Quote. * Only present in responses to requests with Reference Expansion for Quote.

    * + * @return null|Quote */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Quote/QuoteReferenceModel.php b/lib/commercetools-api/src/Models/Quote/QuoteReferenceModel.php index 45eac5142f5..6b14b34ab93 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteReferenceModel.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteReferenceModel.php @@ -23,16 +23,19 @@ final class QuoteReferenceModel extends JsonObjectModel implements QuoteReferenc { public const DISCRIMINATOR_VALUE = 'quote'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?Quote */ protected $obj; @@ -43,16 +46,18 @@ final class QuoteReferenceModel extends JsonObjectModel implements QuoteReferenc */ public function __construct( ?string $id = null, - ?Quote $obj = null + ?Quote $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique ID of the referenced resource.

    * + * * @return null|string */ public function getId() @@ -92,6 +98,7 @@ public function getId() *

    Contains the representation of the expanded Quote. * Only present in responses to requests with Reference Expansion for Quote.

    * + * * @return null|Quote */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Quote/QuoteRequestQuoteRenegotiationAction.php b/lib/commercetools-api/src/Models/Quote/QuoteRequestQuoteRenegotiationAction.php new file mode 100644 index 00000000000..ea0836685f7 --- /dev/null +++ b/lib/commercetools-api/src/Models/Quote/QuoteRequestQuoteRenegotiationAction.php @@ -0,0 +1,30 @@ +Message from the Buyer regarding the Quote renegotiation request.

    + * + + * @return null|string + */ + public function getBuyerComment(); + + /** + * @param ?string $buyerComment + */ + public function setBuyerComment(?string $buyerComment): void; +} diff --git a/lib/commercetools-api/src/Models/Quote/QuoteRequestQuoteRenegotiationActionBuilder.php b/lib/commercetools-api/src/Models/Quote/QuoteRequestQuoteRenegotiationActionBuilder.php new file mode 100644 index 00000000000..7f548b42760 --- /dev/null +++ b/lib/commercetools-api/src/Models/Quote/QuoteRequestQuoteRenegotiationActionBuilder.php @@ -0,0 +1,63 @@ + + */ +final class QuoteRequestQuoteRenegotiationActionBuilder implements Builder +{ + /** + + * @var ?string + */ + private $buyerComment; + + /** + *

    Message from the Buyer regarding the Quote renegotiation request.

    + * + + * @return null|string + */ + public function getBuyerComment() + { + return $this->buyerComment; + } + + /** + * @param ?string $buyerComment + * @return $this + */ + public function withBuyerComment(?string $buyerComment) + { + $this->buyerComment = $buyerComment; + + return $this; + } + + + public function build(): QuoteRequestQuoteRenegotiationAction + { + return new QuoteRequestQuoteRenegotiationActionModel( + $this->buyerComment + ); + } + + public static function of(): QuoteRequestQuoteRenegotiationActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Quote/QuoteRequestQuoteRenegotiationActionCollection.php b/lib/commercetools-api/src/Models/Quote/QuoteRequestQuoteRenegotiationActionCollection.php new file mode 100644 index 00000000000..54abae09005 --- /dev/null +++ b/lib/commercetools-api/src/Models/Quote/QuoteRequestQuoteRenegotiationActionCollection.php @@ -0,0 +1,56 @@ + + * @method QuoteRequestQuoteRenegotiationAction current() + * @method QuoteRequestQuoteRenegotiationAction end() + * @method QuoteRequestQuoteRenegotiationAction at($offset) + */ +class QuoteRequestQuoteRenegotiationActionCollection extends QuoteUpdateActionCollection +{ + /** + * @psalm-assert QuoteRequestQuoteRenegotiationAction $value + * @psalm-param QuoteRequestQuoteRenegotiationAction|stdClass $value + * @throws InvalidArgumentException + * + * @return QuoteRequestQuoteRenegotiationActionCollection + */ + public function add($value) + { + if (!$value instanceof QuoteRequestQuoteRenegotiationAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?QuoteRequestQuoteRenegotiationAction + */ + protected function mapper() + { + return function (?int $index): ?QuoteRequestQuoteRenegotiationAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var QuoteRequestQuoteRenegotiationAction $data */ + $data = QuoteRequestQuoteRenegotiationActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Quote/QuoteRequestQuoteRenegotiationActionModel.php b/lib/commercetools-api/src/Models/Quote/QuoteRequestQuoteRenegotiationActionModel.php new file mode 100644 index 00000000000..bd497844e55 --- /dev/null +++ b/lib/commercetools-api/src/Models/Quote/QuoteRequestQuoteRenegotiationActionModel.php @@ -0,0 +1,93 @@ +buyerComment = $buyerComment; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    Message from the Buyer regarding the Quote renegotiation request.

    + * + * + * @return null|string + */ + public function getBuyerComment() + { + if (is_null($this->buyerComment)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_BUYER_COMMENT); + if (is_null($data)) { + return null; + } + $this->buyerComment = (string) $data; + } + + return $this->buyerComment; + } + + + /** + * @param ?string $buyerComment + */ + public function setBuyerComment(?string $buyerComment): void + { + $this->buyerComment = $buyerComment; + } +} diff --git a/lib/commercetools-api/src/Models/Quote/QuoteResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/Quote/QuoteResourceIdentifierBuilder.php index 34dda347f16..51b43a9ee13 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class QuoteResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class QuoteResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced resource. Required if key is absent.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced resource. Required if id is absent.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Quote/QuoteResourceIdentifierModel.php b/lib/commercetools-api/src/Models/Quote/QuoteResourceIdentifierModel.php index 3a82dce61f2..726893019b5 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class QuoteResourceIdentifierModel extends JsonObjectModel implements Quot { public const DISCRIMINATOR_VALUE = 'quote'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class QuoteResourceIdentifierModel extends JsonObjectModel implements Quot */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced resource. Required if key is absent.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced resource. Required if id is absent.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Quote/QuoteSetCustomFieldAction.php b/lib/commercetools-api/src/Models/Quote/QuoteSetCustomFieldAction.php index 315c0513cbf..9cdccc353c2 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface QuoteSetCustomFieldAction extends QuoteUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Quote/QuoteSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Quote/QuoteSetCustomFieldActionBuilder.php index def34b6d706..254176de29b 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class QuoteSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class QuoteSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Quote/QuoteSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Quote/QuoteSetCustomFieldActionModel.php index 1d218d5a7d5..64b069b3271 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class QuoteSetCustomFieldActionModel extends JsonObjectModel implements Qu { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class QuoteSetCustomFieldActionModel extends JsonObjectModel implements Qu */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Quote/QuoteSetCustomTypeAction.php b/lib/commercetools-api/src/Models/Quote/QuoteSetCustomTypeAction.php index dd9933d8eaa..73935238abf 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface QuoteSetCustomTypeAction extends QuoteUpdateAction *

    Defines the Type that extends the Quote with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Quote.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the Quote.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Quote/QuoteSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Quote/QuoteSetCustomTypeActionBuilder.php index 2213058b550..80e1b71aa61 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class QuoteSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class QuoteSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the Quote with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Quote.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Quote.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Quote/QuoteSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Quote/QuoteSetCustomTypeActionModel.php index ad335417592..fff067b7e69 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class QuoteSetCustomTypeActionModel extends JsonObjectModel implements Quo { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class QuoteSetCustomTypeActionModel extends JsonObjectModel implements Quo */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the Quote with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Quote.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Quote.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Quote/QuoteTransitionStateAction.php b/lib/commercetools-api/src/Models/Quote/QuoteTransitionStateAction.php new file mode 100644 index 00000000000..e9bdf808cc6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Quote/QuoteTransitionStateAction.php @@ -0,0 +1,46 @@ +Value to set. + * If there is no State yet, this must be an initial State.

    + * + + * @return null|StateResourceIdentifier + */ + public function getState(); + + /** + *

    Switch validations on or off.

    + * + + * @return null|bool + */ + public function getForce(); + + /** + * @param ?StateResourceIdentifier $state + */ + public function setState(?StateResourceIdentifier $state): void; + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void; +} diff --git a/lib/commercetools-api/src/Models/Quote/QuoteTransitionStateActionBuilder.php b/lib/commercetools-api/src/Models/Quote/QuoteTransitionStateActionBuilder.php new file mode 100644 index 00000000000..1938430c8c0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Quote/QuoteTransitionStateActionBuilder.php @@ -0,0 +1,105 @@ + + */ +final class QuoteTransitionStateActionBuilder implements Builder +{ + /** + + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder + */ + private $state; + + /** + + * @var ?bool + */ + private $force; + + /** + *

    Value to set. + * If there is no State yet, this must be an initial State.

    + * + + * @return null|StateResourceIdentifier + */ + public function getState() + { + return $this->state instanceof StateResourceIdentifierBuilder ? $this->state->build() : $this->state; + } + + /** + *

    Switch validations on or off.

    + * + + * @return null|bool + */ + public function getForce() + { + return $this->force; + } + + /** + * @param ?StateResourceIdentifier $state + * @return $this + */ + public function withState(?StateResourceIdentifier $state) + { + $this->state = $state; + + return $this; + } + + /** + * @param ?bool $force + * @return $this + */ + public function withForce(?bool $force) + { + $this->force = $force; + + return $this; + } + + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateResourceIdentifierBuilder $state) + { + $this->state = $state; + + return $this; + } + + public function build(): QuoteTransitionStateAction + { + return new QuoteTransitionStateActionModel( + $this->state instanceof StateResourceIdentifierBuilder ? $this->state->build() : $this->state, + $this->force + ); + } + + public static function of(): QuoteTransitionStateActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Quote/QuoteTransitionStateActionCollection.php b/lib/commercetools-api/src/Models/Quote/QuoteTransitionStateActionCollection.php new file mode 100644 index 00000000000..2d2a317e131 --- /dev/null +++ b/lib/commercetools-api/src/Models/Quote/QuoteTransitionStateActionCollection.php @@ -0,0 +1,56 @@ + + * @method QuoteTransitionStateAction current() + * @method QuoteTransitionStateAction end() + * @method QuoteTransitionStateAction at($offset) + */ +class QuoteTransitionStateActionCollection extends QuoteUpdateActionCollection +{ + /** + * @psalm-assert QuoteTransitionStateAction $value + * @psalm-param QuoteTransitionStateAction|stdClass $value + * @throws InvalidArgumentException + * + * @return QuoteTransitionStateActionCollection + */ + public function add($value) + { + if (!$value instanceof QuoteTransitionStateAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?QuoteTransitionStateAction + */ + protected function mapper() + { + return function (?int $index): ?QuoteTransitionStateAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var QuoteTransitionStateAction $data */ + $data = QuoteTransitionStateActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Quote/QuoteTransitionStateActionModel.php b/lib/commercetools-api/src/Models/Quote/QuoteTransitionStateActionModel.php new file mode 100644 index 00000000000..95430403950 --- /dev/null +++ b/lib/commercetools-api/src/Models/Quote/QuoteTransitionStateActionModel.php @@ -0,0 +1,133 @@ +state = $state; + $this->force = $force; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    Value to set. + * If there is no State yet, this must be an initial State.

    + * + * + * @return null|StateResourceIdentifier + */ + public function getState() + { + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); + if (is_null($data)) { + return null; + } + + $this->state = StateResourceIdentifierModel::of($data); + } + + return $this->state; + } + + /** + *

    Switch validations on or off.

    + * + * + * @return null|bool + */ + public function getForce() + { + if (is_null($this->force)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_FORCE); + if (is_null($data)) { + return null; + } + $this->force = (bool) $data; + } + + return $this->force; + } + + + /** + * @param ?StateResourceIdentifier $state + */ + public function setState(?StateResourceIdentifier $state): void + { + $this->state = $state; + } + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void + { + $this->force = $force; + } +} diff --git a/lib/commercetools-api/src/Models/Quote/QuoteUpdate.php b/lib/commercetools-api/src/Models/Quote/QuoteUpdate.php index 3a57e6b64b8..e8c07f11714 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteUpdate.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteUpdate.php @@ -17,11 +17,18 @@ interface QuoteUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + *

    Expected version of the Quote to which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * @return null|int */ public function getVersion(); /** + *

    Update actions to be performed on the Quote.

    + * + * @return null|QuoteUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Quote/QuoteUpdateAction.php b/lib/commercetools-api/src/Models/Quote/QuoteUpdateAction.php index 848c7bedfcb..5ad13cb4f60 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteUpdateAction.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteUpdateAction.php @@ -17,6 +17,7 @@ interface QuoteUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Quote/QuoteUpdateActionModel.php b/lib/commercetools-api/src/Models/Quote/QuoteUpdateActionModel.php index c43a21221e7..1b082859960 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteUpdateActionModel.php @@ -21,6 +21,7 @@ final class QuoteUpdateActionModel extends JsonObjectModel implements QuoteUpdat { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -31,19 +32,23 @@ final class QuoteUpdateActionModel extends JsonObjectModel implements QuoteUpdat */ private static $discriminatorClasses = [ 'changeQuoteState' => QuoteChangeQuoteStateActionModel::class, + 'requestQuoteRenegotiation' => QuoteRequestQuoteRenegotiationActionModel::class, 'setCustomField' => QuoteSetCustomFieldActionModel::class, 'setCustomType' => QuoteSetCustomTypeActionModel::class, + 'transitionState' => QuoteTransitionStateActionModel::class, ]; /** * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Quote/QuoteUpdateBuilder.php b/lib/commercetools-api/src/Models/Quote/QuoteUpdateBuilder.php index 6f2b2388043..bcb3a19bc3f 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteUpdateBuilder.php @@ -21,16 +21,22 @@ final class QuoteUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?QuoteUpdateActionCollection */ private $actions; /** + *

    Expected version of the Quote to which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * @return null|int */ public function getVersion() @@ -39,6 +45,9 @@ public function getVersion() } /** + *

    Update actions to be performed on the Quote.

    + * + * @return null|QuoteUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Quote/QuoteUpdateModel.php b/lib/commercetools-api/src/Models/Quote/QuoteUpdateModel.php index 5f87d69f07a..b31af4363ff 100644 --- a/lib/commercetools-api/src/Models/Quote/QuoteUpdateModel.php +++ b/lib/commercetools-api/src/Models/Quote/QuoteUpdateModel.php @@ -20,11 +20,13 @@ final class QuoteUpdateModel extends JsonObjectModel implements QuoteUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?QuoteUpdateActionCollection */ protected $actions; @@ -42,6 +44,10 @@ public function __construct( } /** + *

    Expected version of the Quote to which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * * @return null|int */ public function getVersion() @@ -59,6 +65,9 @@ public function getVersion() } /** + *

    Update actions to be performed on the Quote.

    + * + * * @return null|QuoteUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequest.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequest.php index f99a6063238..0b72e87c02e 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequest.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequest.php @@ -8,6 +8,7 @@ namespace Commercetools\Api\Models\QuoteRequest; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; use Commercetools\Api\Models\Cart\CustomLineItemCollection; use Commercetools\Api\Models\Cart\DirectDiscountCollection; use Commercetools\Api\Models\Cart\LineItemCollection; @@ -23,6 +24,7 @@ use Commercetools\Api\Models\Customer\CustomerReference; use Commercetools\Api\Models\CustomerGroup\CustomerGroupReference; use Commercetools\Api\Models\Order\PaymentInfo; +use Commercetools\Api\Models\State\StateReference; use Commercetools\Api\Models\Store\StoreKeyReference; use Commercetools\Api\Models\Type\CustomFields; use Commercetools\Base\DateTimeImmutableCollection; @@ -56,10 +58,13 @@ interface QuoteRequest extends BaseResource public const FIELD_ITEM_SHIPPING_ADDRESSES = 'itemShippingAddresses'; public const FIELD_DIRECT_DISCOUNTS = 'directDiscounts'; public const FIELD_CUSTOM = 'custom'; + public const FIELD_STATE = 'state'; + public const FIELD_BUSINESS_UNIT = 'businessUnit'; /** *

    Unique identifier of the QuoteRequest.

    * + * @return null|string */ public function getId(); @@ -67,6 +72,7 @@ public function getId(); /** *

    Current version of the QuoteRequest.

    * + * @return null|int */ public function getVersion(); @@ -74,6 +80,7 @@ public function getVersion(); /** *

    User-defined unique identifier of the QuoteRequest.

    * + * @return null|string */ public function getKey(); @@ -81,6 +88,7 @@ public function getKey(); /** *

    Date and time (UTC) the QuoteRequest was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -88,6 +96,7 @@ public function getCreatedAt(); /** *

    Date and time (UTC) the QuoteRequest was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -95,6 +104,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -102,6 +112,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -109,13 +120,15 @@ public function getCreatedBy(); /** *

    Indicates the current state of the Quote Request in the negotiation process.

    * + * @return null|string */ public function getQuoteRequestState(); /** - *

    Text message included in the request.

    + *

    Message from the Buyer included in the Quote Request.

    * + * @return null|string */ public function getComment(); @@ -123,6 +136,7 @@ public function getComment(); /** *

    The Buyer who raised the request.

    * + * @return null|CustomerReference */ public function getCustomer(); @@ -131,6 +145,7 @@ public function getCustomer(); *

    Set automatically when customer is set and the Customer is a member of a Customer Group. * Used for Product Variant price selection.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup(); @@ -138,28 +153,32 @@ public function getCustomerGroup(); /** *

    The Store to which the Buyer belongs.

    * + * @return null|StoreKeyReference */ public function getStore(); /** - *

    The Line Items for which a quote is requested.

    + *

    The Line Items for which a Quote is requested.

    * + * @return null|LineItemCollection */ public function getLineItems(); /** - *

    The Custom Line Items for which a quote is requested.

    + *

    The Custom Line Items for which a Quote is requested.

    * + * @return null|CustomLineItemCollection */ public function getCustomLineItems(); /** - *

    The sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). + *

    Sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property of each price.

    * + * @return null|TypedMoney */ public function getTotalPrice(); @@ -169,6 +188,7 @@ public function getTotalPrice(); * Will be set automatically in the Platform TaxMode. * For the External tax mode it will be set as soon as the external tax rates for all line items, custom line items, and shipping in the cart are set.

    * + * @return null|TaxedPrice */ public function getTaxedPrice(); @@ -177,27 +197,31 @@ public function getTaxedPrice(); *

    Used to determine the eligible ShippingMethods * and rates as well as the tax rate of the Line Items.

    * + * @return null|Address */ public function getShippingAddress(); /** - *

    The address used for invoicing.

    + *

    Address used for invoicing.

    * + * @return null|Address */ public function getBillingAddress(); /** - *

    The inventory mode of the Cart referenced in the QuoteRequestDraft.

    + *

    Inventory mode of the Cart referenced in the QuoteRequestDraft.

    * + * @return null|string */ public function getInventoryMode(); /** - *

    The tax mode of the Cart referenced in the QuoteRequestDraft.

    + *

    Tax mode of the Cart referenced in the QuoteRequestDraft.

    * + * @return null|string */ public function getTaxMode(); @@ -205,6 +229,7 @@ public function getTaxMode(); /** *

    When calculating taxes for taxedPrice, the selected mode is used for rounding.

    * + * @return null|string */ public function getTaxRoundingMode(); @@ -212,6 +237,7 @@ public function getTaxRoundingMode(); /** *

    When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

    * + * @return null|string */ public function getTaxCalculationMode(); @@ -219,6 +245,7 @@ public function getTaxCalculationMode(); /** *

    Used for Product Variant price selection.

    * + * @return null|string */ public function getCountry(); @@ -226,13 +253,15 @@ public function getCountry(); /** *

    Set automatically once the ShippingMethod is set.

    * + * @return null|ShippingInfo */ public function getShippingInfo(); /** - *

    Log of payment transactions related to this quote.

    + *

    Log of payment transactions related to the Quote.

    * + * @return null|PaymentInfo */ public function getPaymentInfo(); @@ -240,6 +269,7 @@ public function getPaymentInfo(); /** *

    Used to select a ShippingRatePriceTier.

    * + * @return null|ShippingRateInput */ public function getShippingRateInput(); @@ -250,24 +280,44 @@ public function getShippingRateInput(); * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. * Only the cart's shippingAddress is used for this.

    * + * @return null|AddressCollection */ public function getItemShippingAddresses(); /** - *

    Discounts only valid for this Quote, those cannot be associated to any other Cart or Order.

    + *

    Discounts that are only valid for the Quote and cannot be associated to any other Cart or Order.

    * + * @return null|DirectDiscountCollection */ public function getDirectDiscounts(); /** - *

    Custom Fields of this Quote Request.

    + *

    Custom Fields of the Quote Request.

    * + * @return null|CustomFields */ public function getCustom(); + /** + *

    State of the Quote Request. + * This reference can point to a State in a custom workflow.

    + * + + * @return null|StateReference + */ + public function getState(); + + /** + *

    The BusinessUnit for the Quote Request.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit(); + /** * @param ?string $id */ @@ -412,4 +462,14 @@ public function setDirectDiscounts(?DirectDiscountCollection $directDiscounts): * @param ?CustomFields $custom */ public function setCustom(?CustomFields $custom): void; + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void; + + /** + * @param ?BusinessUnitKeyReference $businessUnit + */ + public function setBusinessUnit(?BusinessUnitKeyReference $businessUnit): void; } diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestBuilder.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestBuilder.php index 373dc596f5a..68f7fe3ef99 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestBuilder.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestBuilder.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\QuoteRequest; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceBuilder; use Commercetools\Api\Models\Cart\CustomLineItemCollection; use Commercetools\Api\Models\Cart\DirectDiscountCollection; use Commercetools\Api\Models\Cart\LineItemCollection; @@ -34,6 +36,8 @@ use Commercetools\Api\Models\CustomerGroup\CustomerGroupReferenceBuilder; use Commercetools\Api\Models\Order\PaymentInfo; use Commercetools\Api\Models\Order\PaymentInfoBuilder; +use Commercetools\Api\Models\State\StateReference; +use Commercetools\Api\Models\State\StateReferenceBuilder; use Commercetools\Api\Models\Store\StoreKeyReference; use Commercetools\Api\Models\Store\StoreKeyReferenceBuilder; use Commercetools\Api\Models\Type\CustomFields; @@ -52,153 +56,195 @@ final class QuoteRequestBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var ?string */ private $key; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $quoteRequestState; /** + * @var ?string */ private $comment; /** + * @var null|CustomerReference|CustomerReferenceBuilder */ private $customer; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $customerGroup; /** + * @var null|StoreKeyReference|StoreKeyReferenceBuilder */ private $store; /** + * @var ?LineItemCollection */ private $lineItems; /** + * @var ?CustomLineItemCollection */ private $customLineItems; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalPrice; /** + * @var null|TaxedPrice|TaxedPriceBuilder */ private $taxedPrice; /** + * @var null|Address|AddressBuilder */ private $shippingAddress; /** + * @var null|Address|AddressBuilder */ private $billingAddress; /** + * @var ?string */ private $inventoryMode; /** + * @var ?string */ private $taxMode; /** + * @var ?string */ private $taxRoundingMode; /** + * @var ?string */ private $taxCalculationMode; /** + * @var ?string */ private $country; /** + * @var null|ShippingInfo|ShippingInfoBuilder */ private $shippingInfo; /** + * @var null|PaymentInfo|PaymentInfoBuilder */ private $paymentInfo; /** + * @var null|ShippingRateInput|ShippingRateInputBuilder */ private $shippingRateInput; /** + * @var ?AddressCollection */ private $itemShippingAddresses; /** + * @var ?DirectDiscountCollection */ private $directDiscounts; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; + /** + + * @var null|StateReference|StateReferenceBuilder + */ + private $state; + + /** + + * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + */ + private $businessUnit; + /** *

    Unique identifier of the QuoteRequest.

    * + * @return null|string */ public function getId() @@ -209,6 +255,7 @@ public function getId() /** *

    Current version of the QuoteRequest.

    * + * @return null|int */ public function getVersion() @@ -219,6 +266,7 @@ public function getVersion() /** *

    Date and time (UTC) the QuoteRequest was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -229,6 +277,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the QuoteRequest was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -239,6 +288,7 @@ public function getLastModifiedAt() /** *

    User-defined unique identifier of the QuoteRequest.

    * + * @return null|string */ public function getKey() @@ -249,6 +299,7 @@ public function getKey() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -259,6 +310,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -269,6 +321,7 @@ public function getCreatedBy() /** *

    Indicates the current state of the Quote Request in the negotiation process.

    * + * @return null|string */ public function getQuoteRequestState() @@ -277,8 +330,9 @@ public function getQuoteRequestState() } /** - *

    Text message included in the request.

    + *

    Message from the Buyer included in the Quote Request.

    * + * @return null|string */ public function getComment() @@ -289,6 +343,7 @@ public function getComment() /** *

    The Buyer who raised the request.

    * + * @return null|CustomerReference */ public function getCustomer() @@ -300,6 +355,7 @@ public function getCustomer() *

    Set automatically when customer is set and the Customer is a member of a Customer Group. * Used for Product Variant price selection.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -310,6 +366,7 @@ public function getCustomerGroup() /** *

    The Store to which the Buyer belongs.

    * + * @return null|StoreKeyReference */ public function getStore() @@ -318,8 +375,9 @@ public function getStore() } /** - *

    The Line Items for which a quote is requested.

    + *

    The Line Items for which a Quote is requested.

    * + * @return null|LineItemCollection */ public function getLineItems() @@ -328,8 +386,9 @@ public function getLineItems() } /** - *

    The Custom Line Items for which a quote is requested.

    + *

    The Custom Line Items for which a Quote is requested.

    * + * @return null|CustomLineItemCollection */ public function getCustomLineItems() @@ -338,9 +397,10 @@ public function getCustomLineItems() } /** - *

    The sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). + *

    Sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property of each price.

    * + * @return null|TypedMoney */ public function getTotalPrice() @@ -353,6 +413,7 @@ public function getTotalPrice() * Will be set automatically in the Platform TaxMode. * For the External tax mode it will be set as soon as the external tax rates for all line items, custom line items, and shipping in the cart are set.

    * + * @return null|TaxedPrice */ public function getTaxedPrice() @@ -364,6 +425,7 @@ public function getTaxedPrice() *

    Used to determine the eligible ShippingMethods * and rates as well as the tax rate of the Line Items.

    * + * @return null|Address */ public function getShippingAddress() @@ -372,8 +434,9 @@ public function getShippingAddress() } /** - *

    The address used for invoicing.

    + *

    Address used for invoicing.

    * + * @return null|Address */ public function getBillingAddress() @@ -382,8 +445,9 @@ public function getBillingAddress() } /** - *

    The inventory mode of the Cart referenced in the QuoteRequestDraft.

    + *

    Inventory mode of the Cart referenced in the QuoteRequestDraft.

    * + * @return null|string */ public function getInventoryMode() @@ -392,8 +456,9 @@ public function getInventoryMode() } /** - *

    The tax mode of the Cart referenced in the QuoteRequestDraft.

    + *

    Tax mode of the Cart referenced in the QuoteRequestDraft.

    * + * @return null|string */ public function getTaxMode() @@ -404,6 +469,7 @@ public function getTaxMode() /** *

    When calculating taxes for taxedPrice, the selected mode is used for rounding.

    * + * @return null|string */ public function getTaxRoundingMode() @@ -414,6 +480,7 @@ public function getTaxRoundingMode() /** *

    When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

    * + * @return null|string */ public function getTaxCalculationMode() @@ -424,6 +491,7 @@ public function getTaxCalculationMode() /** *

    Used for Product Variant price selection.

    * + * @return null|string */ public function getCountry() @@ -434,6 +502,7 @@ public function getCountry() /** *

    Set automatically once the ShippingMethod is set.

    * + * @return null|ShippingInfo */ public function getShippingInfo() @@ -442,8 +511,9 @@ public function getShippingInfo() } /** - *

    Log of payment transactions related to this quote.

    + *

    Log of payment transactions related to the Quote.

    * + * @return null|PaymentInfo */ public function getPaymentInfo() @@ -454,6 +524,7 @@ public function getPaymentInfo() /** *

    Used to select a ShippingRatePriceTier.

    * + * @return null|ShippingRateInput */ public function getShippingRateInput() @@ -467,6 +538,7 @@ public function getShippingRateInput() * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. * Only the cart's shippingAddress is used for this.

    * + * @return null|AddressCollection */ public function getItemShippingAddresses() @@ -475,8 +547,9 @@ public function getItemShippingAddresses() } /** - *

    Discounts only valid for this Quote, those cannot be associated to any other Cart or Order.

    + *

    Discounts that are only valid for the Quote and cannot be associated to any other Cart or Order.

    * + * @return null|DirectDiscountCollection */ public function getDirectDiscounts() @@ -485,8 +558,9 @@ public function getDirectDiscounts() } /** - *

    Custom Fields of this Quote Request.

    + *

    Custom Fields of the Quote Request.

    * + * @return null|CustomFields */ public function getCustom() @@ -494,6 +568,29 @@ public function getCustom() return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; } + /** + *

    State of the Quote Request. + * This reference can point to a State in a custom workflow.

    + * + + * @return null|StateReference + */ + public function getState() + { + return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; + } + + /** + *

    The BusinessUnit for the Quote Request.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit() + { + return $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit; + } + /** * @param ?string $id * @return $this @@ -813,6 +910,28 @@ public function withCustom(?CustomFields $custom) return $this; } + /** + * @param ?StateReference $state + * @return $this + */ + public function withState(?StateReference $state) + { + $this->state = $state; + + return $this; + } + + /** + * @param ?BusinessUnitKeyReference $businessUnit + * @return $this + */ + public function withBusinessUnit(?BusinessUnitKeyReference $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -956,6 +1075,28 @@ public function withCustomBuilder(?CustomFieldsBuilder $custom) return $this; } + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateReferenceBuilder $state) + { + $this->state = $state; + + return $this; + } + + /** + * @deprecated use withBusinessUnit() instead + * @return $this + */ + public function withBusinessUnitBuilder(?BusinessUnitKeyReferenceBuilder $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + public function build(): QuoteRequest { return new QuoteRequestModel( @@ -987,7 +1128,9 @@ public function build(): QuoteRequest $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, $this->itemShippingAddresses, $this->directDiscounts, - $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom + $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, + $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state, + $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit ); } diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestChangeQuoteRequestStateAction.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestChangeQuoteRequestStateAction.php index 603a9c05c53..9cfc25890e3 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestChangeQuoteRequestStateAction.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestChangeQuoteRequestStateAction.php @@ -16,8 +16,9 @@ interface QuoteRequestChangeQuoteRequestStateAction extends QuoteRequestUpdateAc public const FIELD_QUOTE_REQUEST_STATE = 'quoteRequestState'; /** - *

    The new state to be set for the Quote Request.

    + *

    New state to be set for the Quote Request.

    * + * @return null|string */ public function getQuoteRequestState(); diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestChangeQuoteRequestStateActionBuilder.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestChangeQuoteRequestStateActionBuilder.php index ab7cf1cd70c..020611037c7 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestChangeQuoteRequestStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestChangeQuoteRequestStateActionBuilder.php @@ -21,13 +21,15 @@ final class QuoteRequestChangeQuoteRequestStateActionBuilder implements Builder { /** + * @var ?string */ private $quoteRequestState; /** - *

    The new state to be set for the Quote Request.

    + *

    New state to be set for the Quote Request.

    * + * @return null|string */ public function getQuoteRequestState() diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestChangeQuoteRequestStateActionModel.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestChangeQuoteRequestStateActionModel.php index 87c8ed5792f..a0bc26df6fe 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestChangeQuoteRequestStateActionModel.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestChangeQuoteRequestStateActionModel.php @@ -21,11 +21,13 @@ final class QuoteRequestChangeQuoteRequestStateActionModel extends JsonObjectMod { public const DISCRIMINATOR_VALUE = 'changeQuoteRequestState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $quoteRequestState; @@ -35,13 +37,15 @@ final class QuoteRequestChangeQuoteRequestStateActionModel extends JsonObjectMod * @psalm-suppress MissingParamType */ public function __construct( - ?string $quoteRequestState = null + ?string $quoteRequestState = null, + ?string $action = null ) { $this->quoteRequestState = $quoteRequestState; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,7 +63,8 @@ public function getAction() } /** - *

    The new state to be set for the Quote Request.

    + *

    New state to be set for the Quote Request.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestDraft.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestDraft.php index 51e99cd11eb..fcc333b1aaf 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestDraft.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestDraft.php @@ -9,6 +9,7 @@ namespace Commercetools\Api\Models\QuoteRequest; use Commercetools\Api\Models\Cart\CartResourceIdentifier; +use Commercetools\Api\Models\State\StateReference; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -20,10 +21,13 @@ interface QuoteRequestDraft extends JsonObject public const FIELD_KEY = 'key'; public const FIELD_COMMENT = 'comment'; public const FIELD_CUSTOM = 'custom'; + public const FIELD_STATE = 'state'; /** - *

    Cart for which a Quote is requested. Anonymous Carts as well as Carts with Discount Codes are not supported.

    + *

    Cart for which a Quote is requested. + * Anonymous Carts, Carts with Discount Codes, or Carts with a Multiple ShippingMode are not supported.

    * + * @return null|CartResourceIdentifier */ public function getCart(); @@ -31,6 +35,7 @@ public function getCart(); /** *

    Current version of the referenced Cart.

    * + * @return null|int */ public function getCartVersion(); @@ -38,13 +43,15 @@ public function getCartVersion(); /** *

    User-defined unique identifier for the QuoteRequest.

    * + * @return null|string */ public function getKey(); /** - *

    Text message included in the request.

    + *

    Message from the Buyer included in the Quote Request.

    * + * @return null|string */ public function getComment(); @@ -52,10 +59,20 @@ public function getComment(); /** *

    Custom Fields to be added to the Quote Request.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); + /** + *

    State of this Quote Request. + * This reference can point to a State in a custom workflow.

    + * + + * @return null|StateReference + */ + public function getState(); + /** * @param ?CartResourceIdentifier $cart */ @@ -80,4 +97,9 @@ public function setComment(?string $comment): void; * @param ?CustomFieldsDraft $custom */ public function setCustom(?CustomFieldsDraft $custom): void; + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void; } diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestDraftBuilder.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestDraftBuilder.php index 50891c61c2e..1987384a5ce 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestDraftBuilder.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestDraftBuilder.php @@ -10,6 +10,8 @@ use Commercetools\Api\Models\Cart\CartResourceIdentifier; use Commercetools\Api\Models\Cart\CartResourceIdentifierBuilder; +use Commercetools\Api\Models\State\StateReference; +use Commercetools\Api\Models\State\StateReferenceBuilder; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Api\Models\Type\CustomFieldsDraftBuilder; use Commercetools\Base\Builder; @@ -25,33 +27,46 @@ final class QuoteRequestDraftBuilder implements Builder { /** + * @var null|CartResourceIdentifier|CartResourceIdentifierBuilder */ private $cart; /** + * @var ?int */ private $cartVersion; /** + * @var ?string */ private $key; /** + * @var ?string */ private $comment; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** - *

    Cart for which a Quote is requested. Anonymous Carts as well as Carts with Discount Codes are not supported.

    + + * @var null|StateReference|StateReferenceBuilder + */ + private $state; + + /** + *

    Cart for which a Quote is requested. + * Anonymous Carts, Carts with Discount Codes, or Carts with a Multiple ShippingMode are not supported.

    * + * @return null|CartResourceIdentifier */ public function getCart() @@ -62,6 +77,7 @@ public function getCart() /** *

    Current version of the referenced Cart.

    * + * @return null|int */ public function getCartVersion() @@ -72,6 +88,7 @@ public function getCartVersion() /** *

    User-defined unique identifier for the QuoteRequest.

    * + * @return null|string */ public function getKey() @@ -80,8 +97,9 @@ public function getKey() } /** - *

    Text message included in the request.

    + *

    Message from the Buyer included in the Quote Request.

    * + * @return null|string */ public function getComment() @@ -92,6 +110,7 @@ public function getComment() /** *

    Custom Fields to be added to the Quote Request.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -99,6 +118,18 @@ public function getCustom() return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } + /** + *

    State of this Quote Request. + * This reference can point to a State in a custom workflow.

    + * + + * @return null|StateReference + */ + public function getState() + { + return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; + } + /** * @param ?CartResourceIdentifier $cart * @return $this @@ -154,6 +185,17 @@ public function withCustom(?CustomFieldsDraft $custom) return $this; } + /** + * @param ?StateReference $state + * @return $this + */ + public function withState(?StateReference $state) + { + $this->state = $state; + + return $this; + } + /** * @deprecated use withCart() instead * @return $this @@ -176,6 +218,17 @@ public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) return $this; } + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateReferenceBuilder $state) + { + $this->state = $state; + + return $this; + } + public function build(): QuoteRequestDraft { return new QuoteRequestDraftModel( @@ -183,7 +236,8 @@ public function build(): QuoteRequestDraft $this->cartVersion, $this->key, $this->comment, - $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, + $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state ); } diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestDraftModel.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestDraftModel.php index cb253a5c11a..ef87f874171 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestDraftModel.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestDraftModel.php @@ -10,6 +10,8 @@ use Commercetools\Api\Models\Cart\CartResourceIdentifier; use Commercetools\Api\Models\Cart\CartResourceIdentifierModel; +use Commercetools\Api\Models\State\StateReference; +use Commercetools\Api\Models\State\StateReferenceModel; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Api\Models\Type\CustomFieldsDraftModel; use Commercetools\Base\DateTimeImmutableCollection; @@ -24,30 +26,41 @@ final class QuoteRequestDraftModel extends JsonObjectModel implements QuoteRequestDraft { /** + * * @var ?CartResourceIdentifier */ protected $cart; /** + * * @var ?int */ protected $cartVersion; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $comment; /** + * * @var ?CustomFieldsDraft */ protected $custom; + /** + * + * @var ?StateReference + */ + protected $state; + /** * @psalm-suppress MissingParamType @@ -57,17 +70,21 @@ public function __construct( ?int $cartVersion = null, ?string $key = null, ?string $comment = null, - ?CustomFieldsDraft $custom = null + ?CustomFieldsDraft $custom = null, + ?StateReference $state = null ) { $this->cart = $cart; $this->cartVersion = $cartVersion; $this->key = $key; $this->comment = $comment; $this->custom = $custom; + $this->state = $state; } /** - *

    Cart for which a Quote is requested. Anonymous Carts as well as Carts with Discount Codes are not supported.

    + *

    Cart for which a Quote is requested. + * Anonymous Carts, Carts with Discount Codes, or Carts with a Multiple ShippingMode are not supported.

    + * * * @return null|CartResourceIdentifier */ @@ -89,6 +106,7 @@ public function getCart() /** *

    Current version of the referenced Cart.

    * + * * @return null|int */ public function getCartVersion() @@ -108,6 +126,7 @@ public function getCartVersion() /** *

    User-defined unique identifier for the QuoteRequest.

    * + * * @return null|string */ public function getKey() @@ -125,7 +144,8 @@ public function getKey() } /** - *

    Text message included in the request.

    + *

    Message from the Buyer included in the Quote Request.

    + * * * @return null|string */ @@ -146,6 +166,7 @@ public function getComment() /** *

    Custom Fields to be added to the Quote Request.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -163,6 +184,28 @@ public function getCustom() return $this->custom; } + /** + *

    State of this Quote Request. + * This reference can point to a State in a custom workflow.

    + * + * + * @return null|StateReference + */ + public function getState() + { + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); + if (is_null($data)) { + return null; + } + + $this->state = StateReferenceModel::of($data); + } + + return $this->state; + } + /** * @param ?CartResourceIdentifier $cart @@ -203,4 +246,12 @@ public function setCustom(?CustomFieldsDraft $custom): void { $this->custom = $custom; } + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void + { + $this->state = $state; + } } diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestModel.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestModel.php index a0820a87470..fc70512218e 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestModel.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestModel.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\QuoteRequest; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceModel; use Commercetools\Api\Models\Cart\CustomLineItemCollection; use Commercetools\Api\Models\Cart\DirectDiscountCollection; use Commercetools\Api\Models\Cart\LineItemCollection; @@ -34,6 +36,8 @@ use Commercetools\Api\Models\CustomerGroup\CustomerGroupReferenceModel; use Commercetools\Api\Models\Order\PaymentInfo; use Commercetools\Api\Models\Order\PaymentInfoModel; +use Commercetools\Api\Models\State\StateReference; +use Commercetools\Api\Models\State\StateReferenceModel; use Commercetools\Api\Models\Store\StoreKeyReference; use Commercetools\Api\Models\Store\StoreKeyReferenceModel; use Commercetools\Api\Models\Type\CustomFields; @@ -51,150 +55,191 @@ final class QuoteRequestModel extends JsonObjectModel implements QuoteRequest { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?string */ protected $key; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $quoteRequestState; /** + * * @var ?string */ protected $comment; /** + * * @var ?CustomerReference */ protected $customer; /** + * * @var ?CustomerGroupReference */ protected $customerGroup; /** + * * @var ?StoreKeyReference */ protected $store; /** + * * @var ?LineItemCollection */ protected $lineItems; /** + * * @var ?CustomLineItemCollection */ protected $customLineItems; /** + * * @var ?TypedMoney */ protected $totalPrice; /** + * * @var ?TaxedPrice */ protected $taxedPrice; /** + * * @var ?Address */ protected $shippingAddress; /** + * * @var ?Address */ protected $billingAddress; /** + * * @var ?string */ protected $inventoryMode; /** + * * @var ?string */ protected $taxMode; /** + * * @var ?string */ protected $taxRoundingMode; /** + * * @var ?string */ protected $taxCalculationMode; /** + * * @var ?string */ protected $country; /** + * * @var ?ShippingInfo */ protected $shippingInfo; /** + * * @var ?PaymentInfo */ protected $paymentInfo; /** + * * @var ?ShippingRateInput */ protected $shippingRateInput; /** + * * @var ?AddressCollection */ protected $itemShippingAddresses; /** + * * @var ?DirectDiscountCollection */ protected $directDiscounts; /** + * * @var ?CustomFields */ protected $custom; + /** + * + * @var ?StateReference + */ + protected $state; + + /** + * + * @var ?BusinessUnitKeyReference + */ + protected $businessUnit; + /** * @psalm-suppress MissingParamType @@ -228,7 +273,9 @@ public function __construct( ?ShippingRateInput $shippingRateInput = null, ?AddressCollection $itemShippingAddresses = null, ?DirectDiscountCollection $directDiscounts = null, - ?CustomFields $custom = null + ?CustomFields $custom = null, + ?StateReference $state = null, + ?BusinessUnitKeyReference $businessUnit = null ) { $this->id = $id; $this->version = $version; @@ -259,11 +306,14 @@ public function __construct( $this->itemShippingAddresses = $itemShippingAddresses; $this->directDiscounts = $directDiscounts; $this->custom = $custom; + $this->state = $state; + $this->businessUnit = $businessUnit; } /** *

    Unique identifier of the QuoteRequest.

    * + * * @return null|string */ public function getId() @@ -283,6 +333,7 @@ public function getId() /** *

    Current version of the QuoteRequest.

    * + * * @return null|int */ public function getVersion() @@ -302,6 +353,7 @@ public function getVersion() /** *

    Date and time (UTC) the QuoteRequest was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -325,6 +377,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the QuoteRequest was last updated.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -348,6 +401,7 @@ public function getLastModifiedAt() /** *

    User-defined unique identifier of the QuoteRequest.

    * + * * @return null|string */ public function getKey() @@ -367,6 +421,7 @@ public function getKey() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -387,6 +442,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -407,6 +463,7 @@ public function getCreatedBy() /** *

    Indicates the current state of the Quote Request in the negotiation process.

    * + * * @return null|string */ public function getQuoteRequestState() @@ -424,7 +481,8 @@ public function getQuoteRequestState() } /** - *

    Text message included in the request.

    + *

    Message from the Buyer included in the Quote Request.

    + * * * @return null|string */ @@ -445,6 +503,7 @@ public function getComment() /** *

    The Buyer who raised the request.

    * + * * @return null|CustomerReference */ public function getCustomer() @@ -466,6 +525,7 @@ public function getCustomer() *

    Set automatically when customer is set and the Customer is a member of a Customer Group. * Used for Product Variant price selection.

    * + * * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -486,6 +546,7 @@ public function getCustomerGroup() /** *

    The Store to which the Buyer belongs.

    * + * * @return null|StoreKeyReference */ public function getStore() @@ -504,7 +565,8 @@ public function getStore() } /** - *

    The Line Items for which a quote is requested.

    + *

    The Line Items for which a Quote is requested.

    + * * * @return null|LineItemCollection */ @@ -523,7 +585,8 @@ public function getLineItems() } /** - *

    The Custom Line Items for which a quote is requested.

    + *

    The Custom Line Items for which a Quote is requested.

    + * * * @return null|CustomLineItemCollection */ @@ -542,9 +605,10 @@ public function getCustomLineItems() } /** - *

    The sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). + *

    Sum of all totalPrice fields of the lineItems and customLineItems, as well as the price field of shippingInfo (if it exists). * totalPrice may or may not include the taxes: it depends on the taxRate.includedInPrice property of each price.

    * + * * @return null|TypedMoney */ public function getTotalPrice() @@ -567,6 +631,7 @@ public function getTotalPrice() * Will be set automatically in the Platform TaxMode. * For the External tax mode it will be set as soon as the external tax rates for all line items, custom line items, and shipping in the cart are set.

    * + * * @return null|TaxedPrice */ public function getTaxedPrice() @@ -588,6 +653,7 @@ public function getTaxedPrice() *

    Used to determine the eligible ShippingMethods * and rates as well as the tax rate of the Line Items.

    * + * * @return null|Address */ public function getShippingAddress() @@ -606,7 +672,8 @@ public function getShippingAddress() } /** - *

    The address used for invoicing.

    + *

    Address used for invoicing.

    + * * * @return null|Address */ @@ -626,7 +693,8 @@ public function getBillingAddress() } /** - *

    The inventory mode of the Cart referenced in the QuoteRequestDraft.

    + *

    Inventory mode of the Cart referenced in the QuoteRequestDraft.

    + * * * @return null|string */ @@ -645,7 +713,8 @@ public function getInventoryMode() } /** - *

    The tax mode of the Cart referenced in the QuoteRequestDraft.

    + *

    Tax mode of the Cart referenced in the QuoteRequestDraft.

    + * * * @return null|string */ @@ -666,6 +735,7 @@ public function getTaxMode() /** *

    When calculating taxes for taxedPrice, the selected mode is used for rounding.

    * + * * @return null|string */ public function getTaxRoundingMode() @@ -685,6 +755,7 @@ public function getTaxRoundingMode() /** *

    When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

    * + * * @return null|string */ public function getTaxCalculationMode() @@ -704,6 +775,7 @@ public function getTaxCalculationMode() /** *

    Used for Product Variant price selection.

    * + * * @return null|string */ public function getCountry() @@ -723,6 +795,7 @@ public function getCountry() /** *

    Set automatically once the ShippingMethod is set.

    * + * * @return null|ShippingInfo */ public function getShippingInfo() @@ -741,7 +814,8 @@ public function getShippingInfo() } /** - *

    Log of payment transactions related to this quote.

    + *

    Log of payment transactions related to the Quote.

    + * * * @return null|PaymentInfo */ @@ -763,6 +837,7 @@ public function getPaymentInfo() /** *

    Used to select a ShippingRatePriceTier.

    * + * * @return null|ShippingRateInput */ public function getShippingRateInput() @@ -786,6 +861,7 @@ public function getShippingRateInput() * The addresses captured here are not used to determine eligible shipping methods or the applicable tax rate. * Only the cart's shippingAddress is used for this.

    * + * * @return null|AddressCollection */ public function getItemShippingAddresses() @@ -803,7 +879,8 @@ public function getItemShippingAddresses() } /** - *

    Discounts only valid for this Quote, those cannot be associated to any other Cart or Order.

    + *

    Discounts that are only valid for the Quote and cannot be associated to any other Cart or Order.

    + * * * @return null|DirectDiscountCollection */ @@ -822,7 +899,8 @@ public function getDirectDiscounts() } /** - *

    Custom Fields of this Quote Request.

    + *

    Custom Fields of the Quote Request.

    + * * * @return null|CustomFields */ @@ -841,6 +919,49 @@ public function getCustom() return $this->custom; } + /** + *

    State of the Quote Request. + * This reference can point to a State in a custom workflow.

    + * + * + * @return null|StateReference + */ + public function getState() + { + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); + if (is_null($data)) { + return null; + } + + $this->state = StateReferenceModel::of($data); + } + + return $this->state; + } + + /** + *

    The BusinessUnit for the Quote Request.

    + * + * + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit() + { + if (is_null($this->businessUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BUSINESS_UNIT); + if (is_null($data)) { + return null; + } + + $this->businessUnit = BusinessUnitKeyReferenceModel::of($data); + } + + return $this->businessUnit; + } + /** * @param ?string $id @@ -1074,6 +1195,22 @@ public function setCustom(?CustomFields $custom): void $this->custom = $custom; } + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void + { + $this->state = $state; + } + + /** + * @param ?BusinessUnitKeyReference $businessUnit + */ + public function setBusinessUnit(?BusinessUnitKeyReference $businessUnit): void + { + $this->businessUnit = $businessUnit; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestPagedQueryResponse.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestPagedQueryResponse.php index 190003c7511..3425c4e6f95 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestPagedQueryResponse.php @@ -22,6 +22,7 @@ interface QuoteRequestPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    Quote Requests matching the query.

    * + * @return null|QuoteRequestCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestPagedQueryResponseBuilder.php index 3f3fcf94606..6724d797690 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class QuoteRequestPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?QuoteRequestCollection */ private $results; @@ -48,6 +53,7 @@ final class QuoteRequestPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    Quote Requests matching the query.

    * + * @return null|QuoteRequestCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestPagedQueryResponseModel.php index 876d24f7c5f..5c9b7e31bc4 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class QuoteRequestPagedQueryResponseModel extends JsonObjectModel implements QuoteRequestPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?QuoteRequestCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    Quote Requests matching the query.

    * + * * @return null|QuoteRequestCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestReference.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestReference.php index 81eb789c30d..23e14a6f650 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestReference.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestReference.php @@ -20,6 +20,7 @@ interface QuoteRequestReference extends Reference *

    Contains the representation of the expanded QuoteRequest. * Only present in responses to requests with Reference Expansion for QuoteRequest.

    * + * @return null|QuoteRequest */ public function getObj(); diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestReferenceBuilder.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestReferenceBuilder.php index 3b743f0b2b2..29f8dac393b 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestReferenceBuilder.php @@ -23,11 +23,13 @@ final class QuoteRequestReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|QuoteRequest|QuoteRequestBuilder */ private $obj; @@ -35,6 +37,7 @@ final class QuoteRequestReferenceBuilder implements Builder /** *

    Unique ID of the referenced resource.

    * + * @return null|string */ public function getId() @@ -46,6 +49,7 @@ public function getId() *

    Contains the representation of the expanded QuoteRequest. * Only present in responses to requests with Reference Expansion for QuoteRequest.

    * + * @return null|QuoteRequest */ public function getObj() diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestReferenceModel.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestReferenceModel.php index e0b1250dded..ed21d247d75 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestReferenceModel.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestReferenceModel.php @@ -23,16 +23,19 @@ final class QuoteRequestReferenceModel extends JsonObjectModel implements QuoteR { public const DISCRIMINATOR_VALUE = 'quote-request'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?QuoteRequest */ protected $obj; @@ -43,16 +46,18 @@ final class QuoteRequestReferenceModel extends JsonObjectModel implements QuoteR */ public function __construct( ?string $id = null, - ?QuoteRequest $obj = null + ?QuoteRequest $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique ID of the referenced resource.

    * + * * @return null|string */ public function getId() @@ -92,6 +98,7 @@ public function getId() *

    Contains the representation of the expanded QuoteRequest. * Only present in responses to requests with Reference Expansion for QuoteRequest.

    * + * * @return null|QuoteRequest */ public function getObj() diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestResourceIdentifierBuilder.php index 57d27e95377..a3437ec1436 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class QuoteRequestResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class QuoteRequestResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced resource. Required if key is absent.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced resource. Required if id is absent.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestResourceIdentifierModel.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestResourceIdentifierModel.php index a5e9701db22..9f33f412bef 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class QuoteRequestResourceIdentifierModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'quote-request'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class QuoteRequestResourceIdentifierModel extends JsonObjectModel implemen */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced resource. Required if key is absent.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced resource. Required if id is absent.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomFieldAction.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomFieldAction.php index cbc123d0cf3..6ca4c6910df 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface QuoteRequestSetCustomFieldAction extends QuoteRequestUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomFieldActionBuilder.php index db7db7decb3..e8a4e6ae078 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class QuoteRequestSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class QuoteRequestSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomFieldActionModel.php index fc7553ed192..f2637cf6ffe 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class QuoteRequestSetCustomFieldActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class QuoteRequestSetCustomFieldActionModel extends JsonObjectModel implem */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomTypeAction.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomTypeAction.php index 38673e81f0a..56e1f8ca3ab 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface QuoteRequestSetCustomTypeAction extends QuoteRequestUpdateAction *

    Defines the Type that extends the QuoteRequest with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the QuoteRequest.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the QuoteRequest.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomTypeActionBuilder.php index aab7719fca1..c2c4598788e 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class QuoteRequestSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class QuoteRequestSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the QuoteRequest with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the QuoteRequest.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the QuoteRequest.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomTypeActionModel.php index 7dd6dca6841..cbd558e456d 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class QuoteRequestSetCustomTypeActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class QuoteRequestSetCustomTypeActionModel extends JsonObjectModel impleme */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the QuoteRequest with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the QuoteRequest.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the QuoteRequest.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestTransitionStateAction.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestTransitionStateAction.php new file mode 100644 index 00000000000..8d04ad58184 --- /dev/null +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestTransitionStateAction.php @@ -0,0 +1,46 @@ +Value to set. + * If there is no State yet, this must be an initial State.

    + * + + * @return null|StateResourceIdentifier + */ + public function getState(); + + /** + *

    Switch validations on or off.

    + * + + * @return null|bool + */ + public function getForce(); + + /** + * @param ?StateResourceIdentifier $state + */ + public function setState(?StateResourceIdentifier $state): void; + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void; +} diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestTransitionStateActionBuilder.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestTransitionStateActionBuilder.php new file mode 100644 index 00000000000..bf44d6c1ad6 --- /dev/null +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestTransitionStateActionBuilder.php @@ -0,0 +1,105 @@ + + */ +final class QuoteRequestTransitionStateActionBuilder implements Builder +{ + /** + + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder + */ + private $state; + + /** + + * @var ?bool + */ + private $force; + + /** + *

    Value to set. + * If there is no State yet, this must be an initial State.

    + * + + * @return null|StateResourceIdentifier + */ + public function getState() + { + return $this->state instanceof StateResourceIdentifierBuilder ? $this->state->build() : $this->state; + } + + /** + *

    Switch validations on or off.

    + * + + * @return null|bool + */ + public function getForce() + { + return $this->force; + } + + /** + * @param ?StateResourceIdentifier $state + * @return $this + */ + public function withState(?StateResourceIdentifier $state) + { + $this->state = $state; + + return $this; + } + + /** + * @param ?bool $force + * @return $this + */ + public function withForce(?bool $force) + { + $this->force = $force; + + return $this; + } + + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateResourceIdentifierBuilder $state) + { + $this->state = $state; + + return $this; + } + + public function build(): QuoteRequestTransitionStateAction + { + return new QuoteRequestTransitionStateActionModel( + $this->state instanceof StateResourceIdentifierBuilder ? $this->state->build() : $this->state, + $this->force + ); + } + + public static function of(): QuoteRequestTransitionStateActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestTransitionStateActionCollection.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestTransitionStateActionCollection.php new file mode 100644 index 00000000000..459e2075c3c --- /dev/null +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestTransitionStateActionCollection.php @@ -0,0 +1,56 @@ + + * @method QuoteRequestTransitionStateAction current() + * @method QuoteRequestTransitionStateAction end() + * @method QuoteRequestTransitionStateAction at($offset) + */ +class QuoteRequestTransitionStateActionCollection extends QuoteRequestUpdateActionCollection +{ + /** + * @psalm-assert QuoteRequestTransitionStateAction $value + * @psalm-param QuoteRequestTransitionStateAction|stdClass $value + * @throws InvalidArgumentException + * + * @return QuoteRequestTransitionStateActionCollection + */ + public function add($value) + { + if (!$value instanceof QuoteRequestTransitionStateAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?QuoteRequestTransitionStateAction + */ + protected function mapper() + { + return function (?int $index): ?QuoteRequestTransitionStateAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var QuoteRequestTransitionStateAction $data */ + $data = QuoteRequestTransitionStateActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestTransitionStateActionModel.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestTransitionStateActionModel.php new file mode 100644 index 00000000000..8c3134271ad --- /dev/null +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestTransitionStateActionModel.php @@ -0,0 +1,133 @@ +state = $state; + $this->force = $force; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    Value to set. + * If there is no State yet, this must be an initial State.

    + * + * + * @return null|StateResourceIdentifier + */ + public function getState() + { + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); + if (is_null($data)) { + return null; + } + + $this->state = StateResourceIdentifierModel::of($data); + } + + return $this->state; + } + + /** + *

    Switch validations on or off.

    + * + * + * @return null|bool + */ + public function getForce() + { + if (is_null($this->force)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_FORCE); + if (is_null($data)) { + return null; + } + $this->force = (bool) $data; + } + + return $this->force; + } + + + /** + * @param ?StateResourceIdentifier $state + */ + public function setState(?StateResourceIdentifier $state): void + { + $this->state = $state; + } + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void + { + $this->force = $force; + } +} diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdate.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdate.php index 1b139b6e13c..58d72f73f69 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdate.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdate.php @@ -17,11 +17,18 @@ interface QuoteRequestUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + *

    Expected version of the QuoteRequest to which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * @return null|int */ public function getVersion(); /** + *

    Update actions to be performed on the QuoteRequest.

    + * + * @return null|QuoteRequestUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdateAction.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdateAction.php index 5eeccf273d7..ad6e8a77b9b 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdateAction.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdateAction.php @@ -17,6 +17,7 @@ interface QuoteRequestUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdateActionModel.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdateActionModel.php index 63439a634e2..95819e75fae 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdateActionModel.php @@ -21,6 +21,7 @@ final class QuoteRequestUpdateActionModel extends JsonObjectModel implements Quo { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -33,17 +34,20 @@ final class QuoteRequestUpdateActionModel extends JsonObjectModel implements Quo 'changeQuoteRequestState' => QuoteRequestChangeQuoteRequestStateActionModel::class, 'setCustomField' => QuoteRequestSetCustomFieldActionModel::class, 'setCustomType' => QuoteRequestSetCustomTypeActionModel::class, + 'transitionState' => QuoteRequestTransitionStateActionModel::class, ]; /** * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdateBuilder.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdateBuilder.php index 0f920bdb4ce..1e3fd3de63e 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdateBuilder.php @@ -21,16 +21,22 @@ final class QuoteRequestUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?QuoteRequestUpdateActionCollection */ private $actions; /** + *

    Expected version of the QuoteRequest to which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * @return null|int */ public function getVersion() @@ -39,6 +45,9 @@ public function getVersion() } /** + *

    Update actions to be performed on the QuoteRequest.

    + * + * @return null|QuoteRequestUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdateModel.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdateModel.php index 399a4e59dc9..290ae2584c9 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdateModel.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestUpdateModel.php @@ -20,11 +20,13 @@ final class QuoteRequestUpdateModel extends JsonObjectModel implements QuoteRequestUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?QuoteRequestUpdateActionCollection */ protected $actions; @@ -42,6 +44,10 @@ public function __construct( } /** + *

    Expected version of the QuoteRequest to which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * * @return null|int */ public function getVersion() @@ -59,6 +65,9 @@ public function getVersion() } /** + *

    Update actions to be performed on the QuoteRequest.

    + * + * * @return null|QuoteRequestUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Review/Review.php b/lib/commercetools-api/src/Models/Review/Review.php index f202546c00d..d7c4d6940ce 100644 --- a/lib/commercetools-api/src/Models/Review/Review.php +++ b/lib/commercetools-api/src/Models/Review/Review.php @@ -40,23 +40,31 @@ interface Review extends BaseResource /** *

    Unique identifier of the Review.

    * + * @return null|string */ public function getId(); /** - *

    The current version of the review.

    + *

    Current version of the Review.

    * + * @return null|int */ public function getVersion(); /** + *

    Date and time (UTC) the Review was initially created.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt(); /** + *

    Date and time (UTC) the Review was last updated.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -64,6 +72,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -71,6 +80,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -78,72 +88,97 @@ public function getCreatedBy(); /** *

    User-defined unique identifier of the Review.

    * + * @return null|string */ public function getKey(); /** + *

    Must be unique among Reviews. For example, if this value is set to Customer id + Product id, only one Review per Customer and per Product is allowed.

    + * + * @return null|string */ public function getUniquenessValue(); /** + *

    Language in which the content of the Review is written.

    + * + * @return null|string */ public function getLocale(); /** + *

    Name of the author.

    + * + * @return null|string */ public function getAuthorName(); /** + *

    Title of the Review.

    + * + * @return null|string */ public function getTitle(); /** + *

    Content of the Review.

    + * + * @return null|string */ public function getText(); /** - *

    Identifies the target of the review. - * Can be a Product or a Channel

    + *

    Identifies the target of the Review. Can be a Product or a Channel, specified as ProductReference or ChannelReference, respectively.

    * + * @return null|mixed */ public function getTarget(); /** - *

    Indicates if this review is taken into account in the ratings statistics of the target. - * A review is per default used in the statistics, unless the review is in a state that does not have the role ReviewIncludedInStatistics. - * If the role of a State is modified after the calculation of this field, the calculation is not updated.

    + *

    Indicates if this Review is taken into account in the ratings statistics of the target. + * A Review is per default used in the statistics, unless the Review is in a state that does not have the role ReviewIncludedInStatistics. + * If the role of a State is modified after the calculation of this field, the calculation is not updated.

    * + * @return null|bool */ public function getIncludedInStatistics(); /** - *

    Number between -100 and 100 included.

    + *

    Rating of the Product or Channel.

    * + * @return null|int */ public function getRating(); /** + *

    State of the Review. Used for approval processes, see Review approval process for details.

    + * + * @return null|StateReference */ public function getState(); /** - *

    The customer who created the review.

    + *

    Customer who created the Review.

    * + * @return null|CustomerReference */ public function getCustomer(); /** + *

    Custom Fields of the Review.

    + * + * @return null|CustomFields */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewBuilder.php index d87e5a690e5..1ac0ae8d28b 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewBuilder.php @@ -34,91 +34,109 @@ final class ReviewBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $key; /** + * @var ?string */ private $uniquenessValue; /** + * @var ?string */ private $locale; /** + * @var ?string */ private $authorName; /** + * @var ?string */ private $title; /** + * @var ?string */ private $text; /** + * @var ?JsonObject */ private $target; /** + * @var ?bool */ private $includedInStatistics; /** + * @var ?int */ private $rating; /** + * @var null|StateReference|StateReferenceBuilder */ private $state; /** + * @var null|CustomerReference|CustomerReferenceBuilder */ private $customer; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; @@ -126,6 +144,7 @@ final class ReviewBuilder implements Builder /** *

    Unique identifier of the Review.

    * + * @return null|string */ public function getId() @@ -134,8 +153,9 @@ public function getId() } /** - *

    The current version of the review.

    + *

    Current version of the Review.

    * + * @return null|int */ public function getVersion() @@ -144,6 +164,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Review was initially created.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -152,6 +175,9 @@ public function getCreatedAt() } /** + *

    Date and time (UTC) the Review was last updated.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -162,6 +188,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -172,6 +199,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -182,6 +210,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the Review.

    * + * @return null|string */ public function getKey() @@ -190,6 +219,9 @@ public function getKey() } /** + *

    Must be unique among Reviews. For example, if this value is set to Customer id + Product id, only one Review per Customer and per Product is allowed.

    + * + * @return null|string */ public function getUniquenessValue() @@ -198,6 +230,9 @@ public function getUniquenessValue() } /** + *

    Language in which the content of the Review is written.

    + * + * @return null|string */ public function getLocale() @@ -206,6 +241,9 @@ public function getLocale() } /** + *

    Name of the author.

    + * + * @return null|string */ public function getAuthorName() @@ -214,6 +252,9 @@ public function getAuthorName() } /** + *

    Title of the Review.

    + * + * @return null|string */ public function getTitle() @@ -222,6 +263,9 @@ public function getTitle() } /** + *

    Content of the Review.

    + * + * @return null|string */ public function getText() @@ -230,9 +274,9 @@ public function getText() } /** - *

    Identifies the target of the review. - * Can be a Product or a Channel

    + *

    Identifies the target of the Review. Can be a Product or a Channel, specified as ProductReference or ChannelReference, respectively.

    * + * @return null|JsonObject */ public function getTarget() @@ -241,10 +285,11 @@ public function getTarget() } /** - *

    Indicates if this review is taken into account in the ratings statistics of the target. - * A review is per default used in the statistics, unless the review is in a state that does not have the role ReviewIncludedInStatistics. - * If the role of a State is modified after the calculation of this field, the calculation is not updated.

    + *

    Indicates if this Review is taken into account in the ratings statistics of the target. + * A Review is per default used in the statistics, unless the Review is in a state that does not have the role ReviewIncludedInStatistics. + * If the role of a State is modified after the calculation of this field, the calculation is not updated.

    * + * @return null|bool */ public function getIncludedInStatistics() @@ -253,8 +298,9 @@ public function getIncludedInStatistics() } /** - *

    Number between -100 and 100 included.

    + *

    Rating of the Product or Channel.

    * + * @return null|int */ public function getRating() @@ -263,6 +309,9 @@ public function getRating() } /** + *

    State of the Review. Used for approval processes, see Review approval process for details.

    + * + * @return null|StateReference */ public function getState() @@ -271,8 +320,9 @@ public function getState() } /** - *

    The customer who created the review.

    + *

    Customer who created the Review.

    * + * @return null|CustomerReference */ public function getCustomer() @@ -281,6 +331,9 @@ public function getCustomer() } /** + *

    Custom Fields of the Review.

    + * + * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Review/ReviewDraft.php b/lib/commercetools-api/src/Models/Review/ReviewDraft.php index 54f5ef0cccb..e63c8c45396 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewDraft.php +++ b/lib/commercetools-api/src/Models/Review/ReviewDraft.php @@ -33,69 +33,90 @@ interface ReviewDraft extends JsonObject /** *

    User-defined unique identifier for the Review.

    * + * @return null|string */ public function getKey(); /** - *

    If set, this value must be unique among reviews. - * For example, if you want to have only one review per customer and per product, you can set the value to customer's id and product's id.

    + *

    If set, this value must be unique among Reviews. + * For example, if you want to have only one Review per Customer and per Product, you can set the value to Customer id + Product id.

    * + * @return null|string */ public function getUniquenessValue(); /** + *

    Language in which the content of the Review is written.

    + * + * @return null|string */ public function getLocale(); /** + *

    Name of the author.

    + * + * @return null|string */ public function getAuthorName(); /** + *

    Title of the Review.

    + * + * @return null|string */ public function getTitle(); /** + *

    Content of the Review.

    + * + * @return null|string */ public function getText(); /** - *

    Identifies the target of the review. - * Can be a Product or a Channel

    + *

    Identifies the target of the Review. Can be a Product or a Channel, specified as ProductResourceIdentifier or ChannelResourceIdentifier, respectively.

    * + * @return null|mixed */ public function getTarget(); /** + *

    State of the Review. Used for approval processes, see Review approval process for details.

    + * + * @return null|StateResourceIdentifier */ public function getState(); /** - *

    Number between -100 and 100 included. - * Rating of the targeted object, like a product. - * This rating can represent the number of stars, or a percentage, or a like (+1)/dislike (-1) - * A rating is used in the ratings statistics of the targeted object, unless the review is in a state that does not have the role ReviewIncludedInStatistics.

    + *

    Rating of the targeted Product or Channel. + * This rating can represent the number of stars, a percentage, or a like (+1)/dislike (-1). + * A rating is used in the ratings statistics of the targeted object, unless the Review is in a State that does not have the role ReviewIncludedInStatistics.

    * + * @return null|int */ public function getRating(); /** - *

    The customer who created the review.

    + *

    Customer who created the Review.

    * + * @return null|CustomerResourceIdentifier */ public function getCustomer(); /** + *

    Custom Fields for the Review.

    + * + * @return null|CustomFieldsDraft */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewDraftBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewDraftBuilder.php index 2d1686cfde2..b3ce39d3db4 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewDraftBuilder.php @@ -27,56 +27,67 @@ final class ReviewDraftBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $uniquenessValue; /** + * @var ?string */ private $locale; /** + * @var ?string */ private $authorName; /** + * @var ?string */ private $title; /** + * @var ?string */ private $text; /** + * @var ?JsonObject */ private $target; /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $state; /** + * @var ?int */ private $rating; /** + * @var null|CustomerResourceIdentifier|CustomerResourceIdentifierBuilder */ private $customer; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; @@ -84,6 +95,7 @@ final class ReviewDraftBuilder implements Builder /** *

    User-defined unique identifier for the Review.

    * + * @return null|string */ public function getKey() @@ -92,9 +104,10 @@ public function getKey() } /** - *

    If set, this value must be unique among reviews. - * For example, if you want to have only one review per customer and per product, you can set the value to customer's id and product's id.

    + *

    If set, this value must be unique among Reviews. + * For example, if you want to have only one Review per Customer and per Product, you can set the value to Customer id + Product id.

    * + * @return null|string */ public function getUniquenessValue() @@ -103,6 +116,9 @@ public function getUniquenessValue() } /** + *

    Language in which the content of the Review is written.

    + * + * @return null|string */ public function getLocale() @@ -111,6 +127,9 @@ public function getLocale() } /** + *

    Name of the author.

    + * + * @return null|string */ public function getAuthorName() @@ -119,6 +138,9 @@ public function getAuthorName() } /** + *

    Title of the Review.

    + * + * @return null|string */ public function getTitle() @@ -127,6 +149,9 @@ public function getTitle() } /** + *

    Content of the Review.

    + * + * @return null|string */ public function getText() @@ -135,9 +160,9 @@ public function getText() } /** - *

    Identifies the target of the review. - * Can be a Product or a Channel

    + *

    Identifies the target of the Review. Can be a Product or a Channel, specified as ProductResourceIdentifier or ChannelResourceIdentifier, respectively.

    * + * @return null|JsonObject */ public function getTarget() @@ -146,6 +171,9 @@ public function getTarget() } /** + *

    State of the Review. Used for approval processes, see Review approval process for details.

    + * + * @return null|StateResourceIdentifier */ public function getState() @@ -154,11 +182,11 @@ public function getState() } /** - *

    Number between -100 and 100 included. - * Rating of the targeted object, like a product. - * This rating can represent the number of stars, or a percentage, or a like (+1)/dislike (-1) - * A rating is used in the ratings statistics of the targeted object, unless the review is in a state that does not have the role ReviewIncludedInStatistics.

    + *

    Rating of the targeted Product or Channel. + * This rating can represent the number of stars, a percentage, or a like (+1)/dislike (-1). + * A rating is used in the ratings statistics of the targeted object, unless the Review is in a State that does not have the role ReviewIncludedInStatistics.

    * + * @return null|int */ public function getRating() @@ -167,8 +195,9 @@ public function getRating() } /** - *

    The customer who created the review.

    + *

    Customer who created the Review.

    * + * @return null|CustomerResourceIdentifier */ public function getCustomer() @@ -177,6 +206,9 @@ public function getCustomer() } /** + *

    Custom Fields for the Review.

    + * + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Review/ReviewDraftModel.php b/lib/commercetools-api/src/Models/Review/ReviewDraftModel.php index d26f8e0fc82..cc85dbd2ec7 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewDraftModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewDraftModel.php @@ -30,56 +30,67 @@ final class ReviewDraftModel extends JsonObjectModel implements ReviewDraft { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $uniquenessValue; /** + * * @var ?string */ protected $locale; /** + * * @var ?string */ protected $authorName; /** + * * @var ?string */ protected $title; /** + * * @var ?string */ protected $text; /** + * * @var ?mixed */ protected $target; /** + * * @var ?StateResourceIdentifier */ protected $state; /** + * * @var ?int */ protected $rating; /** + * * @var ?CustomerResourceIdentifier */ protected $customer; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -117,6 +128,7 @@ public function __construct( /** *

    User-defined unique identifier for the Review.

    * + * * @return null|string */ public function getKey() @@ -134,8 +146,9 @@ public function getKey() } /** - *

    If set, this value must be unique among reviews. - * For example, if you want to have only one review per customer and per product, you can set the value to customer's id and product's id.

    + *

    If set, this value must be unique among Reviews. + * For example, if you want to have only one Review per Customer and per Product, you can set the value to Customer id + Product id.

    + * * * @return null|string */ @@ -154,6 +167,9 @@ public function getUniquenessValue() } /** + *

    Language in which the content of the Review is written.

    + * + * * @return null|string */ public function getLocale() @@ -171,6 +187,9 @@ public function getLocale() } /** + *

    Name of the author.

    + * + * * @return null|string */ public function getAuthorName() @@ -188,6 +207,9 @@ public function getAuthorName() } /** + *

    Title of the Review.

    + * + * * @return null|string */ public function getTitle() @@ -205,6 +227,9 @@ public function getTitle() } /** + *

    Content of the Review.

    + * + * * @return null|string */ public function getText() @@ -222,8 +247,8 @@ public function getText() } /** - *

    Identifies the target of the review. - * Can be a Product or a Channel

    + *

    Identifies the target of the Review. Can be a Product or a Channel, specified as ProductResourceIdentifier or ChannelResourceIdentifier, respectively.

    + * * * @return ?mixed */ @@ -242,6 +267,9 @@ public function getTarget() } /** + *

    State of the Review. Used for approval processes, see Review approval process for details.

    + * + * * @return null|StateResourceIdentifier */ public function getState() @@ -260,10 +288,10 @@ public function getState() } /** - *

    Number between -100 and 100 included. - * Rating of the targeted object, like a product. - * This rating can represent the number of stars, or a percentage, or a like (+1)/dislike (-1) - * A rating is used in the ratings statistics of the targeted object, unless the review is in a state that does not have the role ReviewIncludedInStatistics.

    + *

    Rating of the targeted Product or Channel. + * This rating can represent the number of stars, a percentage, or a like (+1)/dislike (-1). + * A rating is used in the ratings statistics of the targeted object, unless the Review is in a State that does not have the role ReviewIncludedInStatistics.

    + * * * @return null|int */ @@ -282,7 +310,8 @@ public function getRating() } /** - *

    The customer who created the review.

    + *

    Customer who created the Review.

    + * * * @return null|CustomerResourceIdentifier */ @@ -302,6 +331,9 @@ public function getCustomer() } /** + *

    Custom Fields for the Review.

    + * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -320,8 +352,7 @@ public function getCustom() } /** - *

    Identifies the target of the review. - * Can be a Product or a Channel

    + *

    Identifies the target of the Review. Can be a Product or a Channel, specified as ProductResourceIdentifier or ChannelResourceIdentifier, respectively.

    * * @return null|ProductResourceIdentifier */ @@ -337,8 +368,7 @@ public function getTargetAsProductResourceIdentifier() } /** - *

    Identifies the target of the review. - * Can be a Product or a Channel

    + *

    Identifies the target of the Review. Can be a Product or a Channel, specified as ProductResourceIdentifier or ChannelResourceIdentifier, respectively.

    * * @return null|ChannelResourceIdentifier */ diff --git a/lib/commercetools-api/src/Models/Review/ReviewModel.php b/lib/commercetools-api/src/Models/Review/ReviewModel.php index 084ab8cce31..3b6fafbb3bd 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewModel.php @@ -37,91 +37,109 @@ final class ReviewModel extends JsonObjectModel implements Review { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $uniquenessValue; /** + * * @var ?string */ protected $locale; /** + * * @var ?string */ protected $authorName; /** + * * @var ?string */ protected $title; /** + * * @var ?string */ protected $text; /** + * * @var ?mixed */ protected $target; /** + * * @var ?bool */ protected $includedInStatistics; /** + * * @var ?int */ protected $rating; /** + * * @var ?StateReference */ protected $state; /** + * * @var ?CustomerReference */ protected $customer; /** + * * @var ?CustomFields */ protected $custom; @@ -173,6 +191,7 @@ public function __construct( /** *

    Unique identifier of the Review.

    * + * * @return null|string */ public function getId() @@ -190,7 +209,8 @@ public function getId() } /** - *

    The current version of the review.

    + *

    Current version of the Review.

    + * * * @return null|int */ @@ -209,6 +229,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Review was initially created.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -230,6 +253,9 @@ public function getCreatedAt() } /** + *

    Date and time (UTC) the Review was last updated.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -253,6 +279,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -273,6 +300,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -293,6 +321,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the Review.

    * + * * @return null|string */ public function getKey() @@ -310,6 +339,9 @@ public function getKey() } /** + *

    Must be unique among Reviews. For example, if this value is set to Customer id + Product id, only one Review per Customer and per Product is allowed.

    + * + * * @return null|string */ public function getUniquenessValue() @@ -327,6 +359,9 @@ public function getUniquenessValue() } /** + *

    Language in which the content of the Review is written.

    + * + * * @return null|string */ public function getLocale() @@ -344,6 +379,9 @@ public function getLocale() } /** + *

    Name of the author.

    + * + * * @return null|string */ public function getAuthorName() @@ -361,6 +399,9 @@ public function getAuthorName() } /** + *

    Title of the Review.

    + * + * * @return null|string */ public function getTitle() @@ -378,6 +419,9 @@ public function getTitle() } /** + *

    Content of the Review.

    + * + * * @return null|string */ public function getText() @@ -395,8 +439,8 @@ public function getText() } /** - *

    Identifies the target of the review. - * Can be a Product or a Channel

    + *

    Identifies the target of the Review. Can be a Product or a Channel, specified as ProductReference or ChannelReference, respectively.

    + * * * @return ?mixed */ @@ -415,9 +459,10 @@ public function getTarget() } /** - *

    Indicates if this review is taken into account in the ratings statistics of the target. - * A review is per default used in the statistics, unless the review is in a state that does not have the role ReviewIncludedInStatistics. - * If the role of a State is modified after the calculation of this field, the calculation is not updated.

    + *

    Indicates if this Review is taken into account in the ratings statistics of the target. + * A Review is per default used in the statistics, unless the Review is in a state that does not have the role ReviewIncludedInStatistics. + * If the role of a State is modified after the calculation of this field, the calculation is not updated.

    + * * * @return null|bool */ @@ -436,7 +481,8 @@ public function getIncludedInStatistics() } /** - *

    Number between -100 and 100 included.

    + *

    Rating of the Product or Channel.

    + * * * @return null|int */ @@ -455,6 +501,9 @@ public function getRating() } /** + *

    State of the Review. Used for approval processes, see Review approval process for details.

    + * + * * @return null|StateReference */ public function getState() @@ -473,7 +522,8 @@ public function getState() } /** - *

    The customer who created the review.

    + *

    Customer who created the Review.

    + * * * @return null|CustomerReference */ @@ -493,6 +543,9 @@ public function getCustomer() } /** + *

    Custom Fields of the Review.

    + * + * * @return null|CustomFields */ public function getCustom() @@ -511,8 +564,7 @@ public function getCustom() } /** - *

    Identifies the target of the review. - * Can be a Product or a Channel

    + *

    Identifies the target of the Review. Can be a Product or a Channel, specified as ProductReference or ChannelReference, respectively.

    * * @return null|ProductReference */ @@ -528,8 +580,7 @@ public function getTargetAsProductReference() } /** - *

    Identifies the target of the review. - * Can be a Product or a Channel

    + *

    Identifies the target of the Review. Can be a Product or a Channel, specified as ProductReference or ChannelReference, respectively.

    * * @return null|ChannelReference */ diff --git a/lib/commercetools-api/src/Models/Review/ReviewPagedQueryResponse.php b/lib/commercetools-api/src/Models/Review/ReviewPagedQueryResponse.php index 054aa652f2b..9f0b164a217 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Review/ReviewPagedQueryResponse.php @@ -22,16 +22,27 @@ interface ReviewPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); /** + *

    Actual number of results returned.

    + * + * @return null|int */ public function getCount(); /** + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    + * + * @return null|int */ public function getTotal(); @@ -39,11 +50,15 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); /** + *

    Reviews matching the query.

    + * + * @return null|ReviewCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewPagedQueryResponseBuilder.php index f519ec2ce1e..eb0c0cb6400 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class ReviewPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?ReviewCollection */ private $results; @@ -48,6 +53,7 @@ final class ReviewPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -56,6 +62,9 @@ public function getLimit() } /** + *

    Actual number of results returned.

    + * + * @return null|int */ public function getCount() @@ -64,6 +73,13 @@ public function getCount() } /** + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    + * + * @return null|int */ public function getTotal() @@ -74,6 +90,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -82,6 +99,9 @@ public function getOffset() } /** + *

    Reviews matching the query.

    + * + * @return null|ReviewCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Review/ReviewPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Review/ReviewPagedQueryResponseModel.php index f52bc785e41..df9dbc37d07 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class ReviewPagedQueryResponseModel extends JsonObjectModel implements ReviewPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?ReviewCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -82,6 +88,9 @@ public function getLimit() } /** + *

    Actual number of results returned.

    + * + * * @return null|int */ public function getCount() @@ -99,6 +108,13 @@ public function getCount() } /** + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    + * + * * @return null|int */ public function getTotal() @@ -118,6 +134,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -135,6 +152,9 @@ public function getOffset() } /** + *

    Reviews matching the query.

    + * + * * @return null|ReviewCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Review/ReviewRatingStatistics.php b/lib/commercetools-api/src/Models/Review/ReviewRatingStatistics.php index 5ce2cfcedf9..352b2f1628e 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewRatingStatistics.php +++ b/lib/commercetools-api/src/Models/Review/ReviewRatingStatistics.php @@ -23,6 +23,7 @@ interface ReviewRatingStatistics extends JsonObject *

    Average rating of one target * This number is rounded with 5 decimals.

    * + * @return null|float */ public function getAverageRating(); @@ -30,6 +31,7 @@ public function getAverageRating(); /** *

    Highest rating of one target

    * + * @return null|float */ public function getHighestRating(); @@ -37,6 +39,7 @@ public function getHighestRating(); /** *

    Lowest rating of one target

    * + * @return null|float */ public function getLowestRating(); @@ -44,15 +47,17 @@ public function getLowestRating(); /** *

    Number of ratings taken into account

    * + * @return null|int */ public function getCount(); /** - *

    The full distribution of the ratings. + *

    Full distribution of the ratings. * The keys are the different ratings and the values are the count of reviews having this rating. * Only the used ratings appear in this object.

    * + * @return null|mixed */ public function getRatingsDistribution(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewRatingStatisticsBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewRatingStatisticsBuilder.php index 5a694792f6e..45ea84de622 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewRatingStatisticsBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewRatingStatisticsBuilder.php @@ -21,26 +21,31 @@ final class ReviewRatingStatisticsBuilder implements Builder { /** + * @var ?float */ private $averageRating; /** + * @var ?float */ private $highestRating; /** + * @var ?float */ private $lowestRating; /** + * @var ?int */ private $count; /** + * @var ?JsonObject */ private $ratingsDistribution; @@ -49,6 +54,7 @@ final class ReviewRatingStatisticsBuilder implements Builder *

    Average rating of one target * This number is rounded with 5 decimals.

    * + * @return null|float */ public function getAverageRating() @@ -59,6 +65,7 @@ public function getAverageRating() /** *

    Highest rating of one target

    * + * @return null|float */ public function getHighestRating() @@ -69,6 +76,7 @@ public function getHighestRating() /** *

    Lowest rating of one target

    * + * @return null|float */ public function getLowestRating() @@ -79,6 +87,7 @@ public function getLowestRating() /** *

    Number of ratings taken into account

    * + * @return null|int */ public function getCount() @@ -87,10 +96,11 @@ public function getCount() } /** - *

    The full distribution of the ratings. + *

    Full distribution of the ratings. * The keys are the different ratings and the values are the count of reviews having this rating. * Only the used ratings appear in this object.

    * + * @return null|JsonObject */ public function getRatingsDistribution() diff --git a/lib/commercetools-api/src/Models/Review/ReviewRatingStatisticsModel.php b/lib/commercetools-api/src/Models/Review/ReviewRatingStatisticsModel.php index 012ab48b8a0..d78da0f28ed 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewRatingStatisticsModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewRatingStatisticsModel.php @@ -20,26 +20,31 @@ final class ReviewRatingStatisticsModel extends JsonObjectModel implements ReviewRatingStatistics { /** + * * @var ?float */ protected $averageRating; /** + * * @var ?float */ protected $highestRating; /** + * * @var ?float */ protected $lowestRating; /** + * * @var ?int */ protected $count; /** + * * @var ?mixed */ protected $ratingsDistribution; @@ -66,6 +71,7 @@ public function __construct( *

    Average rating of one target * This number is rounded with 5 decimals.

    * + * * @return null|float */ public function getAverageRating() @@ -85,6 +91,7 @@ public function getAverageRating() /** *

    Highest rating of one target

    * + * * @return null|float */ public function getHighestRating() @@ -104,6 +111,7 @@ public function getHighestRating() /** *

    Lowest rating of one target

    * + * * @return null|float */ public function getLowestRating() @@ -123,6 +131,7 @@ public function getLowestRating() /** *

    Number of ratings taken into account

    * + * * @return null|int */ public function getCount() @@ -140,10 +149,11 @@ public function getCount() } /** - *

    The full distribution of the ratings. + *

    Full distribution of the ratings. * The keys are the different ratings and the values are the count of reviews having this rating. * Only the used ratings appear in this object.

    * + * * @return null|mixed */ public function getRatingsDistribution() diff --git a/lib/commercetools-api/src/Models/Review/ReviewReference.php b/lib/commercetools-api/src/Models/Review/ReviewReference.php index 425b030329b..4459b269fbd 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewReference.php +++ b/lib/commercetools-api/src/Models/Review/ReviewReference.php @@ -19,6 +19,7 @@ interface ReviewReference extends Reference /** *

    Contains the representation of the expanded Review. Only present in responses to requests with Reference Expansion for Reviews.

    * + * @return null|Review */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

    Unique identifier of the referenced Review.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewReferenceBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewReferenceBuilder.php index 85e5dcbfdcd..456d7026165 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewReferenceBuilder.php @@ -23,11 +23,13 @@ final class ReviewReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|Review|ReviewBuilder */ private $obj; @@ -35,6 +37,7 @@ final class ReviewReferenceBuilder implements Builder /** *

    Unique identifier of the referenced Review.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded Review. Only present in responses to requests with Reference Expansion for Reviews.

    * + * @return null|Review */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Review/ReviewReferenceModel.php b/lib/commercetools-api/src/Models/Review/ReviewReferenceModel.php index 26bf959f4b6..d5f23b203de 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewReferenceModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewReferenceModel.php @@ -23,16 +23,19 @@ final class ReviewReferenceModel extends JsonObjectModel implements ReviewRefere { public const DISCRIMINATOR_VALUE = 'review'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?Review */ protected $obj; @@ -43,16 +46,18 @@ final class ReviewReferenceModel extends JsonObjectModel implements ReviewRefere */ public function __construct( ?string $id = null, - ?Review $obj = null + ?Review $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced Review.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded Review. Only present in responses to requests with Reference Expansion for Reviews.

    * + * * @return null|Review */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Review/ReviewResourceIdentifier.php b/lib/commercetools-api/src/Models/Review/ReviewResourceIdentifier.php index 340d04a766d..34d7abd6eca 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/Review/ReviewResourceIdentifier.php @@ -17,6 +17,7 @@ interface ReviewResourceIdentifier extends ResourceIdentifier /** *

    Unique identifier of the referenced Review. Either id or key is required.

    * + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

    User-defined unique identifier of the referenced Review. Either id or key is required.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewResourceIdentifierBuilder.php index d07e27749f6..e3c4c499d1d 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class ReviewResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class ReviewResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced Review. Either id or key is required.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced Review. Either id or key is required.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Review/ReviewResourceIdentifierModel.php b/lib/commercetools-api/src/Models/Review/ReviewResourceIdentifierModel.php index 763ddfa2116..7c98bc2dfcb 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class ReviewResourceIdentifierModel extends JsonObjectModel implements Rev { public const DISCRIMINATOR_VALUE = 'review'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class ReviewResourceIdentifierModel extends JsonObjectModel implements Rev */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced Review. Either id or key is required.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced Review. Either id or key is required.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetAuthorNameAction.php b/lib/commercetools-api/src/Models/Review/ReviewSetAuthorNameAction.php index fcd11c8aebd..9fb7c4be631 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetAuthorNameAction.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetAuthorNameAction.php @@ -16,8 +16,9 @@ interface ReviewSetAuthorNameAction extends ReviewUpdateAction public const FIELD_AUTHOR_NAME = 'authorName'; /** - *

    If authorName is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getAuthorName(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetAuthorNameActionBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewSetAuthorNameActionBuilder.php index 2ea83687cfd..90340f4f302 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetAuthorNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetAuthorNameActionBuilder.php @@ -21,13 +21,15 @@ final class ReviewSetAuthorNameActionBuilder implements Builder { /** + * @var ?string */ private $authorName; /** - *

    If authorName is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getAuthorName() diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetAuthorNameActionModel.php b/lib/commercetools-api/src/Models/Review/ReviewSetAuthorNameActionModel.php index 58292625241..4765a28142a 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetAuthorNameActionModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetAuthorNameActionModel.php @@ -21,11 +21,13 @@ final class ReviewSetAuthorNameActionModel extends JsonObjectModel implements Re { public const DISCRIMINATOR_VALUE = 'setAuthorName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $authorName; @@ -35,13 +37,15 @@ final class ReviewSetAuthorNameActionModel extends JsonObjectModel implements Re * @psalm-suppress MissingParamType */ public function __construct( - ?string $authorName = null + ?string $authorName = null, + ?string $action = null ) { $this->authorName = $authorName; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,7 +63,8 @@ public function getAction() } /** - *

    If authorName is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetCustomFieldAction.php b/lib/commercetools-api/src/Models/Review/ReviewSetCustomFieldAction.php index abd70cf0b91..b24703d9e0a 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface ReviewSetCustomFieldAction extends ReviewUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewSetCustomFieldActionBuilder.php index 99009bf5cf3..0be775c8a46 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class ReviewSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class ReviewSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Review/ReviewSetCustomFieldActionModel.php index 16036259831..ae328b7bdb5 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class ReviewSetCustomFieldActionModel extends JsonObjectModel implements R { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class ReviewSetCustomFieldActionModel extends JsonObjectModel implements R */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetCustomTypeAction.php b/lib/commercetools-api/src/Models/Review/ReviewSetCustomTypeAction.php index d45f8a00568..bf907450c71 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface ReviewSetCustomTypeAction extends ReviewUpdateAction *

    Defines the Type that extends the Review with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Review.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the Review.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewSetCustomTypeActionBuilder.php index bfcefebb7f1..e65da3b7625 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class ReviewSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class ReviewSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the Review with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Review.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Review.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Review/ReviewSetCustomTypeActionModel.php index 6f3c224caed..db719fd7381 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class ReviewSetCustomTypeActionModel extends JsonObjectModel implements Re { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class ReviewSetCustomTypeActionModel extends JsonObjectModel implements Re */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the Review with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Review.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Review.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetCustomerAction.php b/lib/commercetools-api/src/Models/Review/ReviewSetCustomerAction.php index 5e8a93ee9c1..39865329ad9 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetCustomerAction.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetCustomerAction.php @@ -17,9 +17,9 @@ interface ReviewSetCustomerAction extends ReviewUpdateAction public const FIELD_CUSTOMER = 'customer'; /** - *

    The customer who created the review. - * If customer is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|CustomerResourceIdentifier */ public function getCustomer(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetCustomerActionBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewSetCustomerActionBuilder.php index 04394e2374d..ad246043f0f 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetCustomerActionBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetCustomerActionBuilder.php @@ -23,14 +23,15 @@ final class ReviewSetCustomerActionBuilder implements Builder { /** + * @var null|CustomerResourceIdentifier|CustomerResourceIdentifierBuilder */ private $customer; /** - *

    The customer who created the review. - * If customer is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|CustomerResourceIdentifier */ public function getCustomer() diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetCustomerActionModel.php b/lib/commercetools-api/src/Models/Review/ReviewSetCustomerActionModel.php index aadc9317680..8096ca3df9f 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetCustomerActionModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetCustomerActionModel.php @@ -23,11 +23,13 @@ final class ReviewSetCustomerActionModel extends JsonObjectModel implements Revi { public const DISCRIMINATOR_VALUE = 'setCustomer'; /** + * * @var ?string */ protected $action; /** + * * @var ?CustomerResourceIdentifier */ protected $customer; @@ -37,13 +39,15 @@ final class ReviewSetCustomerActionModel extends JsonObjectModel implements Revi * @psalm-suppress MissingParamType */ public function __construct( - ?CustomerResourceIdentifier $customer = null + ?CustomerResourceIdentifier $customer = null, + ?string $action = null ) { $this->customer = $customer; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,8 +65,8 @@ public function getAction() } /** - *

    The customer who created the review. - * If customer is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    + * * * @return null|CustomerResourceIdentifier */ diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetKeyAction.php b/lib/commercetools-api/src/Models/Review/ReviewSetKeyAction.php index 9be85b68895..87b79a6d8d9 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetKeyAction.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetKeyAction.php @@ -16,8 +16,9 @@ interface ReviewSetKeyAction extends ReviewUpdateAction public const FIELD_KEY = 'key'; /** - *

    If key is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewSetKeyActionBuilder.php index 54564cde722..c5445281f29 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetKeyActionBuilder.php @@ -21,13 +21,15 @@ final class ReviewSetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; /** - *

    If key is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetKeyActionModel.php b/lib/commercetools-api/src/Models/Review/ReviewSetKeyActionModel.php index a31f29f85f4..3ddb25f3bac 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetKeyActionModel.php @@ -21,11 +21,13 @@ final class ReviewSetKeyActionModel extends JsonObjectModel implements ReviewSet { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class ReviewSetKeyActionModel extends JsonObjectModel implements ReviewSet * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,7 +63,8 @@ public function getAction() } /** - *

    If key is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetLocaleAction.php b/lib/commercetools-api/src/Models/Review/ReviewSetLocaleAction.php index 32d692120fb..60c6b35db17 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetLocaleAction.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetLocaleAction.php @@ -16,8 +16,9 @@ interface ReviewSetLocaleAction extends ReviewUpdateAction public const FIELD_LOCALE = 'locale'; /** - *

    If locale is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getLocale(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetLocaleActionBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewSetLocaleActionBuilder.php index 02447c4d391..9e658e3a498 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetLocaleActionBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetLocaleActionBuilder.php @@ -21,13 +21,15 @@ final class ReviewSetLocaleActionBuilder implements Builder { /** + * @var ?string */ private $locale; /** - *

    If locale is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getLocale() diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetLocaleActionModel.php b/lib/commercetools-api/src/Models/Review/ReviewSetLocaleActionModel.php index 693fa345b87..6e3579c35d0 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetLocaleActionModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetLocaleActionModel.php @@ -21,11 +21,13 @@ final class ReviewSetLocaleActionModel extends JsonObjectModel implements Review { public const DISCRIMINATOR_VALUE = 'setLocale'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $locale; @@ -35,13 +37,15 @@ final class ReviewSetLocaleActionModel extends JsonObjectModel implements Review * @psalm-suppress MissingParamType */ public function __construct( - ?string $locale = null + ?string $locale = null, + ?string $action = null ) { $this->locale = $locale; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,7 +63,8 @@ public function getAction() } /** - *

    If locale is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetRatingAction.php b/lib/commercetools-api/src/Models/Review/ReviewSetRatingAction.php index 600b31cdfbf..539d6be6fe6 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetRatingAction.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetRatingAction.php @@ -16,9 +16,9 @@ interface ReviewSetRatingAction extends ReviewUpdateAction public const FIELD_RATING = 'rating'; /** - *

    Number between -100 and 100 included. - * If rating is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|int */ public function getRating(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetRatingActionBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewSetRatingActionBuilder.php index 4d7db8fcf1d..a8f1310f46d 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetRatingActionBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetRatingActionBuilder.php @@ -21,14 +21,15 @@ final class ReviewSetRatingActionBuilder implements Builder { /** + * @var ?int */ private $rating; /** - *

    Number between -100 and 100 included. - * If rating is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|int */ public function getRating() diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetRatingActionModel.php b/lib/commercetools-api/src/Models/Review/ReviewSetRatingActionModel.php index 51e161d99f4..cb7e9db022a 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetRatingActionModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetRatingActionModel.php @@ -21,11 +21,13 @@ final class ReviewSetRatingActionModel extends JsonObjectModel implements Review { public const DISCRIMINATOR_VALUE = 'setRating'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $rating; @@ -35,13 +37,15 @@ final class ReviewSetRatingActionModel extends JsonObjectModel implements Review * @psalm-suppress MissingParamType */ public function __construct( - ?int $rating = null + ?int $rating = null, + ?string $action = null ) { $this->rating = $rating; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,8 +63,8 @@ public function getAction() } /** - *

    Number between -100 and 100 included. - * If rating is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    + * * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetTargetAction.php b/lib/commercetools-api/src/Models/Review/ReviewSetTargetAction.php index 3288b909c3d..a85f36b19fb 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetTargetAction.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetTargetAction.php @@ -18,10 +18,9 @@ interface ReviewSetTargetAction extends ReviewUpdateAction public const FIELD_TARGET = 'target'; /** - *

    Identifies the target of the review. - * Can be a Product or a Channel. - * If target is absent or null, this field will be removed if it exists.

    + *

    Value to set, specified as ProductResourceIdentifier or ChannelResourceIdentifier, respectively. If empty, any existing value will be removed.

    * + * @return null|mixed */ public function getTarget(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetTargetActionBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewSetTargetActionBuilder.php index c57750b1b8f..ee41a844b72 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetTargetActionBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetTargetActionBuilder.php @@ -21,15 +21,15 @@ final class ReviewSetTargetActionBuilder implements Builder { /** + * @var ?JsonObject */ private $target; /** - *

    Identifies the target of the review. - * Can be a Product or a Channel. - * If target is absent or null, this field will be removed if it exists.

    + *

    Value to set, specified as ProductResourceIdentifier or ChannelResourceIdentifier, respectively. If empty, any existing value will be removed.

    * + * @return null|JsonObject */ public function getTarget() diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetTargetActionModel.php b/lib/commercetools-api/src/Models/Review/ReviewSetTargetActionModel.php index b33d5dc9bf2..94d00204282 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetTargetActionModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetTargetActionModel.php @@ -25,11 +25,13 @@ final class ReviewSetTargetActionModel extends JsonObjectModel implements Review { public const DISCRIMINATOR_VALUE = 'setTarget'; /** + * * @var ?string */ protected $action; /** + * * @var ?mixed */ protected $target; @@ -39,13 +41,15 @@ final class ReviewSetTargetActionModel extends JsonObjectModel implements Review * @psalm-suppress MissingParamType */ public function __construct( - ?JsonObject $target = null + ?JsonObject $target = null, + ?string $action = null ) { $this->target = $target; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,9 +67,8 @@ public function getAction() } /** - *

    Identifies the target of the review. - * Can be a Product or a Channel. - * If target is absent or null, this field will be removed if it exists.

    + *

    Value to set, specified as ProductResourceIdentifier or ChannelResourceIdentifier, respectively. If empty, any existing value will be removed.

    + * * * @return ?mixed */ @@ -84,9 +87,7 @@ public function getTarget() } /** - *

    Identifies the target of the review. - * Can be a Product or a Channel. - * If target is absent or null, this field will be removed if it exists.

    + *

    Value to set, specified as ProductResourceIdentifier or ChannelResourceIdentifier, respectively. If empty, any existing value will be removed.

    * * @return null|ProductResourceIdentifier */ @@ -102,9 +103,7 @@ public function getTargetAsProductResourceIdentifier() } /** - *

    Identifies the target of the review. - * Can be a Product or a Channel. - * If target is absent or null, this field will be removed if it exists.

    + *

    Value to set, specified as ProductResourceIdentifier or ChannelResourceIdentifier, respectively. If empty, any existing value will be removed.

    * * @return null|ChannelResourceIdentifier */ diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetTextAction.php b/lib/commercetools-api/src/Models/Review/ReviewSetTextAction.php index a71bdae8487..f3439dcabb5 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetTextAction.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetTextAction.php @@ -16,8 +16,9 @@ interface ReviewSetTextAction extends ReviewUpdateAction public const FIELD_TEXT = 'text'; /** - *

    If text is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getText(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetTextActionBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewSetTextActionBuilder.php index a91478066e1..eea4926ac74 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetTextActionBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetTextActionBuilder.php @@ -21,13 +21,15 @@ final class ReviewSetTextActionBuilder implements Builder { /** + * @var ?string */ private $text; /** - *

    If text is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getText() diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetTextActionModel.php b/lib/commercetools-api/src/Models/Review/ReviewSetTextActionModel.php index 1e109eec2d5..df2c108140e 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetTextActionModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetTextActionModel.php @@ -21,11 +21,13 @@ final class ReviewSetTextActionModel extends JsonObjectModel implements ReviewSe { public const DISCRIMINATOR_VALUE = 'setText'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $text; @@ -35,13 +37,15 @@ final class ReviewSetTextActionModel extends JsonObjectModel implements ReviewSe * @psalm-suppress MissingParamType */ public function __construct( - ?string $text = null + ?string $text = null, + ?string $action = null ) { $this->text = $text; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,7 +63,8 @@ public function getAction() } /** - *

    If text is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetTitleAction.php b/lib/commercetools-api/src/Models/Review/ReviewSetTitleAction.php index aa2195ff960..f171645935f 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetTitleAction.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetTitleAction.php @@ -16,8 +16,9 @@ interface ReviewSetTitleAction extends ReviewUpdateAction public const FIELD_TITLE = 'title'; /** - *

    If title is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getTitle(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetTitleActionBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewSetTitleActionBuilder.php index 0f8fb728897..94e3bba9cb0 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetTitleActionBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetTitleActionBuilder.php @@ -21,13 +21,15 @@ final class ReviewSetTitleActionBuilder implements Builder { /** + * @var ?string */ private $title; /** - *

    If title is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getTitle() diff --git a/lib/commercetools-api/src/Models/Review/ReviewSetTitleActionModel.php b/lib/commercetools-api/src/Models/Review/ReviewSetTitleActionModel.php index 05e2fa0b9fc..9007d174df8 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewSetTitleActionModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewSetTitleActionModel.php @@ -21,11 +21,13 @@ final class ReviewSetTitleActionModel extends JsonObjectModel implements ReviewS { public const DISCRIMINATOR_VALUE = 'setTitle'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $title; @@ -35,13 +37,15 @@ final class ReviewSetTitleActionModel extends JsonObjectModel implements ReviewS * @psalm-suppress MissingParamType */ public function __construct( - ?string $title = null + ?string $title = null, + ?string $action = null ) { $this->title = $title; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,7 +63,8 @@ public function getAction() } /** - *

    If title is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Review/ReviewTransitionStateAction.php b/lib/commercetools-api/src/Models/Review/ReviewTransitionStateAction.php index 6e6fb5f4a9e..e36ff34d02d 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewTransitionStateAction.php +++ b/lib/commercetools-api/src/Models/Review/ReviewTransitionStateAction.php @@ -18,11 +18,17 @@ interface ReviewTransitionStateAction extends ReviewUpdateAction public const FIELD_FORCE = 'force'; /** + *

    Value to set. If there is no State yet, the new State must be an initial State. If the existing State has transitions set, there must be a direct transition to the new State. If transitions is not set, no validation is performed. If the new State does not have the role ReviewIncludedInStatistics, the Review is not taken into account in the ratings statistics of the target.

    + * + * @return null|StateResourceIdentifier */ public function getState(); /** + *

    Switch validations on or off.

    + * + * @return null|bool */ public function getForce(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewTransitionStateActionBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewTransitionStateActionBuilder.php index 800494c7273..dcfeb409976 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewTransitionStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewTransitionStateActionBuilder.php @@ -23,16 +23,21 @@ final class ReviewTransitionStateActionBuilder implements Builder { /** + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder */ private $state; /** + * @var ?bool */ private $force; /** + *

    Value to set. If there is no State yet, the new State must be an initial State. If the existing State has transitions set, there must be a direct transition to the new State. If transitions is not set, no validation is performed. If the new State does not have the role ReviewIncludedInStatistics, the Review is not taken into account in the ratings statistics of the target.

    + * + * @return null|StateResourceIdentifier */ public function getState() @@ -41,6 +46,9 @@ public function getState() } /** + *

    Switch validations on or off.

    + * + * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Review/ReviewTransitionStateActionModel.php b/lib/commercetools-api/src/Models/Review/ReviewTransitionStateActionModel.php index 39fa2e941ed..bbecba4a9ef 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewTransitionStateActionModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewTransitionStateActionModel.php @@ -23,16 +23,19 @@ final class ReviewTransitionStateActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'transitionState'; /** + * * @var ?string */ protected $action; /** + * * @var ?StateResourceIdentifier */ protected $state; /** + * * @var ?bool */ protected $force; @@ -43,14 +46,16 @@ final class ReviewTransitionStateActionModel extends JsonObjectModel implements */ public function __construct( ?StateResourceIdentifier $state = null, - ?bool $force = null + ?bool $force = null, + ?string $action = null ) { $this->state = $state; $this->force = $force; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,9 @@ public function getAction() } /** + *

    Value to set. If there is no State yet, the new State must be an initial State. If the existing State has transitions set, there must be a direct transition to the new State. If transitions is not set, no validation is performed. If the new State does not have the role ReviewIncludedInStatistics, the Review is not taken into account in the ratings statistics of the target.

    + * + * * @return null|StateResourceIdentifier */ public function getState() @@ -86,6 +94,9 @@ public function getState() } /** + *

    Switch validations on or off.

    + * + * * @return null|bool */ public function getForce() diff --git a/lib/commercetools-api/src/Models/Review/ReviewUpdate.php b/lib/commercetools-api/src/Models/Review/ReviewUpdate.php index bfb464d2e9b..560df42c000 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewUpdate.php +++ b/lib/commercetools-api/src/Models/Review/ReviewUpdate.php @@ -17,11 +17,17 @@ interface ReviewUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + *

    The expected version of the review on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    + * + * @return null|int */ public function getVersion(); /** + *

    The list of update actions to be performed on the review.

    + * + * @return null|ReviewUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewUpdateAction.php b/lib/commercetools-api/src/Models/Review/ReviewUpdateAction.php index cb178288627..c6db800b364 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewUpdateAction.php +++ b/lib/commercetools-api/src/Models/Review/ReviewUpdateAction.php @@ -17,6 +17,7 @@ interface ReviewUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Review/ReviewUpdateActionModel.php b/lib/commercetools-api/src/Models/Review/ReviewUpdateActionModel.php index fb2d791dd36..158b0f04535 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewUpdateActionModel.php @@ -21,6 +21,7 @@ final class ReviewUpdateActionModel extends JsonObjectModel implements ReviewUpd { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -47,11 +48,13 @@ final class ReviewUpdateActionModel extends JsonObjectModel implements ReviewUpd * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Review/ReviewUpdateBuilder.php b/lib/commercetools-api/src/Models/Review/ReviewUpdateBuilder.php index d271622ece2..653626d91ee 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Review/ReviewUpdateBuilder.php @@ -21,16 +21,21 @@ final class ReviewUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?ReviewUpdateActionCollection */ private $actions; /** + *

    The expected version of the review on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    + * + * @return null|int */ public function getVersion() @@ -39,6 +44,9 @@ public function getVersion() } /** + *

    The list of update actions to be performed on the review.

    + * + * @return null|ReviewUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Review/ReviewUpdateModel.php b/lib/commercetools-api/src/Models/Review/ReviewUpdateModel.php index e919baf27d0..03d03adfcc0 100644 --- a/lib/commercetools-api/src/Models/Review/ReviewUpdateModel.php +++ b/lib/commercetools-api/src/Models/Review/ReviewUpdateModel.php @@ -20,11 +20,13 @@ final class ReviewUpdateModel extends JsonObjectModel implements ReviewUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?ReviewUpdateActionCollection */ protected $actions; @@ -42,6 +44,9 @@ public function __construct( } /** + *

    The expected version of the review on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    + * + * * @return null|int */ public function getVersion() @@ -59,6 +64,9 @@ public function getVersion() } /** + *

    The list of update actions to be performed on the review.

    + * + * * @return null|ReviewUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/CartClassificationTier.php b/lib/commercetools-api/src/Models/ShippingMethod/CartClassificationTier.php index bfc3dd5fdc8..f7e1188a8c4 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/CartClassificationTier.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/CartClassificationTier.php @@ -21,6 +21,7 @@ interface CartClassificationTier extends ShippingRatePriceTier /** *

    key selected from the values of the CartClassificationType configured in the Project.

    * + * @return null|string */ public function getValue(); @@ -28,6 +29,7 @@ public function getValue(); /** *

    Fixed shipping rate for the selected classification.

    * + * @return null|Money */ public function getPrice(); @@ -35,6 +37,7 @@ public function getPrice(); /** *

    Appears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query.

    * + * @return null|bool */ public function getIsMatching(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/CartClassificationTierBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/CartClassificationTierBuilder.php index 267e698b000..784cff90fee 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/CartClassificationTierBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/CartClassificationTierBuilder.php @@ -23,16 +23,19 @@ final class CartClassificationTierBuilder implements Builder { /** + * @var ?string */ private $value; /** + * @var null|Money|MoneyBuilder */ private $price; /** + * @var ?bool */ private $isMatching; @@ -40,6 +43,7 @@ final class CartClassificationTierBuilder implements Builder /** *

    key selected from the values of the CartClassificationType configured in the Project.

    * + * @return null|string */ public function getValue() @@ -50,6 +54,7 @@ public function getValue() /** *

    Fixed shipping rate for the selected classification.

    * + * @return null|Money */ public function getPrice() @@ -60,6 +65,7 @@ public function getPrice() /** *

    Appears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query.

    * + * @return null|bool */ public function getIsMatching() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/CartClassificationTierModel.php b/lib/commercetools-api/src/Models/ShippingMethod/CartClassificationTierModel.php index 0ca8820fb7f..39852e37995 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/CartClassificationTierModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/CartClassificationTierModel.php @@ -23,21 +23,25 @@ final class CartClassificationTierModel extends JsonObjectModel implements CartC { public const DISCRIMINATOR_VALUE = 'CartClassification'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $value; /** + * * @var ?Money */ protected $price; /** + * * @var ?bool */ protected $isMatching; @@ -49,15 +53,17 @@ final class CartClassificationTierModel extends JsonObjectModel implements CartC public function __construct( ?string $value = null, ?Money $price = null, - ?bool $isMatching = null + ?bool $isMatching = null, + ?string $type = null ) { $this->value = $value; $this->price = $price; $this->isMatching = $isMatching; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -77,6 +83,7 @@ public function getType() /** *

    key selected from the values of the CartClassificationType configured in the Project.

    * + * * @return null|string */ public function getValue() @@ -96,6 +103,7 @@ public function getValue() /** *

    Fixed shipping rate for the selected classification.

    * + * * @return null|Money */ public function getPrice() @@ -116,6 +124,7 @@ public function getPrice() /** *

    Appears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query.

    * + * * @return null|bool */ public function getIsMatching() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/CartScoreTier.php b/lib/commercetools-api/src/Models/ShippingMethod/CartScoreTier.php index e77ee1eb744..a548d3454ef 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/CartScoreTier.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/CartScoreTier.php @@ -22,6 +22,7 @@ interface CartScoreTier extends ShippingRatePriceTier /** *

    Abstract value for categorizing a Cart. The range starts at 0. The default price covers 0, tiers start at 1. See Using Tiered Shipping Rates for details and examples.

    * + * @return null|int */ public function getScore(); @@ -29,6 +30,7 @@ public function getScore(); /** *

    Defines a fixed price for the score.

    * + * @return null|Money */ public function getPrice(); @@ -36,6 +38,7 @@ public function getPrice(); /** *

    Dynamically calculates a Price for a range of scores.

    * + * @return null|PriceFunction */ public function getPriceFunction(); @@ -43,6 +46,7 @@ public function getPriceFunction(); /** *

    Appears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query.

    * + * @return null|bool */ public function getIsMatching(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/CartScoreTierBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/CartScoreTierBuilder.php index 2119c19611a..f56e11f73e6 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/CartScoreTierBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/CartScoreTierBuilder.php @@ -23,21 +23,25 @@ final class CartScoreTierBuilder implements Builder { /** + * @var ?int */ private $score; /** + * @var null|Money|MoneyBuilder */ private $price; /** + * @var null|PriceFunction|PriceFunctionBuilder */ private $priceFunction; /** + * @var ?bool */ private $isMatching; @@ -45,6 +49,7 @@ final class CartScoreTierBuilder implements Builder /** *

    Abstract value for categorizing a Cart. The range starts at 0. The default price covers 0, tiers start at 1. See Using Tiered Shipping Rates for details and examples.

    * + * @return null|int */ public function getScore() @@ -55,6 +60,7 @@ public function getScore() /** *

    Defines a fixed price for the score.

    * + * @return null|Money */ public function getPrice() @@ -65,6 +71,7 @@ public function getPrice() /** *

    Dynamically calculates a Price for a range of scores.

    * + * @return null|PriceFunction */ public function getPriceFunction() @@ -75,6 +82,7 @@ public function getPriceFunction() /** *

    Appears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query.

    * + * @return null|bool */ public function getIsMatching() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/CartScoreTierModel.php b/lib/commercetools-api/src/Models/ShippingMethod/CartScoreTierModel.php index 345b58e448a..a5871aaacee 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/CartScoreTierModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/CartScoreTierModel.php @@ -23,26 +23,31 @@ final class CartScoreTierModel extends JsonObjectModel implements CartScoreTier { public const DISCRIMINATOR_VALUE = 'CartScore'; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $score; /** + * * @var ?Money */ protected $price; /** + * * @var ?PriceFunction */ protected $priceFunction; /** + * * @var ?bool */ protected $isMatching; @@ -55,16 +60,18 @@ public function __construct( ?int $score = null, ?Money $price = null, ?PriceFunction $priceFunction = null, - ?bool $isMatching = null + ?bool $isMatching = null, + ?string $type = null ) { $this->score = $score; $this->price = $price; $this->priceFunction = $priceFunction; $this->isMatching = $isMatching; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -84,6 +91,7 @@ public function getType() /** *

    Abstract value for categorizing a Cart. The range starts at 0. The default price covers 0, tiers start at 1. See Using Tiered Shipping Rates for details and examples.

    * + * * @return null|int */ public function getScore() @@ -103,6 +111,7 @@ public function getScore() /** *

    Defines a fixed price for the score.

    * + * * @return null|Money */ public function getPrice() @@ -123,6 +132,7 @@ public function getPrice() /** *

    Dynamically calculates a Price for a range of scores.

    * + * * @return null|PriceFunction */ public function getPriceFunction() @@ -143,6 +153,7 @@ public function getPriceFunction() /** *

    Appears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query.

    * + * * @return null|bool */ public function getIsMatching() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/CartValueTier.php b/lib/commercetools-api/src/Models/ShippingMethod/CartValueTier.php index 7b08bdccf95..667ffb0021a 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/CartValueTier.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/CartValueTier.php @@ -21,6 +21,7 @@ interface CartValueTier extends ShippingRatePriceTier /** *

    Minimum total price of a Cart for which a shipping rate applies.

    * + * @return null|int */ public function getMinimumCentAmount(); @@ -28,6 +29,7 @@ public function getMinimumCentAmount(); /** *

    Fixed shipping rate Price for a CartValue.

    * + * @return null|Money */ public function getPrice(); @@ -35,6 +37,7 @@ public function getPrice(); /** *

    Appears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query.

    * + * @return null|bool */ public function getIsMatching(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/CartValueTierBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/CartValueTierBuilder.php index 7c39c1d8058..a476c6b0c50 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/CartValueTierBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/CartValueTierBuilder.php @@ -23,16 +23,19 @@ final class CartValueTierBuilder implements Builder { /** + * @var ?int */ private $minimumCentAmount; /** + * @var null|Money|MoneyBuilder */ private $price; /** + * @var ?bool */ private $isMatching; @@ -40,6 +43,7 @@ final class CartValueTierBuilder implements Builder /** *

    Minimum total price of a Cart for which a shipping rate applies.

    * + * @return null|int */ public function getMinimumCentAmount() @@ -50,6 +54,7 @@ public function getMinimumCentAmount() /** *

    Fixed shipping rate Price for a CartValue.

    * + * @return null|Money */ public function getPrice() @@ -60,6 +65,7 @@ public function getPrice() /** *

    Appears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query.

    * + * @return null|bool */ public function getIsMatching() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/CartValueTierModel.php b/lib/commercetools-api/src/Models/ShippingMethod/CartValueTierModel.php index df4b6041009..b51d3969778 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/CartValueTierModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/CartValueTierModel.php @@ -23,21 +23,25 @@ final class CartValueTierModel extends JsonObjectModel implements CartValueTier { public const DISCRIMINATOR_VALUE = 'CartValue'; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $minimumCentAmount; /** + * * @var ?Money */ protected $price; /** + * * @var ?bool */ protected $isMatching; @@ -49,15 +53,17 @@ final class CartValueTierModel extends JsonObjectModel implements CartValueTier public function __construct( ?int $minimumCentAmount = null, ?Money $price = null, - ?bool $isMatching = null + ?bool $isMatching = null, + ?string $type = null ) { $this->minimumCentAmount = $minimumCentAmount; $this->price = $price; $this->isMatching = $isMatching; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -77,6 +83,7 @@ public function getType() /** *

    Minimum total price of a Cart for which a shipping rate applies.

    * + * * @return null|int */ public function getMinimumCentAmount() @@ -96,6 +103,7 @@ public function getMinimumCentAmount() /** *

    Fixed shipping rate Price for a CartValue.

    * + * * @return null|Money */ public function getPrice() @@ -116,6 +124,7 @@ public function getPrice() /** *

    Appears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query.

    * + * * @return null|bool */ public function getIsMatching() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/PriceFunction.php b/lib/commercetools-api/src/Models/ShippingMethod/PriceFunction.php index 1c9e7b2b51c..ceb8ae6d8c1 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/PriceFunction.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/PriceFunction.php @@ -19,6 +19,7 @@ interface PriceFunction extends JsonObject /** *

    Currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode(); @@ -27,6 +28,7 @@ public function getCurrencyCode(); *

    To calculate a Price based on the score, use +, -, * and parentheses. The score is inserted with x. The function returns the cent amount.

    *

    For example, to charge $1.99 for a score of 1, $3.99 for a score of 2, $5.99 for a score of 3 and onwards, the function is: (200 * x) - 1). To charge $4.50, $6.00, and $7.50 for express shipping, the function is: (150 * x) + 300.

    * + * @return null|string */ public function getFunction(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/PriceFunctionBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/PriceFunctionBuilder.php index 975f7e44810..cde6e4ccca4 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/PriceFunctionBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/PriceFunctionBuilder.php @@ -21,11 +21,13 @@ final class PriceFunctionBuilder implements Builder { /** + * @var ?string */ private $currencyCode; /** + * @var ?string */ private $function; @@ -33,6 +35,7 @@ final class PriceFunctionBuilder implements Builder /** *

    Currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode() @@ -44,6 +47,7 @@ public function getCurrencyCode() *

    To calculate a Price based on the score, use +, -, * and parentheses. The score is inserted with x. The function returns the cent amount.

    *

    For example, to charge $1.99 for a score of 1, $3.99 for a score of 2, $5.99 for a score of 3 and onwards, the function is: (200 * x) - 1). To charge $4.50, $6.00, and $7.50 for express shipping, the function is: (150 * x) + 300.

    * + * @return null|string */ public function getFunction() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/PriceFunctionModel.php b/lib/commercetools-api/src/Models/ShippingMethod/PriceFunctionModel.php index e9359e420ff..9ff4c403c56 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/PriceFunctionModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/PriceFunctionModel.php @@ -20,11 +20,13 @@ final class PriceFunctionModel extends JsonObjectModel implements PriceFunction { /** + * * @var ?string */ protected $currencyCode; /** + * * @var ?string */ protected $function; @@ -44,6 +46,7 @@ public function __construct( /** *

    Currency code compliant to ISO 4217.

    * + * * @return null|string */ public function getCurrencyCode() @@ -64,6 +67,7 @@ public function getCurrencyCode() *

    To calculate a Price based on the score, use +, -, * and parentheses. The score is inserted with x. The function returns the cent amount.

    *

    For example, to charge $1.99 for a score of 1, $3.99 for a score of 2, $5.99 for a score of 3 and onwards, the function is: (200 * x) - 1). To charge $4.50, $6.00, and $7.50 for express shipping, the function is: (150 * x) + 300.

    * + * * @return null|string */ public function getFunction() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethod.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethod.php index 469eb172116..eaf45e1c394 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethod.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethod.php @@ -36,6 +36,7 @@ interface ShippingMethod extends BaseResource /** *

    Unique identifier of the ShippingMethod.

    * + * @return null|string */ public function getId(); @@ -43,6 +44,7 @@ public function getId(); /** *

    Current version of the ShippingMethod.

    * + * @return null|int */ public function getVersion(); @@ -50,6 +52,7 @@ public function getVersion(); /** *

    Date and time (UTC) the ShippingMethod was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -57,6 +60,7 @@ public function getCreatedAt(); /** *

    Date and time (UTC) the ShippingMethod was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -64,6 +68,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -71,6 +76,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -78,6 +84,7 @@ public function getCreatedBy(); /** *

    User-defined unique identifier of the ShippingMethod.

    * + * @return null|string */ public function getKey(); @@ -85,6 +92,7 @@ public function getKey(); /** *

    Name of the ShippingMethod.

    * + * @return null|string */ public function getName(); @@ -92,6 +100,7 @@ public function getName(); /** *

    Localized name of the ShippingMethod.

    * + * @return null|LocalizedString */ public function getLocalizedName(); @@ -99,6 +108,7 @@ public function getLocalizedName(); /** *

    Description of the ShippingMethod.

    * + * @deprecated * @return null|string */ public function getDescription(); @@ -106,6 +116,7 @@ public function getDescription(); /** *

    Localized description of the ShippingMethod.

    * + * @return null|LocalizedString */ public function getLocalizedDescription(); @@ -113,6 +124,7 @@ public function getLocalizedDescription(); /** *

    TaxCategory of all ZoneRates of the ShippingMethod.

    * + * @return null|TaxCategoryReference */ public function getTaxCategory(); @@ -120,6 +132,7 @@ public function getTaxCategory(); /** *

    Defines ShippingRates (prices) for specific Zones.

    * + * @return null|ZoneRateCollection */ public function getZoneRates(); @@ -127,6 +140,7 @@ public function getZoneRates(); /** *

    If true this ShippingMethod is the Project's default ShippingMethod.

    * + * @return null|bool */ public function getIsDefault(); @@ -134,6 +148,7 @@ public function getIsDefault(); /** *

    Valid Cart predicate to select a ShippingMethod for a Cart.

    * + * @return null|string */ public function getPredicate(); @@ -141,6 +156,7 @@ public function getPredicate(); /** *

    Custom Fields of the ShippingMethod.

    * + * @return null|CustomFields */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddShippingRateAction.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddShippingRateAction.php index 558a9f890ff..dc6fab8116b 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddShippingRateAction.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddShippingRateAction.php @@ -20,6 +20,7 @@ interface ShippingMethodAddShippingRateAction extends ShippingMethodUpdateAction /** *

    Zone to which the ShippingRate should be added.

    * + * @return null|ZoneResourceIdentifier */ public function getZone(); @@ -27,6 +28,7 @@ public function getZone(); /** *

    Value to add to shippingRates.

    * + * @return null|ShippingRateDraft */ public function getShippingRate(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddShippingRateActionBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddShippingRateActionBuilder.php index c5c71bc077f..665b6e8b9fb 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddShippingRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddShippingRateActionBuilder.php @@ -23,11 +23,13 @@ final class ShippingMethodAddShippingRateActionBuilder implements Builder { /** + * @var null|ZoneResourceIdentifier|ZoneResourceIdentifierBuilder */ private $zone; /** + * @var null|ShippingRateDraft|ShippingRateDraftBuilder */ private $shippingRate; @@ -35,6 +37,7 @@ final class ShippingMethodAddShippingRateActionBuilder implements Builder /** *

    Zone to which the ShippingRate should be added.

    * + * @return null|ZoneResourceIdentifier */ public function getZone() @@ -45,6 +48,7 @@ public function getZone() /** *

    Value to add to shippingRates.

    * + * @return null|ShippingRateDraft */ public function getShippingRate() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddShippingRateActionModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddShippingRateActionModel.php index 749a95e2d10..39e8773e81c 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddShippingRateActionModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddShippingRateActionModel.php @@ -23,16 +23,19 @@ final class ShippingMethodAddShippingRateActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'addShippingRate'; /** + * * @var ?string */ protected $action; /** + * * @var ?ZoneResourceIdentifier */ protected $zone; /** + * * @var ?ShippingRateDraft */ protected $shippingRate; @@ -43,14 +46,16 @@ final class ShippingMethodAddShippingRateActionModel extends JsonObjectModel imp */ public function __construct( ?ZoneResourceIdentifier $zone = null, - ?ShippingRateDraft $shippingRate = null + ?ShippingRateDraft $shippingRate = null, + ?string $action = null ) { $this->zone = $zone; $this->shippingRate = $shippingRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() /** *

    Zone to which the ShippingRate should be added.

    * + * * @return null|ZoneResourceIdentifier */ public function getZone() @@ -90,6 +96,7 @@ public function getZone() /** *

    Value to add to shippingRates.

    * + * * @return null|ShippingRateDraft */ public function getShippingRate() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddZoneAction.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddZoneAction.php index 0f605f28244..71477215aba 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddZoneAction.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddZoneAction.php @@ -19,6 +19,7 @@ interface ShippingMethodAddZoneAction extends ShippingMethodUpdateAction /** *

    Value to add to zoneRates.

    * + * @return null|ZoneResourceIdentifier */ public function getZone(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddZoneActionBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddZoneActionBuilder.php index aee04d9b4d4..f0671245bcb 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddZoneActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddZoneActionBuilder.php @@ -23,6 +23,7 @@ final class ShippingMethodAddZoneActionBuilder implements Builder { /** + * @var null|ZoneResourceIdentifier|ZoneResourceIdentifierBuilder */ private $zone; @@ -30,6 +31,7 @@ final class ShippingMethodAddZoneActionBuilder implements Builder /** *

    Value to add to zoneRates.

    * + * @return null|ZoneResourceIdentifier */ public function getZone() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddZoneActionModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddZoneActionModel.php index e045046417b..cc214fc9643 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddZoneActionModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddZoneActionModel.php @@ -23,11 +23,13 @@ final class ShippingMethodAddZoneActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'addZone'; /** + * * @var ?string */ protected $action; /** + * * @var ?ZoneResourceIdentifier */ protected $zone; @@ -37,13 +39,15 @@ final class ShippingMethodAddZoneActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?ZoneResourceIdentifier $zone = null + ?ZoneResourceIdentifier $zone = null, + ?string $action = null ) { $this->zone = $zone; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Value to add to zoneRates.

    * + * * @return null|ZoneResourceIdentifier */ public function getZone() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodBuilder.php index 4e5f8acf380..531309e387b 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodBuilder.php @@ -34,81 +34,97 @@ final class ShippingMethodBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $key; /** + * @var ?string */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $localizedName; /** + * @deprecated * @var ?string */ private $description; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $localizedDescription; /** + * @var null|TaxCategoryReference|TaxCategoryReferenceBuilder */ private $taxCategory; /** + * @var ?ZoneRateCollection */ private $zoneRates; /** + * @var ?bool */ private $isDefault; /** + * @var ?string */ private $predicate; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; @@ -116,6 +132,7 @@ final class ShippingMethodBuilder implements Builder /** *

    Unique identifier of the ShippingMethod.

    * + * @return null|string */ public function getId() @@ -126,6 +143,7 @@ public function getId() /** *

    Current version of the ShippingMethod.

    * + * @return null|int */ public function getVersion() @@ -136,6 +154,7 @@ public function getVersion() /** *

    Date and time (UTC) the ShippingMethod was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -146,6 +165,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the ShippingMethod was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -156,6 +176,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -166,6 +187,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -176,6 +198,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the ShippingMethod.

    * + * @return null|string */ public function getKey() @@ -186,6 +209,7 @@ public function getKey() /** *

    Name of the ShippingMethod.

    * + * @return null|string */ public function getName() @@ -196,6 +220,7 @@ public function getName() /** *

    Localized name of the ShippingMethod.

    * + * @return null|LocalizedString */ public function getLocalizedName() @@ -206,6 +231,7 @@ public function getLocalizedName() /** *

    Description of the ShippingMethod.

    * + * @deprecated * @return null|string */ public function getDescription() @@ -216,6 +242,7 @@ public function getDescription() /** *

    Localized description of the ShippingMethod.

    * + * @return null|LocalizedString */ public function getLocalizedDescription() @@ -226,6 +253,7 @@ public function getLocalizedDescription() /** *

    TaxCategory of all ZoneRates of the ShippingMethod.

    * + * @return null|TaxCategoryReference */ public function getTaxCategory() @@ -236,6 +264,7 @@ public function getTaxCategory() /** *

    Defines ShippingRates (prices) for specific Zones.

    * + * @return null|ZoneRateCollection */ public function getZoneRates() @@ -246,6 +275,7 @@ public function getZoneRates() /** *

    If true this ShippingMethod is the Project's default ShippingMethod.

    * + * @return null|bool */ public function getIsDefault() @@ -256,6 +286,7 @@ public function getIsDefault() /** *

    Valid Cart predicate to select a ShippingMethod for a Cart.

    * + * @return null|string */ public function getPredicate() @@ -266,6 +297,7 @@ public function getPredicate() /** *

    Custom Fields of the ShippingMethod.

    * + * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeIsDefaultAction.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeIsDefaultAction.php index fcad9ff237a..62e90ccdef6 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeIsDefaultAction.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeIsDefaultAction.php @@ -18,6 +18,7 @@ interface ShippingMethodChangeIsDefaultAction extends ShippingMethodUpdateAction /** *

    Value to set. Only one ShippingMethod can be default in a Project.

    * + * @return null|bool */ public function getIsDefault(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeIsDefaultActionBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeIsDefaultActionBuilder.php index d01a80bf2d5..ff90dfa7ae0 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeIsDefaultActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeIsDefaultActionBuilder.php @@ -21,6 +21,7 @@ final class ShippingMethodChangeIsDefaultActionBuilder implements Builder { /** + * @var ?bool */ private $isDefault; @@ -28,6 +29,7 @@ final class ShippingMethodChangeIsDefaultActionBuilder implements Builder /** *

    Value to set. Only one ShippingMethod can be default in a Project.

    * + * @return null|bool */ public function getIsDefault() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeIsDefaultActionModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeIsDefaultActionModel.php index 48164b93d34..38d9618f7c8 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeIsDefaultActionModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeIsDefaultActionModel.php @@ -21,11 +21,13 @@ final class ShippingMethodChangeIsDefaultActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'changeIsDefault'; /** + * * @var ?string */ protected $action; /** + * * @var ?bool */ protected $isDefault; @@ -35,13 +37,15 @@ final class ShippingMethodChangeIsDefaultActionModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?bool $isDefault = null + ?bool $isDefault = null, + ?string $action = null ) { $this->isDefault = $isDefault; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to set. Only one ShippingMethod can be default in a Project.

    * + * * @return null|bool */ public function getIsDefault() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeNameAction.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeNameAction.php index 98e5f193efb..e0ce2405965 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeNameAction.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeNameAction.php @@ -18,6 +18,7 @@ interface ShippingMethodChangeNameAction extends ShippingMethodUpdateAction /** *

    Value to set. Must not be empty.

    * + * @return null|string */ public function getName(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeNameActionBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeNameActionBuilder.php index 23109c3f47e..e46f17c2155 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeNameActionBuilder.php @@ -21,6 +21,7 @@ final class ShippingMethodChangeNameActionBuilder implements Builder { /** + * @var ?string */ private $name; @@ -28,6 +29,7 @@ final class ShippingMethodChangeNameActionBuilder implements Builder /** *

    Value to set. Must not be empty.

    * + * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeNameActionModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeNameActionModel.php index bd15219541f..259940b2be3 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeNameActionModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeNameActionModel.php @@ -21,11 +21,13 @@ final class ShippingMethodChangeNameActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'changeName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; @@ -35,13 +37,15 @@ final class ShippingMethodChangeNameActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?string $name = null + ?string $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to set. Must not be empty.

    * + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeTaxCategoryAction.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeTaxCategoryAction.php index 2bd28777d71..95367c8f278 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeTaxCategoryAction.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeTaxCategoryAction.php @@ -19,6 +19,7 @@ interface ShippingMethodChangeTaxCategoryAction extends ShippingMethodUpdateActi /** *

    Value to set.

    * + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeTaxCategoryActionBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeTaxCategoryActionBuilder.php index 7c89f25c6b1..9d6cd0ca5f6 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeTaxCategoryActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeTaxCategoryActionBuilder.php @@ -23,6 +23,7 @@ final class ShippingMethodChangeTaxCategoryActionBuilder implements Builder { /** + * @var null|TaxCategoryResourceIdentifier|TaxCategoryResourceIdentifierBuilder */ private $taxCategory; @@ -30,6 +31,7 @@ final class ShippingMethodChangeTaxCategoryActionBuilder implements Builder /** *

    Value to set.

    * + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeTaxCategoryActionModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeTaxCategoryActionModel.php index 0d49d2927aa..e8521deb6d5 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeTaxCategoryActionModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodChangeTaxCategoryActionModel.php @@ -23,11 +23,13 @@ final class ShippingMethodChangeTaxCategoryActionModel extends JsonObjectModel i { public const DISCRIMINATOR_VALUE = 'changeTaxCategory'; /** + * * @var ?string */ protected $action; /** + * * @var ?TaxCategoryResourceIdentifier */ protected $taxCategory; @@ -37,13 +39,15 @@ final class ShippingMethodChangeTaxCategoryActionModel extends JsonObjectModel i * @psalm-suppress MissingParamType */ public function __construct( - ?TaxCategoryResourceIdentifier $taxCategory = null + ?TaxCategoryResourceIdentifier $taxCategory = null, + ?string $action = null ) { $this->taxCategory = $taxCategory; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Value to set.

    * + * * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodDraft.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodDraft.php index 252be9f7932..d5a18051207 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodDraft.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodDraft.php @@ -30,6 +30,7 @@ interface ShippingMethodDraft extends JsonObject /** *

    User-defined unique identifier for the ShippingMethod.

    * + * @return null|string */ public function getKey(); @@ -37,6 +38,7 @@ public function getKey(); /** *

    Name of the ShippingMethod.

    * + * @return null|string */ public function getName(); @@ -44,6 +46,7 @@ public function getName(); /** *

    Localized name of the ShippingMethod.

    * + * @return null|LocalizedString */ public function getLocalizedName(); @@ -51,6 +54,7 @@ public function getLocalizedName(); /** *

    Description of the ShippingMethod.

    * + * @deprecated * @return null|string */ public function getDescription(); @@ -58,6 +62,7 @@ public function getDescription(); /** *

    Localized description of the ShippingMethod.

    * + * @return null|LocalizedString */ public function getLocalizedDescription(); @@ -65,6 +70,7 @@ public function getLocalizedDescription(); /** *

    TaxCategory for all ZoneRates of the ShippingMethod.

    * + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory(); @@ -72,6 +78,7 @@ public function getTaxCategory(); /** *

    Defines ShippingRates (prices) for specific zones.

    * + * @return null|ZoneRateDraftCollection */ public function getZoneRates(); @@ -79,6 +86,7 @@ public function getZoneRates(); /** *

    If true the ShippingMethod will be the Project's default ShippingMethod.

    * + * @return null|bool */ public function getIsDefault(); @@ -86,6 +94,7 @@ public function getIsDefault(); /** *

    Valid Cart predicate to select a ShippingMethod for a Cart.

    * + * @return null|string */ public function getPredicate(); @@ -93,6 +102,7 @@ public function getPredicate(); /** *

    Custom Fields for the ShippingMethod.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodDraftBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodDraftBuilder.php index 08eff4b49c4..ae56969e94b 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodDraftBuilder.php @@ -27,51 +27,61 @@ final class ShippingMethodDraftBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $localizedName; /** + * @deprecated * @var ?string */ private $description; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $localizedDescription; /** + * @var null|TaxCategoryResourceIdentifier|TaxCategoryResourceIdentifierBuilder */ private $taxCategory; /** + * @var ?ZoneRateDraftCollection */ private $zoneRates; /** + * @var ?bool */ private $isDefault; /** + * @var ?string */ private $predicate; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; @@ -79,6 +89,7 @@ final class ShippingMethodDraftBuilder implements Builder /** *

    User-defined unique identifier for the ShippingMethod.

    * + * @return null|string */ public function getKey() @@ -89,6 +100,7 @@ public function getKey() /** *

    Name of the ShippingMethod.

    * + * @return null|string */ public function getName() @@ -99,6 +111,7 @@ public function getName() /** *

    Localized name of the ShippingMethod.

    * + * @return null|LocalizedString */ public function getLocalizedName() @@ -109,6 +122,7 @@ public function getLocalizedName() /** *

    Description of the ShippingMethod.

    * + * @deprecated * @return null|string */ public function getDescription() @@ -119,6 +133,7 @@ public function getDescription() /** *

    Localized description of the ShippingMethod.

    * + * @return null|LocalizedString */ public function getLocalizedDescription() @@ -129,6 +144,7 @@ public function getLocalizedDescription() /** *

    TaxCategory for all ZoneRates of the ShippingMethod.

    * + * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -139,6 +155,7 @@ public function getTaxCategory() /** *

    Defines ShippingRates (prices) for specific zones.

    * + * @return null|ZoneRateDraftCollection */ public function getZoneRates() @@ -149,6 +166,7 @@ public function getZoneRates() /** *

    If true the ShippingMethod will be the Project's default ShippingMethod.

    * + * @return null|bool */ public function getIsDefault() @@ -159,6 +177,7 @@ public function getIsDefault() /** *

    Valid Cart predicate to select a ShippingMethod for a Cart.

    * + * @return null|string */ public function getPredicate() @@ -169,6 +188,7 @@ public function getPredicate() /** *

    Custom Fields for the ShippingMethod.

    * + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodDraftModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodDraftModel.php index 75211a4c856..9517eb19473 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodDraftModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodDraftModel.php @@ -26,51 +26,61 @@ final class ShippingMethodDraftModel extends JsonObjectModel implements ShippingMethodDraft { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $name; /** + * * @var ?LocalizedString */ protected $localizedName; /** + * @deprecated * @var ?string */ protected $description; /** + * * @var ?LocalizedString */ protected $localizedDescription; /** + * * @var ?TaxCategoryResourceIdentifier */ protected $taxCategory; /** + * * @var ?ZoneRateDraftCollection */ protected $zoneRates; /** + * * @var ?bool */ protected $isDefault; /** + * * @var ?string */ protected $predicate; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -106,6 +116,7 @@ public function __construct( /** *

    User-defined unique identifier for the ShippingMethod.

    * + * * @return null|string */ public function getKey() @@ -125,6 +136,7 @@ public function getKey() /** *

    Name of the ShippingMethod.

    * + * * @return null|string */ public function getName() @@ -144,6 +156,7 @@ public function getName() /** *

    Localized name of the ShippingMethod.

    * + * * @return null|LocalizedString */ public function getLocalizedName() @@ -164,6 +177,7 @@ public function getLocalizedName() /** *

    Description of the ShippingMethod.

    * + * @deprecated * @return null|string */ public function getDescription() @@ -183,6 +197,7 @@ public function getDescription() /** *

    Localized description of the ShippingMethod.

    * + * * @return null|LocalizedString */ public function getLocalizedDescription() @@ -203,6 +218,7 @@ public function getLocalizedDescription() /** *

    TaxCategory for all ZoneRates of the ShippingMethod.

    * + * * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory() @@ -223,6 +239,7 @@ public function getTaxCategory() /** *

    Defines ShippingRates (prices) for specific zones.

    * + * * @return null|ZoneRateDraftCollection */ public function getZoneRates() @@ -242,6 +259,7 @@ public function getZoneRates() /** *

    If true the ShippingMethod will be the Project's default ShippingMethod.

    * + * * @return null|bool */ public function getIsDefault() @@ -261,6 +279,7 @@ public function getIsDefault() /** *

    Valid Cart predicate to select a ShippingMethod for a Cart.

    * + * * @return null|string */ public function getPredicate() @@ -280,6 +299,7 @@ public function getPredicate() /** *

    Custom Fields for the ShippingMethod.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodModel.php index 4ad696076ec..c408f01bebc 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodModel.php @@ -33,81 +33,97 @@ final class ShippingMethodModel extends JsonObjectModel implements ShippingMethod { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $name; /** + * * @var ?LocalizedString */ protected $localizedName; /** + * @deprecated * @var ?string */ protected $description; /** + * * @var ?LocalizedString */ protected $localizedDescription; /** + * * @var ?TaxCategoryReference */ protected $taxCategory; /** + * * @var ?ZoneRateCollection */ protected $zoneRates; /** + * * @var ?bool */ protected $isDefault; /** + * * @var ?string */ protected $predicate; /** + * * @var ?CustomFields */ protected $custom; @@ -155,6 +171,7 @@ public function __construct( /** *

    Unique identifier of the ShippingMethod.

    * + * * @return null|string */ public function getId() @@ -174,6 +191,7 @@ public function getId() /** *

    Current version of the ShippingMethod.

    * + * * @return null|int */ public function getVersion() @@ -193,6 +211,7 @@ public function getVersion() /** *

    Date and time (UTC) the ShippingMethod was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -216,6 +235,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the ShippingMethod was last updated.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -239,6 +259,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -259,6 +280,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -279,6 +301,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the ShippingMethod.

    * + * * @return null|string */ public function getKey() @@ -298,6 +321,7 @@ public function getKey() /** *

    Name of the ShippingMethod.

    * + * * @return null|string */ public function getName() @@ -317,6 +341,7 @@ public function getName() /** *

    Localized name of the ShippingMethod.

    * + * * @return null|LocalizedString */ public function getLocalizedName() @@ -337,6 +362,7 @@ public function getLocalizedName() /** *

    Description of the ShippingMethod.

    * + * @deprecated * @return null|string */ public function getDescription() @@ -356,6 +382,7 @@ public function getDescription() /** *

    Localized description of the ShippingMethod.

    * + * * @return null|LocalizedString */ public function getLocalizedDescription() @@ -376,6 +403,7 @@ public function getLocalizedDescription() /** *

    TaxCategory of all ZoneRates of the ShippingMethod.

    * + * * @return null|TaxCategoryReference */ public function getTaxCategory() @@ -396,6 +424,7 @@ public function getTaxCategory() /** *

    Defines ShippingRates (prices) for specific Zones.

    * + * * @return null|ZoneRateCollection */ public function getZoneRates() @@ -415,6 +444,7 @@ public function getZoneRates() /** *

    If true this ShippingMethod is the Project's default ShippingMethod.

    * + * * @return null|bool */ public function getIsDefault() @@ -434,6 +464,7 @@ public function getIsDefault() /** *

    Valid Cart predicate to select a ShippingMethod for a Cart.

    * + * * @return null|string */ public function getPredicate() @@ -453,6 +484,7 @@ public function getPredicate() /** *

    Custom Fields of the ShippingMethod.

    * + * * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodPagedQueryResponse.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodPagedQueryResponse.php index 7fbe40aae7e..8f6ee9a06f7 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodPagedQueryResponse.php @@ -22,6 +22,7 @@ interface ShippingMethodPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -40,6 +42,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -47,6 +50,7 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -54,6 +58,7 @@ public function getOffset(); /** *

    Shipping Methods matching the query.

    * + * @return null|ShippingMethodCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodPagedQueryResponseBuilder.php index 2b6c20ca1d3..4d828a772d2 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class ShippingMethodPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?ShippingMethodCollection */ private $results; @@ -48,6 +53,7 @@ final class ShippingMethodPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -72,6 +79,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -82,6 +90,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -92,6 +101,7 @@ public function getOffset() /** *

    Shipping Methods matching the query.

    * + * @return null|ShippingMethodCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodPagedQueryResponseModel.php index 7156e5111e1..99e4f77510c 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class ShippingMethodPagedQueryResponseModel extends JsonObjectModel implements ShippingMethodPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?ShippingMethodCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -107,6 +114,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -126,6 +134,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -145,6 +154,7 @@ public function getOffset() /** *

    Shipping Methods matching the query.

    * + * * @return null|ShippingMethodCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodReference.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodReference.php index 6b5a732446f..40ce59ff37e 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodReference.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodReference.php @@ -19,6 +19,7 @@ interface ShippingMethodReference extends Reference /** *

    Contains the representation of the expanded ShippingMethod. Only present in responses to requests with Reference Expansion for ShippingMethods.

    * + * @return null|ShippingMethod */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

    Unique identifier of the referenced ShippingMethod.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodReferenceBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodReferenceBuilder.php index acfa03cda53..6a33ebe5967 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodReferenceBuilder.php @@ -23,11 +23,13 @@ final class ShippingMethodReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|ShippingMethod|ShippingMethodBuilder */ private $obj; @@ -35,6 +37,7 @@ final class ShippingMethodReferenceBuilder implements Builder /** *

    Unique identifier of the referenced ShippingMethod.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded ShippingMethod. Only present in responses to requests with Reference Expansion for ShippingMethods.

    * + * @return null|ShippingMethod */ public function getObj() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodReferenceModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodReferenceModel.php index 9b939b61ec9..bc83a686199 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodReferenceModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodReferenceModel.php @@ -23,16 +23,19 @@ final class ShippingMethodReferenceModel extends JsonObjectModel implements Ship { public const DISCRIMINATOR_VALUE = 'shipping-method'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?ShippingMethod */ protected $obj; @@ -43,16 +46,18 @@ final class ShippingMethodReferenceModel extends JsonObjectModel implements Ship */ public function __construct( ?string $id = null, - ?ShippingMethod $obj = null + ?ShippingMethod $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced ShippingMethod.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded ShippingMethod. Only present in responses to requests with Reference Expansion for ShippingMethods.

    * + * * @return null|ShippingMethod */ public function getObj() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveShippingRateAction.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveShippingRateAction.php index c2decdbbff6..dba401c357e 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveShippingRateAction.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveShippingRateAction.php @@ -20,6 +20,7 @@ interface ShippingMethodRemoveShippingRateAction extends ShippingMethodUpdateAct /** *

    Zone from which the ShippingRate should be removed.

    * + * @return null|ZoneResourceIdentifier */ public function getZone(); @@ -27,6 +28,7 @@ public function getZone(); /** *

    Value to remove from shippingRates.

    * + * @return null|ShippingRateDraft */ public function getShippingRate(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveShippingRateActionBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveShippingRateActionBuilder.php index dd27c97f9cd..547dc184367 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveShippingRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveShippingRateActionBuilder.php @@ -23,11 +23,13 @@ final class ShippingMethodRemoveShippingRateActionBuilder implements Builder { /** + * @var null|ZoneResourceIdentifier|ZoneResourceIdentifierBuilder */ private $zone; /** + * @var null|ShippingRateDraft|ShippingRateDraftBuilder */ private $shippingRate; @@ -35,6 +37,7 @@ final class ShippingMethodRemoveShippingRateActionBuilder implements Builder /** *

    Zone from which the ShippingRate should be removed.

    * + * @return null|ZoneResourceIdentifier */ public function getZone() @@ -45,6 +48,7 @@ public function getZone() /** *

    Value to remove from shippingRates.

    * + * @return null|ShippingRateDraft */ public function getShippingRate() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveShippingRateActionModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveShippingRateActionModel.php index 2057244c86c..875b4cca513 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveShippingRateActionModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveShippingRateActionModel.php @@ -23,16 +23,19 @@ final class ShippingMethodRemoveShippingRateActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'removeShippingRate'; /** + * * @var ?string */ protected $action; /** + * * @var ?ZoneResourceIdentifier */ protected $zone; /** + * * @var ?ShippingRateDraft */ protected $shippingRate; @@ -43,14 +46,16 @@ final class ShippingMethodRemoveShippingRateActionModel extends JsonObjectModel */ public function __construct( ?ZoneResourceIdentifier $zone = null, - ?ShippingRateDraft $shippingRate = null + ?ShippingRateDraft $shippingRate = null, + ?string $action = null ) { $this->zone = $zone; $this->shippingRate = $shippingRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() /** *

    Zone from which the ShippingRate should be removed.

    * + * * @return null|ZoneResourceIdentifier */ public function getZone() @@ -90,6 +96,7 @@ public function getZone() /** *

    Value to remove from shippingRates.

    * + * * @return null|ShippingRateDraft */ public function getShippingRate() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveZoneAction.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveZoneAction.php index 0b7a1c47df3..1a4b9129c10 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveZoneAction.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveZoneAction.php @@ -19,6 +19,7 @@ interface ShippingMethodRemoveZoneAction extends ShippingMethodUpdateAction /** *

    Value to remove from zoneRates.

    * + * @return null|ZoneResourceIdentifier */ public function getZone(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveZoneActionBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveZoneActionBuilder.php index d441d31fb4b..2b051be3a52 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveZoneActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveZoneActionBuilder.php @@ -23,6 +23,7 @@ final class ShippingMethodRemoveZoneActionBuilder implements Builder { /** + * @var null|ZoneResourceIdentifier|ZoneResourceIdentifierBuilder */ private $zone; @@ -30,6 +31,7 @@ final class ShippingMethodRemoveZoneActionBuilder implements Builder /** *

    Value to remove from zoneRates.

    * + * @return null|ZoneResourceIdentifier */ public function getZone() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveZoneActionModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveZoneActionModel.php index 68ab5d577f1..75d2afafbb8 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveZoneActionModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodRemoveZoneActionModel.php @@ -23,11 +23,13 @@ final class ShippingMethodRemoveZoneActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'removeZone'; /** + * * @var ?string */ protected $action; /** + * * @var ?ZoneResourceIdentifier */ protected $zone; @@ -37,13 +39,15 @@ final class ShippingMethodRemoveZoneActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?ZoneResourceIdentifier $zone = null + ?ZoneResourceIdentifier $zone = null, + ?string $action = null ) { $this->zone = $zone; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Value to remove from zoneRates.

    * + * * @return null|ZoneResourceIdentifier */ public function getZone() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodResourceIdentifier.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodResourceIdentifier.php index 42ae1c66598..731ca59d407 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodResourceIdentifier.php @@ -17,6 +17,7 @@ interface ShippingMethodResourceIdentifier extends ResourceIdentifier /** *

    Unique identifier of the referenced ShippingMethod. Either id or key is required.

    * + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

    User-defined unique identifier of the referenced ShippingMethod. Either id or key is required.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodResourceIdentifierBuilder.php index 8f77271f3f2..2b529a97c04 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class ShippingMethodResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class ShippingMethodResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced ShippingMethod. Either id or key is required.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced ShippingMethod. Either id or key is required.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodResourceIdentifierModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodResourceIdentifierModel.php index b531387b39a..d05b9dc5137 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class ShippingMethodResourceIdentifierModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'shipping-method'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class ShippingMethodResourceIdentifierModel extends JsonObjectModel implem */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced ShippingMethod. Either id or key is required.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced ShippingMethod. Either id or key is required.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomFieldAction.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomFieldAction.php index 0efbec05dfc..a76271bf462 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface ShippingMethodSetCustomFieldAction extends ShippingMethodUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomFieldActionBuilder.php index 29e09066bb0..d92b60dd16f 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class ShippingMethodSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class ShippingMethodSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomFieldActionModel.php index ec44d295201..4cfb66c38dc 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class ShippingMethodSetCustomFieldActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class ShippingMethodSetCustomFieldActionModel extends JsonObjectModel impl */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomTypeAction.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomTypeAction.php index 60ffe35e2f6..e9551cad466 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface ShippingMethodSetCustomTypeAction extends ShippingMethodUpdateAction *

    Defines the Type that extends the ShippingMethod with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ShippingMethod.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the ShippingMethod.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomTypeActionBuilder.php index a6c05a4b225..40fa8a0b4fa 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class ShippingMethodSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class ShippingMethodSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the ShippingMethod with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ShippingMethod.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the ShippingMethod.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomTypeActionModel.php index 03376000277..3beabc3258b 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class ShippingMethodSetCustomTypeActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class ShippingMethodSetCustomTypeActionModel extends JsonObjectModel imple */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the ShippingMethod with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ShippingMethod.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the ShippingMethod.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetDescriptionAction.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetDescriptionAction.php index d4a05c09291..c839a95a67b 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetDescriptionAction.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetDescriptionAction.php @@ -18,6 +18,7 @@ interface ShippingMethodSetDescriptionAction extends ShippingMethodUpdateAction /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getDescription(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetDescriptionActionBuilder.php index ecf7ac5b692..48a87d47455 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetDescriptionActionBuilder.php @@ -21,6 +21,7 @@ final class ShippingMethodSetDescriptionActionBuilder implements Builder { /** + * @var ?string */ private $description; @@ -28,6 +29,7 @@ final class ShippingMethodSetDescriptionActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetDescriptionActionModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetDescriptionActionModel.php index 39c628e4b11..0d88c00c2f3 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetDescriptionActionModel.php @@ -21,11 +21,13 @@ final class ShippingMethodSetDescriptionActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $description; @@ -35,13 +37,15 @@ final class ShippingMethodSetDescriptionActionModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?string $description = null + ?string $description = null, + ?string $action = null ) { $this->description = $description; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|string */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetKeyAction.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetKeyAction.php index f90a0816a22..80118298440 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetKeyAction.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetKeyAction.php @@ -18,6 +18,7 @@ interface ShippingMethodSetKeyAction extends ShippingMethodUpdateAction /** *

    If key is absent or null, the existing key, if any, will be removed.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetKeyActionBuilder.php index e301adf8d49..ab3cdde350d 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetKeyActionBuilder.php @@ -21,6 +21,7 @@ final class ShippingMethodSetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; @@ -28,6 +29,7 @@ final class ShippingMethodSetKeyActionBuilder implements Builder /** *

    If key is absent or null, the existing key, if any, will be removed.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetKeyActionModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetKeyActionModel.php index c0d27f4dd99..6bb40b0da0e 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetKeyActionModel.php @@ -21,11 +21,13 @@ final class ShippingMethodSetKeyActionModel extends JsonObjectModel implements S { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class ShippingMethodSetKeyActionModel extends JsonObjectModel implements S * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    If key is absent or null, the existing key, if any, will be removed.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedDescriptionAction.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedDescriptionAction.php index 0f4de8b2566..488ae91bf33 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedDescriptionAction.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedDescriptionAction.php @@ -19,6 +19,7 @@ interface ShippingMethodSetLocalizedDescriptionAction extends ShippingMethodUpda /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getLocalizedDescription(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedDescriptionActionBuilder.php index 80d6c1f3b40..49d81ae34c9 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedDescriptionActionBuilder.php @@ -23,6 +23,7 @@ final class ShippingMethodSetLocalizedDescriptionActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $localizedDescription; @@ -30,6 +31,7 @@ final class ShippingMethodSetLocalizedDescriptionActionBuilder implements Builde /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getLocalizedDescription() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedDescriptionActionModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedDescriptionActionModel.php index 0c7d435c319..390a239ad20 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedDescriptionActionModel.php @@ -23,11 +23,13 @@ final class ShippingMethodSetLocalizedDescriptionActionModel extends JsonObjectM { public const DISCRIMINATOR_VALUE = 'setLocalizedDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $localizedDescription; @@ -37,13 +39,15 @@ final class ShippingMethodSetLocalizedDescriptionActionModel extends JsonObjectM * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $localizedDescription = null + ?LocalizedString $localizedDescription = null, + ?string $action = null ) { $this->localizedDescription = $localizedDescription; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|LocalizedString */ public function getLocalizedDescription() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedNameAction.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedNameAction.php index 4bdef4e9b3e..606df12b0b2 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedNameAction.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedNameAction.php @@ -19,6 +19,7 @@ interface ShippingMethodSetLocalizedNameAction extends ShippingMethodUpdateActio /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getLocalizedName(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedNameActionBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedNameActionBuilder.php index 3aed788be47..6ac87d7ee69 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedNameActionBuilder.php @@ -23,6 +23,7 @@ final class ShippingMethodSetLocalizedNameActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $localizedName; @@ -30,6 +31,7 @@ final class ShippingMethodSetLocalizedNameActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getLocalizedName() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedNameActionModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedNameActionModel.php index c4b8d283ebc..c48c0268439 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedNameActionModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetLocalizedNameActionModel.php @@ -23,11 +23,13 @@ final class ShippingMethodSetLocalizedNameActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'setLocalizedName'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $localizedName; @@ -37,13 +39,15 @@ final class ShippingMethodSetLocalizedNameActionModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $localizedName = null + ?LocalizedString $localizedName = null, + ?string $action = null ) { $this->localizedName = $localizedName; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|LocalizedString */ public function getLocalizedName() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetPredicateAction.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetPredicateAction.php index e6039aab3d6..6a3e9eda2ea 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetPredicateAction.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetPredicateAction.php @@ -18,6 +18,7 @@ interface ShippingMethodSetPredicateAction extends ShippingMethodUpdateAction /** *

    A valid Cart predicate. If predicate is absent or null, it is removed if it exists.

    * + * @return null|string */ public function getPredicate(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetPredicateActionBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetPredicateActionBuilder.php index 85ba2562607..d354bd2317b 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetPredicateActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetPredicateActionBuilder.php @@ -21,6 +21,7 @@ final class ShippingMethodSetPredicateActionBuilder implements Builder { /** + * @var ?string */ private $predicate; @@ -28,6 +29,7 @@ final class ShippingMethodSetPredicateActionBuilder implements Builder /** *

    A valid Cart predicate. If predicate is absent or null, it is removed if it exists.

    * + * @return null|string */ public function getPredicate() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetPredicateActionModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetPredicateActionModel.php index 6f34f06d759..2d05707d93b 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetPredicateActionModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodSetPredicateActionModel.php @@ -21,11 +21,13 @@ final class ShippingMethodSetPredicateActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setPredicate'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $predicate; @@ -35,13 +37,15 @@ final class ShippingMethodSetPredicateActionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?string $predicate = null + ?string $predicate = null, + ?string $action = null ) { $this->predicate = $predicate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    A valid Cart predicate. If predicate is absent or null, it is removed if it exists.

    * + * * @return null|string */ public function getPredicate() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdate.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdate.php index 5bdcc6caa86..bdf2af739b9 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdate.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdate.php @@ -19,6 +19,7 @@ interface ShippingMethodUpdate extends JsonObject /** *

    Expected version of the ShippingMethod on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion(); @@ -26,6 +27,7 @@ public function getVersion(); /** *

    Update actions to be performed on the ShippingMethod.

    * + * @return null|ShippingMethodUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdateAction.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdateAction.php index 946979bda99..a41a1bc4f2f 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdateAction.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdateAction.php @@ -17,6 +17,7 @@ interface ShippingMethodUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdateActionModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdateActionModel.php index 4efd8cb4228..482ae863df8 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdateActionModel.php @@ -21,6 +21,7 @@ final class ShippingMethodUpdateActionModel extends JsonObjectModel implements S { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -50,11 +51,13 @@ final class ShippingMethodUpdateActionModel extends JsonObjectModel implements S * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdateBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdateBuilder.php index 181ce80b96a..9b589e7b9ef 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdateBuilder.php @@ -21,11 +21,13 @@ final class ShippingMethodUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?ShippingMethodUpdateActionCollection */ private $actions; @@ -33,6 +35,7 @@ final class ShippingMethodUpdateBuilder implements Builder /** *

    Expected version of the ShippingMethod on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion() @@ -43,6 +46,7 @@ public function getVersion() /** *

    Update actions to be performed on the ShippingMethod.

    * + * @return null|ShippingMethodUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdateModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdateModel.php index b792ab99ade..8055808e6c3 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdateModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodUpdateModel.php @@ -20,11 +20,13 @@ final class ShippingMethodUpdateModel extends JsonObjectModel implements ShippingMethodUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?ShippingMethodUpdateActionCollection */ protected $actions; @@ -44,6 +46,7 @@ public function __construct( /** *

    Expected version of the ShippingMethod on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * * @return null|int */ public function getVersion() @@ -63,6 +66,7 @@ public function getVersion() /** *

    Update actions to be performed on the ShippingMethod.

    * + * * @return null|ShippingMethodUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingRate.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingRate.php index 3782683dd72..78aa0d67d7f 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingRate.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingRate.php @@ -22,6 +22,7 @@ interface ShippingRate extends JsonObject /** *

    Currency amount of the ShippingRate.

    * + * @return null|TypedMoney */ public function getPrice(); @@ -29,6 +30,7 @@ public function getPrice(); /** *

    Shipping is free if the sum of the (Custom) Line Item Prices reaches the specified value.

    * + * @return null|TypedMoney */ public function getFreeAbove(); @@ -38,6 +40,7 @@ public function getFreeAbove(); * Only appears in response to requests for Get ShippingMethods for a Cart or * Get ShippingMethods for a Location.

    * + * @return null|bool */ public function getIsMatching(); @@ -45,6 +48,7 @@ public function getIsMatching(); /** *

    Price tiers for the ShippingRate.

    * + * @return null|ShippingRatePriceTierCollection */ public function getTiers(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateBuilder.php index df06c71845f..89fae6d1726 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateBuilder.php @@ -23,21 +23,25 @@ final class ShippingRateBuilder implements Builder { /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $price; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $freeAbove; /** + * @var ?bool */ private $isMatching; /** + * @var ?ShippingRatePriceTierCollection */ private $tiers; @@ -45,6 +49,7 @@ final class ShippingRateBuilder implements Builder /** *

    Currency amount of the ShippingRate.

    * + * @return null|TypedMoney */ public function getPrice() @@ -55,6 +60,7 @@ public function getPrice() /** *

    Shipping is free if the sum of the (Custom) Line Item Prices reaches the specified value.

    * + * @return null|TypedMoney */ public function getFreeAbove() @@ -67,6 +73,7 @@ public function getFreeAbove() * Only appears in response to requests for Get ShippingMethods for a Cart or * Get ShippingMethods for a Location.

    * + * @return null|bool */ public function getIsMatching() @@ -77,6 +84,7 @@ public function getIsMatching() /** *

    Price tiers for the ShippingRate.

    * + * @return null|ShippingRatePriceTierCollection */ public function getTiers() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateDraft.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateDraft.php index 048e9604604..a3211aa75b6 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateDraft.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateDraft.php @@ -21,6 +21,7 @@ interface ShippingRateDraft extends JsonObject /** *

    Money value of the ShippingRate.

    * + * @return null|Money */ public function getPrice(); @@ -28,6 +29,7 @@ public function getPrice(); /** *

    Shipping is free if the sum of the (Custom) Line Item Prices reaches the specified value.

    * + * @return null|Money */ public function getFreeAbove(); @@ -35,6 +37,7 @@ public function getFreeAbove(); /** *

    Price tiers for the ShippingRate.

    * + * @return null|ShippingRatePriceTierCollection */ public function getTiers(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateDraftBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateDraftBuilder.php index 0c4252a2dd2..f02b6b5b1cc 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateDraftBuilder.php @@ -23,16 +23,19 @@ final class ShippingRateDraftBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $price; /** + * @var null|Money|MoneyBuilder */ private $freeAbove; /** + * @var ?ShippingRatePriceTierCollection */ private $tiers; @@ -40,6 +43,7 @@ final class ShippingRateDraftBuilder implements Builder /** *

    Money value of the ShippingRate.

    * + * @return null|Money */ public function getPrice() @@ -50,6 +54,7 @@ public function getPrice() /** *

    Shipping is free if the sum of the (Custom) Line Item Prices reaches the specified value.

    * + * @return null|Money */ public function getFreeAbove() @@ -60,6 +65,7 @@ public function getFreeAbove() /** *

    Price tiers for the ShippingRate.

    * + * @return null|ShippingRatePriceTierCollection */ public function getTiers() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateDraftModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateDraftModel.php index 656b4c9e077..66a685ac594 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateDraftModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateDraftModel.php @@ -22,16 +22,19 @@ final class ShippingRateDraftModel extends JsonObjectModel implements ShippingRateDraft { /** + * * @var ?Money */ protected $price; /** + * * @var ?Money */ protected $freeAbove; /** + * * @var ?ShippingRatePriceTierCollection */ protected $tiers; @@ -53,6 +56,7 @@ public function __construct( /** *

    Money value of the ShippingRate.

    * + * * @return null|Money */ public function getPrice() @@ -73,6 +77,7 @@ public function getPrice() /** *

    Shipping is free if the sum of the (Custom) Line Item Prices reaches the specified value.

    * + * * @return null|Money */ public function getFreeAbove() @@ -93,6 +98,7 @@ public function getFreeAbove() /** *

    Price tiers for the ShippingRate.

    * + * * @return null|ShippingRatePriceTierCollection */ public function getTiers() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateModel.php index 288447d4228..29ac0043b69 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingRateModel.php @@ -22,21 +22,25 @@ final class ShippingRateModel extends JsonObjectModel implements ShippingRate { /** + * * @var ?TypedMoney */ protected $price; /** + * * @var ?TypedMoney */ protected $freeAbove; /** + * * @var ?bool */ protected $isMatching; /** + * * @var ?ShippingRatePriceTierCollection */ protected $tiers; @@ -60,6 +64,7 @@ public function __construct( /** *

    Currency amount of the ShippingRate.

    * + * * @return null|TypedMoney */ public function getPrice() @@ -80,6 +85,7 @@ public function getPrice() /** *

    Shipping is free if the sum of the (Custom) Line Item Prices reaches the specified value.

    * + * * @return null|TypedMoney */ public function getFreeAbove() @@ -102,6 +108,7 @@ public function getFreeAbove() * Only appears in response to requests for Get ShippingMethods for a Cart or * Get ShippingMethods for a Location.

    * + * * @return null|bool */ public function getIsMatching() @@ -121,6 +128,7 @@ public function getIsMatching() /** *

    Price tiers for the ShippingRate.

    * + * * @return null|ShippingRatePriceTierCollection */ public function getTiers() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingRatePriceTier.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingRatePriceTier.php index b867837a6f2..2cd8622518d 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingRatePriceTier.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingRatePriceTier.php @@ -17,6 +17,7 @@ interface ShippingRatePriceTier extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ShippingRatePriceTierModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ShippingRatePriceTierModel.php index 1ddc429f9be..de0ecaa6675 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ShippingRatePriceTierModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ShippingRatePriceTierModel.php @@ -21,6 +21,7 @@ final class ShippingRatePriceTierModel extends JsonObjectModel implements Shippi { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -39,11 +40,13 @@ final class ShippingRatePriceTierModel extends JsonObjectModel implements Shippi * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ZoneRate.php b/lib/commercetools-api/src/Models/ShippingMethod/ZoneRate.php index 85944e29cc5..c8c954b6f74 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ZoneRate.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ZoneRate.php @@ -20,6 +20,7 @@ interface ZoneRate extends JsonObject /** *

    Zone for which the shipping rates are valid.

    * + * @return null|ZoneReference */ public function getZone(); @@ -27,6 +28,7 @@ public function getZone(); /** *

    Shipping rates defined per currency.

    * + * @return null|ShippingRateCollection */ public function getShippingRates(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateBuilder.php index 3da87714b32..1d8670a5e8a 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateBuilder.php @@ -23,11 +23,13 @@ final class ZoneRateBuilder implements Builder { /** + * @var null|ZoneReference|ZoneReferenceBuilder */ private $zone; /** + * @var ?ShippingRateCollection */ private $shippingRates; @@ -35,6 +37,7 @@ final class ZoneRateBuilder implements Builder /** *

    Zone for which the shipping rates are valid.

    * + * @return null|ZoneReference */ public function getZone() @@ -45,6 +48,7 @@ public function getZone() /** *

    Shipping rates defined per currency.

    * + * @return null|ShippingRateCollection */ public function getShippingRates() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateDraft.php b/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateDraft.php index 869bf5cc3ab..41ac5c327f6 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateDraft.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateDraft.php @@ -20,6 +20,7 @@ interface ZoneRateDraft extends JsonObject /** *

    Sets the Zone for which the shippng rates are valid.

    * + * @return null|ZoneResourceIdentifier */ public function getZone(); @@ -27,6 +28,7 @@ public function getZone(); /** *

    Shipping rates for the currencies configured in the Project. The array must not contain two ShippingRates with the same CurrencyCode.

    * + * @return null|ShippingRateDraftCollection */ public function getShippingRates(); diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateDraftBuilder.php b/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateDraftBuilder.php index d25c14de87d..1eff7f58748 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateDraftBuilder.php @@ -23,11 +23,13 @@ final class ZoneRateDraftBuilder implements Builder { /** + * @var null|ZoneResourceIdentifier|ZoneResourceIdentifierBuilder */ private $zone; /** + * @var ?ShippingRateDraftCollection */ private $shippingRates; @@ -35,6 +37,7 @@ final class ZoneRateDraftBuilder implements Builder /** *

    Sets the Zone for which the shippng rates are valid.

    * + * @return null|ZoneResourceIdentifier */ public function getZone() @@ -45,6 +48,7 @@ public function getZone() /** *

    Shipping rates for the currencies configured in the Project. The array must not contain two ShippingRates with the same CurrencyCode.

    * + * @return null|ShippingRateDraftCollection */ public function getShippingRates() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateDraftModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateDraftModel.php index 95445cd5c04..5ee43d91c02 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateDraftModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateDraftModel.php @@ -22,11 +22,13 @@ final class ZoneRateDraftModel extends JsonObjectModel implements ZoneRateDraft { /** + * * @var ?ZoneResourceIdentifier */ protected $zone; /** + * * @var ?ShippingRateDraftCollection */ protected $shippingRates; @@ -46,6 +48,7 @@ public function __construct( /** *

    Sets the Zone for which the shippng rates are valid.

    * + * * @return null|ZoneResourceIdentifier */ public function getZone() @@ -66,6 +69,7 @@ public function getZone() /** *

    Shipping rates for the currencies configured in the Project. The array must not contain two ShippingRates with the same CurrencyCode.

    * + * * @return null|ShippingRateDraftCollection */ public function getShippingRates() diff --git a/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateModel.php b/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateModel.php index 2619cb1d659..2c399d5bda2 100644 --- a/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateModel.php +++ b/lib/commercetools-api/src/Models/ShippingMethod/ZoneRateModel.php @@ -22,11 +22,13 @@ final class ZoneRateModel extends JsonObjectModel implements ZoneRate { /** + * * @var ?ZoneReference */ protected $zone; /** + * * @var ?ShippingRateCollection */ protected $shippingRates; @@ -46,6 +48,7 @@ public function __construct( /** *

    Zone for which the shipping rates are valid.

    * + * * @return null|ZoneReference */ public function getZone() @@ -66,6 +69,7 @@ public function getZone() /** *

    Shipping rates defined per currency.

    * + * * @return null|ShippingRateCollection */ public function getShippingRates() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingList.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingList.php index 75c040f6340..8e1dd7a6441 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingList.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingList.php @@ -38,6 +38,7 @@ interface ShoppingList extends BaseResource /** *

    Unique identifier of the ShoppingList.

    * + * @return null|string */ public function getId(); @@ -45,16 +46,19 @@ public function getId(); /** *

    The current version of the shopping list.

    * + * @return null|int */ public function getVersion(); /** + * @return null|DateTimeImmutable */ public function getCreatedAt(); /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -62,6 +66,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -69,16 +74,19 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); /** + * @return null|CustomFields */ public function getCustom(); /** + * @return null|CustomerReference */ public function getCustomer(); @@ -86,11 +94,13 @@ public function getCustomer(); /** *

    The shopping list will be deleted automatically if it hasn't been modified for the specified amount of days.

    * + * @return null|int */ public function getDeleteDaysAfterLastModification(); /** + * @return null|LocalizedString */ public function getDescription(); @@ -98,16 +108,19 @@ public function getDescription(); /** *

    User-defined unique identifier of the ShoppingList.

    * + * @return null|string */ public function getKey(); /** + * @return null|ShoppingListLineItemCollection */ public function getLineItems(); /** + * @return null|LocalizedString */ public function getName(); @@ -117,11 +130,13 @@ public function getName(); * Each slug is unique across a project, but a shopping list can have the same slug for different languages. * The slug must match the pattern [a-zA-Z0-9_-]{2,256}.

    * + * @return null|LocalizedString */ public function getSlug(); /** + * @return null|TextLineItemCollection */ public function getTextLineItems(); @@ -129,11 +144,13 @@ public function getTextLineItems(); /** *

    Identifies shopping lists belonging to an anonymous session (the customer has not signed up/in yet).

    * + * @return null|string */ public function getAnonymousId(); /** + * @return null|StoreKeyReference */ public function getStore(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemAction.php index afc271e0805..5fa996fba07 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemAction.php @@ -23,26 +23,31 @@ interface ShoppingListAddLineItemAction extends ShoppingListUpdateAction public const FIELD_CUSTOM = 'custom'; /** + * @return null|string */ public function getSku(); /** + * @return null|string */ public function getProductId(); /** + * @return null|int */ public function getVariantId(); /** + * @return null|int */ public function getQuantity(); /** + * @return null|DateTimeImmutable */ public function getAddedAt(); @@ -50,6 +55,7 @@ public function getAddedAt(); /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemActionBuilder.php index 0d3d94dffff..799a807a86c 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemActionBuilder.php @@ -24,36 +24,43 @@ final class ShoppingListAddLineItemActionBuilder implements Builder { /** + * @var ?string */ private $sku; /** + * @var ?string */ private $productId; /** + * @var ?int */ private $variantId; /** + * @var ?int */ private $quantity; /** + * @var ?DateTimeImmutable */ private $addedAt; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @return null|string */ public function getSku() @@ -62,6 +69,7 @@ public function getSku() } /** + * @return null|string */ public function getProductId() @@ -70,6 +78,7 @@ public function getProductId() } /** + * @return null|int */ public function getVariantId() @@ -78,6 +87,7 @@ public function getVariantId() } /** + * @return null|int */ public function getQuantity() @@ -86,6 +96,7 @@ public function getQuantity() } /** + * @return null|DateTimeImmutable */ public function getAddedAt() @@ -96,6 +107,7 @@ public function getAddedAt() /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemActionModel.php index 488d2a36409..24ab86569f9 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemActionModel.php @@ -24,36 +24,43 @@ final class ShoppingListAddLineItemActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'addLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $productId; /** + * * @var ?int */ protected $variantId; /** + * * @var ?int */ protected $quantity; /** + * * @var ?DateTimeImmutable */ protected $addedAt; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -68,7 +75,8 @@ public function __construct( ?int $variantId = null, ?int $quantity = null, ?DateTimeImmutable $addedAt = null, - ?CustomFieldsDraft $custom = null + ?CustomFieldsDraft $custom = null, + ?string $action = null ) { $this->sku = $sku; $this->productId = $productId; @@ -76,10 +84,11 @@ public function __construct( $this->quantity = $quantity; $this->addedAt = $addedAt; $this->custom = $custom; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -97,6 +106,7 @@ public function getAction() } /** + * * @return null|string */ public function getSku() @@ -114,6 +124,7 @@ public function getSku() } /** + * * @return null|string */ public function getProductId() @@ -131,6 +142,7 @@ public function getProductId() } /** + * * @return null|int */ public function getVariantId() @@ -148,6 +160,7 @@ public function getVariantId() } /** + * * @return null|int */ public function getQuantity() @@ -165,6 +178,7 @@ public function getQuantity() } /** + * * @return null|DateTimeImmutable */ public function getAddedAt() @@ -188,6 +202,7 @@ public function getAddedAt() /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemAction.php index 42b92893790..ffcd59e96cd 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemAction.php @@ -25,6 +25,7 @@ interface ShoppingListAddTextLineItemAction extends ShoppingListUpdateAction /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getName(); @@ -32,16 +33,19 @@ public function getName(); /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getDescription(); /** + * @return null|int */ public function getQuantity(); /** + * @return null|DateTimeImmutable */ public function getAddedAt(); @@ -49,6 +53,7 @@ public function getAddedAt(); /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemActionBuilder.php index f574c005bb0..2c8d25833d2 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemActionBuilder.php @@ -26,26 +26,31 @@ final class ShoppingListAddTextLineItemActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?int */ private $quantity; /** + * @var ?DateTimeImmutable */ private $addedAt; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; @@ -53,6 +58,7 @@ final class ShoppingListAddTextLineItemActionBuilder implements Builder /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getName() @@ -63,6 +69,7 @@ public function getName() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getDescription() @@ -71,6 +78,7 @@ public function getDescription() } /** + * @return null|int */ public function getQuantity() @@ -79,6 +87,7 @@ public function getQuantity() } /** + * @return null|DateTimeImmutable */ public function getAddedAt() @@ -89,6 +98,7 @@ public function getAddedAt() /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemActionModel.php index dcac26280c7..1d5e9973da0 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemActionModel.php @@ -26,31 +26,37 @@ final class ShoppingListAddTextLineItemActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'addTextLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?int */ protected $quantity; /** + * * @var ?DateTimeImmutable */ protected $addedAt; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -64,17 +70,19 @@ public function __construct( ?LocalizedString $description = null, ?int $quantity = null, ?DateTimeImmutable $addedAt = null, - ?CustomFieldsDraft $custom = null + ?CustomFieldsDraft $custom = null, + ?string $action = null ) { $this->name = $name; $this->description = $description; $this->quantity = $quantity; $this->addedAt = $addedAt; $this->custom = $custom; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -94,6 +102,7 @@ public function getAction() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * * @return null|LocalizedString */ public function getName() @@ -114,6 +123,7 @@ public function getName() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * * @return null|LocalizedString */ public function getDescription() @@ -132,6 +142,7 @@ public function getDescription() } /** + * * @return null|int */ public function getQuantity() @@ -149,6 +160,7 @@ public function getQuantity() } /** + * * @return null|DateTimeImmutable */ public function getAddedAt() @@ -172,6 +184,7 @@ public function getAddedAt() /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListBuilder.php index 5a56f548a6a..49fafc54399 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListBuilder.php @@ -36,86 +36,103 @@ final class ShoppingListBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var null|CustomerReference|CustomerReferenceBuilder */ private $customer; /** + * @var ?int */ private $deleteDaysAfterLastModification; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?string */ private $key; /** + * @var ?ShoppingListLineItemCollection */ private $lineItems; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @var ?TextLineItemCollection */ private $textLineItems; /** + * @var ?string */ private $anonymousId; /** + * @var null|StoreKeyReference|StoreKeyReferenceBuilder */ private $store; @@ -123,6 +140,7 @@ final class ShoppingListBuilder implements Builder /** *

    Unique identifier of the ShoppingList.

    * + * @return null|string */ public function getId() @@ -133,6 +151,7 @@ public function getId() /** *

    The current version of the shopping list.

    * + * @return null|int */ public function getVersion() @@ -141,6 +160,7 @@ public function getVersion() } /** + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -149,6 +169,7 @@ public function getCreatedAt() } /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -159,6 +180,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -169,6 +191,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -177,6 +200,7 @@ public function getCreatedBy() } /** + * @return null|CustomFields */ public function getCustom() @@ -185,6 +209,7 @@ public function getCustom() } /** + * @return null|CustomerReference */ public function getCustomer() @@ -195,6 +220,7 @@ public function getCustomer() /** *

    The shopping list will be deleted automatically if it hasn't been modified for the specified amount of days.

    * + * @return null|int */ public function getDeleteDaysAfterLastModification() @@ -203,6 +229,7 @@ public function getDeleteDaysAfterLastModification() } /** + * @return null|LocalizedString */ public function getDescription() @@ -213,6 +240,7 @@ public function getDescription() /** *

    User-defined unique identifier of the ShoppingList.

    * + * @return null|string */ public function getKey() @@ -221,6 +249,7 @@ public function getKey() } /** + * @return null|ShoppingListLineItemCollection */ public function getLineItems() @@ -229,6 +258,7 @@ public function getLineItems() } /** + * @return null|LocalizedString */ public function getName() @@ -241,6 +271,7 @@ public function getName() * Each slug is unique across a project, but a shopping list can have the same slug for different languages. * The slug must match the pattern [a-zA-Z0-9_-]{2,256}.

    * + * @return null|LocalizedString */ public function getSlug() @@ -249,6 +280,7 @@ public function getSlug() } /** + * @return null|TextLineItemCollection */ public function getTextLineItems() @@ -259,6 +291,7 @@ public function getTextLineItems() /** *

    Identifies shopping lists belonging to an anonymous session (the customer has not signed up/in yet).

    * + * @return null|string */ public function getAnonymousId() @@ -267,6 +300,7 @@ public function getAnonymousId() } /** + * @return null|StoreKeyReference */ public function getStore() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityAction.php index f388e5fc396..0fd82cc9d3e 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityAction.php @@ -17,11 +17,13 @@ interface ShoppingListChangeLineItemQuantityAction extends ShoppingListUpdateAct public const FIELD_QUANTITY = 'quantity'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityActionBuilder.php index 6d1a578c77b..14045814176 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityActionBuilder.php @@ -21,16 +21,19 @@ final class ShoppingListChangeLineItemQuantityActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?int */ private $quantity; /** + * @return null|string */ public function getLineItemId() @@ -39,6 +42,7 @@ public function getLineItemId() } /** + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityActionModel.php index 1014751e040..bdb8ae6f3ed 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityActionModel.php @@ -21,16 +21,19 @@ final class ShoppingListChangeLineItemQuantityActionModel extends JsonObjectMode { public const DISCRIMINATOR_VALUE = 'changeLineItemQuantity'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?int */ protected $quantity; @@ -41,14 +44,16 @@ final class ShoppingListChangeLineItemQuantityActionModel extends JsonObjectMode */ public function __construct( ?string $lineItemId = null, - ?int $quantity = null + ?int $quantity = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->quantity = $quantity; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -83,6 +89,7 @@ public function getLineItemId() } /** + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemsOrderAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemsOrderAction.php index 79ca5e89b94..d945168dc77 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemsOrderAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemsOrderAction.php @@ -16,6 +16,7 @@ interface ShoppingListChangeLineItemsOrderAction extends ShoppingListUpdateActio public const FIELD_LINE_ITEM_ORDER = 'lineItemOrder'; /** + * @return null|array */ public function getLineItemOrder(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemsOrderActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemsOrderActionBuilder.php index 63809e65d2f..f5c54f5b45f 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemsOrderActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemsOrderActionBuilder.php @@ -21,11 +21,13 @@ final class ShoppingListChangeLineItemsOrderActionBuilder implements Builder { /** + * @var ?array */ private $lineItemOrder; /** + * @return null|array */ public function getLineItemOrder() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemsOrderActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemsOrderActionModel.php index e9eebb93f84..998ee14d44a 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemsOrderActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemsOrderActionModel.php @@ -21,11 +21,13 @@ final class ShoppingListChangeLineItemsOrderActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'changeLineItemsOrder'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $lineItemOrder; @@ -35,13 +37,15 @@ final class ShoppingListChangeLineItemsOrderActionModel extends JsonObjectModel * @psalm-suppress MissingParamType */ public function __construct( - ?array $lineItemOrder = null + ?array $lineItemOrder = null, + ?string $action = null ) { $this->lineItemOrder = $lineItemOrder; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|array */ public function getLineItemOrder() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeNameAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeNameAction.php index f3c30085c32..6a37905b2d7 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeNameAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeNameAction.php @@ -17,6 +17,7 @@ interface ShoppingListChangeNameAction extends ShoppingListUpdateAction public const FIELD_NAME = 'name'; /** + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeNameActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeNameActionBuilder.php index 9e0596adf5d..70fe97154fd 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeNameActionBuilder.php @@ -23,11 +23,13 @@ final class ShoppingListChangeNameActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeNameActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeNameActionModel.php index 03c7d71a381..e23c9b8d5e0 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeNameActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeNameActionModel.php @@ -23,11 +23,13 @@ final class ShoppingListChangeNameActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'changeName'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $name; @@ -37,13 +39,15 @@ final class ShoppingListChangeNameActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameAction.php index c962641d20c..d7741c266a3 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameAction.php @@ -18,6 +18,7 @@ interface ShoppingListChangeTextLineItemNameAction extends ShoppingListUpdateAct public const FIELD_NAME = 'name'; /** + * @return null|string */ public function getTextLineItemId(); @@ -25,6 +26,7 @@ public function getTextLineItemId(); /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameActionBuilder.php index 8655d81eae6..f2784a4e117 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameActionBuilder.php @@ -23,16 +23,19 @@ final class ShoppingListChangeTextLineItemNameActionBuilder implements Builder { /** + * @var ?string */ private $textLineItemId; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @return null|string */ public function getTextLineItemId() @@ -43,6 +46,7 @@ public function getTextLineItemId() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameActionModel.php index b92b101049e..e1b25729a75 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameActionModel.php @@ -23,16 +23,19 @@ final class ShoppingListChangeTextLineItemNameActionModel extends JsonObjectMode { public const DISCRIMINATOR_VALUE = 'changeTextLineItemName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $textLineItemId; /** + * * @var ?LocalizedString */ protected $name; @@ -43,14 +46,16 @@ final class ShoppingListChangeTextLineItemNameActionModel extends JsonObjectMode */ public function __construct( ?string $textLineItemId = null, - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $action = null ) { $this->textLineItemId = $textLineItemId; $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|string */ public function getTextLineItemId() @@ -87,6 +93,7 @@ public function getTextLineItemId() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityAction.php index e6b2d7d0ff2..db831383584 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityAction.php @@ -17,11 +17,13 @@ interface ShoppingListChangeTextLineItemQuantityAction extends ShoppingListUpdat public const FIELD_QUANTITY = 'quantity'; /** + * @return null|string */ public function getTextLineItemId(); /** + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityActionBuilder.php index a5389f1c3e2..c8a1d6a9f9e 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityActionBuilder.php @@ -21,16 +21,19 @@ final class ShoppingListChangeTextLineItemQuantityActionBuilder implements Builder { /** + * @var ?string */ private $textLineItemId; /** + * @var ?int */ private $quantity; /** + * @return null|string */ public function getTextLineItemId() @@ -39,6 +42,7 @@ public function getTextLineItemId() } /** + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityActionModel.php index 7477603197e..4b087e373d7 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityActionModel.php @@ -21,16 +21,19 @@ final class ShoppingListChangeTextLineItemQuantityActionModel extends JsonObject { public const DISCRIMINATOR_VALUE = 'changeTextLineItemQuantity'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $textLineItemId; /** + * * @var ?int */ protected $quantity; @@ -41,14 +44,16 @@ final class ShoppingListChangeTextLineItemQuantityActionModel extends JsonObject */ public function __construct( ?string $textLineItemId = null, - ?int $quantity = null + ?int $quantity = null, + ?string $action = null ) { $this->textLineItemId = $textLineItemId; $this->quantity = $quantity; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getTextLineItemId() @@ -83,6 +89,7 @@ public function getTextLineItemId() } /** + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemsOrderAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemsOrderAction.php index ab49b193cad..8e91d9fc91c 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemsOrderAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemsOrderAction.php @@ -16,6 +16,7 @@ interface ShoppingListChangeTextLineItemsOrderAction extends ShoppingListUpdateA public const FIELD_TEXT_LINE_ITEM_ORDER = 'textLineItemOrder'; /** + * @return null|array */ public function getTextLineItemOrder(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemsOrderActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemsOrderActionBuilder.php index dc0f6f30f36..2cf2786c86d 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemsOrderActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemsOrderActionBuilder.php @@ -21,11 +21,13 @@ final class ShoppingListChangeTextLineItemsOrderActionBuilder implements Builder { /** + * @var ?array */ private $textLineItemOrder; /** + * @return null|array */ public function getTextLineItemOrder() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemsOrderActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemsOrderActionModel.php index e6ac293603f..96681fababc 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemsOrderActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemsOrderActionModel.php @@ -21,11 +21,13 @@ final class ShoppingListChangeTextLineItemsOrderActionModel extends JsonObjectMo { public const DISCRIMINATOR_VALUE = 'changeTextLineItemsOrder'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $textLineItemOrder; @@ -35,13 +37,15 @@ final class ShoppingListChangeTextLineItemsOrderActionModel extends JsonObjectMo * @psalm-suppress MissingParamType */ public function __construct( - ?array $textLineItemOrder = null + ?array $textLineItemOrder = null, + ?string $action = null ) { $this->textLineItemOrder = $textLineItemOrder; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|array */ public function getTextLineItemOrder() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraft.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraft.php index 4578a5f39f3..9ab7cb06f03 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraft.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraft.php @@ -32,11 +32,13 @@ interface ShoppingListDraft extends JsonObject /** *

    The custom fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); /** + * @return null|CustomerResourceIdentifier */ public function getCustomer(); @@ -44,11 +46,13 @@ public function getCustomer(); /** *

    The shopping list will be deleted automatically if it hasn't been modified for the specified amount of days.

    * + * @return null|int */ public function getDeleteDaysAfterLastModification(); /** + * @return null|LocalizedString */ public function getDescription(); @@ -56,16 +60,19 @@ public function getDescription(); /** *

    User-defined unique identifier for the ShoppingList.

    * + * @return null|string */ public function getKey(); /** + * @return null|ShoppingListLineItemDraftCollection */ public function getLineItems(); /** + * @return null|LocalizedString */ public function getName(); @@ -75,11 +82,13 @@ public function getName(); * Each slug is unique across a project, but a shopping list can have the same slug for different languages. * The slug must match the pattern [a-zA-Z0-9_-]{2,256}.

    * + * @return null|LocalizedString */ public function getSlug(); /** + * @return null|TextLineItemDraftCollection */ public function getTextLineItems(); @@ -87,11 +96,13 @@ public function getTextLineItems(); /** *

    Identifies shopping lists belonging to an anonymous session (the customer has not signed up/in yet).

    * + * @return null|string */ public function getAnonymousId(); /** + * @return null|StoreResourceIdentifier */ public function getStore(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraftBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraftBuilder.php index de917e87fc8..228e3086f59 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraftBuilder.php @@ -29,56 +29,67 @@ final class ShoppingListDraftBuilder implements Builder { /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var null|CustomerResourceIdentifier|CustomerResourceIdentifierBuilder */ private $customer; /** + * @var ?int */ private $deleteDaysAfterLastModification; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?string */ private $key; /** + * @var ?ShoppingListLineItemDraftCollection */ private $lineItems; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @var ?TextLineItemDraftCollection */ private $textLineItems; /** + * @var ?string */ private $anonymousId; /** + * @var null|StoreResourceIdentifier|StoreResourceIdentifierBuilder */ private $store; @@ -86,6 +97,7 @@ final class ShoppingListDraftBuilder implements Builder /** *

    The custom fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -94,6 +106,7 @@ public function getCustom() } /** + * @return null|CustomerResourceIdentifier */ public function getCustomer() @@ -104,6 +117,7 @@ public function getCustomer() /** *

    The shopping list will be deleted automatically if it hasn't been modified for the specified amount of days.

    * + * @return null|int */ public function getDeleteDaysAfterLastModification() @@ -112,6 +126,7 @@ public function getDeleteDaysAfterLastModification() } /** + * @return null|LocalizedString */ public function getDescription() @@ -122,6 +137,7 @@ public function getDescription() /** *

    User-defined unique identifier for the ShoppingList.

    * + * @return null|string */ public function getKey() @@ -130,6 +146,7 @@ public function getKey() } /** + * @return null|ShoppingListLineItemDraftCollection */ public function getLineItems() @@ -138,6 +155,7 @@ public function getLineItems() } /** + * @return null|LocalizedString */ public function getName() @@ -150,6 +168,7 @@ public function getName() * Each slug is unique across a project, but a shopping list can have the same slug for different languages. * The slug must match the pattern [a-zA-Z0-9_-]{2,256}.

    * + * @return null|LocalizedString */ public function getSlug() @@ -158,6 +177,7 @@ public function getSlug() } /** + * @return null|TextLineItemDraftCollection */ public function getTextLineItems() @@ -168,6 +188,7 @@ public function getTextLineItems() /** *

    Identifies shopping lists belonging to an anonymous session (the customer has not signed up/in yet).

    * + * @return null|string */ public function getAnonymousId() @@ -176,6 +197,7 @@ public function getAnonymousId() } /** + * @return null|StoreResourceIdentifier */ public function getStore() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraftModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraftModel.php index 574b2c48894..708bc3f7d4e 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraftModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListDraftModel.php @@ -28,56 +28,67 @@ final class ShoppingListDraftModel extends JsonObjectModel implements ShoppingListDraft { /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?CustomerResourceIdentifier */ protected $customer; /** + * * @var ?int */ protected $deleteDaysAfterLastModification; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?string */ protected $key; /** + * * @var ?ShoppingListLineItemDraftCollection */ protected $lineItems; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $slug; /** + * * @var ?TextLineItemDraftCollection */ protected $textLineItems; /** + * * @var ?string */ protected $anonymousId; /** + * * @var ?StoreResourceIdentifier */ protected $store; @@ -115,6 +126,7 @@ public function __construct( /** *

    The custom fields.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -133,6 +145,7 @@ public function getCustom() } /** + * * @return null|CustomerResourceIdentifier */ public function getCustomer() @@ -153,6 +166,7 @@ public function getCustomer() /** *

    The shopping list will be deleted automatically if it hasn't been modified for the specified amount of days.

    * + * * @return null|int */ public function getDeleteDaysAfterLastModification() @@ -170,6 +184,7 @@ public function getDeleteDaysAfterLastModification() } /** + * * @return null|LocalizedString */ public function getDescription() @@ -190,6 +205,7 @@ public function getDescription() /** *

    User-defined unique identifier for the ShoppingList.

    * + * * @return null|string */ public function getKey() @@ -207,6 +223,7 @@ public function getKey() } /** + * * @return null|ShoppingListLineItemDraftCollection */ public function getLineItems() @@ -224,6 +241,7 @@ public function getLineItems() } /** + * * @return null|LocalizedString */ public function getName() @@ -246,6 +264,7 @@ public function getName() * Each slug is unique across a project, but a shopping list can have the same slug for different languages. * The slug must match the pattern [a-zA-Z0-9_-]{2,256}.

    * + * * @return null|LocalizedString */ public function getSlug() @@ -264,6 +283,7 @@ public function getSlug() } /** + * * @return null|TextLineItemDraftCollection */ public function getTextLineItems() @@ -283,6 +303,7 @@ public function getTextLineItems() /** *

    Identifies shopping lists belonging to an anonymous session (the customer has not signed up/in yet).

    * + * * @return null|string */ public function getAnonymousId() @@ -300,6 +321,7 @@ public function getAnonymousId() } /** + * * @return null|StoreResourceIdentifier */ public function getStore() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItem.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItem.php index 33e6a83c0a1..18261ee0b0f 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItem.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItem.php @@ -31,6 +31,7 @@ interface ShoppingListLineItem extends JsonObject public const FIELD_VARIANT_ID = 'variantId'; /** + * @return null|DateTimeImmutable */ public function getAddedAt(); @@ -38,11 +39,13 @@ public function getAddedAt(); /** *

    Serves as value of the custom field on a resource or data type customized with a Type.

    * + * @return null|CustomFields */ public function getCustom(); /** + * @return null|DateTimeImmutable */ public function getDeactivatedAt(); @@ -50,6 +53,7 @@ public function getDeactivatedAt(); /** *

    Unique identifier of the ShoppingListLineItem.

    * + * @return null|string */ public function getId(); @@ -57,11 +61,13 @@ public function getId(); /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getName(); /** + * @return null|string */ public function getProductId(); @@ -69,6 +75,7 @@ public function getProductId(); /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getProductSlug(); @@ -76,21 +83,27 @@ public function getProductSlug(); /** *

    Reference to a ProductType.

    * + * @return null|ProductTypeReference */ public function getProductType(); /** + * @return null|int */ public function getQuantity(); /** + *

    A concrete sellable good for which inventory can be tracked. Product Variants are generally mapped to specific SKUs.

    + * + * @return null|ProductVariant */ public function getVariant(); /** + * @return null|int */ public function getVariantId(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php index f69e606fd76..1e69ed137c7 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php @@ -30,61 +30,73 @@ final class ShoppingListLineItemBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $addedAt; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var ?DateTimeImmutable */ private $deactivatedAt; /** + * @var ?string */ private $id; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?string */ private $productId; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $productSlug; /** + * @var null|ProductTypeReference|ProductTypeReferenceBuilder */ private $productType; /** + * @var ?int */ private $quantity; /** + * @var null|ProductVariant|ProductVariantBuilder */ private $variant; /** + * @var ?int */ private $variantId; /** + * @return null|DateTimeImmutable */ public function getAddedAt() @@ -95,6 +107,7 @@ public function getAddedAt() /** *

    Serves as value of the custom field on a resource or data type customized with a Type.

    * + * @return null|CustomFields */ public function getCustom() @@ -103,6 +116,7 @@ public function getCustom() } /** + * @return null|DateTimeImmutable */ public function getDeactivatedAt() @@ -113,6 +127,7 @@ public function getDeactivatedAt() /** *

    Unique identifier of the ShoppingListLineItem.

    * + * @return null|string */ public function getId() @@ -123,6 +138,7 @@ public function getId() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getName() @@ -131,6 +147,7 @@ public function getName() } /** + * @return null|string */ public function getProductId() @@ -141,6 +158,7 @@ public function getProductId() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getProductSlug() @@ -151,6 +169,7 @@ public function getProductSlug() /** *

    Reference to a ProductType.

    * + * @return null|ProductTypeReference */ public function getProductType() @@ -159,6 +178,7 @@ public function getProductType() } /** + * @return null|int */ public function getQuantity() @@ -167,6 +187,9 @@ public function getQuantity() } /** + *

    A concrete sellable good for which inventory can be tracked. Product Variants are generally mapped to specific SKUs.

    + * + * @return null|ProductVariant */ public function getVariant() @@ -175,6 +198,7 @@ public function getVariant() } /** + * @return null|int */ public function getVariantId() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraft.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraft.php index 1d4cc621bec..e3c0f452e65 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraft.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraft.php @@ -23,6 +23,7 @@ interface ShoppingListLineItemDraft extends JsonObject public const FIELD_VARIANT_ID = 'variantId'; /** + * @return null|DateTimeImmutable */ public function getAddedAt(); @@ -30,26 +31,31 @@ public function getAddedAt(); /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); /** + * @return null|string */ public function getSku(); /** + * @return null|string */ public function getProductId(); /** + * @return null|int */ public function getQuantity(); /** + * @return null|int */ public function getVariantId(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraftBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraftBuilder.php index 20571a0b812..45dc4b96613 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraftBuilder.php @@ -24,36 +24,43 @@ final class ShoppingListLineItemDraftBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $addedAt; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var ?string */ private $sku; /** + * @var ?string */ private $productId; /** + * @var ?int */ private $quantity; /** + * @var ?int */ private $variantId; /** + * @return null|DateTimeImmutable */ public function getAddedAt() @@ -64,6 +71,7 @@ public function getAddedAt() /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -72,6 +80,7 @@ public function getCustom() } /** + * @return null|string */ public function getSku() @@ -80,6 +89,7 @@ public function getSku() } /** + * @return null|string */ public function getProductId() @@ -88,6 +98,7 @@ public function getProductId() } /** + * @return null|int */ public function getQuantity() @@ -96,6 +107,7 @@ public function getQuantity() } /** + * @return null|int */ public function getVariantId() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraftModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraftModel.php index 2dfc21dbd60..f8f69ca779e 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraftModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraftModel.php @@ -23,31 +23,37 @@ final class ShoppingListLineItemDraftModel extends JsonObjectModel implements ShoppingListLineItemDraft { /** + * * @var ?DateTimeImmutable */ protected $addedAt; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $productId; /** + * * @var ?int */ protected $quantity; /** + * * @var ?int */ protected $variantId; @@ -73,6 +79,7 @@ public function __construct( } /** + * * @return null|DateTimeImmutable */ public function getAddedAt() @@ -96,6 +103,7 @@ public function getAddedAt() /** *

    The representation used when creating or updating a customizable data type with Custom Fields.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -114,6 +122,7 @@ public function getCustom() } /** + * * @return null|string */ public function getSku() @@ -131,6 +140,7 @@ public function getSku() } /** + * * @return null|string */ public function getProductId() @@ -148,6 +158,7 @@ public function getProductId() } /** + * * @return null|int */ public function getQuantity() @@ -165,6 +176,7 @@ public function getQuantity() } /** + * * @return null|int */ public function getVariantId() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php index 5a91fe344b1..3de7569cf68 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php @@ -29,56 +29,67 @@ final class ShoppingListLineItemModel extends JsonObjectModel implements ShoppingListLineItem { /** + * * @var ?DateTimeImmutable */ protected $addedAt; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?DateTimeImmutable */ protected $deactivatedAt; /** + * * @var ?string */ protected $id; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?string */ protected $productId; /** + * * @var ?LocalizedString */ protected $productSlug; /** + * * @var ?ProductTypeReference */ protected $productType; /** + * * @var ?int */ protected $quantity; /** + * * @var ?ProductVariant */ protected $variant; /** + * * @var ?int */ protected $variantId; @@ -114,6 +125,7 @@ public function __construct( } /** + * * @return null|DateTimeImmutable */ public function getAddedAt() @@ -137,6 +149,7 @@ public function getAddedAt() /** *

    Serves as value of the custom field on a resource or data type customized with a Type.

    * + * * @return null|CustomFields */ public function getCustom() @@ -155,6 +168,7 @@ public function getCustom() } /** + * * @return null|DateTimeImmutable */ public function getDeactivatedAt() @@ -178,6 +192,7 @@ public function getDeactivatedAt() /** *

    Unique identifier of the ShoppingListLineItem.

    * + * * @return null|string */ public function getId() @@ -197,6 +212,7 @@ public function getId() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * * @return null|LocalizedString */ public function getName() @@ -215,6 +231,7 @@ public function getName() } /** + * * @return null|string */ public function getProductId() @@ -234,6 +251,7 @@ public function getProductId() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * * @return null|LocalizedString */ public function getProductSlug() @@ -254,6 +272,7 @@ public function getProductSlug() /** *

    Reference to a ProductType.

    * + * * @return null|ProductTypeReference */ public function getProductType() @@ -272,6 +291,7 @@ public function getProductType() } /** + * * @return null|int */ public function getQuantity() @@ -289,6 +309,9 @@ public function getQuantity() } /** + *

    A concrete sellable good for which inventory can be tracked. Product Variants are generally mapped to specific SKUs.

    + * + * * @return null|ProductVariant */ public function getVariant() @@ -307,6 +330,7 @@ public function getVariant() } /** + * * @return null|int */ public function getVariantId() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListModel.php index 98c1ea30a0e..7b9b3a07036 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListModel.php @@ -35,86 +35,103 @@ final class ShoppingListModel extends JsonObjectModel implements ShoppingList { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?CustomerReference */ protected $customer; /** + * * @var ?int */ protected $deleteDaysAfterLastModification; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?string */ protected $key; /** + * * @var ?ShoppingListLineItemCollection */ protected $lineItems; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $slug; /** + * * @var ?TextLineItemCollection */ protected $textLineItems; /** + * * @var ?string */ protected $anonymousId; /** + * * @var ?StoreKeyReference */ protected $store; @@ -164,6 +181,7 @@ public function __construct( /** *

    Unique identifier of the ShoppingList.

    * + * * @return null|string */ public function getId() @@ -183,6 +201,7 @@ public function getId() /** *

    The current version of the shopping list.

    * + * * @return null|int */ public function getVersion() @@ -200,6 +219,7 @@ public function getVersion() } /** + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -221,6 +241,7 @@ public function getCreatedAt() } /** + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -244,6 +265,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -264,6 +286,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -282,6 +305,7 @@ public function getCreatedBy() } /** + * * @return null|CustomFields */ public function getCustom() @@ -300,6 +324,7 @@ public function getCustom() } /** + * * @return null|CustomerReference */ public function getCustomer() @@ -320,6 +345,7 @@ public function getCustomer() /** *

    The shopping list will be deleted automatically if it hasn't been modified for the specified amount of days.

    * + * * @return null|int */ public function getDeleteDaysAfterLastModification() @@ -337,6 +363,7 @@ public function getDeleteDaysAfterLastModification() } /** + * * @return null|LocalizedString */ public function getDescription() @@ -357,6 +384,7 @@ public function getDescription() /** *

    User-defined unique identifier of the ShoppingList.

    * + * * @return null|string */ public function getKey() @@ -374,6 +402,7 @@ public function getKey() } /** + * * @return null|ShoppingListLineItemCollection */ public function getLineItems() @@ -391,6 +420,7 @@ public function getLineItems() } /** + * * @return null|LocalizedString */ public function getName() @@ -413,6 +443,7 @@ public function getName() * Each slug is unique across a project, but a shopping list can have the same slug for different languages. * The slug must match the pattern [a-zA-Z0-9_-]{2,256}.

    * + * * @return null|LocalizedString */ public function getSlug() @@ -431,6 +462,7 @@ public function getSlug() } /** + * * @return null|TextLineItemCollection */ public function getTextLineItems() @@ -450,6 +482,7 @@ public function getTextLineItems() /** *

    Identifies shopping lists belonging to an anonymous session (the customer has not signed up/in yet).

    * + * * @return null|string */ public function getAnonymousId() @@ -467,6 +500,7 @@ public function getAnonymousId() } /** + * * @return null|StoreKeyReference */ public function getStore() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListPagedQueryResponse.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListPagedQueryResponse.php index 7be4bdfa9ae..8beecdcab34 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListPagedQueryResponse.php @@ -22,16 +22,19 @@ interface ShoppingListPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); /** + * @return null|int */ public function getCount(); /** + * @return null|int */ public function getTotal(); @@ -39,11 +42,13 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); /** + * @return null|ShoppingListCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListPagedQueryResponseBuilder.php index d0c52883574..a8f2c7d9add 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class ShoppingListPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?ShoppingListCollection */ private $results; @@ -48,6 +53,7 @@ final class ShoppingListPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -56,6 +62,7 @@ public function getLimit() } /** + * @return null|int */ public function getCount() @@ -64,6 +71,7 @@ public function getCount() } /** + * @return null|int */ public function getTotal() @@ -74,6 +82,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -82,6 +91,7 @@ public function getOffset() } /** + * @return null|ShoppingListCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListPagedQueryResponseModel.php index e5996ee46a6..fd88b143c0a 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class ShoppingListPagedQueryResponseModel extends JsonObjectModel implements ShoppingListPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?ShoppingListCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -82,6 +88,7 @@ public function getLimit() } /** + * * @return null|int */ public function getCount() @@ -99,6 +106,7 @@ public function getCount() } /** + * * @return null|int */ public function getTotal() @@ -118,6 +126,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -135,6 +144,7 @@ public function getOffset() } /** + * * @return null|ShoppingListCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListReference.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListReference.php index b4ad3676c90..805c74bc7f5 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListReference.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListReference.php @@ -19,6 +19,7 @@ interface ShoppingListReference extends Reference /** *

    Contains the representation of the expanded ShoppingList. Only present in responses to requests with Reference Expansion for ShoppingLists.

    * + * @return null|ShoppingList */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

    Unique identifier of the referenced ShoppingList.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListReferenceBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListReferenceBuilder.php index d6645d68dff..d9f718253d8 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListReferenceBuilder.php @@ -23,11 +23,13 @@ final class ShoppingListReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|ShoppingList|ShoppingListBuilder */ private $obj; @@ -35,6 +37,7 @@ final class ShoppingListReferenceBuilder implements Builder /** *

    Unique identifier of the referenced ShoppingList.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded ShoppingList. Only present in responses to requests with Reference Expansion for ShoppingLists.

    * + * @return null|ShoppingList */ public function getObj() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListReferenceModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListReferenceModel.php index e6be4d54c74..fd600fe7246 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListReferenceModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListReferenceModel.php @@ -23,16 +23,19 @@ final class ShoppingListReferenceModel extends JsonObjectModel implements Shoppi { public const DISCRIMINATOR_VALUE = 'shopping-list'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?ShoppingList */ protected $obj; @@ -43,16 +46,18 @@ final class ShoppingListReferenceModel extends JsonObjectModel implements Shoppi */ public function __construct( ?string $id = null, - ?ShoppingList $obj = null + ?ShoppingList $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced ShoppingList.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded ShoppingList. Only present in responses to requests with Reference Expansion for ShoppingLists.

    * + * * @return null|ShoppingList */ public function getObj() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemAction.php index 284132dab81..ed80e2692ad 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemAction.php @@ -17,11 +17,13 @@ interface ShoppingListRemoveLineItemAction extends ShoppingListUpdateAction public const FIELD_QUANTITY = 'quantity'; /** + * @return null|string */ public function getLineItemId(); /** + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemActionBuilder.php index 9bed500c728..1272c22267e 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemActionBuilder.php @@ -21,16 +21,19 @@ final class ShoppingListRemoveLineItemActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?int */ private $quantity; /** + * @return null|string */ public function getLineItemId() @@ -39,6 +42,7 @@ public function getLineItemId() } /** + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemActionModel.php index 5465727d8a7..00c4e6b8564 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemActionModel.php @@ -21,16 +21,19 @@ final class ShoppingListRemoveLineItemActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'removeLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?int */ protected $quantity; @@ -41,14 +44,16 @@ final class ShoppingListRemoveLineItemActionModel extends JsonObjectModel implem */ public function __construct( ?string $lineItemId = null, - ?int $quantity = null + ?int $quantity = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->quantity = $quantity; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -83,6 +89,7 @@ public function getLineItemId() } /** + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemAction.php index 795778679f8..9e60cbffb3c 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemAction.php @@ -17,11 +17,13 @@ interface ShoppingListRemoveTextLineItemAction extends ShoppingListUpdateAction public const FIELD_QUANTITY = 'quantity'; /** + * @return null|string */ public function getTextLineItemId(); /** + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemActionBuilder.php index f55dc10a03c..7552e238ccf 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemActionBuilder.php @@ -21,16 +21,19 @@ final class ShoppingListRemoveTextLineItemActionBuilder implements Builder { /** + * @var ?string */ private $textLineItemId; /** + * @var ?int */ private $quantity; /** + * @return null|string */ public function getTextLineItemId() @@ -39,6 +42,7 @@ public function getTextLineItemId() } /** + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemActionModel.php index 4bc329a1777..e70e9c07e1d 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemActionModel.php @@ -21,16 +21,19 @@ final class ShoppingListRemoveTextLineItemActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'removeTextLineItem'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $textLineItemId; /** + * * @var ?int */ protected $quantity; @@ -41,14 +44,16 @@ final class ShoppingListRemoveTextLineItemActionModel extends JsonObjectModel im */ public function __construct( ?string $textLineItemId = null, - ?int $quantity = null + ?int $quantity = null, + ?string $action = null ) { $this->textLineItemId = $textLineItemId; $this->quantity = $quantity; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -66,6 +71,7 @@ public function getAction() } /** + * * @return null|string */ public function getTextLineItemId() @@ -83,6 +89,7 @@ public function getTextLineItemId() } /** + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListResourceIdentifier.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListResourceIdentifier.php index 4fda234df3e..ccf17c0e89f 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListResourceIdentifier.php @@ -17,6 +17,7 @@ interface ShoppingListResourceIdentifier extends ResourceIdentifier /** *

    Unique identifier of the referenced ShoppingList. Either id or key is required.

    * + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

    User-defined unique identifier of the referenced ShoppingList. Either id or key is required.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListResourceIdentifierBuilder.php index ab5ecc6694a..877e6fbae58 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class ShoppingListResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class ShoppingListResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced ShoppingList. Either id or key is required.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced ShoppingList. Either id or key is required.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListResourceIdentifierModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListResourceIdentifierModel.php index fa9e9576c94..5a8fb1a1d39 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class ShoppingListResourceIdentifierModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'shopping-list'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class ShoppingListResourceIdentifierModel extends JsonObjectModel implemen */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced ShoppingList. Either id or key is required.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced ShoppingList. Either id or key is required.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetAnonymousIdAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetAnonymousIdAction.php index 868404690ec..b1f473a9263 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetAnonymousIdAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetAnonymousIdAction.php @@ -19,6 +19,7 @@ interface ShoppingListSetAnonymousIdAction extends ShoppingListUpdateAction *

    Anonymous ID of the anonymous customer that this shopping list belongs to. * If this field is not set any existing anonymousId is removed.

    * + * @return null|string */ public function getAnonymousId(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetAnonymousIdActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetAnonymousIdActionBuilder.php index 6a489da6916..4e1a6a3e6e1 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetAnonymousIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetAnonymousIdActionBuilder.php @@ -21,6 +21,7 @@ final class ShoppingListSetAnonymousIdActionBuilder implements Builder { /** + * @var ?string */ private $anonymousId; @@ -29,6 +30,7 @@ final class ShoppingListSetAnonymousIdActionBuilder implements Builder *

    Anonymous ID of the anonymous customer that this shopping list belongs to. * If this field is not set any existing anonymousId is removed.

    * + * @return null|string */ public function getAnonymousId() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetAnonymousIdActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetAnonymousIdActionModel.php index 911e56d8bb9..c2307e48c04 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetAnonymousIdActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetAnonymousIdActionModel.php @@ -21,11 +21,13 @@ final class ShoppingListSetAnonymousIdActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setAnonymousId'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $anonymousId; @@ -35,13 +37,15 @@ final class ShoppingListSetAnonymousIdActionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?string $anonymousId = null + ?string $anonymousId = null, + ?string $action = null ) { $this->anonymousId = $anonymousId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() *

    Anonymous ID of the anonymous customer that this shopping list belongs to. * If this field is not set any existing anonymousId is removed.

    * + * * @return null|string */ public function getAnonymousId() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomFieldAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomFieldAction.php index a171f599a78..1155ae0d586 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface ShoppingListSetCustomFieldAction extends ShoppingListUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomFieldActionBuilder.php index afddc25b11e..68f46182bae 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class ShoppingListSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class ShoppingListSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomFieldActionModel.php index cd810d34668..59b11715e16 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class ShoppingListSetCustomFieldActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class ShoppingListSetCustomFieldActionModel extends JsonObjectModel implem */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomTypeAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomTypeAction.php index bc95a53cc4f..eeff0a66497 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface ShoppingListSetCustomTypeAction extends ShoppingListUpdateAction *

    Defines the Type that extends the ShoppingList with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ShoppingList.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the ShoppingList.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomTypeActionBuilder.php index 9f54b597f21..324abb39401 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class ShoppingListSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class ShoppingListSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the ShoppingList with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ShoppingList.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the ShoppingList.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomTypeActionModel.php index ecc00fb488e..073c55471a6 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class ShoppingListSetCustomTypeActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class ShoppingListSetCustomTypeActionModel extends JsonObjectModel impleme */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the ShoppingList with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ShoppingList.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the ShoppingList.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomerAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomerAction.php index 1c7c612adb7..ce67b3225c0 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomerAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomerAction.php @@ -17,6 +17,7 @@ interface ShoppingListSetCustomerAction extends ShoppingListUpdateAction public const FIELD_CUSTOMER = 'customer'; /** + * @return null|CustomerResourceIdentifier */ public function getCustomer(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomerActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomerActionBuilder.php index eedad892255..6765870e86a 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomerActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomerActionBuilder.php @@ -23,11 +23,13 @@ final class ShoppingListSetCustomerActionBuilder implements Builder { /** + * @var null|CustomerResourceIdentifier|CustomerResourceIdentifierBuilder */ private $customer; /** + * @return null|CustomerResourceIdentifier */ public function getCustomer() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomerActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomerActionModel.php index 39baac57a2c..9e58e61a799 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomerActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetCustomerActionModel.php @@ -23,11 +23,13 @@ final class ShoppingListSetCustomerActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'setCustomer'; /** + * * @var ?string */ protected $action; /** + * * @var ?CustomerResourceIdentifier */ protected $customer; @@ -37,13 +39,15 @@ final class ShoppingListSetCustomerActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?CustomerResourceIdentifier $customer = null + ?CustomerResourceIdentifier $customer = null, + ?string $action = null ) { $this->customer = $customer; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|CustomerResourceIdentifier */ public function getCustomer() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDeleteDaysAfterLastModificationAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDeleteDaysAfterLastModificationAction.php index f6b82c66495..336b0857047 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDeleteDaysAfterLastModificationAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDeleteDaysAfterLastModificationAction.php @@ -16,6 +16,7 @@ interface ShoppingListSetDeleteDaysAfterLastModificationAction extends ShoppingL public const FIELD_DELETE_DAYS_AFTER_LAST_MODIFICATION = 'deleteDaysAfterLastModification'; /** + * @return null|int */ public function getDeleteDaysAfterLastModification(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDeleteDaysAfterLastModificationActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDeleteDaysAfterLastModificationActionBuilder.php index 3c37a228141..e11f1413e13 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDeleteDaysAfterLastModificationActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDeleteDaysAfterLastModificationActionBuilder.php @@ -21,11 +21,13 @@ final class ShoppingListSetDeleteDaysAfterLastModificationActionBuilder implements Builder { /** + * @var ?int */ private $deleteDaysAfterLastModification; /** + * @return null|int */ public function getDeleteDaysAfterLastModification() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDeleteDaysAfterLastModificationActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDeleteDaysAfterLastModificationActionModel.php index 3b3bc829d3e..720aa91d903 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDeleteDaysAfterLastModificationActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDeleteDaysAfterLastModificationActionModel.php @@ -21,11 +21,13 @@ final class ShoppingListSetDeleteDaysAfterLastModificationActionModel extends Js { public const DISCRIMINATOR_VALUE = 'setDeleteDaysAfterLastModification'; /** + * * @var ?string */ protected $action; /** + * * @var ?int */ protected $deleteDaysAfterLastModification; @@ -35,13 +37,15 @@ final class ShoppingListSetDeleteDaysAfterLastModificationActionModel extends Js * @psalm-suppress MissingParamType */ public function __construct( - ?int $deleteDaysAfterLastModification = null + ?int $deleteDaysAfterLastModification = null, + ?string $action = null ) { $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|int */ public function getDeleteDaysAfterLastModification() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDescriptionAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDescriptionAction.php index 96dd738ac28..36d1016971c 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDescriptionAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDescriptionAction.php @@ -17,6 +17,7 @@ interface ShoppingListSetDescriptionAction extends ShoppingListUpdateAction public const FIELD_DESCRIPTION = 'description'; /** + * @return null|LocalizedString */ public function getDescription(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDescriptionActionBuilder.php index 98fc5f745da..f4c18a84a3a 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDescriptionActionBuilder.php @@ -23,11 +23,13 @@ final class ShoppingListSetDescriptionActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDescriptionActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDescriptionActionModel.php index 2c46d1e6940..e7af298678b 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetDescriptionActionModel.php @@ -23,11 +23,13 @@ final class ShoppingListSetDescriptionActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'setDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $description; @@ -37,13 +39,15 @@ final class ShoppingListSetDescriptionActionModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $description = null + ?LocalizedString $description = null, + ?string $action = null ) { $this->description = $description; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetKeyAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetKeyAction.php index 57b8c3b4a50..3e63ff2a247 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetKeyAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetKeyAction.php @@ -18,6 +18,7 @@ interface ShoppingListSetKeyAction extends ShoppingListUpdateAction /** *

    User-specific unique identifier for the shopping list.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetKeyActionBuilder.php index 8da5d9fad52..3e39393c345 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetKeyActionBuilder.php @@ -21,6 +21,7 @@ final class ShoppingListSetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; @@ -28,6 +29,7 @@ final class ShoppingListSetKeyActionBuilder implements Builder /** *

    User-specific unique identifier for the shopping list.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetKeyActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetKeyActionModel.php index ade4fc1b511..7aa3328d492 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetKeyActionModel.php @@ -21,11 +21,13 @@ final class ShoppingListSetKeyActionModel extends JsonObjectModel implements Sho { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class ShoppingListSetKeyActionModel extends JsonObjectModel implements Sho * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    User-specific unique identifier for the shopping list.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldAction.php index f12b54b7ed9..2e6a7dafc8c 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldAction.php @@ -18,6 +18,7 @@ interface ShoppingListSetLineItemCustomFieldAction extends ShoppingListUpdateAct public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getLineItemId(); @@ -25,6 +26,7 @@ public function getLineItemId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -34,6 +36,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldActionBuilder.php index bfd7c982a59..3a2251d7df8 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class ShoppingListSetLineItemCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getLineItemId() @@ -46,6 +50,7 @@ public function getLineItemId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -58,6 +63,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldActionModel.php index 3e9701283ca..40a91abc683 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class ShoppingListSetLineItemCustomFieldActionModel extends JsonObjectMode { public const DISCRIMINATOR_VALUE = 'setLineItemCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class ShoppingListSetLineItemCustomFieldActionModel extends JsonObjectMode public function __construct( ?string $lineItemId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -92,6 +99,7 @@ public function getLineItemId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -113,6 +121,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeAction.php index 8598a3f3e6e..0acdad98c8e 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeAction.php @@ -20,6 +20,7 @@ interface ShoppingListSetLineItemCustomTypeAction extends ShoppingListUpdateActi public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getLineItemId(); @@ -28,6 +29,7 @@ public function getLineItemId(); *

    Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -35,6 +37,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the LineItem.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeActionBuilder.php index 9631bbbbf34..93c1708fdb5 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class ShoppingListSetLineItemCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $lineItemId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getLineItemId() @@ -51,6 +55,7 @@ public function getLineItemId() *

    Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -61,6 +66,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the LineItem.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeActionModel.php index f12b9bc79aa..06eb86e32d0 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeActionModel.php @@ -25,21 +25,25 @@ final class ShoppingListSetLineItemCustomTypeActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setLineItemCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -51,15 +55,17 @@ final class ShoppingListSetLineItemCustomTypeActionModel extends JsonObjectModel public function __construct( ?string $lineItemId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->lineItemId = $lineItemId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getLineItemId() @@ -97,6 +104,7 @@ public function getLineItemId() *

    Defines the Type that extends the LineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the LineItem.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the LineItem.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetSlugAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetSlugAction.php index e65ce88190a..af942894140 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetSlugAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetSlugAction.php @@ -17,6 +17,7 @@ interface ShoppingListSetSlugAction extends ShoppingListUpdateAction public const FIELD_SLUG = 'slug'; /** + * @return null|LocalizedString */ public function getSlug(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetSlugActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetSlugActionBuilder.php index 33502724ef5..d0f435e6034 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetSlugActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetSlugActionBuilder.php @@ -23,11 +23,13 @@ final class ShoppingListSetSlugActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @return null|LocalizedString */ public function getSlug() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetSlugActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetSlugActionModel.php index 217a6eb91ea..1e455f073b4 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetSlugActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetSlugActionModel.php @@ -23,11 +23,13 @@ final class ShoppingListSetSlugActionModel extends JsonObjectModel implements Sh { public const DISCRIMINATOR_VALUE = 'setSlug'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $slug; @@ -37,13 +39,15 @@ final class ShoppingListSetSlugActionModel extends JsonObjectModel implements Sh * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $slug = null + ?LocalizedString $slug = null, + ?string $action = null ) { $this->slug = $slug; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|LocalizedString */ public function getSlug() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetStoreAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetStoreAction.php index a0471a9dd3d..87a19469223 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetStoreAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetStoreAction.php @@ -17,6 +17,7 @@ interface ShoppingListSetStoreAction extends ShoppingListUpdateAction public const FIELD_STORE = 'store'; /** + * @return null|StoreResourceIdentifier */ public function getStore(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetStoreActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetStoreActionBuilder.php index 6caa7701a55..086c3029aaa 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetStoreActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetStoreActionBuilder.php @@ -23,11 +23,13 @@ final class ShoppingListSetStoreActionBuilder implements Builder { /** + * @var null|StoreResourceIdentifier|StoreResourceIdentifierBuilder */ private $store; /** + * @return null|StoreResourceIdentifier */ public function getStore() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetStoreActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetStoreActionModel.php index bb5cb51e49b..06e060569dd 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetStoreActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetStoreActionModel.php @@ -23,11 +23,13 @@ final class ShoppingListSetStoreActionModel extends JsonObjectModel implements S { public const DISCRIMINATOR_VALUE = 'setStore'; /** + * * @var ?string */ protected $action; /** + * * @var ?StoreResourceIdentifier */ protected $store; @@ -37,13 +39,15 @@ final class ShoppingListSetStoreActionModel extends JsonObjectModel implements S * @psalm-suppress MissingParamType */ public function __construct( - ?StoreResourceIdentifier $store = null + ?StoreResourceIdentifier $store = null, + ?string $action = null ) { $this->store = $store; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() } /** + * * @return null|StoreResourceIdentifier */ public function getStore() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldAction.php index 9ca6aa0447d..a7fe64883b7 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldAction.php @@ -18,6 +18,7 @@ interface ShoppingListSetTextLineItemCustomFieldAction extends ShoppingListUpdat public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getTextLineItemId(); @@ -25,6 +26,7 @@ public function getTextLineItemId(); /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -34,6 +36,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldActionBuilder.php index 7b2806e380b..5ba6e69cc9c 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldActionBuilder.php @@ -21,21 +21,25 @@ final class ShoppingListSetTextLineItemCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $textLineItemId; /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getTextLineItemId() @@ -46,6 +50,7 @@ public function getTextLineItemId() /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -58,6 +63,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldActionModel.php index 114842c5038..1a7c78910ed 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldActionModel.php @@ -21,21 +21,25 @@ final class ShoppingListSetTextLineItemCustomFieldActionModel extends JsonObject { public const DISCRIMINATOR_VALUE = 'setTextLineItemCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $textLineItemId; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -47,15 +51,17 @@ final class ShoppingListSetTextLineItemCustomFieldActionModel extends JsonObject public function __construct( ?string $textLineItemId = null, ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->textLineItemId = $textLineItemId; $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +79,7 @@ public function getAction() } /** + * * @return null|string */ public function getTextLineItemId() @@ -92,6 +99,7 @@ public function getTextLineItemId() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -113,6 +121,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeAction.php index d1e4cb5170b..da21492202b 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeAction.php @@ -20,6 +20,7 @@ interface ShoppingListSetTextLineItemCustomTypeAction extends ShoppingListUpdate public const FIELD_FIELDS = 'fields'; /** + * @return null|string */ public function getTextLineItemId(); @@ -28,6 +29,7 @@ public function getTextLineItemId(); *

    Defines the Type that extends the TextLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the TextLineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -35,6 +37,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the TextLineItem.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeActionBuilder.php index a094b9429e9..4a0e79a0215 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeActionBuilder.php @@ -25,21 +25,25 @@ final class ShoppingListSetTextLineItemCustomTypeActionBuilder implements Builder { /** + * @var ?string */ private $textLineItemId; /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; /** + * @return null|string */ public function getTextLineItemId() @@ -51,6 +55,7 @@ public function getTextLineItemId() *

    Defines the Type that extends the TextLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the TextLineItem.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -61,6 +66,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the TextLineItem.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeActionModel.php index 9b8f791d865..5a271e252b1 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeActionModel.php @@ -25,21 +25,25 @@ final class ShoppingListSetTextLineItemCustomTypeActionModel extends JsonObjectM { public const DISCRIMINATOR_VALUE = 'setTextLineItemCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $textLineItemId; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -51,15 +55,17 @@ final class ShoppingListSetTextLineItemCustomTypeActionModel extends JsonObjectM public function __construct( ?string $textLineItemId = null, ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->textLineItemId = $textLineItemId; $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -77,6 +83,7 @@ public function getAction() } /** + * * @return null|string */ public function getTextLineItemId() @@ -97,6 +104,7 @@ public function getTextLineItemId() *

    Defines the Type that extends the TextLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the TextLineItem.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -117,6 +125,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the TextLineItem.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionAction.php index 10c196d9576..a4a0269aae7 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionAction.php @@ -18,6 +18,7 @@ interface ShoppingListSetTextLineItemDescriptionAction extends ShoppingListUpdat public const FIELD_DESCRIPTION = 'description'; /** + * @return null|string */ public function getTextLineItemId(); @@ -25,6 +26,7 @@ public function getTextLineItemId(); /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getDescription(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionActionBuilder.php index 47f00fa57b7..cb4d55786ff 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionActionBuilder.php @@ -23,16 +23,19 @@ final class ShoppingListSetTextLineItemDescriptionActionBuilder implements Builder { /** + * @var ?string */ private $textLineItemId; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @return null|string */ public function getTextLineItemId() @@ -43,6 +46,7 @@ public function getTextLineItemId() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionActionModel.php index 60682a5df77..b09eeffecbd 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionActionModel.php @@ -23,16 +23,19 @@ final class ShoppingListSetTextLineItemDescriptionActionModel extends JsonObject { public const DISCRIMINATOR_VALUE = 'setTextLineItemDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $textLineItemId; /** + * * @var ?LocalizedString */ protected $description; @@ -43,14 +46,16 @@ final class ShoppingListSetTextLineItemDescriptionActionModel extends JsonObject */ public function __construct( ?string $textLineItemId = null, - ?LocalizedString $description = null + ?LocalizedString $description = null, + ?string $action = null ) { $this->textLineItemId = $textLineItemId; $this->description = $description; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() } /** + * * @return null|string */ public function getTextLineItemId() @@ -87,6 +93,7 @@ public function getTextLineItemId() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdate.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdate.php index 2e1fc1686c4..f5334afec16 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdate.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdate.php @@ -17,11 +17,13 @@ interface ShoppingListUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + * @return null|int */ public function getVersion(); /** + * @return null|ShoppingListUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdateAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdateAction.php index acb4c148bcc..5c15a93b173 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdateAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdateAction.php @@ -17,6 +17,7 @@ interface ShoppingListUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdateActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdateActionModel.php index a820261f382..46e76f6087a 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdateActionModel.php @@ -21,6 +21,7 @@ final class ShoppingListUpdateActionModel extends JsonObjectModel implements Sho { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -60,11 +61,13 @@ final class ShoppingListUpdateActionModel extends JsonObjectModel implements Sho * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdateBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdateBuilder.php index 50bf3f30318..226717835b5 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdateBuilder.php @@ -21,16 +21,19 @@ final class ShoppingListUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?ShoppingListUpdateActionCollection */ private $actions; /** + * @return null|int */ public function getVersion() @@ -39,6 +42,7 @@ public function getVersion() } /** + * @return null|ShoppingListUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdateModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdateModel.php index dec99b86fd7..5a726d592a9 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdateModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListUpdateModel.php @@ -20,11 +20,13 @@ final class ShoppingListUpdateModel extends JsonObjectModel implements ShoppingListUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?ShoppingListUpdateActionCollection */ protected $actions; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|int */ public function getVersion() @@ -59,6 +62,7 @@ public function getVersion() } /** + * * @return null|ShoppingListUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/ShoppingList/TextLineItem.php b/lib/commercetools-api/src/Models/ShoppingList/TextLineItem.php index cf82f47d39d..5b2c9195161 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/TextLineItem.php +++ b/lib/commercetools-api/src/Models/ShoppingList/TextLineItem.php @@ -26,16 +26,19 @@ interface TextLineItem extends JsonObject /** *

    When the text line item was added to the shopping list.

    * + * @return null|DateTimeImmutable */ public function getAddedAt(); /** + * @return null|CustomFields */ public function getCustom(); /** + * @return null|LocalizedString */ public function getDescription(); @@ -43,16 +46,19 @@ public function getDescription(); /** *

    Unique identifier of the TextLineItem.

    * + * @return null|string */ public function getId(); /** + * @return null|LocalizedString */ public function getName(); /** + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemBuilder.php index eb32be2e441..bd6f7463c32 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemBuilder.php @@ -26,31 +26,37 @@ final class TextLineItemBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $addedAt; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?string */ private $id; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?int */ private $quantity; @@ -58,6 +64,7 @@ final class TextLineItemBuilder implements Builder /** *

    When the text line item was added to the shopping list.

    * + * @return null|DateTimeImmutable */ public function getAddedAt() @@ -66,6 +73,7 @@ public function getAddedAt() } /** + * @return null|CustomFields */ public function getCustom() @@ -74,6 +82,7 @@ public function getCustom() } /** + * @return null|LocalizedString */ public function getDescription() @@ -84,6 +93,7 @@ public function getDescription() /** *

    Unique identifier of the TextLineItem.

    * + * @return null|string */ public function getId() @@ -92,6 +102,7 @@ public function getId() } /** + * @return null|LocalizedString */ public function getName() @@ -100,6 +111,7 @@ public function getName() } /** + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraft.php b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraft.php index 34184197d34..5d646151c91 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraft.php +++ b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraft.php @@ -25,6 +25,7 @@ interface TextLineItemDraft extends JsonObject /** *

    Defaults to the current date and time.

    * + * @return null|DateTimeImmutable */ public function getAddedAt(); @@ -32,16 +33,19 @@ public function getAddedAt(); /** *

    The custom fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); /** + * @return null|LocalizedString */ public function getDescription(); /** + * @return null|LocalizedString */ public function getName(); @@ -49,6 +53,7 @@ public function getName(); /** *

    Defaults to 1.

    * + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraftBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraftBuilder.php index b8f8b434178..c127737b6a6 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraftBuilder.php @@ -26,26 +26,31 @@ final class TextLineItemDraftBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $addedAt; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?int */ private $quantity; @@ -53,6 +58,7 @@ final class TextLineItemDraftBuilder implements Builder /** *

    Defaults to the current date and time.

    * + * @return null|DateTimeImmutable */ public function getAddedAt() @@ -63,6 +69,7 @@ public function getAddedAt() /** *

    The custom fields.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -71,6 +78,7 @@ public function getCustom() } /** + * @return null|LocalizedString */ public function getDescription() @@ -79,6 +87,7 @@ public function getDescription() } /** + * @return null|LocalizedString */ public function getName() @@ -89,6 +98,7 @@ public function getName() /** *

    Defaults to 1.

    * + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraftModel.php b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraftModel.php index 0509c4fd8cb..d6f0a78f600 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraftModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraftModel.php @@ -25,26 +25,31 @@ final class TextLineItemDraftModel extends JsonObjectModel implements TextLineItemDraft { /** + * * @var ?DateTimeImmutable */ protected $addedAt; /** + * * @var ?CustomFieldsDraft */ protected $custom; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?int */ protected $quantity; @@ -70,6 +75,7 @@ public function __construct( /** *

    Defaults to the current date and time.

    * + * * @return null|DateTimeImmutable */ public function getAddedAt() @@ -93,6 +99,7 @@ public function getAddedAt() /** *

    The custom fields.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -111,6 +118,7 @@ public function getCustom() } /** + * * @return null|LocalizedString */ public function getDescription() @@ -129,6 +137,7 @@ public function getDescription() } /** + * * @return null|LocalizedString */ public function getName() @@ -149,6 +158,7 @@ public function getName() /** *

    Defaults to 1.

    * + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemModel.php b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemModel.php index b6d8ad9cd53..0bb64d146e3 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemModel.php @@ -25,31 +25,37 @@ final class TextLineItemModel extends JsonObjectModel implements TextLineItem { /** + * * @var ?DateTimeImmutable */ protected $addedAt; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?string */ protected $id; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?int */ protected $quantity; @@ -77,6 +83,7 @@ public function __construct( /** *

    When the text line item was added to the shopping list.

    * + * * @return null|DateTimeImmutable */ public function getAddedAt() @@ -98,6 +105,7 @@ public function getAddedAt() } /** + * * @return null|CustomFields */ public function getCustom() @@ -116,6 +124,7 @@ public function getCustom() } /** + * * @return null|LocalizedString */ public function getDescription() @@ -136,6 +145,7 @@ public function getDescription() /** *

    Unique identifier of the TextLineItem.

    * + * * @return null|string */ public function getId() @@ -153,6 +163,7 @@ public function getId() } /** + * * @return null|LocalizedString */ public function getName() @@ -171,6 +182,7 @@ public function getName() } /** + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuote.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuote.php index f71d513eacb..f583626f468 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuote.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuote.php @@ -8,12 +8,14 @@ namespace Commercetools\Api\Models\StagedQuote; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; use Commercetools\Api\Models\Cart\CartReference; use Commercetools\Api\Models\Common\BaseResource; use Commercetools\Api\Models\Common\CreatedBy; use Commercetools\Api\Models\Common\LastModifiedBy; use Commercetools\Api\Models\Customer\CustomerReference; use Commercetools\Api\Models\QuoteRequest\QuoteRequestReference; +use Commercetools\Api\Models\State\StateReference; use Commercetools\Api\Models\Type\CustomFields; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -31,10 +33,13 @@ interface StagedQuote extends BaseResource public const FIELD_VALID_TO = 'validTo'; public const FIELD_SELLER_COMMENT = 'sellerComment'; public const FIELD_CUSTOM = 'custom'; + public const FIELD_STATE = 'state'; + public const FIELD_BUSINESS_UNIT = 'businessUnit'; /** *

    The unique ID of the StagedQuote.

    * + * @return null|string */ public function getId(); @@ -42,6 +47,7 @@ public function getId(); /** *

    Current version of the StagedQuote.

    * + * @return null|int */ public function getVersion(); @@ -49,6 +55,7 @@ public function getVersion(); /** *

    User-specific unique identifier of the staged quote.

    * + * @return null|string */ public function getKey(); @@ -56,6 +63,7 @@ public function getKey(); /** *

    Date and time (UTC) the StagedQuote was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -63,6 +71,7 @@ public function getCreatedAt(); /** *

    Date and time (UTC) the StagedQuote was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -70,6 +79,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -77,6 +87,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -84,52 +95,76 @@ public function getCreatedBy(); /** *

    Predefined states tracking the status of the Staged Quote.

    * + * @return null|string */ public function getStagedQuoteState(); /** - *

    The Buyer who requested the quote.

    + *

    The Buyer who requested the Quote.

    * + * @return null|CustomerReference */ public function getCustomer(); /** - *

    The Quote Request related to this Staged Quote.

    + *

    Quote Request related to the Staged Quote.

    * + * @return null|QuoteRequestReference */ public function getQuoteRequest(); /** - *

    The Cart containing the offered items.

    + *

    Cart containing the offered items. May contain either DirectDiscounts or CartDiscounts.

    * + * @return null|CartReference */ public function getQuotationCart(); /** - *

    Expiration date for the quote.

    + *

    Expiration date for the Quote.

    * + * @return null|DateTimeImmutable */ public function getValidTo(); /** - *

    The text message included in the offer from the Seller.

    + *

    Message from the Seller included in the offer.

    * + * @return null|string */ public function getSellerComment(); /** - *

    Custom Fields of this Staged Quote.

    + *

    Custom Fields of the Staged Quote.

    * + * @return null|CustomFields */ public function getCustom(); + /** + *

    State of the Staged Quote. + * This reference can point to a State in a custom workflow.

    + * + + * @return null|StateReference + */ + public function getState(); + + /** + *

    The BusinessUnit for the Staged Quote.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit(); + /** * @param ?string $id */ @@ -199,4 +234,14 @@ public function setSellerComment(?string $sellerComment): void; * @param ?CustomFields $custom */ public function setCustom(?CustomFields $custom): void; + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void; + + /** + * @param ?BusinessUnitKeyReference $businessUnit + */ + public function setBusinessUnit(?BusinessUnitKeyReference $businessUnit): void; } diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteBuilder.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteBuilder.php index 43b7238ac8d..f283d20fec7 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteBuilder.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteBuilder.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\StagedQuote; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceBuilder; use Commercetools\Api\Models\Cart\CartReference; use Commercetools\Api\Models\Cart\CartReferenceBuilder; use Commercetools\Api\Models\Common\BaseResource; @@ -20,6 +22,8 @@ use Commercetools\Api\Models\Customer\CustomerReferenceBuilder; use Commercetools\Api\Models\QuoteRequest\QuoteRequestReference; use Commercetools\Api\Models\QuoteRequest\QuoteRequestReferenceBuilder; +use Commercetools\Api\Models\State\StateReference; +use Commercetools\Api\Models\State\StateReferenceBuilder; use Commercetools\Api\Models\Type\CustomFields; use Commercetools\Api\Models\Type\CustomFieldsBuilder; use Commercetools\Base\Builder; @@ -36,78 +40,105 @@ final class StagedQuoteBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var ?string */ private $key; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $stagedQuoteState; /** + * @var null|CustomerReference|CustomerReferenceBuilder */ private $customer; /** + * @var null|QuoteRequestReference|QuoteRequestReferenceBuilder */ private $quoteRequest; /** + * @var null|CartReference|CartReferenceBuilder */ private $quotationCart; /** + * @var ?DateTimeImmutable */ private $validTo; /** + * @var ?string */ private $sellerComment; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; + /** + + * @var null|StateReference|StateReferenceBuilder + */ + private $state; + + /** + + * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder + */ + private $businessUnit; + /** *

    The unique ID of the StagedQuote.

    * + * @return null|string */ public function getId() @@ -118,6 +149,7 @@ public function getId() /** *

    Current version of the StagedQuote.

    * + * @return null|int */ public function getVersion() @@ -128,6 +160,7 @@ public function getVersion() /** *

    Date and time (UTC) the StagedQuote was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -138,6 +171,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the StagedQuote was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -148,6 +182,7 @@ public function getLastModifiedAt() /** *

    User-specific unique identifier of the staged quote.

    * + * @return null|string */ public function getKey() @@ -158,6 +193,7 @@ public function getKey() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -168,6 +204,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -178,6 +215,7 @@ public function getCreatedBy() /** *

    Predefined states tracking the status of the Staged Quote.

    * + * @return null|string */ public function getStagedQuoteState() @@ -186,8 +224,9 @@ public function getStagedQuoteState() } /** - *

    The Buyer who requested the quote.

    + *

    The Buyer who requested the Quote.

    * + * @return null|CustomerReference */ public function getCustomer() @@ -196,8 +235,9 @@ public function getCustomer() } /** - *

    The Quote Request related to this Staged Quote.

    + *

    Quote Request related to the Staged Quote.

    * + * @return null|QuoteRequestReference */ public function getQuoteRequest() @@ -206,8 +246,9 @@ public function getQuoteRequest() } /** - *

    The Cart containing the offered items.

    + *

    Cart containing the offered items. May contain either DirectDiscounts or CartDiscounts.

    * + * @return null|CartReference */ public function getQuotationCart() @@ -216,8 +257,9 @@ public function getQuotationCart() } /** - *

    Expiration date for the quote.

    + *

    Expiration date for the Quote.

    * + * @return null|DateTimeImmutable */ public function getValidTo() @@ -226,8 +268,9 @@ public function getValidTo() } /** - *

    The text message included in the offer from the Seller.

    + *

    Message from the Seller included in the offer.

    * + * @return null|string */ public function getSellerComment() @@ -236,8 +279,9 @@ public function getSellerComment() } /** - *

    Custom Fields of this Staged Quote.

    + *

    Custom Fields of the Staged Quote.

    * + * @return null|CustomFields */ public function getCustom() @@ -245,6 +289,29 @@ public function getCustom() return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; } + /** + *

    State of the Staged Quote. + * This reference can point to a State in a custom workflow.

    + * + + * @return null|StateReference + */ + public function getState() + { + return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; + } + + /** + *

    The BusinessUnit for the Staged Quote.

    + * + + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit() + { + return $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit; + } + /** * @param ?string $id * @return $this @@ -399,6 +466,28 @@ public function withCustom(?CustomFields $custom) return $this; } + /** + * @param ?StateReference $state + * @return $this + */ + public function withState(?StateReference $state) + { + $this->state = $state; + + return $this; + } + + /** + * @param ?BusinessUnitKeyReference $businessUnit + * @return $this + */ + public function withBusinessUnit(?BusinessUnitKeyReference $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -465,6 +554,28 @@ public function withCustomBuilder(?CustomFieldsBuilder $custom) return $this; } + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateReferenceBuilder $state) + { + $this->state = $state; + + return $this; + } + + /** + * @deprecated use withBusinessUnit() instead + * @return $this + */ + public function withBusinessUnitBuilder(?BusinessUnitKeyReferenceBuilder $businessUnit) + { + $this->businessUnit = $businessUnit; + + return $this; + } + public function build(): StagedQuote { return new StagedQuoteModel( @@ -481,7 +592,9 @@ public function build(): StagedQuote $this->quotationCart instanceof CartReferenceBuilder ? $this->quotationCart->build() : $this->quotationCart, $this->validTo, $this->sellerComment, - $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom + $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, + $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state, + $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit ); } diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteChangeStagedQuoteStateAction.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteChangeStagedQuoteStateAction.php index 013d5f38ccb..9d03ddf04f1 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteChangeStagedQuoteStateAction.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteChangeStagedQuoteStateAction.php @@ -16,8 +16,9 @@ interface StagedQuoteChangeStagedQuoteStateAction extends StagedQuoteUpdateActio public const FIELD_STAGED_QUOTE_STATE = 'stagedQuoteState'; /** - *

    The new quote staged state to be set for the Quote Staged.

    + *

    New state to be set for the Staged Quote.

    * + * @return null|string */ public function getStagedQuoteState(); diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteChangeStagedQuoteStateActionBuilder.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteChangeStagedQuoteStateActionBuilder.php index 9cac674f341..d42a39fbee5 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteChangeStagedQuoteStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteChangeStagedQuoteStateActionBuilder.php @@ -21,13 +21,15 @@ final class StagedQuoteChangeStagedQuoteStateActionBuilder implements Builder { /** + * @var ?string */ private $stagedQuoteState; /** - *

    The new quote staged state to be set for the Quote Staged.

    + *

    New state to be set for the Staged Quote.

    * + * @return null|string */ public function getStagedQuoteState() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteChangeStagedQuoteStateActionModel.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteChangeStagedQuoteStateActionModel.php index 6fff9ae33bf..e731e7ba827 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteChangeStagedQuoteStateActionModel.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteChangeStagedQuoteStateActionModel.php @@ -21,11 +21,13 @@ final class StagedQuoteChangeStagedQuoteStateActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'changeStagedQuoteState'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $stagedQuoteState; @@ -35,13 +37,15 @@ final class StagedQuoteChangeStagedQuoteStateActionModel extends JsonObjectModel * @psalm-suppress MissingParamType */ public function __construct( - ?string $stagedQuoteState = null + ?string $stagedQuoteState = null, + ?string $action = null ) { $this->stagedQuoteState = $stagedQuoteState; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,7 +63,8 @@ public function getAction() } /** - *

    The new quote staged state to be set for the Quote Staged.

    + *

    New state to be set for the Staged Quote.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteDraft.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteDraft.php index 688c4ba4724..2b341b81551 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteDraft.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteDraft.php @@ -9,6 +9,7 @@ namespace Commercetools\Api\Models\StagedQuote; use Commercetools\Api\Models\QuoteRequest\QuoteRequestResourceIdentifier; +use Commercetools\Api\Models\State\StateReference; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -17,12 +18,15 @@ interface StagedQuoteDraft extends JsonObject { public const FIELD_QUOTE_REQUEST = 'quoteRequest'; public const FIELD_QUOTE_REQUEST_VERSION = 'quoteRequestVersion'; + public const FIELD_QUOTE_REQUEST_STATE_TO_ACCEPTED = 'quoteRequestStateToAccepted'; public const FIELD_KEY = 'key'; public const FIELD_CUSTOM = 'custom'; + public const FIELD_STATE = 'state'; /** - *

    The QuoteRequest from which this StagedQuote is created.

    + *

    QuoteRequest from which the StagedQuote is created.

    * + * @return null|QuoteRequestResourceIdentifier */ public function getQuoteRequest(); @@ -30,13 +34,23 @@ public function getQuoteRequest(); /** *

    Current version of the QuoteRequest.

    * + * @return null|int */ public function getQuoteRequestVersion(); + /** + *

    If true, the quoteRequestState of the referenced QuoteRequest will be set to Accepted.

    + * + + * @return null|bool + */ + public function getQuoteRequestStateToAccepted(); + /** *

    User-defined unique identifier for the StagedQuote.

    * + * @return null|string */ public function getKey(); @@ -48,10 +62,20 @@ public function getKey(); *
  • If empty, the Custom Fields on the referenced QuoteRequest are added to the StagedQuote automatically.
  • * * + * @return null|CustomFieldsDraft */ public function getCustom(); + /** + *

    State of the Staged Quote. + * This reference can point to a State in a custom workflow.

    + * + + * @return null|StateReference + */ + public function getState(); + /** * @param ?QuoteRequestResourceIdentifier $quoteRequest */ @@ -62,6 +86,11 @@ public function setQuoteRequest(?QuoteRequestResourceIdentifier $quoteRequest): */ public function setQuoteRequestVersion(?int $quoteRequestVersion): void; + /** + * @param ?bool $quoteRequestStateToAccepted + */ + public function setQuoteRequestStateToAccepted(?bool $quoteRequestStateToAccepted): void; + /** * @param ?string $key */ @@ -71,4 +100,9 @@ public function setKey(?string $key): void; * @param ?CustomFieldsDraft $custom */ public function setCustom(?CustomFieldsDraft $custom): void; + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void; } diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteDraftBuilder.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteDraftBuilder.php index bdbff0df402..089b2447423 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteDraftBuilder.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteDraftBuilder.php @@ -10,6 +10,8 @@ use Commercetools\Api\Models\QuoteRequest\QuoteRequestResourceIdentifier; use Commercetools\Api\Models\QuoteRequest\QuoteRequestResourceIdentifierBuilder; +use Commercetools\Api\Models\State\StateReference; +use Commercetools\Api\Models\State\StateReferenceBuilder; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Api\Models\Type\CustomFieldsDraftBuilder; use Commercetools\Base\Builder; @@ -25,28 +27,45 @@ final class StagedQuoteDraftBuilder implements Builder { /** + * @var null|QuoteRequestResourceIdentifier|QuoteRequestResourceIdentifierBuilder */ private $quoteRequest; /** + * @var ?int */ private $quoteRequestVersion; /** + + * @var ?bool + */ + private $quoteRequestStateToAccepted; + + /** + * @var ?string */ private $key; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; /** - *

    The QuoteRequest from which this StagedQuote is created.

    + + * @var null|StateReference|StateReferenceBuilder + */ + private $state; + + /** + *

    QuoteRequest from which the StagedQuote is created.

    * + * @return null|QuoteRequestResourceIdentifier */ public function getQuoteRequest() @@ -57,6 +76,7 @@ public function getQuoteRequest() /** *

    Current version of the QuoteRequest.

    * + * @return null|int */ public function getQuoteRequestVersion() @@ -64,9 +84,21 @@ public function getQuoteRequestVersion() return $this->quoteRequestVersion; } + /** + *

    If true, the quoteRequestState of the referenced QuoteRequest will be set to Accepted.

    + * + + * @return null|bool + */ + public function getQuoteRequestStateToAccepted() + { + return $this->quoteRequestStateToAccepted; + } + /** *

    User-defined unique identifier for the StagedQuote.

    * + * @return null|string */ public function getKey() @@ -81,6 +113,7 @@ public function getKey() *
  • If empty, the Custom Fields on the referenced QuoteRequest are added to the StagedQuote automatically.
  • * * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -88,6 +121,18 @@ public function getCustom() return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } + /** + *

    State of the Staged Quote. + * This reference can point to a State in a custom workflow.

    + * + + * @return null|StateReference + */ + public function getState() + { + return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; + } + /** * @param ?QuoteRequestResourceIdentifier $quoteRequest * @return $this @@ -110,6 +155,17 @@ public function withQuoteRequestVersion(?int $quoteRequestVersion) return $this; } + /** + * @param ?bool $quoteRequestStateToAccepted + * @return $this + */ + public function withQuoteRequestStateToAccepted(?bool $quoteRequestStateToAccepted) + { + $this->quoteRequestStateToAccepted = $quoteRequestStateToAccepted; + + return $this; + } + /** * @param ?string $key * @return $this @@ -132,6 +188,17 @@ public function withCustom(?CustomFieldsDraft $custom) return $this; } + /** + * @param ?StateReference $state + * @return $this + */ + public function withState(?StateReference $state) + { + $this->state = $state; + + return $this; + } + /** * @deprecated use withQuoteRequest() instead * @return $this @@ -154,13 +221,26 @@ public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) return $this; } + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateReferenceBuilder $state) + { + $this->state = $state; + + return $this; + } + public function build(): StagedQuoteDraft { return new StagedQuoteDraftModel( $this->quoteRequest instanceof QuoteRequestResourceIdentifierBuilder ? $this->quoteRequest->build() : $this->quoteRequest, $this->quoteRequestVersion, + $this->quoteRequestStateToAccepted, $this->key, - $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, + $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state ); } diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteDraftModel.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteDraftModel.php index 6bdf5ba44ce..0fbf9aa7bf6 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteDraftModel.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteDraftModel.php @@ -10,6 +10,8 @@ use Commercetools\Api\Models\QuoteRequest\QuoteRequestResourceIdentifier; use Commercetools\Api\Models\QuoteRequest\QuoteRequestResourceIdentifierModel; +use Commercetools\Api\Models\State\StateReference; +use Commercetools\Api\Models\State\StateReferenceModel; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Api\Models\Type\CustomFieldsDraftModel; use Commercetools\Base\DateTimeImmutableCollection; @@ -24,25 +26,41 @@ final class StagedQuoteDraftModel extends JsonObjectModel implements StagedQuoteDraft { /** + * * @var ?QuoteRequestResourceIdentifier */ protected $quoteRequest; /** + * * @var ?int */ protected $quoteRequestVersion; /** + * + * @var ?bool + */ + protected $quoteRequestStateToAccepted; + + /** + * * @var ?string */ protected $key; /** + * * @var ?CustomFieldsDraft */ protected $custom; + /** + * + * @var ?StateReference + */ + protected $state; + /** * @psalm-suppress MissingParamType @@ -50,17 +68,22 @@ final class StagedQuoteDraftModel extends JsonObjectModel implements StagedQuote public function __construct( ?QuoteRequestResourceIdentifier $quoteRequest = null, ?int $quoteRequestVersion = null, + ?bool $quoteRequestStateToAccepted = null, ?string $key = null, - ?CustomFieldsDraft $custom = null + ?CustomFieldsDraft $custom = null, + ?StateReference $state = null ) { $this->quoteRequest = $quoteRequest; $this->quoteRequestVersion = $quoteRequestVersion; + $this->quoteRequestStateToAccepted = $quoteRequestStateToAccepted; $this->key = $key; $this->custom = $custom; + $this->state = $state; } /** - *

    The QuoteRequest from which this StagedQuote is created.

    + *

    QuoteRequest from which the StagedQuote is created.

    + * * * @return null|QuoteRequestResourceIdentifier */ @@ -82,6 +105,7 @@ public function getQuoteRequest() /** *

    Current version of the QuoteRequest.

    * + * * @return null|int */ public function getQuoteRequestVersion() @@ -98,9 +122,30 @@ public function getQuoteRequestVersion() return $this->quoteRequestVersion; } + /** + *

    If true, the quoteRequestState of the referenced QuoteRequest will be set to Accepted.

    + * + * + * @return null|bool + */ + public function getQuoteRequestStateToAccepted() + { + if (is_null($this->quoteRequestStateToAccepted)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_QUOTE_REQUEST_STATE_TO_ACCEPTED); + if (is_null($data)) { + return null; + } + $this->quoteRequestStateToAccepted = (bool) $data; + } + + return $this->quoteRequestStateToAccepted; + } + /** *

    User-defined unique identifier for the StagedQuote.

    * + * * @return null|string */ public function getKey() @@ -124,6 +169,7 @@ public function getKey() *
  • If empty, the Custom Fields on the referenced QuoteRequest are added to the StagedQuote automatically.
  • * * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -141,6 +187,28 @@ public function getCustom() return $this->custom; } + /** + *

    State of the Staged Quote. + * This reference can point to a State in a custom workflow.

    + * + * + * @return null|StateReference + */ + public function getState() + { + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); + if (is_null($data)) { + return null; + } + + $this->state = StateReferenceModel::of($data); + } + + return $this->state; + } + /** * @param ?QuoteRequestResourceIdentifier $quoteRequest @@ -158,6 +226,14 @@ public function setQuoteRequestVersion(?int $quoteRequestVersion): void $this->quoteRequestVersion = $quoteRequestVersion; } + /** + * @param ?bool $quoteRequestStateToAccepted + */ + public function setQuoteRequestStateToAccepted(?bool $quoteRequestStateToAccepted): void + { + $this->quoteRequestStateToAccepted = $quoteRequestStateToAccepted; + } + /** * @param ?string $key */ @@ -173,4 +249,12 @@ public function setCustom(?CustomFieldsDraft $custom): void { $this->custom = $custom; } + + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void + { + $this->state = $state; + } } diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteModel.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteModel.php index f8abd0ebc5a..ac44fd74723 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteModel.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteModel.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Models\StagedQuote; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceModel; use Commercetools\Api\Models\Cart\CartReference; use Commercetools\Api\Models\Cart\CartReferenceModel; use Commercetools\Api\Models\Common\BaseResource; @@ -20,6 +22,8 @@ use Commercetools\Api\Models\Customer\CustomerReferenceModel; use Commercetools\Api\Models\QuoteRequest\QuoteRequestReference; use Commercetools\Api\Models\QuoteRequest\QuoteRequestReferenceModel; +use Commercetools\Api\Models\State\StateReference; +use Commercetools\Api\Models\State\StateReferenceModel; use Commercetools\Api\Models\Type\CustomFields; use Commercetools\Api\Models\Type\CustomFieldsModel; use Commercetools\Base\DateTimeImmutableCollection; @@ -35,75 +39,101 @@ final class StagedQuoteModel extends JsonObjectModel implements StagedQuote { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?string */ protected $key; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $stagedQuoteState; /** + * * @var ?CustomerReference */ protected $customer; /** + * * @var ?QuoteRequestReference */ protected $quoteRequest; /** + * * @var ?CartReference */ protected $quotationCart; /** + * * @var ?DateTimeImmutable */ protected $validTo; /** + * * @var ?string */ protected $sellerComment; /** + * * @var ?CustomFields */ protected $custom; + /** + * + * @var ?StateReference + */ + protected $state; + + /** + * + * @var ?BusinessUnitKeyReference + */ + protected $businessUnit; + /** * @psalm-suppress MissingParamType @@ -122,7 +152,9 @@ public function __construct( ?CartReference $quotationCart = null, ?DateTimeImmutable $validTo = null, ?string $sellerComment = null, - ?CustomFields $custom = null + ?CustomFields $custom = null, + ?StateReference $state = null, + ?BusinessUnitKeyReference $businessUnit = null ) { $this->id = $id; $this->version = $version; @@ -138,11 +170,14 @@ public function __construct( $this->validTo = $validTo; $this->sellerComment = $sellerComment; $this->custom = $custom; + $this->state = $state; + $this->businessUnit = $businessUnit; } /** *

    The unique ID of the StagedQuote.

    * + * * @return null|string */ public function getId() @@ -162,6 +197,7 @@ public function getId() /** *

    Current version of the StagedQuote.

    * + * * @return null|int */ public function getVersion() @@ -181,6 +217,7 @@ public function getVersion() /** *

    Date and time (UTC) the StagedQuote was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -204,6 +241,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the StagedQuote was last updated.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -227,6 +265,7 @@ public function getLastModifiedAt() /** *

    User-specific unique identifier of the staged quote.

    * + * * @return null|string */ public function getKey() @@ -246,6 +285,7 @@ public function getKey() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -266,6 +306,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -286,6 +327,7 @@ public function getCreatedBy() /** *

    Predefined states tracking the status of the Staged Quote.

    * + * * @return null|string */ public function getStagedQuoteState() @@ -303,7 +345,8 @@ public function getStagedQuoteState() } /** - *

    The Buyer who requested the quote.

    + *

    The Buyer who requested the Quote.

    + * * * @return null|CustomerReference */ @@ -323,7 +366,8 @@ public function getCustomer() } /** - *

    The Quote Request related to this Staged Quote.

    + *

    Quote Request related to the Staged Quote.

    + * * * @return null|QuoteRequestReference */ @@ -343,7 +387,8 @@ public function getQuoteRequest() } /** - *

    The Cart containing the offered items.

    + *

    Cart containing the offered items. May contain either DirectDiscounts or CartDiscounts.

    + * * * @return null|CartReference */ @@ -363,7 +408,8 @@ public function getQuotationCart() } /** - *

    Expiration date for the quote.

    + *

    Expiration date for the Quote.

    + * * * @return null|DateTimeImmutable */ @@ -386,7 +432,8 @@ public function getValidTo() } /** - *

    The text message included in the offer from the Seller.

    + *

    Message from the Seller included in the offer.

    + * * * @return null|string */ @@ -405,7 +452,8 @@ public function getSellerComment() } /** - *

    Custom Fields of this Staged Quote.

    + *

    Custom Fields of the Staged Quote.

    + * * * @return null|CustomFields */ @@ -424,6 +472,49 @@ public function getCustom() return $this->custom; } + /** + *

    State of the Staged Quote. + * This reference can point to a State in a custom workflow.

    + * + * + * @return null|StateReference + */ + public function getState() + { + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); + if (is_null($data)) { + return null; + } + + $this->state = StateReferenceModel::of($data); + } + + return $this->state; + } + + /** + *

    The BusinessUnit for the Staged Quote.

    + * + * + * @return null|BusinessUnitKeyReference + */ + public function getBusinessUnit() + { + if (is_null($this->businessUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BUSINESS_UNIT); + if (is_null($data)) { + return null; + } + + $this->businessUnit = BusinessUnitKeyReferenceModel::of($data); + } + + return $this->businessUnit; + } + /** * @param ?string $id @@ -537,6 +628,22 @@ public function setCustom(?CustomFields $custom): void $this->custom = $custom; } + /** + * @param ?StateReference $state + */ + public function setState(?StateReference $state): void + { + $this->state = $state; + } + + /** + * @param ?BusinessUnitKeyReference $businessUnit + */ + public function setBusinessUnit(?BusinessUnitKeyReference $businessUnit): void + { + $this->businessUnit = $businessUnit; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuotePagedQueryResponse.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuotePagedQueryResponse.php index ea88e63b819..6bced8342a8 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuotePagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuotePagedQueryResponse.php @@ -22,6 +22,7 @@ interface StagedQuotePagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    Staged Quotes matching the query.

    * + * @return null|StagedQuoteCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuotePagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuotePagedQueryResponseBuilder.php index ae8a457d477..552b79e078c 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuotePagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuotePagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class StagedQuotePagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?StagedQuoteCollection */ private $results; @@ -48,6 +53,7 @@ final class StagedQuotePagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    Staged Quotes matching the query.

    * + * @return null|StagedQuoteCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuotePagedQueryResponseModel.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuotePagedQueryResponseModel.php index 6e14c0dbfbf..acd4edba28b 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuotePagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuotePagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class StagedQuotePagedQueryResponseModel extends JsonObjectModel implements StagedQuotePagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?StagedQuoteCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    Staged Quotes matching the query.

    * + * * @return null|StagedQuoteCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteReference.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteReference.php index ae9aef2898c..0995b0962be 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteReference.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteReference.php @@ -20,6 +20,7 @@ interface StagedQuoteReference extends Reference *

    Contains the representation of the expanded StagedQuote. * Only present in responses to requests with Reference Expansion for StagedQuote.

    * + * @return null|StagedQuote */ public function getObj(); diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteReferenceBuilder.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteReferenceBuilder.php index 822c56ba6df..2edfed920e8 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteReferenceBuilder.php @@ -23,11 +23,13 @@ final class StagedQuoteReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|StagedQuote|StagedQuoteBuilder */ private $obj; @@ -35,6 +37,7 @@ final class StagedQuoteReferenceBuilder implements Builder /** *

    Unique ID of the referenced resource.

    * + * @return null|string */ public function getId() @@ -46,6 +49,7 @@ public function getId() *

    Contains the representation of the expanded StagedQuote. * Only present in responses to requests with Reference Expansion for StagedQuote.

    * + * @return null|StagedQuote */ public function getObj() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteReferenceModel.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteReferenceModel.php index add8e82337a..149d511e956 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteReferenceModel.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteReferenceModel.php @@ -23,16 +23,19 @@ final class StagedQuoteReferenceModel extends JsonObjectModel implements StagedQ { public const DISCRIMINATOR_VALUE = 'staged-quote'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?StagedQuote */ protected $obj; @@ -43,16 +46,18 @@ final class StagedQuoteReferenceModel extends JsonObjectModel implements StagedQ */ public function __construct( ?string $id = null, - ?StagedQuote $obj = null + ?StagedQuote $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique ID of the referenced resource.

    * + * * @return null|string */ public function getId() @@ -92,6 +98,7 @@ public function getId() *

    Contains the representation of the expanded StagedQuote. * Only present in responses to requests with Reference Expansion for StagedQuote.

    * + * * @return null|StagedQuote */ public function getObj() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteResourceIdentifierBuilder.php index 21bcd4c74b7..64f380a244d 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class StagedQuoteResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class StagedQuoteResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced resource. Required if key is absent.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced resource. Required if id is absent.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteResourceIdentifierModel.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteResourceIdentifierModel.php index 039c25ea9e0..b26b51a7b73 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class StagedQuoteResourceIdentifierModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'staged-quote'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class StagedQuoteResourceIdentifierModel extends JsonObjectModel implement */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced resource. Required if key is absent.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced resource. Required if id is absent.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomFieldAction.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomFieldAction.php index b9eb20a5b1d..5130fb57d0d 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface StagedQuoteSetCustomFieldAction extends StagedQuoteUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomFieldActionBuilder.php index a099cf987eb..8b176d61678 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class StagedQuoteSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class StagedQuoteSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomFieldActionModel.php index 42e1dba340c..924909a404a 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class StagedQuoteSetCustomFieldActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class StagedQuoteSetCustomFieldActionModel extends JsonObjectModel impleme */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomTypeAction.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomTypeAction.php index 9600db0d299..a1650617be0 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface StagedQuoteSetCustomTypeAction extends StagedQuoteUpdateAction *

    Defines the Type that extends the StagedQuote with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the StagedQuote.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the StagedQuote.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomTypeActionBuilder.php index d12a29672e4..1888a318376 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class StagedQuoteSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class StagedQuoteSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the StagedQuote with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the StagedQuote.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the StagedQuote.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomTypeActionModel.php index 6064ef4067a..13f7f8fb867 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class StagedQuoteSetCustomTypeActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class StagedQuoteSetCustomTypeActionModel extends JsonObjectModel implemen */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the StagedQuote with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the StagedQuote.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the StagedQuote.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetSellerCommentAction.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetSellerCommentAction.php index 98c87669da3..9dc2f7cb64a 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetSellerCommentAction.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetSellerCommentAction.php @@ -18,6 +18,7 @@ interface StagedQuoteSetSellerCommentAction extends StagedQuoteUpdateAction /** *

    If sellerComment is absent or null, this field will be removed if it exists.

    * + * @return null|string */ public function getSellerComment(); diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetSellerCommentActionBuilder.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetSellerCommentActionBuilder.php index 16083c7d2fa..116f2e3a17b 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetSellerCommentActionBuilder.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetSellerCommentActionBuilder.php @@ -21,6 +21,7 @@ final class StagedQuoteSetSellerCommentActionBuilder implements Builder { /** + * @var ?string */ private $sellerComment; @@ -28,6 +29,7 @@ final class StagedQuoteSetSellerCommentActionBuilder implements Builder /** *

    If sellerComment is absent or null, this field will be removed if it exists.

    * + * @return null|string */ public function getSellerComment() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetSellerCommentActionModel.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetSellerCommentActionModel.php index 35b01d3f284..89668489e50 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetSellerCommentActionModel.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetSellerCommentActionModel.php @@ -21,11 +21,13 @@ final class StagedQuoteSetSellerCommentActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'setSellerComment'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $sellerComment; @@ -35,13 +37,15 @@ final class StagedQuoteSetSellerCommentActionModel extends JsonObjectModel imple * @psalm-suppress MissingParamType */ public function __construct( - ?string $sellerComment = null + ?string $sellerComment = null, + ?string $action = null ) { $this->sellerComment = $sellerComment; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    If sellerComment is absent or null, this field will be removed if it exists.

    * + * * @return null|string */ public function getSellerComment() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetValidToAction.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetValidToAction.php index 1435fafa59b..ad9e267361e 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetValidToAction.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetValidToAction.php @@ -19,6 +19,7 @@ interface StagedQuoteSetValidToAction extends StagedQuoteUpdateAction /** *

    If validTo is absent or null, this field will be removed if it exists.

    * + * @return null|DateTimeImmutable */ public function getValidTo(); diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetValidToActionBuilder.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetValidToActionBuilder.php index fa7bbd6e3d9..9c51f0624dc 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetValidToActionBuilder.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetValidToActionBuilder.php @@ -22,6 +22,7 @@ final class StagedQuoteSetValidToActionBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $validTo; @@ -29,6 +30,7 @@ final class StagedQuoteSetValidToActionBuilder implements Builder /** *

    If validTo is absent or null, this field will be removed if it exists.

    * + * @return null|DateTimeImmutable */ public function getValidTo() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetValidToActionModel.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetValidToActionModel.php index 46063fb44fb..08228aafaed 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetValidToActionModel.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteSetValidToActionModel.php @@ -22,11 +22,13 @@ final class StagedQuoteSetValidToActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setValidTo'; /** + * * @var ?string */ protected $action; /** + * * @var ?DateTimeImmutable */ protected $validTo; @@ -36,13 +38,15 @@ final class StagedQuoteSetValidToActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutable $validTo = null + ?DateTimeImmutable $validTo = null, + ?string $action = null ) { $this->validTo = $validTo; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() /** *

    If validTo is absent or null, this field will be removed if it exists.

    * + * * @return null|DateTimeImmutable */ public function getValidTo() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteTransitionStateAction.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteTransitionStateAction.php new file mode 100644 index 00000000000..a17de8b085d --- /dev/null +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteTransitionStateAction.php @@ -0,0 +1,46 @@ +Value to set. + * If there is no State yet, the new State must be an initial State.

    + * + + * @return null|StateResourceIdentifier + */ + public function getState(); + + /** + *

    Switch validations on or off.

    + * + + * @return null|bool + */ + public function getForce(); + + /** + * @param ?StateResourceIdentifier $state + */ + public function setState(?StateResourceIdentifier $state): void; + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void; +} diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteTransitionStateActionBuilder.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteTransitionStateActionBuilder.php new file mode 100644 index 00000000000..3c2375620c0 --- /dev/null +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteTransitionStateActionBuilder.php @@ -0,0 +1,105 @@ + + */ +final class StagedQuoteTransitionStateActionBuilder implements Builder +{ + /** + + * @var null|StateResourceIdentifier|StateResourceIdentifierBuilder + */ + private $state; + + /** + + * @var ?bool + */ + private $force; + + /** + *

    Value to set. + * If there is no State yet, the new State must be an initial State.

    + * + + * @return null|StateResourceIdentifier + */ + public function getState() + { + return $this->state instanceof StateResourceIdentifierBuilder ? $this->state->build() : $this->state; + } + + /** + *

    Switch validations on or off.

    + * + + * @return null|bool + */ + public function getForce() + { + return $this->force; + } + + /** + * @param ?StateResourceIdentifier $state + * @return $this + */ + public function withState(?StateResourceIdentifier $state) + { + $this->state = $state; + + return $this; + } + + /** + * @param ?bool $force + * @return $this + */ + public function withForce(?bool $force) + { + $this->force = $force; + + return $this; + } + + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateResourceIdentifierBuilder $state) + { + $this->state = $state; + + return $this; + } + + public function build(): StagedQuoteTransitionStateAction + { + return new StagedQuoteTransitionStateActionModel( + $this->state instanceof StateResourceIdentifierBuilder ? $this->state->build() : $this->state, + $this->force + ); + } + + public static function of(): StagedQuoteTransitionStateActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteTransitionStateActionCollection.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteTransitionStateActionCollection.php new file mode 100644 index 00000000000..22b72c1ba8f --- /dev/null +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteTransitionStateActionCollection.php @@ -0,0 +1,56 @@ + + * @method StagedQuoteTransitionStateAction current() + * @method StagedQuoteTransitionStateAction end() + * @method StagedQuoteTransitionStateAction at($offset) + */ +class StagedQuoteTransitionStateActionCollection extends StagedQuoteUpdateActionCollection +{ + /** + * @psalm-assert StagedQuoteTransitionStateAction $value + * @psalm-param StagedQuoteTransitionStateAction|stdClass $value + * @throws InvalidArgumentException + * + * @return StagedQuoteTransitionStateActionCollection + */ + public function add($value) + { + if (!$value instanceof StagedQuoteTransitionStateAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StagedQuoteTransitionStateAction + */ + protected function mapper() + { + return function (?int $index): ?StagedQuoteTransitionStateAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StagedQuoteTransitionStateAction $data */ + $data = StagedQuoteTransitionStateActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteTransitionStateActionModel.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteTransitionStateActionModel.php new file mode 100644 index 00000000000..e30b1d9b7dc --- /dev/null +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteTransitionStateActionModel.php @@ -0,0 +1,133 @@ +state = $state; + $this->force = $force; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    Value to set. + * If there is no State yet, the new State must be an initial State.

    + * + * + * @return null|StateResourceIdentifier + */ + public function getState() + { + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); + if (is_null($data)) { + return null; + } + + $this->state = StateResourceIdentifierModel::of($data); + } + + return $this->state; + } + + /** + *

    Switch validations on or off.

    + * + * + * @return null|bool + */ + public function getForce() + { + if (is_null($this->force)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_FORCE); + if (is_null($data)) { + return null; + } + $this->force = (bool) $data; + } + + return $this->force; + } + + + /** + * @param ?StateResourceIdentifier $state + */ + public function setState(?StateResourceIdentifier $state): void + { + $this->state = $state; + } + + /** + * @param ?bool $force + */ + public function setForce(?bool $force): void + { + $this->force = $force; + } +} diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdate.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdate.php index 2456bb4987e..5c638eb8b13 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdate.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdate.php @@ -17,11 +17,18 @@ interface StagedQuoteUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + *

    Expected version of the StagedQuote to which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * @return null|int */ public function getVersion(); /** + *

    Update actions to be performed on the StagedQuote.

    + * + * @return null|StagedQuoteUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdateAction.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdateAction.php index 24572ab1e0d..59bd30c3cd0 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdateAction.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdateAction.php @@ -17,6 +17,7 @@ interface StagedQuoteUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdateActionModel.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdateActionModel.php index 89e0edee4e8..79f34529efe 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdateActionModel.php @@ -21,6 +21,7 @@ final class StagedQuoteUpdateActionModel extends JsonObjectModel implements Stag { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -35,17 +36,20 @@ final class StagedQuoteUpdateActionModel extends JsonObjectModel implements Stag 'setCustomType' => StagedQuoteSetCustomTypeActionModel::class, 'setSellerComment' => StagedQuoteSetSellerCommentActionModel::class, 'setValidTo' => StagedQuoteSetValidToActionModel::class, + 'transitionState' => StagedQuoteTransitionStateActionModel::class, ]; /** * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdateBuilder.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdateBuilder.php index a2cbf369a7b..91305264c92 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdateBuilder.php @@ -21,16 +21,22 @@ final class StagedQuoteUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?StagedQuoteUpdateActionCollection */ private $actions; /** + *

    Expected version of the StagedQuote to which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * @return null|int */ public function getVersion() @@ -39,6 +45,9 @@ public function getVersion() } /** + *

    Update actions to be performed on the StagedQuote.

    + * + * @return null|StagedQuoteUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdateModel.php b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdateModel.php index 80f735ab7d9..23db78c5f33 100644 --- a/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdateModel.php +++ b/lib/commercetools-api/src/Models/StagedQuote/StagedQuoteUpdateModel.php @@ -20,11 +20,13 @@ final class StagedQuoteUpdateModel extends JsonObjectModel implements StagedQuoteUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?StagedQuoteUpdateActionCollection */ protected $actions; @@ -42,6 +44,10 @@ public function __construct( } /** + *

    Expected version of the StagedQuote to which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict error will be returned.

    + * + * * @return null|int */ public function getVersion() @@ -59,6 +65,9 @@ public function getVersion() } /** + *

    Update actions to be performed on the StagedQuote.

    + * + * * @return null|StagedQuoteUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StagedStandalonePrice.php b/lib/commercetools-api/src/Models/StandalonePrice/StagedStandalonePrice.php new file mode 100644 index 00000000000..23587da2548 --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StagedStandalonePrice.php @@ -0,0 +1,46 @@ +Money value of the StagedStandalonePrice.

    + * + + * @return null|TypedMoney + */ + public function getValue(); + + /** + *

    Discounted price for the StagedStandalonePrice.

    + * + + * @return null|DiscountedPrice + */ + public function getDiscounted(); + + /** + * @param ?TypedMoney $value + */ + public function setValue(?TypedMoney $value): void; + + /** + * @param ?DiscountedPrice $discounted + */ + public function setDiscounted(?DiscountedPrice $discounted): void; +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StagedStandalonePriceBuilder.php b/lib/commercetools-api/src/Models/StandalonePrice/StagedStandalonePriceBuilder.php new file mode 100644 index 00000000000..e136ae1e5a8 --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StagedStandalonePriceBuilder.php @@ -0,0 +1,117 @@ + + */ +final class StagedStandalonePriceBuilder implements Builder +{ + /** + + * @var null|TypedMoney|TypedMoneyBuilder + */ + private $value; + + /** + + * @var null|DiscountedPrice|DiscountedPriceBuilder + */ + private $discounted; + + /** + *

    Money value of the StagedStandalonePrice.

    + * + + * @return null|TypedMoney + */ + public function getValue() + { + return $this->value instanceof TypedMoneyBuilder ? $this->value->build() : $this->value; + } + + /** + *

    Discounted price for the StagedStandalonePrice.

    + * + + * @return null|DiscountedPrice + */ + public function getDiscounted() + { + return $this->discounted instanceof DiscountedPriceBuilder ? $this->discounted->build() : $this->discounted; + } + + /** + * @param ?TypedMoney $value + * @return $this + */ + public function withValue(?TypedMoney $value) + { + $this->value = $value; + + return $this; + } + + /** + * @param ?DiscountedPrice $discounted + * @return $this + */ + public function withDiscounted(?DiscountedPrice $discounted) + { + $this->discounted = $discounted; + + return $this; + } + + /** + * @deprecated use withValue() instead + * @return $this + */ + public function withValueBuilder(?TypedMoneyBuilder $value) + { + $this->value = $value; + + return $this; + } + + /** + * @deprecated use withDiscounted() instead + * @return $this + */ + public function withDiscountedBuilder(?DiscountedPriceBuilder $discounted) + { + $this->discounted = $discounted; + + return $this; + } + + public function build(): StagedStandalonePrice + { + return new StagedStandalonePriceModel( + $this->value instanceof TypedMoneyBuilder ? $this->value->build() : $this->value, + $this->discounted instanceof DiscountedPriceBuilder ? $this->discounted->build() : $this->discounted + ); + } + + public static function of(): StagedStandalonePriceBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StagedStandalonePriceCollection.php b/lib/commercetools-api/src/Models/StandalonePrice/StagedStandalonePriceCollection.php new file mode 100644 index 00000000000..c25401f9913 --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StagedStandalonePriceCollection.php @@ -0,0 +1,56 @@ + + * @method StagedStandalonePrice current() + * @method StagedStandalonePrice end() + * @method StagedStandalonePrice at($offset) + */ +class StagedStandalonePriceCollection extends MapperSequence +{ + /** + * @psalm-assert StagedStandalonePrice $value + * @psalm-param StagedStandalonePrice|stdClass $value + * @throws InvalidArgumentException + * + * @return StagedStandalonePriceCollection + */ + public function add($value) + { + if (!$value instanceof StagedStandalonePrice) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StagedStandalonePrice + */ + protected function mapper() + { + return function (?int $index): ?StagedStandalonePrice { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StagedStandalonePrice $data */ + $data = StagedStandalonePriceModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StagedStandalonePriceModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StagedStandalonePriceModel.php new file mode 100644 index 00000000000..ca859f13860 --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StagedStandalonePriceModel.php @@ -0,0 +1,108 @@ +value = $value; + $this->discounted = $discounted; + } + + /** + *

    Money value of the StagedStandalonePrice.

    + * + * + * @return null|TypedMoney + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $className = TypedMoneyModel::resolveDiscriminatorClass($data); + $this->value = $className::of($data); + } + + return $this->value; + } + + /** + *

    Discounted price for the StagedStandalonePrice.

    + * + * + * @return null|DiscountedPrice + */ + public function getDiscounted() + { + if (is_null($this->discounted)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_DISCOUNTED); + if (is_null($data)) { + return null; + } + + $this->discounted = DiscountedPriceModel::of($data); + } + + return $this->discounted; + } + + + /** + * @param ?TypedMoney $value + */ + public function setValue(?TypedMoney $value): void + { + $this->value = $value; + } + + /** + * @param ?DiscountedPrice $discounted + */ + public function setDiscounted(?DiscountedPrice $discounted): void + { + $this->discounted = $discounted; + } +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePrice.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePrice.php index 0f5b44cd9fb..43879359857 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePrice.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePrice.php @@ -36,10 +36,13 @@ interface StandalonePrice extends BaseResource public const FIELD_TIERS = 'tiers'; public const FIELD_DISCOUNTED = 'discounted'; public const FIELD_CUSTOM = 'custom'; + public const FIELD_STAGED = 'staged'; + public const FIELD_ACTIVE = 'active'; /** *

    Unique identifier of the StandalonePrice.

    * + * @return null|string */ public function getId(); @@ -47,6 +50,7 @@ public function getId(); /** *

    Current version of the StandalonePrice.

    * + * @return null|int */ public function getVersion(); @@ -54,6 +58,7 @@ public function getVersion(); /** *

    Date and time (UTC) the StandalonePrice was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -61,6 +66,7 @@ public function getCreatedAt(); /** *

    Date and time (UTC) the StandalonePrice was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -68,6 +74,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -75,6 +82,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -82,6 +90,7 @@ public function getCreatedBy(); /** *

    User-defined unique identifier of the StandalonePrice.

    * + * @return null|string */ public function getKey(); @@ -89,6 +98,7 @@ public function getKey(); /** *

    SKU of the ProductVariant to which this Price is associated.

    * + * @return null|string */ public function getSku(); @@ -96,6 +106,7 @@ public function getSku(); /** *

    Money value of this Price.

    * + * @return null|TypedMoney */ public function getValue(); @@ -103,6 +114,7 @@ public function getValue(); /** *

    Country for which this Price is valid.

    * + * @return null|string */ public function getCountry(); @@ -110,6 +122,7 @@ public function getCountry(); /** *

    CustomerGroup for which this Price is valid.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup(); @@ -117,6 +130,7 @@ public function getCustomerGroup(); /** *

    Product distribution Channel for which this Price is valid.

    * + * @return null|ChannelReference */ public function getChannel(); @@ -124,6 +138,7 @@ public function getChannel(); /** *

    Date from which the Price is valid.

    * + * @return null|DateTimeImmutable */ public function getValidFrom(); @@ -131,6 +146,7 @@ public function getValidFrom(); /** *

    Date until the Price is valid.

    * + * @return null|DateTimeImmutable */ public function getValidUntil(); @@ -138,6 +154,7 @@ public function getValidUntil(); /** *

    Price tiers if any are defined.

    * + * @return null|PriceTierCollection */ public function getTiers(); @@ -146,6 +163,7 @@ public function getTiers(); *

    Set if a matching ProductDiscount exists. If set, the API uses the discounted value for the LineItem Price selection. * When a relative discount is applied and the fraction part of the discounted price is 0.5, the discounted price is rounded in favor of the customer with the half down rounding.

    * + * @return null|DiscountedPrice */ public function getDiscounted(); @@ -153,10 +171,28 @@ public function getDiscounted(); /** *

    Custom Fields for the StandalonePrice.

    * + * @return null|CustomFields */ public function getCustom(); + /** + *

    Staged changes of the StandalonePrice. Only present if the StandalonePrice has staged changes.

    + * + + * @return null|StagedStandalonePrice + */ + public function getStaged(); + + /** + *

    If set to true, the StandalonePrice is considered during price selection. + * If set to false, the StandalonePrice is not considered during price selection.

    + * + + * @return null|bool + */ + public function getActive(); + /** * @param ?string $id */ @@ -241,4 +277,14 @@ public function setDiscounted(?DiscountedPrice $discounted): void; * @param ?CustomFields $custom */ public function setCustom(?CustomFields $custom): void; + + /** + * @param ?StagedStandalonePrice $staged + */ + public function setStaged(?StagedStandalonePrice $staged): void; + + /** + * @param ?bool $active + */ + public function setActive(?bool $active): void; } diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceApplyStagedChangesAction.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceApplyStagedChangesAction.php new file mode 100644 index 00000000000..b85d63c69b0 --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceApplyStagedChangesAction.php @@ -0,0 +1,16 @@ + + */ +final class StandalonePriceApplyStagedChangesActionBuilder implements Builder +{ + public function build(): StandalonePriceApplyStagedChangesAction + { + return new StandalonePriceApplyStagedChangesActionModel( + ); + } + + public static function of(): StandalonePriceApplyStagedChangesActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceApplyStagedChangesActionCollection.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceApplyStagedChangesActionCollection.php new file mode 100644 index 00000000000..7aecf27c109 --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceApplyStagedChangesActionCollection.php @@ -0,0 +1,56 @@ + + * @method StandalonePriceApplyStagedChangesAction current() + * @method StandalonePriceApplyStagedChangesAction end() + * @method StandalonePriceApplyStagedChangesAction at($offset) + */ +class StandalonePriceApplyStagedChangesActionCollection extends StandalonePriceUpdateActionCollection +{ + /** + * @psalm-assert StandalonePriceApplyStagedChangesAction $value + * @psalm-param StandalonePriceApplyStagedChangesAction|stdClass $value + * @throws InvalidArgumentException + * + * @return StandalonePriceApplyStagedChangesActionCollection + */ + public function add($value) + { + if (!$value instanceof StandalonePriceApplyStagedChangesAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StandalonePriceApplyStagedChangesAction + */ + protected function mapper() + { + return function (?int $index): ?StandalonePriceApplyStagedChangesAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StandalonePriceApplyStagedChangesAction $data */ + $data = StandalonePriceApplyStagedChangesActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceApplyStagedChangesActionModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceApplyStagedChangesActionModel.php new file mode 100644 index 00000000000..f39c3c0de46 --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceApplyStagedChangesActionModel.php @@ -0,0 +1,56 @@ +action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceBuilder.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceBuilder.php index 393bf04781b..8462670cffd 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceBuilder.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceBuilder.php @@ -39,93 +39,123 @@ final class StandalonePriceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $key; /** + * @var ?string */ private $sku; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $value; /** + * @var ?string */ private $country; /** + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ private $customerGroup; /** + * @var null|ChannelReference|ChannelReferenceBuilder */ private $channel; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; /** + * @var ?PriceTierCollection */ private $tiers; /** + * @var null|DiscountedPrice|DiscountedPriceBuilder */ private $discounted; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; + /** + + * @var null|StagedStandalonePrice|StagedStandalonePriceBuilder + */ + private $staged; + + /** + + * @var ?bool + */ + private $active; + /** *

    Unique identifier of the StandalonePrice.

    * + * @return null|string */ public function getId() @@ -136,6 +166,7 @@ public function getId() /** *

    Current version of the StandalonePrice.

    * + * @return null|int */ public function getVersion() @@ -146,6 +177,7 @@ public function getVersion() /** *

    Date and time (UTC) the StandalonePrice was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -156,6 +188,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the StandalonePrice was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -166,6 +199,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -176,6 +210,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -186,6 +221,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the StandalonePrice.

    * + * @return null|string */ public function getKey() @@ -196,6 +232,7 @@ public function getKey() /** *

    SKU of the ProductVariant to which this Price is associated.

    * + * @return null|string */ public function getSku() @@ -206,6 +243,7 @@ public function getSku() /** *

    Money value of this Price.

    * + * @return null|TypedMoney */ public function getValue() @@ -216,6 +254,7 @@ public function getValue() /** *

    Country for which this Price is valid.

    * + * @return null|string */ public function getCountry() @@ -226,6 +265,7 @@ public function getCountry() /** *

    CustomerGroup for which this Price is valid.

    * + * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -236,6 +276,7 @@ public function getCustomerGroup() /** *

    Product distribution Channel for which this Price is valid.

    * + * @return null|ChannelReference */ public function getChannel() @@ -246,6 +287,7 @@ public function getChannel() /** *

    Date from which the Price is valid.

    * + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -256,6 +298,7 @@ public function getValidFrom() /** *

    Date until the Price is valid.

    * + * @return null|DateTimeImmutable */ public function getValidUntil() @@ -266,6 +309,7 @@ public function getValidUntil() /** *

    Price tiers if any are defined.

    * + * @return null|PriceTierCollection */ public function getTiers() @@ -277,6 +321,7 @@ public function getTiers() *

    Set if a matching ProductDiscount exists. If set, the API uses the discounted value for the LineItem Price selection. * When a relative discount is applied and the fraction part of the discounted price is 0.5, the discounted price is rounded in favor of the customer with the half down rounding.

    * + * @return null|DiscountedPrice */ public function getDiscounted() @@ -287,6 +332,7 @@ public function getDiscounted() /** *

    Custom Fields for the StandalonePrice.

    * + * @return null|CustomFields */ public function getCustom() @@ -294,6 +340,29 @@ public function getCustom() return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; } + /** + *

    Staged changes of the StandalonePrice. Only present if the StandalonePrice has staged changes.

    + * + + * @return null|StagedStandalonePrice + */ + public function getStaged() + { + return $this->staged instanceof StagedStandalonePriceBuilder ? $this->staged->build() : $this->staged; + } + + /** + *

    If set to true, the StandalonePrice is considered during price selection. + * If set to false, the StandalonePrice is not considered during price selection.

    + * + + * @return null|bool + */ + public function getActive() + { + return $this->active; + } + /** * @param ?string $id * @return $this @@ -481,6 +550,28 @@ public function withCustom(?CustomFields $custom) return $this; } + /** + * @param ?StagedStandalonePrice $staged + * @return $this + */ + public function withStaged(?StagedStandalonePrice $staged) + { + $this->staged = $staged; + + return $this; + } + + /** + * @param ?bool $active + * @return $this + */ + public function withActive(?bool $active) + { + $this->active = $active; + + return $this; + } + /** * @deprecated use withLastModifiedBy() instead * @return $this @@ -558,6 +649,17 @@ public function withCustomBuilder(?CustomFieldsBuilder $custom) return $this; } + /** + * @deprecated use withStaged() instead + * @return $this + */ + public function withStagedBuilder(?StagedStandalonePriceBuilder $staged) + { + $this->staged = $staged; + + return $this; + } + public function build(): StandalonePrice { return new StandalonePriceModel( @@ -577,7 +679,9 @@ public function build(): StandalonePrice $this->validUntil, $this->tiers, $this->discounted instanceof DiscountedPriceBuilder ? $this->discounted->build() : $this->discounted, - $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom + $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, + $this->staged instanceof StagedStandalonePriceBuilder ? $this->staged->build() : $this->staged, + $this->active ); } diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeActiveAction.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeActiveAction.php new file mode 100644 index 00000000000..a0d531fe25e --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeActiveAction.php @@ -0,0 +1,30 @@ +New value to set for the active field of the StandalonePrice.

    + * + + * @return null|bool + */ + public function getActive(); + + /** + * @param ?bool $active + */ + public function setActive(?bool $active): void; +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeActiveActionBuilder.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeActiveActionBuilder.php new file mode 100644 index 00000000000..fd9c2113cb1 --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeActiveActionBuilder.php @@ -0,0 +1,63 @@ + + */ +final class StandalonePriceChangeActiveActionBuilder implements Builder +{ + /** + + * @var ?bool + */ + private $active; + + /** + *

    New value to set for the active field of the StandalonePrice.

    + * + + * @return null|bool + */ + public function getActive() + { + return $this->active; + } + + /** + * @param ?bool $active + * @return $this + */ + public function withActive(?bool $active) + { + $this->active = $active; + + return $this; + } + + + public function build(): StandalonePriceChangeActiveAction + { + return new StandalonePriceChangeActiveActionModel( + $this->active + ); + } + + public static function of(): StandalonePriceChangeActiveActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeActiveActionCollection.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeActiveActionCollection.php new file mode 100644 index 00000000000..09b7b30afec --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeActiveActionCollection.php @@ -0,0 +1,56 @@ + + * @method StandalonePriceChangeActiveAction current() + * @method StandalonePriceChangeActiveAction end() + * @method StandalonePriceChangeActiveAction at($offset) + */ +class StandalonePriceChangeActiveActionCollection extends StandalonePriceUpdateActionCollection +{ + /** + * @psalm-assert StandalonePriceChangeActiveAction $value + * @psalm-param StandalonePriceChangeActiveAction|stdClass $value + * @throws InvalidArgumentException + * + * @return StandalonePriceChangeActiveActionCollection + */ + public function add($value) + { + if (!$value instanceof StandalonePriceChangeActiveAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StandalonePriceChangeActiveAction + */ + protected function mapper() + { + return function (?int $index): ?StandalonePriceChangeActiveAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StandalonePriceChangeActiveAction $data */ + $data = StandalonePriceChangeActiveActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeActiveActionModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeActiveActionModel.php new file mode 100644 index 00000000000..ea965a92e51 --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeActiveActionModel.php @@ -0,0 +1,93 @@ +active = $active; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

    New value to set for the active field of the StandalonePrice.

    + * + * + * @return null|bool + */ + public function getActive() + { + if (is_null($this->active)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_ACTIVE); + if (is_null($data)) { + return null; + } + $this->active = (bool) $data; + } + + return $this->active; + } + + + /** + * @param ?bool $active + */ + public function setActive(?bool $active): void + { + $this->active = $active; + } +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeValueAction.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeValueAction.php index a84846eef05..3cfca7f4399 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeValueAction.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeValueAction.php @@ -15,16 +15,31 @@ interface StandalonePriceChangeValueAction extends StandalonePriceUpdateAction { public const FIELD_VALUE = 'value'; + public const FIELD_STAGED = 'staged'; /** *

    New value to set. Must not be empty.

    * + * @return null|Money */ public function getValue(); + /** + *

    If set to true the update action applies to the StagedStandalonePrice. If set to false, the update action applies to the current StandalonePrice.

    + * + + * @return null|bool + */ + public function getStaged(); + /** * @param ?Money $value */ public function setValue(?Money $value): void; + + /** + * @param ?bool $staged + */ + public function setStaged(?bool $staged): void; } diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeValueActionBuilder.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeValueActionBuilder.php index d06322ced2c..9a5d7bf20c9 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeValueActionBuilder.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeValueActionBuilder.php @@ -23,13 +23,21 @@ final class StandalonePriceChangeValueActionBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $value; + /** + + * @var ?bool + */ + private $staged; + /** *

    New value to set. Must not be empty.

    * + * @return null|Money */ public function getValue() @@ -37,6 +45,17 @@ public function getValue() return $this->value instanceof MoneyBuilder ? $this->value->build() : $this->value; } + /** + *

    If set to true the update action applies to the StagedStandalonePrice. If set to false, the update action applies to the current StandalonePrice.

    + * + + * @return null|bool + */ + public function getStaged() + { + return $this->staged; + } + /** * @param ?Money $value * @return $this @@ -48,6 +67,17 @@ public function withValue(?Money $value) return $this; } + /** + * @param ?bool $staged + * @return $this + */ + public function withStaged(?bool $staged) + { + $this->staged = $staged; + + return $this; + } + /** * @deprecated use withValue() instead * @return $this @@ -62,7 +92,8 @@ public function withValueBuilder(?MoneyBuilder $value) public function build(): StandalonePriceChangeValueAction { return new StandalonePriceChangeValueActionModel( - $this->value instanceof MoneyBuilder ? $this->value->build() : $this->value + $this->value instanceof MoneyBuilder ? $this->value->build() : $this->value, + $this->staged ); } diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeValueActionModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeValueActionModel.php index fd4385e6c67..e2c33ab09ba 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeValueActionModel.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceChangeValueActionModel.php @@ -23,27 +23,39 @@ final class StandalonePriceChangeValueActionModel extends JsonObjectModel implem { public const DISCRIMINATOR_VALUE = 'changeValue'; /** + * * @var ?string */ protected $action; /** + * * @var ?Money */ protected $value; + /** + * + * @var ?bool + */ + protected $staged; + /** * @psalm-suppress MissingParamType */ public function __construct( - ?Money $value = null + ?Money $value = null, + ?bool $staged = null, + ?string $action = null ) { $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->staged = $staged; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +75,7 @@ public function getAction() /** *

    New value to set. Must not be empty.

    * + * * @return null|Money */ public function getValue() @@ -80,6 +93,26 @@ public function getValue() return $this->value; } + /** + *

    If set to true the update action applies to the StagedStandalonePrice. If set to false, the update action applies to the current StandalonePrice.

    + * + * + * @return null|bool + */ + public function getStaged() + { + if (is_null($this->staged)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_STAGED); + if (is_null($data)) { + return null; + } + $this->staged = (bool) $data; + } + + return $this->staged; + } + /** * @param ?Money $value @@ -88,4 +121,12 @@ public function setValue(?Money $value): void { $this->value = $value; } + + /** + * @param ?bool $staged + */ + public function setStaged(?bool $staged): void + { + $this->staged = $staged; + } } diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraft.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraft.php index 466a40f964f..a481776872b 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraft.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraft.php @@ -31,10 +31,12 @@ interface StandalonePriceDraft extends JsonObject public const FIELD_TIERS = 'tiers'; public const FIELD_DISCOUNTED = 'discounted'; public const FIELD_CUSTOM = 'custom'; + public const FIELD_ACTIVE = 'active'; /** *

    User-defined unique identifier for the StandalonePrice.

    * + * @return null|string */ public function getKey(); @@ -43,6 +45,7 @@ public function getKey(); *

    Specifies to which ProductVariant the API associates this Price. * It is not validated to exist in product variants.

    * + * @return null|string */ public function getSku(); @@ -50,6 +53,7 @@ public function getSku(); /** *

    Sets the money value of this Price.

    * + * @return null|Money */ public function getValue(); @@ -57,6 +61,7 @@ public function getValue(); /** *

    Sets the country for which this Price is valid.

    * + * @return null|string */ public function getCountry(); @@ -64,6 +69,7 @@ public function getCountry(); /** *

    Sets the CustomerGroup for which this Price is valid.

    * + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup(); @@ -71,20 +77,23 @@ public function getCustomerGroup(); /** *

    Sets the product distribution Channel for which this Price is valid.

    * + * @return null|ChannelResourceIdentifier */ public function getChannel(); /** - *

    Sets the date from which the Price is valid.

    + *

    Sets the date from which the Price is valid. Must be at least 1 ms earlier than validUntil.

    * + * @return null|DateTimeImmutable */ public function getValidFrom(); /** - *

    Sets the date until the Price is valid.

    + *

    Sets the date until the Price is valid. Must be at least 1 ms later than validFrom.

    * + * @return null|DateTimeImmutable */ public function getValidUntil(); @@ -92,6 +101,7 @@ public function getValidUntil(); /** *

    Sets price tiers.

    * + * @return null|PriceTierDraftCollection */ public function getTiers(); @@ -99,6 +109,7 @@ public function getTiers(); /** *

    Sets a discounted price for this Price that is different from the base price with value.

    * + * @return null|DiscountedPriceDraft */ public function getDiscounted(); @@ -106,10 +117,20 @@ public function getDiscounted(); /** *

    Custom Fields for the StandalonePrice.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); + /** + *

    If set to true, the StandalonePrice is considered during price selection. + * If set to false, the StandalonePrice is not considered during price selection.

    + * + + * @return null|bool + */ + public function getActive(); + /** * @param ?string $key */ @@ -164,4 +185,9 @@ public function setDiscounted(?DiscountedPriceDraft $discounted): void; * @param ?CustomFieldsDraft $custom */ public function setCustom(?CustomFieldsDraft $custom): void; + + /** + * @param ?bool $active + */ + public function setActive(?bool $active): void; } diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraftBuilder.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraftBuilder.php index 19168c924a8..0035fdeebe9 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraftBuilder.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraftBuilder.php @@ -33,63 +33,81 @@ final class StandalonePriceDraftBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $sku; /** + * @var null|Money|MoneyBuilder */ private $value; /** + * @var ?string */ private $country; /** + * @var null|CustomerGroupResourceIdentifier|CustomerGroupResourceIdentifierBuilder */ private $customerGroup; /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $channel; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; /** + * @var ?PriceTierDraftCollection */ private $tiers; /** + * @var null|DiscountedPriceDraft|DiscountedPriceDraftBuilder */ private $discounted; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; + /** + + * @var ?bool + */ + private $active; + /** *

    User-defined unique identifier for the StandalonePrice.

    * + * @return null|string */ public function getKey() @@ -101,6 +119,7 @@ public function getKey() *

    Specifies to which ProductVariant the API associates this Price. * It is not validated to exist in product variants.

    * + * @return null|string */ public function getSku() @@ -111,6 +130,7 @@ public function getSku() /** *

    Sets the money value of this Price.

    * + * @return null|Money */ public function getValue() @@ -121,6 +141,7 @@ public function getValue() /** *

    Sets the country for which this Price is valid.

    * + * @return null|string */ public function getCountry() @@ -131,6 +152,7 @@ public function getCountry() /** *

    Sets the CustomerGroup for which this Price is valid.

    * + * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() @@ -141,6 +163,7 @@ public function getCustomerGroup() /** *

    Sets the product distribution Channel for which this Price is valid.

    * + * @return null|ChannelResourceIdentifier */ public function getChannel() @@ -149,8 +172,9 @@ public function getChannel() } /** - *

    Sets the date from which the Price is valid.

    + *

    Sets the date from which the Price is valid. Must be at least 1 ms earlier than validUntil.

    * + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -159,8 +183,9 @@ public function getValidFrom() } /** - *

    Sets the date until the Price is valid.

    + *

    Sets the date until the Price is valid. Must be at least 1 ms later than validFrom.

    * + * @return null|DateTimeImmutable */ public function getValidUntil() @@ -171,6 +196,7 @@ public function getValidUntil() /** *

    Sets price tiers.

    * + * @return null|PriceTierDraftCollection */ public function getTiers() @@ -181,6 +207,7 @@ public function getTiers() /** *

    Sets a discounted price for this Price that is different from the base price with value.

    * + * @return null|DiscountedPriceDraft */ public function getDiscounted() @@ -191,6 +218,7 @@ public function getDiscounted() /** *

    Custom Fields for the StandalonePrice.

    * + * @return null|CustomFieldsDraft */ public function getCustom() @@ -198,6 +226,18 @@ public function getCustom() return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } + /** + *

    If set to true, the StandalonePrice is considered during price selection. + * If set to false, the StandalonePrice is not considered during price selection.

    + * + + * @return null|bool + */ + public function getActive() + { + return $this->active; + } + /** * @param ?string $key * @return $this @@ -319,6 +359,17 @@ public function withCustom(?CustomFieldsDraft $custom) return $this; } + /** + * @param ?bool $active + * @return $this + */ + public function withActive(?bool $active) + { + $this->active = $active; + + return $this; + } + /** * @deprecated use withValue() instead * @return $this @@ -387,7 +438,8 @@ public function build(): StandalonePriceDraft $this->validUntil, $this->tiers, $this->discounted instanceof DiscountedPriceDraftBuilder ? $this->discounted->build() : $this->discounted, - $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, + $this->active ); } diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraftModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraftModel.php index d5692dde1c1..e86933b79bb 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraftModel.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraftModel.php @@ -32,60 +32,77 @@ final class StandalonePriceDraftModel extends JsonObjectModel implements StandalonePriceDraft { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $sku; /** + * * @var ?Money */ protected $value; /** + * * @var ?string */ protected $country; /** + * * @var ?CustomerGroupResourceIdentifier */ protected $customerGroup; /** + * * @var ?ChannelResourceIdentifier */ protected $channel; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; /** + * * @var ?PriceTierDraftCollection */ protected $tiers; /** + * * @var ?DiscountedPriceDraft */ protected $discounted; /** + * * @var ?CustomFieldsDraft */ protected $custom; + /** + * + * @var ?bool + */ + protected $active; + /** * @psalm-suppress MissingParamType @@ -101,7 +118,8 @@ public function __construct( ?DateTimeImmutable $validUntil = null, ?PriceTierDraftCollection $tiers = null, ?DiscountedPriceDraft $discounted = null, - ?CustomFieldsDraft $custom = null + ?CustomFieldsDraft $custom = null, + ?bool $active = null ) { $this->key = $key; $this->sku = $sku; @@ -114,11 +132,13 @@ public function __construct( $this->tiers = $tiers; $this->discounted = $discounted; $this->custom = $custom; + $this->active = $active; } /** *

    User-defined unique identifier for the StandalonePrice.

    * + * * @return null|string */ public function getKey() @@ -139,6 +159,7 @@ public function getKey() *

    Specifies to which ProductVariant the API associates this Price. * It is not validated to exist in product variants.

    * + * * @return null|string */ public function getSku() @@ -158,6 +179,7 @@ public function getSku() /** *

    Sets the money value of this Price.

    * + * * @return null|Money */ public function getValue() @@ -178,6 +200,7 @@ public function getValue() /** *

    Sets the country for which this Price is valid.

    * + * * @return null|string */ public function getCountry() @@ -197,6 +220,7 @@ public function getCountry() /** *

    Sets the CustomerGroup for which this Price is valid.

    * + * * @return null|CustomerGroupResourceIdentifier */ public function getCustomerGroup() @@ -217,6 +241,7 @@ public function getCustomerGroup() /** *

    Sets the product distribution Channel for which this Price is valid.

    * + * * @return null|ChannelResourceIdentifier */ public function getChannel() @@ -235,7 +260,8 @@ public function getChannel() } /** - *

    Sets the date from which the Price is valid.

    + *

    Sets the date from which the Price is valid. Must be at least 1 ms earlier than validUntil.

    + * * * @return null|DateTimeImmutable */ @@ -258,7 +284,8 @@ public function getValidFrom() } /** - *

    Sets the date until the Price is valid.

    + *

    Sets the date until the Price is valid. Must be at least 1 ms later than validFrom.

    + * * * @return null|DateTimeImmutable */ @@ -283,6 +310,7 @@ public function getValidUntil() /** *

    Sets price tiers.

    * + * * @return null|PriceTierDraftCollection */ public function getTiers() @@ -302,6 +330,7 @@ public function getTiers() /** *

    Sets a discounted price for this Price that is different from the base price with value.

    * + * * @return null|DiscountedPriceDraft */ public function getDiscounted() @@ -322,6 +351,7 @@ public function getDiscounted() /** *

    Custom Fields for the StandalonePrice.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() @@ -339,6 +369,27 @@ public function getCustom() return $this->custom; } + /** + *

    If set to true, the StandalonePrice is considered during price selection. + * If set to false, the StandalonePrice is not considered during price selection.

    + * + * + * @return null|bool + */ + public function getActive() + { + if (is_null($this->active)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_ACTIVE); + if (is_null($data)) { + return null; + } + $this->active = (bool) $data; + } + + return $this->active; + } + /** * @param ?string $key @@ -428,6 +479,14 @@ public function setCustom(?CustomFieldsDraft $custom): void $this->custom = $custom; } + /** + * @param ?bool $active + */ + public function setActive(?bool $active): void + { + $this->active = $active; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceModel.php index f45b4402089..9db5bfbfec0 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceModel.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceModel.php @@ -38,90 +38,119 @@ final class StandalonePriceModel extends JsonObjectModel implements StandalonePrice { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $sku; /** + * * @var ?TypedMoney */ protected $value; /** + * * @var ?string */ protected $country; /** + * * @var ?CustomerGroupReference */ protected $customerGroup; /** + * * @var ?ChannelReference */ protected $channel; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; /** + * * @var ?PriceTierCollection */ protected $tiers; /** + * * @var ?DiscountedPrice */ protected $discounted; /** + * * @var ?CustomFields */ protected $custom; + /** + * + * @var ?StagedStandalonePrice + */ + protected $staged; + + /** + * + * @var ?bool + */ + protected $active; + /** * @psalm-suppress MissingParamType @@ -143,7 +172,9 @@ public function __construct( ?DateTimeImmutable $validUntil = null, ?PriceTierCollection $tiers = null, ?DiscountedPrice $discounted = null, - ?CustomFields $custom = null + ?CustomFields $custom = null, + ?StagedStandalonePrice $staged = null, + ?bool $active = null ) { $this->id = $id; $this->version = $version; @@ -162,11 +193,14 @@ public function __construct( $this->tiers = $tiers; $this->discounted = $discounted; $this->custom = $custom; + $this->staged = $staged; + $this->active = $active; } /** *

    Unique identifier of the StandalonePrice.

    * + * * @return null|string */ public function getId() @@ -186,6 +220,7 @@ public function getId() /** *

    Current version of the StandalonePrice.

    * + * * @return null|int */ public function getVersion() @@ -205,6 +240,7 @@ public function getVersion() /** *

    Date and time (UTC) the StandalonePrice was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -228,6 +264,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the StandalonePrice was last updated.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -251,6 +288,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -271,6 +309,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -291,6 +330,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the StandalonePrice.

    * + * * @return null|string */ public function getKey() @@ -310,6 +350,7 @@ public function getKey() /** *

    SKU of the ProductVariant to which this Price is associated.

    * + * * @return null|string */ public function getSku() @@ -329,6 +370,7 @@ public function getSku() /** *

    Money value of this Price.

    * + * * @return null|TypedMoney */ public function getValue() @@ -349,6 +391,7 @@ public function getValue() /** *

    Country for which this Price is valid.

    * + * * @return null|string */ public function getCountry() @@ -368,6 +411,7 @@ public function getCountry() /** *

    CustomerGroup for which this Price is valid.

    * + * * @return null|CustomerGroupReference */ public function getCustomerGroup() @@ -388,6 +432,7 @@ public function getCustomerGroup() /** *

    Product distribution Channel for which this Price is valid.

    * + * * @return null|ChannelReference */ public function getChannel() @@ -408,6 +453,7 @@ public function getChannel() /** *

    Date from which the Price is valid.

    * + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -431,6 +477,7 @@ public function getValidFrom() /** *

    Date until the Price is valid.

    * + * * @return null|DateTimeImmutable */ public function getValidUntil() @@ -454,6 +501,7 @@ public function getValidUntil() /** *

    Price tiers if any are defined.

    * + * * @return null|PriceTierCollection */ public function getTiers() @@ -474,6 +522,7 @@ public function getTiers() *

    Set if a matching ProductDiscount exists. If set, the API uses the discounted value for the LineItem Price selection. * When a relative discount is applied and the fraction part of the discounted price is 0.5, the discounted price is rounded in favor of the customer with the half down rounding.

    * + * * @return null|DiscountedPrice */ public function getDiscounted() @@ -494,6 +543,7 @@ public function getDiscounted() /** *

    Custom Fields for the StandalonePrice.

    * + * * @return null|CustomFields */ public function getCustom() @@ -511,6 +561,48 @@ public function getCustom() return $this->custom; } + /** + *

    Staged changes of the StandalonePrice. Only present if the StandalonePrice has staged changes.

    + * + * + * @return null|StagedStandalonePrice + */ + public function getStaged() + { + if (is_null($this->staged)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STAGED); + if (is_null($data)) { + return null; + } + + $this->staged = StagedStandalonePriceModel::of($data); + } + + return $this->staged; + } + + /** + *

    If set to true, the StandalonePrice is considered during price selection. + * If set to false, the StandalonePrice is not considered during price selection.

    + * + * + * @return null|bool + */ + public function getActive() + { + if (is_null($this->active)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_ACTIVE); + if (is_null($data)) { + return null; + } + $this->active = (bool) $data; + } + + return $this->active; + } + /** * @param ?string $id @@ -648,6 +740,22 @@ public function setCustom(?CustomFields $custom): void $this->custom = $custom; } + /** + * @param ?StagedStandalonePrice $staged + */ + public function setStaged(?StagedStandalonePrice $staged): void + { + $this->staged = $staged; + } + + /** + * @param ?bool $active + */ + public function setActive(?bool $active): void + { + $this->active = $active; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePricePagedQueryResponse.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePricePagedQueryResponse.php index 277487d09b9..0ec1db60314 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePricePagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePricePagedQueryResponse.php @@ -22,6 +22,7 @@ interface StandalonePricePagedQueryResponse extends JsonObject /** *

    Number of requested results.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Offset supplied by the client or server default. It is the number of elements skipped, not a page number.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    StandalonePrices matching the query.

    * + * @return null|StandalonePriceCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePricePagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePricePagedQueryResponseBuilder.php index 9e8dcaac87e..6391eb63fcb 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePricePagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePricePagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class StandalonePricePagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?StandalonePriceCollection */ private $results; @@ -48,6 +53,7 @@ final class StandalonePricePagedQueryResponseBuilder implements Builder /** *

    Number of requested results.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Offset supplied by the client or server default. It is the number of elements skipped, not a page number.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    StandalonePrices matching the query.

    * + * @return null|StandalonePriceCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePricePagedQueryResponseModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePricePagedQueryResponseModel.php index 7216c1575dc..d07c839c2ce 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePricePagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePricePagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class StandalonePricePagedQueryResponseModel extends JsonObjectModel implements StandalonePricePagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?StandalonePriceCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of requested results.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Offset supplied by the client or server default. It is the number of elements skipped, not a page number.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    StandalonePrices matching the query.

    * + * * @return null|StandalonePriceCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceReference.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceReference.php index b8a75de6096..abbb6a04bee 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceReference.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceReference.php @@ -19,6 +19,7 @@ interface StandalonePriceReference extends Reference /** *

    Contains the representation of the expanded StandalonePrice. Only present in responses to requests with Reference Expansion for StandalonePrice.

    * + * @return null|StandalonePrice */ public function getObj(); diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceReferenceBuilder.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceReferenceBuilder.php index 946f2a1b877..7cce4f1a77f 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceReferenceBuilder.php @@ -23,11 +23,13 @@ final class StandalonePriceReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|StandalonePrice|StandalonePriceBuilder */ private $obj; @@ -35,6 +37,7 @@ final class StandalonePriceReferenceBuilder implements Builder /** *

    Unique ID of the referenced resource.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded StandalonePrice. Only present in responses to requests with Reference Expansion for StandalonePrice.

    * + * @return null|StandalonePrice */ public function getObj() diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceReferenceModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceReferenceModel.php index 8a6bcac6d70..3548ff347d3 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceReferenceModel.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceReferenceModel.php @@ -23,16 +23,19 @@ final class StandalonePriceReferenceModel extends JsonObjectModel implements Sta { public const DISCRIMINATOR_VALUE = 'standalone-price'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?StandalonePrice */ protected $obj; @@ -43,16 +46,18 @@ final class StandalonePriceReferenceModel extends JsonObjectModel implements Sta */ public function __construct( ?string $id = null, - ?StandalonePrice $obj = null + ?StandalonePrice $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique ID of the referenced resource.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded StandalonePrice. Only present in responses to requests with Reference Expansion for StandalonePrice.

    * + * * @return null|StandalonePrice */ public function getObj() diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceResourceIdentifierBuilder.php index debb7e30e3a..8edd660d36a 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class StandalonePriceResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class StandalonePriceResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced resource. Required if key is absent.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced resource. Required if id is absent.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceResourceIdentifierModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceResourceIdentifierModel.php index 80e2a08ebdc..d1aa41036f1 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class StandalonePriceResourceIdentifierModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'standalone-price'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class StandalonePriceResourceIdentifierModel extends JsonObjectModel imple */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced resource. Required if key is absent.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced resource. Required if id is absent.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomFieldAction.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomFieldAction.php index 54ccb5f5e7d..d2a7c4fd9c7 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface StandalonePriceSetCustomFieldAction extends StandalonePriceUpdateActio /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomFieldActionBuilder.php index 957c6ba214d..4e62ddfc078 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class StandalonePriceSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class StandalonePriceSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomFieldActionModel.php index 38e30ebb7e5..55d059d3e64 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class StandalonePriceSetCustomFieldActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class StandalonePriceSetCustomFieldActionModel extends JsonObjectModel imp */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomTypeAction.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomTypeAction.php index efdd0f88c86..fb8622dd14c 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface StandalonePriceSetCustomTypeAction extends StandalonePriceUpdateAction *

    Defines the Type that extends the StandalonePrice with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the StandalonePrice.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the StandalonePrice.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomTypeActionBuilder.php index b57672c79f2..e86625329ae 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class StandalonePriceSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class StandalonePriceSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the StandalonePrice with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the StandalonePrice.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the StandalonePrice.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomTypeActionModel.php index e01ff84cae6..97491389fef 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class StandalonePriceSetCustomTypeActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class StandalonePriceSetCustomTypeActionModel extends JsonObjectModel impl */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the StandalonePrice with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the StandalonePrice.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the StandalonePrice.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetDiscountedPriceAction.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetDiscountedPriceAction.php index dc53027a91d..5478c3d8e29 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetDiscountedPriceAction.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetDiscountedPriceAction.php @@ -19,6 +19,7 @@ interface StandalonePriceSetDiscountedPriceAction extends StandalonePriceUpdateA /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|DiscountedPriceDraft */ public function getDiscounted(); diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetDiscountedPriceActionBuilder.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetDiscountedPriceActionBuilder.php index ba58aeff058..c08cf0ebceb 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetDiscountedPriceActionBuilder.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetDiscountedPriceActionBuilder.php @@ -23,6 +23,7 @@ final class StandalonePriceSetDiscountedPriceActionBuilder implements Builder { /** + * @var null|DiscountedPriceDraft|DiscountedPriceDraftBuilder */ private $discounted; @@ -30,6 +31,7 @@ final class StandalonePriceSetDiscountedPriceActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|DiscountedPriceDraft */ public function getDiscounted() diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetDiscountedPriceActionModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetDiscountedPriceActionModel.php index b2c73cf4b88..41e0e431c61 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetDiscountedPriceActionModel.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetDiscountedPriceActionModel.php @@ -23,11 +23,13 @@ final class StandalonePriceSetDiscountedPriceActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'setDiscountedPrice'; /** + * * @var ?string */ protected $action; /** + * * @var ?DiscountedPriceDraft */ protected $discounted; @@ -37,13 +39,15 @@ final class StandalonePriceSetDiscountedPriceActionModel extends JsonObjectModel * @psalm-suppress MissingParamType */ public function __construct( - ?DiscountedPriceDraft $discounted = null + ?DiscountedPriceDraft $discounted = null, + ?string $action = null ) { $this->discounted = $discounted; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|DiscountedPriceDraft */ public function getDiscounted() diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdate.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdate.php index 71d98cd9296..b37f22ffbb2 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdate.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdate.php @@ -19,6 +19,7 @@ interface StandalonePriceUpdate extends JsonObject /** *

    Expected version of the StandalonePrice on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

    * + * @return null|int */ public function getVersion(); @@ -26,6 +27,7 @@ public function getVersion(); /** *

    Update actions to be performed on the StandalonePrice.

    * + * @return null|StandalonePriceUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateAction.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateAction.php index b782912d673..52f7ffc0d77 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateAction.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateAction.php @@ -17,6 +17,7 @@ interface StandalonePriceUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateActionModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateActionModel.php index 572905d31ae..7c9b6f023a0 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateActionModel.php @@ -21,6 +21,7 @@ final class StandalonePriceUpdateActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -30,6 +31,8 @@ final class StandalonePriceUpdateActionModel extends JsonObjectModel implements * */ private static $discriminatorClasses = [ + 'applyStagedChanges' => StandalonePriceApplyStagedChangesActionModel::class, + 'changeActive' => StandalonePriceChangeActiveActionModel::class, 'changeValue' => StandalonePriceChangeValueActionModel::class, 'setCustomField' => StandalonePriceSetCustomFieldActionModel::class, 'setCustomType' => StandalonePriceSetCustomTypeActionModel::class, @@ -40,11 +43,13 @@ final class StandalonePriceUpdateActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateBuilder.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateBuilder.php index 13e33290dd8..4c45c0a4d29 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateBuilder.php @@ -21,11 +21,13 @@ final class StandalonePriceUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?StandalonePriceUpdateActionCollection */ private $actions; @@ -33,6 +35,7 @@ final class StandalonePriceUpdateBuilder implements Builder /** *

    Expected version of the StandalonePrice on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

    * + * @return null|int */ public function getVersion() @@ -43,6 +46,7 @@ public function getVersion() /** *

    Update actions to be performed on the StandalonePrice.

    * + * @return null|StandalonePriceUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateModel.php index 0840556582a..c9e4e326cee 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateModel.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateModel.php @@ -20,11 +20,13 @@ final class StandalonePriceUpdateModel extends JsonObjectModel implements StandalonePriceUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?StandalonePriceUpdateActionCollection */ protected $actions; @@ -44,6 +46,7 @@ public function __construct( /** *

    Expected version of the StandalonePrice on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict error will be returned.

    * + * * @return null|int */ public function getVersion() @@ -63,6 +66,7 @@ public function getVersion() /** *

    Update actions to be performed on the StandalonePrice.

    * + * * @return null|StandalonePriceUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/State/State.php b/lib/commercetools-api/src/Models/State/State.php index 83a1da5c7b5..36bbb092864 100644 --- a/lib/commercetools-api/src/Models/State/State.php +++ b/lib/commercetools-api/src/Models/State/State.php @@ -32,6 +32,7 @@ interface State extends BaseResource /** *

    Unique identifier of the State.

    * + * @return null|string */ public function getId(); @@ -39,6 +40,7 @@ public function getId(); /** *

    Current version of the State.

    * + * @return null|int */ public function getVersion(); @@ -46,6 +48,7 @@ public function getVersion(); /** *

    Date and time (UTC) the State was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -53,6 +56,7 @@ public function getCreatedAt(); /** *

    Date and time (UTC) the State was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -60,6 +64,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -67,6 +72,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -74,6 +80,7 @@ public function getCreatedBy(); /** *

    User-defined unique identifier of the State.

    * + * @return null|string */ public function getKey(); @@ -81,6 +88,7 @@ public function getKey(); /** *

    Indicates to which resource or object types the State is assigned to.

    * + * @return null|string */ public function getType(); @@ -88,6 +96,7 @@ public function getType(); /** *

    Name of the State.

    * + * @return null|LocalizedString */ public function getName(); @@ -95,6 +104,7 @@ public function getName(); /** *

    Description of the State.

    * + * @return null|LocalizedString */ public function getDescription(); @@ -102,6 +112,7 @@ public function getDescription(); /** *

    true for an initial State, the first State in a workflow.

    * + * @return null|bool */ public function getInitial(); @@ -109,6 +120,7 @@ public function getInitial(); /** *

    true for States that are an integral part of the Project. Those States cannot be deleted and their key cannot be changed.

    * + * @return null|bool */ public function getBuiltIn(); @@ -116,6 +128,7 @@ public function getBuiltIn(); /** *

    Roles the State can fulfill for Reviews and Line Items.

    * + * @return null|array */ public function getRoles(); @@ -127,6 +140,7 @@ public function getRoles(); *
  • if not set, the validation is turned off and the current State can be transitioned to any other State of the same type as the current State.
  • * * + * @return null|StateReferenceCollection */ public function getTransitions(); diff --git a/lib/commercetools-api/src/Models/State/StateAddRolesAction.php b/lib/commercetools-api/src/Models/State/StateAddRolesAction.php index 1d6bd4858e8..f150aaf27af 100644 --- a/lib/commercetools-api/src/Models/State/StateAddRolesAction.php +++ b/lib/commercetools-api/src/Models/State/StateAddRolesAction.php @@ -18,6 +18,7 @@ interface StateAddRolesAction extends StateUpdateAction /** *

    Value to append to the array.

    * + * @return null|array */ public function getRoles(); diff --git a/lib/commercetools-api/src/Models/State/StateAddRolesActionBuilder.php b/lib/commercetools-api/src/Models/State/StateAddRolesActionBuilder.php index 9f408af9d25..2ec56c8162b 100644 --- a/lib/commercetools-api/src/Models/State/StateAddRolesActionBuilder.php +++ b/lib/commercetools-api/src/Models/State/StateAddRolesActionBuilder.php @@ -21,6 +21,7 @@ final class StateAddRolesActionBuilder implements Builder { /** + * @var ?array */ private $roles; @@ -28,6 +29,7 @@ final class StateAddRolesActionBuilder implements Builder /** *

    Value to append to the array.

    * + * @return null|array */ public function getRoles() diff --git a/lib/commercetools-api/src/Models/State/StateAddRolesActionModel.php b/lib/commercetools-api/src/Models/State/StateAddRolesActionModel.php index cf6dc09f717..2b7ab5a4a54 100644 --- a/lib/commercetools-api/src/Models/State/StateAddRolesActionModel.php +++ b/lib/commercetools-api/src/Models/State/StateAddRolesActionModel.php @@ -21,11 +21,13 @@ final class StateAddRolesActionModel extends JsonObjectModel implements StateAdd { public const DISCRIMINATOR_VALUE = 'addRoles'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $roles; @@ -35,13 +37,15 @@ final class StateAddRolesActionModel extends JsonObjectModel implements StateAdd * @psalm-suppress MissingParamType */ public function __construct( - ?array $roles = null + ?array $roles = null, + ?string $action = null ) { $this->roles = $roles; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to append to the array.

    * + * * @return null|array */ public function getRoles() diff --git a/lib/commercetools-api/src/Models/State/StateBuilder.php b/lib/commercetools-api/src/Models/State/StateBuilder.php index d19416d1610..9c3606ca34d 100644 --- a/lib/commercetools-api/src/Models/State/StateBuilder.php +++ b/lib/commercetools-api/src/Models/State/StateBuilder.php @@ -30,71 +30,85 @@ final class StateBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $key; /** + * @var ?string */ private $type; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?bool */ private $initial; /** + * @var ?bool */ private $builtIn; /** + * @var ?array */ private $roles; /** + * @var ?StateReferenceCollection */ private $transitions; @@ -102,6 +116,7 @@ final class StateBuilder implements Builder /** *

    Unique identifier of the State.

    * + * @return null|string */ public function getId() @@ -112,6 +127,7 @@ public function getId() /** *

    Current version of the State.

    * + * @return null|int */ public function getVersion() @@ -122,6 +138,7 @@ public function getVersion() /** *

    Date and time (UTC) the State was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -132,6 +149,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the State was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -142,6 +160,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -152,6 +171,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -162,6 +182,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the State.

    * + * @return null|string */ public function getKey() @@ -172,6 +193,7 @@ public function getKey() /** *

    Indicates to which resource or object types the State is assigned to.

    * + * @return null|string */ public function getType() @@ -182,6 +204,7 @@ public function getType() /** *

    Name of the State.

    * + * @return null|LocalizedString */ public function getName() @@ -192,6 +215,7 @@ public function getName() /** *

    Description of the State.

    * + * @return null|LocalizedString */ public function getDescription() @@ -202,6 +226,7 @@ public function getDescription() /** *

    true for an initial State, the first State in a workflow.

    * + * @return null|bool */ public function getInitial() @@ -212,6 +237,7 @@ public function getInitial() /** *

    true for States that are an integral part of the Project. Those States cannot be deleted and their key cannot be changed.

    * + * @return null|bool */ public function getBuiltIn() @@ -222,6 +248,7 @@ public function getBuiltIn() /** *

    Roles the State can fulfill for Reviews and Line Items.

    * + * @return null|array */ public function getRoles() @@ -236,6 +263,7 @@ public function getRoles() *
  • if not set, the validation is turned off and the current State can be transitioned to any other State of the same type as the current State.
  • * * + * @return null|StateReferenceCollection */ public function getTransitions() diff --git a/lib/commercetools-api/src/Models/State/StateChangeInitialAction.php b/lib/commercetools-api/src/Models/State/StateChangeInitialAction.php index b82ac622c7d..dd4c455df9b 100644 --- a/lib/commercetools-api/src/Models/State/StateChangeInitialAction.php +++ b/lib/commercetools-api/src/Models/State/StateChangeInitialAction.php @@ -18,6 +18,7 @@ interface StateChangeInitialAction extends StateUpdateAction /** *

    Set to true for defining the State as initial State in a state machine and making it the first step in a workflow.

    * + * @return null|bool */ public function getInitial(); diff --git a/lib/commercetools-api/src/Models/State/StateChangeInitialActionBuilder.php b/lib/commercetools-api/src/Models/State/StateChangeInitialActionBuilder.php index f2d5e65cde1..49059187c9d 100644 --- a/lib/commercetools-api/src/Models/State/StateChangeInitialActionBuilder.php +++ b/lib/commercetools-api/src/Models/State/StateChangeInitialActionBuilder.php @@ -21,6 +21,7 @@ final class StateChangeInitialActionBuilder implements Builder { /** + * @var ?bool */ private $initial; @@ -28,6 +29,7 @@ final class StateChangeInitialActionBuilder implements Builder /** *

    Set to true for defining the State as initial State in a state machine and making it the first step in a workflow.

    * + * @return null|bool */ public function getInitial() diff --git a/lib/commercetools-api/src/Models/State/StateChangeInitialActionModel.php b/lib/commercetools-api/src/Models/State/StateChangeInitialActionModel.php index d266df75430..daeb2f7ebdf 100644 --- a/lib/commercetools-api/src/Models/State/StateChangeInitialActionModel.php +++ b/lib/commercetools-api/src/Models/State/StateChangeInitialActionModel.php @@ -21,11 +21,13 @@ final class StateChangeInitialActionModel extends JsonObjectModel implements Sta { public const DISCRIMINATOR_VALUE = 'changeInitial'; /** + * * @var ?string */ protected $action; /** + * * @var ?bool */ protected $initial; @@ -35,13 +37,15 @@ final class StateChangeInitialActionModel extends JsonObjectModel implements Sta * @psalm-suppress MissingParamType */ public function __construct( - ?bool $initial = null + ?bool $initial = null, + ?string $action = null ) { $this->initial = $initial; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Set to true for defining the State as initial State in a state machine and making it the first step in a workflow.

    * + * * @return null|bool */ public function getInitial() diff --git a/lib/commercetools-api/src/Models/State/StateChangeKeyAction.php b/lib/commercetools-api/src/Models/State/StateChangeKeyAction.php index 652298c057e..2140bc4184a 100644 --- a/lib/commercetools-api/src/Models/State/StateChangeKeyAction.php +++ b/lib/commercetools-api/src/Models/State/StateChangeKeyAction.php @@ -19,6 +19,7 @@ interface StateChangeKeyAction extends StateUpdateAction *

    New value to set. * Must not be empty.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/State/StateChangeKeyActionBuilder.php b/lib/commercetools-api/src/Models/State/StateChangeKeyActionBuilder.php index de6459952d8..aa0fe2bf501 100644 --- a/lib/commercetools-api/src/Models/State/StateChangeKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/State/StateChangeKeyActionBuilder.php @@ -21,6 +21,7 @@ final class StateChangeKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; @@ -29,6 +30,7 @@ final class StateChangeKeyActionBuilder implements Builder *

    New value to set. * Must not be empty.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/State/StateChangeKeyActionModel.php b/lib/commercetools-api/src/Models/State/StateChangeKeyActionModel.php index 45354958015..b90258413e4 100644 --- a/lib/commercetools-api/src/Models/State/StateChangeKeyActionModel.php +++ b/lib/commercetools-api/src/Models/State/StateChangeKeyActionModel.php @@ -21,11 +21,13 @@ final class StateChangeKeyActionModel extends JsonObjectModel implements StateCh { public const DISCRIMINATOR_VALUE = 'changeKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class StateChangeKeyActionModel extends JsonObjectModel implements StateCh * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() *

    New value to set. * Must not be empty.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/State/StateChangeTypeAction.php b/lib/commercetools-api/src/Models/State/StateChangeTypeAction.php index c57f2a57f22..51bb5b2d610 100644 --- a/lib/commercetools-api/src/Models/State/StateChangeTypeAction.php +++ b/lib/commercetools-api/src/Models/State/StateChangeTypeAction.php @@ -19,6 +19,7 @@ interface StateChangeTypeAction extends StateUpdateAction *

    Resource or object types the State shall be assigned to. * Must not be empty.

    * + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/State/StateChangeTypeActionBuilder.php b/lib/commercetools-api/src/Models/State/StateChangeTypeActionBuilder.php index 0e6712901e0..9692127984d 100644 --- a/lib/commercetools-api/src/Models/State/StateChangeTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/State/StateChangeTypeActionBuilder.php @@ -21,6 +21,7 @@ final class StateChangeTypeActionBuilder implements Builder { /** + * @var ?string */ private $type; @@ -29,6 +30,7 @@ final class StateChangeTypeActionBuilder implements Builder *

    Resource or object types the State shall be assigned to. * Must not be empty.

    * + * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/State/StateChangeTypeActionModel.php b/lib/commercetools-api/src/Models/State/StateChangeTypeActionModel.php index ddea5f3cf50..07ef6773f0e 100644 --- a/lib/commercetools-api/src/Models/State/StateChangeTypeActionModel.php +++ b/lib/commercetools-api/src/Models/State/StateChangeTypeActionModel.php @@ -21,11 +21,13 @@ final class StateChangeTypeActionModel extends JsonObjectModel implements StateC { public const DISCRIMINATOR_VALUE = 'changeType'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $type; @@ -35,13 +37,15 @@ final class StateChangeTypeActionModel extends JsonObjectModel implements StateC * @psalm-suppress MissingParamType */ public function __construct( - ?string $type = null + ?string $type = null, + ?string $action = null ) { $this->type = $type; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() *

    Resource or object types the State shall be assigned to. * Must not be empty.

    * + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/State/StateDraft.php b/lib/commercetools-api/src/Models/State/StateDraft.php index b96f52f1dee..a8a7e175756 100644 --- a/lib/commercetools-api/src/Models/State/StateDraft.php +++ b/lib/commercetools-api/src/Models/State/StateDraft.php @@ -25,6 +25,7 @@ interface StateDraft extends JsonObject /** *

    User-defined unique identifier for the State.

    * + * @return null|string */ public function getKey(); @@ -32,6 +33,7 @@ public function getKey(); /** *

    Specify to which resource or object type the State is assigned to.

    * + * @return null|string */ public function getType(); @@ -39,6 +41,7 @@ public function getType(); /** *

    Name of the State.

    * + * @return null|LocalizedString */ public function getName(); @@ -46,6 +49,7 @@ public function getName(); /** *

    Description of the State.

    * + * @return null|LocalizedString */ public function getDescription(); @@ -53,6 +57,7 @@ public function getDescription(); /** *

    Set to false if the State is not the first step in a workflow.

    * + * @return null|bool */ public function getInitial(); @@ -60,6 +65,7 @@ public function getInitial(); /** *

    If suitable, assign predifined roles the State can fulfill in case the State's type is LineItemState or ReviewState.

    * + * @return null|array */ public function getRoles(); @@ -72,6 +78,7 @@ public function getRoles(); *
  • Do not set this field at all to turn off validation and allowing transitions to any other State of the same type as the current State.
  • * * + * @return null|StateResourceIdentifierCollection */ public function getTransitions(); diff --git a/lib/commercetools-api/src/Models/State/StateDraftBuilder.php b/lib/commercetools-api/src/Models/State/StateDraftBuilder.php index caacbba8108..d0f3dab8ec8 100644 --- a/lib/commercetools-api/src/Models/State/StateDraftBuilder.php +++ b/lib/commercetools-api/src/Models/State/StateDraftBuilder.php @@ -23,36 +23,43 @@ final class StateDraftBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $type; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?bool */ private $initial; /** + * @var ?array */ private $roles; /** + * @var ?StateResourceIdentifierCollection */ private $transitions; @@ -60,6 +67,7 @@ final class StateDraftBuilder implements Builder /** *

    User-defined unique identifier for the State.

    * + * @return null|string */ public function getKey() @@ -70,6 +78,7 @@ public function getKey() /** *

    Specify to which resource or object type the State is assigned to.

    * + * @return null|string */ public function getType() @@ -80,6 +89,7 @@ public function getType() /** *

    Name of the State.

    * + * @return null|LocalizedString */ public function getName() @@ -90,6 +100,7 @@ public function getName() /** *

    Description of the State.

    * + * @return null|LocalizedString */ public function getDescription() @@ -100,6 +111,7 @@ public function getDescription() /** *

    Set to false if the State is not the first step in a workflow.

    * + * @return null|bool */ public function getInitial() @@ -110,6 +122,7 @@ public function getInitial() /** *

    If suitable, assign predifined roles the State can fulfill in case the State's type is LineItemState or ReviewState.

    * + * @return null|array */ public function getRoles() @@ -125,6 +138,7 @@ public function getRoles() *
  • Do not set this field at all to turn off validation and allowing transitions to any other State of the same type as the current State.
  • * * + * @return null|StateResourceIdentifierCollection */ public function getTransitions() diff --git a/lib/commercetools-api/src/Models/State/StateDraftModel.php b/lib/commercetools-api/src/Models/State/StateDraftModel.php index 996765e4556..3e1039541eb 100644 --- a/lib/commercetools-api/src/Models/State/StateDraftModel.php +++ b/lib/commercetools-api/src/Models/State/StateDraftModel.php @@ -22,36 +22,43 @@ final class StateDraftModel extends JsonObjectModel implements StateDraft { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $type; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?bool */ protected $initial; /** + * * @var ?array */ protected $roles; /** + * * @var ?StateResourceIdentifierCollection */ protected $transitions; @@ -81,6 +88,7 @@ public function __construct( /** *

    User-defined unique identifier for the State.

    * + * * @return null|string */ public function getKey() @@ -100,6 +108,7 @@ public function getKey() /** *

    Specify to which resource or object type the State is assigned to.

    * + * * @return null|string */ public function getType() @@ -119,6 +128,7 @@ public function getType() /** *

    Name of the State.

    * + * * @return null|LocalizedString */ public function getName() @@ -139,6 +149,7 @@ public function getName() /** *

    Description of the State.

    * + * * @return null|LocalizedString */ public function getDescription() @@ -159,6 +170,7 @@ public function getDescription() /** *

    Set to false if the State is not the first step in a workflow.

    * + * * @return null|bool */ public function getInitial() @@ -178,6 +190,7 @@ public function getInitial() /** *

    If suitable, assign predifined roles the State can fulfill in case the State's type is LineItemState or ReviewState.

    * + * * @return null|array */ public function getRoles() @@ -202,6 +215,7 @@ public function getRoles() *
  • Do not set this field at all to turn off validation and allowing transitions to any other State of the same type as the current State.
  • * * + * * @return null|StateResourceIdentifierCollection */ public function getTransitions() diff --git a/lib/commercetools-api/src/Models/State/StateModel.php b/lib/commercetools-api/src/Models/State/StateModel.php index 83bfe2639d9..abbbc6170ae 100644 --- a/lib/commercetools-api/src/Models/State/StateModel.php +++ b/lib/commercetools-api/src/Models/State/StateModel.php @@ -29,71 +29,85 @@ final class StateModel extends JsonObjectModel implements State { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $type; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?bool */ protected $initial; /** + * * @var ?bool */ protected $builtIn; /** + * * @var ?array */ protected $roles; /** + * * @var ?StateReferenceCollection */ protected $transitions; @@ -137,6 +151,7 @@ public function __construct( /** *

    Unique identifier of the State.

    * + * * @return null|string */ public function getId() @@ -156,6 +171,7 @@ public function getId() /** *

    Current version of the State.

    * + * * @return null|int */ public function getVersion() @@ -175,6 +191,7 @@ public function getVersion() /** *

    Date and time (UTC) the State was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -198,6 +215,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the State was last updated.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -221,6 +239,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -241,6 +260,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -261,6 +281,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the State.

    * + * * @return null|string */ public function getKey() @@ -280,6 +301,7 @@ public function getKey() /** *

    Indicates to which resource or object types the State is assigned to.

    * + * * @return null|string */ public function getType() @@ -299,6 +321,7 @@ public function getType() /** *

    Name of the State.

    * + * * @return null|LocalizedString */ public function getName() @@ -319,6 +342,7 @@ public function getName() /** *

    Description of the State.

    * + * * @return null|LocalizedString */ public function getDescription() @@ -339,6 +363,7 @@ public function getDescription() /** *

    true for an initial State, the first State in a workflow.

    * + * * @return null|bool */ public function getInitial() @@ -358,6 +383,7 @@ public function getInitial() /** *

    true for States that are an integral part of the Project. Those States cannot be deleted and their key cannot be changed.

    * + * * @return null|bool */ public function getBuiltIn() @@ -377,6 +403,7 @@ public function getBuiltIn() /** *

    Roles the State can fulfill for Reviews and Line Items.

    * + * * @return null|array */ public function getRoles() @@ -400,6 +427,7 @@ public function getRoles() *
  • if not set, the validation is turned off and the current State can be transitioned to any other State of the same type as the current State.
  • * * + * * @return null|StateReferenceCollection */ public function getTransitions() diff --git a/lib/commercetools-api/src/Models/State/StatePagedQueryResponse.php b/lib/commercetools-api/src/Models/State/StatePagedQueryResponse.php index dfce77a29a3..fa4fd9c718d 100644 --- a/lib/commercetools-api/src/Models/State/StatePagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/State/StatePagedQueryResponse.php @@ -22,6 +22,7 @@ interface StatePagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    States matching the query.

    * + * @return null|StateCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/State/StatePagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/State/StatePagedQueryResponseBuilder.php index 4c39de353e8..fff3a636bc6 100644 --- a/lib/commercetools-api/src/Models/State/StatePagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/State/StatePagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class StatePagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?StateCollection */ private $results; @@ -48,6 +53,7 @@ final class StatePagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    States matching the query.

    * + * @return null|StateCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/State/StatePagedQueryResponseModel.php b/lib/commercetools-api/src/Models/State/StatePagedQueryResponseModel.php index e6bae5a83a7..fb03215cec9 100644 --- a/lib/commercetools-api/src/Models/State/StatePagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/State/StatePagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class StatePagedQueryResponseModel extends JsonObjectModel implements StatePagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?StateCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    States matching the query.

    * + * * @return null|StateCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/State/StateReference.php b/lib/commercetools-api/src/Models/State/StateReference.php index 51d83e91121..3c0bab8a7ac 100644 --- a/lib/commercetools-api/src/Models/State/StateReference.php +++ b/lib/commercetools-api/src/Models/State/StateReference.php @@ -19,6 +19,7 @@ interface StateReference extends Reference /** *

    Contains the representation of the expanded State. Only present in responses to requests with Reference Expansion for States.

    * + * @return null|State */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

    Unique identifier of the referenced State.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/State/StateReferenceBuilder.php b/lib/commercetools-api/src/Models/State/StateReferenceBuilder.php index ecaa4bfe258..6d6bc913fec 100644 --- a/lib/commercetools-api/src/Models/State/StateReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/State/StateReferenceBuilder.php @@ -23,11 +23,13 @@ final class StateReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|State|StateBuilder */ private $obj; @@ -35,6 +37,7 @@ final class StateReferenceBuilder implements Builder /** *

    Unique identifier of the referenced State.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded State. Only present in responses to requests with Reference Expansion for States.

    * + * @return null|State */ public function getObj() diff --git a/lib/commercetools-api/src/Models/State/StateReferenceModel.php b/lib/commercetools-api/src/Models/State/StateReferenceModel.php index 32646348a29..88232abd126 100644 --- a/lib/commercetools-api/src/Models/State/StateReferenceModel.php +++ b/lib/commercetools-api/src/Models/State/StateReferenceModel.php @@ -23,16 +23,19 @@ final class StateReferenceModel extends JsonObjectModel implements StateReferenc { public const DISCRIMINATOR_VALUE = 'state'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?State */ protected $obj; @@ -43,16 +46,18 @@ final class StateReferenceModel extends JsonObjectModel implements StateReferenc */ public function __construct( ?string $id = null, - ?State $obj = null + ?State $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced State.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded State. Only present in responses to requests with Reference Expansion for States.

    * + * * @return null|State */ public function getObj() diff --git a/lib/commercetools-api/src/Models/State/StateRemoveRolesAction.php b/lib/commercetools-api/src/Models/State/StateRemoveRolesAction.php index dec4265c4c1..a5d743edb05 100644 --- a/lib/commercetools-api/src/Models/State/StateRemoveRolesAction.php +++ b/lib/commercetools-api/src/Models/State/StateRemoveRolesAction.php @@ -18,6 +18,7 @@ interface StateRemoveRolesAction extends StateUpdateAction /** *

    Roles to remove from the State.

    * + * @return null|array */ public function getRoles(); diff --git a/lib/commercetools-api/src/Models/State/StateRemoveRolesActionBuilder.php b/lib/commercetools-api/src/Models/State/StateRemoveRolesActionBuilder.php index 45790ee25c0..12673b82a68 100644 --- a/lib/commercetools-api/src/Models/State/StateRemoveRolesActionBuilder.php +++ b/lib/commercetools-api/src/Models/State/StateRemoveRolesActionBuilder.php @@ -21,6 +21,7 @@ final class StateRemoveRolesActionBuilder implements Builder { /** + * @var ?array */ private $roles; @@ -28,6 +29,7 @@ final class StateRemoveRolesActionBuilder implements Builder /** *

    Roles to remove from the State.

    * + * @return null|array */ public function getRoles() diff --git a/lib/commercetools-api/src/Models/State/StateRemoveRolesActionModel.php b/lib/commercetools-api/src/Models/State/StateRemoveRolesActionModel.php index 8654d0373ff..ede9236cffe 100644 --- a/lib/commercetools-api/src/Models/State/StateRemoveRolesActionModel.php +++ b/lib/commercetools-api/src/Models/State/StateRemoveRolesActionModel.php @@ -21,11 +21,13 @@ final class StateRemoveRolesActionModel extends JsonObjectModel implements State { public const DISCRIMINATOR_VALUE = 'removeRoles'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $roles; @@ -35,13 +37,15 @@ final class StateRemoveRolesActionModel extends JsonObjectModel implements State * @psalm-suppress MissingParamType */ public function __construct( - ?array $roles = null + ?array $roles = null, + ?string $action = null ) { $this->roles = $roles; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Roles to remove from the State.

    * + * * @return null|array */ public function getRoles() diff --git a/lib/commercetools-api/src/Models/State/StateResourceIdentifier.php b/lib/commercetools-api/src/Models/State/StateResourceIdentifier.php index 5efd46aea0a..57029255c5c 100644 --- a/lib/commercetools-api/src/Models/State/StateResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/State/StateResourceIdentifier.php @@ -17,6 +17,7 @@ interface StateResourceIdentifier extends ResourceIdentifier /** *

    Unique identifier of the referenced State. Either id or key is required.

    * + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

    User-defined unique identifier of the referenced State. Either id or key is required.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/State/StateResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/State/StateResourceIdentifierBuilder.php index 31f2d67c868..623683f01d9 100644 --- a/lib/commercetools-api/src/Models/State/StateResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/State/StateResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class StateResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class StateResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced State. Either id or key is required.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced State. Either id or key is required.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/State/StateResourceIdentifierModel.php b/lib/commercetools-api/src/Models/State/StateResourceIdentifierModel.php index d5964a87c41..18414cc208a 100644 --- a/lib/commercetools-api/src/Models/State/StateResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/State/StateResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class StateResourceIdentifierModel extends JsonObjectModel implements Stat { public const DISCRIMINATOR_VALUE = 'state'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class StateResourceIdentifierModel extends JsonObjectModel implements Stat */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced State. Either id or key is required.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced State. Either id or key is required.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/State/StateSetDescriptionAction.php b/lib/commercetools-api/src/Models/State/StateSetDescriptionAction.php index ca38e57f002..0f3d21eed96 100644 --- a/lib/commercetools-api/src/Models/State/StateSetDescriptionAction.php +++ b/lib/commercetools-api/src/Models/State/StateSetDescriptionAction.php @@ -20,6 +20,7 @@ interface StateSetDescriptionAction extends StateUpdateAction *

    Value to set. * If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getDescription(); diff --git a/lib/commercetools-api/src/Models/State/StateSetDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/State/StateSetDescriptionActionBuilder.php index 8ff857e0494..052a6e9c03a 100644 --- a/lib/commercetools-api/src/Models/State/StateSetDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/State/StateSetDescriptionActionBuilder.php @@ -23,6 +23,7 @@ final class StateSetDescriptionActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; @@ -31,6 +32,7 @@ final class StateSetDescriptionActionBuilder implements Builder *

    Value to set. * If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/State/StateSetDescriptionActionModel.php b/lib/commercetools-api/src/Models/State/StateSetDescriptionActionModel.php index c384b087736..09223282e5d 100644 --- a/lib/commercetools-api/src/Models/State/StateSetDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/State/StateSetDescriptionActionModel.php @@ -23,11 +23,13 @@ final class StateSetDescriptionActionModel extends JsonObjectModel implements St { public const DISCRIMINATOR_VALUE = 'setDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $description; @@ -37,13 +39,15 @@ final class StateSetDescriptionActionModel extends JsonObjectModel implements St * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $description = null + ?LocalizedString $description = null, + ?string $action = null ) { $this->description = $description; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -64,6 +68,7 @@ public function getAction() *

    Value to set. * If empty, any existing value will be removed.

    * + * * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/State/StateSetNameAction.php b/lib/commercetools-api/src/Models/State/StateSetNameAction.php index bc9d6ed5747..c530d33e72a 100644 --- a/lib/commercetools-api/src/Models/State/StateSetNameAction.php +++ b/lib/commercetools-api/src/Models/State/StateSetNameAction.php @@ -20,6 +20,7 @@ interface StateSetNameAction extends StateUpdateAction *

    Value to set. * If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/State/StateSetNameActionBuilder.php b/lib/commercetools-api/src/Models/State/StateSetNameActionBuilder.php index d4c34080fce..8a5ded8297e 100644 --- a/lib/commercetools-api/src/Models/State/StateSetNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/State/StateSetNameActionBuilder.php @@ -23,6 +23,7 @@ final class StateSetNameActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; @@ -31,6 +32,7 @@ final class StateSetNameActionBuilder implements Builder *

    Value to set. * If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/State/StateSetNameActionModel.php b/lib/commercetools-api/src/Models/State/StateSetNameActionModel.php index 7422194d2f2..64e5de87e0f 100644 --- a/lib/commercetools-api/src/Models/State/StateSetNameActionModel.php +++ b/lib/commercetools-api/src/Models/State/StateSetNameActionModel.php @@ -23,11 +23,13 @@ final class StateSetNameActionModel extends JsonObjectModel implements StateSetN { public const DISCRIMINATOR_VALUE = 'setName'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $name; @@ -37,13 +39,15 @@ final class StateSetNameActionModel extends JsonObjectModel implements StateSetN * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -64,6 +68,7 @@ public function getAction() *

    Value to set. * If empty, any existing value will be removed.

    * + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/State/StateSetRolesAction.php b/lib/commercetools-api/src/Models/State/StateSetRolesAction.php index 49f7a8f5c95..28f68162406 100644 --- a/lib/commercetools-api/src/Models/State/StateSetRolesAction.php +++ b/lib/commercetools-api/src/Models/State/StateSetRolesAction.php @@ -19,6 +19,7 @@ interface StateSetRolesAction extends StateUpdateAction *

    Value to set. * If empty, any existing value will be removed.

    * + * @return null|array */ public function getRoles(); diff --git a/lib/commercetools-api/src/Models/State/StateSetRolesActionBuilder.php b/lib/commercetools-api/src/Models/State/StateSetRolesActionBuilder.php index 614d4ea8cd5..60b16b8eba6 100644 --- a/lib/commercetools-api/src/Models/State/StateSetRolesActionBuilder.php +++ b/lib/commercetools-api/src/Models/State/StateSetRolesActionBuilder.php @@ -21,6 +21,7 @@ final class StateSetRolesActionBuilder implements Builder { /** + * @var ?array */ private $roles; @@ -29,6 +30,7 @@ final class StateSetRolesActionBuilder implements Builder *

    Value to set. * If empty, any existing value will be removed.

    * + * @return null|array */ public function getRoles() diff --git a/lib/commercetools-api/src/Models/State/StateSetRolesActionModel.php b/lib/commercetools-api/src/Models/State/StateSetRolesActionModel.php index c634985b495..955ebd11544 100644 --- a/lib/commercetools-api/src/Models/State/StateSetRolesActionModel.php +++ b/lib/commercetools-api/src/Models/State/StateSetRolesActionModel.php @@ -21,11 +21,13 @@ final class StateSetRolesActionModel extends JsonObjectModel implements StateSet { public const DISCRIMINATOR_VALUE = 'setRoles'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $roles; @@ -35,13 +37,15 @@ final class StateSetRolesActionModel extends JsonObjectModel implements StateSet * @psalm-suppress MissingParamType */ public function __construct( - ?array $roles = null + ?array $roles = null, + ?string $action = null ) { $this->roles = $roles; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() *

    Value to set. * If empty, any existing value will be removed.

    * + * * @return null|array */ public function getRoles() diff --git a/lib/commercetools-api/src/Models/State/StateSetTransitionsAction.php b/lib/commercetools-api/src/Models/State/StateSetTransitionsAction.php index 73a7811b474..8dc5b8dae93 100644 --- a/lib/commercetools-api/src/Models/State/StateSetTransitionsAction.php +++ b/lib/commercetools-api/src/Models/State/StateSetTransitionsAction.php @@ -24,6 +24,7 @@ interface StateSetTransitionsAction extends StateUpdateAction * If transitions is not set, the validation is turned off.

    *

    When performing a transitionState update action, any other State of the same type can be transitioned to.

    * + * @return null|StateResourceIdentifierCollection */ public function getTransitions(); diff --git a/lib/commercetools-api/src/Models/State/StateSetTransitionsActionBuilder.php b/lib/commercetools-api/src/Models/State/StateSetTransitionsActionBuilder.php index 2bf2cf50dc4..90a8fefceaf 100644 --- a/lib/commercetools-api/src/Models/State/StateSetTransitionsActionBuilder.php +++ b/lib/commercetools-api/src/Models/State/StateSetTransitionsActionBuilder.php @@ -21,6 +21,7 @@ final class StateSetTransitionsActionBuilder implements Builder { /** + * @var ?StateResourceIdentifierCollection */ private $transitions; @@ -34,6 +35,7 @@ final class StateSetTransitionsActionBuilder implements Builder * If transitions is not set, the validation is turned off.

    *

    When performing a transitionState update action, any other State of the same type can be transitioned to.

    * + * @return null|StateResourceIdentifierCollection */ public function getTransitions() diff --git a/lib/commercetools-api/src/Models/State/StateSetTransitionsActionModel.php b/lib/commercetools-api/src/Models/State/StateSetTransitionsActionModel.php index 9eb2adf699b..206898550d2 100644 --- a/lib/commercetools-api/src/Models/State/StateSetTransitionsActionModel.php +++ b/lib/commercetools-api/src/Models/State/StateSetTransitionsActionModel.php @@ -21,11 +21,13 @@ final class StateSetTransitionsActionModel extends JsonObjectModel implements St { public const DISCRIMINATOR_VALUE = 'setTransitions'; /** + * * @var ?string */ protected $action; /** + * * @var ?StateResourceIdentifierCollection */ protected $transitions; @@ -35,13 +37,15 @@ final class StateSetTransitionsActionModel extends JsonObjectModel implements St * @psalm-suppress MissingParamType */ public function __construct( - ?StateResourceIdentifierCollection $transitions = null + ?StateResourceIdentifierCollection $transitions = null, + ?string $action = null ) { $this->transitions = $transitions; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -67,6 +71,7 @@ public function getAction() * If transitions is not set, the validation is turned off.

    *

    When performing a transitionState update action, any other State of the same type can be transitioned to.

    * + * * @return null|StateResourceIdentifierCollection */ public function getTransitions() diff --git a/lib/commercetools-api/src/Models/State/StateUpdate.php b/lib/commercetools-api/src/Models/State/StateUpdate.php index 96e8b7f8a8a..17c3e499407 100644 --- a/lib/commercetools-api/src/Models/State/StateUpdate.php +++ b/lib/commercetools-api/src/Models/State/StateUpdate.php @@ -19,6 +19,7 @@ interface StateUpdate extends JsonObject /** *

    Expected version of the State on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion(); @@ -26,6 +27,7 @@ public function getVersion(); /** *

    Update actions to be performed on the State.

    * + * @return null|StateUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/State/StateUpdateAction.php b/lib/commercetools-api/src/Models/State/StateUpdateAction.php index 3fc1ad62bf6..bb2645e56f2 100644 --- a/lib/commercetools-api/src/Models/State/StateUpdateAction.php +++ b/lib/commercetools-api/src/Models/State/StateUpdateAction.php @@ -17,6 +17,7 @@ interface StateUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/State/StateUpdateActionModel.php b/lib/commercetools-api/src/Models/State/StateUpdateActionModel.php index f3ae9521a3e..371c3aaccaf 100644 --- a/lib/commercetools-api/src/Models/State/StateUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/State/StateUpdateActionModel.php @@ -21,6 +21,7 @@ final class StateUpdateActionModel extends JsonObjectModel implements StateUpdat { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -45,11 +46,13 @@ final class StateUpdateActionModel extends JsonObjectModel implements StateUpdat * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/State/StateUpdateBuilder.php b/lib/commercetools-api/src/Models/State/StateUpdateBuilder.php index 332ebe45762..a33c0e320e7 100644 --- a/lib/commercetools-api/src/Models/State/StateUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/State/StateUpdateBuilder.php @@ -21,11 +21,13 @@ final class StateUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?StateUpdateActionCollection */ private $actions; @@ -33,6 +35,7 @@ final class StateUpdateBuilder implements Builder /** *

    Expected version of the State on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion() @@ -43,6 +46,7 @@ public function getVersion() /** *

    Update actions to be performed on the State.

    * + * @return null|StateUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/State/StateUpdateModel.php b/lib/commercetools-api/src/Models/State/StateUpdateModel.php index cd37c72d9a4..8a51647ac67 100644 --- a/lib/commercetools-api/src/Models/State/StateUpdateModel.php +++ b/lib/commercetools-api/src/Models/State/StateUpdateModel.php @@ -20,11 +20,13 @@ final class StateUpdateModel extends JsonObjectModel implements StateUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?StateUpdateActionCollection */ protected $actions; @@ -44,6 +46,7 @@ public function __construct( /** *

    Expected version of the State on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * * @return null|int */ public function getVersion() @@ -63,6 +66,7 @@ public function getVersion() /** *

    Update actions to be performed on the State.

    * + * * @return null|StateUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Store/ProductSelectionSetting.php b/lib/commercetools-api/src/Models/Store/ProductSelectionSetting.php index 49562227942..deb5d54bffa 100644 --- a/lib/commercetools-api/src/Models/Store/ProductSelectionSetting.php +++ b/lib/commercetools-api/src/Models/Store/ProductSelectionSetting.php @@ -20,6 +20,7 @@ interface ProductSelectionSetting extends JsonObject /** *

    Reference to a ProductSelection.

    * + * @return null|ProductSelectionReference */ public function getProductSelection(); @@ -27,6 +28,7 @@ public function getProductSelection(); /** *

    If true, all Products assigned to this Product Selection are part of the Store's assortment.

    * + * @return null|bool */ public function getActive(); diff --git a/lib/commercetools-api/src/Models/Store/ProductSelectionSettingBuilder.php b/lib/commercetools-api/src/Models/Store/ProductSelectionSettingBuilder.php index 8383c7256f3..3435ce62d5f 100644 --- a/lib/commercetools-api/src/Models/Store/ProductSelectionSettingBuilder.php +++ b/lib/commercetools-api/src/Models/Store/ProductSelectionSettingBuilder.php @@ -23,11 +23,13 @@ final class ProductSelectionSettingBuilder implements Builder { /** + * @var null|ProductSelectionReference|ProductSelectionReferenceBuilder */ private $productSelection; /** + * @var ?bool */ private $active; @@ -35,6 +37,7 @@ final class ProductSelectionSettingBuilder implements Builder /** *

    Reference to a ProductSelection.

    * + * @return null|ProductSelectionReference */ public function getProductSelection() @@ -45,6 +48,7 @@ public function getProductSelection() /** *

    If true, all Products assigned to this Product Selection are part of the Store's assortment.

    * + * @return null|bool */ public function getActive() diff --git a/lib/commercetools-api/src/Models/Store/ProductSelectionSettingDraft.php b/lib/commercetools-api/src/Models/Store/ProductSelectionSettingDraft.php index f1c235fdd91..d100b49a83c 100644 --- a/lib/commercetools-api/src/Models/Store/ProductSelectionSettingDraft.php +++ b/lib/commercetools-api/src/Models/Store/ProductSelectionSettingDraft.php @@ -20,6 +20,7 @@ interface ProductSelectionSettingDraft extends JsonObject /** *

    Resource Identifier of a ProductSelection.

    * + * @return null|ProductSelectionResourceIdentifier */ public function getProductSelection(); @@ -27,6 +28,7 @@ public function getProductSelection(); /** *

    Set to true if all Products assigned to the Product Selection should become part of the Store's assortment.

    * + * @return null|bool */ public function getActive(); diff --git a/lib/commercetools-api/src/Models/Store/ProductSelectionSettingDraftBuilder.php b/lib/commercetools-api/src/Models/Store/ProductSelectionSettingDraftBuilder.php index 8b2b2e396ed..ec48481fcbf 100644 --- a/lib/commercetools-api/src/Models/Store/ProductSelectionSettingDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Store/ProductSelectionSettingDraftBuilder.php @@ -23,11 +23,13 @@ final class ProductSelectionSettingDraftBuilder implements Builder { /** + * @var null|ProductSelectionResourceIdentifier|ProductSelectionResourceIdentifierBuilder */ private $productSelection; /** + * @var ?bool */ private $active; @@ -35,6 +37,7 @@ final class ProductSelectionSettingDraftBuilder implements Builder /** *

    Resource Identifier of a ProductSelection.

    * + * @return null|ProductSelectionResourceIdentifier */ public function getProductSelection() @@ -45,6 +48,7 @@ public function getProductSelection() /** *

    Set to true if all Products assigned to the Product Selection should become part of the Store's assortment.

    * + * @return null|bool */ public function getActive() diff --git a/lib/commercetools-api/src/Models/Store/ProductSelectionSettingDraftModel.php b/lib/commercetools-api/src/Models/Store/ProductSelectionSettingDraftModel.php index 8aeb5a838f1..f3bbd80cb8c 100644 --- a/lib/commercetools-api/src/Models/Store/ProductSelectionSettingDraftModel.php +++ b/lib/commercetools-api/src/Models/Store/ProductSelectionSettingDraftModel.php @@ -22,11 +22,13 @@ final class ProductSelectionSettingDraftModel extends JsonObjectModel implements ProductSelectionSettingDraft { /** + * * @var ?ProductSelectionResourceIdentifier */ protected $productSelection; /** + * * @var ?bool */ protected $active; @@ -46,6 +48,7 @@ public function __construct( /** *

    Resource Identifier of a ProductSelection.

    * + * * @return null|ProductSelectionResourceIdentifier */ public function getProductSelection() @@ -66,6 +69,7 @@ public function getProductSelection() /** *

    Set to true if all Products assigned to the Product Selection should become part of the Store's assortment.

    * + * * @return null|bool */ public function getActive() diff --git a/lib/commercetools-api/src/Models/Store/ProductSelectionSettingModel.php b/lib/commercetools-api/src/Models/Store/ProductSelectionSettingModel.php index 7f0e7f221f9..c841da555c6 100644 --- a/lib/commercetools-api/src/Models/Store/ProductSelectionSettingModel.php +++ b/lib/commercetools-api/src/Models/Store/ProductSelectionSettingModel.php @@ -22,11 +22,13 @@ final class ProductSelectionSettingModel extends JsonObjectModel implements ProductSelectionSetting { /** + * * @var ?ProductSelectionReference */ protected $productSelection; /** + * * @var ?bool */ protected $active; @@ -46,6 +48,7 @@ public function __construct( /** *

    Reference to a ProductSelection.

    * + * * @return null|ProductSelectionReference */ public function getProductSelection() @@ -66,6 +69,7 @@ public function getProductSelection() /** *

    If true, all Products assigned to this Product Selection are part of the Store's assortment.

    * + * * @return null|bool */ public function getActive() diff --git a/lib/commercetools-api/src/Models/Store/Store.php b/lib/commercetools-api/src/Models/Store/Store.php index eef10097d10..92bac6fa5c0 100644 --- a/lib/commercetools-api/src/Models/Store/Store.php +++ b/lib/commercetools-api/src/Models/Store/Store.php @@ -33,6 +33,7 @@ interface Store extends BaseResource /** *

    Unique ID of the Store.

    * + * @return null|string */ public function getId(); @@ -40,6 +41,7 @@ public function getId(); /** *

    Current version of the Store.

    * + * @return null|int */ public function getVersion(); @@ -47,6 +49,7 @@ public function getVersion(); /** *

    Date and time (UTC) the Store was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -54,6 +57,7 @@ public function getCreatedAt(); /** *

    Date and time (UTC) the Store was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -61,6 +65,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -68,6 +73,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -75,6 +81,7 @@ public function getCreatedBy(); /** *

    User-defined unique and immutable identifier for the Store.

    * + * @return null|string */ public function getKey(); @@ -82,6 +89,7 @@ public function getKey(); /** *

    Name of the Store.

    * + * @return null|LocalizedString */ public function getName(); @@ -89,6 +97,7 @@ public function getName(); /** *

    Languages configured for the Store.

    * + * @return null|array */ public function getLanguages(); @@ -96,6 +105,7 @@ public function getLanguages(); /** *

    Product Distribution Channels allowed for the Store.

    * + * @return null|ChannelReferenceCollection */ public function getDistributionChannels(); @@ -103,6 +113,7 @@ public function getDistributionChannels(); /** *

    Inventory Supply Channels allowed for the Store.

    * + * @return null|ChannelReferenceCollection */ public function getSupplyChannels(); @@ -114,6 +125,7 @@ public function getSupplyChannels(); *
  • If provided, Products from active Product Selections are available in this Store.
  • * * + * @return null|ProductSelectionSettingCollection */ public function getProductSelections(); @@ -121,6 +133,7 @@ public function getProductSelections(); /** *

    Custom fields for the Store.

    * + * @return null|CustomFields */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Store/StoreAddDistributionChannelAction.php b/lib/commercetools-api/src/Models/Store/StoreAddDistributionChannelAction.php index 0f829134b0a..14d7d797315 100644 --- a/lib/commercetools-api/src/Models/Store/StoreAddDistributionChannelAction.php +++ b/lib/commercetools-api/src/Models/Store/StoreAddDistributionChannelAction.php @@ -19,6 +19,7 @@ interface StoreAddDistributionChannelAction extends StoreUpdateAction /** *

    Value to append. Any attempt to use Channel without the ProductDistribution ChannelRoleEnum will fail with a MissingRoleOnChannelError error.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel(); diff --git a/lib/commercetools-api/src/Models/Store/StoreAddDistributionChannelActionBuilder.php b/lib/commercetools-api/src/Models/Store/StoreAddDistributionChannelActionBuilder.php index 757df6d548a..a7e4a625580 100644 --- a/lib/commercetools-api/src/Models/Store/StoreAddDistributionChannelActionBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreAddDistributionChannelActionBuilder.php @@ -23,6 +23,7 @@ final class StoreAddDistributionChannelActionBuilder implements Builder { /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $distributionChannel; @@ -30,6 +31,7 @@ final class StoreAddDistributionChannelActionBuilder implements Builder /** *

    Value to append. Any attempt to use Channel without the ProductDistribution ChannelRoleEnum will fail with a MissingRoleOnChannelError error.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/Store/StoreAddDistributionChannelActionModel.php b/lib/commercetools-api/src/Models/Store/StoreAddDistributionChannelActionModel.php index aeebcff6ee6..5adc6860ceb 100644 --- a/lib/commercetools-api/src/Models/Store/StoreAddDistributionChannelActionModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreAddDistributionChannelActionModel.php @@ -23,11 +23,13 @@ final class StoreAddDistributionChannelActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'addDistributionChannel'; /** + * * @var ?string */ protected $action; /** + * * @var ?ChannelResourceIdentifier */ protected $distributionChannel; @@ -37,13 +39,15 @@ final class StoreAddDistributionChannelActionModel extends JsonObjectModel imple * @psalm-suppress MissingParamType */ public function __construct( - ?ChannelResourceIdentifier $distributionChannel = null + ?ChannelResourceIdentifier $distributionChannel = null, + ?string $action = null ) { $this->distributionChannel = $distributionChannel; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Value to append. Any attempt to use Channel without the ProductDistribution ChannelRoleEnum will fail with a MissingRoleOnChannelError error.

    * + * * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/Store/StoreAddProductSelectionAction.php b/lib/commercetools-api/src/Models/Store/StoreAddProductSelectionAction.php index f726f6ed820..52dbf5f88f6 100644 --- a/lib/commercetools-api/src/Models/Store/StoreAddProductSelectionAction.php +++ b/lib/commercetools-api/src/Models/Store/StoreAddProductSelectionAction.php @@ -20,6 +20,7 @@ interface StoreAddProductSelectionAction extends StoreUpdateAction /** *

    Product Selection to add to the Store either activated or deactivated.

    * + * @return null|ProductSelectionResourceIdentifier */ public function getProductSelection(); @@ -27,6 +28,7 @@ public function getProductSelection(); /** *

    Set to true to make all Products assigned to the referenced Product Selection available in the Store.

    * + * @return null|bool */ public function getActive(); diff --git a/lib/commercetools-api/src/Models/Store/StoreAddProductSelectionActionBuilder.php b/lib/commercetools-api/src/Models/Store/StoreAddProductSelectionActionBuilder.php index 383a1f83c72..b1b58299d59 100644 --- a/lib/commercetools-api/src/Models/Store/StoreAddProductSelectionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreAddProductSelectionActionBuilder.php @@ -23,11 +23,13 @@ final class StoreAddProductSelectionActionBuilder implements Builder { /** + * @var null|ProductSelectionResourceIdentifier|ProductSelectionResourceIdentifierBuilder */ private $productSelection; /** + * @var ?bool */ private $active; @@ -35,6 +37,7 @@ final class StoreAddProductSelectionActionBuilder implements Builder /** *

    Product Selection to add to the Store either activated or deactivated.

    * + * @return null|ProductSelectionResourceIdentifier */ public function getProductSelection() @@ -45,6 +48,7 @@ public function getProductSelection() /** *

    Set to true to make all Products assigned to the referenced Product Selection available in the Store.

    * + * @return null|bool */ public function getActive() diff --git a/lib/commercetools-api/src/Models/Store/StoreAddProductSelectionActionModel.php b/lib/commercetools-api/src/Models/Store/StoreAddProductSelectionActionModel.php index 7a5c28e317a..7c972e6fe30 100644 --- a/lib/commercetools-api/src/Models/Store/StoreAddProductSelectionActionModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreAddProductSelectionActionModel.php @@ -23,16 +23,19 @@ final class StoreAddProductSelectionActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'addProductSelection'; /** + * * @var ?string */ protected $action; /** + * * @var ?ProductSelectionResourceIdentifier */ protected $productSelection; /** + * * @var ?bool */ protected $active; @@ -43,14 +46,16 @@ final class StoreAddProductSelectionActionModel extends JsonObjectModel implemen */ public function __construct( ?ProductSelectionResourceIdentifier $productSelection = null, - ?bool $active = null + ?bool $active = null, + ?string $action = null ) { $this->productSelection = $productSelection; $this->active = $active; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() /** *

    Product Selection to add to the Store either activated or deactivated.

    * + * * @return null|ProductSelectionResourceIdentifier */ public function getProductSelection() @@ -90,6 +96,7 @@ public function getProductSelection() /** *

    Set to true to make all Products assigned to the referenced Product Selection available in the Store.

    * + * * @return null|bool */ public function getActive() diff --git a/lib/commercetools-api/src/Models/Store/StoreAddSupplyChannelAction.php b/lib/commercetools-api/src/Models/Store/StoreAddSupplyChannelAction.php index a379b95c665..f1c544a3ba0 100644 --- a/lib/commercetools-api/src/Models/Store/StoreAddSupplyChannelAction.php +++ b/lib/commercetools-api/src/Models/Store/StoreAddSupplyChannelAction.php @@ -19,6 +19,7 @@ interface StoreAddSupplyChannelAction extends StoreUpdateAction /** *

    Any attempt to use Channel without the InventorySupply ChannelRoleEnum will fail with a MissingRoleOnChannel error.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel(); diff --git a/lib/commercetools-api/src/Models/Store/StoreAddSupplyChannelActionBuilder.php b/lib/commercetools-api/src/Models/Store/StoreAddSupplyChannelActionBuilder.php index 469a133e64d..4930a72c05e 100644 --- a/lib/commercetools-api/src/Models/Store/StoreAddSupplyChannelActionBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreAddSupplyChannelActionBuilder.php @@ -23,6 +23,7 @@ final class StoreAddSupplyChannelActionBuilder implements Builder { /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $supplyChannel; @@ -30,6 +31,7 @@ final class StoreAddSupplyChannelActionBuilder implements Builder /** *

    Any attempt to use Channel without the InventorySupply ChannelRoleEnum will fail with a MissingRoleOnChannel error.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() diff --git a/lib/commercetools-api/src/Models/Store/StoreAddSupplyChannelActionModel.php b/lib/commercetools-api/src/Models/Store/StoreAddSupplyChannelActionModel.php index b3ac027da4d..a57ae83c360 100644 --- a/lib/commercetools-api/src/Models/Store/StoreAddSupplyChannelActionModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreAddSupplyChannelActionModel.php @@ -23,11 +23,13 @@ final class StoreAddSupplyChannelActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'addSupplyChannel'; /** + * * @var ?string */ protected $action; /** + * * @var ?ChannelResourceIdentifier */ protected $supplyChannel; @@ -37,13 +39,15 @@ final class StoreAddSupplyChannelActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?ChannelResourceIdentifier $supplyChannel = null + ?ChannelResourceIdentifier $supplyChannel = null, + ?string $action = null ) { $this->supplyChannel = $supplyChannel; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Any attempt to use Channel without the InventorySupply ChannelRoleEnum will fail with a MissingRoleOnChannel error.

    * + * * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() diff --git a/lib/commercetools-api/src/Models/Store/StoreBuilder.php b/lib/commercetools-api/src/Models/Store/StoreBuilder.php index b8282f12004..fd17f34139a 100644 --- a/lib/commercetools-api/src/Models/Store/StoreBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreBuilder.php @@ -33,66 +33,79 @@ final class StoreBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?array */ private $languages; /** + * @var ?ChannelReferenceCollection */ private $distributionChannels; /** + * @var ?ChannelReferenceCollection */ private $supplyChannels; /** + * @var ?ProductSelectionSettingCollection */ private $productSelections; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; @@ -100,6 +113,7 @@ final class StoreBuilder implements Builder /** *

    Unique ID of the Store.

    * + * @return null|string */ public function getId() @@ -110,6 +124,7 @@ public function getId() /** *

    Current version of the Store.

    * + * @return null|int */ public function getVersion() @@ -120,6 +135,7 @@ public function getVersion() /** *

    Date and time (UTC) the Store was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -130,6 +146,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the Store was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -140,6 +157,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -150,6 +168,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -160,6 +179,7 @@ public function getCreatedBy() /** *

    User-defined unique and immutable identifier for the Store.

    * + * @return null|string */ public function getKey() @@ -170,6 +190,7 @@ public function getKey() /** *

    Name of the Store.

    * + * @return null|LocalizedString */ public function getName() @@ -180,6 +201,7 @@ public function getName() /** *

    Languages configured for the Store.

    * + * @return null|array */ public function getLanguages() @@ -190,6 +212,7 @@ public function getLanguages() /** *

    Product Distribution Channels allowed for the Store.

    * + * @return null|ChannelReferenceCollection */ public function getDistributionChannels() @@ -200,6 +223,7 @@ public function getDistributionChannels() /** *

    Inventory Supply Channels allowed for the Store.

    * + * @return null|ChannelReferenceCollection */ public function getSupplyChannels() @@ -214,6 +238,7 @@ public function getSupplyChannels() *
  • If provided, Products from active Product Selections are available in this Store.
  • * * + * @return null|ProductSelectionSettingCollection */ public function getProductSelections() @@ -224,6 +249,7 @@ public function getProductSelections() /** *

    Custom fields for the Store.

    * + * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Store/StoreChangeProductSelectionAction.php b/lib/commercetools-api/src/Models/Store/StoreChangeProductSelectionAction.php index 2d5ad8746ef..9c17007d667 100644 --- a/lib/commercetools-api/src/Models/Store/StoreChangeProductSelectionAction.php +++ b/lib/commercetools-api/src/Models/Store/StoreChangeProductSelectionAction.php @@ -20,6 +20,7 @@ interface StoreChangeProductSelectionAction extends StoreUpdateAction /** *

    Current Product Selection of the Store to be activated or deactivated.

    * + * @return null|ProductSelectionResourceIdentifier */ public function getProductSelection(); @@ -27,6 +28,7 @@ public function getProductSelection(); /** *

    Set to true if all Products assigned to the Product Selection should become part of the Store's assortment.

    * + * @return null|bool */ public function getActive(); diff --git a/lib/commercetools-api/src/Models/Store/StoreChangeProductSelectionActionBuilder.php b/lib/commercetools-api/src/Models/Store/StoreChangeProductSelectionActionBuilder.php index 02fc474231f..e44f0a26f05 100644 --- a/lib/commercetools-api/src/Models/Store/StoreChangeProductSelectionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreChangeProductSelectionActionBuilder.php @@ -23,11 +23,13 @@ final class StoreChangeProductSelectionActionBuilder implements Builder { /** + * @var null|ProductSelectionResourceIdentifier|ProductSelectionResourceIdentifierBuilder */ private $productSelection; /** + * @var ?bool */ private $active; @@ -35,6 +37,7 @@ final class StoreChangeProductSelectionActionBuilder implements Builder /** *

    Current Product Selection of the Store to be activated or deactivated.

    * + * @return null|ProductSelectionResourceIdentifier */ public function getProductSelection() @@ -45,6 +48,7 @@ public function getProductSelection() /** *

    Set to true if all Products assigned to the Product Selection should become part of the Store's assortment.

    * + * @return null|bool */ public function getActive() diff --git a/lib/commercetools-api/src/Models/Store/StoreChangeProductSelectionActionModel.php b/lib/commercetools-api/src/Models/Store/StoreChangeProductSelectionActionModel.php index 550e08e3774..1aeee43dc01 100644 --- a/lib/commercetools-api/src/Models/Store/StoreChangeProductSelectionActionModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreChangeProductSelectionActionModel.php @@ -23,16 +23,19 @@ final class StoreChangeProductSelectionActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'changeProductSelectionActive'; /** + * * @var ?string */ protected $action; /** + * * @var ?ProductSelectionResourceIdentifier */ protected $productSelection; /** + * * @var ?bool */ protected $active; @@ -43,14 +46,16 @@ final class StoreChangeProductSelectionActionModel extends JsonObjectModel imple */ public function __construct( ?ProductSelectionResourceIdentifier $productSelection = null, - ?bool $active = null + ?bool $active = null, + ?string $action = null ) { $this->productSelection = $productSelection; $this->active = $active; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() /** *

    Current Product Selection of the Store to be activated or deactivated.

    * + * * @return null|ProductSelectionResourceIdentifier */ public function getProductSelection() @@ -90,6 +96,7 @@ public function getProductSelection() /** *

    Set to true if all Products assigned to the Product Selection should become part of the Store's assortment.

    * + * * @return null|bool */ public function getActive() diff --git a/lib/commercetools-api/src/Models/Store/StoreDraft.php b/lib/commercetools-api/src/Models/Store/StoreDraft.php index 1b71dd3184d..a55cbea5a5b 100644 --- a/lib/commercetools-api/src/Models/Store/StoreDraft.php +++ b/lib/commercetools-api/src/Models/Store/StoreDraft.php @@ -28,6 +28,7 @@ interface StoreDraft extends JsonObject *

    User-defined unique and immutable identifier for the Store. * Keys can only contain alphanumeric characters, underscores, and hyphens.

    * + * @return null|string */ public function getKey(); @@ -35,6 +36,7 @@ public function getKey(); /** *

    Name of the Store.

    * + * @return null|LocalizedString */ public function getName(); @@ -42,20 +44,23 @@ public function getName(); /** *

    Languages defined in Project. Only languages defined in the Project can be used.

    * + * @return null|array */ public function getLanguages(); /** - *

    ResourceIdentifier to a Channel with ProductDistribution ChannelRoleEnum.

    + *

    ResourceIdentifier of a Channel with ProductDistribution ChannelRoleEnum.

    * + * @return null|ChannelResourceIdentifierCollection */ public function getDistributionChannels(); /** - *

    ResourceIdentifier to a Channel with InventorySupply ChannelRoleEnum.

    + *

    ResourceIdentifier of a Channel with InventorySupply ChannelRoleEnum.

    * + * @return null|ChannelResourceIdentifierCollection */ public function getSupplyChannels(); @@ -67,6 +72,7 @@ public function getSupplyChannels(); *
  • If provided, Products from active Product Selections are available in this Store.
  • * * + * @return null|ProductSelectionSettingDraftCollection */ public function getProductSelections(); @@ -74,6 +80,7 @@ public function getProductSelections(); /** *

    Custom fields for the Store.

    * + * @return null|CustomFieldsDraft */ public function getCustom(); diff --git a/lib/commercetools-api/src/Models/Store/StoreDraftBuilder.php b/lib/commercetools-api/src/Models/Store/StoreDraftBuilder.php index 78a2903b0ec..cc0c1e8f294 100644 --- a/lib/commercetools-api/src/Models/Store/StoreDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreDraftBuilder.php @@ -26,36 +26,43 @@ final class StoreDraftBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?array */ private $languages; /** + * @var ?ChannelResourceIdentifierCollection */ private $distributionChannels; /** + * @var ?ChannelResourceIdentifierCollection */ private $supplyChannels; /** + * @var ?ProductSelectionSettingDraftCollection */ private $productSelections; /** + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ private $custom; @@ -64,6 +71,7 @@ final class StoreDraftBuilder implements Builder *

    User-defined unique and immutable identifier for the Store. * Keys can only contain alphanumeric characters, underscores, and hyphens.

    * + * @return null|string */ public function getKey() @@ -74,6 +82,7 @@ public function getKey() /** *

    Name of the Store.

    * + * @return null|LocalizedString */ public function getName() @@ -84,6 +93,7 @@ public function getName() /** *

    Languages defined in Project. Only languages defined in the Project can be used.

    * + * @return null|array */ public function getLanguages() @@ -92,8 +102,9 @@ public function getLanguages() } /** - *

    ResourceIdentifier to a Channel with ProductDistribution ChannelRoleEnum.

    + *

    ResourceIdentifier of a Channel with ProductDistribution ChannelRoleEnum.

    * + * @return null|ChannelResourceIdentifierCollection */ public function getDistributionChannels() @@ -102,8 +113,9 @@ public function getDistributionChannels() } /** - *

    ResourceIdentifier to a Channel with InventorySupply ChannelRoleEnum.

    + *

    ResourceIdentifier of a Channel with InventorySupply ChannelRoleEnum.

    * + * @return null|ChannelResourceIdentifierCollection */ public function getSupplyChannels() @@ -118,6 +130,7 @@ public function getSupplyChannels() *
  • If provided, Products from active Product Selections are available in this Store.
  • * * + * @return null|ProductSelectionSettingDraftCollection */ public function getProductSelections() @@ -128,6 +141,7 @@ public function getProductSelections() /** *

    Custom fields for the Store.

    * + * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Store/StoreDraftModel.php b/lib/commercetools-api/src/Models/Store/StoreDraftModel.php index 0e0c219760f..7953882741c 100644 --- a/lib/commercetools-api/src/Models/Store/StoreDraftModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreDraftModel.php @@ -25,36 +25,43 @@ final class StoreDraftModel extends JsonObjectModel implements StoreDraft { /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?array */ protected $languages; /** + * * @var ?ChannelResourceIdentifierCollection */ protected $distributionChannels; /** + * * @var ?ChannelResourceIdentifierCollection */ protected $supplyChannels; /** + * * @var ?ProductSelectionSettingDraftCollection */ protected $productSelections; /** + * * @var ?CustomFieldsDraft */ protected $custom; @@ -85,6 +92,7 @@ public function __construct( *

    User-defined unique and immutable identifier for the Store. * Keys can only contain alphanumeric characters, underscores, and hyphens.

    * + * * @return null|string */ public function getKey() @@ -104,6 +112,7 @@ public function getKey() /** *

    Name of the Store.

    * + * * @return null|LocalizedString */ public function getName() @@ -124,6 +133,7 @@ public function getName() /** *

    Languages defined in Project. Only languages defined in the Project can be used.

    * + * * @return null|array */ public function getLanguages() @@ -141,7 +151,8 @@ public function getLanguages() } /** - *

    ResourceIdentifier to a Channel with ProductDistribution ChannelRoleEnum.

    + *

    ResourceIdentifier of a Channel with ProductDistribution ChannelRoleEnum.

    + * * * @return null|ChannelResourceIdentifierCollection */ @@ -160,7 +171,8 @@ public function getDistributionChannels() } /** - *

    ResourceIdentifier to a Channel with InventorySupply ChannelRoleEnum.

    + *

    ResourceIdentifier of a Channel with InventorySupply ChannelRoleEnum.

    + * * * @return null|ChannelResourceIdentifierCollection */ @@ -185,6 +197,7 @@ public function getSupplyChannels() *
  • If provided, Products from active Product Selections are available in this Store.
  • * * + * * @return null|ProductSelectionSettingDraftCollection */ public function getProductSelections() @@ -204,6 +217,7 @@ public function getProductSelections() /** *

    Custom fields for the Store.

    * + * * @return null|CustomFieldsDraft */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Store/StoreKeyReference.php b/lib/commercetools-api/src/Models/Store/StoreKeyReference.php index 7f3451c2500..dbb8fb7b317 100644 --- a/lib/commercetools-api/src/Models/Store/StoreKeyReference.php +++ b/lib/commercetools-api/src/Models/Store/StoreKeyReference.php @@ -17,6 +17,7 @@ interface StoreKeyReference extends KeyReference /** *

    Unique and immutable key of the referenced Store.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Store/StoreKeyReferenceBuilder.php b/lib/commercetools-api/src/Models/Store/StoreKeyReferenceBuilder.php index 7151c487915..ab891b54710 100644 --- a/lib/commercetools-api/src/Models/Store/StoreKeyReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreKeyReferenceBuilder.php @@ -23,6 +23,7 @@ final class StoreKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; @@ -30,6 +31,7 @@ final class StoreKeyReferenceBuilder implements Builder /** *

    Unique and immutable key of the referenced Store.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Store/StoreKeyReferenceModel.php b/lib/commercetools-api/src/Models/Store/StoreKeyReferenceModel.php index d635eda934d..bc5c51e2876 100644 --- a/lib/commercetools-api/src/Models/Store/StoreKeyReferenceModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreKeyReferenceModel.php @@ -23,11 +23,13 @@ final class StoreKeyReferenceModel extends JsonObjectModel implements StoreKeyRe { public const DISCRIMINATOR_VALUE = 'store'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $key; @@ -37,15 +39,17 @@ final class StoreKeyReferenceModel extends JsonObjectModel implements StoreKeyRe * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -65,6 +69,7 @@ public function getTypeId() /** *

    Unique and immutable key of the referenced Store.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Store/StoreModel.php b/lib/commercetools-api/src/Models/Store/StoreModel.php index 31fd40d4673..13616dc06f9 100644 --- a/lib/commercetools-api/src/Models/Store/StoreModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreModel.php @@ -32,66 +32,79 @@ final class StoreModel extends JsonObjectModel implements Store { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?array */ protected $languages; /** + * * @var ?ChannelReferenceCollection */ protected $distributionChannels; /** + * * @var ?ChannelReferenceCollection */ protected $supplyChannels; /** + * * @var ?ProductSelectionSettingCollection */ protected $productSelections; /** + * * @var ?CustomFields */ protected $custom; @@ -133,6 +146,7 @@ public function __construct( /** *

    Unique ID of the Store.

    * + * * @return null|string */ public function getId() @@ -152,6 +166,7 @@ public function getId() /** *

    Current version of the Store.

    * + * * @return null|int */ public function getVersion() @@ -171,6 +186,7 @@ public function getVersion() /** *

    Date and time (UTC) the Store was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -194,6 +210,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the Store was last updated.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -217,6 +234,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -237,6 +255,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -257,6 +276,7 @@ public function getCreatedBy() /** *

    User-defined unique and immutable identifier for the Store.

    * + * * @return null|string */ public function getKey() @@ -276,6 +296,7 @@ public function getKey() /** *

    Name of the Store.

    * + * * @return null|LocalizedString */ public function getName() @@ -296,6 +317,7 @@ public function getName() /** *

    Languages configured for the Store.

    * + * * @return null|array */ public function getLanguages() @@ -315,6 +337,7 @@ public function getLanguages() /** *

    Product Distribution Channels allowed for the Store.

    * + * * @return null|ChannelReferenceCollection */ public function getDistributionChannels() @@ -334,6 +357,7 @@ public function getDistributionChannels() /** *

    Inventory Supply Channels allowed for the Store.

    * + * * @return null|ChannelReferenceCollection */ public function getSupplyChannels() @@ -357,6 +381,7 @@ public function getSupplyChannels() *
  • If provided, Products from active Product Selections are available in this Store.
  • * * + * * @return null|ProductSelectionSettingCollection */ public function getProductSelections() @@ -376,6 +401,7 @@ public function getProductSelections() /** *

    Custom fields for the Store.

    * + * * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-api/src/Models/Store/StorePagedQueryResponse.php b/lib/commercetools-api/src/Models/Store/StorePagedQueryResponse.php index cead1e8ee68..9151b9ee124 100644 --- a/lib/commercetools-api/src/Models/Store/StorePagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Store/StorePagedQueryResponse.php @@ -22,6 +22,7 @@ interface StorePagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    Stores matching the query.

    * + * @return null|StoreCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/Store/StorePagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Store/StorePagedQueryResponseBuilder.php index 25c72d04df4..bf049d5e391 100644 --- a/lib/commercetools-api/src/Models/Store/StorePagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StorePagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class StorePagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?StoreCollection */ private $results; @@ -48,6 +53,7 @@ final class StorePagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    Stores matching the query.

    * + * @return null|StoreCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Store/StorePagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Store/StorePagedQueryResponseModel.php index 31b1b6d6602..1fd67461982 100644 --- a/lib/commercetools-api/src/Models/Store/StorePagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Store/StorePagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class StorePagedQueryResponseModel extends JsonObjectModel implements StorePagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?StoreCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    Stores matching the query.

    * + * * @return null|StoreCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Store/StoreReference.php b/lib/commercetools-api/src/Models/Store/StoreReference.php index 75b797bb59b..b47fa23ebb7 100644 --- a/lib/commercetools-api/src/Models/Store/StoreReference.php +++ b/lib/commercetools-api/src/Models/Store/StoreReference.php @@ -19,6 +19,7 @@ interface StoreReference extends Reference /** *

    Contains the representation of the expanded Store. Only present in responses to requests with Reference Expansion for Stores.

    * + * @return null|Store */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

    Unique ID of the referenced Store.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/Store/StoreReferenceBuilder.php b/lib/commercetools-api/src/Models/Store/StoreReferenceBuilder.php index a68ee130884..cf5437719b0 100644 --- a/lib/commercetools-api/src/Models/Store/StoreReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreReferenceBuilder.php @@ -23,11 +23,13 @@ final class StoreReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|Store|StoreBuilder */ private $obj; @@ -35,6 +37,7 @@ final class StoreReferenceBuilder implements Builder /** *

    Unique ID of the referenced Store.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded Store. Only present in responses to requests with Reference Expansion for Stores.

    * + * @return null|Store */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Store/StoreReferenceModel.php b/lib/commercetools-api/src/Models/Store/StoreReferenceModel.php index 1216846ae84..05191e55d99 100644 --- a/lib/commercetools-api/src/Models/Store/StoreReferenceModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreReferenceModel.php @@ -23,16 +23,19 @@ final class StoreReferenceModel extends JsonObjectModel implements StoreReferenc { public const DISCRIMINATOR_VALUE = 'store'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?Store */ protected $obj; @@ -43,16 +46,18 @@ final class StoreReferenceModel extends JsonObjectModel implements StoreReferenc */ public function __construct( ?string $id = null, - ?Store $obj = null + ?Store $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique ID of the referenced Store.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded Store. Only present in responses to requests with Reference Expansion for Stores.

    * + * * @return null|Store */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Store/StoreRemoveDistributionChannelAction.php b/lib/commercetools-api/src/Models/Store/StoreRemoveDistributionChannelAction.php index 27a118b20ac..b3559474e8e 100644 --- a/lib/commercetools-api/src/Models/Store/StoreRemoveDistributionChannelAction.php +++ b/lib/commercetools-api/src/Models/Store/StoreRemoveDistributionChannelAction.php @@ -19,6 +19,7 @@ interface StoreRemoveDistributionChannelAction extends StoreUpdateAction /** *

    Value to remove. ResourceIdentifier of a Channel with the ProductDistribution ChannelRoleEnum.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel(); diff --git a/lib/commercetools-api/src/Models/Store/StoreRemoveDistributionChannelActionBuilder.php b/lib/commercetools-api/src/Models/Store/StoreRemoveDistributionChannelActionBuilder.php index d423a212b29..8f69dc14fb8 100644 --- a/lib/commercetools-api/src/Models/Store/StoreRemoveDistributionChannelActionBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreRemoveDistributionChannelActionBuilder.php @@ -23,6 +23,7 @@ final class StoreRemoveDistributionChannelActionBuilder implements Builder { /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $distributionChannel; @@ -30,6 +31,7 @@ final class StoreRemoveDistributionChannelActionBuilder implements Builder /** *

    Value to remove. ResourceIdentifier of a Channel with the ProductDistribution ChannelRoleEnum.

    * + * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/Store/StoreRemoveDistributionChannelActionModel.php b/lib/commercetools-api/src/Models/Store/StoreRemoveDistributionChannelActionModel.php index f32719a3c92..d4e4659ede9 100644 --- a/lib/commercetools-api/src/Models/Store/StoreRemoveDistributionChannelActionModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreRemoveDistributionChannelActionModel.php @@ -23,11 +23,13 @@ final class StoreRemoveDistributionChannelActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'removeDistributionChannel'; /** + * * @var ?string */ protected $action; /** + * * @var ?ChannelResourceIdentifier */ protected $distributionChannel; @@ -37,13 +39,15 @@ final class StoreRemoveDistributionChannelActionModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?ChannelResourceIdentifier $distributionChannel = null + ?ChannelResourceIdentifier $distributionChannel = null, + ?string $action = null ) { $this->distributionChannel = $distributionChannel; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Value to remove. ResourceIdentifier of a Channel with the ProductDistribution ChannelRoleEnum.

    * + * * @return null|ChannelResourceIdentifier */ public function getDistributionChannel() diff --git a/lib/commercetools-api/src/Models/Store/StoreRemoveProductSelectionAction.php b/lib/commercetools-api/src/Models/Store/StoreRemoveProductSelectionAction.php index 1a80b5b33ae..63d7b4aefa3 100644 --- a/lib/commercetools-api/src/Models/Store/StoreRemoveProductSelectionAction.php +++ b/lib/commercetools-api/src/Models/Store/StoreRemoveProductSelectionAction.php @@ -19,6 +19,7 @@ interface StoreRemoveProductSelectionAction extends StoreUpdateAction /** *

    Value to remove. The removed Product Selection is made offline.

    * + * @return null|ProductSelectionResourceIdentifier */ public function getProductSelection(); diff --git a/lib/commercetools-api/src/Models/Store/StoreRemoveProductSelectionActionBuilder.php b/lib/commercetools-api/src/Models/Store/StoreRemoveProductSelectionActionBuilder.php index 344c493f7bc..ea4c5172204 100644 --- a/lib/commercetools-api/src/Models/Store/StoreRemoveProductSelectionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreRemoveProductSelectionActionBuilder.php @@ -23,6 +23,7 @@ final class StoreRemoveProductSelectionActionBuilder implements Builder { /** + * @var null|ProductSelectionResourceIdentifier|ProductSelectionResourceIdentifierBuilder */ private $productSelection; @@ -30,6 +31,7 @@ final class StoreRemoveProductSelectionActionBuilder implements Builder /** *

    Value to remove. The removed Product Selection is made offline.

    * + * @return null|ProductSelectionResourceIdentifier */ public function getProductSelection() diff --git a/lib/commercetools-api/src/Models/Store/StoreRemoveProductSelectionActionModel.php b/lib/commercetools-api/src/Models/Store/StoreRemoveProductSelectionActionModel.php index f0341abe2bf..520090bba0a 100644 --- a/lib/commercetools-api/src/Models/Store/StoreRemoveProductSelectionActionModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreRemoveProductSelectionActionModel.php @@ -23,11 +23,13 @@ final class StoreRemoveProductSelectionActionModel extends JsonObjectModel imple { public const DISCRIMINATOR_VALUE = 'removeProductSelection'; /** + * * @var ?string */ protected $action; /** + * * @var ?ProductSelectionResourceIdentifier */ protected $productSelection; @@ -37,13 +39,15 @@ final class StoreRemoveProductSelectionActionModel extends JsonObjectModel imple * @psalm-suppress MissingParamType */ public function __construct( - ?ProductSelectionResourceIdentifier $productSelection = null + ?ProductSelectionResourceIdentifier $productSelection = null, + ?string $action = null ) { $this->productSelection = $productSelection; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Value to remove. The removed Product Selection is made offline.

    * + * * @return null|ProductSelectionResourceIdentifier */ public function getProductSelection() diff --git a/lib/commercetools-api/src/Models/Store/StoreRemoveSupplyChannelAction.php b/lib/commercetools-api/src/Models/Store/StoreRemoveSupplyChannelAction.php index 4648f910540..03c95f44b64 100644 --- a/lib/commercetools-api/src/Models/Store/StoreRemoveSupplyChannelAction.php +++ b/lib/commercetools-api/src/Models/Store/StoreRemoveSupplyChannelAction.php @@ -19,6 +19,7 @@ interface StoreRemoveSupplyChannelAction extends StoreUpdateAction /** *

    Value to remove. ResourceIdentifier of a Channel with the InventorySupply ChannelRoleEnum.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel(); diff --git a/lib/commercetools-api/src/Models/Store/StoreRemoveSupplyChannelActionBuilder.php b/lib/commercetools-api/src/Models/Store/StoreRemoveSupplyChannelActionBuilder.php index 27a4bcbfdc6..2d2741c0dcf 100644 --- a/lib/commercetools-api/src/Models/Store/StoreRemoveSupplyChannelActionBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreRemoveSupplyChannelActionBuilder.php @@ -23,6 +23,7 @@ final class StoreRemoveSupplyChannelActionBuilder implements Builder { /** + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ private $supplyChannel; @@ -30,6 +31,7 @@ final class StoreRemoveSupplyChannelActionBuilder implements Builder /** *

    Value to remove. ResourceIdentifier of a Channel with the InventorySupply ChannelRoleEnum.

    * + * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() diff --git a/lib/commercetools-api/src/Models/Store/StoreRemoveSupplyChannelActionModel.php b/lib/commercetools-api/src/Models/Store/StoreRemoveSupplyChannelActionModel.php index e7c50f1b4b1..e16151b81a0 100644 --- a/lib/commercetools-api/src/Models/Store/StoreRemoveSupplyChannelActionModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreRemoveSupplyChannelActionModel.php @@ -23,11 +23,13 @@ final class StoreRemoveSupplyChannelActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'removeSupplyChannel'; /** + * * @var ?string */ protected $action; /** + * * @var ?ChannelResourceIdentifier */ protected $supplyChannel; @@ -37,13 +39,15 @@ final class StoreRemoveSupplyChannelActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?ChannelResourceIdentifier $supplyChannel = null + ?ChannelResourceIdentifier $supplyChannel = null, + ?string $action = null ) { $this->supplyChannel = $supplyChannel; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Value to remove. ResourceIdentifier of a Channel with the InventorySupply ChannelRoleEnum.

    * + * * @return null|ChannelResourceIdentifier */ public function getSupplyChannel() diff --git a/lib/commercetools-api/src/Models/Store/StoreResourceIdentifier.php b/lib/commercetools-api/src/Models/Store/StoreResourceIdentifier.php index 696a5a31893..0e58a84481e 100644 --- a/lib/commercetools-api/src/Models/Store/StoreResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/Store/StoreResourceIdentifier.php @@ -17,6 +17,7 @@ interface StoreResourceIdentifier extends ResourceIdentifier /** *

    Unique ID of the referenced Store. Either id or key is required.

    * + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

    Unique key of the referenced Store. Either id or key is required.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Store/StoreResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/Store/StoreResourceIdentifierBuilder.php index 70dd1da6300..f23e33a8030 100644 --- a/lib/commercetools-api/src/Models/Store/StoreResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class StoreResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class StoreResourceIdentifierBuilder implements Builder /** *

    Unique ID of the referenced Store. Either id or key is required.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Unique key of the referenced Store. Either id or key is required.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Store/StoreResourceIdentifierModel.php b/lib/commercetools-api/src/Models/Store/StoreResourceIdentifierModel.php index 1723072dd2d..abc384f63fc 100644 --- a/lib/commercetools-api/src/Models/Store/StoreResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class StoreResourceIdentifierModel extends JsonObjectModel implements Stor { public const DISCRIMINATOR_VALUE = 'store'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class StoreResourceIdentifierModel extends JsonObjectModel implements Stor */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique ID of the referenced Store. Either id or key is required.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Unique key of the referenced Store. Either id or key is required.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Store/StoreSetCustomFieldAction.php b/lib/commercetools-api/src/Models/Store/StoreSetCustomFieldAction.php index 2d3d942b499..923e284d96c 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetCustomFieldAction.php @@ -19,6 +19,7 @@ interface StoreSetCustomFieldAction extends StoreUpdateAction /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Store/StoreSetCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Store/StoreSetCustomFieldActionBuilder.php index 26fc1912cdc..51cfe7ecd35 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetCustomFieldActionBuilder.php @@ -21,11 +21,13 @@ final class StoreSetCustomFieldActionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; @@ -33,6 +35,7 @@ final class StoreSetCustomFieldActionBuilder implements Builder /** *

    Name of the Custom Field.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Store/StoreSetCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Store/StoreSetCustomFieldActionModel.php index 3715663c0bf..51aa7313df8 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetCustomFieldActionModel.php @@ -21,16 +21,19 @@ final class StoreSetCustomFieldActionModel extends JsonObjectModel implements St { public const DISCRIMINATOR_VALUE = 'setCustomField'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -41,14 +44,16 @@ final class StoreSetCustomFieldActionModel extends JsonObjectModel implements St */ public function __construct( ?string $name = null, - $value = null + $value = null, + ?string $action = null ) { $this->name = $name; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    Name of the Custom Field.

    * + * * @return null|string */ public function getName() @@ -89,6 +95,7 @@ public function getName() * Trying to remove a field that does not exist will fail with an InvalidOperation error. * If value is provided, it is set for the field defined by name.

    * + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Store/StoreSetCustomTypeAction.php b/lib/commercetools-api/src/Models/Store/StoreSetCustomTypeAction.php index e50b604a5ad..910a6020c21 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetCustomTypeAction.php @@ -22,6 +22,7 @@ interface StoreSetCustomTypeAction extends StoreUpdateAction *

    Defines the Type that extends the Store with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Store.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Sets the Custom Fields fields for the Store.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Store/StoreSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Store/StoreSetCustomTypeActionBuilder.php index 208c3ea2cf3..22791ff7ada 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetCustomTypeActionBuilder.php @@ -25,11 +25,13 @@ final class StoreSetCustomTypeActionBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -38,6 +40,7 @@ final class StoreSetCustomTypeActionBuilder implements Builder *

    Defines the Type that extends the Store with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Store.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -48,6 +51,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Store.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Store/StoreSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Store/StoreSetCustomTypeActionModel.php index 037c9cbe721..dce89f46792 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetCustomTypeActionModel.php @@ -25,16 +25,19 @@ final class StoreSetCustomTypeActionModel extends JsonObjectModel implements Sto { public const DISCRIMINATOR_VALUE = 'setCustomType'; /** + * * @var ?string */ protected $action; /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -45,14 +48,16 @@ final class StoreSetCustomTypeActionModel extends JsonObjectModel implements Sto */ public function __construct( ?TypeResourceIdentifier $type = null, - ?FieldContainer $fields = null + ?FieldContainer $fields = null, + ?string $action = null ) { $this->type = $type; $this->fields = $fields; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -73,6 +78,7 @@ public function getAction() *

    Defines the Type that extends the Store with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Store.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -93,6 +99,7 @@ public function getType() /** *

    Sets the Custom Fields fields for the Store.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Store/StoreSetDistributionChannelsAction.php b/lib/commercetools-api/src/Models/Store/StoreSetDistributionChannelsAction.php index 245a5ec26b7..d4dc0b55415 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetDistributionChannelsAction.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetDistributionChannelsAction.php @@ -21,6 +21,7 @@ interface StoreSetDistributionChannelsAction extends StoreUpdateAction * If not defined, the Store's distributionChannels are unset. * Any attempt to use Channel without the ProductDistribution ChannelRoleEnum will fail with a MissingRoleOnChannel error.

    * + * @return null|ChannelResourceIdentifierCollection */ public function getDistributionChannels(); diff --git a/lib/commercetools-api/src/Models/Store/StoreSetDistributionChannelsActionBuilder.php b/lib/commercetools-api/src/Models/Store/StoreSetDistributionChannelsActionBuilder.php index b6dcdfe715e..f52cd1434c2 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetDistributionChannelsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetDistributionChannelsActionBuilder.php @@ -22,6 +22,7 @@ final class StoreSetDistributionChannelsActionBuilder implements Builder { /** + * @var ?ChannelResourceIdentifierCollection */ private $distributionChannels; @@ -31,6 +32,7 @@ final class StoreSetDistributionChannelsActionBuilder implements Builder * If not defined, the Store's distributionChannels are unset. * Any attempt to use Channel without the ProductDistribution ChannelRoleEnum will fail with a MissingRoleOnChannel error.

    * + * @return null|ChannelResourceIdentifierCollection */ public function getDistributionChannels() diff --git a/lib/commercetools-api/src/Models/Store/StoreSetDistributionChannelsActionModel.php b/lib/commercetools-api/src/Models/Store/StoreSetDistributionChannelsActionModel.php index bcd41c96910..1815d255dd6 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetDistributionChannelsActionModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetDistributionChannelsActionModel.php @@ -22,11 +22,13 @@ final class StoreSetDistributionChannelsActionModel extends JsonObjectModel impl { public const DISCRIMINATOR_VALUE = 'setDistributionChannels'; /** + * * @var ?string */ protected $action; /** + * * @var ?ChannelResourceIdentifierCollection */ protected $distributionChannels; @@ -36,13 +38,15 @@ final class StoreSetDistributionChannelsActionModel extends JsonObjectModel impl * @psalm-suppress MissingParamType */ public function __construct( - ?ChannelResourceIdentifierCollection $distributionChannels = null + ?ChannelResourceIdentifierCollection $distributionChannels = null, + ?string $action = null ) { $this->distributionChannels = $distributionChannels; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -64,6 +68,7 @@ public function getAction() * If not defined, the Store's distributionChannels are unset. * Any attempt to use Channel without the ProductDistribution ChannelRoleEnum will fail with a MissingRoleOnChannel error.

    * + * * @return null|ChannelResourceIdentifierCollection */ public function getDistributionChannels() diff --git a/lib/commercetools-api/src/Models/Store/StoreSetLanguagesAction.php b/lib/commercetools-api/src/Models/Store/StoreSetLanguagesAction.php index 1a0a15c0578..bbf359947ea 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetLanguagesAction.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetLanguagesAction.php @@ -19,6 +19,7 @@ interface StoreSetLanguagesAction extends StoreUpdateAction *

    Value to set. * Any attempt to use languages other than the ones defined in the Project will fail with a ProjectNotConfiguredForLanguages error.

    * + * @return null|array */ public function getLanguages(); diff --git a/lib/commercetools-api/src/Models/Store/StoreSetLanguagesActionBuilder.php b/lib/commercetools-api/src/Models/Store/StoreSetLanguagesActionBuilder.php index 9ffd2bc88a4..f9aaeaa83cc 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetLanguagesActionBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetLanguagesActionBuilder.php @@ -21,6 +21,7 @@ final class StoreSetLanguagesActionBuilder implements Builder { /** + * @var ?array */ private $languages; @@ -29,6 +30,7 @@ final class StoreSetLanguagesActionBuilder implements Builder *

    Value to set. * Any attempt to use languages other than the ones defined in the Project will fail with a ProjectNotConfiguredForLanguages error.

    * + * @return null|array */ public function getLanguages() diff --git a/lib/commercetools-api/src/Models/Store/StoreSetLanguagesActionModel.php b/lib/commercetools-api/src/Models/Store/StoreSetLanguagesActionModel.php index e7a246ffe13..cba0b62ad88 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetLanguagesActionModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetLanguagesActionModel.php @@ -21,11 +21,13 @@ final class StoreSetLanguagesActionModel extends JsonObjectModel implements Stor { public const DISCRIMINATOR_VALUE = 'setLanguages'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $languages; @@ -35,13 +37,15 @@ final class StoreSetLanguagesActionModel extends JsonObjectModel implements Stor * @psalm-suppress MissingParamType */ public function __construct( - ?array $languages = null + ?array $languages = null, + ?string $action = null ) { $this->languages = $languages; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() *

    Value to set. * Any attempt to use languages other than the ones defined in the Project will fail with a ProjectNotConfiguredForLanguages error.

    * + * * @return null|array */ public function getLanguages() diff --git a/lib/commercetools-api/src/Models/Store/StoreSetNameAction.php b/lib/commercetools-api/src/Models/Store/StoreSetNameAction.php index 5d3b0ba13d1..7a9b5564b8b 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetNameAction.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetNameAction.php @@ -19,6 +19,7 @@ interface StoreSetNameAction extends StoreUpdateAction /** *

    Value to set.

    * + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/Store/StoreSetNameActionBuilder.php b/lib/commercetools-api/src/Models/Store/StoreSetNameActionBuilder.php index 791e2735dc8..3dcf4738383 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetNameActionBuilder.php @@ -23,6 +23,7 @@ final class StoreSetNameActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; @@ -30,6 +31,7 @@ final class StoreSetNameActionBuilder implements Builder /** *

    Value to set.

    * + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Store/StoreSetNameActionModel.php b/lib/commercetools-api/src/Models/Store/StoreSetNameActionModel.php index 947eb5280e3..e6da727485f 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetNameActionModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetNameActionModel.php @@ -23,11 +23,13 @@ final class StoreSetNameActionModel extends JsonObjectModel implements StoreSetN { public const DISCRIMINATOR_VALUE = 'setName'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $name; @@ -37,13 +39,15 @@ final class StoreSetNameActionModel extends JsonObjectModel implements StoreSetN * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Value to set.

    * + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Store/StoreSetProductSelectionsAction.php b/lib/commercetools-api/src/Models/Store/StoreSetProductSelectionsAction.php index 2d0d3960e00..f7a4a83ca65 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetProductSelectionsAction.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetProductSelectionsAction.php @@ -22,6 +22,7 @@ interface StoreSetProductSelectionsAction extends StoreUpdateAction *
  • If not provided or provided as empty array, the action removes all Product Selections from this Store, meaning all Products in the Project are available in this Store.
  • * * + * @return null|ProductSelectionSettingDraftCollection */ public function getProductSelections(); diff --git a/lib/commercetools-api/src/Models/Store/StoreSetProductSelectionsActionBuilder.php b/lib/commercetools-api/src/Models/Store/StoreSetProductSelectionsActionBuilder.php index c54ca21b9db..64859919e7b 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetProductSelectionsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetProductSelectionsActionBuilder.php @@ -21,6 +21,7 @@ final class StoreSetProductSelectionsActionBuilder implements Builder { /** + * @var ?ProductSelectionSettingDraftCollection */ private $productSelections; @@ -32,6 +33,7 @@ final class StoreSetProductSelectionsActionBuilder implements Builder *
  • If not provided or provided as empty array, the action removes all Product Selections from this Store, meaning all Products in the Project are available in this Store.
  • * * + * @return null|ProductSelectionSettingDraftCollection */ public function getProductSelections() diff --git a/lib/commercetools-api/src/Models/Store/StoreSetProductSelectionsActionModel.php b/lib/commercetools-api/src/Models/Store/StoreSetProductSelectionsActionModel.php index 34336f56cd5..81d37a3b901 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetProductSelectionsActionModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetProductSelectionsActionModel.php @@ -21,11 +21,13 @@ final class StoreSetProductSelectionsActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setProductSelections'; /** + * * @var ?string */ protected $action; /** + * * @var ?ProductSelectionSettingDraftCollection */ protected $productSelections; @@ -35,13 +37,15 @@ final class StoreSetProductSelectionsActionModel extends JsonObjectModel impleme * @psalm-suppress MissingParamType */ public function __construct( - ?ProductSelectionSettingDraftCollection $productSelections = null + ?ProductSelectionSettingDraftCollection $productSelections = null, + ?string $action = null ) { $this->productSelections = $productSelections; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -65,6 +69,7 @@ public function getAction() *
  • If not provided or provided as empty array, the action removes all Product Selections from this Store, meaning all Products in the Project are available in this Store.
  • * * + * * @return null|ProductSelectionSettingDraftCollection */ public function getProductSelections() diff --git a/lib/commercetools-api/src/Models/Store/StoreSetSupplyChannelsAction.php b/lib/commercetools-api/src/Models/Store/StoreSetSupplyChannelsAction.php index 860961aa8b9..2b60b9f34a9 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetSupplyChannelsAction.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetSupplyChannelsAction.php @@ -21,6 +21,7 @@ interface StoreSetSupplyChannelsAction extends StoreUpdateAction * If not defined, the Store's supplyChannels are unset. * Any attempt to use Channel without the InventorySupply ChannelRoleEnum will fail with a MissingRoleOnChannel error.

    * + * @return null|ChannelResourceIdentifierCollection */ public function getSupplyChannels(); diff --git a/lib/commercetools-api/src/Models/Store/StoreSetSupplyChannelsActionBuilder.php b/lib/commercetools-api/src/Models/Store/StoreSetSupplyChannelsActionBuilder.php index fbb5fccf119..5fc022c5e29 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetSupplyChannelsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetSupplyChannelsActionBuilder.php @@ -22,6 +22,7 @@ final class StoreSetSupplyChannelsActionBuilder implements Builder { /** + * @var ?ChannelResourceIdentifierCollection */ private $supplyChannels; @@ -31,6 +32,7 @@ final class StoreSetSupplyChannelsActionBuilder implements Builder * If not defined, the Store's supplyChannels are unset. * Any attempt to use Channel without the InventorySupply ChannelRoleEnum will fail with a MissingRoleOnChannel error.

    * + * @return null|ChannelResourceIdentifierCollection */ public function getSupplyChannels() diff --git a/lib/commercetools-api/src/Models/Store/StoreSetSupplyChannelsActionModel.php b/lib/commercetools-api/src/Models/Store/StoreSetSupplyChannelsActionModel.php index 3c6d7427986..110e4260e85 100644 --- a/lib/commercetools-api/src/Models/Store/StoreSetSupplyChannelsActionModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreSetSupplyChannelsActionModel.php @@ -22,11 +22,13 @@ final class StoreSetSupplyChannelsActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setSupplyChannels'; /** + * * @var ?string */ protected $action; /** + * * @var ?ChannelResourceIdentifierCollection */ protected $supplyChannels; @@ -36,13 +38,15 @@ final class StoreSetSupplyChannelsActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?ChannelResourceIdentifierCollection $supplyChannels = null + ?ChannelResourceIdentifierCollection $supplyChannels = null, + ?string $action = null ) { $this->supplyChannels = $supplyChannels; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -64,6 +68,7 @@ public function getAction() * If not defined, the Store's supplyChannels are unset. * Any attempt to use Channel without the InventorySupply ChannelRoleEnum will fail with a MissingRoleOnChannel error.

    * + * * @return null|ChannelResourceIdentifierCollection */ public function getSupplyChannels() diff --git a/lib/commercetools-api/src/Models/Store/StoreUpdate.php b/lib/commercetools-api/src/Models/Store/StoreUpdate.php index 01f04ab76b7..31187a867e0 100644 --- a/lib/commercetools-api/src/Models/Store/StoreUpdate.php +++ b/lib/commercetools-api/src/Models/Store/StoreUpdate.php @@ -19,6 +19,7 @@ interface StoreUpdate extends JsonObject /** *

    Expected version of the Store on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion(); @@ -26,6 +27,7 @@ public function getVersion(); /** *

    Update actions to be performed on the Store.

    * + * @return null|StoreUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Store/StoreUpdateAction.php b/lib/commercetools-api/src/Models/Store/StoreUpdateAction.php index 5e81b9c6750..336070c0427 100644 --- a/lib/commercetools-api/src/Models/Store/StoreUpdateAction.php +++ b/lib/commercetools-api/src/Models/Store/StoreUpdateAction.php @@ -17,6 +17,7 @@ interface StoreUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Store/StoreUpdateActionModel.php b/lib/commercetools-api/src/Models/Store/StoreUpdateActionModel.php index c755634686c..8842b9ee343 100644 --- a/lib/commercetools-api/src/Models/Store/StoreUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreUpdateActionModel.php @@ -21,6 +21,7 @@ final class StoreUpdateActionModel extends JsonObjectModel implements StoreUpdat { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -50,11 +51,13 @@ final class StoreUpdateActionModel extends JsonObjectModel implements StoreUpdat * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Store/StoreUpdateBuilder.php b/lib/commercetools-api/src/Models/Store/StoreUpdateBuilder.php index 7299df1c422..449d42c9d2e 100644 --- a/lib/commercetools-api/src/Models/Store/StoreUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Store/StoreUpdateBuilder.php @@ -21,11 +21,13 @@ final class StoreUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?StoreUpdateActionCollection */ private $actions; @@ -33,6 +35,7 @@ final class StoreUpdateBuilder implements Builder /** *

    Expected version of the Store on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion() @@ -43,6 +46,7 @@ public function getVersion() /** *

    Update actions to be performed on the Store.

    * + * @return null|StoreUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Store/StoreUpdateModel.php b/lib/commercetools-api/src/Models/Store/StoreUpdateModel.php index 98a4bce3ff9..7b9e07da855 100644 --- a/lib/commercetools-api/src/Models/Store/StoreUpdateModel.php +++ b/lib/commercetools-api/src/Models/Store/StoreUpdateModel.php @@ -20,11 +20,13 @@ final class StoreUpdateModel extends JsonObjectModel implements StoreUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?StoreUpdateActionCollection */ protected $actions; @@ -44,6 +46,7 @@ public function __construct( /** *

    Expected version of the Store on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * * @return null|int */ public function getVersion() @@ -63,6 +66,7 @@ public function getVersion() /** *

    Update actions to be performed on the Store.

    * + * * @return null|StoreUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Subscription/AzureEventGridDestination.php b/lib/commercetools-api/src/Models/Subscription/AzureEventGridDestination.php index af5f9d191d6..0dd58f84b18 100644 --- a/lib/commercetools-api/src/Models/Subscription/AzureEventGridDestination.php +++ b/lib/commercetools-api/src/Models/Subscription/AzureEventGridDestination.php @@ -17,11 +17,17 @@ interface AzureEventGridDestination extends Destination public const FIELD_ACCESS_KEY = 'accessKey'; /** + *

    URI of the topic.

    + * + * @return null|string */ public function getUri(); /** + *

    Partially hidden on retrieval for security reasons.

    + * + * @return null|string */ public function getAccessKey(); diff --git a/lib/commercetools-api/src/Models/Subscription/AzureEventGridDestinationBuilder.php b/lib/commercetools-api/src/Models/Subscription/AzureEventGridDestinationBuilder.php index 5933b6666c1..f6882ba107b 100644 --- a/lib/commercetools-api/src/Models/Subscription/AzureEventGridDestinationBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/AzureEventGridDestinationBuilder.php @@ -21,16 +21,21 @@ final class AzureEventGridDestinationBuilder implements Builder { /** + * @var ?string */ private $uri; /** + * @var ?string */ private $accessKey; /** + *

    URI of the topic.

    + * + * @return null|string */ public function getUri() @@ -39,6 +44,9 @@ public function getUri() } /** + *

    Partially hidden on retrieval for security reasons.

    + * + * @return null|string */ public function getAccessKey() diff --git a/lib/commercetools-api/src/Models/Subscription/AzureEventGridDestinationModel.php b/lib/commercetools-api/src/Models/Subscription/AzureEventGridDestinationModel.php index 031c8318e14..1f5f1d49a3b 100644 --- a/lib/commercetools-api/src/Models/Subscription/AzureEventGridDestinationModel.php +++ b/lib/commercetools-api/src/Models/Subscription/AzureEventGridDestinationModel.php @@ -21,16 +21,19 @@ final class AzureEventGridDestinationModel extends JsonObjectModel implements Az { public const DISCRIMINATOR_VALUE = 'EventGrid'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $uri; /** + * * @var ?string */ protected $accessKey; @@ -41,14 +44,16 @@ final class AzureEventGridDestinationModel extends JsonObjectModel implements Az */ public function __construct( ?string $uri = null, - ?string $accessKey = null + ?string $accessKey = null, + ?string $type = null ) { $this->uri = $uri; $this->accessKey = $accessKey; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -66,6 +71,9 @@ public function getType() } /** + *

    URI of the topic.

    + * + * * @return null|string */ public function getUri() @@ -83,6 +91,9 @@ public function getUri() } /** + *

    Partially hidden on retrieval for security reasons.

    + * + * * @return null|string */ public function getAccessKey() diff --git a/lib/commercetools-api/src/Models/Subscription/AzureServiceBusDestination.php b/lib/commercetools-api/src/Models/Subscription/AzureServiceBusDestination.php index 051d7650b38..77c941c51e7 100644 --- a/lib/commercetools-api/src/Models/Subscription/AzureServiceBusDestination.php +++ b/lib/commercetools-api/src/Models/Subscription/AzureServiceBusDestination.php @@ -16,6 +16,9 @@ interface AzureServiceBusDestination extends Destination public const FIELD_CONNECTION_STRING = 'connectionString'; /** + *

    SharedAccessKey is partially hidden on retrieval for security reasons.

    + * + * @return null|string */ public function getConnectionString(); diff --git a/lib/commercetools-api/src/Models/Subscription/AzureServiceBusDestinationBuilder.php b/lib/commercetools-api/src/Models/Subscription/AzureServiceBusDestinationBuilder.php index 044d4fd950a..e59b6d7fe63 100644 --- a/lib/commercetools-api/src/Models/Subscription/AzureServiceBusDestinationBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/AzureServiceBusDestinationBuilder.php @@ -21,11 +21,15 @@ final class AzureServiceBusDestinationBuilder implements Builder { /** + * @var ?string */ private $connectionString; /** + *

    SharedAccessKey is partially hidden on retrieval for security reasons.

    + * + * @return null|string */ public function getConnectionString() diff --git a/lib/commercetools-api/src/Models/Subscription/AzureServiceBusDestinationModel.php b/lib/commercetools-api/src/Models/Subscription/AzureServiceBusDestinationModel.php index ca67768200b..2bf1d63744c 100644 --- a/lib/commercetools-api/src/Models/Subscription/AzureServiceBusDestinationModel.php +++ b/lib/commercetools-api/src/Models/Subscription/AzureServiceBusDestinationModel.php @@ -21,11 +21,13 @@ final class AzureServiceBusDestinationModel extends JsonObjectModel implements A { public const DISCRIMINATOR_VALUE = 'AzureServiceBus'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $connectionString; @@ -35,13 +37,15 @@ final class AzureServiceBusDestinationModel extends JsonObjectModel implements A * @psalm-suppress MissingParamType */ public function __construct( - ?string $connectionString = null + ?string $connectionString = null, + ?string $type = null ) { $this->connectionString = $connectionString; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,6 +63,9 @@ public function getType() } /** + *

    SharedAccessKey is partially hidden on retrieval for security reasons.

    + * + * * @return null|string */ public function getConnectionString() diff --git a/lib/commercetools-api/src/Models/Subscription/ChangeSubscription.php b/lib/commercetools-api/src/Models/Subscription/ChangeSubscription.php index 62ffec1c4c0..72d1260e5c8 100644 --- a/lib/commercetools-api/src/Models/Subscription/ChangeSubscription.php +++ b/lib/commercetools-api/src/Models/Subscription/ChangeSubscription.php @@ -16,6 +16,9 @@ interface ChangeSubscription extends JsonObject public const FIELD_RESOURCE_TYPE_ID = 'resourceTypeId'; /** + *

    Unique identifier for the type of resource, for example, cart.

    + * + * @return null|string */ public function getResourceTypeId(); diff --git a/lib/commercetools-api/src/Models/Subscription/ChangeSubscriptionBuilder.php b/lib/commercetools-api/src/Models/Subscription/ChangeSubscriptionBuilder.php index c0c7f48f62c..21cb37a943d 100644 --- a/lib/commercetools-api/src/Models/Subscription/ChangeSubscriptionBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/ChangeSubscriptionBuilder.php @@ -21,11 +21,15 @@ final class ChangeSubscriptionBuilder implements Builder { /** + * @var ?string */ private $resourceTypeId; /** + *

    Unique identifier for the type of resource, for example, cart.

    + * + * @return null|string */ public function getResourceTypeId() diff --git a/lib/commercetools-api/src/Models/Subscription/ChangeSubscriptionModel.php b/lib/commercetools-api/src/Models/Subscription/ChangeSubscriptionModel.php index 942ba951224..d7efee08638 100644 --- a/lib/commercetools-api/src/Models/Subscription/ChangeSubscriptionModel.php +++ b/lib/commercetools-api/src/Models/Subscription/ChangeSubscriptionModel.php @@ -20,6 +20,7 @@ final class ChangeSubscriptionModel extends JsonObjectModel implements ChangeSubscription { /** + * * @var ?string */ protected $resourceTypeId; @@ -35,6 +36,9 @@ public function __construct( } /** + *

    Unique identifier for the type of resource, for example, cart.

    + * + * * @return null|string */ public function getResourceTypeId() diff --git a/lib/commercetools-api/src/Models/Subscription/CloudEventsFormat.php b/lib/commercetools-api/src/Models/Subscription/CloudEventsFormat.php index 14f6f387113..7faedd6ba82 100644 --- a/lib/commercetools-api/src/Models/Subscription/CloudEventsFormat.php +++ b/lib/commercetools-api/src/Models/Subscription/CloudEventsFormat.php @@ -16,6 +16,9 @@ interface CloudEventsFormat extends DeliveryFormat public const FIELD_CLOUD_EVENTS_VERSION = 'cloudEventsVersion'; /** + *

    Supported versions: "1.0".

    + * + * @return null|string */ public function getCloudEventsVersion(); diff --git a/lib/commercetools-api/src/Models/Subscription/CloudEventsFormatBuilder.php b/lib/commercetools-api/src/Models/Subscription/CloudEventsFormatBuilder.php index b23b1318a7e..173172b1c4a 100644 --- a/lib/commercetools-api/src/Models/Subscription/CloudEventsFormatBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/CloudEventsFormatBuilder.php @@ -21,11 +21,15 @@ final class CloudEventsFormatBuilder implements Builder { /** + * @var ?string */ private $cloudEventsVersion; /** + *

    Supported versions: "1.0".

    + * + * @return null|string */ public function getCloudEventsVersion() diff --git a/lib/commercetools-api/src/Models/Subscription/CloudEventsFormatModel.php b/lib/commercetools-api/src/Models/Subscription/CloudEventsFormatModel.php index d4309c91ea6..85b1f2ac84d 100644 --- a/lib/commercetools-api/src/Models/Subscription/CloudEventsFormatModel.php +++ b/lib/commercetools-api/src/Models/Subscription/CloudEventsFormatModel.php @@ -21,11 +21,13 @@ final class CloudEventsFormatModel extends JsonObjectModel implements CloudEvent { public const DISCRIMINATOR_VALUE = 'CloudEvents'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $cloudEventsVersion; @@ -35,13 +37,15 @@ final class CloudEventsFormatModel extends JsonObjectModel implements CloudEvent * @psalm-suppress MissingParamType */ public function __construct( - ?string $cloudEventsVersion = null + ?string $cloudEventsVersion = null, + ?string $type = null ) { $this->cloudEventsVersion = $cloudEventsVersion; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,6 +63,9 @@ public function getType() } /** + *

    Supported versions: "1.0".

    + * + * * @return null|string */ public function getCloudEventsVersion() diff --git a/lib/commercetools-api/src/Models/Subscription/CloudEventsPayload.php b/lib/commercetools-api/src/Models/Subscription/CloudEventsPayload.php new file mode 100644 index 00000000000..fab94c6005a --- /dev/null +++ b/lib/commercetools-api/src/Models/Subscription/CloudEventsPayload.php @@ -0,0 +1,158 @@ +The version of the CloudEvents specification which the event uses.

    + * + + * @return null|string + */ + public function getSpecversion(); + + /** + *

    Unique identifier of the event.

    + * + + * @return null|string + */ + public function getId(); + + /** + *

    The type is namespaced with com.commercetools, followed by the ReferenceTypeId, the type of Subscription (either message or change), and the message or change type. + * For example, com.commercetools.product.message.ProductPublished or com.commercetools.order.change.ResourceCreated.

    + * + + * @return null|string + */ + public function getType(); + + /** + *

    The default REST URI of the ReferenceTypeId that triggered this event, including the project key.

    + * + + * @return null|string + */ + public function getSource(); + + /** + *

    Unique identifier of the resource that triggered the event.

    + * + + * @return null|string + */ + public function getSubject(); + + /** + *

    Corresponds to the lastModifiedAt of the resource at the time the event was triggered.

    + * + + * @return null|DateTimeImmutable + */ + public function getTime(); + + /** + *

    Corresponds to the sequenceNumber of a MessageSubscription. Can be used to process messages in the correct order.

    + * + + * @return null|string + */ + public function getSequence(); + + /** + *

    "Integer"

    + * + + * @return null|string + */ + public function getSequencetype(); + + /** + *

    The URI from which the message can be retrieved if messages are enabled. Only set for MessageSubscriptions.

    + * + + * @return null|string + */ + public function getDataref(); + + /** + *

    MessageDeliveryPayload, ResourceCreatedDeliveryPayload, ResourceUpdatedDeliveryPayload, or ResourceDeletedDeliveryPayload.

    + * + + * @return null|DeliveryPayload + */ + public function getData(); + + /** + * @param ?string $specversion + */ + public function setSpecversion(?string $specversion): void; + + /** + * @param ?string $id + */ + public function setId(?string $id): void; + + /** + * @param ?string $type + */ + public function setType(?string $type): void; + + /** + * @param ?string $source + */ + public function setSource(?string $source): void; + + /** + * @param ?string $subject + */ + public function setSubject(?string $subject): void; + + /** + * @param ?DateTimeImmutable $time + */ + public function setTime(?DateTimeImmutable $time): void; + + /** + * @param ?string $sequence + */ + public function setSequence(?string $sequence): void; + + /** + * @param ?string $sequencetype + */ + public function setSequencetype(?string $sequencetype): void; + + /** + * @param ?string $dataref + */ + public function setDataref(?string $dataref): void; + + /** + * @param ?DeliveryPayload $data + */ + public function setData(?DeliveryPayload $data): void; +} diff --git a/lib/commercetools-api/src/Models/Subscription/CloudEventsPayloadBuilder.php b/lib/commercetools-api/src/Models/Subscription/CloudEventsPayloadBuilder.php new file mode 100644 index 00000000000..72aeb6eb948 --- /dev/null +++ b/lib/commercetools-api/src/Models/Subscription/CloudEventsPayloadBuilder.php @@ -0,0 +1,336 @@ + + */ +final class CloudEventsPayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $specversion; + + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?string + */ + private $type; + + /** + + * @var ?string + */ + private $source; + + /** + + * @var ?string + */ + private $subject; + + /** + + * @var ?DateTimeImmutable + */ + private $time; + + /** + + * @var ?string + */ + private $sequence; + + /** + + * @var ?string + */ + private $sequencetype; + + /** + + * @var ?string + */ + private $dataref; + + /** + + * @var null|DeliveryPayload|DeliveryPayloadBuilder + */ + private $data; + + /** + *

    The version of the CloudEvents specification which the event uses.

    + * + + * @return null|string + */ + public function getSpecversion() + { + return $this->specversion; + } + + /** + *

    Unique identifier of the event.

    + * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

    The type is namespaced with com.commercetools, followed by the ReferenceTypeId, the type of Subscription (either message or change), and the message or change type. + * For example, com.commercetools.product.message.ProductPublished or com.commercetools.order.change.ResourceCreated.

    + * + + * @return null|string + */ + public function getType() + { + return $this->type; + } + + /** + *

    The default REST URI of the ReferenceTypeId that triggered this event, including the project key.

    + * + + * @return null|string + */ + public function getSource() + { + return $this->source; + } + + /** + *

    Unique identifier of the resource that triggered the event.

    + * + + * @return null|string + */ + public function getSubject() + { + return $this->subject; + } + + /** + *

    Corresponds to the lastModifiedAt of the resource at the time the event was triggered.

    + * + + * @return null|DateTimeImmutable + */ + public function getTime() + { + return $this->time; + } + + /** + *

    Corresponds to the sequenceNumber of a MessageSubscription. Can be used to process messages in the correct order.

    + * + + * @return null|string + */ + public function getSequence() + { + return $this->sequence; + } + + /** + *

    "Integer"

    + * + + * @return null|string + */ + public function getSequencetype() + { + return $this->sequencetype; + } + + /** + *

    The URI from which the message can be retrieved if messages are enabled. Only set for MessageSubscriptions.

    + * + + * @return null|string + */ + public function getDataref() + { + return $this->dataref; + } + + /** + *

    MessageDeliveryPayload, ResourceCreatedDeliveryPayload, ResourceUpdatedDeliveryPayload, or ResourceDeletedDeliveryPayload.

    + * + + * @return null|DeliveryPayload + */ + public function getData() + { + return $this->data instanceof DeliveryPayloadBuilder ? $this->data->build() : $this->data; + } + + /** + * @param ?string $specversion + * @return $this + */ + public function withSpecversion(?string $specversion) + { + $this->specversion = $specversion; + + return $this; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?string $type + * @return $this + */ + public function withType(?string $type) + { + $this->type = $type; + + return $this; + } + + /** + * @param ?string $source + * @return $this + */ + public function withSource(?string $source) + { + $this->source = $source; + + return $this; + } + + /** + * @param ?string $subject + * @return $this + */ + public function withSubject(?string $subject) + { + $this->subject = $subject; + + return $this; + } + + /** + * @param ?DateTimeImmutable $time + * @return $this + */ + public function withTime(?DateTimeImmutable $time) + { + $this->time = $time; + + return $this; + } + + /** + * @param ?string $sequence + * @return $this + */ + public function withSequence(?string $sequence) + { + $this->sequence = $sequence; + + return $this; + } + + /** + * @param ?string $sequencetype + * @return $this + */ + public function withSequencetype(?string $sequencetype) + { + $this->sequencetype = $sequencetype; + + return $this; + } + + /** + * @param ?string $dataref + * @return $this + */ + public function withDataref(?string $dataref) + { + $this->dataref = $dataref; + + return $this; + } + + /** + * @param ?DeliveryPayload $data + * @return $this + */ + public function withData(?DeliveryPayload $data) + { + $this->data = $data; + + return $this; + } + + /** + * @deprecated use withData() instead + * @return $this + */ + public function withDataBuilder(?DeliveryPayloadBuilder $data) + { + $this->data = $data; + + return $this; + } + + public function build(): CloudEventsPayload + { + return new CloudEventsPayloadModel( + $this->specversion, + $this->id, + $this->type, + $this->source, + $this->subject, + $this->time, + $this->sequence, + $this->sequencetype, + $this->dataref, + $this->data instanceof DeliveryPayloadBuilder ? $this->data->build() : $this->data + ); + } + + public static function of(): CloudEventsPayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Subscription/CloudEventsPayloadCollection.php b/lib/commercetools-api/src/Models/Subscription/CloudEventsPayloadCollection.php new file mode 100644 index 00000000000..8480e7d909b --- /dev/null +++ b/lib/commercetools-api/src/Models/Subscription/CloudEventsPayloadCollection.php @@ -0,0 +1,56 @@ + + * @method CloudEventsPayload current() + * @method CloudEventsPayload end() + * @method CloudEventsPayload at($offset) + */ +class CloudEventsPayloadCollection extends MapperSequence +{ + /** + * @psalm-assert CloudEventsPayload $value + * @psalm-param CloudEventsPayload|stdClass $value + * @throws InvalidArgumentException + * + * @return CloudEventsPayloadCollection + */ + public function add($value) + { + if (!$value instanceof CloudEventsPayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CloudEventsPayload + */ + protected function mapper() + { + return function (?int $index): ?CloudEventsPayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CloudEventsPayload $data */ + $data = CloudEventsPayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Subscription/CloudEventsPayloadModel.php b/lib/commercetools-api/src/Models/Subscription/CloudEventsPayloadModel.php new file mode 100644 index 00000000000..9d0f39d3673 --- /dev/null +++ b/lib/commercetools-api/src/Models/Subscription/CloudEventsPayloadModel.php @@ -0,0 +1,409 @@ +specversion = $specversion; + $this->id = $id; + $this->type = $type; + $this->source = $source; + $this->subject = $subject; + $this->time = $time; + $this->sequence = $sequence; + $this->sequencetype = $sequencetype; + $this->dataref = $dataref; + $this->data = $data; + } + + /** + *

    The version of the CloudEvents specification which the event uses.

    + * + * + * @return null|string + */ + public function getSpecversion() + { + if (is_null($this->specversion)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SPECVERSION); + if (is_null($data)) { + return null; + } + $this->specversion = (string) $data; + } + + return $this->specversion; + } + + /** + *

    Unique identifier of the event.

    + * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

    The type is namespaced with com.commercetools, followed by the ReferenceTypeId, the type of Subscription (either message or change), and the message or change type. + * For example, com.commercetools.product.message.ProductPublished or com.commercetools.order.change.ResourceCreated.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The default REST URI of the ReferenceTypeId that triggered this event, including the project key.

    + * + * + * @return null|string + */ + public function getSource() + { + if (is_null($this->source)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SOURCE); + if (is_null($data)) { + return null; + } + $this->source = (string) $data; + } + + return $this->source; + } + + /** + *

    Unique identifier of the resource that triggered the event.

    + * + * + * @return null|string + */ + public function getSubject() + { + if (is_null($this->subject)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SUBJECT); + if (is_null($data)) { + return null; + } + $this->subject = (string) $data; + } + + return $this->subject; + } + + /** + *

    Corresponds to the lastModifiedAt of the resource at the time the event was triggered.

    + * + * + * @return null|DateTimeImmutable + */ + public function getTime() + { + if (is_null($this->time)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TIME); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->time = $data; + } + + return $this->time; + } + + /** + *

    Corresponds to the sequenceNumber of a MessageSubscription. Can be used to process messages in the correct order.

    + * + * + * @return null|string + */ + public function getSequence() + { + if (is_null($this->sequence)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SEQUENCE); + if (is_null($data)) { + return null; + } + $this->sequence = (string) $data; + } + + return $this->sequence; + } + + /** + *

    "Integer"

    + * + * + * @return null|string + */ + public function getSequencetype() + { + if (is_null($this->sequencetype)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SEQUENCETYPE); + if (is_null($data)) { + return null; + } + $this->sequencetype = (string) $data; + } + + return $this->sequencetype; + } + + /** + *

    The URI from which the message can be retrieved if messages are enabled. Only set for MessageSubscriptions.

    + * + * + * @return null|string + */ + public function getDataref() + { + if (is_null($this->dataref)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_DATAREF); + if (is_null($data)) { + return null; + } + $this->dataref = (string) $data; + } + + return $this->dataref; + } + + /** + *

    MessageDeliveryPayload, ResourceCreatedDeliveryPayload, ResourceUpdatedDeliveryPayload, or ResourceDeletedDeliveryPayload.

    + * + * + * @return null|DeliveryPayload + */ + public function getData() + { + if (is_null($this->data)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_DATA); + if (is_null($data)) { + return null; + } + + $this->data = DeliveryPayloadModel::of($data); + } + + return $this->data; + } + + + /** + * @param ?string $specversion + */ + public function setSpecversion(?string $specversion): void + { + $this->specversion = $specversion; + } + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?string $type + */ + public function setType(?string $type): void + { + $this->type = $type; + } + + /** + * @param ?string $source + */ + public function setSource(?string $source): void + { + $this->source = $source; + } + + /** + * @param ?string $subject + */ + public function setSubject(?string $subject): void + { + $this->subject = $subject; + } + + /** + * @param ?DateTimeImmutable $time + */ + public function setTime(?DateTimeImmutable $time): void + { + $this->time = $time; + } + + /** + * @param ?string $sequence + */ + public function setSequence(?string $sequence): void + { + $this->sequence = $sequence; + } + + /** + * @param ?string $sequencetype + */ + public function setSequencetype(?string $sequencetype): void + { + $this->sequencetype = $sequencetype; + } + + /** + * @param ?string $dataref + */ + public function setDataref(?string $dataref): void + { + $this->dataref = $dataref; + } + + /** + * @param ?DeliveryPayload $data + */ + public function setData(?DeliveryPayload $data): void + { + $this->data = $data; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[CloudEventsPayload::FIELD_TIME]) && $data[CloudEventsPayload::FIELD_TIME] instanceof \DateTimeImmutable) { + $data[CloudEventsPayload::FIELD_TIME] = $data[CloudEventsPayload::FIELD_TIME]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Subscription/DeliveryFormat.php b/lib/commercetools-api/src/Models/Subscription/DeliveryFormat.php index f406b81cf70..331bfc9d406 100644 --- a/lib/commercetools-api/src/Models/Subscription/DeliveryFormat.php +++ b/lib/commercetools-api/src/Models/Subscription/DeliveryFormat.php @@ -17,6 +17,7 @@ interface DeliveryFormat extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/Subscription/DeliveryFormatModel.php b/lib/commercetools-api/src/Models/Subscription/DeliveryFormatModel.php index b85a49d1c84..4a605f7ed07 100644 --- a/lib/commercetools-api/src/Models/Subscription/DeliveryFormatModel.php +++ b/lib/commercetools-api/src/Models/Subscription/DeliveryFormatModel.php @@ -21,6 +21,7 @@ final class DeliveryFormatModel extends JsonObjectModel implements DeliveryForma { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -38,11 +39,13 @@ final class DeliveryFormatModel extends JsonObjectModel implements DeliveryForma * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Subscription/DeliveryPayload.php b/lib/commercetools-api/src/Models/Subscription/DeliveryPayload.php index 4958e6ad56b..ba70ca5a84a 100644 --- a/lib/commercetools-api/src/Models/Subscription/DeliveryPayload.php +++ b/lib/commercetools-api/src/Models/Subscription/DeliveryPayload.php @@ -22,23 +22,34 @@ interface DeliveryPayload extends JsonObject public const FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS = 'resourceUserProvidedIdentifiers'; /** + *

    key of the Project. + * Useful in message processing if the Destination receives events from multiple Projects.

    + * + * @return null|string */ public function getProjectKey(); /** + *

    Identifies the payload.

    + * + * @return null|string */ public function getNotificationType(); /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that triggered the message.

    * + * @return null|Reference */ public function getResource(); /** + *

    User-defined unique identifiers of the resource.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers(); diff --git a/lib/commercetools-api/src/Models/Subscription/DeliveryPayloadBuilder.php b/lib/commercetools-api/src/Models/Subscription/DeliveryPayloadBuilder.php index 572de186ab2..725b7c1b9fc 100644 --- a/lib/commercetools-api/src/Models/Subscription/DeliveryPayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/DeliveryPayloadBuilder.php @@ -25,21 +25,28 @@ final class DeliveryPayloadBuilder implements Builder { /** + * @var ?string */ private $projectKey; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + *

    key of the Project. + * Useful in message processing if the Destination receives events from multiple Projects.

    + * + * @return null|string */ public function getProjectKey() @@ -48,8 +55,9 @@ public function getProjectKey() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that triggered the message.

    * + * @return null|Reference */ public function getResource() @@ -58,6 +66,9 @@ public function getResource() } /** + *

    User-defined unique identifiers of the resource.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Subscription/DeliveryPayloadModel.php b/lib/commercetools-api/src/Models/Subscription/DeliveryPayloadModel.php index 4a1f3448f42..3f8ed5807d8 100644 --- a/lib/commercetools-api/src/Models/Subscription/DeliveryPayloadModel.php +++ b/lib/commercetools-api/src/Models/Subscription/DeliveryPayloadModel.php @@ -25,21 +25,25 @@ final class DeliveryPayloadModel extends JsonObjectModel implements DeliveryPayl { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $projectKey; /** + * * @var ?string */ protected $notificationType; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; @@ -61,15 +65,20 @@ final class DeliveryPayloadModel extends JsonObjectModel implements DeliveryPayl public function __construct( ?string $projectKey = null, ?Reference $resource = null, - ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null + ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, + ?string $notificationType = null ) { $this->projectKey = $projectKey; $this->resource = $resource; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; - $this->notificationType = static::DISCRIMINATOR_VALUE; + $this->notificationType = $notificationType; } /** + *

    key of the Project. + * Useful in message processing if the Destination receives events from multiple Projects.

    + * + * * @return null|string */ public function getProjectKey() @@ -87,6 +96,9 @@ public function getProjectKey() } /** + *

    Identifies the payload.

    + * + * * @return null|string */ public function getNotificationType() @@ -104,7 +116,8 @@ public function getNotificationType() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that triggered the message.

    + * * * @return null|Reference */ @@ -124,6 +137,9 @@ public function getResource() } /** + *

    User-defined unique identifiers of the resource.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() diff --git a/lib/commercetools-api/src/Models/Subscription/Destination.php b/lib/commercetools-api/src/Models/Subscription/Destination.php index 2e1ba2126ab..5ed0cb025b6 100644 --- a/lib/commercetools-api/src/Models/Subscription/Destination.php +++ b/lib/commercetools-api/src/Models/Subscription/Destination.php @@ -17,6 +17,7 @@ interface Destination extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/Subscription/DestinationModel.php b/lib/commercetools-api/src/Models/Subscription/DestinationModel.php index ab4e403bef1..f99993c735a 100644 --- a/lib/commercetools-api/src/Models/Subscription/DestinationModel.php +++ b/lib/commercetools-api/src/Models/Subscription/DestinationModel.php @@ -21,6 +21,7 @@ final class DestinationModel extends JsonObjectModel implements Destination { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -43,11 +44,13 @@ final class DestinationModel extends JsonObjectModel implements Destination * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Subscription/EventBridgeDestination.php b/lib/commercetools-api/src/Models/Subscription/EventBridgeDestination.php index 44e34b097a7..2fe5c313cfd 100644 --- a/lib/commercetools-api/src/Models/Subscription/EventBridgeDestination.php +++ b/lib/commercetools-api/src/Models/Subscription/EventBridgeDestination.php @@ -17,15 +17,17 @@ interface EventBridgeDestination extends Destination public const FIELD_ACCOUNT_ID = 'accountId'; /** - *

    AWS region of the Subscriptions that receives the events.

    + *

    AWS region that receives the events.

    * + * @return null|string */ public function getRegion(); /** - *

    ID of the AWS account that receives events.

    + *

    ID of the AWS account that receives the events.

    * + * @return null|string */ public function getAccountId(); diff --git a/lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationBuilder.php b/lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationBuilder.php index 8ab0b12836c..38b7e799370 100644 --- a/lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationBuilder.php @@ -21,18 +21,21 @@ final class EventBridgeDestinationBuilder implements Builder { /** + * @var ?string */ private $region; /** + * @var ?string */ private $accountId; /** - *

    AWS region of the Subscriptions that receives the events.

    + *

    AWS region that receives the events.

    * + * @return null|string */ public function getRegion() @@ -41,8 +44,9 @@ public function getRegion() } /** - *

    ID of the AWS account that receives events.

    + *

    ID of the AWS account that receives the events.

    * + * @return null|string */ public function getAccountId() diff --git a/lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php b/lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php index 8f43bffc2b3..cd4115106e6 100644 --- a/lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php +++ b/lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php @@ -21,16 +21,19 @@ final class EventBridgeDestinationModel extends JsonObjectModel implements Event { public const DISCRIMINATOR_VALUE = 'EventBridge'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $region; /** + * * @var ?string */ protected $accountId; @@ -41,14 +44,16 @@ final class EventBridgeDestinationModel extends JsonObjectModel implements Event */ public function __construct( ?string $region = null, - ?string $accountId = null + ?string $accountId = null, + ?string $type = null ) { $this->region = $region; $this->accountId = $accountId; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -66,7 +71,8 @@ public function getType() } /** - *

    AWS region of the Subscriptions that receives the events.

    + *

    AWS region that receives the events.

    + * * * @return null|string */ @@ -85,7 +91,8 @@ public function getRegion() } /** - *

    ID of the AWS account that receives events.

    + *

    ID of the AWS account that receives the events.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Subscription/GoogleCloudPubSubDestination.php b/lib/commercetools-api/src/Models/Subscription/GoogleCloudPubSubDestination.php index 7b91769342a..1c646013758 100644 --- a/lib/commercetools-api/src/Models/Subscription/GoogleCloudPubSubDestination.php +++ b/lib/commercetools-api/src/Models/Subscription/GoogleCloudPubSubDestination.php @@ -17,11 +17,17 @@ interface GoogleCloudPubSubDestination extends Destination public const FIELD_TOPIC = 'topic'; /** + *

    ID of the Google Cloud project that contains the Pub/Sub topic.

    + * + * @return null|string */ public function getProjectId(); /** + *

    Name of the topic.

    + * + * @return null|string */ public function getTopic(); diff --git a/lib/commercetools-api/src/Models/Subscription/GoogleCloudPubSubDestinationBuilder.php b/lib/commercetools-api/src/Models/Subscription/GoogleCloudPubSubDestinationBuilder.php index 67405dae7af..31f9ba95e5c 100644 --- a/lib/commercetools-api/src/Models/Subscription/GoogleCloudPubSubDestinationBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/GoogleCloudPubSubDestinationBuilder.php @@ -21,16 +21,21 @@ final class GoogleCloudPubSubDestinationBuilder implements Builder { /** + * @var ?string */ private $projectId; /** + * @var ?string */ private $topic; /** + *

    ID of the Google Cloud project that contains the Pub/Sub topic.

    + * + * @return null|string */ public function getProjectId() @@ -39,6 +44,9 @@ public function getProjectId() } /** + *

    Name of the topic.

    + * + * @return null|string */ public function getTopic() diff --git a/lib/commercetools-api/src/Models/Subscription/GoogleCloudPubSubDestinationModel.php b/lib/commercetools-api/src/Models/Subscription/GoogleCloudPubSubDestinationModel.php index 77a59e94c3d..e8becd4c3b3 100644 --- a/lib/commercetools-api/src/Models/Subscription/GoogleCloudPubSubDestinationModel.php +++ b/lib/commercetools-api/src/Models/Subscription/GoogleCloudPubSubDestinationModel.php @@ -21,16 +21,19 @@ final class GoogleCloudPubSubDestinationModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'GoogleCloudPubSub'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $projectId; /** + * * @var ?string */ protected $topic; @@ -41,14 +44,16 @@ final class GoogleCloudPubSubDestinationModel extends JsonObjectModel implements */ public function __construct( ?string $projectId = null, - ?string $topic = null + ?string $topic = null, + ?string $type = null ) { $this->projectId = $projectId; $this->topic = $topic; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -66,6 +71,9 @@ public function getType() } /** + *

    ID of the Google Cloud project that contains the Pub/Sub topic.

    + * + * * @return null|string */ public function getProjectId() @@ -83,6 +91,9 @@ public function getProjectId() } /** + *

    Name of the topic.

    + * + * * @return null|string */ public function getTopic() diff --git a/lib/commercetools-api/src/Models/Subscription/IronMqDestination.php b/lib/commercetools-api/src/Models/Subscription/IronMqDestination.php index f3c4853a068..2837073668e 100644 --- a/lib/commercetools-api/src/Models/Subscription/IronMqDestination.php +++ b/lib/commercetools-api/src/Models/Subscription/IronMqDestination.php @@ -16,6 +16,7 @@ interface IronMqDestination extends Destination public const FIELD_URI = 'uri'; /** + * @return null|string */ public function getUri(); diff --git a/lib/commercetools-api/src/Models/Subscription/IronMqDestinationBuilder.php b/lib/commercetools-api/src/Models/Subscription/IronMqDestinationBuilder.php index f7a0f8088c3..c22cdaa44ab 100644 --- a/lib/commercetools-api/src/Models/Subscription/IronMqDestinationBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/IronMqDestinationBuilder.php @@ -21,11 +21,13 @@ final class IronMqDestinationBuilder implements Builder { /** + * @var ?string */ private $uri; /** + * @return null|string */ public function getUri() diff --git a/lib/commercetools-api/src/Models/Subscription/IronMqDestinationModel.php b/lib/commercetools-api/src/Models/Subscription/IronMqDestinationModel.php index db809075625..78f51bb66f4 100644 --- a/lib/commercetools-api/src/Models/Subscription/IronMqDestinationModel.php +++ b/lib/commercetools-api/src/Models/Subscription/IronMqDestinationModel.php @@ -21,11 +21,13 @@ final class IronMqDestinationModel extends JsonObjectModel implements IronMqDest { public const DISCRIMINATOR_VALUE = 'IronMQ'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $uri; @@ -35,13 +37,15 @@ final class IronMqDestinationModel extends JsonObjectModel implements IronMqDest * @psalm-suppress MissingParamType */ public function __construct( - ?string $uri = null + ?string $uri = null, + ?string $type = null ) { $this->uri = $uri; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,6 +63,7 @@ public function getType() } /** + * * @return null|string */ public function getUri() diff --git a/lib/commercetools-api/src/Models/Subscription/MessageDeliveryPayload.php b/lib/commercetools-api/src/Models/Subscription/MessageDeliveryPayload.php index b512fa5663f..051a5da7d05 100644 --- a/lib/commercetools-api/src/Models/Subscription/MessageDeliveryPayload.php +++ b/lib/commercetools-api/src/Models/Subscription/MessageDeliveryPayload.php @@ -23,36 +23,58 @@ interface MessageDeliveryPayload extends DeliveryPayload public const FIELD_PAYLOAD_NOT_INCLUDED = 'payloadNotIncluded'; /** + *

    Unique ID of the message.

    + * + * @return null|string */ public function getId(); /** + *

    Last seen version of the resource.

    + * + * @return null|int */ public function getVersion(); /** + *

    Date and time (UTC) the resource was initially created.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt(); /** + *

    Date and time (UTC) the resource was last modified.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); /** + *

    Used to ensure all messages of the resource are processed in correct order. + * The sequenceNumber of the next message of the resource is a successor of the sequenceNumber of the current message.

    + * + * @return null|int */ public function getSequenceNumber(); /** + *

    Version of the resource on which the change was performed.

    + * + * @return null|int */ public function getResourceVersion(); /** + *

    If the payload does not fit into the size limit or its format is not accepted by the messaging service, the payloadNotIncluded field is present.

    + * + * @return null|PayloadNotIncluded */ public function getPayloadNotIncluded(); diff --git a/lib/commercetools-api/src/Models/Subscription/MessageDeliveryPayloadBuilder.php b/lib/commercetools-api/src/Models/Subscription/MessageDeliveryPayloadBuilder.php index e3972e774ae..aace093a67c 100644 --- a/lib/commercetools-api/src/Models/Subscription/MessageDeliveryPayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/MessageDeliveryPayloadBuilder.php @@ -26,56 +26,70 @@ final class MessageDeliveryPayloadBuilder implements Builder { /** + * @var ?string */ private $projectKey; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var ?int */ private $sequenceNumber; /** + * @var ?int */ private $resourceVersion; /** + * @var null|PayloadNotIncluded|PayloadNotIncludedBuilder */ private $payloadNotIncluded; /** + *

    key of the Project. + * Useful in message processing if the Destination receives events from multiple Projects.

    + * + * @return null|string */ public function getProjectKey() @@ -84,8 +98,9 @@ public function getProjectKey() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that triggered the message.

    * + * @return null|Reference */ public function getResource() @@ -94,6 +109,9 @@ public function getResource() } /** + *

    User-defined unique identifiers of the resource.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -102,6 +120,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique ID of the message.

    + * + * @return null|string */ public function getId() @@ -110,6 +131,9 @@ public function getId() } /** + *

    Last seen version of the resource.

    + * + * @return null|int */ public function getVersion() @@ -118,6 +142,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the resource was initially created.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -126,6 +153,9 @@ public function getCreatedAt() } /** + *

    Date and time (UTC) the resource was last modified.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -134,6 +164,10 @@ public function getLastModifiedAt() } /** + *

    Used to ensure all messages of the resource are processed in correct order. + * The sequenceNumber of the next message of the resource is a successor of the sequenceNumber of the current message.

    + * + * @return null|int */ public function getSequenceNumber() @@ -142,6 +176,9 @@ public function getSequenceNumber() } /** + *

    Version of the resource on which the change was performed.

    + * + * @return null|int */ public function getResourceVersion() @@ -150,6 +187,9 @@ public function getResourceVersion() } /** + *

    If the payload does not fit into the size limit or its format is not accepted by the messaging service, the payloadNotIncluded field is present.

    + * + * @return null|PayloadNotIncluded */ public function getPayloadNotIncluded() diff --git a/lib/commercetools-api/src/Models/Subscription/MessageDeliveryPayloadModel.php b/lib/commercetools-api/src/Models/Subscription/MessageDeliveryPayloadModel.php index 1fc559453f3..049ea34d645 100644 --- a/lib/commercetools-api/src/Models/Subscription/MessageDeliveryPayloadModel.php +++ b/lib/commercetools-api/src/Models/Subscription/MessageDeliveryPayloadModel.php @@ -26,56 +26,67 @@ final class MessageDeliveryPayloadModel extends JsonObjectModel implements Messa { public const DISCRIMINATOR_VALUE = 'Message'; /** + * * @var ?string */ protected $projectKey; /** + * * @var ?string */ protected $notificationType; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?int */ protected $sequenceNumber; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?PayloadNotIncluded */ protected $payloadNotIncluded; @@ -94,7 +105,8 @@ public function __construct( ?DateTimeImmutable $lastModifiedAt = null, ?int $sequenceNumber = null, ?int $resourceVersion = null, - ?PayloadNotIncluded $payloadNotIncluded = null + ?PayloadNotIncluded $payloadNotIncluded = null, + ?string $notificationType = null ) { $this->projectKey = $projectKey; $this->resource = $resource; @@ -106,10 +118,14 @@ public function __construct( $this->sequenceNumber = $sequenceNumber; $this->resourceVersion = $resourceVersion; $this->payloadNotIncluded = $payloadNotIncluded; - $this->notificationType = static::DISCRIMINATOR_VALUE; + $this->notificationType = $notificationType ?? self::DISCRIMINATOR_VALUE; } /** + *

    key of the Project. + * Useful in message processing if the Destination receives events from multiple Projects.

    + * + * * @return null|string */ public function getProjectKey() @@ -127,6 +143,9 @@ public function getProjectKey() } /** + *

    Identifies the payload.

    + * + * * @return null|string */ public function getNotificationType() @@ -144,7 +163,8 @@ public function getNotificationType() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that triggered the message.

    + * * * @return null|Reference */ @@ -164,6 +184,9 @@ public function getResource() } /** + *

    User-defined unique identifiers of the resource.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -182,6 +205,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Unique ID of the message.

    + * + * * @return null|string */ public function getId() @@ -199,6 +225,9 @@ public function getId() } /** + *

    Last seen version of the resource.

    + * + * * @return null|int */ public function getVersion() @@ -216,6 +245,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the resource was initially created.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -237,6 +269,9 @@ public function getCreatedAt() } /** + *

    Date and time (UTC) the resource was last modified.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -258,6 +293,10 @@ public function getLastModifiedAt() } /** + *

    Used to ensure all messages of the resource are processed in correct order. + * The sequenceNumber of the next message of the resource is a successor of the sequenceNumber of the current message.

    + * + * * @return null|int */ public function getSequenceNumber() @@ -275,6 +314,9 @@ public function getSequenceNumber() } /** + *

    Version of the resource on which the change was performed.

    + * + * * @return null|int */ public function getResourceVersion() @@ -292,6 +334,9 @@ public function getResourceVersion() } /** + *

    If the payload does not fit into the size limit or its format is not accepted by the messaging service, the payloadNotIncluded field is present.

    + * + * * @return null|PayloadNotIncluded */ public function getPayloadNotIncluded() diff --git a/lib/commercetools-api/src/Models/Subscription/MessageSubscription.php b/lib/commercetools-api/src/Models/Subscription/MessageSubscription.php index 5534d4f62e6..a43db2e70c2 100644 --- a/lib/commercetools-api/src/Models/Subscription/MessageSubscription.php +++ b/lib/commercetools-api/src/Models/Subscription/MessageSubscription.php @@ -17,11 +17,18 @@ interface MessageSubscription extends JsonObject public const FIELD_TYPES = 'types'; /** + *

    Unique identifier for the type of resource, for example, order.

    + * + * @return null|string */ public function getResourceTypeId(); /** + *

    Must contain valid message types for the resource. For example, for resource type product the message type ProductPublished is valid. + * If no types of messages are given, the Subscription will receive all messages for this resource.

    + * + * @return null|array */ public function getTypes(); diff --git a/lib/commercetools-api/src/Models/Subscription/MessageSubscriptionBuilder.php b/lib/commercetools-api/src/Models/Subscription/MessageSubscriptionBuilder.php index dc6188c5c21..ec7303dc93a 100644 --- a/lib/commercetools-api/src/Models/Subscription/MessageSubscriptionBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/MessageSubscriptionBuilder.php @@ -21,16 +21,21 @@ final class MessageSubscriptionBuilder implements Builder { /** + * @var ?string */ private $resourceTypeId; /** + * @var ?array */ private $types; /** + *

    Unique identifier for the type of resource, for example, order.

    + * + * @return null|string */ public function getResourceTypeId() @@ -39,6 +44,10 @@ public function getResourceTypeId() } /** + *

    Must contain valid message types for the resource. For example, for resource type product the message type ProductPublished is valid. + * If no types of messages are given, the Subscription will receive all messages for this resource.

    + * + * @return null|array */ public function getTypes() diff --git a/lib/commercetools-api/src/Models/Subscription/MessageSubscriptionModel.php b/lib/commercetools-api/src/Models/Subscription/MessageSubscriptionModel.php index 02cba7b3562..4d0f98d4ec9 100644 --- a/lib/commercetools-api/src/Models/Subscription/MessageSubscriptionModel.php +++ b/lib/commercetools-api/src/Models/Subscription/MessageSubscriptionModel.php @@ -20,11 +20,13 @@ final class MessageSubscriptionModel extends JsonObjectModel implements MessageSubscription { /** + * * @var ?string */ protected $resourceTypeId; /** + * * @var ?array */ protected $types; @@ -42,6 +44,9 @@ public function __construct( } /** + *

    Unique identifier for the type of resource, for example, order.

    + * + * * @return null|string */ public function getResourceTypeId() @@ -59,6 +64,10 @@ public function getResourceTypeId() } /** + *

    Must contain valid message types for the resource. For example, for resource type product the message type ProductPublished is valid. + * If no types of messages are given, the Subscription will receive all messages for this resource.

    + * + * * @return null|array */ public function getTypes() diff --git a/lib/commercetools-api/src/Models/Subscription/PayloadNotIncluded.php b/lib/commercetools-api/src/Models/Subscription/PayloadNotIncluded.php index d2955725df6..4bafd333855 100644 --- a/lib/commercetools-api/src/Models/Subscription/PayloadNotIncluded.php +++ b/lib/commercetools-api/src/Models/Subscription/PayloadNotIncluded.php @@ -17,11 +17,17 @@ interface PayloadNotIncluded extends JsonObject public const FIELD_PAYLOAD_TYPE = 'payloadType'; /** + *

    Reason the payload is not included. For example, the payload is too large, or its content is not supported by the Subscription destination.

    + * + * @return null|string */ public function getReason(); /** + *

    Value of the type field in the original payload.

    + * + * @return null|string */ public function getPayloadType(); diff --git a/lib/commercetools-api/src/Models/Subscription/PayloadNotIncludedBuilder.php b/lib/commercetools-api/src/Models/Subscription/PayloadNotIncludedBuilder.php index 58de9def640..1f7e2854db1 100644 --- a/lib/commercetools-api/src/Models/Subscription/PayloadNotIncludedBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/PayloadNotIncludedBuilder.php @@ -21,16 +21,21 @@ final class PayloadNotIncludedBuilder implements Builder { /** + * @var ?string */ private $reason; /** + * @var ?string */ private $payloadType; /** + *

    Reason the payload is not included. For example, the payload is too large, or its content is not supported by the Subscription destination.

    + * + * @return null|string */ public function getReason() @@ -39,6 +44,9 @@ public function getReason() } /** + *

    Value of the type field in the original payload.

    + * + * @return null|string */ public function getPayloadType() diff --git a/lib/commercetools-api/src/Models/Subscription/PayloadNotIncludedModel.php b/lib/commercetools-api/src/Models/Subscription/PayloadNotIncludedModel.php index 8f6b55f3718..925a5a045a0 100644 --- a/lib/commercetools-api/src/Models/Subscription/PayloadNotIncludedModel.php +++ b/lib/commercetools-api/src/Models/Subscription/PayloadNotIncludedModel.php @@ -20,11 +20,13 @@ final class PayloadNotIncludedModel extends JsonObjectModel implements PayloadNotIncluded { /** + * * @var ?string */ protected $reason; /** + * * @var ?string */ protected $payloadType; @@ -42,6 +44,9 @@ public function __construct( } /** + *

    Reason the payload is not included. For example, the payload is too large, or its content is not supported by the Subscription destination.

    + * + * * @return null|string */ public function getReason() @@ -59,6 +64,9 @@ public function getReason() } /** + *

    Value of the type field in the original payload.

    + * + * * @return null|string */ public function getPayloadType() diff --git a/lib/commercetools-api/src/Models/Subscription/PlatformFormatModel.php b/lib/commercetools-api/src/Models/Subscription/PlatformFormatModel.php index 678f5ec8d73..3811d5bdc83 100644 --- a/lib/commercetools-api/src/Models/Subscription/PlatformFormatModel.php +++ b/lib/commercetools-api/src/Models/Subscription/PlatformFormatModel.php @@ -21,6 +21,7 @@ final class PlatformFormatModel extends JsonObjectModel implements PlatformForma { public const DISCRIMINATOR_VALUE = 'Platform'; /** + * * @var ?string */ protected $type; @@ -30,11 +31,13 @@ final class PlatformFormatModel extends JsonObjectModel implements PlatformForma * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/Subscription/ResourceCreatedDeliveryPayload.php b/lib/commercetools-api/src/Models/Subscription/ResourceCreatedDeliveryPayload.php index c7f8426fd5d..8ab4b17ce6f 100644 --- a/lib/commercetools-api/src/Models/Subscription/ResourceCreatedDeliveryPayload.php +++ b/lib/commercetools-api/src/Models/Subscription/ResourceCreatedDeliveryPayload.php @@ -18,11 +18,17 @@ interface ResourceCreatedDeliveryPayload extends DeliveryPayload public const FIELD_MODIFIED_AT = 'modifiedAt'; /** + *

    Last seen version of the resource.

    + * + * @return null|int */ public function getVersion(); /** + *

    Date and time (UTC) the resource was last modified.

    + * + * @return null|DateTimeImmutable */ public function getModifiedAt(); diff --git a/lib/commercetools-api/src/Models/Subscription/ResourceCreatedDeliveryPayloadBuilder.php b/lib/commercetools-api/src/Models/Subscription/ResourceCreatedDeliveryPayloadBuilder.php index 86771d95471..d86f155f48a 100644 --- a/lib/commercetools-api/src/Models/Subscription/ResourceCreatedDeliveryPayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/ResourceCreatedDeliveryPayloadBuilder.php @@ -26,31 +26,40 @@ final class ResourceCreatedDeliveryPayloadBuilder implements Builder { /** + * @var ?string */ private $projectKey; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $modifiedAt; /** + *

    key of the Project. + * Useful in message processing if the Destination receives events from multiple Projects.

    + * + * @return null|string */ public function getProjectKey() @@ -59,8 +68,9 @@ public function getProjectKey() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that triggered the message.

    * + * @return null|Reference */ public function getResource() @@ -69,6 +79,9 @@ public function getResource() } /** + *

    User-defined unique identifiers of the resource.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -77,6 +90,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Last seen version of the resource.

    + * + * @return null|int */ public function getVersion() @@ -85,6 +101,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the resource was last modified.

    + * + * @return null|DateTimeImmutable */ public function getModifiedAt() diff --git a/lib/commercetools-api/src/Models/Subscription/ResourceCreatedDeliveryPayloadModel.php b/lib/commercetools-api/src/Models/Subscription/ResourceCreatedDeliveryPayloadModel.php index 77d675199d7..1be4960b3c1 100644 --- a/lib/commercetools-api/src/Models/Subscription/ResourceCreatedDeliveryPayloadModel.php +++ b/lib/commercetools-api/src/Models/Subscription/ResourceCreatedDeliveryPayloadModel.php @@ -26,31 +26,37 @@ final class ResourceCreatedDeliveryPayloadModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'ResourceCreated'; /** + * * @var ?string */ protected $projectKey; /** + * * @var ?string */ protected $notificationType; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $modifiedAt; @@ -64,17 +70,22 @@ public function __construct( ?Reference $resource = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?int $version = null, - ?DateTimeImmutable $modifiedAt = null + ?DateTimeImmutable $modifiedAt = null, + ?string $notificationType = null ) { $this->projectKey = $projectKey; $this->resource = $resource; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->version = $version; $this->modifiedAt = $modifiedAt; - $this->notificationType = static::DISCRIMINATOR_VALUE; + $this->notificationType = $notificationType ?? self::DISCRIMINATOR_VALUE; } /** + *

    key of the Project. + * Useful in message processing if the Destination receives events from multiple Projects.

    + * + * * @return null|string */ public function getProjectKey() @@ -92,6 +103,9 @@ public function getProjectKey() } /** + *

    Identifies the payload.

    + * + * * @return null|string */ public function getNotificationType() @@ -109,7 +123,8 @@ public function getNotificationType() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that triggered the message.

    + * * * @return null|Reference */ @@ -129,6 +144,9 @@ public function getResource() } /** + *

    User-defined unique identifiers of the resource.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -147,6 +165,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Last seen version of the resource.

    + * + * * @return null|int */ public function getVersion() @@ -164,6 +185,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the resource was last modified.

    + * + * * @return null|DateTimeImmutable */ public function getModifiedAt() diff --git a/lib/commercetools-api/src/Models/Subscription/ResourceDeletedDeliveryPayload.php b/lib/commercetools-api/src/Models/Subscription/ResourceDeletedDeliveryPayload.php index 27c240e3d73..a50bcb25e3a 100644 --- a/lib/commercetools-api/src/Models/Subscription/ResourceDeletedDeliveryPayload.php +++ b/lib/commercetools-api/src/Models/Subscription/ResourceDeletedDeliveryPayload.php @@ -19,16 +19,25 @@ interface ResourceDeletedDeliveryPayload extends DeliveryPayload public const FIELD_DATA_ERASURE = 'dataErasure'; /** + *

    Last seen version of the resource.

    + * + * @return null|int */ public function getVersion(); /** + *

    Date and time (UTC) the resource was last deleted.

    + * + * @return null|DateTimeImmutable */ public function getModifiedAt(); /** + *

    true if the dataErasure parameter on the DELETE request was set to true.

    + * + * @return null|bool */ public function getDataErasure(); diff --git a/lib/commercetools-api/src/Models/Subscription/ResourceDeletedDeliveryPayloadBuilder.php b/lib/commercetools-api/src/Models/Subscription/ResourceDeletedDeliveryPayloadBuilder.php index 1aa2b5f8c98..a8ecac6265f 100644 --- a/lib/commercetools-api/src/Models/Subscription/ResourceDeletedDeliveryPayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/ResourceDeletedDeliveryPayloadBuilder.php @@ -26,36 +26,46 @@ final class ResourceDeletedDeliveryPayloadBuilder implements Builder { /** + * @var ?string */ private $projectKey; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $modifiedAt; /** + * @var ?bool */ private $dataErasure; /** + *

    key of the Project. + * Useful in message processing if the Destination receives events from multiple Projects.

    + * + * @return null|string */ public function getProjectKey() @@ -64,8 +74,9 @@ public function getProjectKey() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that triggered the message.

    * + * @return null|Reference */ public function getResource() @@ -74,6 +85,9 @@ public function getResource() } /** + *

    User-defined unique identifiers of the resource.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -82,6 +96,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Last seen version of the resource.

    + * + * @return null|int */ public function getVersion() @@ -90,6 +107,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the resource was last deleted.

    + * + * @return null|DateTimeImmutable */ public function getModifiedAt() @@ -98,6 +118,9 @@ public function getModifiedAt() } /** + *

    true if the dataErasure parameter on the DELETE request was set to true.

    + * + * @return null|bool */ public function getDataErasure() diff --git a/lib/commercetools-api/src/Models/Subscription/ResourceDeletedDeliveryPayloadModel.php b/lib/commercetools-api/src/Models/Subscription/ResourceDeletedDeliveryPayloadModel.php index e20d0ab4cfc..e3f66576a3a 100644 --- a/lib/commercetools-api/src/Models/Subscription/ResourceDeletedDeliveryPayloadModel.php +++ b/lib/commercetools-api/src/Models/Subscription/ResourceDeletedDeliveryPayloadModel.php @@ -26,36 +26,43 @@ final class ResourceDeletedDeliveryPayloadModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'ResourceDeleted'; /** + * * @var ?string */ protected $projectKey; /** + * * @var ?string */ protected $notificationType; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $modifiedAt; /** + * * @var ?bool */ protected $dataErasure; @@ -70,7 +77,8 @@ public function __construct( ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?int $version = null, ?DateTimeImmutable $modifiedAt = null, - ?bool $dataErasure = null + ?bool $dataErasure = null, + ?string $notificationType = null ) { $this->projectKey = $projectKey; $this->resource = $resource; @@ -78,10 +86,14 @@ public function __construct( $this->version = $version; $this->modifiedAt = $modifiedAt; $this->dataErasure = $dataErasure; - $this->notificationType = static::DISCRIMINATOR_VALUE; + $this->notificationType = $notificationType ?? self::DISCRIMINATOR_VALUE; } /** + *

    key of the Project. + * Useful in message processing if the Destination receives events from multiple Projects.

    + * + * * @return null|string */ public function getProjectKey() @@ -99,6 +111,9 @@ public function getProjectKey() } /** + *

    Identifies the payload.

    + * + * * @return null|string */ public function getNotificationType() @@ -116,7 +131,8 @@ public function getNotificationType() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that triggered the message.

    + * * * @return null|Reference */ @@ -136,6 +152,9 @@ public function getResource() } /** + *

    User-defined unique identifiers of the resource.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -154,6 +173,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Last seen version of the resource.

    + * + * * @return null|int */ public function getVersion() @@ -171,6 +193,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the resource was last deleted.

    + * + * * @return null|DateTimeImmutable */ public function getModifiedAt() @@ -192,6 +217,9 @@ public function getModifiedAt() } /** + *

    true if the dataErasure parameter on the DELETE request was set to true.

    + * + * * @return null|bool */ public function getDataErasure() diff --git a/lib/commercetools-api/src/Models/Subscription/ResourceUpdatedDeliveryPayload.php b/lib/commercetools-api/src/Models/Subscription/ResourceUpdatedDeliveryPayload.php index 60eecd60758..4908c636910 100644 --- a/lib/commercetools-api/src/Models/Subscription/ResourceUpdatedDeliveryPayload.php +++ b/lib/commercetools-api/src/Models/Subscription/ResourceUpdatedDeliveryPayload.php @@ -19,16 +19,25 @@ interface ResourceUpdatedDeliveryPayload extends DeliveryPayload public const FIELD_MODIFIED_AT = 'modifiedAt'; /** + *

    Last seen version of the resource.

    + * + * @return null|int */ public function getVersion(); /** + *

    Version of the resource before the update.

    + * + * @return null|int */ public function getOldVersion(); /** + *

    Date and time (UTC) the resource was last updated.

    + * + * @return null|DateTimeImmutable */ public function getModifiedAt(); diff --git a/lib/commercetools-api/src/Models/Subscription/ResourceUpdatedDeliveryPayloadBuilder.php b/lib/commercetools-api/src/Models/Subscription/ResourceUpdatedDeliveryPayloadBuilder.php index 31bb71876b7..5037141f42d 100644 --- a/lib/commercetools-api/src/Models/Subscription/ResourceUpdatedDeliveryPayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/ResourceUpdatedDeliveryPayloadBuilder.php @@ -26,36 +26,46 @@ final class ResourceUpdatedDeliveryPayloadBuilder implements Builder { /** + * @var ?string */ private $projectKey; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder */ private $resourceUserProvidedIdentifiers; /** + * @var ?int */ private $version; /** + * @var ?int */ private $oldVersion; /** + * @var ?DateTimeImmutable */ private $modifiedAt; /** + *

    key of the Project. + * Useful in message processing if the Destination receives events from multiple Projects.

    + * + * @return null|string */ public function getProjectKey() @@ -64,8 +74,9 @@ public function getProjectKey() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that triggered the message.

    * + * @return null|Reference */ public function getResource() @@ -74,6 +85,9 @@ public function getResource() } /** + *

    User-defined unique identifiers of the resource.

    + * + * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -82,6 +96,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Last seen version of the resource.

    + * + * @return null|int */ public function getVersion() @@ -90,6 +107,9 @@ public function getVersion() } /** + *

    Version of the resource before the update.

    + * + * @return null|int */ public function getOldVersion() @@ -98,6 +118,9 @@ public function getOldVersion() } /** + *

    Date and time (UTC) the resource was last updated.

    + * + * @return null|DateTimeImmutable */ public function getModifiedAt() diff --git a/lib/commercetools-api/src/Models/Subscription/ResourceUpdatedDeliveryPayloadModel.php b/lib/commercetools-api/src/Models/Subscription/ResourceUpdatedDeliveryPayloadModel.php index 84d3eafee01..1cbdd4968a5 100644 --- a/lib/commercetools-api/src/Models/Subscription/ResourceUpdatedDeliveryPayloadModel.php +++ b/lib/commercetools-api/src/Models/Subscription/ResourceUpdatedDeliveryPayloadModel.php @@ -26,36 +26,43 @@ final class ResourceUpdatedDeliveryPayloadModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'ResourceUpdated'; /** + * * @var ?string */ protected $projectKey; /** + * * @var ?string */ protected $notificationType; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?UserProvidedIdentifiers */ protected $resourceUserProvidedIdentifiers; /** + * * @var ?int */ protected $version; /** + * * @var ?int */ protected $oldVersion; /** + * * @var ?DateTimeImmutable */ protected $modifiedAt; @@ -70,7 +77,8 @@ public function __construct( ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?int $version = null, ?int $oldVersion = null, - ?DateTimeImmutable $modifiedAt = null + ?DateTimeImmutable $modifiedAt = null, + ?string $notificationType = null ) { $this->projectKey = $projectKey; $this->resource = $resource; @@ -78,10 +86,14 @@ public function __construct( $this->version = $version; $this->oldVersion = $oldVersion; $this->modifiedAt = $modifiedAt; - $this->notificationType = static::DISCRIMINATOR_VALUE; + $this->notificationType = $notificationType ?? self::DISCRIMINATOR_VALUE; } /** + *

    key of the Project. + * Useful in message processing if the Destination receives events from multiple Projects.

    + * + * * @return null|string */ public function getProjectKey() @@ -99,6 +111,9 @@ public function getProjectKey() } /** + *

    Identifies the payload.

    + * + * * @return null|string */ public function getNotificationType() @@ -116,7 +131,8 @@ public function getNotificationType() } /** - *

    A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

    + *

    Reference to the resource that triggered the message.

    + * * * @return null|Reference */ @@ -136,6 +152,9 @@ public function getResource() } /** + *

    User-defined unique identifiers of the resource.

    + * + * * @return null|UserProvidedIdentifiers */ public function getResourceUserProvidedIdentifiers() @@ -154,6 +173,9 @@ public function getResourceUserProvidedIdentifiers() } /** + *

    Last seen version of the resource.

    + * + * * @return null|int */ public function getVersion() @@ -171,6 +193,9 @@ public function getVersion() } /** + *

    Version of the resource before the update.

    + * + * * @return null|int */ public function getOldVersion() @@ -188,6 +213,9 @@ public function getOldVersion() } /** + *

    Date and time (UTC) the resource was last updated.

    + * + * * @return null|DateTimeImmutable */ public function getModifiedAt() diff --git a/lib/commercetools-api/src/Models/Subscription/SnsDestination.php b/lib/commercetools-api/src/Models/Subscription/SnsDestination.php index 8657cc93461..11f0ef50d18 100644 --- a/lib/commercetools-api/src/Models/Subscription/SnsDestination.php +++ b/lib/commercetools-api/src/Models/Subscription/SnsDestination.php @@ -16,22 +16,40 @@ interface SnsDestination extends Destination public const FIELD_ACCESS_KEY = 'accessKey'; public const FIELD_ACCESS_SECRET = 'accessSecret'; public const FIELD_TOPIC_ARN = 'topicArn'; + public const FIELD_AUTHENTICATION_MODE = 'authenticationMode'; /** + *

    Only present if authenticationMode is set to Credentials.

    + * + * @return null|string */ public function getAccessKey(); /** + *

    Only present if authenticationMode is set to Credentials.

    + * + * @return null|string */ public function getAccessSecret(); /** + *

    Amazon Resource Name (ARN) of the topic.

    + * + * @return null|string */ public function getTopicArn(); + /** + *

    Defines the method of authentication for the SNS topic.

    + * + + * @return null|string + */ + public function getAuthenticationMode(); + /** * @param ?string $accessKey */ @@ -46,4 +64,9 @@ public function setAccessSecret(?string $accessSecret): void; * @param ?string $topicArn */ public function setTopicArn(?string $topicArn): void; + + /** + * @param ?string $authenticationMode + */ + public function setAuthenticationMode(?string $authenticationMode): void; } diff --git a/lib/commercetools-api/src/Models/Subscription/SnsDestinationBuilder.php b/lib/commercetools-api/src/Models/Subscription/SnsDestinationBuilder.php index 3c1c5177c86..5c08b6560eb 100644 --- a/lib/commercetools-api/src/Models/Subscription/SnsDestinationBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/SnsDestinationBuilder.php @@ -21,21 +21,33 @@ final class SnsDestinationBuilder implements Builder { /** + * @var ?string */ private $accessKey; /** + * @var ?string */ private $accessSecret; /** + * @var ?string */ private $topicArn; /** + + * @var ?string + */ + private $authenticationMode; + + /** + *

    Only present if authenticationMode is set to Credentials.

    + * + * @return null|string */ public function getAccessKey() @@ -44,6 +56,9 @@ public function getAccessKey() } /** + *

    Only present if authenticationMode is set to Credentials.

    + * + * @return null|string */ public function getAccessSecret() @@ -52,6 +67,9 @@ public function getAccessSecret() } /** + *

    Amazon Resource Name (ARN) of the topic.

    + * + * @return null|string */ public function getTopicArn() @@ -59,6 +77,17 @@ public function getTopicArn() return $this->topicArn; } + /** + *

    Defines the method of authentication for the SNS topic.

    + * + + * @return null|string + */ + public function getAuthenticationMode() + { + return $this->authenticationMode; + } + /** * @param ?string $accessKey * @return $this @@ -92,13 +121,25 @@ public function withTopicArn(?string $topicArn) return $this; } + /** + * @param ?string $authenticationMode + * @return $this + */ + public function withAuthenticationMode(?string $authenticationMode) + { + $this->authenticationMode = $authenticationMode; + + return $this; + } + public function build(): SnsDestination { return new SnsDestinationModel( $this->accessKey, $this->accessSecret, - $this->topicArn + $this->topicArn, + $this->authenticationMode ); } diff --git a/lib/commercetools-api/src/Models/Subscription/SnsDestinationModel.php b/lib/commercetools-api/src/Models/Subscription/SnsDestinationModel.php index b3d7b1064de..b87d48ecce5 100644 --- a/lib/commercetools-api/src/Models/Subscription/SnsDestinationModel.php +++ b/lib/commercetools-api/src/Models/Subscription/SnsDestinationModel.php @@ -21,25 +21,35 @@ final class SnsDestinationModel extends JsonObjectModel implements SnsDestinatio { public const DISCRIMINATOR_VALUE = 'SNS'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $accessKey; /** + * * @var ?string */ protected $accessSecret; /** + * * @var ?string */ protected $topicArn; + /** + * + * @var ?string + */ + protected $authenticationMode; + /** * @psalm-suppress MissingParamType @@ -47,15 +57,19 @@ final class SnsDestinationModel extends JsonObjectModel implements SnsDestinatio public function __construct( ?string $accessKey = null, ?string $accessSecret = null, - ?string $topicArn = null + ?string $topicArn = null, + ?string $authenticationMode = null, + ?string $type = null ) { $this->accessKey = $accessKey; $this->accessSecret = $accessSecret; $this->topicArn = $topicArn; - $this->type = static::DISCRIMINATOR_VALUE; + $this->authenticationMode = $authenticationMode; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -73,6 +87,9 @@ public function getType() } /** + *

    Only present if authenticationMode is set to Credentials.

    + * + * * @return null|string */ public function getAccessKey() @@ -90,6 +107,9 @@ public function getAccessKey() } /** + *

    Only present if authenticationMode is set to Credentials.

    + * + * * @return null|string */ public function getAccessSecret() @@ -107,6 +127,9 @@ public function getAccessSecret() } /** + *

    Amazon Resource Name (ARN) of the topic.

    + * + * * @return null|string */ public function getTopicArn() @@ -123,6 +146,26 @@ public function getTopicArn() return $this->topicArn; } + /** + *

    Defines the method of authentication for the SNS topic.

    + * + * + * @return null|string + */ + public function getAuthenticationMode() + { + if (is_null($this->authenticationMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_AUTHENTICATION_MODE); + if (is_null($data)) { + return null; + } + $this->authenticationMode = (string) $data; + } + + return $this->authenticationMode; + } + /** * @param ?string $accessKey @@ -147,4 +190,12 @@ public function setTopicArn(?string $topicArn): void { $this->topicArn = $topicArn; } + + /** + * @param ?string $authenticationMode + */ + public function setAuthenticationMode(?string $authenticationMode): void + { + $this->authenticationMode = $authenticationMode; + } } diff --git a/lib/commercetools-api/src/Models/Subscription/SqsDestination.php b/lib/commercetools-api/src/Models/Subscription/SqsDestination.php index c90f8fdcb77..703090061fd 100644 --- a/lib/commercetools-api/src/Models/Subscription/SqsDestination.php +++ b/lib/commercetools-api/src/Models/Subscription/SqsDestination.php @@ -17,27 +17,48 @@ interface SqsDestination extends Destination public const FIELD_ACCESS_SECRET = 'accessSecret'; public const FIELD_QUEUE_URL = 'queueUrl'; public const FIELD_REGION = 'region'; + public const FIELD_AUTHENTICATION_MODE = 'authenticationMode'; /** + *

    Only present if authenticationMode is set to Credentials.

    + * + * @return null|string */ public function getAccessKey(); /** + *

    Only present if authenticationMode is set to Credentials.

    + * + * @return null|string */ public function getAccessSecret(); /** + *

    URL of the Amazon SQS queue.

    + * + * @return null|string */ public function getQueueUrl(); /** + *

    AWS Region the message queue is located in.

    + * + * @return null|string */ public function getRegion(); + /** + *

    Defines the method of authentication for the SQS queue.

    + * + + * @return null|string + */ + public function getAuthenticationMode(); + /** * @param ?string $accessKey */ @@ -57,4 +78,9 @@ public function setQueueUrl(?string $queueUrl): void; * @param ?string $region */ public function setRegion(?string $region): void; + + /** + * @param ?string $authenticationMode + */ + public function setAuthenticationMode(?string $authenticationMode): void; } diff --git a/lib/commercetools-api/src/Models/Subscription/SqsDestinationBuilder.php b/lib/commercetools-api/src/Models/Subscription/SqsDestinationBuilder.php index 949020ba7f6..7962d7f3828 100644 --- a/lib/commercetools-api/src/Models/Subscription/SqsDestinationBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/SqsDestinationBuilder.php @@ -21,26 +21,39 @@ final class SqsDestinationBuilder implements Builder { /** + * @var ?string */ private $accessKey; /** + * @var ?string */ private $accessSecret; /** + * @var ?string */ private $queueUrl; /** + * @var ?string */ private $region; /** + + * @var ?string + */ + private $authenticationMode; + + /** + *

    Only present if authenticationMode is set to Credentials.

    + * + * @return null|string */ public function getAccessKey() @@ -49,6 +62,9 @@ public function getAccessKey() } /** + *

    Only present if authenticationMode is set to Credentials.

    + * + * @return null|string */ public function getAccessSecret() @@ -57,6 +73,9 @@ public function getAccessSecret() } /** + *

    URL of the Amazon SQS queue.

    + * + * @return null|string */ public function getQueueUrl() @@ -65,6 +84,9 @@ public function getQueueUrl() } /** + *

    AWS Region the message queue is located in.

    + * + * @return null|string */ public function getRegion() @@ -72,6 +94,17 @@ public function getRegion() return $this->region; } + /** + *

    Defines the method of authentication for the SQS queue.

    + * + + * @return null|string + */ + public function getAuthenticationMode() + { + return $this->authenticationMode; + } + /** * @param ?string $accessKey * @return $this @@ -116,6 +149,17 @@ public function withRegion(?string $region) return $this; } + /** + * @param ?string $authenticationMode + * @return $this + */ + public function withAuthenticationMode(?string $authenticationMode) + { + $this->authenticationMode = $authenticationMode; + + return $this; + } + public function build(): SqsDestination { @@ -123,7 +167,8 @@ public function build(): SqsDestination $this->accessKey, $this->accessSecret, $this->queueUrl, - $this->region + $this->region, + $this->authenticationMode ); } diff --git a/lib/commercetools-api/src/Models/Subscription/SqsDestinationModel.php b/lib/commercetools-api/src/Models/Subscription/SqsDestinationModel.php index 9db253d7ace..3af2d703bf7 100644 --- a/lib/commercetools-api/src/Models/Subscription/SqsDestinationModel.php +++ b/lib/commercetools-api/src/Models/Subscription/SqsDestinationModel.php @@ -21,30 +21,41 @@ final class SqsDestinationModel extends JsonObjectModel implements SqsDestinatio { public const DISCRIMINATOR_VALUE = 'SQS'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $accessKey; /** + * * @var ?string */ protected $accessSecret; /** + * * @var ?string */ protected $queueUrl; /** + * * @var ?string */ protected $region; + /** + * + * @var ?string + */ + protected $authenticationMode; + /** * @psalm-suppress MissingParamType @@ -53,16 +64,20 @@ public function __construct( ?string $accessKey = null, ?string $accessSecret = null, ?string $queueUrl = null, - ?string $region = null + ?string $region = null, + ?string $authenticationMode = null, + ?string $type = null ) { $this->accessKey = $accessKey; $this->accessSecret = $accessSecret; $this->queueUrl = $queueUrl; $this->region = $region; - $this->type = static::DISCRIMINATOR_VALUE; + $this->authenticationMode = $authenticationMode; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -80,6 +95,9 @@ public function getType() } /** + *

    Only present if authenticationMode is set to Credentials.

    + * + * * @return null|string */ public function getAccessKey() @@ -97,6 +115,9 @@ public function getAccessKey() } /** + *

    Only present if authenticationMode is set to Credentials.

    + * + * * @return null|string */ public function getAccessSecret() @@ -114,6 +135,9 @@ public function getAccessSecret() } /** + *

    URL of the Amazon SQS queue.

    + * + * * @return null|string */ public function getQueueUrl() @@ -131,6 +155,9 @@ public function getQueueUrl() } /** + *

    AWS Region the message queue is located in.

    + * + * * @return null|string */ public function getRegion() @@ -147,6 +174,26 @@ public function getRegion() return $this->region; } + /** + *

    Defines the method of authentication for the SQS queue.

    + * + * + * @return null|string + */ + public function getAuthenticationMode() + { + if (is_null($this->authenticationMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_AUTHENTICATION_MODE); + if (is_null($data)) { + return null; + } + $this->authenticationMode = (string) $data; + } + + return $this->authenticationMode; + } + /** * @param ?string $accessKey @@ -179,4 +226,12 @@ public function setRegion(?string $region): void { $this->region = $region; } + + /** + * @param ?string $authenticationMode + */ + public function setAuthenticationMode(?string $authenticationMode): void + { + $this->authenticationMode = $authenticationMode; + } } diff --git a/lib/commercetools-api/src/Models/Subscription/Subscription.php b/lib/commercetools-api/src/Models/Subscription/Subscription.php index 29f08de7657..e45cf897a64 100644 --- a/lib/commercetools-api/src/Models/Subscription/Subscription.php +++ b/lib/commercetools-api/src/Models/Subscription/Subscription.php @@ -29,45 +29,63 @@ interface Subscription extends BaseResource /** *

    Unique identifier of the Subscription.

    * + * @return null|string */ public function getId(); /** + *

    Current version of the Subscription.

    + * + * @return null|int */ public function getVersion(); /** + *

    Date and time (UTC) the Subscription was initially created.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt(); /** + *

    Date and time (UTC) the Subscription was last modified.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); /** - *

    Present on resources created after 2019-02-01 except for events not tracked.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); /** - *

    Present on resources created after 2019-02-01 except for events not tracked.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); /** + *

    Change notifications subscribed to.

    + * + * @return null|ChangeSubscriptionCollection */ public function getChanges(); /** + *

    Messaging service to which the messages are to be sent.

    + * + * @return null|Destination */ public function getDestination(); @@ -75,21 +93,31 @@ public function getDestination(); /** *

    User-defined unique identifier of the Subscription.

    * + * @return null|string */ public function getKey(); /** + *

    Messages subscribed to.

    + * + * @return null|MessageSubscriptionCollection */ public function getMessages(); /** + *

    Format in which the payload is delivered.

    + * + * @return null|DeliveryFormat */ public function getFormat(); /** + *

    Status of the Subscription.

    + * + * @return null|string */ public function getStatus(); diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionBuilder.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionBuilder.php index c4a7564ac45..341c6b0e7d1 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionBuilder.php @@ -28,61 +28,73 @@ final class SubscriptionBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?ChangeSubscriptionCollection */ private $changes; /** + * @var null|Destination|DestinationBuilder */ private $destination; /** + * @var ?string */ private $key; /** + * @var ?MessageSubscriptionCollection */ private $messages; /** + * @var null|DeliveryFormat|DeliveryFormatBuilder */ private $format; /** + * @var ?string */ private $status; @@ -90,6 +102,7 @@ final class SubscriptionBuilder implements Builder /** *

    Unique identifier of the Subscription.

    * + * @return null|string */ public function getId() @@ -98,6 +111,9 @@ public function getId() } /** + *

    Current version of the Subscription.

    + * + * @return null|int */ public function getVersion() @@ -106,6 +122,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Subscription was initially created.

    + * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -114,6 +133,9 @@ public function getCreatedAt() } /** + *

    Date and time (UTC) the Subscription was last modified.

    + * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -122,8 +144,9 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 2019-02-01 except for events not tracked.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -132,8 +155,9 @@ public function getLastModifiedBy() } /** - *

    Present on resources created after 2019-02-01 except for events not tracked.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -142,6 +166,9 @@ public function getCreatedBy() } /** + *

    Change notifications subscribed to.

    + * + * @return null|ChangeSubscriptionCollection */ public function getChanges() @@ -150,6 +177,9 @@ public function getChanges() } /** + *

    Messaging service to which the messages are to be sent.

    + * + * @return null|Destination */ public function getDestination() @@ -160,6 +190,7 @@ public function getDestination() /** *

    User-defined unique identifier of the Subscription.

    * + * @return null|string */ public function getKey() @@ -168,6 +199,9 @@ public function getKey() } /** + *

    Messages subscribed to.

    + * + * @return null|MessageSubscriptionCollection */ public function getMessages() @@ -176,6 +210,9 @@ public function getMessages() } /** + *

    Format in which the payload is delivered.

    + * + * @return null|DeliveryFormat */ public function getFormat() @@ -184,6 +221,9 @@ public function getFormat() } /** + *

    Status of the Subscription.

    + * + * @return null|string */ public function getStatus() diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionChangeDestinationAction.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionChangeDestinationAction.php index 334f03e8515..dab43ef9251 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionChangeDestinationAction.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionChangeDestinationAction.php @@ -16,6 +16,9 @@ interface SubscriptionChangeDestinationAction extends SubscriptionUpdateAction public const FIELD_DESTINATION = 'destination'; /** + *

    New value to set. Must not be empty.

    + * + * @return null|Destination */ public function getDestination(); diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionChangeDestinationActionBuilder.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionChangeDestinationActionBuilder.php index 333942ff49a..6ecb0daa5e6 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionChangeDestinationActionBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionChangeDestinationActionBuilder.php @@ -21,11 +21,15 @@ final class SubscriptionChangeDestinationActionBuilder implements Builder { /** + * @var null|Destination|DestinationBuilder */ private $destination; /** + *

    New value to set. Must not be empty.

    + * + * @return null|Destination */ public function getDestination() diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionChangeDestinationActionModel.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionChangeDestinationActionModel.php index e4fe68cb596..5a81978b2be 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionChangeDestinationActionModel.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionChangeDestinationActionModel.php @@ -21,11 +21,13 @@ final class SubscriptionChangeDestinationActionModel extends JsonObjectModel imp { public const DISCRIMINATOR_VALUE = 'changeDestination'; /** + * * @var ?string */ protected $action; /** + * * @var ?Destination */ protected $destination; @@ -35,13 +37,15 @@ final class SubscriptionChangeDestinationActionModel extends JsonObjectModel imp * @psalm-suppress MissingParamType */ public function __construct( - ?Destination $destination = null + ?Destination $destination = null, + ?string $action = null ) { $this->destination = $destination; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,9 @@ public function getAction() } /** + *

    New value to set. Must not be empty.

    + * + * * @return null|Destination */ public function getDestination() diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionDraft.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionDraft.php index c30e9e96196..fda99f75e94 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionDraft.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionDraft.php @@ -20,11 +20,17 @@ interface SubscriptionDraft extends JsonObject public const FIELD_FORMAT = 'format'; /** + *

    Change notifications to be subscribed to.

    + * + * @return null|ChangeSubscriptionCollection */ public function getChanges(); /** + *

    Messaging service to which the messages are sent.

    + * + * @return null|Destination */ public function getDestination(); @@ -32,16 +38,23 @@ public function getDestination(); /** *

    User-defined unique identifier for the Subscription.

    * + * @return null|string */ public function getKey(); /** + *

    Messages to be subscribed to.

    + * + * @return null|MessageSubscriptionCollection */ public function getMessages(); /** + *

    Format in which the payload is delivered. When not provided, the PlatformFormat is selected by default.

    + * + * @return null|DeliveryFormat */ public function getFormat(); diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionDraftBuilder.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionDraftBuilder.php index ed3b60db0ba..749d7c93571 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionDraftBuilder.php @@ -21,31 +21,39 @@ final class SubscriptionDraftBuilder implements Builder { /** + * @var ?ChangeSubscriptionCollection */ private $changes; /** + * @var null|Destination|DestinationBuilder */ private $destination; /** + * @var ?string */ private $key; /** + * @var ?MessageSubscriptionCollection */ private $messages; /** + * @var null|DeliveryFormat|DeliveryFormatBuilder */ private $format; /** + *

    Change notifications to be subscribed to.

    + * + * @return null|ChangeSubscriptionCollection */ public function getChanges() @@ -54,6 +62,9 @@ public function getChanges() } /** + *

    Messaging service to which the messages are sent.

    + * + * @return null|Destination */ public function getDestination() @@ -64,6 +75,7 @@ public function getDestination() /** *

    User-defined unique identifier for the Subscription.

    * + * @return null|string */ public function getKey() @@ -72,6 +84,9 @@ public function getKey() } /** + *

    Messages to be subscribed to.

    + * + * @return null|MessageSubscriptionCollection */ public function getMessages() @@ -80,6 +95,9 @@ public function getMessages() } /** + *

    Format in which the payload is delivered. When not provided, the PlatformFormat is selected by default.

    + * + * @return null|DeliveryFormat */ public function getFormat() diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionDraftModel.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionDraftModel.php index f18df244beb..f5ed39bad9d 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionDraftModel.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionDraftModel.php @@ -20,26 +20,31 @@ final class SubscriptionDraftModel extends JsonObjectModel implements SubscriptionDraft { /** + * * @var ?ChangeSubscriptionCollection */ protected $changes; /** + * * @var ?Destination */ protected $destination; /** + * * @var ?string */ protected $key; /** + * * @var ?MessageSubscriptionCollection */ protected $messages; /** + * * @var ?DeliveryFormat */ protected $format; @@ -63,6 +68,9 @@ public function __construct( } /** + *

    Change notifications to be subscribed to.

    + * + * * @return null|ChangeSubscriptionCollection */ public function getChanges() @@ -80,6 +88,9 @@ public function getChanges() } /** + *

    Messaging service to which the messages are sent.

    + * + * * @return null|Destination */ public function getDestination() @@ -100,6 +111,7 @@ public function getDestination() /** *

    User-defined unique identifier for the Subscription.

    * + * * @return null|string */ public function getKey() @@ -117,6 +129,9 @@ public function getKey() } /** + *

    Messages to be subscribed to.

    + * + * * @return null|MessageSubscriptionCollection */ public function getMessages() @@ -134,6 +149,9 @@ public function getMessages() } /** + *

    Format in which the payload is delivered. When not provided, the PlatformFormat is selected by default.

    + * + * * @return null|DeliveryFormat */ public function getFormat() diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionModel.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionModel.php index 1e383ee9100..0210e0d200b 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionModel.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionModel.php @@ -27,61 +27,73 @@ final class SubscriptionModel extends JsonObjectModel implements Subscription { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?ChangeSubscriptionCollection */ protected $changes; /** + * * @var ?Destination */ protected $destination; /** + * * @var ?string */ protected $key; /** + * * @var ?MessageSubscriptionCollection */ protected $messages; /** + * * @var ?DeliveryFormat */ protected $format; /** + * * @var ?string */ protected $status; @@ -121,6 +133,7 @@ public function __construct( /** *

    Unique identifier of the Subscription.

    * + * * @return null|string */ public function getId() @@ -138,6 +151,9 @@ public function getId() } /** + *

    Current version of the Subscription.

    + * + * * @return null|int */ public function getVersion() @@ -155,6 +171,9 @@ public function getVersion() } /** + *

    Date and time (UTC) the Subscription was initially created.

    + * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -176,6 +195,9 @@ public function getCreatedAt() } /** + *

    Date and time (UTC) the Subscription was last modified.

    + * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -197,7 +219,8 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 2019-02-01 except for events not tracked.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * * * @return null|LastModifiedBy */ @@ -217,7 +240,8 @@ public function getLastModifiedBy() } /** - *

    Present on resources created after 2019-02-01 except for events not tracked.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * * * @return null|CreatedBy */ @@ -237,6 +261,9 @@ public function getCreatedBy() } /** + *

    Change notifications subscribed to.

    + * + * * @return null|ChangeSubscriptionCollection */ public function getChanges() @@ -254,6 +281,9 @@ public function getChanges() } /** + *

    Messaging service to which the messages are to be sent.

    + * + * * @return null|Destination */ public function getDestination() @@ -274,6 +304,7 @@ public function getDestination() /** *

    User-defined unique identifier of the Subscription.

    * + * * @return null|string */ public function getKey() @@ -291,6 +322,9 @@ public function getKey() } /** + *

    Messages subscribed to.

    + * + * * @return null|MessageSubscriptionCollection */ public function getMessages() @@ -308,6 +342,9 @@ public function getMessages() } /** + *

    Format in which the payload is delivered.

    + * + * * @return null|DeliveryFormat */ public function getFormat() @@ -326,6 +363,9 @@ public function getFormat() } /** + *

    Status of the Subscription.

    + * + * * @return null|string */ public function getStatus() diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionPagedQueryResponse.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionPagedQueryResponse.php index 22ea266330b..0a02ee69484 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionPagedQueryResponse.php @@ -14,36 +14,51 @@ interface SubscriptionPagedQueryResponse extends JsonObject { public const FIELD_LIMIT = 'limit'; + public const FIELD_OFFSET = 'offset'; public const FIELD_COUNT = 'count'; public const FIELD_TOTAL = 'total'; - public const FIELD_OFFSET = 'offset'; public const FIELD_RESULTS = 'results'; /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); /** + *

    Number of elements skipped.

    + * + * @return null|int */ - public function getCount(); + public function getOffset(); /** + *

    Actual number of results returned.

    + * + * @return null|int */ - public function getTotal(); + public function getCount(); /** - *

    Number of elements skipped.

    + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ - public function getOffset(); + public function getTotal(); /** + *

    Subscriptions matching the query.

    + * + * @return null|SubscriptionCollection */ public function getResults(); @@ -53,6 +68,11 @@ public function getResults(); */ public function setLimit(?int $limit): void; + /** + * @param ?int $offset + */ + public function setOffset(?int $offset): void; + /** * @param ?int $count */ @@ -63,11 +83,6 @@ public function setCount(?int $count): void; */ public function setTotal(?int $total): void; - /** - * @param ?int $offset - */ - public function setOffset(?int $offset): void; - /** * @param ?SubscriptionCollection $results */ diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionPagedQueryResponseBuilder.php index e2eb301712a..3172c0dfd1d 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class SubscriptionPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ - private $count; + private $offset; /** + * @var ?int */ - private $total; + private $count; /** + * @var ?int */ - private $offset; + private $total; /** + * @var ?SubscriptionCollection */ private $results; @@ -48,6 +53,7 @@ final class SubscriptionPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -56,32 +62,46 @@ public function getLimit() } /** + *

    Number of elements skipped.

    + * + * @return null|int */ - public function getCount() + public function getOffset() { - return $this->count; + return $this->offset; } /** + *

    Actual number of results returned.

    + * + * @return null|int */ - public function getTotal() + public function getCount() { - return $this->total; + return $this->count; } /** - *

    Number of elements skipped.

    + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ - public function getOffset() + public function getTotal() { - return $this->offset; + return $this->total; } /** + *

    Subscriptions matching the query.

    + * + * @return null|SubscriptionCollection */ public function getResults() @@ -101,34 +121,34 @@ public function withLimit(?int $limit) } /** - * @param ?int $count + * @param ?int $offset * @return $this */ - public function withCount(?int $count) + public function withOffset(?int $offset) { - $this->count = $count; + $this->offset = $offset; return $this; } /** - * @param ?int $total + * @param ?int $count * @return $this */ - public function withTotal(?int $total) + public function withCount(?int $count) { - $this->total = $total; + $this->count = $count; return $this; } /** - * @param ?int $offset + * @param ?int $total * @return $this */ - public function withOffset(?int $offset) + public function withTotal(?int $total) { - $this->offset = $offset; + $this->total = $total; return $this; } @@ -149,9 +169,9 @@ public function build(): SubscriptionPagedQueryResponse { return new SubscriptionPagedQueryResponseModel( $this->limit, + $this->offset, $this->count, $this->total, - $this->offset, $this->results ); } diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionPagedQueryResponseModel.php index b34b1606857..3fa56436b7d 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class SubscriptionPagedQueryResponseModel extends JsonObjectModel implements SubscriptionPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ - protected $count; + protected $offset; /** + * * @var ?int */ - protected $total; + protected $count; /** + * * @var ?int */ - protected $offset; + protected $total; /** + * * @var ?SubscriptionCollection */ protected $results; @@ -50,21 +55,22 @@ final class SubscriptionPagedQueryResponseModel extends JsonObjectModel implemen */ public function __construct( ?int $limit = null, + ?int $offset = null, ?int $count = null, ?int $total = null, - ?int $offset = null, ?SubscriptionCollection $results = null ) { $this->limit = $limit; + $this->offset = $offset; $this->count = $count; $this->total = $total; - $this->offset = $offset; $this->results = $results; } /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -82,59 +88,73 @@ public function getLimit() } /** + *

    Number of elements skipped.

    + * + * * @return null|int */ - public function getCount() + public function getOffset() { - if (is_null($this->count)) { + if (is_null($this->offset)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_COUNT); + $data = $this->raw(self::FIELD_OFFSET); if (is_null($data)) { return null; } - $this->count = (int) $data; + $this->offset = (int) $data; } - return $this->count; + return $this->offset; } /** + *

    Actual number of results returned.

    + * + * * @return null|int */ - public function getTotal() + public function getCount() { - if (is_null($this->total)) { + if (is_null($this->count)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_TOTAL); + $data = $this->raw(self::FIELD_COUNT); if (is_null($data)) { return null; } - $this->total = (int) $data; + $this->count = (int) $data; } - return $this->total; + return $this->count; } /** - *

    Number of elements skipped.

    + *

    Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

    + * * * @return null|int */ - public function getOffset() + public function getTotal() { - if (is_null($this->offset)) { + if (is_null($this->total)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_OFFSET); + $data = $this->raw(self::FIELD_TOTAL); if (is_null($data)) { return null; } - $this->offset = (int) $data; + $this->total = (int) $data; } - return $this->offset; + return $this->total; } /** + *

    Subscriptions matching the query.

    + * + * * @return null|SubscriptionCollection */ public function getResults() @@ -160,6 +180,14 @@ public function setLimit(?int $limit): void $this->limit = $limit; } + /** + * @param ?int $offset + */ + public function setOffset(?int $offset): void + { + $this->offset = $offset; + } + /** * @param ?int $count */ @@ -176,14 +204,6 @@ public function setTotal(?int $total): void $this->total = $total; } - /** - * @param ?int $offset - */ - public function setOffset(?int $offset): void - { - $this->offset = $offset; - } - /** * @param ?SubscriptionCollection $results */ diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetChangesAction.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetChangesAction.php index 100609ba184..633564279da 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetChangesAction.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetChangesAction.php @@ -16,6 +16,9 @@ interface SubscriptionSetChangesAction extends SubscriptionUpdateAction public const FIELD_CHANGES = 'changes'; /** + *

    Value to set. Can only be unset if messages is set.

    + * + * @return null|ChangeSubscriptionCollection */ public function getChanges(); diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetChangesActionBuilder.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetChangesActionBuilder.php index 40c1253c526..199d9c4c4e4 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetChangesActionBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetChangesActionBuilder.php @@ -21,11 +21,15 @@ final class SubscriptionSetChangesActionBuilder implements Builder { /** + * @var ?ChangeSubscriptionCollection */ private $changes; /** + *

    Value to set. Can only be unset if messages is set.

    + * + * @return null|ChangeSubscriptionCollection */ public function getChanges() diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetChangesActionModel.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetChangesActionModel.php index 11b9a5f5c7a..e8f14cbe685 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetChangesActionModel.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetChangesActionModel.php @@ -21,11 +21,13 @@ final class SubscriptionSetChangesActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'setChanges'; /** + * * @var ?string */ protected $action; /** + * * @var ?ChangeSubscriptionCollection */ protected $changes; @@ -35,13 +37,15 @@ final class SubscriptionSetChangesActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?ChangeSubscriptionCollection $changes = null + ?ChangeSubscriptionCollection $changes = null, + ?string $action = null ) { $this->changes = $changes; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,9 @@ public function getAction() } /** + *

    Value to set. Can only be unset if messages is set.

    + * + * * @return null|ChangeSubscriptionCollection */ public function getChanges() diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetKeyAction.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetKeyAction.php index fb874b3138a..b081eea13ae 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetKeyAction.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetKeyAction.php @@ -16,8 +16,9 @@ interface SubscriptionSetKeyAction extends SubscriptionUpdateAction public const FIELD_KEY = 'key'; /** - *

    If key is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetKeyActionBuilder.php index 7581779d6d9..80cd18b090c 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetKeyActionBuilder.php @@ -21,13 +21,15 @@ final class SubscriptionSetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; /** - *

    If key is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetKeyActionModel.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetKeyActionModel.php index 49fa4c8b252..c58623ccdb7 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetKeyActionModel.php @@ -21,11 +21,13 @@ final class SubscriptionSetKeyActionModel extends JsonObjectModel implements Sub { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class SubscriptionSetKeyActionModel extends JsonObjectModel implements Sub * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,7 +63,8 @@ public function getAction() } /** - *

    If key is absent or null, this field will be removed if it exists.

    + *

    Value to set. If empty, any existing value will be removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetMessagesAction.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetMessagesAction.php index f7dd3047052..d487ad8d69b 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetMessagesAction.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetMessagesAction.php @@ -16,6 +16,9 @@ interface SubscriptionSetMessagesAction extends SubscriptionUpdateAction public const FIELD_MESSAGES = 'messages'; /** + *

    Value to set. Can only be unset if changes is set.

    + * + * @return null|MessageSubscriptionCollection */ public function getMessages(); diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetMessagesActionBuilder.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetMessagesActionBuilder.php index 8d0cfd3128a..7f2c82b3888 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetMessagesActionBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetMessagesActionBuilder.php @@ -21,11 +21,15 @@ final class SubscriptionSetMessagesActionBuilder implements Builder { /** + * @var ?MessageSubscriptionCollection */ private $messages; /** + *

    Value to set. Can only be unset if changes is set.

    + * + * @return null|MessageSubscriptionCollection */ public function getMessages() diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetMessagesActionModel.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetMessagesActionModel.php index 5a96a04975e..1e24a941496 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionSetMessagesActionModel.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionSetMessagesActionModel.php @@ -21,11 +21,13 @@ final class SubscriptionSetMessagesActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'setMessages'; /** + * * @var ?string */ protected $action; /** + * * @var ?MessageSubscriptionCollection */ protected $messages; @@ -35,13 +37,15 @@ final class SubscriptionSetMessagesActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( - ?MessageSubscriptionCollection $messages = null + ?MessageSubscriptionCollection $messages = null, + ?string $action = null ) { $this->messages = $messages; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,9 @@ public function getAction() } /** + *

    Value to set. Can only be unset if changes is set.

    + * + * * @return null|MessageSubscriptionCollection */ public function getMessages() diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdate.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdate.php index 8cc58ec8a78..db217e41fc1 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdate.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdate.php @@ -17,11 +17,17 @@ interface SubscriptionUpdate extends JsonObject public const FIELD_ACTIONS = 'actions'; /** + *

    Expected version of the Subscription on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    + * + * @return null|int */ public function getVersion(); /** + *

    Update actions to be performed on the Subscription.

    + * + * @return null|SubscriptionUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdateAction.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdateAction.php index 2150f8a2d6c..0dbb494cced 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdateAction.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdateAction.php @@ -17,6 +17,7 @@ interface SubscriptionUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdateActionModel.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdateActionModel.php index c87d996ba3a..d4b8ab4caef 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdateActionModel.php @@ -21,6 +21,7 @@ final class SubscriptionUpdateActionModel extends JsonObjectModel implements Sub { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -40,11 +41,13 @@ final class SubscriptionUpdateActionModel extends JsonObjectModel implements Sub * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdateBuilder.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdateBuilder.php index fcea6e16be6..37d82840096 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdateBuilder.php @@ -21,16 +21,21 @@ final class SubscriptionUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?SubscriptionUpdateActionCollection */ private $actions; /** + *

    Expected version of the Subscription on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    + * + * @return null|int */ public function getVersion() @@ -39,6 +44,9 @@ public function getVersion() } /** + *

    Update actions to be performed on the Subscription.

    + * + * @return null|SubscriptionUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdateModel.php b/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdateModel.php index c46cb8de7e5..90e71db7bdd 100644 --- a/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdateModel.php +++ b/lib/commercetools-api/src/Models/Subscription/SubscriptionUpdateModel.php @@ -20,11 +20,13 @@ final class SubscriptionUpdateModel extends JsonObjectModel implements SubscriptionUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?SubscriptionUpdateActionCollection */ protected $actions; @@ -42,6 +44,9 @@ public function __construct( } /** + *

    Expected version of the Subscription on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    + * + * * @return null|int */ public function getVersion() @@ -59,6 +64,9 @@ public function getVersion() } /** + *

    Update actions to be performed on the Subscription.

    + * + * * @return null|SubscriptionUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/TaxCategory/SubRate.php b/lib/commercetools-api/src/Models/TaxCategory/SubRate.php index 65ae974f759..2c6eab52f25 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/SubRate.php +++ b/lib/commercetools-api/src/Models/TaxCategory/SubRate.php @@ -19,11 +19,13 @@ interface SubRate extends JsonObject /** *

    Name of the SubRate.

    * + * @return null|string */ public function getName(); /** + * @return null|float */ public function getAmount(); diff --git a/lib/commercetools-api/src/Models/TaxCategory/SubRateBuilder.php b/lib/commercetools-api/src/Models/TaxCategory/SubRateBuilder.php index ae3ca39a7a6..bc694460617 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/SubRateBuilder.php +++ b/lib/commercetools-api/src/Models/TaxCategory/SubRateBuilder.php @@ -21,11 +21,13 @@ final class SubRateBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?float */ private $amount; @@ -33,6 +35,7 @@ final class SubRateBuilder implements Builder /** *

    Name of the SubRate.

    * + * @return null|string */ public function getName() @@ -41,6 +44,7 @@ public function getName() } /** + * @return null|float */ public function getAmount() diff --git a/lib/commercetools-api/src/Models/TaxCategory/SubRateModel.php b/lib/commercetools-api/src/Models/TaxCategory/SubRateModel.php index 76ac74212e6..1c8d3acb0a8 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/SubRateModel.php +++ b/lib/commercetools-api/src/Models/TaxCategory/SubRateModel.php @@ -20,11 +20,13 @@ final class SubRateModel extends JsonObjectModel implements SubRate { /** + * * @var ?string */ protected $name; /** + * * @var ?float */ protected $amount; @@ -44,6 +46,7 @@ public function __construct( /** *

    Name of the SubRate.

    * + * * @return null|string */ public function getName() @@ -61,6 +64,7 @@ public function getName() } /** + * * @return null|float */ public function getAmount() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategory.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategory.php index 36e3b7f3ca5..75a486df6d7 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategory.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategory.php @@ -27,6 +27,7 @@ interface TaxCategory extends BaseResource /** *

    Unique identifier of the TaxCategory.

    * + * @return null|string */ public function getId(); @@ -34,6 +35,7 @@ public function getId(); /** *

    Current version of the TaxCategory.

    * + * @return null|int */ public function getVersion(); @@ -41,6 +43,7 @@ public function getVersion(); /** *

    Date and time (UTC) the TaxCategory was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -48,6 +51,7 @@ public function getCreatedAt(); /** *

    Date and time (UTC) the TaxCategory was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -55,6 +59,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -62,6 +67,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -69,6 +75,7 @@ public function getCreatedBy(); /** *

    Name of the TaxCategory.

    * + * @return null|string */ public function getName(); @@ -76,6 +83,7 @@ public function getName(); /** *

    Description of the TaxCategory.

    * + * @return null|string */ public function getDescription(); @@ -83,6 +91,7 @@ public function getDescription(); /** *

    Tax rates and subrates of states and countries. Each TaxRate in the array has a unique ID.

    * + * @return null|TaxRateCollection */ public function getRates(); @@ -90,6 +99,7 @@ public function getRates(); /** *

    User-defined unique identifier of the TaxCategory.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryAddTaxRateAction.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryAddTaxRateAction.php index bf1c9bd776d..7eef45875ec 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryAddTaxRateAction.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryAddTaxRateAction.php @@ -18,6 +18,7 @@ interface TaxCategoryAddTaxRateAction extends TaxCategoryUpdateAction /** *

    Value to append to the rates array.

    * + * @return null|TaxRateDraft */ public function getTaxRate(); diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryAddTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryAddTaxRateActionBuilder.php index 6d22538c0e9..ef4fc840d23 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryAddTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryAddTaxRateActionBuilder.php @@ -21,6 +21,7 @@ final class TaxCategoryAddTaxRateActionBuilder implements Builder { /** + * @var null|TaxRateDraft|TaxRateDraftBuilder */ private $taxRate; @@ -28,6 +29,7 @@ final class TaxCategoryAddTaxRateActionBuilder implements Builder /** *

    Value to append to the rates array.

    * + * @return null|TaxRateDraft */ public function getTaxRate() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryAddTaxRateActionModel.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryAddTaxRateActionModel.php index b17b9f548ea..fc98ec7b6f7 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryAddTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryAddTaxRateActionModel.php @@ -21,11 +21,13 @@ final class TaxCategoryAddTaxRateActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'addTaxRate'; /** + * * @var ?string */ protected $action; /** + * * @var ?TaxRateDraft */ protected $taxRate; @@ -35,13 +37,15 @@ final class TaxCategoryAddTaxRateActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?TaxRateDraft $taxRate = null + ?TaxRateDraft $taxRate = null, + ?string $action = null ) { $this->taxRate = $taxRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to append to the rates array.

    * + * * @return null|TaxRateDraft */ public function getTaxRate() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryBuilder.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryBuilder.php index 87b95efd48e..c35081ddfc7 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryBuilder.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryBuilder.php @@ -28,51 +28,61 @@ final class TaxCategoryBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $name; /** + * @var ?string */ private $description; /** + * @var ?TaxRateCollection */ private $rates; /** + * @var ?string */ private $key; @@ -80,6 +90,7 @@ final class TaxCategoryBuilder implements Builder /** *

    Unique identifier of the TaxCategory.

    * + * @return null|string */ public function getId() @@ -90,6 +101,7 @@ public function getId() /** *

    Current version of the TaxCategory.

    * + * @return null|int */ public function getVersion() @@ -100,6 +112,7 @@ public function getVersion() /** *

    Date and time (UTC) the TaxCategory was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -110,6 +123,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the TaxCategory was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -120,6 +134,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -130,6 +145,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -140,6 +156,7 @@ public function getCreatedBy() /** *

    Name of the TaxCategory.

    * + * @return null|string */ public function getName() @@ -150,6 +167,7 @@ public function getName() /** *

    Description of the TaxCategory.

    * + * @return null|string */ public function getDescription() @@ -160,6 +178,7 @@ public function getDescription() /** *

    Tax rates and subrates of states and countries. Each TaxRate in the array has a unique ID.

    * + * @return null|TaxRateCollection */ public function getRates() @@ -170,6 +189,7 @@ public function getRates() /** *

    User-defined unique identifier of the TaxCategory.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryChangeNameAction.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryChangeNameAction.php index fda160e104b..34017337a6c 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryChangeNameAction.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryChangeNameAction.php @@ -18,6 +18,7 @@ interface TaxCategoryChangeNameAction extends TaxCategoryUpdateAction /** *

    New value to set. Must not be empty.

    * + * @return null|string */ public function getName(); diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryChangeNameActionBuilder.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryChangeNameActionBuilder.php index fb885e36c01..62932c47488 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryChangeNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryChangeNameActionBuilder.php @@ -21,6 +21,7 @@ final class TaxCategoryChangeNameActionBuilder implements Builder { /** + * @var ?string */ private $name; @@ -28,6 +29,7 @@ final class TaxCategoryChangeNameActionBuilder implements Builder /** *

    New value to set. Must not be empty.

    * + * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryChangeNameActionModel.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryChangeNameActionModel.php index dbca9f6a44d..bcc9fafc617 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryChangeNameActionModel.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryChangeNameActionModel.php @@ -21,11 +21,13 @@ final class TaxCategoryChangeNameActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'changeName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; @@ -35,13 +37,15 @@ final class TaxCategoryChangeNameActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $name = null + ?string $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    New value to set. Must not be empty.

    * + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryDraft.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryDraft.php index 1f0ee1c19f1..998fc666461 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryDraft.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryDraft.php @@ -21,6 +21,7 @@ interface TaxCategoryDraft extends JsonObject /** *

    Name of the TaxCategory.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); /** *

    Description of the TaxCategory.

    * + * @return null|string */ public function getDescription(); @@ -35,6 +37,7 @@ public function getDescription(); /** *

    Tax rates and subrates of states and countries.

    * + * @return null|TaxRateDraftCollection */ public function getRates(); @@ -42,6 +45,7 @@ public function getRates(); /** *

    User-defined unique identifier for the TaxCategory.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryDraftBuilder.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryDraftBuilder.php index e4149eeca10..b6732989ed7 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryDraftBuilder.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryDraftBuilder.php @@ -21,21 +21,25 @@ final class TaxCategoryDraftBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?string */ private $description; /** + * @var ?TaxRateDraftCollection */ private $rates; /** + * @var ?string */ private $key; @@ -43,6 +47,7 @@ final class TaxCategoryDraftBuilder implements Builder /** *

    Name of the TaxCategory.

    * + * @return null|string */ public function getName() @@ -53,6 +58,7 @@ public function getName() /** *

    Description of the TaxCategory.

    * + * @return null|string */ public function getDescription() @@ -63,6 +69,7 @@ public function getDescription() /** *

    Tax rates and subrates of states and countries.

    * + * @return null|TaxRateDraftCollection */ public function getRates() @@ -73,6 +80,7 @@ public function getRates() /** *

    User-defined unique identifier for the TaxCategory.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryDraftModel.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryDraftModel.php index 8d97b1c122b..96c665ca435 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryDraftModel.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryDraftModel.php @@ -20,21 +20,25 @@ final class TaxCategoryDraftModel extends JsonObjectModel implements TaxCategoryDraft { /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $description; /** + * * @var ?TaxRateDraftCollection */ protected $rates; /** + * * @var ?string */ protected $key; @@ -58,6 +62,7 @@ public function __construct( /** *

    Name of the TaxCategory.

    * + * * @return null|string */ public function getName() @@ -77,6 +82,7 @@ public function getName() /** *

    Description of the TaxCategory.

    * + * * @return null|string */ public function getDescription() @@ -96,6 +102,7 @@ public function getDescription() /** *

    Tax rates and subrates of states and countries.

    * + * * @return null|TaxRateDraftCollection */ public function getRates() @@ -115,6 +122,7 @@ public function getRates() /** *

    User-defined unique identifier for the TaxCategory.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryModel.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryModel.php index 1d43c5e1938..e91c1ffe118 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryModel.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryModel.php @@ -27,51 +27,61 @@ final class TaxCategoryModel extends JsonObjectModel implements TaxCategory { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $description; /** + * * @var ?TaxRateCollection */ protected $rates; /** + * * @var ?string */ protected $key; @@ -107,6 +117,7 @@ public function __construct( /** *

    Unique identifier of the TaxCategory.

    * + * * @return null|string */ public function getId() @@ -126,6 +137,7 @@ public function getId() /** *

    Current version of the TaxCategory.

    * + * * @return null|int */ public function getVersion() @@ -145,6 +157,7 @@ public function getVersion() /** *

    Date and time (UTC) the TaxCategory was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -168,6 +181,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the TaxCategory was last updated.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -191,6 +205,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -211,6 +226,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -231,6 +247,7 @@ public function getCreatedBy() /** *

    Name of the TaxCategory.

    * + * * @return null|string */ public function getName() @@ -250,6 +267,7 @@ public function getName() /** *

    Description of the TaxCategory.

    * + * * @return null|string */ public function getDescription() @@ -269,6 +287,7 @@ public function getDescription() /** *

    Tax rates and subrates of states and countries. Each TaxRate in the array has a unique ID.

    * + * * @return null|TaxRateCollection */ public function getRates() @@ -288,6 +307,7 @@ public function getRates() /** *

    User-defined unique identifier of the TaxCategory.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryPagedQueryResponse.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryPagedQueryResponse.php index 7f19212f1cb..b6b21c0033f 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryPagedQueryResponse.php @@ -22,6 +22,7 @@ interface TaxCategoryPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    TaxCategories matching the query.

    * + * @return null|TaxCategoryCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryPagedQueryResponseBuilder.php index 80430100acb..deba5913535 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class TaxCategoryPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?TaxCategoryCollection */ private $results; @@ -48,6 +53,7 @@ final class TaxCategoryPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    TaxCategories matching the query.

    * + * @return null|TaxCategoryCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryPagedQueryResponseModel.php index 761370d4afc..6a2c346b96f 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class TaxCategoryPagedQueryResponseModel extends JsonObjectModel implements TaxCategoryPagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?TaxCategoryCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    TaxCategories matching the query.

    * + * * @return null|TaxCategoryCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReference.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReference.php index 031c1aaa049..f01800ec199 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReference.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReference.php @@ -19,6 +19,7 @@ interface TaxCategoryReference extends Reference /** *

    Contains the representation of the expanded TaxCategory. Only present in responses to requests with Reference Expansion for TaxCategories.

    * + * @return null|TaxCategory */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

    Unique identifier of the referenced TaxCategory.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReferenceBuilder.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReferenceBuilder.php index d4cebb79023..3cdf5787c6d 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReferenceBuilder.php @@ -23,11 +23,13 @@ final class TaxCategoryReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|TaxCategory|TaxCategoryBuilder */ private $obj; @@ -35,6 +37,7 @@ final class TaxCategoryReferenceBuilder implements Builder /** *

    Unique identifier of the referenced TaxCategory.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded TaxCategory. Only present in responses to requests with Reference Expansion for TaxCategories.

    * + * @return null|TaxCategory */ public function getObj() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReferenceModel.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReferenceModel.php index 100e49df74f..2112460243a 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReferenceModel.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReferenceModel.php @@ -23,16 +23,19 @@ final class TaxCategoryReferenceModel extends JsonObjectModel implements TaxCate { public const DISCRIMINATOR_VALUE = 'tax-category'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?TaxCategory */ protected $obj; @@ -43,16 +46,18 @@ final class TaxCategoryReferenceModel extends JsonObjectModel implements TaxCate */ public function __construct( ?string $id = null, - ?TaxCategory $obj = null + ?TaxCategory $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced TaxCategory.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded TaxCategory. Only present in responses to requests with Reference Expansion for TaxCategories.

    * + * * @return null|TaxCategory */ public function getObj() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryRemoveTaxRateAction.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryRemoveTaxRateAction.php index 3c7a0f7ada2..4814f26908e 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryRemoveTaxRateAction.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryRemoveTaxRateAction.php @@ -18,6 +18,7 @@ interface TaxCategoryRemoveTaxRateAction extends TaxCategoryUpdateAction /** *

    ID of the TaxRate to remove.

    * + * @return null|string */ public function getTaxRateId(); diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryRemoveTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryRemoveTaxRateActionBuilder.php index 88bdd653407..23006fc977d 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryRemoveTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryRemoveTaxRateActionBuilder.php @@ -21,6 +21,7 @@ final class TaxCategoryRemoveTaxRateActionBuilder implements Builder { /** + * @var ?string */ private $taxRateId; @@ -28,6 +29,7 @@ final class TaxCategoryRemoveTaxRateActionBuilder implements Builder /** *

    ID of the TaxRate to remove.

    * + * @return null|string */ public function getTaxRateId() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryRemoveTaxRateActionModel.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryRemoveTaxRateActionModel.php index 7467fdc7379..82b3fad556a 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryRemoveTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryRemoveTaxRateActionModel.php @@ -21,11 +21,13 @@ final class TaxCategoryRemoveTaxRateActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'removeTaxRate'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $taxRateId; @@ -35,13 +37,15 @@ final class TaxCategoryRemoveTaxRateActionModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?string $taxRateId = null + ?string $taxRateId = null, + ?string $action = null ) { $this->taxRateId = $taxRateId; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    ID of the TaxRate to remove.

    * + * * @return null|string */ public function getTaxRateId() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReplaceTaxRateAction.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReplaceTaxRateAction.php index 02da9a456d2..3472719f155 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReplaceTaxRateAction.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReplaceTaxRateAction.php @@ -19,6 +19,7 @@ interface TaxCategoryReplaceTaxRateAction extends TaxCategoryUpdateAction /** *

    ID of the TaxRate to replace.

    * + * @return null|string */ public function getTaxRateId(); @@ -26,6 +27,7 @@ public function getTaxRateId(); /** *

    New TaxRate to replace with.

    * + * @return null|TaxRateDraft */ public function getTaxRate(); diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReplaceTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReplaceTaxRateActionBuilder.php index 7e824343fdd..9de3a14664a 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReplaceTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReplaceTaxRateActionBuilder.php @@ -21,11 +21,13 @@ final class TaxCategoryReplaceTaxRateActionBuilder implements Builder { /** + * @var ?string */ private $taxRateId; /** + * @var null|TaxRateDraft|TaxRateDraftBuilder */ private $taxRate; @@ -33,6 +35,7 @@ final class TaxCategoryReplaceTaxRateActionBuilder implements Builder /** *

    ID of the TaxRate to replace.

    * + * @return null|string */ public function getTaxRateId() @@ -43,6 +46,7 @@ public function getTaxRateId() /** *

    New TaxRate to replace with.

    * + * @return null|TaxRateDraft */ public function getTaxRate() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReplaceTaxRateActionModel.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReplaceTaxRateActionModel.php index 0aff6a79eaf..236fb2d7fd4 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReplaceTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryReplaceTaxRateActionModel.php @@ -21,16 +21,19 @@ final class TaxCategoryReplaceTaxRateActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'replaceTaxRate'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $taxRateId; /** + * * @var ?TaxRateDraft */ protected $taxRate; @@ -41,14 +44,16 @@ final class TaxCategoryReplaceTaxRateActionModel extends JsonObjectModel impleme */ public function __construct( ?string $taxRateId = null, - ?TaxRateDraft $taxRate = null + ?TaxRateDraft $taxRate = null, + ?string $action = null ) { $this->taxRateId = $taxRateId; $this->taxRate = $taxRate; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    ID of the TaxRate to replace.

    * + * * @return null|string */ public function getTaxRateId() @@ -87,6 +93,7 @@ public function getTaxRateId() /** *

    New TaxRate to replace with.

    * + * * @return null|TaxRateDraft */ public function getTaxRate() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryResourceIdentifier.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryResourceIdentifier.php index 65d7faea0fb..3697a354a9f 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryResourceIdentifier.php @@ -17,6 +17,7 @@ interface TaxCategoryResourceIdentifier extends ResourceIdentifier /** *

    Unique identifier of the referenced TaxCategory. Either id or key is required.

    * + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

    User-defined unique identifier of the referenced TaxCategory. Either id or key is required.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryResourceIdentifierBuilder.php index a5a61082236..d14ce1f73e3 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class TaxCategoryResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class TaxCategoryResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced TaxCategory. Either id or key is required.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced TaxCategory. Either id or key is required.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryResourceIdentifierModel.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryResourceIdentifierModel.php index 61bc830bc0a..dbb0a868976 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class TaxCategoryResourceIdentifierModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'tax-category'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class TaxCategoryResourceIdentifierModel extends JsonObjectModel implement */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced TaxCategory. Either id or key is required.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced TaxCategory. Either id or key is required.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetDescriptionAction.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetDescriptionAction.php index e9885e759e6..3110a5ea219 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetDescriptionAction.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetDescriptionAction.php @@ -18,6 +18,7 @@ interface TaxCategorySetDescriptionAction extends TaxCategoryUpdateAction /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getDescription(); diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetDescriptionActionBuilder.php index 58440869755..84bbdd1ef2e 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetDescriptionActionBuilder.php @@ -21,6 +21,7 @@ final class TaxCategorySetDescriptionActionBuilder implements Builder { /** + * @var ?string */ private $description; @@ -28,6 +29,7 @@ final class TaxCategorySetDescriptionActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetDescriptionActionModel.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetDescriptionActionModel.php index cc0f57c0403..5e6a8791756 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetDescriptionActionModel.php @@ -21,11 +21,13 @@ final class TaxCategorySetDescriptionActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'setDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $description; @@ -35,13 +37,15 @@ final class TaxCategorySetDescriptionActionModel extends JsonObjectModel impleme * @psalm-suppress MissingParamType */ public function __construct( - ?string $description = null + ?string $description = null, + ?string $action = null ) { $this->description = $description; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|string */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetKeyAction.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetKeyAction.php index 79d92182aaf..4ebf6a7bd3b 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetKeyAction.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetKeyAction.php @@ -18,6 +18,7 @@ interface TaxCategorySetKeyAction extends TaxCategoryUpdateAction /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetKeyActionBuilder.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetKeyActionBuilder.php index 97e7054be04..0ad91f63c38 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetKeyActionBuilder.php @@ -21,6 +21,7 @@ final class TaxCategorySetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; @@ -28,6 +29,7 @@ final class TaxCategorySetKeyActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetKeyActionModel.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetKeyActionModel.php index 24a1e96d408..c30d742cd0d 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategorySetKeyActionModel.php @@ -21,11 +21,13 @@ final class TaxCategorySetKeyActionModel extends JsonObjectModel implements TaxC { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class TaxCategorySetKeyActionModel extends JsonObjectModel implements TaxC * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdate.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdate.php index 84cab1b97a0..768ad2ab7d6 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdate.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdate.php @@ -19,6 +19,7 @@ interface TaxCategoryUpdate extends JsonObject /** *

    Expected version of the TaxCategory on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion(); @@ -26,6 +27,7 @@ public function getVersion(); /** *

    Update actions to be performed on the TaxCategory.

    * + * @return null|TaxCategoryUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdateAction.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdateAction.php index 2a5ec928635..62f89e3f575 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdateAction.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdateAction.php @@ -17,6 +17,7 @@ interface TaxCategoryUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdateActionModel.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdateActionModel.php index 191ea10d9c8..911693c28ba 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdateActionModel.php @@ -21,6 +21,7 @@ final class TaxCategoryUpdateActionModel extends JsonObjectModel implements TaxC { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -42,11 +43,13 @@ final class TaxCategoryUpdateActionModel extends JsonObjectModel implements TaxC * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdateBuilder.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdateBuilder.php index 399a4736870..723cbb90909 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdateBuilder.php @@ -21,11 +21,13 @@ final class TaxCategoryUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?TaxCategoryUpdateActionCollection */ private $actions; @@ -33,6 +35,7 @@ final class TaxCategoryUpdateBuilder implements Builder /** *

    Expected version of the TaxCategory on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion() @@ -43,6 +46,7 @@ public function getVersion() /** *

    Update actions to be performed on the TaxCategory.

    * + * @return null|TaxCategoryUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdateModel.php b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdateModel.php index 7d60ad14a99..40d08053301 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdateModel.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxCategoryUpdateModel.php @@ -20,11 +20,13 @@ final class TaxCategoryUpdateModel extends JsonObjectModel implements TaxCategoryUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?TaxCategoryUpdateActionCollection */ protected $actions; @@ -44,6 +46,7 @@ public function __construct( /** *

    Expected version of the TaxCategory on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * * @return null|int */ public function getVersion() @@ -63,6 +66,7 @@ public function getVersion() /** *

    Update actions to be performed on the TaxCategory.

    * + * * @return null|TaxCategoryUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxRate.php b/lib/commercetools-api/src/Models/TaxCategory/TaxRate.php index d91dedef8d6..8479c66a509 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxRate.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxRate.php @@ -25,6 +25,7 @@ interface TaxRate extends JsonObject *

    Present if the TaxRate is part of a TaxCategory. * Absent for external TaxRates in LineItem, CustomLineItem, and ShippingInfo.

    * + * @return null|string */ public function getId(); @@ -32,6 +33,7 @@ public function getId(); /** *

    Name of the TaxRate.

    * + * @return null|string */ public function getName(); @@ -39,13 +41,15 @@ public function getName(); /** *

    Tax rate. If subrates are used, the amount must be the sum of all subrates.

    * + * @return null|float */ public function getAmount(); /** - *

    If true, tax is included in Prices and the taxedPrice is present on LineItems. In this case, the totalNet price on TaxedPrice includes the TaxRate.

    + *

    If true, tax is included in Embedded Prices and the taxedPrice is present on LineItems. In this case, the totalNet price on TaxedPrice includes the TaxRate.

    * + * @return null|bool */ public function getIncludedInPrice(); @@ -53,6 +57,7 @@ public function getIncludedInPrice(); /** *

    Country in which the tax rate is applied in ISO 3166-1 alpha-2 format.

    * + * @return null|string */ public function getCountry(); @@ -60,6 +65,7 @@ public function getCountry(); /** *

    State within the country, such as Texas in the United States.

    * + * @return null|string */ public function getState(); @@ -67,6 +73,7 @@ public function getState(); /** *

    Used to calculate the taxPortions field in a Cart or Order. It is useful if the total tax of a country (such as the US) is a combination of multiple taxes (such as state and local taxes).

    * + * @return null|SubRateCollection */ public function getSubRates(); diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxRateBuilder.php b/lib/commercetools-api/src/Models/TaxCategory/TaxRateBuilder.php index 9cd66dfe45d..0cbbb9e28d0 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxRateBuilder.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxRateBuilder.php @@ -21,36 +21,43 @@ final class TaxRateBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $name; /** + * @var ?float */ private $amount; /** + * @var ?bool */ private $includedInPrice; /** + * @var ?string */ private $country; /** + * @var ?string */ private $state; /** + * @var ?SubRateCollection */ private $subRates; @@ -59,6 +66,7 @@ final class TaxRateBuilder implements Builder *

    Present if the TaxRate is part of a TaxCategory. * Absent for external TaxRates in LineItem, CustomLineItem, and ShippingInfo.

    * + * @return null|string */ public function getId() @@ -69,6 +77,7 @@ public function getId() /** *

    Name of the TaxRate.

    * + * @return null|string */ public function getName() @@ -79,6 +88,7 @@ public function getName() /** *

    Tax rate. If subrates are used, the amount must be the sum of all subrates.

    * + * @return null|float */ public function getAmount() @@ -87,8 +97,9 @@ public function getAmount() } /** - *

    If true, tax is included in Prices and the taxedPrice is present on LineItems. In this case, the totalNet price on TaxedPrice includes the TaxRate.

    + *

    If true, tax is included in Embedded Prices and the taxedPrice is present on LineItems. In this case, the totalNet price on TaxedPrice includes the TaxRate.

    * + * @return null|bool */ public function getIncludedInPrice() @@ -99,6 +110,7 @@ public function getIncludedInPrice() /** *

    Country in which the tax rate is applied in ISO 3166-1 alpha-2 format.

    * + * @return null|string */ public function getCountry() @@ -109,6 +121,7 @@ public function getCountry() /** *

    State within the country, such as Texas in the United States.

    * + * @return null|string */ public function getState() @@ -119,6 +132,7 @@ public function getState() /** *

    Used to calculate the taxPortions field in a Cart or Order. It is useful if the total tax of a country (such as the US) is a combination of multiple taxes (such as state and local taxes).

    * + * @return null|SubRateCollection */ public function getSubRates() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxRateDraft.php b/lib/commercetools-api/src/Models/TaxCategory/TaxRateDraft.php index 1687333e880..a047a4778d0 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxRateDraft.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxRateDraft.php @@ -23,6 +23,7 @@ interface TaxRateDraft extends JsonObject /** *

    Name of the TaxRate.

    * + * @return null|string */ public function getName(); @@ -32,13 +33,15 @@ public function getName(); * Must be supplied if no subRates are specified. * If subRates are specified, this field can be omitted or it must be the sum of amounts of all subRates.

    * + * @return null|float */ public function getAmount(); /** - *

    If true, tax is included in Prices and the taxedPrice is present on LineItems. In this case, the totalNet price on TaxedPrice includes the TaxRate.

    + *

    If true, tax is included in Embedded Prices and the taxedPrice is present on LineItems. In this case, the totalNet price on TaxedPrice includes the TaxRate.

    * + * @return null|bool */ public function getIncludedInPrice(); @@ -46,6 +49,7 @@ public function getIncludedInPrice(); /** *

    Country in which the tax rate is applied in ISO 3166-1 alpha-2 format.

    * + * @return null|string */ public function getCountry(); @@ -53,6 +57,7 @@ public function getCountry(); /** *

    State within the country, such as Texas in the United States.

    * + * @return null|string */ public function getState(); @@ -60,6 +65,7 @@ public function getState(); /** *

    Used to calculate the taxPortions field in a Cart or Order. It is useful if the total tax of a country (such as the US) is a combination of multiple taxes (such as state and local taxes).

    * + * @return null|SubRateCollection */ public function getSubRates(); diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxRateDraftBuilder.php b/lib/commercetools-api/src/Models/TaxCategory/TaxRateDraftBuilder.php index 0eac8a330eb..1c4cdf3b0b4 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxRateDraftBuilder.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxRateDraftBuilder.php @@ -21,31 +21,37 @@ final class TaxRateDraftBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?float */ private $amount; /** + * @var ?bool */ private $includedInPrice; /** + * @var ?string */ private $country; /** + * @var ?string */ private $state; /** + * @var ?SubRateCollection */ private $subRates; @@ -53,6 +59,7 @@ final class TaxRateDraftBuilder implements Builder /** *

    Name of the TaxRate.

    * + * @return null|string */ public function getName() @@ -65,6 +72,7 @@ public function getName() * Must be supplied if no subRates are specified. * If subRates are specified, this field can be omitted or it must be the sum of amounts of all subRates.

    * + * @return null|float */ public function getAmount() @@ -73,8 +81,9 @@ public function getAmount() } /** - *

    If true, tax is included in Prices and the taxedPrice is present on LineItems. In this case, the totalNet price on TaxedPrice includes the TaxRate.

    + *

    If true, tax is included in Embedded Prices and the taxedPrice is present on LineItems. In this case, the totalNet price on TaxedPrice includes the TaxRate.

    * + * @return null|bool */ public function getIncludedInPrice() @@ -85,6 +94,7 @@ public function getIncludedInPrice() /** *

    Country in which the tax rate is applied in ISO 3166-1 alpha-2 format.

    * + * @return null|string */ public function getCountry() @@ -95,6 +105,7 @@ public function getCountry() /** *

    State within the country, such as Texas in the United States.

    * + * @return null|string */ public function getState() @@ -105,6 +116,7 @@ public function getState() /** *

    Used to calculate the taxPortions field in a Cart or Order. It is useful if the total tax of a country (such as the US) is a combination of multiple taxes (such as state and local taxes).

    * + * @return null|SubRateCollection */ public function getSubRates() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxRateDraftModel.php b/lib/commercetools-api/src/Models/TaxCategory/TaxRateDraftModel.php index 8345df8d0b6..d49405fcd78 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxRateDraftModel.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxRateDraftModel.php @@ -20,31 +20,37 @@ final class TaxRateDraftModel extends JsonObjectModel implements TaxRateDraft { /** + * * @var ?string */ protected $name; /** + * * @var ?float */ protected $amount; /** + * * @var ?bool */ protected $includedInPrice; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $state; /** + * * @var ?SubRateCollection */ protected $subRates; @@ -72,6 +78,7 @@ public function __construct( /** *

    Name of the TaxRate.

    * + * * @return null|string */ public function getName() @@ -93,6 +100,7 @@ public function getName() * Must be supplied if no subRates are specified. * If subRates are specified, this field can be omitted or it must be the sum of amounts of all subRates.

    * + * * @return null|float */ public function getAmount() @@ -110,7 +118,8 @@ public function getAmount() } /** - *

    If true, tax is included in Prices and the taxedPrice is present on LineItems. In this case, the totalNet price on TaxedPrice includes the TaxRate.

    + *

    If true, tax is included in Embedded Prices and the taxedPrice is present on LineItems. In this case, the totalNet price on TaxedPrice includes the TaxRate.

    + * * * @return null|bool */ @@ -131,6 +140,7 @@ public function getIncludedInPrice() /** *

    Country in which the tax rate is applied in ISO 3166-1 alpha-2 format.

    * + * * @return null|string */ public function getCountry() @@ -150,6 +160,7 @@ public function getCountry() /** *

    State within the country, such as Texas in the United States.

    * + * * @return null|string */ public function getState() @@ -169,6 +180,7 @@ public function getState() /** *

    Used to calculate the taxPortions field in a Cart or Order. It is useful if the total tax of a country (such as the US) is a combination of multiple taxes (such as state and local taxes).

    * + * * @return null|SubRateCollection */ public function getSubRates() diff --git a/lib/commercetools-api/src/Models/TaxCategory/TaxRateModel.php b/lib/commercetools-api/src/Models/TaxCategory/TaxRateModel.php index 4174ce1bb92..1a816ba4fe8 100644 --- a/lib/commercetools-api/src/Models/TaxCategory/TaxRateModel.php +++ b/lib/commercetools-api/src/Models/TaxCategory/TaxRateModel.php @@ -20,36 +20,43 @@ final class TaxRateModel extends JsonObjectModel implements TaxRate { /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $name; /** + * * @var ?float */ protected $amount; /** + * * @var ?bool */ protected $includedInPrice; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $state; /** + * * @var ?SubRateCollection */ protected $subRates; @@ -80,6 +87,7 @@ public function __construct( *

    Present if the TaxRate is part of a TaxCategory. * Absent for external TaxRates in LineItem, CustomLineItem, and ShippingInfo.

    * + * * @return null|string */ public function getId() @@ -99,6 +107,7 @@ public function getId() /** *

    Name of the TaxRate.

    * + * * @return null|string */ public function getName() @@ -118,6 +127,7 @@ public function getName() /** *

    Tax rate. If subrates are used, the amount must be the sum of all subrates.

    * + * * @return null|float */ public function getAmount() @@ -135,7 +145,8 @@ public function getAmount() } /** - *

    If true, tax is included in Prices and the taxedPrice is present on LineItems. In this case, the totalNet price on TaxedPrice includes the TaxRate.

    + *

    If true, tax is included in Embedded Prices and the taxedPrice is present on LineItems. In this case, the totalNet price on TaxedPrice includes the TaxRate.

    + * * * @return null|bool */ @@ -156,6 +167,7 @@ public function getIncludedInPrice() /** *

    Country in which the tax rate is applied in ISO 3166-1 alpha-2 format.

    * + * * @return null|string */ public function getCountry() @@ -175,6 +187,7 @@ public function getCountry() /** *

    State within the country, such as Texas in the United States.

    * + * * @return null|string */ public function getState() @@ -194,6 +207,7 @@ public function getState() /** *

    Used to calculate the taxPortions field in a Cart or Order. It is useful if the total tax of a country (such as the US) is a combination of multiple taxes (such as state and local taxes).

    * + * * @return null|SubRateCollection */ public function getSubRates() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldBooleanTypeModel.php b/lib/commercetools-api/src/Models/Type/CustomFieldBooleanTypeModel.php index 27762a7df3e..53ca81e2616 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldBooleanTypeModel.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldBooleanTypeModel.php @@ -21,6 +21,7 @@ final class CustomFieldBooleanTypeModel extends JsonObjectModel implements Custo { public const DISCRIMINATOR_VALUE = 'Boolean'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class CustomFieldBooleanTypeModel extends JsonObjectModel implements Custo * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldDateTimeTypeModel.php b/lib/commercetools-api/src/Models/Type/CustomFieldDateTimeTypeModel.php index 0a75729ba70..bbd70dbbc82 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldDateTimeTypeModel.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldDateTimeTypeModel.php @@ -21,6 +21,7 @@ final class CustomFieldDateTimeTypeModel extends JsonObjectModel implements Cust { public const DISCRIMINATOR_VALUE = 'DateTime'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class CustomFieldDateTimeTypeModel extends JsonObjectModel implements Cust * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldDateTypeModel.php b/lib/commercetools-api/src/Models/Type/CustomFieldDateTypeModel.php index 1ed9f3e4b9a..ce23913ff16 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldDateTypeModel.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldDateTypeModel.php @@ -21,6 +21,7 @@ final class CustomFieldDateTypeModel extends JsonObjectModel implements CustomFi { public const DISCRIMINATOR_VALUE = 'Date'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class CustomFieldDateTypeModel extends JsonObjectModel implements CustomFi * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldEnumType.php b/lib/commercetools-api/src/Models/Type/CustomFieldEnumType.php index 0f0ad92b8d6..ff2978ab66e 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldEnumType.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldEnumType.php @@ -18,6 +18,7 @@ interface CustomFieldEnumType extends FieldType /** *

    Allowed values.

    * + * @return null|CustomFieldEnumValueCollection */ public function getValues(); diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldEnumTypeBuilder.php b/lib/commercetools-api/src/Models/Type/CustomFieldEnumTypeBuilder.php index ca0030289c5..f408ee9b2ae 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldEnumTypeBuilder.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldEnumTypeBuilder.php @@ -21,6 +21,7 @@ final class CustomFieldEnumTypeBuilder implements Builder { /** + * @var ?CustomFieldEnumValueCollection */ private $values; @@ -28,6 +29,7 @@ final class CustomFieldEnumTypeBuilder implements Builder /** *

    Allowed values.

    * + * @return null|CustomFieldEnumValueCollection */ public function getValues() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldEnumTypeModel.php b/lib/commercetools-api/src/Models/Type/CustomFieldEnumTypeModel.php index 25832b98ab8..9a53b3040e7 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldEnumTypeModel.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldEnumTypeModel.php @@ -21,11 +21,13 @@ final class CustomFieldEnumTypeModel extends JsonObjectModel implements CustomFi { public const DISCRIMINATOR_VALUE = 'Enum'; /** + * * @var ?string */ protected $name; /** + * * @var ?CustomFieldEnumValueCollection */ protected $values; @@ -35,13 +37,15 @@ final class CustomFieldEnumTypeModel extends JsonObjectModel implements CustomFi * @psalm-suppress MissingParamType */ public function __construct( - ?CustomFieldEnumValueCollection $values = null + ?CustomFieldEnumValueCollection $values = null, + ?string $name = null ) { $this->values = $values; - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() @@ -61,6 +65,7 @@ public function getName() /** *

    Allowed values.

    * + * * @return null|CustomFieldEnumValueCollection */ public function getValues() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldEnumValue.php b/lib/commercetools-api/src/Models/Type/CustomFieldEnumValue.php index 6b3f283fbc7..1983f83ffa7 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldEnumValue.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldEnumValue.php @@ -19,6 +19,7 @@ interface CustomFieldEnumValue extends JsonObject /** *

    Key of the value used as a programmatic identifier.

    * + * @return null|string */ public function getKey(); @@ -26,6 +27,7 @@ public function getKey(); /** *

    Descriptive label of the value.

    * + * @return null|string */ public function getLabel(); diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldEnumValueBuilder.php b/lib/commercetools-api/src/Models/Type/CustomFieldEnumValueBuilder.php index 413f935b049..7d701c78aaf 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldEnumValueBuilder.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldEnumValueBuilder.php @@ -21,11 +21,13 @@ final class CustomFieldEnumValueBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $label; @@ -33,6 +35,7 @@ final class CustomFieldEnumValueBuilder implements Builder /** *

    Key of the value used as a programmatic identifier.

    * + * @return null|string */ public function getKey() @@ -43,6 +46,7 @@ public function getKey() /** *

    Descriptive label of the value.

    * + * @return null|string */ public function getLabel() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldEnumValueModel.php b/lib/commercetools-api/src/Models/Type/CustomFieldEnumValueModel.php index e82c277b670..6c1edacb688 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldEnumValueModel.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldEnumValueModel.php @@ -20,11 +20,13 @@ final class CustomFieldEnumValueModel extends JsonObjectModel implements CustomFieldEnumValue { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $label; @@ -44,6 +46,7 @@ public function __construct( /** *

    Key of the value used as a programmatic identifier.

    * + * * @return null|string */ public function getKey() @@ -63,6 +66,7 @@ public function getKey() /** *

    Descriptive label of the value.

    * + * * @return null|string */ public function getLabel() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumType.php b/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumType.php index a3985bf5e97..761cde646ab 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumType.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumType.php @@ -18,6 +18,7 @@ interface CustomFieldLocalizedEnumType extends FieldType /** *

    Allowed values.

    * + * @return null|CustomFieldLocalizedEnumValueCollection */ public function getValues(); diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumTypeBuilder.php b/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumTypeBuilder.php index a627352b8db..f6793ec1d57 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumTypeBuilder.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumTypeBuilder.php @@ -21,6 +21,7 @@ final class CustomFieldLocalizedEnumTypeBuilder implements Builder { /** + * @var ?CustomFieldLocalizedEnumValueCollection */ private $values; @@ -28,6 +29,7 @@ final class CustomFieldLocalizedEnumTypeBuilder implements Builder /** *

    Allowed values.

    * + * @return null|CustomFieldLocalizedEnumValueCollection */ public function getValues() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumTypeModel.php b/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumTypeModel.php index d502518872a..5b5769f750d 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumTypeModel.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumTypeModel.php @@ -21,11 +21,13 @@ final class CustomFieldLocalizedEnumTypeModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'LocalizedEnum'; /** + * * @var ?string */ protected $name; /** + * * @var ?CustomFieldLocalizedEnumValueCollection */ protected $values; @@ -35,13 +37,15 @@ final class CustomFieldLocalizedEnumTypeModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?CustomFieldLocalizedEnumValueCollection $values = null + ?CustomFieldLocalizedEnumValueCollection $values = null, + ?string $name = null ) { $this->values = $values; - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() @@ -61,6 +65,7 @@ public function getName() /** *

    Allowed values.

    * + * * @return null|CustomFieldLocalizedEnumValueCollection */ public function getValues() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumValue.php b/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumValue.php index cf309c82466..fedcfcc25c3 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumValue.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumValue.php @@ -20,6 +20,7 @@ interface CustomFieldLocalizedEnumValue extends JsonObject /** *

    Key of the value used as a programmatic identifier.

    * + * @return null|string */ public function getKey(); @@ -27,6 +28,7 @@ public function getKey(); /** *

    Descriptive localized label of the value.

    * + * @return null|LocalizedString */ public function getLabel(); diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumValueBuilder.php b/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumValueBuilder.php index d4ba9e90b18..c38d0ecbf04 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumValueBuilder.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumValueBuilder.php @@ -23,11 +23,13 @@ final class CustomFieldLocalizedEnumValueBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; @@ -35,6 +37,7 @@ final class CustomFieldLocalizedEnumValueBuilder implements Builder /** *

    Key of the value used as a programmatic identifier.

    * + * @return null|string */ public function getKey() @@ -45,6 +48,7 @@ public function getKey() /** *

    Descriptive localized label of the value.

    * + * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumValueModel.php b/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumValueModel.php index 75454f512a5..aa1ab6bb50e 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumValueModel.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedEnumValueModel.php @@ -22,11 +22,13 @@ final class CustomFieldLocalizedEnumValueModel extends JsonObjectModel implements CustomFieldLocalizedEnumValue { /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $label; @@ -46,6 +48,7 @@ public function __construct( /** *

    Key of the value used as a programmatic identifier.

    * + * * @return null|string */ public function getKey() @@ -65,6 +68,7 @@ public function getKey() /** *

    Descriptive localized label of the value.

    * + * * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedStringTypeModel.php b/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedStringTypeModel.php index a3b8370666b..82dfb2d0a05 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedStringTypeModel.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldLocalizedStringTypeModel.php @@ -21,6 +21,7 @@ final class CustomFieldLocalizedStringTypeModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'LocalizedString'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class CustomFieldLocalizedStringTypeModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldMoneyTypeModel.php b/lib/commercetools-api/src/Models/Type/CustomFieldMoneyTypeModel.php index b7f397d1b79..d3de097b155 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldMoneyTypeModel.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldMoneyTypeModel.php @@ -21,6 +21,7 @@ final class CustomFieldMoneyTypeModel extends JsonObjectModel implements CustomF { public const DISCRIMINATOR_VALUE = 'Money'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class CustomFieldMoneyTypeModel extends JsonObjectModel implements CustomF * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldNumberTypeModel.php b/lib/commercetools-api/src/Models/Type/CustomFieldNumberTypeModel.php index 2b014c1ee26..f652bea1f11 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldNumberTypeModel.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldNumberTypeModel.php @@ -21,6 +21,7 @@ final class CustomFieldNumberTypeModel extends JsonObjectModel implements Custom { public const DISCRIMINATOR_VALUE = 'Number'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class CustomFieldNumberTypeModel extends JsonObjectModel implements Custom * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldReferenceType.php b/lib/commercetools-api/src/Models/Type/CustomFieldReferenceType.php index 3c0214b5a3f..abe2e85305d 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldReferenceType.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldReferenceType.php @@ -18,6 +18,7 @@ interface CustomFieldReferenceType extends FieldType /** *

    Resource type the Custom Field can reference.

    * + * @return null|string */ public function getReferenceTypeId(); diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldReferenceTypeBuilder.php b/lib/commercetools-api/src/Models/Type/CustomFieldReferenceTypeBuilder.php index 738ca7d2021..211715408d5 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldReferenceTypeBuilder.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldReferenceTypeBuilder.php @@ -21,6 +21,7 @@ final class CustomFieldReferenceTypeBuilder implements Builder { /** + * @var ?string */ private $referenceTypeId; @@ -28,6 +29,7 @@ final class CustomFieldReferenceTypeBuilder implements Builder /** *

    Resource type the Custom Field can reference.

    * + * @return null|string */ public function getReferenceTypeId() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldReferenceTypeModel.php b/lib/commercetools-api/src/Models/Type/CustomFieldReferenceTypeModel.php index 34525a57f7d..baade1f749a 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldReferenceTypeModel.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldReferenceTypeModel.php @@ -21,11 +21,13 @@ final class CustomFieldReferenceTypeModel extends JsonObjectModel implements Cus { public const DISCRIMINATOR_VALUE = 'Reference'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $referenceTypeId; @@ -35,13 +37,15 @@ final class CustomFieldReferenceTypeModel extends JsonObjectModel implements Cus * @psalm-suppress MissingParamType */ public function __construct( - ?string $referenceTypeId = null + ?string $referenceTypeId = null, + ?string $name = null ) { $this->referenceTypeId = $referenceTypeId; - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() @@ -61,6 +65,7 @@ public function getName() /** *

    Resource type the Custom Field can reference.

    * + * * @return null|string */ public function getReferenceTypeId() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldSetType.php b/lib/commercetools-api/src/Models/Type/CustomFieldSetType.php index 5cc397a3ee8..ca8fece2dc7 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldSetType.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldSetType.php @@ -18,6 +18,7 @@ interface CustomFieldSetType extends FieldType /** *

    Field type of the elements in the set.

    * + * @return null|FieldType */ public function getElementType(); diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldSetTypeBuilder.php b/lib/commercetools-api/src/Models/Type/CustomFieldSetTypeBuilder.php index 1c87092d96b..2bc7c789ac4 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldSetTypeBuilder.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldSetTypeBuilder.php @@ -21,6 +21,7 @@ final class CustomFieldSetTypeBuilder implements Builder { /** + * @var null|FieldType|FieldTypeBuilder */ private $elementType; @@ -28,6 +29,7 @@ final class CustomFieldSetTypeBuilder implements Builder /** *

    Field type of the elements in the set.

    * + * @return null|FieldType */ public function getElementType() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldSetTypeModel.php b/lib/commercetools-api/src/Models/Type/CustomFieldSetTypeModel.php index fe30fbf80c0..37b640a3840 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldSetTypeModel.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldSetTypeModel.php @@ -21,11 +21,13 @@ final class CustomFieldSetTypeModel extends JsonObjectModel implements CustomFie { public const DISCRIMINATOR_VALUE = 'Set'; /** + * * @var ?string */ protected $name; /** + * * @var ?FieldType */ protected $elementType; @@ -35,13 +37,15 @@ final class CustomFieldSetTypeModel extends JsonObjectModel implements CustomFie * @psalm-suppress MissingParamType */ public function __construct( - ?FieldType $elementType = null + ?FieldType $elementType = null, + ?string $name = null ) { $this->elementType = $elementType; - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() @@ -61,6 +65,7 @@ public function getName() /** *

    Field type of the elements in the set.

    * + * * @return null|FieldType */ public function getElementType() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldStringTypeModel.php b/lib/commercetools-api/src/Models/Type/CustomFieldStringTypeModel.php index 9d884d53aca..a009ecb2355 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldStringTypeModel.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldStringTypeModel.php @@ -21,6 +21,7 @@ final class CustomFieldStringTypeModel extends JsonObjectModel implements Custom { public const DISCRIMINATOR_VALUE = 'String'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class CustomFieldStringTypeModel extends JsonObjectModel implements Custom * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldTimeTypeModel.php b/lib/commercetools-api/src/Models/Type/CustomFieldTimeTypeModel.php index c45a552cd79..ec1f3d7924d 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldTimeTypeModel.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldTimeTypeModel.php @@ -21,6 +21,7 @@ final class CustomFieldTimeTypeModel extends JsonObjectModel implements CustomFi { public const DISCRIMINATOR_VALUE = 'Time'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class CustomFieldTimeTypeModel extends JsonObjectModel implements CustomFi * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/Type/CustomFields.php b/lib/commercetools-api/src/Models/Type/CustomFields.php index 2ddb031981c..f04be776f24 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFields.php +++ b/lib/commercetools-api/src/Models/Type/CustomFields.php @@ -19,6 +19,7 @@ interface CustomFields extends JsonObject /** *

    Reference to the Type that holds the FieldDefinitions for the Custom Fields.

    * + * @return null|TypeReference */ public function getType(); @@ -26,6 +27,7 @@ public function getType(); /** *

    Object containing the Custom Fields for the customized resource or data type.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldsBuilder.php b/lib/commercetools-api/src/Models/Type/CustomFieldsBuilder.php index 512001435fc..8166d67a84e 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldsBuilder.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldsBuilder.php @@ -21,11 +21,13 @@ final class CustomFieldsBuilder implements Builder { /** + * @var null|TypeReference|TypeReferenceBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -33,6 +35,7 @@ final class CustomFieldsBuilder implements Builder /** *

    Reference to the Type that holds the FieldDefinitions for the Custom Fields.

    * + * @return null|TypeReference */ public function getType() @@ -43,6 +46,7 @@ public function getType() /** *

    Object containing the Custom Fields for the customized resource or data type.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldsDraft.php b/lib/commercetools-api/src/Models/Type/CustomFieldsDraft.php index 42acd442534..a81a9f611cd 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldsDraft.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldsDraft.php @@ -19,6 +19,7 @@ interface CustomFieldsDraft extends JsonObject /** *

    id or key of the Type.

    * + * @return null|TypeResourceIdentifier */ public function getType(); @@ -26,6 +27,7 @@ public function getType(); /** *

    Object containing the Custom Fields for the customized resource or data type.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldsDraftBuilder.php b/lib/commercetools-api/src/Models/Type/CustomFieldsDraftBuilder.php index acc1991d7bc..6cdf2657f40 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldsDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldsDraftBuilder.php @@ -21,11 +21,13 @@ final class CustomFieldsDraftBuilder implements Builder { /** + * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -33,6 +35,7 @@ final class CustomFieldsDraftBuilder implements Builder /** *

    id or key of the Type.

    * + * @return null|TypeResourceIdentifier */ public function getType() @@ -43,6 +46,7 @@ public function getType() /** *

    Object containing the Custom Fields for the customized resource or data type.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldsDraftModel.php b/lib/commercetools-api/src/Models/Type/CustomFieldsDraftModel.php index 58fc7e2a46b..6308aae4057 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldsDraftModel.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldsDraftModel.php @@ -20,11 +20,13 @@ final class CustomFieldsDraftModel extends JsonObjectModel implements CustomFieldsDraft { /** + * * @var ?TypeResourceIdentifier */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -44,6 +46,7 @@ public function __construct( /** *

    id or key of the Type.

    * + * * @return null|TypeResourceIdentifier */ public function getType() @@ -64,6 +67,7 @@ public function getType() /** *

    Object containing the Custom Fields for the customized resource or data type.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldsModel.php b/lib/commercetools-api/src/Models/Type/CustomFieldsModel.php index 9b28ef50ed3..1876c0c6819 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldsModel.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldsModel.php @@ -20,11 +20,13 @@ final class CustomFieldsModel extends JsonObjectModel implements CustomFields { /** + * * @var ?TypeReference */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -44,6 +46,7 @@ public function __construct( /** *

    Reference to the Type that holds the FieldDefinitions for the Custom Fields.

    * + * * @return null|TypeReference */ public function getType() @@ -64,6 +67,7 @@ public function getType() /** *

    Object containing the Custom Fields for the customized resource or data type.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-api/src/Models/Type/FieldDefinition.php b/lib/commercetools-api/src/Models/Type/FieldDefinition.php index cdc334de87b..6d62f938d0f 100644 --- a/lib/commercetools-api/src/Models/Type/FieldDefinition.php +++ b/lib/commercetools-api/src/Models/Type/FieldDefinition.php @@ -23,6 +23,7 @@ interface FieldDefinition extends JsonObject /** *

    Data type of the Custom Field to define.

    * + * @return null|FieldType */ public function getType(); @@ -32,6 +33,7 @@ public function getType(); * Must be unique for a given ResourceTypeId. * In case there is a FieldDefinition with the same name in another Type, both FieldDefinitions must have the same type.

    * + * @return null|string */ public function getName(); @@ -39,6 +41,7 @@ public function getName(); /** *

    A human-readable label for the field.

    * + * @return null|LocalizedString */ public function getLabel(); @@ -46,6 +49,7 @@ public function getLabel(); /** *

    Defines whether the field is required to have a value.

    * + * @return null|bool */ public function getRequired(); @@ -55,6 +59,7 @@ public function getRequired(); * Defines the visual representation of the field in user interfaces like the Merchant Center. * It is only relevant for string-based FieldTypes like CustomFieldStringType and CustomFieldLocalizedStringType.

    * + * @return null|string */ public function getInputHint(); diff --git a/lib/commercetools-api/src/Models/Type/FieldDefinitionBuilder.php b/lib/commercetools-api/src/Models/Type/FieldDefinitionBuilder.php index 61a43996190..09b50fc204c 100644 --- a/lib/commercetools-api/src/Models/Type/FieldDefinitionBuilder.php +++ b/lib/commercetools-api/src/Models/Type/FieldDefinitionBuilder.php @@ -23,26 +23,31 @@ final class FieldDefinitionBuilder implements Builder { /** + * @var null|FieldType|FieldTypeBuilder */ private $type; /** + * @var ?string */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; /** + * @var ?bool */ private $required; /** + * @var ?string */ private $inputHint; @@ -50,6 +55,7 @@ final class FieldDefinitionBuilder implements Builder /** *

    Data type of the Custom Field to define.

    * + * @return null|FieldType */ public function getType() @@ -62,6 +68,7 @@ public function getType() * Must be unique for a given ResourceTypeId. * In case there is a FieldDefinition with the same name in another Type, both FieldDefinitions must have the same type.

    * + * @return null|string */ public function getName() @@ -72,6 +79,7 @@ public function getName() /** *

    A human-readable label for the field.

    * + * @return null|LocalizedString */ public function getLabel() @@ -82,6 +90,7 @@ public function getLabel() /** *

    Defines whether the field is required to have a value.

    * + * @return null|bool */ public function getRequired() @@ -94,6 +103,7 @@ public function getRequired() * Defines the visual representation of the field in user interfaces like the Merchant Center. * It is only relevant for string-based FieldTypes like CustomFieldStringType and CustomFieldLocalizedStringType.

    * + * @return null|string */ public function getInputHint() diff --git a/lib/commercetools-api/src/Models/Type/FieldDefinitionModel.php b/lib/commercetools-api/src/Models/Type/FieldDefinitionModel.php index c0ac6b0c44a..44c4d159c1a 100644 --- a/lib/commercetools-api/src/Models/Type/FieldDefinitionModel.php +++ b/lib/commercetools-api/src/Models/Type/FieldDefinitionModel.php @@ -22,26 +22,31 @@ final class FieldDefinitionModel extends JsonObjectModel implements FieldDefinition { /** + * * @var ?FieldType */ protected $type; /** + * * @var ?string */ protected $name; /** + * * @var ?LocalizedString */ protected $label; /** + * * @var ?bool */ protected $required; /** + * * @var ?string */ protected $inputHint; @@ -67,6 +72,7 @@ public function __construct( /** *

    Data type of the Custom Field to define.

    * + * * @return null|FieldType */ public function getType() @@ -89,6 +95,7 @@ public function getType() * Must be unique for a given ResourceTypeId. * In case there is a FieldDefinition with the same name in another Type, both FieldDefinitions must have the same type.

    * + * * @return null|string */ public function getName() @@ -108,6 +115,7 @@ public function getName() /** *

    A human-readable label for the field.

    * + * * @return null|LocalizedString */ public function getLabel() @@ -128,6 +136,7 @@ public function getLabel() /** *

    Defines whether the field is required to have a value.

    * + * * @return null|bool */ public function getRequired() @@ -149,6 +158,7 @@ public function getRequired() * Defines the visual representation of the field in user interfaces like the Merchant Center. * It is only relevant for string-based FieldTypes like CustomFieldStringType and CustomFieldLocalizedStringType.

    * + * * @return null|string */ public function getInputHint() diff --git a/lib/commercetools-api/src/Models/Type/FieldType.php b/lib/commercetools-api/src/Models/Type/FieldType.php index ba533dedfce..8ecd30ee78a 100644 --- a/lib/commercetools-api/src/Models/Type/FieldType.php +++ b/lib/commercetools-api/src/Models/Type/FieldType.php @@ -17,6 +17,7 @@ interface FieldType extends JsonObject public const FIELD_NAME = 'name'; /** + * @return null|string */ public function getName(); diff --git a/lib/commercetools-api/src/Models/Type/FieldTypeModel.php b/lib/commercetools-api/src/Models/Type/FieldTypeModel.php index 7d2abb4e077..6006658d26e 100644 --- a/lib/commercetools-api/src/Models/Type/FieldTypeModel.php +++ b/lib/commercetools-api/src/Models/Type/FieldTypeModel.php @@ -21,6 +21,7 @@ final class FieldTypeModel extends JsonObjectModel implements FieldType { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $name; @@ -48,11 +49,13 @@ final class FieldTypeModel extends JsonObjectModel implements FieldType * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/Type/Type.php b/lib/commercetools-api/src/Models/Type/Type.php index 647ba64d72a..6edd237f0fb 100644 --- a/lib/commercetools-api/src/Models/Type/Type.php +++ b/lib/commercetools-api/src/Models/Type/Type.php @@ -29,6 +29,7 @@ interface Type extends BaseResource /** *

    Unique identifier of the Type.

    * + * @return null|string */ public function getId(); @@ -36,6 +37,7 @@ public function getId(); /** *

    Current version of the Type.

    * + * @return null|int */ public function getVersion(); @@ -43,6 +45,7 @@ public function getVersion(); /** *

    Date and time (UTC) the Type was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -50,6 +53,7 @@ public function getCreatedAt(); /** *

    Date and time (UTC) the Type was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -57,6 +61,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -64,6 +69,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -71,6 +77,7 @@ public function getCreatedBy(); /** *

    User-defined unique identifier of the Type.

    * + * @return null|string */ public function getKey(); @@ -78,6 +85,7 @@ public function getKey(); /** *

    Name of the Type.

    * + * @return null|LocalizedString */ public function getName(); @@ -85,6 +93,7 @@ public function getName(); /** *

    Description of the Type.

    * + * @return null|LocalizedString */ public function getDescription(); @@ -92,6 +101,7 @@ public function getDescription(); /** *

    Resources and/or data types for which the Type is defined.

    * + * @return null|array */ public function getResourceTypeIds(); @@ -99,6 +109,7 @@ public function getResourceTypeIds(); /** *

    Defines Custom Fields.

    * + * @return null|FieldDefinitionCollection */ public function getFieldDefinitions(); diff --git a/lib/commercetools-api/src/Models/Type/TypeAddEnumValueAction.php b/lib/commercetools-api/src/Models/Type/TypeAddEnumValueAction.php index e32b568e224..e40b7145dbc 100644 --- a/lib/commercetools-api/src/Models/Type/TypeAddEnumValueAction.php +++ b/lib/commercetools-api/src/Models/Type/TypeAddEnumValueAction.php @@ -19,6 +19,7 @@ interface TypeAddEnumValueAction extends TypeUpdateAction /** *

    name of the Field Definition to update.

    * + * @return null|string */ public function getFieldName(); @@ -26,6 +27,7 @@ public function getFieldName(); /** *

    Value to append to the array.

    * + * @return null|CustomFieldEnumValue */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Type/TypeAddEnumValueActionBuilder.php b/lib/commercetools-api/src/Models/Type/TypeAddEnumValueActionBuilder.php index 3f266879fd6..879e7191cf5 100644 --- a/lib/commercetools-api/src/Models/Type/TypeAddEnumValueActionBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeAddEnumValueActionBuilder.php @@ -21,11 +21,13 @@ final class TypeAddEnumValueActionBuilder implements Builder { /** + * @var ?string */ private $fieldName; /** + * @var null|CustomFieldEnumValue|CustomFieldEnumValueBuilder */ private $value; @@ -33,6 +35,7 @@ final class TypeAddEnumValueActionBuilder implements Builder /** *

    name of the Field Definition to update.

    * + * @return null|string */ public function getFieldName() @@ -43,6 +46,7 @@ public function getFieldName() /** *

    Value to append to the array.

    * + * @return null|CustomFieldEnumValue */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Type/TypeAddEnumValueActionModel.php b/lib/commercetools-api/src/Models/Type/TypeAddEnumValueActionModel.php index deb956ac740..c42b2d39cd4 100644 --- a/lib/commercetools-api/src/Models/Type/TypeAddEnumValueActionModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeAddEnumValueActionModel.php @@ -21,16 +21,19 @@ final class TypeAddEnumValueActionModel extends JsonObjectModel implements TypeA { public const DISCRIMINATOR_VALUE = 'addEnumValue'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $fieldName; /** + * * @var ?CustomFieldEnumValue */ protected $value; @@ -41,14 +44,16 @@ final class TypeAddEnumValueActionModel extends JsonObjectModel implements TypeA */ public function __construct( ?string $fieldName = null, - ?CustomFieldEnumValue $value = null + ?CustomFieldEnumValue $value = null, + ?string $action = null ) { $this->fieldName = $fieldName; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    name of the Field Definition to update.

    * + * * @return null|string */ public function getFieldName() @@ -87,6 +93,7 @@ public function getFieldName() /** *

    Value to append to the array.

    * + * * @return null|CustomFieldEnumValue */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Type/TypeAddFieldDefinitionAction.php b/lib/commercetools-api/src/Models/Type/TypeAddFieldDefinitionAction.php index f41e76b0400..2bfbf3540b6 100644 --- a/lib/commercetools-api/src/Models/Type/TypeAddFieldDefinitionAction.php +++ b/lib/commercetools-api/src/Models/Type/TypeAddFieldDefinitionAction.php @@ -18,6 +18,7 @@ interface TypeAddFieldDefinitionAction extends TypeUpdateAction /** *

    Value to append to the array.

    * + * @return null|FieldDefinition */ public function getFieldDefinition(); diff --git a/lib/commercetools-api/src/Models/Type/TypeAddFieldDefinitionActionBuilder.php b/lib/commercetools-api/src/Models/Type/TypeAddFieldDefinitionActionBuilder.php index 1e65bd3488e..b921c9c6040 100644 --- a/lib/commercetools-api/src/Models/Type/TypeAddFieldDefinitionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeAddFieldDefinitionActionBuilder.php @@ -21,6 +21,7 @@ final class TypeAddFieldDefinitionActionBuilder implements Builder { /** + * @var null|FieldDefinition|FieldDefinitionBuilder */ private $fieldDefinition; @@ -28,6 +29,7 @@ final class TypeAddFieldDefinitionActionBuilder implements Builder /** *

    Value to append to the array.

    * + * @return null|FieldDefinition */ public function getFieldDefinition() diff --git a/lib/commercetools-api/src/Models/Type/TypeAddFieldDefinitionActionModel.php b/lib/commercetools-api/src/Models/Type/TypeAddFieldDefinitionActionModel.php index ddb606f6ad7..529ca7ef599 100644 --- a/lib/commercetools-api/src/Models/Type/TypeAddFieldDefinitionActionModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeAddFieldDefinitionActionModel.php @@ -21,11 +21,13 @@ final class TypeAddFieldDefinitionActionModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'addFieldDefinition'; /** + * * @var ?string */ protected $action; /** + * * @var ?FieldDefinition */ protected $fieldDefinition; @@ -35,13 +37,15 @@ final class TypeAddFieldDefinitionActionModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?FieldDefinition $fieldDefinition = null + ?FieldDefinition $fieldDefinition = null, + ?string $action = null ) { $this->fieldDefinition = $fieldDefinition; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Value to append to the array.

    * + * * @return null|FieldDefinition */ public function getFieldDefinition() diff --git a/lib/commercetools-api/src/Models/Type/TypeAddLocalizedEnumValueAction.php b/lib/commercetools-api/src/Models/Type/TypeAddLocalizedEnumValueAction.php index 20a8fb3a801..ce2871d98e9 100644 --- a/lib/commercetools-api/src/Models/Type/TypeAddLocalizedEnumValueAction.php +++ b/lib/commercetools-api/src/Models/Type/TypeAddLocalizedEnumValueAction.php @@ -19,6 +19,7 @@ interface TypeAddLocalizedEnumValueAction extends TypeUpdateAction /** *

    name of the FieldDefinition to update.

    * + * @return null|string */ public function getFieldName(); @@ -26,6 +27,7 @@ public function getFieldName(); /** *

    Value to append to the array.

    * + * @return null|CustomFieldLocalizedEnumValue */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Type/TypeAddLocalizedEnumValueActionBuilder.php b/lib/commercetools-api/src/Models/Type/TypeAddLocalizedEnumValueActionBuilder.php index f33ee018f9a..af85d63ebcf 100644 --- a/lib/commercetools-api/src/Models/Type/TypeAddLocalizedEnumValueActionBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeAddLocalizedEnumValueActionBuilder.php @@ -21,11 +21,13 @@ final class TypeAddLocalizedEnumValueActionBuilder implements Builder { /** + * @var ?string */ private $fieldName; /** + * @var null|CustomFieldLocalizedEnumValue|CustomFieldLocalizedEnumValueBuilder */ private $value; @@ -33,6 +35,7 @@ final class TypeAddLocalizedEnumValueActionBuilder implements Builder /** *

    name of the FieldDefinition to update.

    * + * @return null|string */ public function getFieldName() @@ -43,6 +46,7 @@ public function getFieldName() /** *

    Value to append to the array.

    * + * @return null|CustomFieldLocalizedEnumValue */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Type/TypeAddLocalizedEnumValueActionModel.php b/lib/commercetools-api/src/Models/Type/TypeAddLocalizedEnumValueActionModel.php index ac521fd62dc..7aef80a8c88 100644 --- a/lib/commercetools-api/src/Models/Type/TypeAddLocalizedEnumValueActionModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeAddLocalizedEnumValueActionModel.php @@ -21,16 +21,19 @@ final class TypeAddLocalizedEnumValueActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'addLocalizedEnumValue'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $fieldName; /** + * * @var ?CustomFieldLocalizedEnumValue */ protected $value; @@ -41,14 +44,16 @@ final class TypeAddLocalizedEnumValueActionModel extends JsonObjectModel impleme */ public function __construct( ?string $fieldName = null, - ?CustomFieldLocalizedEnumValue $value = null + ?CustomFieldLocalizedEnumValue $value = null, + ?string $action = null ) { $this->fieldName = $fieldName; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    name of the FieldDefinition to update.

    * + * * @return null|string */ public function getFieldName() @@ -87,6 +93,7 @@ public function getFieldName() /** *

    Value to append to the array.

    * + * * @return null|CustomFieldLocalizedEnumValue */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Type/TypeBuilder.php b/lib/commercetools-api/src/Models/Type/TypeBuilder.php index f83d5ed2082..1596e92dabb 100644 --- a/lib/commercetools-api/src/Models/Type/TypeBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeBuilder.php @@ -30,56 +30,67 @@ final class TypeBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?array */ private $resourceTypeIds; /** + * @var ?FieldDefinitionCollection */ private $fieldDefinitions; @@ -87,6 +98,7 @@ final class TypeBuilder implements Builder /** *

    Unique identifier of the Type.

    * + * @return null|string */ public function getId() @@ -97,6 +109,7 @@ public function getId() /** *

    Current version of the Type.

    * + * @return null|int */ public function getVersion() @@ -107,6 +120,7 @@ public function getVersion() /** *

    Date and time (UTC) the Type was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -117,6 +131,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the Type was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -127,6 +142,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -137,6 +153,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -147,6 +164,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the Type.

    * + * @return null|string */ public function getKey() @@ -157,6 +175,7 @@ public function getKey() /** *

    Name of the Type.

    * + * @return null|LocalizedString */ public function getName() @@ -167,6 +186,7 @@ public function getName() /** *

    Description of the Type.

    * + * @return null|LocalizedString */ public function getDescription() @@ -177,6 +197,7 @@ public function getDescription() /** *

    Resources and/or data types for which the Type is defined.

    * + * @return null|array */ public function getResourceTypeIds() @@ -187,6 +208,7 @@ public function getResourceTypeIds() /** *

    Defines Custom Fields.

    * + * @return null|FieldDefinitionCollection */ public function getFieldDefinitions() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueLabelAction.php b/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueLabelAction.php index 4d984fd8153..53b61276b65 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueLabelAction.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueLabelAction.php @@ -19,6 +19,7 @@ interface TypeChangeEnumValueLabelAction extends TypeUpdateAction /** *

    name of the FieldDefinition to update.

    * + * @return null|string */ public function getFieldName(); @@ -27,6 +28,7 @@ public function getFieldName(); *

    New value to set. * Must not be empty.

    * + * @return null|CustomFieldEnumValue */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueLabelActionBuilder.php b/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueLabelActionBuilder.php index 364b268680d..af66a7f88c8 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueLabelActionBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueLabelActionBuilder.php @@ -21,11 +21,13 @@ final class TypeChangeEnumValueLabelActionBuilder implements Builder { /** + * @var ?string */ private $fieldName; /** + * @var null|CustomFieldEnumValue|CustomFieldEnumValueBuilder */ private $value; @@ -33,6 +35,7 @@ final class TypeChangeEnumValueLabelActionBuilder implements Builder /** *

    name of the FieldDefinition to update.

    * + * @return null|string */ public function getFieldName() @@ -44,6 +47,7 @@ public function getFieldName() *

    New value to set. * Must not be empty.

    * + * @return null|CustomFieldEnumValue */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueLabelActionModel.php b/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueLabelActionModel.php index 2aef93dd1cd..a8b1db9c418 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueLabelActionModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueLabelActionModel.php @@ -21,16 +21,19 @@ final class TypeChangeEnumValueLabelActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'changeEnumValueLabel'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $fieldName; /** + * * @var ?CustomFieldEnumValue */ protected $value; @@ -41,14 +44,16 @@ final class TypeChangeEnumValueLabelActionModel extends JsonObjectModel implemen */ public function __construct( ?string $fieldName = null, - ?CustomFieldEnumValue $value = null + ?CustomFieldEnumValue $value = null, + ?string $action = null ) { $this->fieldName = $fieldName; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    name of the FieldDefinition to update.

    * + * * @return null|string */ public function getFieldName() @@ -88,6 +94,7 @@ public function getFieldName() *

    New value to set. * Must not be empty.

    * + * * @return null|CustomFieldEnumValue */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueOrderAction.php b/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueOrderAction.php index 6e5dc7137d8..8a579a1e3f1 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueOrderAction.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueOrderAction.php @@ -19,6 +19,7 @@ interface TypeChangeEnumValueOrderAction extends TypeUpdateAction /** *

    name of the FieldDefinition to update.

    * + * @return null|string */ public function getFieldName(); @@ -26,6 +27,7 @@ public function getFieldName(); /** *

    Must match the set of keys of the EnumValues in the FieldDefinition (apart from their order).

    * + * @return null|array */ public function getKeys(); diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueOrderActionBuilder.php b/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueOrderActionBuilder.php index 5906656d644..8c3bd2dff1a 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueOrderActionBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueOrderActionBuilder.php @@ -21,11 +21,13 @@ final class TypeChangeEnumValueOrderActionBuilder implements Builder { /** + * @var ?string */ private $fieldName; /** + * @var ?array */ private $keys; @@ -33,6 +35,7 @@ final class TypeChangeEnumValueOrderActionBuilder implements Builder /** *

    name of the FieldDefinition to update.

    * + * @return null|string */ public function getFieldName() @@ -43,6 +46,7 @@ public function getFieldName() /** *

    Must match the set of keys of the EnumValues in the FieldDefinition (apart from their order).

    * + * @return null|array */ public function getKeys() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueOrderActionModel.php b/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueOrderActionModel.php index ac5e87fef13..426c62b41df 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueOrderActionModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeEnumValueOrderActionModel.php @@ -21,16 +21,19 @@ final class TypeChangeEnumValueOrderActionModel extends JsonObjectModel implemen { public const DISCRIMINATOR_VALUE = 'changeEnumValueOrder'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $fieldName; /** + * * @var ?array */ protected $keys; @@ -41,14 +44,16 @@ final class TypeChangeEnumValueOrderActionModel extends JsonObjectModel implemen */ public function __construct( ?string $fieldName = null, - ?array $keys = null + ?array $keys = null, + ?string $action = null ) { $this->fieldName = $fieldName; $this->keys = $keys; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    name of the FieldDefinition to update.

    * + * * @return null|string */ public function getFieldName() @@ -87,6 +93,7 @@ public function getFieldName() /** *

    Must match the set of keys of the EnumValues in the FieldDefinition (apart from their order).

    * + * * @return null|array */ public function getKeys() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeFieldDefinitionOrderAction.php b/lib/commercetools-api/src/Models/Type/TypeChangeFieldDefinitionOrderAction.php index 26335b204c0..c0aee9f9686 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeFieldDefinitionOrderAction.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeFieldDefinitionOrderAction.php @@ -18,6 +18,7 @@ interface TypeChangeFieldDefinitionOrderAction extends TypeUpdateAction /** *

    Must match the set of names of FieldDefinitions (up to order).

    * + * @return null|array */ public function getFieldNames(); diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeFieldDefinitionOrderActionBuilder.php b/lib/commercetools-api/src/Models/Type/TypeChangeFieldDefinitionOrderActionBuilder.php index ff1cfe6d6a1..04745f14b88 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeFieldDefinitionOrderActionBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeFieldDefinitionOrderActionBuilder.php @@ -21,6 +21,7 @@ final class TypeChangeFieldDefinitionOrderActionBuilder implements Builder { /** + * @var ?array */ private $fieldNames; @@ -28,6 +29,7 @@ final class TypeChangeFieldDefinitionOrderActionBuilder implements Builder /** *

    Must match the set of names of FieldDefinitions (up to order).

    * + * @return null|array */ public function getFieldNames() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeFieldDefinitionOrderActionModel.php b/lib/commercetools-api/src/Models/Type/TypeChangeFieldDefinitionOrderActionModel.php index bfde1844843..ed60ab2aa1c 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeFieldDefinitionOrderActionModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeFieldDefinitionOrderActionModel.php @@ -21,11 +21,13 @@ final class TypeChangeFieldDefinitionOrderActionModel extends JsonObjectModel im { public const DISCRIMINATOR_VALUE = 'changeFieldDefinitionOrder'; /** + * * @var ?string */ protected $action; /** + * * @var ?array */ protected $fieldNames; @@ -35,13 +37,15 @@ final class TypeChangeFieldDefinitionOrderActionModel extends JsonObjectModel im * @psalm-suppress MissingParamType */ public function __construct( - ?array $fieldNames = null + ?array $fieldNames = null, + ?string $action = null ) { $this->fieldNames = $fieldNames; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Must match the set of names of FieldDefinitions (up to order).

    * + * * @return null|array */ public function getFieldNames() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeInputHintAction.php b/lib/commercetools-api/src/Models/Type/TypeChangeInputHintAction.php index e28820aea66..e74c6550e5e 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeInputHintAction.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeInputHintAction.php @@ -19,6 +19,7 @@ interface TypeChangeInputHintAction extends TypeUpdateAction /** *

    name of the Field Definition to update.

    * + * @return null|string */ public function getFieldName(); @@ -27,6 +28,7 @@ public function getFieldName(); *

    New value to set. * Must not be empty.

    * + * @return null|string */ public function getInputHint(); diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeInputHintActionBuilder.php b/lib/commercetools-api/src/Models/Type/TypeChangeInputHintActionBuilder.php index 7b9cb9123b6..986b4899e59 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeInputHintActionBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeInputHintActionBuilder.php @@ -21,11 +21,13 @@ final class TypeChangeInputHintActionBuilder implements Builder { /** + * @var ?string */ private $fieldName; /** + * @var ?string */ private $inputHint; @@ -33,6 +35,7 @@ final class TypeChangeInputHintActionBuilder implements Builder /** *

    name of the Field Definition to update.

    * + * @return null|string */ public function getFieldName() @@ -44,6 +47,7 @@ public function getFieldName() *

    New value to set. * Must not be empty.

    * + * @return null|string */ public function getInputHint() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeInputHintActionModel.php b/lib/commercetools-api/src/Models/Type/TypeChangeInputHintActionModel.php index 2825c0ccc1e..c742238b5e4 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeInputHintActionModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeInputHintActionModel.php @@ -21,16 +21,19 @@ final class TypeChangeInputHintActionModel extends JsonObjectModel implements Ty { public const DISCRIMINATOR_VALUE = 'changeInputHint'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $fieldName; /** + * * @var ?string */ protected $inputHint; @@ -41,14 +44,16 @@ final class TypeChangeInputHintActionModel extends JsonObjectModel implements Ty */ public function __construct( ?string $fieldName = null, - ?string $inputHint = null + ?string $inputHint = null, + ?string $action = null ) { $this->fieldName = $fieldName; $this->inputHint = $inputHint; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    name of the Field Definition to update.

    * + * * @return null|string */ public function getFieldName() @@ -88,6 +94,7 @@ public function getFieldName() *

    New value to set. * Must not be empty.

    * + * * @return null|string */ public function getInputHint() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeKeyAction.php b/lib/commercetools-api/src/Models/Type/TypeChangeKeyAction.php index 7846b68af91..e90b675c69e 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeKeyAction.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeKeyAction.php @@ -19,6 +19,7 @@ interface TypeChangeKeyAction extends TypeUpdateAction *

    New value to set. * Must not be empty.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeKeyActionBuilder.php b/lib/commercetools-api/src/Models/Type/TypeChangeKeyActionBuilder.php index bd0b89897c3..79ebe8eaaa4 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeKeyActionBuilder.php @@ -21,6 +21,7 @@ final class TypeChangeKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; @@ -29,6 +30,7 @@ final class TypeChangeKeyActionBuilder implements Builder *

    New value to set. * Must not be empty.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeKeyActionModel.php b/lib/commercetools-api/src/Models/Type/TypeChangeKeyActionModel.php index 039a9b74936..db5180d5f21 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeKeyActionModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeKeyActionModel.php @@ -21,11 +21,13 @@ final class TypeChangeKeyActionModel extends JsonObjectModel implements TypeChan { public const DISCRIMINATOR_VALUE = 'changeKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class TypeChangeKeyActionModel extends JsonObjectModel implements TypeChan * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() *

    New value to set. * Must not be empty.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeLabelAction.php b/lib/commercetools-api/src/Models/Type/TypeChangeLabelAction.php index 7b7db38d8d5..5517f9b4fbd 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeLabelAction.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeLabelAction.php @@ -20,6 +20,7 @@ interface TypeChangeLabelAction extends TypeUpdateAction /** *

    Name of the Field Definition to update.

    * + * @return null|string */ public function getFieldName(); @@ -27,6 +28,7 @@ public function getFieldName(); /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getLabel(); diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeLabelActionBuilder.php b/lib/commercetools-api/src/Models/Type/TypeChangeLabelActionBuilder.php index 264721746dc..7e3675fac2f 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeLabelActionBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeLabelActionBuilder.php @@ -23,11 +23,13 @@ final class TypeChangeLabelActionBuilder implements Builder { /** + * @var ?string */ private $fieldName; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; @@ -35,6 +37,7 @@ final class TypeChangeLabelActionBuilder implements Builder /** *

    Name of the Field Definition to update.

    * + * @return null|string */ public function getFieldName() @@ -45,6 +48,7 @@ public function getFieldName() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeLabelActionModel.php b/lib/commercetools-api/src/Models/Type/TypeChangeLabelActionModel.php index 81b38a8c8e0..1792b9aea17 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeLabelActionModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeLabelActionModel.php @@ -23,16 +23,19 @@ final class TypeChangeLabelActionModel extends JsonObjectModel implements TypeCh { public const DISCRIMINATOR_VALUE = 'changeLabel'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $fieldName; /** + * * @var ?LocalizedString */ protected $label; @@ -43,14 +46,16 @@ final class TypeChangeLabelActionModel extends JsonObjectModel implements TypeCh */ public function __construct( ?string $fieldName = null, - ?LocalizedString $label = null + ?LocalizedString $label = null, + ?string $action = null ) { $this->fieldName = $fieldName; $this->label = $label; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -70,6 +75,7 @@ public function getAction() /** *

    Name of the Field Definition to update.

    * + * * @return null|string */ public function getFieldName() @@ -89,6 +95,7 @@ public function getFieldName() /** *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    * + * * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueLabelAction.php b/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueLabelAction.php index 4f5b4289ad1..32efe0bb53e 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueLabelAction.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueLabelAction.php @@ -19,6 +19,7 @@ interface TypeChangeLocalizedEnumValueLabelAction extends TypeUpdateAction /** *

    name of the FieldDefinition to update.

    * + * @return null|string */ public function getFieldName(); @@ -27,6 +28,7 @@ public function getFieldName(); *

    New value to set. * Must not be empty.

    * + * @return null|CustomFieldLocalizedEnumValue */ public function getValue(); diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueLabelActionBuilder.php b/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueLabelActionBuilder.php index aacfca9aec2..89eef542016 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueLabelActionBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueLabelActionBuilder.php @@ -21,11 +21,13 @@ final class TypeChangeLocalizedEnumValueLabelActionBuilder implements Builder { /** + * @var ?string */ private $fieldName; /** + * @var null|CustomFieldLocalizedEnumValue|CustomFieldLocalizedEnumValueBuilder */ private $value; @@ -33,6 +35,7 @@ final class TypeChangeLocalizedEnumValueLabelActionBuilder implements Builder /** *

    name of the FieldDefinition to update.

    * + * @return null|string */ public function getFieldName() @@ -44,6 +47,7 @@ public function getFieldName() *

    New value to set. * Must not be empty.

    * + * @return null|CustomFieldLocalizedEnumValue */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueLabelActionModel.php b/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueLabelActionModel.php index 31e04ccfb6d..0a767735ad1 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueLabelActionModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueLabelActionModel.php @@ -21,16 +21,19 @@ final class TypeChangeLocalizedEnumValueLabelActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'changeLocalizedEnumValueLabel'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $fieldName; /** + * * @var ?CustomFieldLocalizedEnumValue */ protected $value; @@ -41,14 +44,16 @@ final class TypeChangeLocalizedEnumValueLabelActionModel extends JsonObjectModel */ public function __construct( ?string $fieldName = null, - ?CustomFieldLocalizedEnumValue $value = null + ?CustomFieldLocalizedEnumValue $value = null, + ?string $action = null ) { $this->fieldName = $fieldName; $this->value = $value; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    name of the FieldDefinition to update.

    * + * * @return null|string */ public function getFieldName() @@ -88,6 +94,7 @@ public function getFieldName() *

    New value to set. * Must not be empty.

    * + * * @return null|CustomFieldLocalizedEnumValue */ public function getValue() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueOrderAction.php b/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueOrderAction.php index 6123faf1192..c30643659fe 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueOrderAction.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueOrderAction.php @@ -19,6 +19,7 @@ interface TypeChangeLocalizedEnumValueOrderAction extends TypeUpdateAction /** *

    name of the Field Definition to update.

    * + * @return null|string */ public function getFieldName(); @@ -26,6 +27,7 @@ public function getFieldName(); /** *

    Must match the set of keys of the LocalizedEnumValues in the FieldDefinition (up to order).

    * + * @return null|array */ public function getKeys(); diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueOrderActionBuilder.php b/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueOrderActionBuilder.php index 0fe8c3c4a47..421bc515965 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueOrderActionBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueOrderActionBuilder.php @@ -21,11 +21,13 @@ final class TypeChangeLocalizedEnumValueOrderActionBuilder implements Builder { /** + * @var ?string */ private $fieldName; /** + * @var ?array */ private $keys; @@ -33,6 +35,7 @@ final class TypeChangeLocalizedEnumValueOrderActionBuilder implements Builder /** *

    name of the Field Definition to update.

    * + * @return null|string */ public function getFieldName() @@ -43,6 +46,7 @@ public function getFieldName() /** *

    Must match the set of keys of the LocalizedEnumValues in the FieldDefinition (up to order).

    * + * @return null|array */ public function getKeys() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueOrderActionModel.php b/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueOrderActionModel.php index 7cf0fc7fffc..d5867faefe0 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueOrderActionModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeLocalizedEnumValueOrderActionModel.php @@ -21,16 +21,19 @@ final class TypeChangeLocalizedEnumValueOrderActionModel extends JsonObjectModel { public const DISCRIMINATOR_VALUE = 'changeLocalizedEnumValueOrder'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $fieldName; /** + * * @var ?array */ protected $keys; @@ -41,14 +44,16 @@ final class TypeChangeLocalizedEnumValueOrderActionModel extends JsonObjectModel */ public function __construct( ?string $fieldName = null, - ?array $keys = null + ?array $keys = null, + ?string $action = null ) { $this->fieldName = $fieldName; $this->keys = $keys; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -68,6 +73,7 @@ public function getAction() /** *

    name of the Field Definition to update.

    * + * * @return null|string */ public function getFieldName() @@ -87,6 +93,7 @@ public function getFieldName() /** *

    Must match the set of keys of the LocalizedEnumValues in the FieldDefinition (up to order).

    * + * * @return null|array */ public function getKeys() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeNameAction.php b/lib/commercetools-api/src/Models/Type/TypeChangeNameAction.php index 450ba0c8818..ca212499c6d 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeNameAction.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeNameAction.php @@ -20,6 +20,7 @@ interface TypeChangeNameAction extends TypeUpdateAction *

    New value to set. * Must not be empty.

    * + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeNameActionBuilder.php b/lib/commercetools-api/src/Models/Type/TypeChangeNameActionBuilder.php index 88ac1b1f6b8..af177c6b035 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeNameActionBuilder.php @@ -23,6 +23,7 @@ final class TypeChangeNameActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; @@ -31,6 +32,7 @@ final class TypeChangeNameActionBuilder implements Builder *

    New value to set. * Must not be empty.

    * + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Type/TypeChangeNameActionModel.php b/lib/commercetools-api/src/Models/Type/TypeChangeNameActionModel.php index aac9b3b4992..a90dbdd7ea1 100644 --- a/lib/commercetools-api/src/Models/Type/TypeChangeNameActionModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeChangeNameActionModel.php @@ -23,11 +23,13 @@ final class TypeChangeNameActionModel extends JsonObjectModel implements TypeCha { public const DISCRIMINATOR_VALUE = 'changeName'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $name; @@ -37,13 +39,15 @@ final class TypeChangeNameActionModel extends JsonObjectModel implements TypeCha * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -64,6 +68,7 @@ public function getAction() *

    New value to set. * Must not be empty.

    * + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-api/src/Models/Type/TypeDraft.php b/lib/commercetools-api/src/Models/Type/TypeDraft.php index 8bad3700d87..efc22e848c3 100644 --- a/lib/commercetools-api/src/Models/Type/TypeDraft.php +++ b/lib/commercetools-api/src/Models/Type/TypeDraft.php @@ -23,6 +23,7 @@ interface TypeDraft extends JsonObject /** *

    User-defined unique identifier for the Type.

    * + * @return null|string */ public function getKey(); @@ -30,6 +31,7 @@ public function getKey(); /** *

    Name of the Type.

    * + * @return null|LocalizedString */ public function getName(); @@ -37,6 +39,7 @@ public function getName(); /** *

    Description of the Type.

    * + * @return null|LocalizedString */ public function getDescription(); @@ -44,6 +47,7 @@ public function getDescription(); /** *

    Resources and/or data types for which the Type is defined.

    * + * @return null|array */ public function getResourceTypeIds(); @@ -51,6 +55,7 @@ public function getResourceTypeIds(); /** *

    Defines Custom Fields.

    * + * @return null|FieldDefinitionCollection */ public function getFieldDefinitions(); diff --git a/lib/commercetools-api/src/Models/Type/TypeDraftBuilder.php b/lib/commercetools-api/src/Models/Type/TypeDraftBuilder.php index 8d6a0780616..3c225bea7af 100644 --- a/lib/commercetools-api/src/Models/Type/TypeDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeDraftBuilder.php @@ -23,26 +23,31 @@ final class TypeDraftBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?array */ private $resourceTypeIds; /** + * @var ?FieldDefinitionCollection */ private $fieldDefinitions; @@ -50,6 +55,7 @@ final class TypeDraftBuilder implements Builder /** *

    User-defined unique identifier for the Type.

    * + * @return null|string */ public function getKey() @@ -60,6 +66,7 @@ public function getKey() /** *

    Name of the Type.

    * + * @return null|LocalizedString */ public function getName() @@ -70,6 +77,7 @@ public function getName() /** *

    Description of the Type.

    * + * @return null|LocalizedString */ public function getDescription() @@ -80,6 +88,7 @@ public function getDescription() /** *

    Resources and/or data types for which the Type is defined.

    * + * @return null|array */ public function getResourceTypeIds() @@ -90,6 +99,7 @@ public function getResourceTypeIds() /** *

    Defines Custom Fields.

    * + * @return null|FieldDefinitionCollection */ public function getFieldDefinitions() diff --git a/lib/commercetools-api/src/Models/Type/TypeDraftModel.php b/lib/commercetools-api/src/Models/Type/TypeDraftModel.php index 73454cbd376..0fdad1eed6d 100644 --- a/lib/commercetools-api/src/Models/Type/TypeDraftModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeDraftModel.php @@ -22,26 +22,31 @@ final class TypeDraftModel extends JsonObjectModel implements TypeDraft { /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?array */ protected $resourceTypeIds; /** + * * @var ?FieldDefinitionCollection */ protected $fieldDefinitions; @@ -67,6 +72,7 @@ public function __construct( /** *

    User-defined unique identifier for the Type.

    * + * * @return null|string */ public function getKey() @@ -86,6 +92,7 @@ public function getKey() /** *

    Name of the Type.

    * + * * @return null|LocalizedString */ public function getName() @@ -106,6 +113,7 @@ public function getName() /** *

    Description of the Type.

    * + * * @return null|LocalizedString */ public function getDescription() @@ -126,6 +134,7 @@ public function getDescription() /** *

    Resources and/or data types for which the Type is defined.

    * + * * @return null|array */ public function getResourceTypeIds() @@ -145,6 +154,7 @@ public function getResourceTypeIds() /** *

    Defines Custom Fields.

    * + * * @return null|FieldDefinitionCollection */ public function getFieldDefinitions() diff --git a/lib/commercetools-api/src/Models/Type/TypeModel.php b/lib/commercetools-api/src/Models/Type/TypeModel.php index b47240e9fc5..2805b84f7b0 100644 --- a/lib/commercetools-api/src/Models/Type/TypeModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeModel.php @@ -29,56 +29,67 @@ final class TypeModel extends JsonObjectModel implements Type { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?array */ protected $resourceTypeIds; /** + * * @var ?FieldDefinitionCollection */ protected $fieldDefinitions; @@ -116,6 +127,7 @@ public function __construct( /** *

    Unique identifier of the Type.

    * + * * @return null|string */ public function getId() @@ -135,6 +147,7 @@ public function getId() /** *

    Current version of the Type.

    * + * * @return null|int */ public function getVersion() @@ -154,6 +167,7 @@ public function getVersion() /** *

    Date and time (UTC) the Type was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -177,6 +191,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the Type was last updated.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -200,6 +215,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -220,6 +236,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -240,6 +257,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the Type.

    * + * * @return null|string */ public function getKey() @@ -259,6 +277,7 @@ public function getKey() /** *

    Name of the Type.

    * + * * @return null|LocalizedString */ public function getName() @@ -279,6 +298,7 @@ public function getName() /** *

    Description of the Type.

    * + * * @return null|LocalizedString */ public function getDescription() @@ -299,6 +319,7 @@ public function getDescription() /** *

    Resources and/or data types for which the Type is defined.

    * + * * @return null|array */ public function getResourceTypeIds() @@ -318,6 +339,7 @@ public function getResourceTypeIds() /** *

    Defines Custom Fields.

    * + * * @return null|FieldDefinitionCollection */ public function getFieldDefinitions() diff --git a/lib/commercetools-api/src/Models/Type/TypePagedQueryResponse.php b/lib/commercetools-api/src/Models/Type/TypePagedQueryResponse.php index 395662001a3..b70649e694b 100644 --- a/lib/commercetools-api/src/Models/Type/TypePagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Type/TypePagedQueryResponse.php @@ -22,6 +22,7 @@ interface TypePagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    Types matching the query.

    * + * @return null|TypeCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/Type/TypePagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Type/TypePagedQueryResponseBuilder.php index fe74125cecf..9e82bed7952 100644 --- a/lib/commercetools-api/src/Models/Type/TypePagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypePagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class TypePagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?TypeCollection */ private $results; @@ -48,6 +53,7 @@ final class TypePagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    Types matching the query.

    * + * @return null|TypeCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Type/TypePagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Type/TypePagedQueryResponseModel.php index c450b4d6af6..a2b5225eb35 100644 --- a/lib/commercetools-api/src/Models/Type/TypePagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Type/TypePagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class TypePagedQueryResponseModel extends JsonObjectModel implements TypePagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?TypeCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    Types matching the query.

    * + * * @return null|TypeCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Type/TypeReference.php b/lib/commercetools-api/src/Models/Type/TypeReference.php index 7f7a4bb7c3c..477dbd9fb13 100644 --- a/lib/commercetools-api/src/Models/Type/TypeReference.php +++ b/lib/commercetools-api/src/Models/Type/TypeReference.php @@ -19,6 +19,7 @@ interface TypeReference extends Reference /** *

    Unique identifier of the referenced Type.

    * + * @return null|string */ public function getId(); @@ -27,6 +28,7 @@ public function getId(); *

    Contains the representation of the expanded Type. * Only present in responses to requests with Reference Expansion for Types.

    * + * @return null|Type */ public function getObj(); diff --git a/lib/commercetools-api/src/Models/Type/TypeReferenceBuilder.php b/lib/commercetools-api/src/Models/Type/TypeReferenceBuilder.php index 2d572382f56..735eb856a19 100644 --- a/lib/commercetools-api/src/Models/Type/TypeReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeReferenceBuilder.php @@ -23,11 +23,13 @@ final class TypeReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|Type|TypeBuilder */ private $obj; @@ -35,6 +37,7 @@ final class TypeReferenceBuilder implements Builder /** *

    Unique identifier of the referenced Type.

    * + * @return null|string */ public function getId() @@ -46,6 +49,7 @@ public function getId() *

    Contains the representation of the expanded Type. * Only present in responses to requests with Reference Expansion for Types.

    * + * @return null|Type */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Type/TypeReferenceModel.php b/lib/commercetools-api/src/Models/Type/TypeReferenceModel.php index e4f25418626..75574beb8c6 100644 --- a/lib/commercetools-api/src/Models/Type/TypeReferenceModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeReferenceModel.php @@ -23,16 +23,19 @@ final class TypeReferenceModel extends JsonObjectModel implements TypeReference { public const DISCRIMINATOR_VALUE = 'type'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?Type */ protected $obj; @@ -43,16 +46,18 @@ final class TypeReferenceModel extends JsonObjectModel implements TypeReference */ public function __construct( ?string $id = null, - ?Type $obj = null + ?Type $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced Type.

    * + * * @return null|string */ public function getId() @@ -92,6 +98,7 @@ public function getId() *

    Contains the representation of the expanded Type. * Only present in responses to requests with Reference Expansion for Types.

    * + * * @return null|Type */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Type/TypeRemoveFieldDefinitionAction.php b/lib/commercetools-api/src/Models/Type/TypeRemoveFieldDefinitionAction.php index 1601f0cf507..aa281517780 100644 --- a/lib/commercetools-api/src/Models/Type/TypeRemoveFieldDefinitionAction.php +++ b/lib/commercetools-api/src/Models/Type/TypeRemoveFieldDefinitionAction.php @@ -19,6 +19,7 @@ interface TypeRemoveFieldDefinitionAction extends TypeUpdateAction *

    name of the FieldDefinition to remove. * The removal of a FieldDefinition deletes asynchronously all Custom Fields using the FieldDefinition as well.

    * + * @return null|string */ public function getFieldName(); diff --git a/lib/commercetools-api/src/Models/Type/TypeRemoveFieldDefinitionActionBuilder.php b/lib/commercetools-api/src/Models/Type/TypeRemoveFieldDefinitionActionBuilder.php index 5d67e4ad605..e0aa008248c 100644 --- a/lib/commercetools-api/src/Models/Type/TypeRemoveFieldDefinitionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeRemoveFieldDefinitionActionBuilder.php @@ -21,6 +21,7 @@ final class TypeRemoveFieldDefinitionActionBuilder implements Builder { /** + * @var ?string */ private $fieldName; @@ -29,6 +30,7 @@ final class TypeRemoveFieldDefinitionActionBuilder implements Builder *

    name of the FieldDefinition to remove. * The removal of a FieldDefinition deletes asynchronously all Custom Fields using the FieldDefinition as well.

    * + * @return null|string */ public function getFieldName() diff --git a/lib/commercetools-api/src/Models/Type/TypeRemoveFieldDefinitionActionModel.php b/lib/commercetools-api/src/Models/Type/TypeRemoveFieldDefinitionActionModel.php index 4a8f80bf6bb..3525f468c2e 100644 --- a/lib/commercetools-api/src/Models/Type/TypeRemoveFieldDefinitionActionModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeRemoveFieldDefinitionActionModel.php @@ -21,11 +21,13 @@ final class TypeRemoveFieldDefinitionActionModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'removeFieldDefinition'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $fieldName; @@ -35,13 +37,15 @@ final class TypeRemoveFieldDefinitionActionModel extends JsonObjectModel impleme * @psalm-suppress MissingParamType */ public function __construct( - ?string $fieldName = null + ?string $fieldName = null, + ?string $action = null ) { $this->fieldName = $fieldName; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -62,6 +66,7 @@ public function getAction() *

    name of the FieldDefinition to remove. * The removal of a FieldDefinition deletes asynchronously all Custom Fields using the FieldDefinition as well.

    * + * * @return null|string */ public function getFieldName() diff --git a/lib/commercetools-api/src/Models/Type/TypeResourceIdentifier.php b/lib/commercetools-api/src/Models/Type/TypeResourceIdentifier.php index 2e4696b1b3b..e2364aa3d26 100644 --- a/lib/commercetools-api/src/Models/Type/TypeResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/Type/TypeResourceIdentifier.php @@ -17,6 +17,7 @@ interface TypeResourceIdentifier extends ResourceIdentifier /** *

    Unique identifier of the referenced Type. Either id or key is required.

    * + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

    User-defined unique identifier of the referenced Type. Either id or key is required.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Type/TypeResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/Type/TypeResourceIdentifierBuilder.php index b0d5167e9a9..35fa6c9cf3c 100644 --- a/lib/commercetools-api/src/Models/Type/TypeResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class TypeResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class TypeResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced Type. Either id or key is required.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced Type. Either id or key is required.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Type/TypeResourceIdentifierModel.php b/lib/commercetools-api/src/Models/Type/TypeResourceIdentifierModel.php index eb2c34d0754..5e9159d72b8 100644 --- a/lib/commercetools-api/src/Models/Type/TypeResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class TypeResourceIdentifierModel extends JsonObjectModel implements TypeR { public const DISCRIMINATOR_VALUE = 'type'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class TypeResourceIdentifierModel extends JsonObjectModel implements TypeR */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced Type. Either id or key is required.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced Type. Either id or key is required.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Type/TypeSetDescriptionAction.php b/lib/commercetools-api/src/Models/Type/TypeSetDescriptionAction.php index 520cd151903..27568c89e51 100644 --- a/lib/commercetools-api/src/Models/Type/TypeSetDescriptionAction.php +++ b/lib/commercetools-api/src/Models/Type/TypeSetDescriptionAction.php @@ -19,6 +19,7 @@ interface TypeSetDescriptionAction extends TypeUpdateAction /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getDescription(); diff --git a/lib/commercetools-api/src/Models/Type/TypeSetDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/Type/TypeSetDescriptionActionBuilder.php index af93f0220cb..241769398f3 100644 --- a/lib/commercetools-api/src/Models/Type/TypeSetDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeSetDescriptionActionBuilder.php @@ -23,6 +23,7 @@ final class TypeSetDescriptionActionBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; @@ -30,6 +31,7 @@ final class TypeSetDescriptionActionBuilder implements Builder /** *

    Value to set. If empty, any existing value will be removed.

    * + * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/Type/TypeSetDescriptionActionModel.php b/lib/commercetools-api/src/Models/Type/TypeSetDescriptionActionModel.php index 6a037948ad2..9401207f126 100644 --- a/lib/commercetools-api/src/Models/Type/TypeSetDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeSetDescriptionActionModel.php @@ -23,11 +23,13 @@ final class TypeSetDescriptionActionModel extends JsonObjectModel implements Typ { public const DISCRIMINATOR_VALUE = 'setDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?LocalizedString */ protected $description; @@ -37,13 +39,15 @@ final class TypeSetDescriptionActionModel extends JsonObjectModel implements Typ * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $description = null + ?LocalizedString $description = null, + ?string $action = null ) { $this->description = $description; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -63,6 +67,7 @@ public function getAction() /** *

    Value to set. If empty, any existing value will be removed.

    * + * * @return null|LocalizedString */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/Type/TypeUpdate.php b/lib/commercetools-api/src/Models/Type/TypeUpdate.php index f12ee7b5835..753ce16a043 100644 --- a/lib/commercetools-api/src/Models/Type/TypeUpdate.php +++ b/lib/commercetools-api/src/Models/Type/TypeUpdate.php @@ -20,6 +20,7 @@ interface TypeUpdate extends JsonObject *

    Expected version of the type on which the changes should be applied. * If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion(); @@ -27,6 +28,7 @@ public function getVersion(); /** *

    Update actions to be performed on the Type.

    * + * @return null|TypeUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Type/TypeUpdateAction.php b/lib/commercetools-api/src/Models/Type/TypeUpdateAction.php index 238e7f4b8d5..8ef2a51dd79 100644 --- a/lib/commercetools-api/src/Models/Type/TypeUpdateAction.php +++ b/lib/commercetools-api/src/Models/Type/TypeUpdateAction.php @@ -17,6 +17,7 @@ interface TypeUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Type/TypeUpdateBuilder.php b/lib/commercetools-api/src/Models/Type/TypeUpdateBuilder.php index 7eb4834eb3e..ce0cd748a1f 100644 --- a/lib/commercetools-api/src/Models/Type/TypeUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Type/TypeUpdateBuilder.php @@ -21,11 +21,13 @@ final class TypeUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?TypeUpdateActionCollection */ private $actions; @@ -34,6 +36,7 @@ final class TypeUpdateBuilder implements Builder *

    Expected version of the type on which the changes should be applied. * If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion() @@ -44,6 +47,7 @@ public function getVersion() /** *

    Update actions to be performed on the Type.

    * + * @return null|TypeUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Type/TypeUpdateModel.php b/lib/commercetools-api/src/Models/Type/TypeUpdateModel.php index 89605eed640..8c191fa786e 100644 --- a/lib/commercetools-api/src/Models/Type/TypeUpdateModel.php +++ b/lib/commercetools-api/src/Models/Type/TypeUpdateModel.php @@ -20,11 +20,13 @@ final class TypeUpdateModel extends JsonObjectModel implements TypeUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?TypeUpdateActionCollection */ protected $actions; @@ -45,6 +47,7 @@ public function __construct( *

    Expected version of the type on which the changes should be applied. * If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * * @return null|int */ public function getVersion() @@ -64,6 +67,7 @@ public function getVersion() /** *

    Update actions to be performed on the Type.

    * + * * @return null|TypeUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Zone/Location.php b/lib/commercetools-api/src/Models/Zone/Location.php index cc4c79c07b2..a0525d10d88 100644 --- a/lib/commercetools-api/src/Models/Zone/Location.php +++ b/lib/commercetools-api/src/Models/Zone/Location.php @@ -19,6 +19,7 @@ interface Location extends JsonObject /** *

    Country code of the geographic location.

    * + * @return null|string */ public function getCountry(); @@ -26,6 +27,7 @@ public function getCountry(); /** *

    State within the country.

    * + * @return null|string */ public function getState(); diff --git a/lib/commercetools-api/src/Models/Zone/LocationBuilder.php b/lib/commercetools-api/src/Models/Zone/LocationBuilder.php index c2fe406aece..7dfa4a175b2 100644 --- a/lib/commercetools-api/src/Models/Zone/LocationBuilder.php +++ b/lib/commercetools-api/src/Models/Zone/LocationBuilder.php @@ -21,11 +21,13 @@ final class LocationBuilder implements Builder { /** + * @var ?string */ private $country; /** + * @var ?string */ private $state; @@ -33,6 +35,7 @@ final class LocationBuilder implements Builder /** *

    Country code of the geographic location.

    * + * @return null|string */ public function getCountry() @@ -43,6 +46,7 @@ public function getCountry() /** *

    State within the country.

    * + * @return null|string */ public function getState() diff --git a/lib/commercetools-api/src/Models/Zone/LocationModel.php b/lib/commercetools-api/src/Models/Zone/LocationModel.php index 2a513b29cb2..eaa75fea86b 100644 --- a/lib/commercetools-api/src/Models/Zone/LocationModel.php +++ b/lib/commercetools-api/src/Models/Zone/LocationModel.php @@ -20,11 +20,13 @@ final class LocationModel extends JsonObjectModel implements Location { /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $state; @@ -44,6 +46,7 @@ public function __construct( /** *

    Country code of the geographic location.

    * + * * @return null|string */ public function getCountry() @@ -63,6 +66,7 @@ public function getCountry() /** *

    State within the country.

    * + * * @return null|string */ public function getState() diff --git a/lib/commercetools-api/src/Models/Zone/Zone.php b/lib/commercetools-api/src/Models/Zone/Zone.php index c89f93ad195..09b4ce4cf78 100644 --- a/lib/commercetools-api/src/Models/Zone/Zone.php +++ b/lib/commercetools-api/src/Models/Zone/Zone.php @@ -27,6 +27,7 @@ interface Zone extends BaseResource /** *

    Unique identifier of the Zone.

    * + * @return null|string */ public function getId(); @@ -34,6 +35,7 @@ public function getId(); /** *

    Current version of the Zone.

    * + * @return null|int */ public function getVersion(); @@ -41,6 +43,7 @@ public function getVersion(); /** *

    Date and time (UTC) the Zone was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -48,6 +51,7 @@ public function getCreatedAt(); /** *

    Date and time (UTC) the Zone was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -55,6 +59,7 @@ public function getLastModifiedAt(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy(); @@ -62,6 +67,7 @@ public function getLastModifiedBy(); /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy(); @@ -69,6 +75,7 @@ public function getCreatedBy(); /** *

    User-defined unique identifier of the Zone.

    * + * @return null|string */ public function getKey(); @@ -76,6 +83,7 @@ public function getKey(); /** *

    Name of the Zone.

    * + * @return null|string */ public function getName(); @@ -83,6 +91,7 @@ public function getName(); /** *

    Description of the Zone.

    * + * @return null|string */ public function getDescription(); @@ -90,6 +99,7 @@ public function getDescription(); /** *

    List of locations that belong to the Zone.

    * + * @return null|LocationCollection */ public function getLocations(); diff --git a/lib/commercetools-api/src/Models/Zone/ZoneAddLocationAction.php b/lib/commercetools-api/src/Models/Zone/ZoneAddLocationAction.php index 4ac37bdced9..0e0d31bcb15 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneAddLocationAction.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneAddLocationAction.php @@ -18,6 +18,7 @@ interface ZoneAddLocationAction extends ZoneUpdateAction /** *

    Location to be added to the Zone.

    * + * @return null|Location */ public function getLocation(); diff --git a/lib/commercetools-api/src/Models/Zone/ZoneAddLocationActionBuilder.php b/lib/commercetools-api/src/Models/Zone/ZoneAddLocationActionBuilder.php index c912f31871d..796ebe0b453 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneAddLocationActionBuilder.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneAddLocationActionBuilder.php @@ -21,6 +21,7 @@ final class ZoneAddLocationActionBuilder implements Builder { /** + * @var null|Location|LocationBuilder */ private $location; @@ -28,6 +29,7 @@ final class ZoneAddLocationActionBuilder implements Builder /** *

    Location to be added to the Zone.

    * + * @return null|Location */ public function getLocation() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneAddLocationActionModel.php b/lib/commercetools-api/src/Models/Zone/ZoneAddLocationActionModel.php index dbed7b8cca6..381c0c483f3 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneAddLocationActionModel.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneAddLocationActionModel.php @@ -21,11 +21,13 @@ final class ZoneAddLocationActionModel extends JsonObjectModel implements ZoneAd { public const DISCRIMINATOR_VALUE = 'addLocation'; /** + * * @var ?string */ protected $action; /** + * * @var ?Location */ protected $location; @@ -35,13 +37,15 @@ final class ZoneAddLocationActionModel extends JsonObjectModel implements ZoneAd * @psalm-suppress MissingParamType */ public function __construct( - ?Location $location = null + ?Location $location = null, + ?string $action = null ) { $this->location = $location; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Location to be added to the Zone.

    * + * * @return null|Location */ public function getLocation() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneBuilder.php b/lib/commercetools-api/src/Models/Zone/ZoneBuilder.php index 44879a5397f..cee371d3967 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneBuilder.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneBuilder.php @@ -28,51 +28,61 @@ final class ZoneBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var null|LastModifiedBy|LastModifiedByBuilder */ private $lastModifiedBy; /** + * @var null|CreatedBy|CreatedByBuilder */ private $createdBy; /** + * @var ?string */ private $key; /** + * @var ?string */ private $name; /** + * @var ?string */ private $description; /** + * @var ?LocationCollection */ private $locations; @@ -80,6 +90,7 @@ final class ZoneBuilder implements Builder /** *

    Unique identifier of the Zone.

    * + * @return null|string */ public function getId() @@ -90,6 +101,7 @@ public function getId() /** *

    Current version of the Zone.

    * + * @return null|int */ public function getVersion() @@ -100,6 +112,7 @@ public function getVersion() /** *

    Date and time (UTC) the Zone was initially created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -110,6 +123,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the Zone was last updated.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -120,6 +134,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -130,6 +145,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * @return null|CreatedBy */ public function getCreatedBy() @@ -140,6 +156,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the Zone.

    * + * @return null|string */ public function getKey() @@ -150,6 +167,7 @@ public function getKey() /** *

    Name of the Zone.

    * + * @return null|string */ public function getName() @@ -160,6 +178,7 @@ public function getName() /** *

    Description of the Zone.

    * + * @return null|string */ public function getDescription() @@ -170,6 +189,7 @@ public function getDescription() /** *

    List of locations that belong to the Zone.

    * + * @return null|LocationCollection */ public function getLocations() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneChangeNameAction.php b/lib/commercetools-api/src/Models/Zone/ZoneChangeNameAction.php index cc11312be2d..c0e744c3010 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneChangeNameAction.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneChangeNameAction.php @@ -18,6 +18,7 @@ interface ZoneChangeNameAction extends ZoneUpdateAction /** *

    New name of the Zone.

    * + * @return null|string */ public function getName(); diff --git a/lib/commercetools-api/src/Models/Zone/ZoneChangeNameActionBuilder.php b/lib/commercetools-api/src/Models/Zone/ZoneChangeNameActionBuilder.php index ebb66358acc..4da04f4a440 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneChangeNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneChangeNameActionBuilder.php @@ -21,6 +21,7 @@ final class ZoneChangeNameActionBuilder implements Builder { /** + * @var ?string */ private $name; @@ -28,6 +29,7 @@ final class ZoneChangeNameActionBuilder implements Builder /** *

    New name of the Zone.

    * + * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneChangeNameActionModel.php b/lib/commercetools-api/src/Models/Zone/ZoneChangeNameActionModel.php index e9d3b72e6bf..4eb4d71dade 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneChangeNameActionModel.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneChangeNameActionModel.php @@ -21,11 +21,13 @@ final class ZoneChangeNameActionModel extends JsonObjectModel implements ZoneCha { public const DISCRIMINATOR_VALUE = 'changeName'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $name; @@ -35,13 +37,15 @@ final class ZoneChangeNameActionModel extends JsonObjectModel implements ZoneCha * @psalm-suppress MissingParamType */ public function __construct( - ?string $name = null + ?string $name = null, + ?string $action = null ) { $this->name = $name; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    New name of the Zone.

    * + * * @return null|string */ public function getName() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneDraft.php b/lib/commercetools-api/src/Models/Zone/ZoneDraft.php index 44d3462eea7..86d9abf034d 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneDraft.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneDraft.php @@ -21,6 +21,7 @@ interface ZoneDraft extends JsonObject /** *

    User-defined unique identifier for the Zone.

    * + * @return null|string */ public function getKey(); @@ -28,6 +29,7 @@ public function getKey(); /** *

    Name of the Zone.

    * + * @return null|string */ public function getName(); @@ -35,6 +37,7 @@ public function getName(); /** *

    Description of the Zone.

    * + * @return null|string */ public function getDescription(); @@ -42,6 +45,7 @@ public function getDescription(); /** *

    List of locations that belong to the Zone.

    * + * @return null|LocationCollection */ public function getLocations(); diff --git a/lib/commercetools-api/src/Models/Zone/ZoneDraftBuilder.php b/lib/commercetools-api/src/Models/Zone/ZoneDraftBuilder.php index f025d83e0a9..dc778ab0bd7 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneDraftBuilder.php @@ -21,21 +21,25 @@ final class ZoneDraftBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $name; /** + * @var ?string */ private $description; /** + * @var ?LocationCollection */ private $locations; @@ -43,6 +47,7 @@ final class ZoneDraftBuilder implements Builder /** *

    User-defined unique identifier for the Zone.

    * + * @return null|string */ public function getKey() @@ -53,6 +58,7 @@ public function getKey() /** *

    Name of the Zone.

    * + * @return null|string */ public function getName() @@ -63,6 +69,7 @@ public function getName() /** *

    Description of the Zone.

    * + * @return null|string */ public function getDescription() @@ -73,6 +80,7 @@ public function getDescription() /** *

    List of locations that belong to the Zone.

    * + * @return null|LocationCollection */ public function getLocations() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneDraftModel.php b/lib/commercetools-api/src/Models/Zone/ZoneDraftModel.php index 76721a8315b..dfac0cc718e 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneDraftModel.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneDraftModel.php @@ -20,21 +20,25 @@ final class ZoneDraftModel extends JsonObjectModel implements ZoneDraft { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $description; /** + * * @var ?LocationCollection */ protected $locations; @@ -58,6 +62,7 @@ public function __construct( /** *

    User-defined unique identifier for the Zone.

    * + * * @return null|string */ public function getKey() @@ -77,6 +82,7 @@ public function getKey() /** *

    Name of the Zone.

    * + * * @return null|string */ public function getName() @@ -96,6 +102,7 @@ public function getName() /** *

    Description of the Zone.

    * + * * @return null|string */ public function getDescription() @@ -115,6 +122,7 @@ public function getDescription() /** *

    List of locations that belong to the Zone.

    * + * * @return null|LocationCollection */ public function getLocations() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneModel.php b/lib/commercetools-api/src/Models/Zone/ZoneModel.php index e2527f1a442..225f668a3d5 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneModel.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneModel.php @@ -27,51 +27,61 @@ final class ZoneModel extends JsonObjectModel implements Zone { /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?LastModifiedBy */ protected $lastModifiedBy; /** + * * @var ?CreatedBy */ protected $createdBy; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $description; /** + * * @var ?LocationCollection */ protected $locations; @@ -107,6 +117,7 @@ public function __construct( /** *

    Unique identifier of the Zone.

    * + * * @return null|string */ public function getId() @@ -126,6 +137,7 @@ public function getId() /** *

    Current version of the Zone.

    * + * * @return null|int */ public function getVersion() @@ -145,6 +157,7 @@ public function getVersion() /** *

    Date and time (UTC) the Zone was initially created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -168,6 +181,7 @@ public function getCreatedAt() /** *

    Date and time (UTC) the Zone was last updated.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -191,6 +205,7 @@ public function getLastModifiedAt() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|LastModifiedBy */ public function getLastModifiedBy() @@ -211,6 +226,7 @@ public function getLastModifiedBy() /** *

    Present on resources created after 1 February 2019 except for events not tracked.

    * + * * @return null|CreatedBy */ public function getCreatedBy() @@ -231,6 +247,7 @@ public function getCreatedBy() /** *

    User-defined unique identifier of the Zone.

    * + * * @return null|string */ public function getKey() @@ -250,6 +267,7 @@ public function getKey() /** *

    Name of the Zone.

    * + * * @return null|string */ public function getName() @@ -269,6 +287,7 @@ public function getName() /** *

    Description of the Zone.

    * + * * @return null|string */ public function getDescription() @@ -288,6 +307,7 @@ public function getDescription() /** *

    List of locations that belong to the Zone.

    * + * * @return null|LocationCollection */ public function getLocations() diff --git a/lib/commercetools-api/src/Models/Zone/ZonePagedQueryResponse.php b/lib/commercetools-api/src/Models/Zone/ZonePagedQueryResponse.php index 73f766055d2..0575f6b2d2d 100644 --- a/lib/commercetools-api/src/Models/Zone/ZonePagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Zone/ZonePagedQueryResponse.php @@ -22,6 +22,7 @@ interface ZonePagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -47,6 +50,7 @@ public function getCount(); * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal(); @@ -54,6 +58,7 @@ public function getTotal(); /** *

    Zones matching the query.

    * + * @return null|ZoneCollection */ public function getResults(); diff --git a/lib/commercetools-api/src/Models/Zone/ZonePagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Zone/ZonePagedQueryResponseBuilder.php index f34c6b7edb9..5042e58fd1d 100644 --- a/lib/commercetools-api/src/Models/Zone/ZonePagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Zone/ZonePagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class ZonePagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?ZoneCollection */ private $results; @@ -48,6 +53,7 @@ final class ZonePagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -82,6 +90,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * @return null|int */ public function getTotal() @@ -92,6 +101,7 @@ public function getTotal() /** *

    Zones matching the query.

    * + * @return null|ZoneCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Zone/ZonePagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Zone/ZonePagedQueryResponseModel.php index 0f80619c5b6..37615b643fc 100644 --- a/lib/commercetools-api/src/Models/Zone/ZonePagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Zone/ZonePagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class ZonePagedQueryResponseModel extends JsonObjectModel implements ZonePagedQueryResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?ZoneCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -126,6 +134,7 @@ public function getCount() * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. * When the results are filtered with a Query Predicate, total is subject to a limit.

    * + * * @return null|int */ public function getTotal() @@ -145,6 +154,7 @@ public function getTotal() /** *

    Zones matching the query.

    * + * * @return null|ZoneCollection */ public function getResults() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneReference.php b/lib/commercetools-api/src/Models/Zone/ZoneReference.php index fd2e34ef599..ce2f0d109d6 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneReference.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneReference.php @@ -19,6 +19,7 @@ interface ZoneReference extends Reference /** *

    Contains the representation of the expanded Zone. Only present in responses to requests with Reference Expansion for Zones.

    * + * @return null|Zone */ public function getObj(); @@ -26,6 +27,7 @@ public function getObj(); /** *

    Unique identifier of the referenced Zone.

    * + * @return null|string */ public function getId(); diff --git a/lib/commercetools-api/src/Models/Zone/ZoneReferenceBuilder.php b/lib/commercetools-api/src/Models/Zone/ZoneReferenceBuilder.php index 48694780b88..3e95806d846 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneReferenceBuilder.php @@ -23,11 +23,13 @@ final class ZoneReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|Zone|ZoneBuilder */ private $obj; @@ -35,6 +37,7 @@ final class ZoneReferenceBuilder implements Builder /** *

    Unique identifier of the referenced Zone.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    Contains the representation of the expanded Zone. Only present in responses to requests with Reference Expansion for Zones.

    * + * @return null|Zone */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneReferenceModel.php b/lib/commercetools-api/src/Models/Zone/ZoneReferenceModel.php index 6e6ffdeeed2..c0662de534b 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneReferenceModel.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneReferenceModel.php @@ -23,16 +23,19 @@ final class ZoneReferenceModel extends JsonObjectModel implements ZoneReference { public const DISCRIMINATOR_VALUE = 'zone'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?Zone */ protected $obj; @@ -43,16 +46,18 @@ final class ZoneReferenceModel extends JsonObjectModel implements ZoneReference */ public function __construct( ?string $id = null, - ?Zone $obj = null + ?Zone $obj = null, + ?string $typeId = null ) { $this->id = $id; $this->obj = $obj; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced Zone.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    Contains the representation of the expanded Zone. Only present in responses to requests with Reference Expansion for Zones.

    * + * * @return null|Zone */ public function getObj() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneRemoveLocationAction.php b/lib/commercetools-api/src/Models/Zone/ZoneRemoveLocationAction.php index 5ef4d8627cb..8c02a041a69 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneRemoveLocationAction.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneRemoveLocationAction.php @@ -18,6 +18,7 @@ interface ZoneRemoveLocationAction extends ZoneUpdateAction /** *

    Location to be removed from the Zone.

    * + * @return null|Location */ public function getLocation(); diff --git a/lib/commercetools-api/src/Models/Zone/ZoneRemoveLocationActionBuilder.php b/lib/commercetools-api/src/Models/Zone/ZoneRemoveLocationActionBuilder.php index a64f524530f..e4284e2e137 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneRemoveLocationActionBuilder.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneRemoveLocationActionBuilder.php @@ -21,6 +21,7 @@ final class ZoneRemoveLocationActionBuilder implements Builder { /** + * @var null|Location|LocationBuilder */ private $location; @@ -28,6 +29,7 @@ final class ZoneRemoveLocationActionBuilder implements Builder /** *

    Location to be removed from the Zone.

    * + * @return null|Location */ public function getLocation() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneRemoveLocationActionModel.php b/lib/commercetools-api/src/Models/Zone/ZoneRemoveLocationActionModel.php index 82364630be8..5bda30846a5 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneRemoveLocationActionModel.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneRemoveLocationActionModel.php @@ -21,11 +21,13 @@ final class ZoneRemoveLocationActionModel extends JsonObjectModel implements Zon { public const DISCRIMINATOR_VALUE = 'removeLocation'; /** + * * @var ?string */ protected $action; /** + * * @var ?Location */ protected $location; @@ -35,13 +37,15 @@ final class ZoneRemoveLocationActionModel extends JsonObjectModel implements Zon * @psalm-suppress MissingParamType */ public function __construct( - ?Location $location = null + ?Location $location = null, + ?string $action = null ) { $this->location = $location; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Location to be removed from the Zone.

    * + * * @return null|Location */ public function getLocation() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneResourceIdentifier.php b/lib/commercetools-api/src/Models/Zone/ZoneResourceIdentifier.php index 714322201de..fd5fb54f62b 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneResourceIdentifier.php @@ -17,6 +17,7 @@ interface ZoneResourceIdentifier extends ResourceIdentifier /** *

    Unique identifier of the referenced Zone. Either id or key is required.

    * + * @return null|string */ public function getId(); @@ -24,6 +25,7 @@ public function getId(); /** *

    User-defined unique identifier of the referenced Zone. Either id or key is required.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Zone/ZoneResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/Zone/ZoneResourceIdentifierBuilder.php index 78e6b691b9a..37ee3ff3b22 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneResourceIdentifierBuilder.php @@ -23,11 +23,13 @@ final class ZoneResourceIdentifierBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; @@ -35,6 +37,7 @@ final class ZoneResourceIdentifierBuilder implements Builder /** *

    Unique identifier of the referenced Zone. Either id or key is required.

    * + * @return null|string */ public function getId() @@ -45,6 +48,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced Zone. Either id or key is required.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneResourceIdentifierModel.php b/lib/commercetools-api/src/Models/Zone/ZoneResourceIdentifierModel.php index a1733bafb48..2ed2ad1c2dd 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneResourceIdentifierModel.php @@ -23,16 +23,19 @@ final class ZoneResourceIdentifierModel extends JsonObjectModel implements ZoneR { public const DISCRIMINATOR_VALUE = 'zone'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; @@ -43,16 +46,18 @@ final class ZoneResourceIdentifierModel extends JsonObjectModel implements ZoneR */ public function __construct( ?string $id = null, - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->id = $id; $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** *

    Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -72,6 +77,7 @@ public function getTypeId() /** *

    Unique identifier of the referenced Zone. Either id or key is required.

    * + * * @return null|string */ public function getId() @@ -91,6 +97,7 @@ public function getId() /** *

    User-defined unique identifier of the referenced Zone. Either id or key is required.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneSetDescriptionAction.php b/lib/commercetools-api/src/Models/Zone/ZoneSetDescriptionAction.php index a4d0cbe5c33..830ec0d4d20 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneSetDescriptionAction.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneSetDescriptionAction.php @@ -18,6 +18,7 @@ interface ZoneSetDescriptionAction extends ZoneUpdateAction /** *

    Description of the Zone.

    * + * @return null|string */ public function getDescription(); diff --git a/lib/commercetools-api/src/Models/Zone/ZoneSetDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/Zone/ZoneSetDescriptionActionBuilder.php index b1a5a2e623e..1c79dab3807 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneSetDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneSetDescriptionActionBuilder.php @@ -21,6 +21,7 @@ final class ZoneSetDescriptionActionBuilder implements Builder { /** + * @var ?string */ private $description; @@ -28,6 +29,7 @@ final class ZoneSetDescriptionActionBuilder implements Builder /** *

    Description of the Zone.

    * + * @return null|string */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneSetDescriptionActionModel.php b/lib/commercetools-api/src/Models/Zone/ZoneSetDescriptionActionModel.php index 324d03a21a7..fd0c47b057c 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneSetDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneSetDescriptionActionModel.php @@ -21,11 +21,13 @@ final class ZoneSetDescriptionActionModel extends JsonObjectModel implements Zon { public const DISCRIMINATOR_VALUE = 'setDescription'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $description; @@ -35,13 +37,15 @@ final class ZoneSetDescriptionActionModel extends JsonObjectModel implements Zon * @psalm-suppress MissingParamType */ public function __construct( - ?string $description = null + ?string $description = null, + ?string $action = null ) { $this->description = $description; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    Description of the Zone.

    * + * * @return null|string */ public function getDescription() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneSetKeyAction.php b/lib/commercetools-api/src/Models/Zone/ZoneSetKeyAction.php index 70a26d5de60..363b37250f4 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneSetKeyAction.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneSetKeyAction.php @@ -18,6 +18,7 @@ interface ZoneSetKeyAction extends ZoneUpdateAction /** *

    If key is absent or null, the existing key, if any, will be removed.

    * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-api/src/Models/Zone/ZoneSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/Zone/ZoneSetKeyActionBuilder.php index 19ae93d8c7b..650d29aa5e8 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneSetKeyActionBuilder.php @@ -21,6 +21,7 @@ final class ZoneSetKeyActionBuilder implements Builder { /** + * @var ?string */ private $key; @@ -28,6 +29,7 @@ final class ZoneSetKeyActionBuilder implements Builder /** *

    If key is absent or null, the existing key, if any, will be removed.

    * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneSetKeyActionModel.php b/lib/commercetools-api/src/Models/Zone/ZoneSetKeyActionModel.php index 7c10b568a75..2490081d0df 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneSetKeyActionModel.php @@ -21,11 +21,13 @@ final class ZoneSetKeyActionModel extends JsonObjectModel implements ZoneSetKeyA { public const DISCRIMINATOR_VALUE = 'setKey'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $key; @@ -35,13 +37,15 @@ final class ZoneSetKeyActionModel extends JsonObjectModel implements ZoneSetKeyA * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $action = null ) { $this->key = $key; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -61,6 +65,7 @@ public function getAction() /** *

    If key is absent or null, the existing key, if any, will be removed.

    * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneUpdate.php b/lib/commercetools-api/src/Models/Zone/ZoneUpdate.php index 89a81bf585b..d46557fbe68 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneUpdate.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneUpdate.php @@ -19,6 +19,7 @@ interface ZoneUpdate extends JsonObject /** *

    Expected version of the Zone on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion(); @@ -26,6 +27,7 @@ public function getVersion(); /** *

    Update actions to be performed on the Zone.

    * + * @return null|ZoneUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-api/src/Models/Zone/ZoneUpdateAction.php b/lib/commercetools-api/src/Models/Zone/ZoneUpdateAction.php index 4260784ba69..3e5d2dcdb53 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneUpdateAction.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneUpdateAction.php @@ -17,6 +17,7 @@ interface ZoneUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-api/src/Models/Zone/ZoneUpdateActionModel.php b/lib/commercetools-api/src/Models/Zone/ZoneUpdateActionModel.php index 54ec8b952f9..0b614156c6d 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneUpdateActionModel.php @@ -21,6 +21,7 @@ final class ZoneUpdateActionModel extends JsonObjectModel implements ZoneUpdateA { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -41,11 +42,13 @@ final class ZoneUpdateActionModel extends JsonObjectModel implements ZoneUpdateA * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneUpdateBuilder.php b/lib/commercetools-api/src/Models/Zone/ZoneUpdateBuilder.php index 2bb8300e27f..9a062e673f5 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneUpdateBuilder.php @@ -21,11 +21,13 @@ final class ZoneUpdateBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?ZoneUpdateActionCollection */ private $actions; @@ -33,6 +35,7 @@ final class ZoneUpdateBuilder implements Builder /** *

    Expected version of the Zone on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * @return null|int */ public function getVersion() @@ -43,6 +46,7 @@ public function getVersion() /** *

    Update actions to be performed on the Zone.

    * + * @return null|ZoneUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-api/src/Models/Zone/ZoneUpdateModel.php b/lib/commercetools-api/src/Models/Zone/ZoneUpdateModel.php index 53afbcba02f..7c9b36015e7 100644 --- a/lib/commercetools-api/src/Models/Zone/ZoneUpdateModel.php +++ b/lib/commercetools-api/src/Models/Zone/ZoneUpdateModel.php @@ -20,11 +20,13 @@ final class ZoneUpdateModel extends JsonObjectModel implements ZoneUpdate { /** + * * @var ?int */ protected $version; /** + * * @var ?ZoneUpdateActionCollection */ protected $actions; @@ -44,6 +46,7 @@ public function __construct( /** *

    Expected version of the Zone on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.

    * + * * @return null|int */ public function getVersion() @@ -63,6 +66,7 @@ public function getVersion() /** *

    Update actions to be performed on the Zone.

    * + * * @return null|ZoneUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-history/src/Client/HistoryRequestBuilder.php b/lib/commercetools-history/src/Client/HistoryRequestBuilder.php index 8e79ff6d9dd..00f4c9d6723 100644 --- a/lib/commercetools-history/src/Client/HistoryRequestBuilder.php +++ b/lib/commercetools-history/src/Client/HistoryRequestBuilder.php @@ -13,6 +13,9 @@ use GuzzleHttp\ClientInterface; use Commercetools\Client\ApiResource; +/** + * + */ class HistoryRequestBuilder extends ApiResource { /** diff --git a/lib/commercetools-history/src/Client/Resource/ByProjectKeyByResourceTypeByIDGet.php b/lib/commercetools-history/src/Client/Resource/ByProjectKeyByResourceTypeByIDGet.php index 1d54a7d4e62..3ac287b4511 100644 --- a/lib/commercetools-history/src/Client/Resource/ByProjectKeyByResourceTypeByIDGet.php +++ b/lib/commercetools-history/src/Client/Resource/ByProjectKeyByResourceTypeByIDGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-history/src/Client/Resource/ByProjectKeyByResourceTypeGet.php b/lib/commercetools-history/src/Client/Resource/ByProjectKeyByResourceTypeGet.php index 7418fdb73fc..f0c290fa4f7 100644 --- a/lib/commercetools-history/src/Client/Resource/ByProjectKeyByResourceTypeGet.php +++ b/lib/commercetools-history/src/Client/Resource/ByProjectKeyByResourceTypeGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-history/src/Client/Resource/ByProjectKeyGet.php b/lib/commercetools-history/src/Client/Resource/ByProjectKeyGet.php index 75bb7cc9874..47e97666a12 100644 --- a/lib/commercetools-history/src/Client/Resource/ByProjectKeyGet.php +++ b/lib/commercetools-history/src/Client/Resource/ByProjectKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-history/src/Client/Resource/ResourceByProjectKey.php b/lib/commercetools-history/src/Client/Resource/ResourceByProjectKey.php index 65e44a7bc0a..f3717ab4353 100644 --- a/lib/commercetools-history/src/Client/Resource/ResourceByProjectKey.php +++ b/lib/commercetools-history/src/Client/Resource/ResourceByProjectKey.php @@ -38,7 +38,7 @@ public function withResourceTypeValue(string $resourceType = null): ResourceByPr /** * @psalm-param ?object|array|string $body - * @psalm-param array $headers + * @psalm-param array $headers */ public function get($body = null, array $headers = []): ByProjectKeyGet { diff --git a/lib/commercetools-history/src/Client/Resource/ResourceByProjectKeyByResourceType.php b/lib/commercetools-history/src/Client/Resource/ResourceByProjectKeyByResourceType.php index d6b87d4dc82..167bca38af1 100644 --- a/lib/commercetools-history/src/Client/Resource/ResourceByProjectKeyByResourceType.php +++ b/lib/commercetools-history/src/Client/Resource/ResourceByProjectKeyByResourceType.php @@ -38,7 +38,7 @@ public function withIDValue(string $ID = null): ResourceByProjectKeyByResourceTy /** * @psalm-param ?object|array|string $body - * @psalm-param array $headers + * @psalm-param array $headers */ public function get($body = null, array $headers = []): ByProjectKeyByResourceTypeGet { diff --git a/lib/commercetools-history/src/Client/Resource/ResourceByProjectKeyByResourceTypeByID.php b/lib/commercetools-history/src/Client/Resource/ResourceByProjectKeyByResourceTypeByID.php index db91de01705..82529b6949b 100644 --- a/lib/commercetools-history/src/Client/Resource/ResourceByProjectKeyByResourceTypeByID.php +++ b/lib/commercetools-history/src/Client/Resource/ResourceByProjectKeyByResourceTypeByID.php @@ -26,7 +26,7 @@ public function __construct(array $args = [], ClientInterface $client = null) { /** * @psalm-param ?object|array|string $body - * @psalm-param array $headers + * @psalm-param array $headers */ public function get($body = null, array $headers = []): ByProjectKeyByResourceTypeByIDGet { diff --git a/lib/commercetools-history/src/Models/Change/AddAddressChange.php b/lib/commercetools-history/src/Models/Change/AddAddressChange.php index 93d6664f11b..af15f246132 100644 --- a/lib/commercetools-history/src/Models/Change/AddAddressChange.php +++ b/lib/commercetools-history/src/Models/Change/AddAddressChange.php @@ -21,21 +21,25 @@ interface AddAddressChange extends Change /** *

    Update action for setAddress action.

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|Address */ public function getNextValue(); /** + * @return null|Address */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddAddressChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddAddressChangeBuilder.php index 788883d9594..0d621fc4402 100644 --- a/lib/commercetools-history/src/Models/Change/AddAddressChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddAddressChangeBuilder.php @@ -23,16 +23,19 @@ final class AddAddressChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Address|AddressBuilder */ private $nextValue; /** + * @var null|Address|AddressBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class AddAddressChangeBuilder implements Builder /** *

    Update action for setAddress action.

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Address */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/AddAddressChangeModel.php b/lib/commercetools-history/src/Models/Change/AddAddressChangeModel.php index 189581faad9..febfa7ef2c5 100644 --- a/lib/commercetools-history/src/Models/Change/AddAddressChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddAddressChangeModel.php @@ -24,21 +24,25 @@ final class AddAddressChangeModel extends JsonObjectModel implements AddAddressC public const DISCRIMINATOR_VALUE = 'AddAddressChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Address */ protected $nextValue; /** + * * @var ?Address */ protected $previousValue; @@ -50,15 +54,17 @@ final class AddAddressChangeModel extends JsonObjectModel implements AddAddressC public function __construct( ?string $change = null, ?Address $nextValue = null, - ?Address $previousValue = null + ?Address $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for setAddress action.

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Address */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/AddAssetChange.php b/lib/commercetools-history/src/Models/Change/AddAssetChange.php index 59584589b4c..d523dd802dc 100644 --- a/lib/commercetools-history/src/Models/Change/AddAssetChange.php +++ b/lib/commercetools-history/src/Models/Change/AddAssetChange.php @@ -21,21 +21,25 @@ interface AddAssetChange extends Change /** *

    Update action for addAsset

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|Asset */ public function getNextValue(); /** + * @return null|Asset */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddAssetChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddAssetChangeBuilder.php index 6cc62f45ee0..415879979a1 100644 --- a/lib/commercetools-history/src/Models/Change/AddAssetChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddAssetChangeBuilder.php @@ -23,16 +23,19 @@ final class AddAssetChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Asset|AssetBuilder */ private $nextValue; /** + * @var null|Asset|AssetBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class AddAssetChangeBuilder implements Builder /** *

    Update action for addAsset

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Asset */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|Asset */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/AddAssetChangeModel.php b/lib/commercetools-history/src/Models/Change/AddAssetChangeModel.php index a7dcaea9d78..46848d3c16c 100644 --- a/lib/commercetools-history/src/Models/Change/AddAssetChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddAssetChangeModel.php @@ -24,21 +24,25 @@ final class AddAssetChangeModel extends JsonObjectModel implements AddAssetChang public const DISCRIMINATOR_VALUE = 'AddAssetChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Asset */ protected $nextValue; /** + * * @var ?Asset */ protected $previousValue; @@ -50,15 +54,17 @@ final class AddAssetChangeModel extends JsonObjectModel implements AddAssetChang public function __construct( ?string $change = null, ?Asset $nextValue = null, - ?Asset $previousValue = null + ?Asset $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for addAsset

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Asset */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|Asset */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/AddAttributeDefinitionChange.php b/lib/commercetools-history/src/Models/Change/AddAttributeDefinitionChange.php index 48bf76d1b36..0a0e9317aef 100644 --- a/lib/commercetools-history/src/Models/Change/AddAttributeDefinitionChange.php +++ b/lib/commercetools-history/src/Models/Change/AddAttributeDefinitionChange.php @@ -18,6 +18,7 @@ interface AddAttributeDefinitionChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,11 +26,13 @@ public function getType(); /** *

    Update action for addAttributeDefinition on product types

    * + * @return null|string */ public function getChange(); /** + * @return null|AttributeDefinition */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddAttributeDefinitionChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddAttributeDefinitionChangeBuilder.php index 45f1f068505..ee6d4f06327 100644 --- a/lib/commercetools-history/src/Models/Change/AddAttributeDefinitionChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddAttributeDefinitionChangeBuilder.php @@ -23,11 +23,13 @@ final class AddAttributeDefinitionChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|AttributeDefinition|AttributeDefinitionBuilder */ private $nextValue; @@ -35,6 +37,7 @@ final class AddAttributeDefinitionChangeBuilder implements Builder /** *

    Update action for addAttributeDefinition on product types

    * + * @return null|string */ public function getChange() @@ -43,6 +46,7 @@ public function getChange() } /** + * @return null|AttributeDefinition */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddAttributeDefinitionChangeModel.php b/lib/commercetools-history/src/Models/Change/AddAttributeDefinitionChangeModel.php index 4ac67e34b8a..54ff6e0b16f 100644 --- a/lib/commercetools-history/src/Models/Change/AddAttributeDefinitionChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddAttributeDefinitionChangeModel.php @@ -24,16 +24,19 @@ final class AddAttributeDefinitionChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'AddAttributeDefinitionChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?AttributeDefinition */ protected $nextValue; @@ -44,14 +47,16 @@ final class AddAttributeDefinitionChangeModel extends JsonObjectModel implements */ public function __construct( ?string $change = null, - ?AttributeDefinition $nextValue = null + ?AttributeDefinition $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -71,6 +76,7 @@ public function getType() /** *

    Update action for addAttributeDefinition on product types

    * + * * @return null|string */ public function getChange() @@ -88,6 +94,7 @@ public function getChange() } /** + * * @return null|AttributeDefinition */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddBillingAddressIdChange.php b/lib/commercetools-history/src/Models/Change/AddBillingAddressIdChange.php index dcc8d4b78f7..f3e64eb343c 100644 --- a/lib/commercetools-history/src/Models/Change/AddBillingAddressIdChange.php +++ b/lib/commercetools-history/src/Models/Change/AddBillingAddressIdChange.php @@ -22,26 +22,31 @@ interface AddBillingAddressIdChange extends Change /** *

    Update action for addBillingAddressId action on customers.

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|array */ public function getNextValue(); /** + * @return null|array */ public function getPreviousValue(); /** + * @return null|Address */ public function getAddress(); diff --git a/lib/commercetools-history/src/Models/Change/AddBillingAddressIdChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddBillingAddressIdChangeBuilder.php index 1b3fd2941bc..5ca7944a696 100644 --- a/lib/commercetools-history/src/Models/Change/AddBillingAddressIdChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddBillingAddressIdChangeBuilder.php @@ -23,21 +23,25 @@ final class AddBillingAddressIdChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?array */ private $nextValue; /** + * @var ?array */ private $previousValue; /** + * @var null|Address|AddressBuilder */ private $address; @@ -45,6 +49,7 @@ final class AddBillingAddressIdChangeBuilder implements Builder /** *

    Update action for addBillingAddressId action on customers.

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|array */ public function getNextValue() @@ -61,6 +67,7 @@ public function getNextValue() } /** + * @return null|array */ public function getPreviousValue() @@ -69,6 +76,7 @@ public function getPreviousValue() } /** + * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-history/src/Models/Change/AddBillingAddressIdChangeModel.php b/lib/commercetools-history/src/Models/Change/AddBillingAddressIdChangeModel.php index 1f7181d9aed..c3b78082560 100644 --- a/lib/commercetools-history/src/Models/Change/AddBillingAddressIdChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddBillingAddressIdChangeModel.php @@ -24,26 +24,31 @@ final class AddBillingAddressIdChangeModel extends JsonObjectModel implements Ad public const DISCRIMINATOR_VALUE = 'AddBillingAddressIdChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?array */ protected $nextValue; /** + * * @var ?array */ protected $previousValue; /** + * * @var ?Address */ protected $address; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?array $nextValue = null, ?array $previousValue = null, - ?Address $address = null + ?Address $address = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; $this->address = $address; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for addBillingAddressId action on customers.

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|array */ public function getNextValue() @@ -119,6 +128,7 @@ public function getNextValue() } /** + * * @return null|array */ public function getPreviousValue() @@ -136,6 +146,7 @@ public function getPreviousValue() } /** + * * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-history/src/Models/Change/AddChannelRolesChange.php b/lib/commercetools-history/src/Models/Change/AddChannelRolesChange.php index 1f32ab4fb45..7b09187c35a 100644 --- a/lib/commercetools-history/src/Models/Change/AddChannelRolesChange.php +++ b/lib/commercetools-history/src/Models/Change/AddChannelRolesChange.php @@ -18,21 +18,25 @@ interface AddChannelRolesChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|array */ public function getPreviousValue(); /** + * @return null|array */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddChannelRolesChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddChannelRolesChangeBuilder.php index 24dbbc9fb15..7b7c0f5c541 100644 --- a/lib/commercetools-history/src/Models/Change/AddChannelRolesChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddChannelRolesChangeBuilder.php @@ -21,21 +21,25 @@ final class AddChannelRolesChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?array */ private $previousValue; /** + * @var ?array */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -44,6 +48,7 @@ public function getChange() } /** + * @return null|array */ public function getPreviousValue() @@ -52,6 +57,7 @@ public function getPreviousValue() } /** + * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddChannelRolesChangeModel.php b/lib/commercetools-history/src/Models/Change/AddChannelRolesChangeModel.php index 0eb873e2566..b6826d5a3da 100644 --- a/lib/commercetools-history/src/Models/Change/AddChannelRolesChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddChannelRolesChangeModel.php @@ -22,21 +22,25 @@ final class AddChannelRolesChangeModel extends JsonObjectModel implements AddCha public const DISCRIMINATOR_VALUE = 'AddChannelRolesChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?array */ protected $previousValue; /** + * * @var ?array */ protected $nextValue; @@ -48,15 +52,17 @@ final class AddChannelRolesChangeModel extends JsonObjectModel implements AddCha public function __construct( ?string $change = null, ?array $previousValue = null, - ?array $nextValue = null + ?array $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -74,6 +80,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -91,6 +98,7 @@ public function getChange() } /** + * * @return null|array */ public function getPreviousValue() @@ -108,6 +116,7 @@ public function getPreviousValue() } /** + * * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddCustomLineItemChange.php b/lib/commercetools-history/src/Models/Change/AddCustomLineItemChange.php index 380ed7c3308..c3cf3a54cc9 100644 --- a/lib/commercetools-history/src/Models/Change/AddCustomLineItemChange.php +++ b/lib/commercetools-history/src/Models/Change/AddCustomLineItemChange.php @@ -19,6 +19,7 @@ interface AddCustomLineItemChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for adding and removing custom line items

    * + * @return null|string */ public function getChange(); /** + * @return null|CustomLineItem */ public function getNextValue(); /** + * @return null|CustomLineItem */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddCustomLineItemChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddCustomLineItemChangeBuilder.php index 89f24b5f45d..17f403c7df6 100644 --- a/lib/commercetools-history/src/Models/Change/AddCustomLineItemChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddCustomLineItemChangeBuilder.php @@ -23,16 +23,19 @@ final class AddCustomLineItemChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|CustomLineItem|CustomLineItemBuilder */ private $nextValue; /** + * @var null|CustomLineItem|CustomLineItemBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class AddCustomLineItemChangeBuilder implements Builder /** *

    Update action for adding and removing custom line items

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|CustomLineItem */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|CustomLineItem */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/AddCustomLineItemChangeModel.php b/lib/commercetools-history/src/Models/Change/AddCustomLineItemChangeModel.php index d9e85098359..73ab2fe1bf4 100644 --- a/lib/commercetools-history/src/Models/Change/AddCustomLineItemChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddCustomLineItemChangeModel.php @@ -24,21 +24,25 @@ final class AddCustomLineItemChangeModel extends JsonObjectModel implements AddC public const DISCRIMINATOR_VALUE = 'AddCustomLineItemChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?CustomLineItem */ protected $nextValue; /** + * * @var ?CustomLineItem */ protected $previousValue; @@ -50,15 +54,17 @@ final class AddCustomLineItemChangeModel extends JsonObjectModel implements AddC public function __construct( ?string $change = null, ?CustomLineItem $nextValue = null, - ?CustomLineItem $previousValue = null + ?CustomLineItem $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for adding and removing custom line items

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|CustomLineItem */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|CustomLineItem */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/AddDeliveryChange.php b/lib/commercetools-history/src/Models/Change/AddDeliveryChange.php index b1f9258c6d4..bc8f14ffa80 100644 --- a/lib/commercetools-history/src/Models/Change/AddDeliveryChange.php +++ b/lib/commercetools-history/src/Models/Change/AddDeliveryChange.php @@ -19,6 +19,7 @@ interface AddDeliveryChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for addDelivery

    * + * @return null|string */ public function getChange(); /** + * @return null|DeliveryChangeValue */ public function getNextValue(); /** + * @return null|DeliveryChangeValue */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddDeliveryChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddDeliveryChangeBuilder.php index 2d7df0f2a68..033099f0509 100644 --- a/lib/commercetools-history/src/Models/Change/AddDeliveryChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddDeliveryChangeBuilder.php @@ -23,16 +23,19 @@ final class AddDeliveryChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|DeliveryChangeValue|DeliveryChangeValueBuilder */ private $nextValue; /** + * @var null|DeliveryChangeValue|DeliveryChangeValueBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class AddDeliveryChangeBuilder implements Builder /** *

    Update action for addDelivery

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|DeliveryChangeValue */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|DeliveryChangeValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/AddDeliveryChangeModel.php b/lib/commercetools-history/src/Models/Change/AddDeliveryChangeModel.php index f8a0f12d3e2..f40de54b187 100644 --- a/lib/commercetools-history/src/Models/Change/AddDeliveryChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddDeliveryChangeModel.php @@ -24,21 +24,25 @@ final class AddDeliveryChangeModel extends JsonObjectModel implements AddDeliver public const DISCRIMINATOR_VALUE = 'AddDeliveryChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?DeliveryChangeValue */ protected $nextValue; /** + * * @var ?DeliveryChangeValue */ protected $previousValue; @@ -50,15 +54,17 @@ final class AddDeliveryChangeModel extends JsonObjectModel implements AddDeliver public function __construct( ?string $change = null, ?DeliveryChangeValue $nextValue = null, - ?DeliveryChangeValue $previousValue = null + ?DeliveryChangeValue $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for addDelivery

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|DeliveryChangeValue */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|DeliveryChangeValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/AddDiscountCodeChange.php b/lib/commercetools-history/src/Models/Change/AddDiscountCodeChange.php index d579934c45d..7200f2b697e 100644 --- a/lib/commercetools-history/src/Models/Change/AddDiscountCodeChange.php +++ b/lib/commercetools-history/src/Models/Change/AddDiscountCodeChange.php @@ -18,6 +18,7 @@ interface AddDiscountCodeChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,11 +26,13 @@ public function getType(); /** *

    Update action for addDiscountCode

    * + * @return null|string */ public function getChange(); /** + * @return null|DiscountCodeInfo */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddDiscountCodeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddDiscountCodeChangeBuilder.php index df0ce8e6a5e..83e7e8d92e0 100644 --- a/lib/commercetools-history/src/Models/Change/AddDiscountCodeChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddDiscountCodeChangeBuilder.php @@ -23,11 +23,13 @@ final class AddDiscountCodeChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|DiscountCodeInfo|DiscountCodeInfoBuilder */ private $nextValue; @@ -35,6 +37,7 @@ final class AddDiscountCodeChangeBuilder implements Builder /** *

    Update action for addDiscountCode

    * + * @return null|string */ public function getChange() @@ -43,6 +46,7 @@ public function getChange() } /** + * @return null|DiscountCodeInfo */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddDiscountCodeChangeModel.php b/lib/commercetools-history/src/Models/Change/AddDiscountCodeChangeModel.php index 7ca574cc895..479973cbf9e 100644 --- a/lib/commercetools-history/src/Models/Change/AddDiscountCodeChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddDiscountCodeChangeModel.php @@ -24,16 +24,19 @@ final class AddDiscountCodeChangeModel extends JsonObjectModel implements AddDis public const DISCRIMINATOR_VALUE = 'AddDiscountCodeChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?DiscountCodeInfo */ protected $nextValue; @@ -44,14 +47,16 @@ final class AddDiscountCodeChangeModel extends JsonObjectModel implements AddDis */ public function __construct( ?string $change = null, - ?DiscountCodeInfo $nextValue = null + ?DiscountCodeInfo $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -71,6 +76,7 @@ public function getType() /** *

    Update action for addDiscountCode

    * + * * @return null|string */ public function getChange() @@ -88,6 +94,7 @@ public function getChange() } /** + * * @return null|DiscountCodeInfo */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddEnumValueChange.php b/lib/commercetools-history/src/Models/Change/AddEnumValueChange.php index d0c5f127d24..59a710bb97c 100644 --- a/lib/commercetools-history/src/Models/Change/AddEnumValueChange.php +++ b/lib/commercetools-history/src/Models/Change/AddEnumValueChange.php @@ -19,6 +19,7 @@ interface AddEnumValueChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,6 +27,7 @@ public function getType(); /** *

    Update action for addEnumValue on types

    * + * @return null|string */ public function getChange(); @@ -33,11 +35,13 @@ public function getChange(); /** *

    The name of the field/attribute definition updated.

    * + * @return null|string */ public function getFieldName(); /** + * @return null|EnumValue */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddEnumValueChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddEnumValueChangeBuilder.php index 350c3f86a64..0996f70017f 100644 --- a/lib/commercetools-history/src/Models/Change/AddEnumValueChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddEnumValueChangeBuilder.php @@ -23,16 +23,19 @@ final class AddEnumValueChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $fieldName; /** + * @var null|EnumValue|EnumValueBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class AddEnumValueChangeBuilder implements Builder /** *

    Update action for addEnumValue on types

    * + * @return null|string */ public function getChange() @@ -50,6 +54,7 @@ public function getChange() /** *

    The name of the field/attribute definition updated.

    * + * @return null|string */ public function getFieldName() @@ -58,6 +63,7 @@ public function getFieldName() } /** + * @return null|EnumValue */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddEnumValueChangeModel.php b/lib/commercetools-history/src/Models/Change/AddEnumValueChangeModel.php index 4f634549fa1..dd053f6d210 100644 --- a/lib/commercetools-history/src/Models/Change/AddEnumValueChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddEnumValueChangeModel.php @@ -24,21 +24,25 @@ final class AddEnumValueChangeModel extends JsonObjectModel implements AddEnumVa public const DISCRIMINATOR_VALUE = 'AddEnumValueChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $fieldName; /** + * * @var ?EnumValue */ protected $nextValue; @@ -50,15 +54,17 @@ final class AddEnumValueChangeModel extends JsonObjectModel implements AddEnumVa public function __construct( ?string $change = null, ?string $fieldName = null, - ?EnumValue $nextValue = null + ?EnumValue $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->fieldName = $fieldName; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for addEnumValue on types

    * + * * @return null|string */ public function getChange() @@ -97,6 +104,7 @@ public function getChange() /** *

    The name of the field/attribute definition updated.

    * + * * @return null|string */ public function getFieldName() @@ -114,6 +122,7 @@ public function getFieldName() } /** + * * @return null|EnumValue */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddExternalImageChange.php b/lib/commercetools-history/src/Models/Change/AddExternalImageChange.php index c638cc432c6..11481026824 100644 --- a/lib/commercetools-history/src/Models/Change/AddExternalImageChange.php +++ b/lib/commercetools-history/src/Models/Change/AddExternalImageChange.php @@ -20,6 +20,7 @@ interface AddExternalImageChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update actions for adding an external image

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|ImageCollection */ public function getPreviousValue(); /** + * @return null|ImageCollection */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddExternalImageChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddExternalImageChangeBuilder.php index 83f7d0dac2b..3d73ebc7e9b 100644 --- a/lib/commercetools-history/src/Models/Change/AddExternalImageChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddExternalImageChangeBuilder.php @@ -22,21 +22,25 @@ final class AddExternalImageChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var ?ImageCollection */ private $previousValue; /** + * @var ?ImageCollection */ private $nextValue; @@ -44,6 +48,7 @@ final class AddExternalImageChangeBuilder implements Builder /** *

    Update actions for adding an external image

    * + * @return null|string */ public function getChange() @@ -52,6 +57,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -60,6 +66,7 @@ public function getCatalogData() } /** + * @return null|ImageCollection */ public function getPreviousValue() @@ -68,6 +75,7 @@ public function getPreviousValue() } /** + * @return null|ImageCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddExternalImageChangeModel.php b/lib/commercetools-history/src/Models/Change/AddExternalImageChangeModel.php index 3a86f23c8bd..e712d18d6d4 100644 --- a/lib/commercetools-history/src/Models/Change/AddExternalImageChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddExternalImageChangeModel.php @@ -23,26 +23,31 @@ final class AddExternalImageChangeModel extends JsonObjectModel implements AddEx public const DISCRIMINATOR_VALUE = 'AddExternalImageChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?ImageCollection */ protected $previousValue; /** + * * @var ?ImageCollection */ protected $nextValue; @@ -55,16 +60,18 @@ public function __construct( ?string $change = null, ?string $catalogData = null, ?ImageCollection $previousValue = null, - ?ImageCollection $nextValue = null + ?ImageCollection $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -84,6 +91,7 @@ public function getType() /** *

    Update actions for adding an external image

    * + * * @return null|string */ public function getChange() @@ -101,6 +109,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -118,6 +127,7 @@ public function getCatalogData() } /** + * * @return null|ImageCollection */ public function getPreviousValue() @@ -135,6 +145,7 @@ public function getPreviousValue() } /** + * * @return null|ImageCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddFieldDefinitionChange.php b/lib/commercetools-history/src/Models/Change/AddFieldDefinitionChange.php index ce88faf4675..2c2f665f0bc 100644 --- a/lib/commercetools-history/src/Models/Change/AddFieldDefinitionChange.php +++ b/lib/commercetools-history/src/Models/Change/AddFieldDefinitionChange.php @@ -18,6 +18,7 @@ interface AddFieldDefinitionChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,11 +26,13 @@ public function getType(); /** *

    Update action for addFieldDefinition on payments

    * + * @return null|string */ public function getChange(); /** + * @return null|FieldDefinition */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddFieldDefinitionChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddFieldDefinitionChangeBuilder.php index 4547e826b55..06cd597b11b 100644 --- a/lib/commercetools-history/src/Models/Change/AddFieldDefinitionChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddFieldDefinitionChangeBuilder.php @@ -23,11 +23,13 @@ final class AddFieldDefinitionChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|FieldDefinition|FieldDefinitionBuilder */ private $nextValue; @@ -35,6 +37,7 @@ final class AddFieldDefinitionChangeBuilder implements Builder /** *

    Update action for addFieldDefinition on payments

    * + * @return null|string */ public function getChange() @@ -43,6 +46,7 @@ public function getChange() } /** + * @return null|FieldDefinition */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddFieldDefinitionChangeModel.php b/lib/commercetools-history/src/Models/Change/AddFieldDefinitionChangeModel.php index 8c18aa088c9..877ce8e8acf 100644 --- a/lib/commercetools-history/src/Models/Change/AddFieldDefinitionChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddFieldDefinitionChangeModel.php @@ -24,16 +24,19 @@ final class AddFieldDefinitionChangeModel extends JsonObjectModel implements Add public const DISCRIMINATOR_VALUE = 'AddFieldDefinitionChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?FieldDefinition */ protected $nextValue; @@ -44,14 +47,16 @@ final class AddFieldDefinitionChangeModel extends JsonObjectModel implements Add */ public function __construct( ?string $change = null, - ?FieldDefinition $nextValue = null + ?FieldDefinition $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -71,6 +76,7 @@ public function getType() /** *

    Update action for addFieldDefinition on payments

    * + * * @return null|string */ public function getChange() @@ -88,6 +94,7 @@ public function getChange() } /** + * * @return null|FieldDefinition */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddInterfaceInteractionChange.php b/lib/commercetools-history/src/Models/Change/AddInterfaceInteractionChange.php index a0b26fc0d51..2f017e7ceef 100644 --- a/lib/commercetools-history/src/Models/Change/AddInterfaceInteractionChange.php +++ b/lib/commercetools-history/src/Models/Change/AddInterfaceInteractionChange.php @@ -18,6 +18,7 @@ interface AddInterfaceInteractionChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,6 +26,7 @@ public function getType(); /** *

    Update action for addInterfaceInteraction on payments

    * + * @return null|string */ public function getChange(); @@ -32,6 +34,7 @@ public function getChange(); /** *

    Only available if expand is set to true

    * + * @return null|CustomFieldExpandedValue */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddInterfaceInteractionChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddInterfaceInteractionChangeBuilder.php index b2a64950dbd..e85c8bb95fb 100644 --- a/lib/commercetools-history/src/Models/Change/AddInterfaceInteractionChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddInterfaceInteractionChangeBuilder.php @@ -23,11 +23,13 @@ final class AddInterfaceInteractionChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|CustomFieldExpandedValue|CustomFieldExpandedValueBuilder */ private $nextValue; @@ -35,6 +37,7 @@ final class AddInterfaceInteractionChangeBuilder implements Builder /** *

    Update action for addInterfaceInteraction on payments

    * + * @return null|string */ public function getChange() @@ -45,6 +48,7 @@ public function getChange() /** *

    Only available if expand is set to true

    * + * @return null|CustomFieldExpandedValue */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddInterfaceInteractionChangeModel.php b/lib/commercetools-history/src/Models/Change/AddInterfaceInteractionChangeModel.php index f398f80ab45..2e55645cd3c 100644 --- a/lib/commercetools-history/src/Models/Change/AddInterfaceInteractionChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddInterfaceInteractionChangeModel.php @@ -24,16 +24,19 @@ final class AddInterfaceInteractionChangeModel extends JsonObjectModel implement public const DISCRIMINATOR_VALUE = 'AddInterfaceInteractionChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?CustomFieldExpandedValue */ protected $nextValue; @@ -44,14 +47,16 @@ final class AddInterfaceInteractionChangeModel extends JsonObjectModel implement */ public function __construct( ?string $change = null, - ?CustomFieldExpandedValue $nextValue = null + ?CustomFieldExpandedValue $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -71,6 +76,7 @@ public function getType() /** *

    Update action for addInterfaceInteraction on payments

    * + * * @return null|string */ public function getChange() @@ -90,6 +96,7 @@ public function getChange() /** *

    Only available if expand is set to true

    * + * * @return null|CustomFieldExpandedValue */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddItemShippingAddressesChange.php b/lib/commercetools-history/src/Models/Change/AddItemShippingAddressesChange.php index c2cdc648ef2..cbabdc97893 100644 --- a/lib/commercetools-history/src/Models/Change/AddItemShippingAddressesChange.php +++ b/lib/commercetools-history/src/Models/Change/AddItemShippingAddressesChange.php @@ -19,6 +19,7 @@ interface AddItemShippingAddressesChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for addItemShippingAddress

    * + * @return null|string */ public function getChange(); /** + * @return null|Address */ public function getNextValue(); /** + * @return null|Address */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddItemShippingAddressesChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddItemShippingAddressesChangeBuilder.php index fc1ebd8561b..d2474b7084d 100644 --- a/lib/commercetools-history/src/Models/Change/AddItemShippingAddressesChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddItemShippingAddressesChangeBuilder.php @@ -23,16 +23,19 @@ final class AddItemShippingAddressesChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Address|AddressBuilder */ private $nextValue; /** + * @var null|Address|AddressBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class AddItemShippingAddressesChangeBuilder implements Builder /** *

    Update action for addItemShippingAddress

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Address */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/AddItemShippingAddressesChangeModel.php b/lib/commercetools-history/src/Models/Change/AddItemShippingAddressesChangeModel.php index 7911b890c56..656ca05fe59 100644 --- a/lib/commercetools-history/src/Models/Change/AddItemShippingAddressesChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddItemShippingAddressesChangeModel.php @@ -24,21 +24,25 @@ final class AddItemShippingAddressesChangeModel extends JsonObjectModel implemen public const DISCRIMINATOR_VALUE = 'AddItemShippingAddressesChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Address */ protected $nextValue; /** + * * @var ?Address */ protected $previousValue; @@ -50,15 +54,17 @@ final class AddItemShippingAddressesChangeModel extends JsonObjectModel implemen public function __construct( ?string $change = null, ?Address $nextValue = null, - ?Address $previousValue = null + ?Address $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for addItemShippingAddress

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Address */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/AddLocalizedEnumValueChange.php b/lib/commercetools-history/src/Models/Change/AddLocalizedEnumValueChange.php index beb01a2f1f8..79afcbc62f1 100644 --- a/lib/commercetools-history/src/Models/Change/AddLocalizedEnumValueChange.php +++ b/lib/commercetools-history/src/Models/Change/AddLocalizedEnumValueChange.php @@ -20,6 +20,7 @@ interface AddLocalizedEnumValueChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -27,6 +28,7 @@ public function getType(); /** *

    Update action for addLocalizedEnumValue on types

    * + * @return null|string */ public function getChange(); @@ -34,6 +36,7 @@ public function getChange(); /** *

    The name of the field definition updated.

    * + * @return null|string */ public function getFieldName(); @@ -41,11 +44,13 @@ public function getFieldName(); /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName(); /** + * @return null|LocalizedEnumValue */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddLocalizedEnumValueChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddLocalizedEnumValueChangeBuilder.php index 3c4e83000fa..141414fbdc8 100644 --- a/lib/commercetools-history/src/Models/Change/AddLocalizedEnumValueChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddLocalizedEnumValueChangeBuilder.php @@ -23,21 +23,25 @@ final class AddLocalizedEnumValueChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $fieldName; /** + * @var ?string */ private $attributeName; /** + * @var null|LocalizedEnumValue|LocalizedEnumValueBuilder */ private $nextValue; @@ -45,6 +49,7 @@ final class AddLocalizedEnumValueChangeBuilder implements Builder /** *

    Update action for addLocalizedEnumValue on types

    * + * @return null|string */ public function getChange() @@ -55,6 +60,7 @@ public function getChange() /** *

    The name of the field definition updated.

    * + * @return null|string */ public function getFieldName() @@ -65,6 +71,7 @@ public function getFieldName() /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName() @@ -73,6 +80,7 @@ public function getAttributeName() } /** + * @return null|LocalizedEnumValue */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddLocalizedEnumValueChangeModel.php b/lib/commercetools-history/src/Models/Change/AddLocalizedEnumValueChangeModel.php index 8568340c1ac..6a9f3beaf50 100644 --- a/lib/commercetools-history/src/Models/Change/AddLocalizedEnumValueChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddLocalizedEnumValueChangeModel.php @@ -24,26 +24,31 @@ final class AddLocalizedEnumValueChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'AddLocalizedEnumValueChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $fieldName; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?LocalizedEnumValue */ protected $nextValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $fieldName = null, ?string $attributeName = null, - ?LocalizedEnumValue $nextValue = null + ?LocalizedEnumValue $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->fieldName = $fieldName; $this->attributeName = $attributeName; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for addLocalizedEnumValue on types

    * + * * @return null|string */ public function getChange() @@ -104,6 +112,7 @@ public function getChange() /** *

    The name of the field definition updated.

    * + * * @return null|string */ public function getFieldName() @@ -123,6 +132,7 @@ public function getFieldName() /** *

    The name of the attribute updated.

    * + * * @return null|string */ public function getAttributeName() @@ -140,6 +150,7 @@ public function getAttributeName() } /** + * * @return null|LocalizedEnumValue */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddLocationChange.php b/lib/commercetools-history/src/Models/Change/AddLocationChange.php index 91449ff62c5..be6a6ad57fc 100644 --- a/lib/commercetools-history/src/Models/Change/AddLocationChange.php +++ b/lib/commercetools-history/src/Models/Change/AddLocationChange.php @@ -19,6 +19,7 @@ interface AddLocationChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,6 +27,7 @@ public function getType(); /** *

    Update action for addLocation on zones

    * + * @return null|string */ public function getChange(); @@ -33,6 +35,7 @@ public function getChange(); /** *

    Shape of the value for addLocation and removeLocation actions

    * + * @return null|Location */ public function getPreviousValue(); @@ -40,6 +43,7 @@ public function getPreviousValue(); /** *

    Shape of the value for addLocation and removeLocation actions

    * + * @return null|Location */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddLocationChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddLocationChangeBuilder.php index 21edafe63c3..b0e112b36bf 100644 --- a/lib/commercetools-history/src/Models/Change/AddLocationChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddLocationChangeBuilder.php @@ -23,16 +23,19 @@ final class AddLocationChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Location|LocationBuilder */ private $previousValue; /** + * @var null|Location|LocationBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class AddLocationChangeBuilder implements Builder /** *

    Update action for addLocation on zones

    * + * @return null|string */ public function getChange() @@ -50,6 +54,7 @@ public function getChange() /** *

    Shape of the value for addLocation and removeLocation actions

    * + * @return null|Location */ public function getPreviousValue() @@ -60,6 +65,7 @@ public function getPreviousValue() /** *

    Shape of the value for addLocation and removeLocation actions

    * + * @return null|Location */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddLocationChangeModel.php b/lib/commercetools-history/src/Models/Change/AddLocationChangeModel.php index 42b68260e12..e09bb9dd11c 100644 --- a/lib/commercetools-history/src/Models/Change/AddLocationChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddLocationChangeModel.php @@ -24,21 +24,25 @@ final class AddLocationChangeModel extends JsonObjectModel implements AddLocatio public const DISCRIMINATOR_VALUE = 'AddLocationChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Location */ protected $previousValue; /** + * * @var ?Location */ protected $nextValue; @@ -50,15 +54,17 @@ final class AddLocationChangeModel extends JsonObjectModel implements AddLocatio public function __construct( ?string $change = null, ?Location $previousValue = null, - ?Location $nextValue = null + ?Location $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for addLocation on zones

    * + * * @return null|string */ public function getChange() @@ -97,6 +104,7 @@ public function getChange() /** *

    Shape of the value for addLocation and removeLocation actions

    * + * * @return null|Location */ public function getPreviousValue() @@ -117,6 +125,7 @@ public function getPreviousValue() /** *

    Shape of the value for addLocation and removeLocation actions

    * + * * @return null|Location */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddOrderLineItemChange.php b/lib/commercetools-history/src/Models/Change/AddOrderLineItemChange.php index cf972cdf409..47c44dd7d3f 100644 --- a/lib/commercetools-history/src/Models/Change/AddOrderLineItemChange.php +++ b/lib/commercetools-history/src/Models/Change/AddOrderLineItemChange.php @@ -19,21 +19,25 @@ interface AddOrderLineItemChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|LineItem */ public function getPreviousValue(); /** + * @return null|LineItem */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddOrderLineItemChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddOrderLineItemChangeBuilder.php index 14c585002c9..66897a28a3a 100644 --- a/lib/commercetools-history/src/Models/Change/AddOrderLineItemChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddOrderLineItemChangeBuilder.php @@ -23,21 +23,25 @@ final class AddOrderLineItemChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LineItem|LineItemBuilder */ private $previousValue; /** + * @var null|LineItem|LineItemBuilder */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|LineItem */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|LineItem */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddOrderLineItemChangeModel.php b/lib/commercetools-history/src/Models/Change/AddOrderLineItemChangeModel.php index e022acf10c6..5e2038310da 100644 --- a/lib/commercetools-history/src/Models/Change/AddOrderLineItemChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddOrderLineItemChangeModel.php @@ -24,21 +24,25 @@ final class AddOrderLineItemChangeModel extends JsonObjectModel implements AddOr public const DISCRIMINATOR_VALUE = 'AddOrderLineItemChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LineItem */ protected $previousValue; /** + * * @var ?LineItem */ protected $nextValue; @@ -50,15 +54,17 @@ final class AddOrderLineItemChangeModel extends JsonObjectModel implements AddOr public function __construct( ?string $change = null, ?LineItem $previousValue = null, - ?LineItem $nextValue = null + ?LineItem $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|LineItem */ public function getPreviousValue() @@ -111,6 +119,7 @@ public function getPreviousValue() } /** + * * @return null|LineItem */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddParcelToDeliveryChange.php b/lib/commercetools-history/src/Models/Change/AddParcelToDeliveryChange.php index b553a0bc573..e276cb42f9e 100644 --- a/lib/commercetools-history/src/Models/Change/AddParcelToDeliveryChange.php +++ b/lib/commercetools-history/src/Models/Change/AddParcelToDeliveryChange.php @@ -19,6 +19,7 @@ interface AddParcelToDeliveryChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for addParcelToDelivery

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getDeliveryId(); /** + * @return null|Parcel */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddParcelToDeliveryChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddParcelToDeliveryChangeBuilder.php index a7c5c62e224..66f4a26c2ce 100644 --- a/lib/commercetools-history/src/Models/Change/AddParcelToDeliveryChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddParcelToDeliveryChangeBuilder.php @@ -23,16 +23,19 @@ final class AddParcelToDeliveryChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $deliveryId; /** + * @var null|Parcel|ParcelBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class AddParcelToDeliveryChangeBuilder implements Builder /** *

    Update action for addParcelToDelivery

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|string */ public function getDeliveryId() @@ -56,6 +61,7 @@ public function getDeliveryId() } /** + * @return null|Parcel */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddParcelToDeliveryChangeModel.php b/lib/commercetools-history/src/Models/Change/AddParcelToDeliveryChangeModel.php index 3c020468bc1..095c5a5a0d9 100644 --- a/lib/commercetools-history/src/Models/Change/AddParcelToDeliveryChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddParcelToDeliveryChangeModel.php @@ -24,21 +24,25 @@ final class AddParcelToDeliveryChangeModel extends JsonObjectModel implements Ad public const DISCRIMINATOR_VALUE = 'AddParcelToDeliveryChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?Parcel */ protected $nextValue; @@ -50,15 +54,17 @@ final class AddParcelToDeliveryChangeModel extends JsonObjectModel implements Ad public function __construct( ?string $change = null, ?string $deliveryId = null, - ?Parcel $nextValue = null + ?Parcel $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->deliveryId = $deliveryId; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for addParcelToDelivery

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|string */ public function getDeliveryId() @@ -112,6 +120,7 @@ public function getDeliveryId() } /** + * * @return null|Parcel */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddPaymentChange.php b/lib/commercetools-history/src/Models/Change/AddPaymentChange.php index 848a0d8969a..873bca127d0 100644 --- a/lib/commercetools-history/src/Models/Change/AddPaymentChange.php +++ b/lib/commercetools-history/src/Models/Change/AddPaymentChange.php @@ -19,6 +19,7 @@ interface AddPaymentChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for addPayment & removePayment

    * + * @return null|string */ public function getChange(); /** + * @return null|PaymentInfo */ public function getNextValue(); /** + * @return null|PaymentInfo */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddPaymentChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddPaymentChangeBuilder.php index 6995e7fff30..5afef0a3431 100644 --- a/lib/commercetools-history/src/Models/Change/AddPaymentChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddPaymentChangeBuilder.php @@ -23,16 +23,19 @@ final class AddPaymentChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|PaymentInfo|PaymentInfoBuilder */ private $nextValue; /** + * @var null|PaymentInfo|PaymentInfoBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class AddPaymentChangeBuilder implements Builder /** *

    Update action for addPayment & removePayment

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|PaymentInfo */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|PaymentInfo */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/AddPaymentChangeModel.php b/lib/commercetools-history/src/Models/Change/AddPaymentChangeModel.php index e2018578011..283758afd65 100644 --- a/lib/commercetools-history/src/Models/Change/AddPaymentChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddPaymentChangeModel.php @@ -24,21 +24,25 @@ final class AddPaymentChangeModel extends JsonObjectModel implements AddPaymentC public const DISCRIMINATOR_VALUE = 'AddPaymentChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?PaymentInfo */ protected $nextValue; /** + * * @var ?PaymentInfo */ protected $previousValue; @@ -50,15 +54,17 @@ final class AddPaymentChangeModel extends JsonObjectModel implements AddPaymentC public function __construct( ?string $change = null, ?PaymentInfo $nextValue = null, - ?PaymentInfo $previousValue = null + ?PaymentInfo $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for addPayment & removePayment

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|PaymentInfo */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|PaymentInfo */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/AddPlainEnumValueChange.php b/lib/commercetools-history/src/Models/Change/AddPlainEnumValueChange.php index bb6ee4b1820..2f1e292001d 100644 --- a/lib/commercetools-history/src/Models/Change/AddPlainEnumValueChange.php +++ b/lib/commercetools-history/src/Models/Change/AddPlainEnumValueChange.php @@ -19,6 +19,7 @@ interface AddPlainEnumValueChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,6 +27,7 @@ public function getType(); /** *

    Update action for addPlainEnumValue on product types

    * + * @return null|string */ public function getChange(); @@ -33,11 +35,13 @@ public function getChange(); /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName(); /** + * @return null|EnumValue */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddPlainEnumValueChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddPlainEnumValueChangeBuilder.php index fffcc7a5ba5..21ed4a39d4c 100644 --- a/lib/commercetools-history/src/Models/Change/AddPlainEnumValueChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddPlainEnumValueChangeBuilder.php @@ -23,16 +23,19 @@ final class AddPlainEnumValueChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $attributeName; /** + * @var null|EnumValue|EnumValueBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class AddPlainEnumValueChangeBuilder implements Builder /** *

    Update action for addPlainEnumValue on product types

    * + * @return null|string */ public function getChange() @@ -50,6 +54,7 @@ public function getChange() /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName() @@ -58,6 +63,7 @@ public function getAttributeName() } /** + * @return null|EnumValue */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddPlainEnumValueChangeModel.php b/lib/commercetools-history/src/Models/Change/AddPlainEnumValueChangeModel.php index 1b1d346d255..c99e87c42e4 100644 --- a/lib/commercetools-history/src/Models/Change/AddPlainEnumValueChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddPlainEnumValueChangeModel.php @@ -24,21 +24,25 @@ final class AddPlainEnumValueChangeModel extends JsonObjectModel implements AddP public const DISCRIMINATOR_VALUE = 'AddPlainEnumValueChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?EnumValue */ protected $nextValue; @@ -50,15 +54,17 @@ final class AddPlainEnumValueChangeModel extends JsonObjectModel implements AddP public function __construct( ?string $change = null, ?string $attributeName = null, - ?EnumValue $nextValue = null + ?EnumValue $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->attributeName = $attributeName; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for addPlainEnumValue on product types

    * + * * @return null|string */ public function getChange() @@ -97,6 +104,7 @@ public function getChange() /** *

    The name of the attribute updated.

    * + * * @return null|string */ public function getAttributeName() @@ -114,6 +122,7 @@ public function getAttributeName() } /** + * * @return null|EnumValue */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddPriceChange.php b/lib/commercetools-history/src/Models/Change/AddPriceChange.php index be6c396475a..cbb0157495a 100644 --- a/lib/commercetools-history/src/Models/Change/AddPriceChange.php +++ b/lib/commercetools-history/src/Models/Change/AddPriceChange.php @@ -20,6 +20,7 @@ interface AddPriceChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update action for adding prices

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|string */ public function getPriceId(); /** + * @return null|Price */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddPriceChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddPriceChangeBuilder.php index 978c4c71062..f9a64867356 100644 --- a/lib/commercetools-history/src/Models/Change/AddPriceChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddPriceChangeBuilder.php @@ -23,21 +23,25 @@ final class AddPriceChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var ?string */ private $priceId; /** + * @var null|Price|PriceBuilder */ private $nextValue; @@ -45,6 +49,7 @@ final class AddPriceChangeBuilder implements Builder /** *

    Update action for adding prices

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -61,6 +67,7 @@ public function getCatalogData() } /** + * @return null|string */ public function getPriceId() @@ -69,6 +76,7 @@ public function getPriceId() } /** + * @return null|Price */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddPriceChangeModel.php b/lib/commercetools-history/src/Models/Change/AddPriceChangeModel.php index 867c1c9b4a1..7f1a12eaec8 100644 --- a/lib/commercetools-history/src/Models/Change/AddPriceChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddPriceChangeModel.php @@ -24,26 +24,31 @@ final class AddPriceChangeModel extends JsonObjectModel implements AddPriceChang public const DISCRIMINATOR_VALUE = 'AddPriceChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?string */ protected $priceId; /** + * * @var ?Price */ protected $nextValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $catalogData = null, ?string $priceId = null, - ?Price $nextValue = null + ?Price $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->priceId = $priceId; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for adding prices

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -119,6 +128,7 @@ public function getCatalogData() } /** + * * @return null|string */ public function getPriceId() @@ -136,6 +146,7 @@ public function getPriceId() } /** + * * @return null|Price */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddProductChange.php b/lib/commercetools-history/src/Models/Change/AddProductChange.php new file mode 100644 index 00000000000..f5bc4e68df2 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/AddProductChange.php @@ -0,0 +1,49 @@ +Update action for when a product is assigned to a product selection

    + * + + * @return null|string + */ + public function getChange(); + + /** + + * @return null|Reference + */ + public function getNextValue(); + + /** + * @param ?string $change + */ + public function setChange(?string $change): void; + + /** + * @param ?Reference $nextValue + */ + public function setNextValue(?Reference $nextValue): void; +} diff --git a/lib/commercetools-history/src/Models/Change/AddProductChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddProductChangeBuilder.php new file mode 100644 index 00000000000..713aaf33139 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/AddProductChangeBuilder.php @@ -0,0 +1,102 @@ + + */ +final class AddProductChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $nextValue; + + /** + *

    Update action for when a product is assigned to a product selection

    + * + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + + * @return null|Reference + */ + public function getNextValue() + { + return $this->nextValue instanceof ReferenceBuilder ? $this->nextValue->build() : $this->nextValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?Reference $nextValue + * @return $this + */ + public function withNextValue(?Reference $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + /** + * @deprecated use withNextValue() instead + * @return $this + */ + public function withNextValueBuilder(?ReferenceBuilder $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + public function build(): AddProductChange + { + return new AddProductChangeModel( + $this->change, + $this->nextValue instanceof ReferenceBuilder ? $this->nextValue->build() : $this->nextValue + ); + } + + public static function of(): AddProductChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/AddProductChangeCollection.php b/lib/commercetools-history/src/Models/Change/AddProductChangeCollection.php new file mode 100644 index 00000000000..51f7914289d --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/AddProductChangeCollection.php @@ -0,0 +1,56 @@ + + * @method AddProductChange current() + * @method AddProductChange end() + * @method AddProductChange at($offset) + */ +class AddProductChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert AddProductChange $value + * @psalm-param AddProductChange|stdClass $value + * @throws InvalidArgumentException + * + * @return AddProductChangeCollection + */ + public function add($value) + { + if (!$value instanceof AddProductChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?AddProductChange + */ + protected function mapper() + { + return function (?int $index): ?AddProductChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var AddProductChange $data */ + $data = AddProductChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/AddProductChangeModel.php b/lib/commercetools-history/src/Models/Change/AddProductChangeModel.php new file mode 100644 index 00000000000..5d2f0024753 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/AddProductChangeModel.php @@ -0,0 +1,134 @@ +change = $change; + $this->nextValue = $nextValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Update action for when a product is assigned to a product selection

    + * + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + * + * @return null|Reference + */ + public function getNextValue() + { + if (is_null($this->nextValue)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_NEXT_VALUE); + if (is_null($data)) { + return null; + } + + $this->nextValue = ReferenceModel::of($data); + } + + return $this->nextValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?Reference $nextValue + */ + public function setNextValue(?Reference $nextValue): void + { + $this->nextValue = $nextValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Change/AddPropertyChange.php b/lib/commercetools-history/src/Models/Change/AddPropertyChange.php index f396d0f7ba5..7abb4a1837f 100644 --- a/lib/commercetools-history/src/Models/Change/AddPropertyChange.php +++ b/lib/commercetools-history/src/Models/Change/AddPropertyChange.php @@ -18,6 +18,7 @@ interface AddPropertyChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,6 +26,7 @@ public function getType(); /** *

    Update action for addProperty on custom objects

    * + * @return null|string */ public function getChange(); @@ -32,11 +34,13 @@ public function getChange(); /** *

    Value path to the property that was added

    * + * @return null|string */ public function getPath(); /** + * @return null|mixed */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddPropertyChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddPropertyChangeBuilder.php index e59434cb536..06cd73baf37 100644 --- a/lib/commercetools-history/src/Models/Change/AddPropertyChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddPropertyChangeBuilder.php @@ -21,16 +21,19 @@ final class AddPropertyChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $path; /** + * @var null|mixed|mixed */ private $nextValue; @@ -38,6 +41,7 @@ final class AddPropertyChangeBuilder implements Builder /** *

    Update action for addProperty on custom objects

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() /** *

    Value path to the property that was added

    * + * @return null|string */ public function getPath() @@ -56,6 +61,7 @@ public function getPath() } /** + * @return null|mixed */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddPropertyChangeModel.php b/lib/commercetools-history/src/Models/Change/AddPropertyChangeModel.php index 4f5403682b5..877f254f40a 100644 --- a/lib/commercetools-history/src/Models/Change/AddPropertyChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddPropertyChangeModel.php @@ -22,21 +22,25 @@ final class AddPropertyChangeModel extends JsonObjectModel implements AddPropert public const DISCRIMINATOR_VALUE = 'AddPropertyChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $path; /** + * * @var ?mixed */ protected $nextValue; @@ -48,15 +52,17 @@ final class AddPropertyChangeModel extends JsonObjectModel implements AddPropert public function __construct( ?string $change = null, ?string $path = null, - $nextValue = null + $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->path = $path; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Update action for addProperty on custom objects

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() /** *

    Value path to the property that was added

    * + * * @return null|string */ public function getPath() @@ -112,6 +120,7 @@ public function getPath() } /** + * * @return null|mixed */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddReturnInfoChange.php b/lib/commercetools-history/src/Models/Change/AddReturnInfoChange.php index 3c49d94f53e..094c4b31b87 100644 --- a/lib/commercetools-history/src/Models/Change/AddReturnInfoChange.php +++ b/lib/commercetools-history/src/Models/Change/AddReturnInfoChange.php @@ -18,6 +18,7 @@ interface AddReturnInfoChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,11 +26,13 @@ public function getType(); /** *

    Update action for addReturnInfo

    * + * @return null|string */ public function getChange(); /** + * @return null|ReturnInfo */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddReturnInfoChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddReturnInfoChangeBuilder.php index 87da5a156dd..b54c4f0ff3b 100644 --- a/lib/commercetools-history/src/Models/Change/AddReturnInfoChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddReturnInfoChangeBuilder.php @@ -23,11 +23,13 @@ final class AddReturnInfoChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|ReturnInfo|ReturnInfoBuilder */ private $nextValue; @@ -35,6 +37,7 @@ final class AddReturnInfoChangeBuilder implements Builder /** *

    Update action for addReturnInfo

    * + * @return null|string */ public function getChange() @@ -43,6 +46,7 @@ public function getChange() } /** + * @return null|ReturnInfo */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddReturnInfoChangeModel.php b/lib/commercetools-history/src/Models/Change/AddReturnInfoChangeModel.php index e3ff47f1393..0ff4091bc46 100644 --- a/lib/commercetools-history/src/Models/Change/AddReturnInfoChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddReturnInfoChangeModel.php @@ -24,16 +24,19 @@ final class AddReturnInfoChangeModel extends JsonObjectModel implements AddRetur public const DISCRIMINATOR_VALUE = 'AddReturnInfoChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ReturnInfo */ protected $nextValue; @@ -44,14 +47,16 @@ final class AddReturnInfoChangeModel extends JsonObjectModel implements AddRetur */ public function __construct( ?string $change = null, - ?ReturnInfo $nextValue = null + ?ReturnInfo $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -71,6 +76,7 @@ public function getType() /** *

    Update action for addReturnInfo

    * + * * @return null|string */ public function getChange() @@ -88,6 +94,7 @@ public function getChange() } /** + * * @return null|ReturnInfo */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddShippingAddressIdChange.php b/lib/commercetools-history/src/Models/Change/AddShippingAddressIdChange.php index eccba58de71..64d427eb9b4 100644 --- a/lib/commercetools-history/src/Models/Change/AddShippingAddressIdChange.php +++ b/lib/commercetools-history/src/Models/Change/AddShippingAddressIdChange.php @@ -22,26 +22,31 @@ interface AddShippingAddressIdChange extends Change /** *

    Update action for addShippingAddressId action on customers.

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|array */ public function getNextValue(); /** + * @return null|array */ public function getPreviousValue(); /** + * @return null|Address */ public function getAddress(); diff --git a/lib/commercetools-history/src/Models/Change/AddShippingAddressIdChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddShippingAddressIdChangeBuilder.php index 35ef93480a4..4069d4e64c4 100644 --- a/lib/commercetools-history/src/Models/Change/AddShippingAddressIdChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddShippingAddressIdChangeBuilder.php @@ -23,21 +23,25 @@ final class AddShippingAddressIdChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?array */ private $nextValue; /** + * @var ?array */ private $previousValue; /** + * @var null|Address|AddressBuilder */ private $address; @@ -45,6 +49,7 @@ final class AddShippingAddressIdChangeBuilder implements Builder /** *

    Update action for addShippingAddressId action on customers.

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|array */ public function getNextValue() @@ -61,6 +67,7 @@ public function getNextValue() } /** + * @return null|array */ public function getPreviousValue() @@ -69,6 +76,7 @@ public function getPreviousValue() } /** + * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-history/src/Models/Change/AddShippingAddressIdChangeModel.php b/lib/commercetools-history/src/Models/Change/AddShippingAddressIdChangeModel.php index 27e71289e0f..ce0477cb81e 100644 --- a/lib/commercetools-history/src/Models/Change/AddShippingAddressIdChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddShippingAddressIdChangeModel.php @@ -24,26 +24,31 @@ final class AddShippingAddressIdChangeModel extends JsonObjectModel implements A public const DISCRIMINATOR_VALUE = 'AddShippingAddressIdChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?array */ protected $nextValue; /** + * * @var ?array */ protected $previousValue; /** + * * @var ?Address */ protected $address; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?array $nextValue = null, ?array $previousValue = null, - ?Address $address = null + ?Address $address = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; $this->address = $address; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for addShippingAddressId action on customers.

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|array */ public function getNextValue() @@ -119,6 +128,7 @@ public function getNextValue() } /** + * * @return null|array */ public function getPreviousValue() @@ -136,6 +146,7 @@ public function getPreviousValue() } /** + * * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-history/src/Models/Change/AddShoppingListLineItemChange.php b/lib/commercetools-history/src/Models/Change/AddShoppingListLineItemChange.php index 17840374d7f..c71f4ef86ea 100644 --- a/lib/commercetools-history/src/Models/Change/AddShoppingListLineItemChange.php +++ b/lib/commercetools-history/src/Models/Change/AddShoppingListLineItemChange.php @@ -19,21 +19,25 @@ interface AddShoppingListLineItemChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|LineItem */ public function getPreviousValue(); /** + * @return null|LineItem */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddShoppingListLineItemChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddShoppingListLineItemChangeBuilder.php index 2a9aa1912bb..1efadcd8227 100644 --- a/lib/commercetools-history/src/Models/Change/AddShoppingListLineItemChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddShoppingListLineItemChangeBuilder.php @@ -23,21 +23,25 @@ final class AddShoppingListLineItemChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LineItem|LineItemBuilder */ private $previousValue; /** + * @var null|LineItem|LineItemBuilder */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|LineItem */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|LineItem */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddShoppingListLineItemChangeModel.php b/lib/commercetools-history/src/Models/Change/AddShoppingListLineItemChangeModel.php index f384b16cfe3..e617f59cef1 100644 --- a/lib/commercetools-history/src/Models/Change/AddShoppingListLineItemChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddShoppingListLineItemChangeModel.php @@ -24,21 +24,25 @@ final class AddShoppingListLineItemChangeModel extends JsonObjectModel implement public const DISCRIMINATOR_VALUE = 'AddShoppingListLineItemChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LineItem */ protected $previousValue; /** + * * @var ?LineItem */ protected $nextValue; @@ -50,15 +54,17 @@ final class AddShoppingListLineItemChangeModel extends JsonObjectModel implement public function __construct( ?string $change = null, ?LineItem $previousValue = null, - ?LineItem $nextValue = null + ?LineItem $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|LineItem */ public function getPreviousValue() @@ -111,6 +119,7 @@ public function getPreviousValue() } /** + * * @return null|LineItem */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddStateRolesChange.php b/lib/commercetools-history/src/Models/Change/AddStateRolesChange.php index b33b3666d4a..ba275a3d348 100644 --- a/lib/commercetools-history/src/Models/Change/AddStateRolesChange.php +++ b/lib/commercetools-history/src/Models/Change/AddStateRolesChange.php @@ -18,21 +18,25 @@ interface AddStateRolesChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|array */ public function getPreviousValue(); /** + * @return null|array */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddStateRolesChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddStateRolesChangeBuilder.php index e1942853c97..5d19419b1c9 100644 --- a/lib/commercetools-history/src/Models/Change/AddStateRolesChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddStateRolesChangeBuilder.php @@ -21,21 +21,25 @@ final class AddStateRolesChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?array */ private $previousValue; /** + * @var ?array */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -44,6 +48,7 @@ public function getChange() } /** + * @return null|array */ public function getPreviousValue() @@ -52,6 +57,7 @@ public function getPreviousValue() } /** + * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddStateRolesChangeModel.php b/lib/commercetools-history/src/Models/Change/AddStateRolesChangeModel.php index 7b76e2abe2f..fcd4e2f9627 100644 --- a/lib/commercetools-history/src/Models/Change/AddStateRolesChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddStateRolesChangeModel.php @@ -22,21 +22,25 @@ final class AddStateRolesChangeModel extends JsonObjectModel implements AddState public const DISCRIMINATOR_VALUE = 'AddStateRolesChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?array */ protected $previousValue; /** + * * @var ?array */ protected $nextValue; @@ -48,15 +52,17 @@ final class AddStateRolesChangeModel extends JsonObjectModel implements AddState public function __construct( ?string $change = null, ?array $previousValue = null, - ?array $nextValue = null + ?array $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -74,6 +80,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -91,6 +98,7 @@ public function getChange() } /** + * * @return null|array */ public function getPreviousValue() @@ -108,6 +116,7 @@ public function getPreviousValue() } /** + * * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddTaxRateChange.php b/lib/commercetools-history/src/Models/Change/AddTaxRateChange.php index 115234edd51..0a8db91cac6 100644 --- a/lib/commercetools-history/src/Models/Change/AddTaxRateChange.php +++ b/lib/commercetools-history/src/Models/Change/AddTaxRateChange.php @@ -18,6 +18,7 @@ interface AddTaxRateChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,6 +26,7 @@ public function getType(); /** *

    Update action for addTaxRate on tax categories

    * + * @return null|string */ public function getChange(); @@ -32,6 +34,7 @@ public function getChange(); /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddTaxRateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddTaxRateChangeBuilder.php index 28458a05fe2..42510431c2e 100644 --- a/lib/commercetools-history/src/Models/Change/AddTaxRateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddTaxRateChangeBuilder.php @@ -23,11 +23,13 @@ final class AddTaxRateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|TaxRate|TaxRateBuilder */ private $nextValue; @@ -35,6 +37,7 @@ final class AddTaxRateChangeBuilder implements Builder /** *

    Update action for addTaxRate on tax categories

    * + * @return null|string */ public function getChange() @@ -45,6 +48,7 @@ public function getChange() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddTaxRateChangeModel.php b/lib/commercetools-history/src/Models/Change/AddTaxRateChangeModel.php index 19e4f59b449..ef4e8e8cdd3 100644 --- a/lib/commercetools-history/src/Models/Change/AddTaxRateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddTaxRateChangeModel.php @@ -24,16 +24,19 @@ final class AddTaxRateChangeModel extends JsonObjectModel implements AddTaxRateC public const DISCRIMINATOR_VALUE = 'AddTaxRateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?TaxRate */ protected $nextValue; @@ -44,14 +47,16 @@ final class AddTaxRateChangeModel extends JsonObjectModel implements AddTaxRateC */ public function __construct( ?string $change = null, - ?TaxRate $nextValue = null + ?TaxRate $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -71,6 +76,7 @@ public function getType() /** *

    Update action for addTaxRate on tax categories

    * + * * @return null|string */ public function getChange() @@ -90,6 +96,7 @@ public function getChange() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * * @return null|TaxRate */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddTextLineItemChange.php b/lib/commercetools-history/src/Models/Change/AddTextLineItemChange.php index 777363895b1..658e3d9e34b 100644 --- a/lib/commercetools-history/src/Models/Change/AddTextLineItemChange.php +++ b/lib/commercetools-history/src/Models/Change/AddTextLineItemChange.php @@ -18,16 +18,19 @@ interface AddTextLineItemChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|TextLineItem */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddTextLineItemChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddTextLineItemChangeBuilder.php index cad7c115a84..cb0ab61d0a4 100644 --- a/lib/commercetools-history/src/Models/Change/AddTextLineItemChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddTextLineItemChangeBuilder.php @@ -23,16 +23,19 @@ final class AddTextLineItemChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|TextLineItem|TextLineItemBuilder */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -41,6 +44,7 @@ public function getChange() } /** + * @return null|TextLineItem */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddTextLineItemChangeModel.php b/lib/commercetools-history/src/Models/Change/AddTextLineItemChangeModel.php index eed8bf6903c..16d88d908d5 100644 --- a/lib/commercetools-history/src/Models/Change/AddTextLineItemChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddTextLineItemChangeModel.php @@ -24,16 +24,19 @@ final class AddTextLineItemChangeModel extends JsonObjectModel implements AddTex public const DISCRIMINATOR_VALUE = 'AddTextLineItemChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?TextLineItem */ protected $nextValue; @@ -44,14 +47,16 @@ final class AddTextLineItemChangeModel extends JsonObjectModel implements AddTex */ public function __construct( ?string $change = null, - ?TextLineItem $nextValue = null + ?TextLineItem $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -69,6 +74,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -86,6 +92,7 @@ public function getChange() } /** + * * @return null|TextLineItem */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddToCategoryChange.php b/lib/commercetools-history/src/Models/Change/AddToCategoryChange.php index 187889e48b6..944607a6621 100644 --- a/lib/commercetools-history/src/Models/Change/AddToCategoryChange.php +++ b/lib/commercetools-history/src/Models/Change/AddToCategoryChange.php @@ -21,6 +21,7 @@ interface AddToCategoryChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -28,21 +29,25 @@ public function getType(); /** *

    Update action for addToCategory

    * + * @return null|string */ public function getChange(); /** + * @return null|Reference */ public function getCategory(); /** + * @return null|ReferenceCollection */ public function getPreviousValue(); /** + * @return null|ReferenceCollection */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddToCategoryChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddToCategoryChangeBuilder.php index bc94d220b03..42f0546f42d 100644 --- a/lib/commercetools-history/src/Models/Change/AddToCategoryChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddToCategoryChangeBuilder.php @@ -24,21 +24,25 @@ final class AddToCategoryChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Reference|ReferenceBuilder */ private $category; /** + * @var ?ReferenceCollection */ private $previousValue; /** + * @var ?ReferenceCollection */ private $nextValue; @@ -46,6 +50,7 @@ final class AddToCategoryChangeBuilder implements Builder /** *

    Update action for addToCategory

    * + * @return null|string */ public function getChange() @@ -54,6 +59,7 @@ public function getChange() } /** + * @return null|Reference */ public function getCategory() @@ -62,6 +68,7 @@ public function getCategory() } /** + * @return null|ReferenceCollection */ public function getPreviousValue() @@ -70,6 +77,7 @@ public function getPreviousValue() } /** + * @return null|ReferenceCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddToCategoryChangeModel.php b/lib/commercetools-history/src/Models/Change/AddToCategoryChangeModel.php index f605f5ad06f..93802f00bd4 100644 --- a/lib/commercetools-history/src/Models/Change/AddToCategoryChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddToCategoryChangeModel.php @@ -25,26 +25,31 @@ final class AddToCategoryChangeModel extends JsonObjectModel implements AddToCat public const DISCRIMINATOR_VALUE = 'AddToCategoryChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Reference */ protected $category; /** + * * @var ?ReferenceCollection */ protected $previousValue; /** + * * @var ?ReferenceCollection */ protected $nextValue; @@ -57,16 +62,18 @@ public function __construct( ?string $change = null, ?Reference $category = null, ?ReferenceCollection $previousValue = null, - ?ReferenceCollection $nextValue = null + ?ReferenceCollection $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->category = $category; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -86,6 +93,7 @@ public function getType() /** *

    Update action for addToCategory

    * + * * @return null|string */ public function getChange() @@ -103,6 +111,7 @@ public function getChange() } /** + * * @return null|Reference */ public function getCategory() @@ -121,6 +130,7 @@ public function getCategory() } /** + * * @return null|ReferenceCollection */ public function getPreviousValue() @@ -138,6 +148,7 @@ public function getPreviousValue() } /** + * * @return null|ReferenceCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddTransactionChange.php b/lib/commercetools-history/src/Models/Change/AddTransactionChange.php index 96edf0708f7..63df794c071 100644 --- a/lib/commercetools-history/src/Models/Change/AddTransactionChange.php +++ b/lib/commercetools-history/src/Models/Change/AddTransactionChange.php @@ -18,6 +18,7 @@ interface AddTransactionChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,11 +26,13 @@ public function getType(); /** *

    Update action for addTransaction on payments

    * + * @return null|string */ public function getChange(); /** + * @return null|Transaction */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddTransactionChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddTransactionChangeBuilder.php index dd2161e8136..1dbc04b0c39 100644 --- a/lib/commercetools-history/src/Models/Change/AddTransactionChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddTransactionChangeBuilder.php @@ -23,11 +23,13 @@ final class AddTransactionChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Transaction|TransactionBuilder */ private $nextValue; @@ -35,6 +37,7 @@ final class AddTransactionChangeBuilder implements Builder /** *

    Update action for addTransaction on payments

    * + * @return null|string */ public function getChange() @@ -43,6 +46,7 @@ public function getChange() } /** + * @return null|Transaction */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddTransactionChangeModel.php b/lib/commercetools-history/src/Models/Change/AddTransactionChangeModel.php index bb6a37c6668..93eb27d9b15 100644 --- a/lib/commercetools-history/src/Models/Change/AddTransactionChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddTransactionChangeModel.php @@ -24,16 +24,19 @@ final class AddTransactionChangeModel extends JsonObjectModel implements AddTran public const DISCRIMINATOR_VALUE = 'AddTransactionChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Transaction */ protected $nextValue; @@ -44,14 +47,16 @@ final class AddTransactionChangeModel extends JsonObjectModel implements AddTran */ public function __construct( ?string $change = null, - ?Transaction $nextValue = null + ?Transaction $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -71,6 +76,7 @@ public function getType() /** *

    Update action for addTransaction on payments

    * + * * @return null|string */ public function getChange() @@ -88,6 +94,7 @@ public function getChange() } /** + * * @return null|Transaction */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddVariantChange.php b/lib/commercetools-history/src/Models/Change/AddVariantChange.php index ce1243531dd..6f45605cbf8 100644 --- a/lib/commercetools-history/src/Models/Change/AddVariantChange.php +++ b/lib/commercetools-history/src/Models/Change/AddVariantChange.php @@ -20,6 +20,7 @@ interface AddVariantChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update action for addVariant

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|Variant */ public function getPreviousValue(); /** + * @return null|Variant */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/AddVariantChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddVariantChangeBuilder.php index dcca9497675..3dbda00e2e1 100644 --- a/lib/commercetools-history/src/Models/Change/AddVariantChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/AddVariantChangeBuilder.php @@ -23,21 +23,25 @@ final class AddVariantChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var null|Variant|VariantBuilder */ private $previousValue; /** + * @var null|Variant|VariantBuilder */ private $nextValue; @@ -45,6 +49,7 @@ final class AddVariantChangeBuilder implements Builder /** *

    Update action for addVariant

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -61,6 +67,7 @@ public function getCatalogData() } /** + * @return null|Variant */ public function getPreviousValue() @@ -69,6 +76,7 @@ public function getPreviousValue() } /** + * @return null|Variant */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/AddVariantChangeModel.php b/lib/commercetools-history/src/Models/Change/AddVariantChangeModel.php index 49e19b5c349..d0dae6f2bd0 100644 --- a/lib/commercetools-history/src/Models/Change/AddVariantChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/AddVariantChangeModel.php @@ -24,26 +24,31 @@ final class AddVariantChangeModel extends JsonObjectModel implements AddVariantC public const DISCRIMINATOR_VALUE = 'AddVariantChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?Variant */ protected $previousValue; /** + * * @var ?Variant */ protected $nextValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $catalogData = null, ?Variant $previousValue = null, - ?Variant $nextValue = null + ?Variant $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for addVariant

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -119,6 +128,7 @@ public function getCatalogData() } /** + * * @return null|Variant */ public function getPreviousValue() @@ -137,6 +147,7 @@ public function getPreviousValue() } /** + * * @return null|Variant */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/Change.php b/lib/commercetools-history/src/Models/Change/Change.php index 1b483f1a933..38eed788acd 100644 --- a/lib/commercetools-history/src/Models/Change/Change.php +++ b/lib/commercetools-history/src/Models/Change/Change.php @@ -18,11 +18,13 @@ interface Change extends JsonObject public const FIELD_CHANGE = 'change'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeAddressChange.php b/lib/commercetools-history/src/Models/Change/ChangeAddressChange.php index fcb50e20413..d215a4a106e 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAddressChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAddressChange.php @@ -21,21 +21,25 @@ interface ChangeAddressChange extends Change /** *

    Update action changeAddress action.

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|Address */ public function getNextValue(); /** + * @return null|Address */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeAddressChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeAddressChangeBuilder.php index c8c92285538..706aea95bdd 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAddressChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAddressChangeBuilder.php @@ -23,16 +23,19 @@ final class ChangeAddressChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Address|AddressBuilder */ private $nextValue; /** + * @var null|Address|AddressBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class ChangeAddressChangeBuilder implements Builder /** *

    Update action changeAddress action.

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Address */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeAddressChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeAddressChangeModel.php index 97fed9c834b..ce252467128 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAddressChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAddressChangeModel.php @@ -24,21 +24,25 @@ final class ChangeAddressChangeModel extends JsonObjectModel implements ChangeAd public const DISCRIMINATOR_VALUE = 'ChangeAddressChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Address */ protected $nextValue; /** + * * @var ?Address */ protected $previousValue; @@ -50,15 +54,17 @@ final class ChangeAddressChangeModel extends JsonObjectModel implements ChangeAd public function __construct( ?string $change = null, ?Address $nextValue = null, - ?Address $previousValue = null + ?Address $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action changeAddress action.

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Address */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeAmountAuthorizedChange.php b/lib/commercetools-history/src/Models/Change/ChangeAmountAuthorizedChange.php index cebb0d93b38..e0362fdded5 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAmountAuthorizedChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAmountAuthorizedChange.php @@ -19,6 +19,7 @@ interface ChangeAmountAuthorizedChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Internal Update action for changeAmountAuthorized

    * + * @return null|string */ public function getChange(); /** + * @return null|Money */ public function getPreviousValue(); /** + * @return null|Money */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeAmountAuthorizedChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeAmountAuthorizedChangeBuilder.php index ee8125eb8c8..0b54195eb25 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAmountAuthorizedChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAmountAuthorizedChangeBuilder.php @@ -23,16 +23,19 @@ final class ChangeAmountAuthorizedChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Money|MoneyBuilder */ private $previousValue; /** + * @var null|Money|MoneyBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class ChangeAmountAuthorizedChangeBuilder implements Builder /** *

    Internal Update action for changeAmountAuthorized

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Money */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|Money */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeAmountAuthorizedChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeAmountAuthorizedChangeModel.php index 8be872a83f2..e309041696c 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAmountAuthorizedChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAmountAuthorizedChangeModel.php @@ -24,21 +24,25 @@ final class ChangeAmountAuthorizedChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'ChangeAmountAuthorizedChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Money */ protected $previousValue; /** + * * @var ?Money */ protected $nextValue; @@ -50,15 +54,17 @@ final class ChangeAmountAuthorizedChangeModel extends JsonObjectModel implements public function __construct( ?string $change = null, ?Money $previousValue = null, - ?Money $nextValue = null + ?Money $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Internal Update action for changeAmountAuthorized

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Money */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|Money */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeAmountPlannedChange.php b/lib/commercetools-history/src/Models/Change/ChangeAmountPlannedChange.php index d6bd50b4193..52131674036 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAmountPlannedChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAmountPlannedChange.php @@ -19,21 +19,25 @@ interface ChangeAmountPlannedChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|Money */ public function getPreviousValue(); /** + * @return null|Money */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeAmountPlannedChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeAmountPlannedChangeBuilder.php index ae098a5030c..6723583602c 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAmountPlannedChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAmountPlannedChangeBuilder.php @@ -23,21 +23,25 @@ final class ChangeAmountPlannedChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Money|MoneyBuilder */ private $previousValue; /** + * @var null|Money|MoneyBuilder */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|Money */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|Money */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeAmountPlannedChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeAmountPlannedChangeModel.php index c88f1394921..37044d7de13 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAmountPlannedChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAmountPlannedChangeModel.php @@ -24,21 +24,25 @@ final class ChangeAmountPlannedChangeModel extends JsonObjectModel implements Ch public const DISCRIMINATOR_VALUE = 'ChangeAmountPlannedChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Money */ protected $previousValue; /** + * * @var ?Money */ protected $nextValue; @@ -50,15 +54,17 @@ final class ChangeAmountPlannedChangeModel extends JsonObjectModel implements Ch public function __construct( ?string $change = null, ?Money $previousValue = null, - ?Money $nextValue = null + ?Money $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|Money */ public function getPreviousValue() @@ -111,6 +119,7 @@ public function getPreviousValue() } /** + * * @return null|Money */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeAssetNameChange.php b/lib/commercetools-history/src/Models/Change/ChangeAssetNameChange.php index 2614c4171f0..760a8ad659d 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAssetNameChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAssetNameChange.php @@ -23,26 +23,31 @@ interface ChangeAssetNameChange extends Change /** *

    Update action for changeAssetName

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|AssetChangeValue */ public function getAsset(); /** + * @return null|LocalizedString */ public function getNextValue(); /** + * @return null|LocalizedString */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeAssetNameChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeAssetNameChangeBuilder.php index 46afeed4c35..b124ddcfd1f 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAssetNameChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAssetNameChangeBuilder.php @@ -25,21 +25,25 @@ final class ChangeAssetNameChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|AssetChangeValue|AssetChangeValueBuilder */ private $asset; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; @@ -47,6 +51,7 @@ final class ChangeAssetNameChangeBuilder implements Builder /** *

    Update action for changeAssetName

    * + * @return null|string */ public function getChange() @@ -55,6 +60,7 @@ public function getChange() } /** + * @return null|AssetChangeValue */ public function getAsset() @@ -63,6 +69,7 @@ public function getAsset() } /** + * @return null|LocalizedString */ public function getNextValue() @@ -71,6 +78,7 @@ public function getNextValue() } /** + * @return null|LocalizedString */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeAssetNameChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeAssetNameChangeModel.php index eacbd4d513f..1a630205ff9 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAssetNameChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAssetNameChangeModel.php @@ -26,26 +26,31 @@ final class ChangeAssetNameChangeModel extends JsonObjectModel implements Change public const DISCRIMINATOR_VALUE = 'ChangeAssetNameChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?AssetChangeValue */ protected $asset; /** + * * @var ?LocalizedString */ protected $nextValue; /** + * * @var ?LocalizedString */ protected $previousValue; @@ -58,16 +63,18 @@ public function __construct( ?string $change = null, ?AssetChangeValue $asset = null, ?LocalizedString $nextValue = null, - ?LocalizedString $previousValue = null + ?LocalizedString $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->asset = $asset; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -87,6 +94,7 @@ public function getType() /** *

    Update action for changeAssetName

    * + * * @return null|string */ public function getChange() @@ -104,6 +112,7 @@ public function getChange() } /** + * * @return null|AssetChangeValue */ public function getAsset() @@ -122,6 +131,7 @@ public function getAsset() } /** + * * @return null|LocalizedString */ public function getNextValue() @@ -140,6 +150,7 @@ public function getNextValue() } /** + * * @return null|LocalizedString */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeAssetOrderChange.php b/lib/commercetools-history/src/Models/Change/ChangeAssetOrderChange.php index d87282c17f6..a0db7b90afc 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAssetOrderChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAssetOrderChange.php @@ -19,21 +19,25 @@ interface ChangeAssetOrderChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|LocalizedStringCollection */ public function getPreviousValue(); /** + * @return null|LocalizedStringCollection */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeAssetOrderChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeAssetOrderChangeBuilder.php index 4b58a3235b1..297433cd0d8 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAssetOrderChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAssetOrderChangeBuilder.php @@ -22,21 +22,25 @@ final class ChangeAssetOrderChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?LocalizedStringCollection */ private $previousValue; /** + * @var ?LocalizedStringCollection */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -45,6 +49,7 @@ public function getChange() } /** + * @return null|LocalizedStringCollection */ public function getPreviousValue() @@ -53,6 +58,7 @@ public function getPreviousValue() } /** + * @return null|LocalizedStringCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeAssetOrderChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeAssetOrderChangeModel.php index 962e2930c37..2daf3b9c743 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAssetOrderChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAssetOrderChangeModel.php @@ -23,21 +23,25 @@ final class ChangeAssetOrderChangeModel extends JsonObjectModel implements Chang public const DISCRIMINATOR_VALUE = 'ChangeAssetOrderChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedStringCollection */ protected $previousValue; /** + * * @var ?LocalizedStringCollection */ protected $nextValue; @@ -49,15 +53,17 @@ final class ChangeAssetOrderChangeModel extends JsonObjectModel implements Chang public function __construct( ?string $change = null, ?LocalizedStringCollection $previousValue = null, - ?LocalizedStringCollection $nextValue = null + ?LocalizedStringCollection $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -75,6 +81,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -92,6 +99,7 @@ public function getChange() } /** + * * @return null|LocalizedStringCollection */ public function getPreviousValue() @@ -109,6 +117,7 @@ public function getPreviousValue() } /** + * * @return null|LocalizedStringCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeAttributeConstraintChange.php b/lib/commercetools-history/src/Models/Change/ChangeAttributeConstraintChange.php index 8b100245faa..412e9cffbf8 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAttributeConstraintChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAttributeConstraintChange.php @@ -19,11 +19,13 @@ interface ChangeAttributeConstraintChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); @@ -31,16 +33,19 @@ public function getChange(); /** *

    name of the updated attribute

    * + * @return null|string */ public function getAttributeName(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeAttributeConstraintChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeAttributeConstraintChangeBuilder.php index 9b1f51ffe92..b8d9f236698 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAttributeConstraintChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAttributeConstraintChangeBuilder.php @@ -21,26 +21,31 @@ final class ChangeAttributeConstraintChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $attributeName; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -51,6 +56,7 @@ public function getChange() /** *

    name of the updated attribute

    * + * @return null|string */ public function getAttributeName() @@ -59,6 +65,7 @@ public function getAttributeName() } /** + * @return null|string */ public function getPreviousValue() @@ -67,6 +74,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeAttributeConstraintChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeAttributeConstraintChangeModel.php index f2e0bb8935c..45b83a22d76 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAttributeConstraintChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAttributeConstraintChangeModel.php @@ -22,26 +22,31 @@ final class ChangeAttributeConstraintChangeModel extends JsonObjectModel impleme public const DISCRIMINATOR_VALUE = 'ChangeAttributeConstraintChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -54,16 +59,18 @@ public function __construct( ?string $change = null, ?string $attributeName = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->attributeName = $attributeName; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -81,6 +88,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -100,6 +108,7 @@ public function getChange() /** *

    name of the updated attribute

    * + * * @return null|string */ public function getAttributeName() @@ -117,6 +126,7 @@ public function getAttributeName() } /** + * * @return null|string */ public function getPreviousValue() @@ -134,6 +144,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeAttributeOrderByNameChange.php b/lib/commercetools-history/src/Models/Change/ChangeAttributeOrderByNameChange.php index 5d578848f8b..a73446afa55 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAttributeOrderByNameChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAttributeOrderByNameChange.php @@ -18,6 +18,7 @@ interface ChangeAttributeOrderByNameChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Update action for changeAttributeOrderByName on product types

    * + * @return null|string */ public function getChange(); /** + * @return null|array */ public function getPreviousValue(); /** + * @return null|array */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeAttributeOrderByNameChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeAttributeOrderByNameChangeBuilder.php index f88d3b9c32b..0fcee4c3135 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAttributeOrderByNameChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAttributeOrderByNameChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeAttributeOrderByNameChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?array */ private $previousValue; /** + * @var ?array */ private $nextValue; @@ -38,6 +41,7 @@ final class ChangeAttributeOrderByNameChangeBuilder implements Builder /** *

    Update action for changeAttributeOrderByName on product types

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|array */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeAttributeOrderByNameChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeAttributeOrderByNameChangeModel.php index bb5548517e6..c35328bf1b6 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeAttributeOrderByNameChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeAttributeOrderByNameChangeModel.php @@ -22,21 +22,25 @@ final class ChangeAttributeOrderByNameChangeModel extends JsonObjectModel implem public const DISCRIMINATOR_VALUE = 'ChangeAttributeOrderByNameChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?array */ protected $previousValue; /** + * * @var ?array */ protected $nextValue; @@ -48,15 +52,17 @@ final class ChangeAttributeOrderByNameChangeModel extends JsonObjectModel implem public function __construct( ?string $change = null, ?array $previousValue = null, - ?array $nextValue = null + ?array $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Update action for changeAttributeOrderByName on product types

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|array */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeBuilder.php index 3812548afc0..603b87b7f20 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeBuilder.php @@ -21,11 +21,13 @@ final class ChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @return null|string */ public function getChange() diff --git a/lib/commercetools-history/src/Models/Change/ChangeCartDiscountsChange.php b/lib/commercetools-history/src/Models/Change/ChangeCartDiscountsChange.php index 7f74d907b5b..98111db3699 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeCartDiscountsChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeCartDiscountsChange.php @@ -19,6 +19,7 @@ interface ChangeCartDiscountsChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for changeCartDiscounts

    * + * @return null|string */ public function getChange(); /** + * @return null|ReferenceCollection */ public function getPreviousValue(); /** + * @return null|ReferenceCollection */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeCartDiscountsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeCartDiscountsChangeBuilder.php index 484d020f33b..23eff50a238 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeCartDiscountsChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeCartDiscountsChangeBuilder.php @@ -22,16 +22,19 @@ final class ChangeCartDiscountsChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?ReferenceCollection */ private $previousValue; /** + * @var ?ReferenceCollection */ private $nextValue; @@ -39,6 +42,7 @@ final class ChangeCartDiscountsChangeBuilder implements Builder /** *

    Shape of the action for changeCartDiscounts

    * + * @return null|string */ public function getChange() @@ -47,6 +51,7 @@ public function getChange() } /** + * @return null|ReferenceCollection */ public function getPreviousValue() @@ -55,6 +60,7 @@ public function getPreviousValue() } /** + * @return null|ReferenceCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeCartDiscountsChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeCartDiscountsChangeModel.php index 8bc2153b7ed..d0e86bff588 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeCartDiscountsChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeCartDiscountsChangeModel.php @@ -23,21 +23,25 @@ final class ChangeCartDiscountsChangeModel extends JsonObjectModel implements Ch public const DISCRIMINATOR_VALUE = 'ChangeCartDiscountsChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ReferenceCollection */ protected $previousValue; /** + * * @var ?ReferenceCollection */ protected $nextValue; @@ -49,15 +53,17 @@ final class ChangeCartDiscountsChangeModel extends JsonObjectModel implements Ch public function __construct( ?string $change = null, ?ReferenceCollection $previousValue = null, - ?ReferenceCollection $nextValue = null + ?ReferenceCollection $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -77,6 +83,7 @@ public function getType() /** *

    Shape of the action for changeCartDiscounts

    * + * * @return null|string */ public function getChange() @@ -94,6 +101,7 @@ public function getChange() } /** + * * @return null|ReferenceCollection */ public function getPreviousValue() @@ -111,6 +119,7 @@ public function getPreviousValue() } /** + * * @return null|ReferenceCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeCartPredicateChange.php b/lib/commercetools-history/src/Models/Change/ChangeCartPredicateChange.php index fd7fc992de5..ac5fca53975 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeCartPredicateChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeCartPredicateChange.php @@ -18,6 +18,7 @@ interface ChangeCartPredicateChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for changeCartPredicate

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeCartPredicateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeCartPredicateChangeBuilder.php index 19d78f42778..dcb4b04855d 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeCartPredicateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeCartPredicateChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeCartPredicateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class ChangeCartPredicateChangeBuilder implements Builder /** *

    Shape of the action for changeCartPredicate

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeCartPredicateChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeCartPredicateChangeModel.php index 252dfb4b0ba..f1582477591 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeCartPredicateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeCartPredicateChangeModel.php @@ -22,21 +22,25 @@ final class ChangeCartPredicateChangeModel extends JsonObjectModel implements Ch public const DISCRIMINATOR_VALUE = 'ChangeCartPredicateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class ChangeCartPredicateChangeModel extends JsonObjectModel implements Ch public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for changeCartPredicate

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeCustomLineItemQuantityChange.php b/lib/commercetools-history/src/Models/Change/ChangeCustomLineItemQuantityChange.php index 0e48f3efa22..b8b5eeaae18 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeCustomLineItemQuantityChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeCustomLineItemQuantityChange.php @@ -21,6 +21,7 @@ interface ChangeCustomLineItemQuantityChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -28,26 +29,31 @@ public function getType(); /** *

    Update action for changeCustomLineItemQuantity

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getCustomLineItem(); /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|int */ public function getNextValue(); /** + * @return null|int */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeCustomLineItemQuantityChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeCustomLineItemQuantityChangeBuilder.php index 9d6e8880b0d..ddc9c6b1ff8 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeCustomLineItemQuantityChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeCustomLineItemQuantityChangeBuilder.php @@ -23,26 +23,31 @@ final class ChangeCustomLineItemQuantityChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $customLineItem; /** + * @var ?string */ private $customLineItemId; /** + * @var ?int */ private $nextValue; /** + * @var ?int */ private $previousValue; @@ -50,6 +55,7 @@ final class ChangeCustomLineItemQuantityChangeBuilder implements Builder /** *

    Update action for changeCustomLineItemQuantity

    * + * @return null|string */ public function getChange() @@ -58,6 +64,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getCustomLineItem() @@ -66,6 +73,7 @@ public function getCustomLineItem() } /** + * @return null|string */ public function getCustomLineItemId() @@ -74,6 +82,7 @@ public function getCustomLineItemId() } /** + * @return null|int */ public function getNextValue() @@ -82,6 +91,7 @@ public function getNextValue() } /** + * @return null|int */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeCustomLineItemQuantityChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeCustomLineItemQuantityChangeModel.php index 193f27cf2ff..4d91a0480b9 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeCustomLineItemQuantityChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeCustomLineItemQuantityChangeModel.php @@ -24,31 +24,37 @@ final class ChangeCustomLineItemQuantityChangeModel extends JsonObjectModel impl public const DISCRIMINATOR_VALUE = 'ChangeCustomLineItemQuantityChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $customLineItem; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?int */ protected $nextValue; /** + * * @var ?int */ protected $previousValue; @@ -62,17 +68,19 @@ public function __construct( ?LocalizedString $customLineItem = null, ?string $customLineItemId = null, ?int $nextValue = null, - ?int $previousValue = null + ?int $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->customLineItem = $customLineItem; $this->customLineItemId = $customLineItemId; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -92,6 +100,7 @@ public function getType() /** *

    Update action for changeCustomLineItemQuantity

    * + * * @return null|string */ public function getChange() @@ -109,6 +118,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getCustomLineItem() @@ -127,6 +137,7 @@ public function getCustomLineItem() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -144,6 +155,7 @@ public function getCustomLineItemId() } /** + * * @return null|int */ public function getNextValue() @@ -161,6 +173,7 @@ public function getNextValue() } /** + * * @return null|int */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeDescriptionChange.php b/lib/commercetools-history/src/Models/Change/ChangeDescriptionChange.php index 36393f2d640..a5ee75f0d3f 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeDescriptionChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeDescriptionChange.php @@ -18,6 +18,7 @@ interface ChangeDescriptionChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for changeDescription

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeDescriptionChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeDescriptionChangeBuilder.php index 890451b0ff3..a0ccdd78026 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeDescriptionChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeDescriptionChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeDescriptionChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class ChangeDescriptionChangeBuilder implements Builder /** *

    Shape of the action for changeDescription

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeDescriptionChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeDescriptionChangeModel.php index 6e570ff2c4f..809c457b5b9 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeDescriptionChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeDescriptionChangeModel.php @@ -22,21 +22,25 @@ final class ChangeDescriptionChangeModel extends JsonObjectModel implements Chan public const DISCRIMINATOR_VALUE = 'ChangeDescriptionChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class ChangeDescriptionChangeModel extends JsonObjectModel implements Chan public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for changeDescription

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeEmailChange.php b/lib/commercetools-history/src/Models/Change/ChangeEmailChange.php index 8746174be3e..565cb84242a 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeEmailChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeEmailChange.php @@ -18,6 +18,7 @@ interface ChangeEmailChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for changeEmail

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeEmailChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeEmailChangeBuilder.php index ef08b4c8aee..4ad68903eb9 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeEmailChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeEmailChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeEmailChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class ChangeEmailChangeBuilder implements Builder /** *

    Shape of the action for changeEmail

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeEmailChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeEmailChangeModel.php index f7d465d427f..23dad660fea 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeEmailChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeEmailChangeModel.php @@ -22,21 +22,25 @@ final class ChangeEmailChangeModel extends JsonObjectModel implements ChangeEmai public const DISCRIMINATOR_VALUE = 'ChangeEmailChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class ChangeEmailChangeModel extends JsonObjectModel implements ChangeEmai public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for changeEmail

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeEnumValueLabelChange.php b/lib/commercetools-history/src/Models/Change/ChangeEnumValueLabelChange.php index b730058bcb3..2063c506abc 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeEnumValueLabelChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeEnumValueLabelChange.php @@ -20,6 +20,7 @@ interface ChangeEnumValueLabelChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -27,6 +28,7 @@ public function getType(); /** *

    Update action for changeEnumValueLabel on types

    * + * @return null|string */ public function getChange(); @@ -34,6 +36,7 @@ public function getChange(); /** *

    The name of the field definition updated.

    * + * @return null|string */ public function getFieldName(); @@ -41,16 +44,19 @@ public function getFieldName(); /** *

    Key of the values that was updated

    * + * @return null|string */ public function getValueKey(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeEnumValueLabelChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeEnumValueLabelChangeBuilder.php index 50d0644fbb3..a4cec63deb3 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeEnumValueLabelChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeEnumValueLabelChangeBuilder.php @@ -21,26 +21,31 @@ final class ChangeEnumValueLabelChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $fieldName; /** + * @var ?string */ private $valueKey; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -48,6 +53,7 @@ final class ChangeEnumValueLabelChangeBuilder implements Builder /** *

    Update action for changeEnumValueLabel on types

    * + * @return null|string */ public function getChange() @@ -58,6 +64,7 @@ public function getChange() /** *

    The name of the field definition updated.

    * + * @return null|string */ public function getFieldName() @@ -68,6 +75,7 @@ public function getFieldName() /** *

    Key of the values that was updated

    * + * @return null|string */ public function getValueKey() @@ -76,6 +84,7 @@ public function getValueKey() } /** + * @return null|string */ public function getPreviousValue() @@ -84,6 +93,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeEnumValueLabelChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeEnumValueLabelChangeModel.php index bced554e6da..b707c8dd6a9 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeEnumValueLabelChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeEnumValueLabelChangeModel.php @@ -22,31 +22,37 @@ final class ChangeEnumValueLabelChangeModel extends JsonObjectModel implements C public const DISCRIMINATOR_VALUE = 'ChangeEnumValueLabelChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $fieldName; /** + * * @var ?string */ protected $valueKey; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -60,17 +66,19 @@ public function __construct( ?string $fieldName = null, ?string $valueKey = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->fieldName = $fieldName; $this->valueKey = $valueKey; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -90,6 +98,7 @@ public function getType() /** *

    Update action for changeEnumValueLabel on types

    * + * * @return null|string */ public function getChange() @@ -109,6 +118,7 @@ public function getChange() /** *

    The name of the field definition updated.

    * + * * @return null|string */ public function getFieldName() @@ -128,6 +138,7 @@ public function getFieldName() /** *

    Key of the values that was updated

    * + * * @return null|string */ public function getValueKey() @@ -145,6 +156,7 @@ public function getValueKey() } /** + * * @return null|string */ public function getPreviousValue() @@ -162,6 +174,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeEnumValueOrderChange.php b/lib/commercetools-history/src/Models/Change/ChangeEnumValueOrderChange.php index 73963029458..ff788a687de 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeEnumValueOrderChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeEnumValueOrderChange.php @@ -20,6 +20,7 @@ interface ChangeEnumValueOrderChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -27,6 +28,7 @@ public function getType(); /** *

    Update action for changeEnumValueOrder on types

    * + * @return null|string */ public function getChange(); @@ -34,16 +36,19 @@ public function getChange(); /** *

    The name of the field/attribute definition updated.

    * + * @return null|string */ public function getFieldName(); /** + * @return null|EnumValueCollection */ public function getNextValue(); /** + * @return null|EnumValueCollection */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeEnumValueOrderChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeEnumValueOrderChangeBuilder.php index eddbb751e0b..fc7804fd9a5 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeEnumValueOrderChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeEnumValueOrderChangeBuilder.php @@ -22,21 +22,25 @@ final class ChangeEnumValueOrderChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $fieldName; /** + * @var ?EnumValueCollection */ private $nextValue; /** + * @var ?EnumValueCollection */ private $previousValue; @@ -44,6 +48,7 @@ final class ChangeEnumValueOrderChangeBuilder implements Builder /** *

    Update action for changeEnumValueOrder on types

    * + * @return null|string */ public function getChange() @@ -54,6 +59,7 @@ public function getChange() /** *

    The name of the field/attribute definition updated.

    * + * @return null|string */ public function getFieldName() @@ -62,6 +68,7 @@ public function getFieldName() } /** + * @return null|EnumValueCollection */ public function getNextValue() @@ -70,6 +77,7 @@ public function getNextValue() } /** + * @return null|EnumValueCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeEnumValueOrderChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeEnumValueOrderChangeModel.php index 0a2709952ff..5e3a892dcf7 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeEnumValueOrderChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeEnumValueOrderChangeModel.php @@ -23,26 +23,31 @@ final class ChangeEnumValueOrderChangeModel extends JsonObjectModel implements C public const DISCRIMINATOR_VALUE = 'ChangeEnumValueOrderChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $fieldName; /** + * * @var ?EnumValueCollection */ protected $nextValue; /** + * * @var ?EnumValueCollection */ protected $previousValue; @@ -55,16 +60,18 @@ public function __construct( ?string $change = null, ?string $fieldName = null, ?EnumValueCollection $nextValue = null, - ?EnumValueCollection $previousValue = null + ?EnumValueCollection $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->fieldName = $fieldName; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -84,6 +91,7 @@ public function getType() /** *

    Update action for changeEnumValueOrder on types

    * + * * @return null|string */ public function getChange() @@ -103,6 +111,7 @@ public function getChange() /** *

    The name of the field/attribute definition updated.

    * + * * @return null|string */ public function getFieldName() @@ -120,6 +129,7 @@ public function getFieldName() } /** + * * @return null|EnumValueCollection */ public function getNextValue() @@ -137,6 +147,7 @@ public function getNextValue() } /** + * * @return null|EnumValueCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeFieldDefinitionOrderChange.php b/lib/commercetools-history/src/Models/Change/ChangeFieldDefinitionOrderChange.php index c68e11b0220..68a9cd8e52c 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeFieldDefinitionOrderChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeFieldDefinitionOrderChange.php @@ -19,6 +19,7 @@ interface ChangeFieldDefinitionOrderChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for changeFieldDefinitionOrder on types

    * + * @return null|string */ public function getChange(); /** + * @return null|FieldDefinitionOrderValueCollection */ public function getPreviousValue(); /** + * @return null|FieldDefinitionOrderValueCollection */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeFieldDefinitionOrderChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeFieldDefinitionOrderChangeBuilder.php index 969247b99e9..e2c472b856a 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeFieldDefinitionOrderChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeFieldDefinitionOrderChangeBuilder.php @@ -22,16 +22,19 @@ final class ChangeFieldDefinitionOrderChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?FieldDefinitionOrderValueCollection */ private $previousValue; /** + * @var ?FieldDefinitionOrderValueCollection */ private $nextValue; @@ -39,6 +42,7 @@ final class ChangeFieldDefinitionOrderChangeBuilder implements Builder /** *

    Update action for changeFieldDefinitionOrder on types

    * + * @return null|string */ public function getChange() @@ -47,6 +51,7 @@ public function getChange() } /** + * @return null|FieldDefinitionOrderValueCollection */ public function getPreviousValue() @@ -55,6 +60,7 @@ public function getPreviousValue() } /** + * @return null|FieldDefinitionOrderValueCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeFieldDefinitionOrderChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeFieldDefinitionOrderChangeModel.php index 1a11655be5c..7bd9a94673b 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeFieldDefinitionOrderChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeFieldDefinitionOrderChangeModel.php @@ -23,21 +23,25 @@ final class ChangeFieldDefinitionOrderChangeModel extends JsonObjectModel implem public const DISCRIMINATOR_VALUE = 'ChangeFieldDefinitionOrderChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?FieldDefinitionOrderValueCollection */ protected $previousValue; /** + * * @var ?FieldDefinitionOrderValueCollection */ protected $nextValue; @@ -49,15 +53,17 @@ final class ChangeFieldDefinitionOrderChangeModel extends JsonObjectModel implem public function __construct( ?string $change = null, ?FieldDefinitionOrderValueCollection $previousValue = null, - ?FieldDefinitionOrderValueCollection $nextValue = null + ?FieldDefinitionOrderValueCollection $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -77,6 +83,7 @@ public function getType() /** *

    Update action for changeFieldDefinitionOrder on types

    * + * * @return null|string */ public function getChange() @@ -94,6 +101,7 @@ public function getChange() } /** + * * @return null|FieldDefinitionOrderValueCollection */ public function getPreviousValue() @@ -111,6 +119,7 @@ public function getPreviousValue() } /** + * * @return null|FieldDefinitionOrderValueCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeGroupsChange.php b/lib/commercetools-history/src/Models/Change/ChangeGroupsChange.php index ae872c7cb07..9994b291c84 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeGroupsChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeGroupsChange.php @@ -18,6 +18,7 @@ interface ChangeGroupsChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Update action for changeGroups on stores

    * + * @return null|string */ public function getChange(); /** + * @return null|array */ public function getPreviousValue(); /** + * @return null|array */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeGroupsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeGroupsChangeBuilder.php index 8123b1b830c..01e4bd70d9e 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeGroupsChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeGroupsChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeGroupsChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?array */ private $previousValue; /** + * @var ?array */ private $nextValue; @@ -38,6 +41,7 @@ final class ChangeGroupsChangeBuilder implements Builder /** *

    Update action for changeGroups on stores

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|array */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeGroupsChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeGroupsChangeModel.php index c6d6fb94bfe..368c164962e 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeGroupsChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeGroupsChangeModel.php @@ -22,21 +22,25 @@ final class ChangeGroupsChangeModel extends JsonObjectModel implements ChangeGro public const DISCRIMINATOR_VALUE = 'ChangeGroupsChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?array */ protected $previousValue; /** + * * @var ?array */ protected $nextValue; @@ -48,15 +52,17 @@ final class ChangeGroupsChangeModel extends JsonObjectModel implements ChangeGro public function __construct( ?string $change = null, ?array $previousValue = null, - ?array $nextValue = null + ?array $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Update action for changeGroups on stores

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|array */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeInitialChange.php b/lib/commercetools-history/src/Models/Change/ChangeInitialChange.php index 0d595e9954e..12082442d89 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeInitialChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeInitialChange.php @@ -18,6 +18,7 @@ interface ChangeInitialChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for changeInitial

    * + * @return null|string */ public function getChange(); /** + * @return null|bool */ public function getPreviousValue(); /** + * @return null|bool */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeInitialChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeInitialChangeBuilder.php index abcdb390016..5d871aefaf8 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeInitialChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeInitialChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeInitialChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?bool */ private $previousValue; /** + * @var ?bool */ private $nextValue; @@ -38,6 +41,7 @@ final class ChangeInitialChangeBuilder implements Builder /** *

    Shape of the action for changeInitial

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|bool */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|bool */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeInitialChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeInitialChangeModel.php index 8d81f9bfaaa..98508c36cf9 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeInitialChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeInitialChangeModel.php @@ -22,21 +22,25 @@ final class ChangeInitialChangeModel extends JsonObjectModel implements ChangeIn public const DISCRIMINATOR_VALUE = 'ChangeInitialChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?bool */ protected $previousValue; /** + * * @var ?bool */ protected $nextValue; @@ -48,15 +52,17 @@ final class ChangeInitialChangeModel extends JsonObjectModel implements ChangeIn public function __construct( ?string $change = null, ?bool $previousValue = null, - ?bool $nextValue = null + ?bool $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for changeInitial

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|bool */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|bool */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeInputHintChange.php b/lib/commercetools-history/src/Models/Change/ChangeInputHintChange.php index 2db58d41961..08609946f39 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeInputHintChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeInputHintChange.php @@ -20,6 +20,7 @@ interface ChangeInputHintChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -27,6 +28,7 @@ public function getType(); /** *

    Update action for changeInputHint on product types and types

    * + * @return null|string */ public function getChange(); @@ -34,6 +36,7 @@ public function getChange(); /** *

    The name of the field definition updated.

    * + * @return null|string */ public function getFieldName(); @@ -41,16 +44,19 @@ public function getFieldName(); /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName(); /** + * @return null|string */ public function getNextValue(); /** + * @return null|string */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeInputHintChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeInputHintChangeBuilder.php index be31d425214..c26dde83457 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeInputHintChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeInputHintChangeBuilder.php @@ -21,26 +21,31 @@ final class ChangeInputHintChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $fieldName; /** + * @var ?string */ private $attributeName; /** + * @var ?string */ private $nextValue; /** + * @var ?string */ private $previousValue; @@ -48,6 +53,7 @@ final class ChangeInputHintChangeBuilder implements Builder /** *

    Update action for changeInputHint on product types and types

    * + * @return null|string */ public function getChange() @@ -58,6 +64,7 @@ public function getChange() /** *

    The name of the field definition updated.

    * + * @return null|string */ public function getFieldName() @@ -68,6 +75,7 @@ public function getFieldName() /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName() @@ -76,6 +84,7 @@ public function getAttributeName() } /** + * @return null|string */ public function getNextValue() @@ -84,6 +93,7 @@ public function getNextValue() } /** + * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeInputHintChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeInputHintChangeModel.php index b1a3632d918..dd9b22786c7 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeInputHintChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeInputHintChangeModel.php @@ -22,31 +22,37 @@ final class ChangeInputHintChangeModel extends JsonObjectModel implements Change public const DISCRIMINATOR_VALUE = 'ChangeInputHintChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $fieldName; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?string */ protected $nextValue; /** + * * @var ?string */ protected $previousValue; @@ -60,17 +66,19 @@ public function __construct( ?string $fieldName = null, ?string $attributeName = null, ?string $nextValue = null, - ?string $previousValue = null + ?string $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->fieldName = $fieldName; $this->attributeName = $attributeName; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -90,6 +98,7 @@ public function getType() /** *

    Update action for changeInputHint on product types and types

    * + * * @return null|string */ public function getChange() @@ -109,6 +118,7 @@ public function getChange() /** *

    The name of the field definition updated.

    * + * * @return null|string */ public function getFieldName() @@ -128,6 +138,7 @@ public function getFieldName() /** *

    The name of the attribute updated.

    * + * * @return null|string */ public function getAttributeName() @@ -145,6 +156,7 @@ public function getAttributeName() } /** + * * @return null|string */ public function getNextValue() @@ -162,6 +174,7 @@ public function getNextValue() } /** + * * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeIsActiveChange.php b/lib/commercetools-history/src/Models/Change/ChangeIsActiveChange.php index 4d9a37bd8b2..ed52c6fc612 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeIsActiveChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeIsActiveChange.php @@ -18,6 +18,7 @@ interface ChangeIsActiveChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for changeIsActive

    * + * @return null|string */ public function getChange(); /** + * @return null|bool */ public function getPreviousValue(); /** + * @return null|bool */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeIsActiveChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeIsActiveChangeBuilder.php index 40f67e00743..23b70e032da 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeIsActiveChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeIsActiveChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeIsActiveChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?bool */ private $previousValue; /** + * @var ?bool */ private $nextValue; @@ -38,6 +41,7 @@ final class ChangeIsActiveChangeBuilder implements Builder /** *

    Shape of the action for changeIsActive

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|bool */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|bool */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeIsActiveChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeIsActiveChangeModel.php index 90a90632358..94a4b64b43d 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeIsActiveChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeIsActiveChangeModel.php @@ -22,21 +22,25 @@ final class ChangeIsActiveChangeModel extends JsonObjectModel implements ChangeI public const DISCRIMINATOR_VALUE = 'ChangeIsActiveChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?bool */ protected $previousValue; /** + * * @var ?bool */ protected $nextValue; @@ -48,15 +52,17 @@ final class ChangeIsActiveChangeModel extends JsonObjectModel implements ChangeI public function __construct( ?string $change = null, ?bool $previousValue = null, - ?bool $nextValue = null + ?bool $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for changeIsActive

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|bool */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|bool */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeIsSearchableChange.php b/lib/commercetools-history/src/Models/Change/ChangeIsSearchableChange.php index 974ef5556e1..1544cb5b97d 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeIsSearchableChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeIsSearchableChange.php @@ -19,6 +19,7 @@ interface ChangeIsSearchableChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,6 +27,7 @@ public function getType(); /** *

    Update action for changeIsSearchable on product types

    * + * @return null|string */ public function getChange(); @@ -33,16 +35,19 @@ public function getChange(); /** *

    The name of the updated attribute.

    * + * @return null|string */ public function getAttributeName(); /** + * @return null|bool */ public function getNextValue(); /** + * @return null|bool */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeIsSearchableChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeIsSearchableChangeBuilder.php index f5617723a57..d4da7b08e3a 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeIsSearchableChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeIsSearchableChangeBuilder.php @@ -21,21 +21,25 @@ final class ChangeIsSearchableChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $attributeName; /** + * @var ?bool */ private $nextValue; /** + * @var ?bool */ private $previousValue; @@ -43,6 +47,7 @@ final class ChangeIsSearchableChangeBuilder implements Builder /** *

    Update action for changeIsSearchable on product types

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() /** *

    The name of the updated attribute.

    * + * @return null|string */ public function getAttributeName() @@ -61,6 +67,7 @@ public function getAttributeName() } /** + * @return null|bool */ public function getNextValue() @@ -69,6 +76,7 @@ public function getNextValue() } /** + * @return null|bool */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeIsSearchableChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeIsSearchableChangeModel.php index 6b595177f9e..62a8ad7f36e 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeIsSearchableChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeIsSearchableChangeModel.php @@ -22,26 +22,31 @@ final class ChangeIsSearchableChangeModel extends JsonObjectModel implements Cha public const DISCRIMINATOR_VALUE = 'ChangeIsSearchableChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?bool */ protected $nextValue; /** + * * @var ?bool */ protected $previousValue; @@ -54,16 +59,18 @@ public function __construct( ?string $change = null, ?string $attributeName = null, ?bool $nextValue = null, - ?bool $previousValue = null + ?bool $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->attributeName = $attributeName; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -83,6 +90,7 @@ public function getType() /** *

    Update action for changeIsSearchable on product types

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() /** *

    The name of the updated attribute.

    * + * * @return null|string */ public function getAttributeName() @@ -119,6 +128,7 @@ public function getAttributeName() } /** + * * @return null|bool */ public function getNextValue() @@ -136,6 +146,7 @@ public function getNextValue() } /** + * * @return null|bool */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeKeyChange.php b/lib/commercetools-history/src/Models/Change/ChangeKeyChange.php index 62fad563f81..2a94c00ee03 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeKeyChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeKeyChange.php @@ -18,6 +18,7 @@ interface ChangeKeyChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for changeKey

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeKeyChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeKeyChangeBuilder.php index 5a706a8d8ed..9159687c5ce 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeKeyChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeKeyChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeKeyChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class ChangeKeyChangeBuilder implements Builder /** *

    Shape of the action for changeKey

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeKeyChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeKeyChangeModel.php index bb10ae3979b..e80a2996993 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeKeyChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeKeyChangeModel.php @@ -22,21 +22,25 @@ final class ChangeKeyChangeModel extends JsonObjectModel implements ChangeKeyCha public const DISCRIMINATOR_VALUE = 'ChangeKeyChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class ChangeKeyChangeModel extends JsonObjectModel implements ChangeKeyCha public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for changeKey

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeLabelChange.php b/lib/commercetools-history/src/Models/Change/ChangeLabelChange.php index 42b2f689df2..406c0b87eeb 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLabelChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLabelChange.php @@ -21,6 +21,7 @@ interface ChangeLabelChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -28,6 +29,7 @@ public function getType(); /** *

    Update action for changeLabel on product types and types

    * + * @return null|string */ public function getChange(); @@ -35,6 +37,7 @@ public function getChange(); /** *

    The name of the field definition to update (types).

    * + * @return null|string */ public function getFieldName(); @@ -42,16 +45,19 @@ public function getFieldName(); /** *

    The name of the attribute definition to update (product-type).

    * + * @return null|string */ public function getAttributeName(); /** + * @return null|LocalizedString */ public function getNextValue(); /** + * @return null|LocalizedString */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeLabelChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeLabelChangeBuilder.php index 218d3b8d595..c296046b17e 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLabelChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLabelChangeBuilder.php @@ -23,26 +23,31 @@ final class ChangeLabelChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $fieldName; /** + * @var ?string */ private $attributeName; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; @@ -50,6 +55,7 @@ final class ChangeLabelChangeBuilder implements Builder /** *

    Update action for changeLabel on product types and types

    * + * @return null|string */ public function getChange() @@ -60,6 +66,7 @@ public function getChange() /** *

    The name of the field definition to update (types).

    * + * @return null|string */ public function getFieldName() @@ -70,6 +77,7 @@ public function getFieldName() /** *

    The name of the attribute definition to update (product-type).

    * + * @return null|string */ public function getAttributeName() @@ -78,6 +86,7 @@ public function getAttributeName() } /** + * @return null|LocalizedString */ public function getNextValue() @@ -86,6 +95,7 @@ public function getNextValue() } /** + * @return null|LocalizedString */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeLabelChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeLabelChangeModel.php index 6a99e0e2b10..b1a03859cd6 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLabelChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLabelChangeModel.php @@ -24,31 +24,37 @@ final class ChangeLabelChangeModel extends JsonObjectModel implements ChangeLabe public const DISCRIMINATOR_VALUE = 'ChangeLabelChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $fieldName; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?LocalizedString */ protected $nextValue; /** + * * @var ?LocalizedString */ protected $previousValue; @@ -62,17 +68,19 @@ public function __construct( ?string $fieldName = null, ?string $attributeName = null, ?LocalizedString $nextValue = null, - ?LocalizedString $previousValue = null + ?LocalizedString $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->fieldName = $fieldName; $this->attributeName = $attributeName; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -92,6 +100,7 @@ public function getType() /** *

    Update action for changeLabel on product types and types

    * + * * @return null|string */ public function getChange() @@ -111,6 +120,7 @@ public function getChange() /** *

    The name of the field definition to update (types).

    * + * * @return null|string */ public function getFieldName() @@ -130,6 +140,7 @@ public function getFieldName() /** *

    The name of the attribute definition to update (product-type).

    * + * * @return null|string */ public function getAttributeName() @@ -147,6 +158,7 @@ public function getAttributeName() } /** + * * @return null|LocalizedString */ public function getNextValue() @@ -165,6 +177,7 @@ public function getNextValue() } /** + * * @return null|LocalizedString */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeLineItemQuantityChange.php b/lib/commercetools-history/src/Models/Change/ChangeLineItemQuantityChange.php index 49485a0c36d..de9294a3884 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLineItemQuantityChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLineItemQuantityChange.php @@ -21,6 +21,7 @@ interface ChangeLineItemQuantityChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -28,16 +29,19 @@ public function getType(); /** *

    Update action for changeLineItemQuantity

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getLineItem(); /** + * @return null|string */ public function getLineItemId(); @@ -45,6 +49,7 @@ public function getLineItemId(); /** *

    The amount of a LineItem in the cart. Must be a positive integer.

    * + * @return null|int */ public function getNextValue(); @@ -52,6 +57,7 @@ public function getNextValue(); /** *

    The amount of a LineItem in the cart. Must be a positive integer.

    * + * @return null|int */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeLineItemQuantityChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeLineItemQuantityChangeBuilder.php index 2b0ae03ea1e..beb3fc3e677 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLineItemQuantityChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLineItemQuantityChangeBuilder.php @@ -23,26 +23,31 @@ final class ChangeLineItemQuantityChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $lineItem; /** + * @var ?string */ private $lineItemId; /** + * @var ?int */ private $nextValue; /** + * @var ?int */ private $previousValue; @@ -50,6 +55,7 @@ final class ChangeLineItemQuantityChangeBuilder implements Builder /** *

    Update action for changeLineItemQuantity

    * + * @return null|string */ public function getChange() @@ -58,6 +64,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getLineItem() @@ -66,6 +73,7 @@ public function getLineItem() } /** + * @return null|string */ public function getLineItemId() @@ -76,6 +84,7 @@ public function getLineItemId() /** *

    The amount of a LineItem in the cart. Must be a positive integer.

    * + * @return null|int */ public function getNextValue() @@ -86,6 +95,7 @@ public function getNextValue() /** *

    The amount of a LineItem in the cart. Must be a positive integer.

    * + * @return null|int */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeLineItemQuantityChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeLineItemQuantityChangeModel.php index 9ded78d65e8..0c44e9d8c9f 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLineItemQuantityChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLineItemQuantityChangeModel.php @@ -24,31 +24,37 @@ final class ChangeLineItemQuantityChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'ChangeLineItemQuantityChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $lineItem; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?int */ protected $nextValue; /** + * * @var ?int */ protected $previousValue; @@ -62,17 +68,19 @@ public function __construct( ?LocalizedString $lineItem = null, ?string $lineItemId = null, ?int $nextValue = null, - ?int $previousValue = null + ?int $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->lineItem = $lineItem; $this->lineItemId = $lineItemId; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -92,6 +100,7 @@ public function getType() /** *

    Update action for changeLineItemQuantity

    * + * * @return null|string */ public function getChange() @@ -109,6 +118,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getLineItem() @@ -127,6 +137,7 @@ public function getLineItem() } /** + * * @return null|string */ public function getLineItemId() @@ -146,6 +157,7 @@ public function getLineItemId() /** *

    The amount of a LineItem in the cart. Must be a positive integer.

    * + * * @return null|int */ public function getNextValue() @@ -165,6 +177,7 @@ public function getNextValue() /** *

    The amount of a LineItem in the cart. Must be a positive integer.

    * + * * @return null|int */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeLocalizedDescriptionChange.php b/lib/commercetools-history/src/Models/Change/ChangeLocalizedDescriptionChange.php index 58c43c1a55d..1981eb77b90 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLocalizedDescriptionChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLocalizedDescriptionChange.php @@ -19,6 +19,7 @@ interface ChangeLocalizedDescriptionChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for changeDescription

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getPreviousValue(); /** + * @return null|LocalizedString */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeLocalizedDescriptionChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeLocalizedDescriptionChangeBuilder.php index 8a471eeb264..3bb549f8d57 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLocalizedDescriptionChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLocalizedDescriptionChangeBuilder.php @@ -23,16 +23,19 @@ final class ChangeLocalizedDescriptionChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class ChangeLocalizedDescriptionChangeBuilder implements Builder /** *

    Shape of the action for changeDescription

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeLocalizedDescriptionChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeLocalizedDescriptionChangeModel.php index d53ae3539b3..284ce9fd62c 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLocalizedDescriptionChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLocalizedDescriptionChangeModel.php @@ -24,21 +24,25 @@ final class ChangeLocalizedDescriptionChangeModel extends JsonObjectModel implem public const DISCRIMINATOR_VALUE = 'ChangeLocalizedDescriptionChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $previousValue; /** + * * @var ?LocalizedString */ protected $nextValue; @@ -50,15 +54,17 @@ final class ChangeLocalizedDescriptionChangeModel extends JsonObjectModel implem public function __construct( ?string $change = null, ?LocalizedString $previousValue = null, - ?LocalizedString $nextValue = null + ?LocalizedString $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for changeDescription

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueLabelChange.php b/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueLabelChange.php index 8c30c400542..30700eb5711 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueLabelChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueLabelChange.php @@ -22,6 +22,7 @@ interface ChangeLocalizedEnumValueLabelChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -29,6 +30,7 @@ public function getType(); /** *

    Update action for changeLocalizedEnumValueLabel on types

    * + * @return null|string */ public function getChange(); @@ -36,6 +38,7 @@ public function getChange(); /** *

    The name of the field definition updated.

    * + * @return null|string */ public function getFieldName(); @@ -43,6 +46,7 @@ public function getFieldName(); /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName(); @@ -50,16 +54,19 @@ public function getAttributeName(); /** *

    Key of the values that was updated

    * + * @return null|string */ public function getValueKey(); /** + * @return null|LocalizedString */ public function getPreviousValue(); /** + * @return null|LocalizedString */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueLabelChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueLabelChangeBuilder.php index 4ec0d72b97d..31d3deb6620 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueLabelChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueLabelChangeBuilder.php @@ -23,31 +23,37 @@ final class ChangeLocalizedEnumValueLabelChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $fieldName; /** + * @var ?string */ private $attributeName; /** + * @var ?string */ private $valueKey; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; @@ -55,6 +61,7 @@ final class ChangeLocalizedEnumValueLabelChangeBuilder implements Builder /** *

    Update action for changeLocalizedEnumValueLabel on types

    * + * @return null|string */ public function getChange() @@ -65,6 +72,7 @@ public function getChange() /** *

    The name of the field definition updated.

    * + * @return null|string */ public function getFieldName() @@ -75,6 +83,7 @@ public function getFieldName() /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName() @@ -85,6 +94,7 @@ public function getAttributeName() /** *

    Key of the values that was updated

    * + * @return null|string */ public function getValueKey() @@ -93,6 +103,7 @@ public function getValueKey() } /** + * @return null|LocalizedString */ public function getPreviousValue() @@ -101,6 +112,7 @@ public function getPreviousValue() } /** + * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueLabelChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueLabelChangeModel.php index cf431014eca..73c4ea984b8 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueLabelChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueLabelChangeModel.php @@ -24,36 +24,43 @@ final class ChangeLocalizedEnumValueLabelChangeModel extends JsonObjectModel imp public const DISCRIMINATOR_VALUE = 'ChangeLocalizedEnumValueLabelChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $fieldName; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?string */ protected $valueKey; /** + * * @var ?LocalizedString */ protected $previousValue; /** + * * @var ?LocalizedString */ protected $nextValue; @@ -68,7 +75,8 @@ public function __construct( ?string $attributeName = null, ?string $valueKey = null, ?LocalizedString $previousValue = null, - ?LocalizedString $nextValue = null + ?LocalizedString $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->fieldName = $fieldName; @@ -76,10 +84,11 @@ public function __construct( $this->valueKey = $valueKey; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -99,6 +108,7 @@ public function getType() /** *

    Update action for changeLocalizedEnumValueLabel on types

    * + * * @return null|string */ public function getChange() @@ -118,6 +128,7 @@ public function getChange() /** *

    The name of the field definition updated.

    * + * * @return null|string */ public function getFieldName() @@ -137,6 +148,7 @@ public function getFieldName() /** *

    The name of the attribute updated.

    * + * * @return null|string */ public function getAttributeName() @@ -156,6 +168,7 @@ public function getAttributeName() /** *

    Key of the values that was updated

    * + * * @return null|string */ public function getValueKey() @@ -173,6 +186,7 @@ public function getValueKey() } /** + * * @return null|LocalizedString */ public function getPreviousValue() @@ -191,6 +205,7 @@ public function getPreviousValue() } /** + * * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueOrderChange.php b/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueOrderChange.php index 78c6ad81156..66f6fc104ff 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueOrderChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueOrderChange.php @@ -21,6 +21,7 @@ interface ChangeLocalizedEnumValueOrderChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -28,6 +29,7 @@ public function getType(); /** *

    Update action for changeLocalizedEnumValueOrder on types and product types

    * + * @return null|string */ public function getChange(); @@ -35,6 +37,7 @@ public function getChange(); /** *

    The name of the field definition updated.

    * + * @return null|string */ public function getFieldName(); @@ -42,16 +45,19 @@ public function getFieldName(); /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName(); /** + * @return null|LocalizedEnumValueCollection */ public function getNextValue(); /** + * @return null|LocalizedEnumValueCollection */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueOrderChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueOrderChangeBuilder.php index bf16762be47..5dff37aeebb 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueOrderChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueOrderChangeBuilder.php @@ -22,26 +22,31 @@ final class ChangeLocalizedEnumValueOrderChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $fieldName; /** + * @var ?string */ private $attributeName; /** + * @var ?LocalizedEnumValueCollection */ private $nextValue; /** + * @var ?LocalizedEnumValueCollection */ private $previousValue; @@ -49,6 +54,7 @@ final class ChangeLocalizedEnumValueOrderChangeBuilder implements Builder /** *

    Update action for changeLocalizedEnumValueOrder on types and product types

    * + * @return null|string */ public function getChange() @@ -59,6 +65,7 @@ public function getChange() /** *

    The name of the field definition updated.

    * + * @return null|string */ public function getFieldName() @@ -69,6 +76,7 @@ public function getFieldName() /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName() @@ -77,6 +85,7 @@ public function getAttributeName() } /** + * @return null|LocalizedEnumValueCollection */ public function getNextValue() @@ -85,6 +94,7 @@ public function getNextValue() } /** + * @return null|LocalizedEnumValueCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueOrderChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueOrderChangeModel.php index 0347dc234e7..1861bc2b227 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueOrderChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLocalizedEnumValueOrderChangeModel.php @@ -23,31 +23,37 @@ final class ChangeLocalizedEnumValueOrderChangeModel extends JsonObjectModel imp public const DISCRIMINATOR_VALUE = 'ChangeLocalizedEnumValueOrderChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $fieldName; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?LocalizedEnumValueCollection */ protected $nextValue; /** + * * @var ?LocalizedEnumValueCollection */ protected $previousValue; @@ -61,17 +67,19 @@ public function __construct( ?string $fieldName = null, ?string $attributeName = null, ?LocalizedEnumValueCollection $nextValue = null, - ?LocalizedEnumValueCollection $previousValue = null + ?LocalizedEnumValueCollection $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->fieldName = $fieldName; $this->attributeName = $attributeName; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -91,6 +99,7 @@ public function getType() /** *

    Update action for changeLocalizedEnumValueOrder on types and product types

    * + * * @return null|string */ public function getChange() @@ -110,6 +119,7 @@ public function getChange() /** *

    The name of the field definition updated.

    * + * * @return null|string */ public function getFieldName() @@ -129,6 +139,7 @@ public function getFieldName() /** *

    The name of the attribute updated.

    * + * * @return null|string */ public function getAttributeName() @@ -146,6 +157,7 @@ public function getAttributeName() } /** + * * @return null|LocalizedEnumValueCollection */ public function getNextValue() @@ -163,6 +175,7 @@ public function getNextValue() } /** + * * @return null|LocalizedEnumValueCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeLocalizedNameChange.php b/lib/commercetools-history/src/Models/Change/ChangeLocalizedNameChange.php index c3802e97eac..b96066878da 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLocalizedNameChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLocalizedNameChange.php @@ -19,6 +19,7 @@ interface ChangeLocalizedNameChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for changeName

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getPreviousValue(); /** + * @return null|LocalizedString */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeLocalizedNameChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeLocalizedNameChangeBuilder.php index 388ebb8dbcc..3fb254b105e 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLocalizedNameChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLocalizedNameChangeBuilder.php @@ -23,16 +23,19 @@ final class ChangeLocalizedNameChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class ChangeLocalizedNameChangeBuilder implements Builder /** *

    Shape of the action for changeName

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeLocalizedNameChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeLocalizedNameChangeModel.php index 93244ceacba..60d9bb0d6d8 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeLocalizedNameChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeLocalizedNameChangeModel.php @@ -24,21 +24,25 @@ final class ChangeLocalizedNameChangeModel extends JsonObjectModel implements Ch public const DISCRIMINATOR_VALUE = 'ChangeLocalizedNameChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $previousValue; /** + * * @var ?LocalizedString */ protected $nextValue; @@ -50,15 +54,17 @@ final class ChangeLocalizedNameChangeModel extends JsonObjectModel implements Ch public function __construct( ?string $change = null, ?LocalizedString $previousValue = null, - ?LocalizedString $nextValue = null + ?LocalizedString $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for changeName

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeMasterVariantChange.php b/lib/commercetools-history/src/Models/Change/ChangeMasterVariantChange.php index 71e1558dfb7..3f130c5a865 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeMasterVariantChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeMasterVariantChange.php @@ -20,6 +20,7 @@ interface ChangeMasterVariantChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update action for changeMasterVariant

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|Variant */ public function getPreviousValue(); /** + * @return null|Variant */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeMasterVariantChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeMasterVariantChangeBuilder.php index a31d0866006..df529aa8889 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeMasterVariantChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeMasterVariantChangeBuilder.php @@ -23,21 +23,25 @@ final class ChangeMasterVariantChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var null|Variant|VariantBuilder */ private $previousValue; /** + * @var null|Variant|VariantBuilder */ private $nextValue; @@ -45,6 +49,7 @@ final class ChangeMasterVariantChangeBuilder implements Builder /** *

    Update action for changeMasterVariant

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -61,6 +67,7 @@ public function getCatalogData() } /** + * @return null|Variant */ public function getPreviousValue() @@ -69,6 +76,7 @@ public function getPreviousValue() } /** + * @return null|Variant */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeMasterVariantChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeMasterVariantChangeModel.php index 660e424464e..703643176a4 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeMasterVariantChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeMasterVariantChangeModel.php @@ -24,26 +24,31 @@ final class ChangeMasterVariantChangeModel extends JsonObjectModel implements Ch public const DISCRIMINATOR_VALUE = 'ChangeMasterVariantChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?Variant */ protected $previousValue; /** + * * @var ?Variant */ protected $nextValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $catalogData = null, ?Variant $previousValue = null, - ?Variant $nextValue = null + ?Variant $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for changeMasterVariant

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -119,6 +128,7 @@ public function getCatalogData() } /** + * * @return null|Variant */ public function getPreviousValue() @@ -137,6 +147,7 @@ public function getPreviousValue() } /** + * * @return null|Variant */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeModel.php index 795ebdfba0a..e1e0119e746 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeModel.php @@ -22,11 +22,13 @@ final class ChangeModel extends JsonObjectModel implements Change public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; @@ -56,6 +58,7 @@ final class ChangeModel extends JsonObjectModel implements Change 'AddPaymentChange' => AddPaymentChangeModel::class, 'AddPlainEnumValueChange' => AddPlainEnumValueChangeModel::class, 'AddPriceChange' => AddPriceChangeModel::class, + 'AddProductChange' => AddProductChangeModel::class, 'AddPropertyChange' => AddPropertyChangeModel::class, 'AddReturnInfoChange' => AddReturnInfoChangeModel::class, 'AddShippingAddressIdChange' => AddShippingAddressIdChangeModel::class, @@ -104,6 +107,8 @@ final class ChangeModel extends JsonObjectModel implements Change 'ChangePredicateChange' => ChangePredicateChangeModel::class, 'ChangePriceChange' => ChangePriceChangeModel::class, 'ChangeQuantityChange' => ChangeQuantityChangeModel::class, + 'ChangeQuoteRequestStateChange' => ChangeQuoteRequestStateChangeModel::class, + 'ChangeQuoteStateChange' => ChangeQuoteStateChangeModel::class, 'ChangeRequiresDiscountCodeChange' => ChangeRequiresDiscountCodeChangeModel::class, 'ChangeReviewRatingStatisticsChange' => ChangeReviewRatingStatisticsChangeModel::class, 'ChangeShipmentStateChange' => ChangeShipmentStateChangeModel::class, @@ -112,6 +117,7 @@ final class ChangeModel extends JsonObjectModel implements Change 'ChangeSlugChange' => ChangeSlugChangeModel::class, 'ChangeSortOrderChange' => ChangeSortOrderChangeModel::class, 'ChangeStackingModeChange' => ChangeStackingModeChangeModel::class, + 'ChangeStagedQuoteStateChange' => ChangeStagedQuoteStateChangeModel::class, 'ChangeStateTypeChange' => ChangeStateTypeChangeModel::class, 'ChangeTargetChange' => ChangeTargetChangeModel::class, 'ChangeTaxCalculationModeChange' => ChangeTaxCalculationModeChangeModel::class, @@ -145,6 +151,7 @@ final class ChangeModel extends JsonObjectModel implements Change 'RemoveParcelFromDeliveryChange' => RemoveParcelFromDeliveryChangeModel::class, 'RemovePaymentChange' => RemovePaymentChangeModel::class, 'RemovePriceChange' => RemovePriceChangeModel::class, + 'RemoveProductChange' => RemoveProductChangeModel::class, 'RemovePropertyChange' => RemovePropertyChangeModel::class, 'RemoveShippingAddressIdChange' => RemoveShippingAddressIdChangeModel::class, 'RemoveShoppingListLineItemChange' => RemoveShoppingListLineItemChangeModel::class, @@ -162,6 +169,7 @@ final class ChangeModel extends JsonObjectModel implements Change 'SetAssetSourcesChange' => SetAssetSourcesChangeModel::class, 'SetAssetTagsChange' => SetAssetTagsChangeModel::class, 'SetAttributeChange' => SetAttributeChangeModel::class, + 'SetAuthenticationModeChange' => SetAuthenticationModeChangeModel::class, 'SetAuthorNameChange' => SetAuthorNameChangeModel::class, 'SetBillingAddressChange' => SetBillingAddressChangeModel::class, 'SetCartPredicateChange' => SetCartPredicateChangeModel::class, @@ -206,10 +214,12 @@ final class ChangeModel extends JsonObjectModel implements Change 'SetKeyChange' => SetKeyChangeModel::class, 'SetLanguagesChange' => SetLanguagesChangeModel::class, 'SetLastNameChange' => SetLastNameChangeModel::class, + 'SetLineItemDeactivatedAtChange' => SetLineItemDeactivatedAtChangeModel::class, 'SetLineItemDiscountedPriceChange' => SetLineItemDiscountedPriceChangeModel::class, 'SetLineItemDiscountedPricePerQuantityChange' => SetLineItemDiscountedPricePerQuantityChangeModel::class, 'SetLineItemDistributionChannelChange' => SetLineItemDistributionChannelChangeModel::class, 'SetLineItemPriceChange' => SetLineItemPriceChangeModel::class, + 'SetLineItemProductKeyChange' => SetLineItemProductKeyChangeModel::class, 'SetLineItemProductSlugChange' => SetLineItemProductSlugChangeModel::class, 'SetLineItemShippingDetailsChange' => SetLineItemShippingDetailsChangeModel::class, 'SetLineItemTaxAmountChange' => SetLineItemTaxAmountChangeModel::class, @@ -238,8 +248,10 @@ final class ChangeModel extends JsonObjectModel implements Change 'SetParcelMeasurementsChange' => SetParcelMeasurementsChangeModel::class, 'SetParcelTrackingDataChange' => SetParcelTrackingDataChangeModel::class, 'SetPricesChange' => SetPricesChangeModel::class, + 'SetProductCountChange' => SetProductCountChangeModel::class, 'SetProductPriceCustomFieldChange' => SetProductPriceCustomFieldChangeModel::class, 'SetProductPriceCustomTypeChange' => SetProductPriceCustomTypeChangeModel::class, + 'SetProductSelectionsChange' => SetProductSelectionsChangeModel::class, 'SetProductVariantKeyChange' => SetProductVariantKeyChangeModel::class, 'SetPropertyChange' => SetPropertyChangeModel::class, 'SetRatingChange' => SetRatingChangeModel::class, @@ -249,6 +261,7 @@ final class ChangeModel extends JsonObjectModel implements Change 'SetReturnShipmentStateChange' => SetReturnShipmentStateChangeModel::class, 'SetSalutationChange' => SetSalutationChangeModel::class, 'SetSearchKeywordsChange' => SetSearchKeywordsChangeModel::class, + 'SetSellerCommentChange' => SetSellerCommentChangeModel::class, 'SetShippingAddressChange' => SetShippingAddressChangeModel::class, 'SetShippingInfoPriceChange' => SetShippingInfoPriceChangeModel::class, 'SetShippingInfoTaxedPriceChange' => SetShippingInfoTaxedPriceChangeModel::class, @@ -278,6 +291,7 @@ final class ChangeModel extends JsonObjectModel implements Change 'SetTransitionsChange' => SetTransitionsChangeModel::class, 'SetValidFromAndUntilChange' => SetValidFromAndUntilChangeModel::class, 'SetValidFromChange' => SetValidFromChangeModel::class, + 'SetValidToChange' => SetValidToChangeModel::class, 'SetValidUntilChange' => SetValidUntilChangeModel::class, 'SetValueChange' => SetValueChangeModel::class, 'SetVariantAvailabilityChange' => SetVariantAvailabilityChangeModel::class, @@ -295,13 +309,16 @@ final class ChangeModel extends JsonObjectModel implements Change * @psalm-suppress MissingParamType */ public function __construct( - ?string $change = null + ?string $change = null, + ?string $type = null ) { $this->change = $change; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; + } /** + * * @return null|string */ public function getType() @@ -319,6 +336,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() diff --git a/lib/commercetools-history/src/Models/Change/ChangeNameChange.php b/lib/commercetools-history/src/Models/Change/ChangeNameChange.php index a2433acf714..e9dd7ffea2c 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeNameChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeNameChange.php @@ -18,6 +18,7 @@ interface ChangeNameChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for changeName

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeNameChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeNameChangeBuilder.php index 0e27256ca6f..32ae1bc0cff 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeNameChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeNameChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeNameChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class ChangeNameChangeBuilder implements Builder /** *

    Shape of the action for changeName

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeNameChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeNameChangeModel.php index 6709f90f562..833cc50f6e8 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeNameChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeNameChangeModel.php @@ -22,21 +22,25 @@ final class ChangeNameChangeModel extends JsonObjectModel implements ChangeNameC public const DISCRIMINATOR_VALUE = 'ChangeNameChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class ChangeNameChangeModel extends JsonObjectModel implements ChangeNameC public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for changeName

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeOrderHintChange.php b/lib/commercetools-history/src/Models/Change/ChangeOrderHintChange.php index 1cca601786f..9366a479303 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeOrderHintChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeOrderHintChange.php @@ -18,6 +18,7 @@ interface ChangeOrderHintChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for changeOrderHint

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeOrderHintChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeOrderHintChangeBuilder.php index 135ce91efbb..2bd6b4705fa 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeOrderHintChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeOrderHintChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeOrderHintChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class ChangeOrderHintChangeBuilder implements Builder /** *

    Shape of the action for changeOrderHint

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeOrderHintChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeOrderHintChangeModel.php index d29fa8f6376..3e2972a0c92 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeOrderHintChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeOrderHintChangeModel.php @@ -22,21 +22,25 @@ final class ChangeOrderHintChangeModel extends JsonObjectModel implements Change public const DISCRIMINATOR_VALUE = 'ChangeOrderHintChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class ChangeOrderHintChangeModel extends JsonObjectModel implements Change public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for changeOrderHint

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeOrderStateChange.php b/lib/commercetools-history/src/Models/Change/ChangeOrderStateChange.php index 305f063f2e9..5fff5e9e91d 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeOrderStateChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeOrderStateChange.php @@ -18,6 +18,7 @@ interface ChangeOrderStateChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Update action for changeOrderState

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getNextValue(); /** + * @return null|string */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeOrderStateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeOrderStateChangeBuilder.php index ac03e689752..6c6a196c42f 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeOrderStateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeOrderStateChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeOrderStateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $nextValue; /** + * @var ?string */ private $previousValue; @@ -38,6 +41,7 @@ final class ChangeOrderStateChangeBuilder implements Builder /** *

    Update action for changeOrderState

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getNextValue() @@ -54,6 +59,7 @@ public function getNextValue() } /** + * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeOrderStateChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeOrderStateChangeModel.php index 4e784ae2452..d6be86e5349 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeOrderStateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeOrderStateChangeModel.php @@ -22,21 +22,25 @@ final class ChangeOrderStateChangeModel extends JsonObjectModel implements Chang public const DISCRIMINATOR_VALUE = 'ChangeOrderStateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $nextValue; /** + * * @var ?string */ protected $previousValue; @@ -48,15 +52,17 @@ final class ChangeOrderStateChangeModel extends JsonObjectModel implements Chang public function __construct( ?string $change = null, ?string $nextValue = null, - ?string $previousValue = null + ?string $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Update action for changeOrderState

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getNextValue() @@ -110,6 +118,7 @@ public function getNextValue() } /** + * * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeParentChange.php b/lib/commercetools-history/src/Models/Change/ChangeParentChange.php index 4d019490c12..4a529dee03e 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeParentChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeParentChange.php @@ -19,6 +19,7 @@ interface ChangeParentChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for changeParent

    * + * @return null|string */ public function getChange(); /** + * @return null|Reference */ public function getPreviousValue(); /** + * @return null|Reference */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeParentChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeParentChangeBuilder.php index 715c91775a8..9068720a770 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeParentChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeParentChangeBuilder.php @@ -23,16 +23,19 @@ final class ChangeParentChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Reference|ReferenceBuilder */ private $previousValue; /** + * @var null|Reference|ReferenceBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class ChangeParentChangeBuilder implements Builder /** *

    Shape of the action for changeParent

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Reference */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|Reference */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeParentChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeParentChangeModel.php index dcec43c3dd9..e1ad659a9c1 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeParentChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeParentChangeModel.php @@ -24,21 +24,25 @@ final class ChangeParentChangeModel extends JsonObjectModel implements ChangePar public const DISCRIMINATOR_VALUE = 'ChangeParentChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Reference */ protected $previousValue; /** + * * @var ?Reference */ protected $nextValue; @@ -50,15 +54,17 @@ final class ChangeParentChangeModel extends JsonObjectModel implements ChangePar public function __construct( ?string $change = null, ?Reference $previousValue = null, - ?Reference $nextValue = null + ?Reference $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for changeParent

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Reference */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|Reference */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangePaymentStateChange.php b/lib/commercetools-history/src/Models/Change/ChangePaymentStateChange.php index 99d162ee54b..9248ee587c0 100644 --- a/lib/commercetools-history/src/Models/Change/ChangePaymentStateChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangePaymentStateChange.php @@ -18,6 +18,7 @@ interface ChangePaymentStateChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Update action for changePaymentState

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getNextValue(); /** + * @return null|string */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangePaymentStateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangePaymentStateChangeBuilder.php index e6e25181bfa..1fa01748415 100644 --- a/lib/commercetools-history/src/Models/Change/ChangePaymentStateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangePaymentStateChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangePaymentStateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $nextValue; /** + * @var ?string */ private $previousValue; @@ -38,6 +41,7 @@ final class ChangePaymentStateChangeBuilder implements Builder /** *

    Update action for changePaymentState

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getNextValue() @@ -54,6 +59,7 @@ public function getNextValue() } /** + * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangePaymentStateChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangePaymentStateChangeModel.php index 059b658e16d..5843f6c5e3f 100644 --- a/lib/commercetools-history/src/Models/Change/ChangePaymentStateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangePaymentStateChangeModel.php @@ -22,21 +22,25 @@ final class ChangePaymentStateChangeModel extends JsonObjectModel implements Cha public const DISCRIMINATOR_VALUE = 'ChangePaymentStateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $nextValue; /** + * * @var ?string */ protected $previousValue; @@ -48,15 +52,17 @@ final class ChangePaymentStateChangeModel extends JsonObjectModel implements Cha public function __construct( ?string $change = null, ?string $nextValue = null, - ?string $previousValue = null + ?string $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Update action for changePaymentState

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getNextValue() @@ -110,6 +118,7 @@ public function getNextValue() } /** + * * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueLabelChange.php b/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueLabelChange.php index dbca07fbe0f..a963f6657cf 100644 --- a/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueLabelChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueLabelChange.php @@ -20,6 +20,7 @@ interface ChangePlainEnumValueLabelChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -27,6 +28,7 @@ public function getType(); /** *

    Update action for changePlainEnumValueLabel on types

    * + * @return null|string */ public function getChange(); @@ -34,6 +36,7 @@ public function getChange(); /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName(); @@ -41,16 +44,19 @@ public function getAttributeName(); /** *

    Key of the values that was updated

    * + * @return null|string */ public function getValueKey(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueLabelChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueLabelChangeBuilder.php index 80747471f5e..b7e600444e0 100644 --- a/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueLabelChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueLabelChangeBuilder.php @@ -21,26 +21,31 @@ final class ChangePlainEnumValueLabelChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $attributeName; /** + * @var ?string */ private $valueKey; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -48,6 +53,7 @@ final class ChangePlainEnumValueLabelChangeBuilder implements Builder /** *

    Update action for changePlainEnumValueLabel on types

    * + * @return null|string */ public function getChange() @@ -58,6 +64,7 @@ public function getChange() /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName() @@ -68,6 +75,7 @@ public function getAttributeName() /** *

    Key of the values that was updated

    * + * @return null|string */ public function getValueKey() @@ -76,6 +84,7 @@ public function getValueKey() } /** + * @return null|string */ public function getPreviousValue() @@ -84,6 +93,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueLabelChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueLabelChangeModel.php index 70734f9a947..07818155284 100644 --- a/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueLabelChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueLabelChangeModel.php @@ -22,31 +22,37 @@ final class ChangePlainEnumValueLabelChangeModel extends JsonObjectModel impleme public const DISCRIMINATOR_VALUE = 'ChangePlainEnumValueLabelChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?string */ protected $valueKey; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -60,17 +66,19 @@ public function __construct( ?string $attributeName = null, ?string $valueKey = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->attributeName = $attributeName; $this->valueKey = $valueKey; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -90,6 +98,7 @@ public function getType() /** *

    Update action for changePlainEnumValueLabel on types

    * + * * @return null|string */ public function getChange() @@ -109,6 +118,7 @@ public function getChange() /** *

    The name of the attribute updated.

    * + * * @return null|string */ public function getAttributeName() @@ -128,6 +138,7 @@ public function getAttributeName() /** *

    Key of the values that was updated

    * + * * @return null|string */ public function getValueKey() @@ -145,6 +156,7 @@ public function getValueKey() } /** + * * @return null|string */ public function getPreviousValue() @@ -162,6 +174,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueOrderChange.php b/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueOrderChange.php index 0e5166cb8a1..e3b962c417f 100644 --- a/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueOrderChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueOrderChange.php @@ -20,6 +20,7 @@ interface ChangePlainEnumValueOrderChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -27,6 +28,7 @@ public function getType(); /** *

    Update action for changePlainEnumValueOrder on product types

    * + * @return null|string */ public function getChange(); @@ -34,16 +36,19 @@ public function getChange(); /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName(); /** + * @return null|EnumValueCollection */ public function getNextValue(); /** + * @return null|EnumValueCollection */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueOrderChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueOrderChangeBuilder.php index c4bd4154362..5986b23c427 100644 --- a/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueOrderChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueOrderChangeBuilder.php @@ -22,21 +22,25 @@ final class ChangePlainEnumValueOrderChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $attributeName; /** + * @var ?EnumValueCollection */ private $nextValue; /** + * @var ?EnumValueCollection */ private $previousValue; @@ -44,6 +48,7 @@ final class ChangePlainEnumValueOrderChangeBuilder implements Builder /** *

    Update action for changePlainEnumValueOrder on product types

    * + * @return null|string */ public function getChange() @@ -54,6 +59,7 @@ public function getChange() /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName() @@ -62,6 +68,7 @@ public function getAttributeName() } /** + * @return null|EnumValueCollection */ public function getNextValue() @@ -70,6 +77,7 @@ public function getNextValue() } /** + * @return null|EnumValueCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueOrderChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueOrderChangeModel.php index 641e61d2f04..47636247613 100644 --- a/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueOrderChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangePlainEnumValueOrderChangeModel.php @@ -23,26 +23,31 @@ final class ChangePlainEnumValueOrderChangeModel extends JsonObjectModel impleme public const DISCRIMINATOR_VALUE = 'ChangePlainEnumValueOrderChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?EnumValueCollection */ protected $nextValue; /** + * * @var ?EnumValueCollection */ protected $previousValue; @@ -55,16 +60,18 @@ public function __construct( ?string $change = null, ?string $attributeName = null, ?EnumValueCollection $nextValue = null, - ?EnumValueCollection $previousValue = null + ?EnumValueCollection $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->attributeName = $attributeName; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -84,6 +91,7 @@ public function getType() /** *

    Update action for changePlainEnumValueOrder on product types

    * + * * @return null|string */ public function getChange() @@ -103,6 +111,7 @@ public function getChange() /** *

    The name of the attribute updated.

    * + * * @return null|string */ public function getAttributeName() @@ -120,6 +129,7 @@ public function getAttributeName() } /** + * * @return null|EnumValueCollection */ public function getNextValue() @@ -137,6 +147,7 @@ public function getNextValue() } /** + * * @return null|EnumValueCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangePredicateChange.php b/lib/commercetools-history/src/Models/Change/ChangePredicateChange.php index 63155134fd2..9310ee93aaa 100644 --- a/lib/commercetools-history/src/Models/Change/ChangePredicateChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangePredicateChange.php @@ -18,6 +18,7 @@ interface ChangePredicateChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for changePredicate

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangePredicateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangePredicateChangeBuilder.php index 7a39c8a293c..be0c9fad40a 100644 --- a/lib/commercetools-history/src/Models/Change/ChangePredicateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangePredicateChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangePredicateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class ChangePredicateChangeBuilder implements Builder /** *

    Shape of the action for changePredicate

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangePredicateChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangePredicateChangeModel.php index dd482b01f3d..1168475e548 100644 --- a/lib/commercetools-history/src/Models/Change/ChangePredicateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangePredicateChangeModel.php @@ -22,21 +22,25 @@ final class ChangePredicateChangeModel extends JsonObjectModel implements Change public const DISCRIMINATOR_VALUE = 'ChangePredicateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class ChangePredicateChangeModel extends JsonObjectModel implements Change public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for changePredicate

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangePriceChange.php b/lib/commercetools-history/src/Models/Change/ChangePriceChange.php index 0940c901839..0b5c04ee1c8 100644 --- a/lib/commercetools-history/src/Models/Change/ChangePriceChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangePriceChange.php @@ -21,6 +21,7 @@ interface ChangePriceChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -28,26 +29,31 @@ public function getType(); /** *

    Update action for changing prices

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|string */ public function getPriceId(); /** + * @return null|Price */ public function getPreviousValue(); /** + * @return null|Price */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangePriceChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangePriceChangeBuilder.php index e45c6eb2835..df9e735f0c3 100644 --- a/lib/commercetools-history/src/Models/Change/ChangePriceChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangePriceChangeBuilder.php @@ -23,26 +23,31 @@ final class ChangePriceChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var ?string */ private $priceId; /** + * @var null|Price|PriceBuilder */ private $previousValue; /** + * @var null|Price|PriceBuilder */ private $nextValue; @@ -50,6 +55,7 @@ final class ChangePriceChangeBuilder implements Builder /** *

    Update action for changing prices

    * + * @return null|string */ public function getChange() @@ -58,6 +64,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -66,6 +73,7 @@ public function getCatalogData() } /** + * @return null|string */ public function getPriceId() @@ -74,6 +82,7 @@ public function getPriceId() } /** + * @return null|Price */ public function getPreviousValue() @@ -82,6 +91,7 @@ public function getPreviousValue() } /** + * @return null|Price */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangePriceChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangePriceChangeModel.php index f11c1084878..5bd70a5723d 100644 --- a/lib/commercetools-history/src/Models/Change/ChangePriceChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangePriceChangeModel.php @@ -24,31 +24,37 @@ final class ChangePriceChangeModel extends JsonObjectModel implements ChangePric public const DISCRIMINATOR_VALUE = 'ChangePriceChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?string */ protected $priceId; /** + * * @var ?Price */ protected $previousValue; /** + * * @var ?Price */ protected $nextValue; @@ -62,17 +68,19 @@ public function __construct( ?string $catalogData = null, ?string $priceId = null, ?Price $previousValue = null, - ?Price $nextValue = null + ?Price $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->priceId = $priceId; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -92,6 +100,7 @@ public function getType() /** *

    Update action for changing prices

    * + * * @return null|string */ public function getChange() @@ -109,6 +118,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -126,6 +136,7 @@ public function getCatalogData() } /** + * * @return null|string */ public function getPriceId() @@ -143,6 +154,7 @@ public function getPriceId() } /** + * * @return null|Price */ public function getPreviousValue() @@ -161,6 +173,7 @@ public function getPreviousValue() } /** + * * @return null|Price */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeQuantityChange.php b/lib/commercetools-history/src/Models/Change/ChangeQuantityChange.php index c492c61b264..5bdb7f1ca9a 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeQuantityChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeQuantityChange.php @@ -19,21 +19,25 @@ interface ChangeQuantityChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|InventoryQuantityValue */ public function getNextValue(); /** + * @return null|InventoryQuantityValue */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeQuantityChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeQuantityChangeBuilder.php index c4ed9c115a9..58031aa7b32 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeQuantityChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeQuantityChangeBuilder.php @@ -23,21 +23,25 @@ final class ChangeQuantityChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|InventoryQuantityValue|InventoryQuantityValueBuilder */ private $nextValue; /** + * @var null|InventoryQuantityValue|InventoryQuantityValueBuilder */ private $previousValue; /** + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|InventoryQuantityValue */ public function getNextValue() @@ -54,6 +59,7 @@ public function getNextValue() } /** + * @return null|InventoryQuantityValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeQuantityChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeQuantityChangeModel.php index deef5eed23f..be8ebd6db07 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeQuantityChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeQuantityChangeModel.php @@ -24,21 +24,25 @@ final class ChangeQuantityChangeModel extends JsonObjectModel implements ChangeQ public const DISCRIMINATOR_VALUE = 'ChangeQuantityChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?InventoryQuantityValue */ protected $nextValue; /** + * * @var ?InventoryQuantityValue */ protected $previousValue; @@ -50,15 +54,17 @@ final class ChangeQuantityChangeModel extends JsonObjectModel implements ChangeQ public function __construct( ?string $change = null, ?InventoryQuantityValue $nextValue = null, - ?InventoryQuantityValue $previousValue = null + ?InventoryQuantityValue $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|InventoryQuantityValue */ public function getNextValue() @@ -111,6 +119,7 @@ public function getNextValue() } /** + * * @return null|InventoryQuantityValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeQuoteRequestStateChange.php b/lib/commercetools-history/src/Models/Change/ChangeQuoteRequestStateChange.php new file mode 100644 index 00000000000..00c4a03c08a --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/ChangeQuoteRequestStateChange.php @@ -0,0 +1,58 @@ + + */ +final class ChangeQuoteRequestStateChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var ?string + */ + private $nextValue; + + /** + + * @var ?string + */ + private $previousValue; + + /** + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + + * @return null|string + */ + public function getNextValue() + { + return $this->nextValue; + } + + /** + + * @return null|string + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?string $nextValue + * @return $this + */ + public function withNextValue(?string $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + /** + * @param ?string $previousValue + * @return $this + */ + public function withPreviousValue(?string $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + + public function build(): ChangeQuoteRequestStateChange + { + return new ChangeQuoteRequestStateChangeModel( + $this->change, + $this->nextValue, + $this->previousValue + ); + } + + public static function of(): ChangeQuoteRequestStateChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeQuoteRequestStateChangeCollection.php b/lib/commercetools-history/src/Models/Change/ChangeQuoteRequestStateChangeCollection.php new file mode 100644 index 00000000000..c911be26b0e --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/ChangeQuoteRequestStateChangeCollection.php @@ -0,0 +1,56 @@ + + * @method ChangeQuoteRequestStateChange current() + * @method ChangeQuoteRequestStateChange end() + * @method ChangeQuoteRequestStateChange at($offset) + */ +class ChangeQuoteRequestStateChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert ChangeQuoteRequestStateChange $value + * @psalm-param ChangeQuoteRequestStateChange|stdClass $value + * @throws InvalidArgumentException + * + * @return ChangeQuoteRequestStateChangeCollection + */ + public function add($value) + { + if (!$value instanceof ChangeQuoteRequestStateChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ChangeQuoteRequestStateChange + */ + protected function mapper() + { + return function (?int $index): ?ChangeQuoteRequestStateChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ChangeQuoteRequestStateChange $data */ + $data = ChangeQuoteRequestStateChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeQuoteRequestStateChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeQuoteRequestStateChangeModel.php new file mode 100644 index 00000000000..449c521c615 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/ChangeQuoteRequestStateChangeModel.php @@ -0,0 +1,163 @@ +change = $change; + $this->nextValue = $nextValue; + $this->previousValue = $previousValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + * + * @return null|string + */ + public function getNextValue() + { + if (is_null($this->nextValue)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NEXT_VALUE); + if (is_null($data)) { + return null; + } + $this->nextValue = (string) $data; + } + + return $this->nextValue; + } + + /** + * + * @return null|string + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = (string) $data; + } + + return $this->previousValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?string $nextValue + */ + public function setNextValue(?string $nextValue): void + { + $this->nextValue = $nextValue; + } + + /** + * @param ?string $previousValue + */ + public function setPreviousValue(?string $previousValue): void + { + $this->previousValue = $previousValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeQuoteStateChange.php b/lib/commercetools-history/src/Models/Change/ChangeQuoteStateChange.php new file mode 100644 index 00000000000..bf94fa00166 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/ChangeQuoteStateChange.php @@ -0,0 +1,58 @@ + + */ +final class ChangeQuoteStateChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var ?string + */ + private $nextValue; + + /** + + * @var ?string + */ + private $previousValue; + + /** + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + + * @return null|string + */ + public function getNextValue() + { + return $this->nextValue; + } + + /** + + * @return null|string + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?string $nextValue + * @return $this + */ + public function withNextValue(?string $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + /** + * @param ?string $previousValue + * @return $this + */ + public function withPreviousValue(?string $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + + public function build(): ChangeQuoteStateChange + { + return new ChangeQuoteStateChangeModel( + $this->change, + $this->nextValue, + $this->previousValue + ); + } + + public static function of(): ChangeQuoteStateChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeQuoteStateChangeCollection.php b/lib/commercetools-history/src/Models/Change/ChangeQuoteStateChangeCollection.php new file mode 100644 index 00000000000..0bcd7e8c332 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/ChangeQuoteStateChangeCollection.php @@ -0,0 +1,56 @@ + + * @method ChangeQuoteStateChange current() + * @method ChangeQuoteStateChange end() + * @method ChangeQuoteStateChange at($offset) + */ +class ChangeQuoteStateChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert ChangeQuoteStateChange $value + * @psalm-param ChangeQuoteStateChange|stdClass $value + * @throws InvalidArgumentException + * + * @return ChangeQuoteStateChangeCollection + */ + public function add($value) + { + if (!$value instanceof ChangeQuoteStateChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ChangeQuoteStateChange + */ + protected function mapper() + { + return function (?int $index): ?ChangeQuoteStateChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ChangeQuoteStateChange $data */ + $data = ChangeQuoteStateChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeQuoteStateChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeQuoteStateChangeModel.php new file mode 100644 index 00000000000..a587cdc52f6 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/ChangeQuoteStateChangeModel.php @@ -0,0 +1,163 @@ +change = $change; + $this->nextValue = $nextValue; + $this->previousValue = $previousValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + * + * @return null|string + */ + public function getNextValue() + { + if (is_null($this->nextValue)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NEXT_VALUE); + if (is_null($data)) { + return null; + } + $this->nextValue = (string) $data; + } + + return $this->nextValue; + } + + /** + * + * @return null|string + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = (string) $data; + } + + return $this->previousValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?string $nextValue + */ + public function setNextValue(?string $nextValue): void + { + $this->nextValue = $nextValue; + } + + /** + * @param ?string $previousValue + */ + public function setPreviousValue(?string $previousValue): void + { + $this->previousValue = $previousValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeRequiresDiscountCodeChange.php b/lib/commercetools-history/src/Models/Change/ChangeRequiresDiscountCodeChange.php index 7d152d15460..641d2441462 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeRequiresDiscountCodeChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeRequiresDiscountCodeChange.php @@ -18,6 +18,7 @@ interface ChangeRequiresDiscountCodeChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for changeRequiresDiscountCode

    * + * @return null|string */ public function getChange(); /** + * @return null|bool */ public function getPreviousValue(); /** + * @return null|bool */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeRequiresDiscountCodeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeRequiresDiscountCodeChangeBuilder.php index b1be0f314bf..2cd79be7d74 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeRequiresDiscountCodeChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeRequiresDiscountCodeChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeRequiresDiscountCodeChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?bool */ private $previousValue; /** + * @var ?bool */ private $nextValue; @@ -38,6 +41,7 @@ final class ChangeRequiresDiscountCodeChangeBuilder implements Builder /** *

    Shape of the action for changeRequiresDiscountCode

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|bool */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|bool */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeRequiresDiscountCodeChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeRequiresDiscountCodeChangeModel.php index 9d5323a0271..cea61d9ba25 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeRequiresDiscountCodeChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeRequiresDiscountCodeChangeModel.php @@ -22,21 +22,25 @@ final class ChangeRequiresDiscountCodeChangeModel extends JsonObjectModel implem public const DISCRIMINATOR_VALUE = 'ChangeRequiresDiscountCodeChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?bool */ protected $previousValue; /** + * * @var ?bool */ protected $nextValue; @@ -48,15 +52,17 @@ final class ChangeRequiresDiscountCodeChangeModel extends JsonObjectModel implem public function __construct( ?string $change = null, ?bool $previousValue = null, - ?bool $nextValue = null + ?bool $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for changeRequiresDiscountCode

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|bool */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|bool */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeReviewRatingStatisticsChange.php b/lib/commercetools-history/src/Models/Change/ChangeReviewRatingStatisticsChange.php index a3a0a045aa2..0346923f582 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeReviewRatingStatisticsChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeReviewRatingStatisticsChange.php @@ -21,21 +21,25 @@ interface ChangeReviewRatingStatisticsChange extends Change /** *

    Update action for changeReviewRatingStatistics

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|ReviewRatingStatistics */ public function getNextValue(); /** + * @return null|ReviewRatingStatistics */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeReviewRatingStatisticsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeReviewRatingStatisticsChangeBuilder.php index 2384cd6a40b..1c9879a3938 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeReviewRatingStatisticsChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeReviewRatingStatisticsChangeBuilder.php @@ -23,16 +23,19 @@ final class ChangeReviewRatingStatisticsChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|ReviewRatingStatistics|ReviewRatingStatisticsBuilder */ private $nextValue; /** + * @var null|ReviewRatingStatistics|ReviewRatingStatisticsBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class ChangeReviewRatingStatisticsChangeBuilder implements Builder /** *

    Update action for changeReviewRatingStatistics

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|ReviewRatingStatistics */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|ReviewRatingStatistics */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeReviewRatingStatisticsChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeReviewRatingStatisticsChangeModel.php index 971a43057d7..747ec62104e 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeReviewRatingStatisticsChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeReviewRatingStatisticsChangeModel.php @@ -24,21 +24,25 @@ final class ChangeReviewRatingStatisticsChangeModel extends JsonObjectModel impl public const DISCRIMINATOR_VALUE = 'ChangeReviewRatingStatisticsChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ReviewRatingStatistics */ protected $nextValue; /** + * * @var ?ReviewRatingStatistics */ protected $previousValue; @@ -50,15 +54,17 @@ final class ChangeReviewRatingStatisticsChangeModel extends JsonObjectModel impl public function __construct( ?string $change = null, ?ReviewRatingStatistics $nextValue = null, - ?ReviewRatingStatistics $previousValue = null + ?ReviewRatingStatistics $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for changeReviewRatingStatistics

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|ReviewRatingStatistics */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|ReviewRatingStatistics */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeShipmentStateChange.php b/lib/commercetools-history/src/Models/Change/ChangeShipmentStateChange.php index f325d7082cf..f8216d28921 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeShipmentStateChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeShipmentStateChange.php @@ -18,6 +18,7 @@ interface ChangeShipmentStateChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Update action for changeShipmentState

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getNextValue(); /** + * @return null|string */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeShipmentStateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeShipmentStateChangeBuilder.php index 2470aa7c8bc..fd0f414f71c 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeShipmentStateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeShipmentStateChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeShipmentStateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $nextValue; /** + * @var ?string */ private $previousValue; @@ -38,6 +41,7 @@ final class ChangeShipmentStateChangeBuilder implements Builder /** *

    Update action for changeShipmentState

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getNextValue() @@ -54,6 +59,7 @@ public function getNextValue() } /** + * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeShipmentStateChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeShipmentStateChangeModel.php index 9bdfcbceee0..554be9939e1 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeShipmentStateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeShipmentStateChangeModel.php @@ -22,21 +22,25 @@ final class ChangeShipmentStateChangeModel extends JsonObjectModel implements Ch public const DISCRIMINATOR_VALUE = 'ChangeShipmentStateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $nextValue; /** + * * @var ?string */ protected $previousValue; @@ -48,15 +52,17 @@ final class ChangeShipmentStateChangeModel extends JsonObjectModel implements Ch public function __construct( ?string $change = null, ?string $nextValue = null, - ?string $previousValue = null + ?string $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Update action for changeShipmentState

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getNextValue() @@ -110,6 +118,7 @@ public function getNextValue() } /** + * * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemQuantityChange.php b/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemQuantityChange.php index bd95068431f..0041dca95fc 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemQuantityChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemQuantityChange.php @@ -20,26 +20,31 @@ interface ChangeShoppingListLineItemQuantityChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|ShoppingListLineItemValue */ public function getLineItem(); /** + * @return null|int */ public function getPreviousValue(); /** + * @return null|int */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemQuantityChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemQuantityChangeBuilder.php index bf024b5c7d6..0de8af4ff1b 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemQuantityChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemQuantityChangeBuilder.php @@ -23,26 +23,31 @@ final class ChangeShoppingListLineItemQuantityChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|ShoppingListLineItemValue|ShoppingListLineItemValueBuilder */ private $lineItem; /** + * @var ?int */ private $previousValue; /** + * @var ?int */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -51,6 +56,7 @@ public function getChange() } /** + * @return null|ShoppingListLineItemValue */ public function getLineItem() @@ -59,6 +65,7 @@ public function getLineItem() } /** + * @return null|int */ public function getPreviousValue() @@ -67,6 +74,7 @@ public function getPreviousValue() } /** + * @return null|int */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemQuantityChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemQuantityChangeModel.php index 88c5ed3905b..6e312359b3b 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemQuantityChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemQuantityChangeModel.php @@ -24,26 +24,31 @@ final class ChangeShoppingListLineItemQuantityChangeModel extends JsonObjectMode public const DISCRIMINATOR_VALUE = 'ChangeShoppingListLineItemQuantityChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ShoppingListLineItemValue */ protected $lineItem; /** + * * @var ?int */ protected $previousValue; /** + * * @var ?int */ protected $nextValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?ShoppingListLineItemValue $lineItem = null, ?int $previousValue = null, - ?int $nextValue = null + ?int $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->lineItem = $lineItem; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -83,6 +90,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -100,6 +108,7 @@ public function getChange() } /** + * * @return null|ShoppingListLineItemValue */ public function getLineItem() @@ -118,6 +127,7 @@ public function getLineItem() } /** + * * @return null|int */ public function getPreviousValue() @@ -135,6 +145,7 @@ public function getPreviousValue() } /** + * * @return null|int */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemsOrderChange.php b/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemsOrderChange.php index f18b844133c..65e3686a0ca 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemsOrderChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemsOrderChange.php @@ -19,21 +19,25 @@ interface ChangeShoppingListLineItemsOrderChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|ShoppingListLineItemValueCollection */ public function getPreviousValue(); /** + * @return null|ShoppingListLineItemValueCollection */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemsOrderChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemsOrderChangeBuilder.php index b984763ff4b..d29bfdd3cce 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemsOrderChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemsOrderChangeBuilder.php @@ -22,21 +22,25 @@ final class ChangeShoppingListLineItemsOrderChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?ShoppingListLineItemValueCollection */ private $previousValue; /** + * @var ?ShoppingListLineItemValueCollection */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -45,6 +49,7 @@ public function getChange() } /** + * @return null|ShoppingListLineItemValueCollection */ public function getPreviousValue() @@ -53,6 +58,7 @@ public function getPreviousValue() } /** + * @return null|ShoppingListLineItemValueCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemsOrderChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemsOrderChangeModel.php index 350c5743d52..f47fd3b6195 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemsOrderChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeShoppingListLineItemsOrderChangeModel.php @@ -23,21 +23,25 @@ final class ChangeShoppingListLineItemsOrderChangeModel extends JsonObjectModel public const DISCRIMINATOR_VALUE = 'ChangeShoppingListLineItemsOrderChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ShoppingListLineItemValueCollection */ protected $previousValue; /** + * * @var ?ShoppingListLineItemValueCollection */ protected $nextValue; @@ -49,15 +53,17 @@ final class ChangeShoppingListLineItemsOrderChangeModel extends JsonObjectModel public function __construct( ?string $change = null, ?ShoppingListLineItemValueCollection $previousValue = null, - ?ShoppingListLineItemValueCollection $nextValue = null + ?ShoppingListLineItemValueCollection $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -75,6 +81,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -92,6 +99,7 @@ public function getChange() } /** + * * @return null|ShoppingListLineItemValueCollection */ public function getPreviousValue() @@ -109,6 +117,7 @@ public function getPreviousValue() } /** + * * @return null|ShoppingListLineItemValueCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeSlugChange.php b/lib/commercetools-history/src/Models/Change/ChangeSlugChange.php index 565e72a4f43..b319770159d 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeSlugChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeSlugChange.php @@ -19,6 +19,7 @@ interface ChangeSlugChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for changeSlug

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getPreviousValue(); /** + * @return null|LocalizedString */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeSlugChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeSlugChangeBuilder.php index e3061707fa4..a1f5af54cb4 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeSlugChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeSlugChangeBuilder.php @@ -23,16 +23,19 @@ final class ChangeSlugChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class ChangeSlugChangeBuilder implements Builder /** *

    Shape of the action for changeSlug

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeSlugChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeSlugChangeModel.php index 8e920b8f309..195e2bb8458 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeSlugChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeSlugChangeModel.php @@ -24,21 +24,25 @@ final class ChangeSlugChangeModel extends JsonObjectModel implements ChangeSlugC public const DISCRIMINATOR_VALUE = 'ChangeSlugChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $previousValue; /** + * * @var ?LocalizedString */ protected $nextValue; @@ -50,15 +54,17 @@ final class ChangeSlugChangeModel extends JsonObjectModel implements ChangeSlugC public function __construct( ?string $change = null, ?LocalizedString $previousValue = null, - ?LocalizedString $nextValue = null + ?LocalizedString $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for changeSlug

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeSortOrderChange.php b/lib/commercetools-history/src/Models/Change/ChangeSortOrderChange.php index b7281a14dae..8ce9e39412a 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeSortOrderChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeSortOrderChange.php @@ -18,6 +18,7 @@ interface ChangeSortOrderChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for changeSortOrder

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeSortOrderChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeSortOrderChangeBuilder.php index 2107abdd835..d90702e6c44 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeSortOrderChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeSortOrderChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeSortOrderChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class ChangeSortOrderChangeBuilder implements Builder /** *

    Shape of the action for changeSortOrder

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeSortOrderChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeSortOrderChangeModel.php index 5bc36f2630d..e4852b13c10 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeSortOrderChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeSortOrderChangeModel.php @@ -22,21 +22,25 @@ final class ChangeSortOrderChangeModel extends JsonObjectModel implements Change public const DISCRIMINATOR_VALUE = 'ChangeSortOrderChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class ChangeSortOrderChangeModel extends JsonObjectModel implements Change public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for changeSortOrder

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeStackingModeChange.php b/lib/commercetools-history/src/Models/Change/ChangeStackingModeChange.php index 42c80b71826..1541b972545 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeStackingModeChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeStackingModeChange.php @@ -20,21 +20,25 @@ interface ChangeStackingModeChange extends Change /** *

    Update action for changeStackingMode on cart discounts

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getNextValue(); /** + * @return null|string */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeStackingModeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeStackingModeChangeBuilder.php index 4b72e9a1f12..b9b49f9ec2a 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeStackingModeChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeStackingModeChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeStackingModeChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $nextValue; /** + * @var ?string */ private $previousValue; @@ -38,6 +41,7 @@ final class ChangeStackingModeChangeBuilder implements Builder /** *

    Update action for changeStackingMode on cart discounts

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getNextValue() @@ -54,6 +59,7 @@ public function getNextValue() } /** + * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeStackingModeChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeStackingModeChangeModel.php index b70e1a815e2..1a2ad124295 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeStackingModeChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeStackingModeChangeModel.php @@ -22,21 +22,25 @@ final class ChangeStackingModeChangeModel extends JsonObjectModel implements Cha public const DISCRIMINATOR_VALUE = 'ChangeStackingModeChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $nextValue; /** + * * @var ?string */ protected $previousValue; @@ -48,15 +52,17 @@ final class ChangeStackingModeChangeModel extends JsonObjectModel implements Cha public function __construct( ?string $change = null, ?string $nextValue = null, - ?string $previousValue = null + ?string $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Update action for changeStackingMode on cart discounts

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getNextValue() @@ -110,6 +118,7 @@ public function getNextValue() } /** + * * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeStagedQuoteStateChange.php b/lib/commercetools-history/src/Models/Change/ChangeStagedQuoteStateChange.php new file mode 100644 index 00000000000..8a067ff50a4 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/ChangeStagedQuoteStateChange.php @@ -0,0 +1,58 @@ + + */ +final class ChangeStagedQuoteStateChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var ?string + */ + private $nextValue; + + /** + + * @var ?string + */ + private $previousValue; + + /** + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + + * @return null|string + */ + public function getNextValue() + { + return $this->nextValue; + } + + /** + + * @return null|string + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?string $nextValue + * @return $this + */ + public function withNextValue(?string $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + /** + * @param ?string $previousValue + * @return $this + */ + public function withPreviousValue(?string $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + + public function build(): ChangeStagedQuoteStateChange + { + return new ChangeStagedQuoteStateChangeModel( + $this->change, + $this->nextValue, + $this->previousValue + ); + } + + public static function of(): ChangeStagedQuoteStateChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeStagedQuoteStateChangeCollection.php b/lib/commercetools-history/src/Models/Change/ChangeStagedQuoteStateChangeCollection.php new file mode 100644 index 00000000000..7514bb6fe4b --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/ChangeStagedQuoteStateChangeCollection.php @@ -0,0 +1,56 @@ + + * @method ChangeStagedQuoteStateChange current() + * @method ChangeStagedQuoteStateChange end() + * @method ChangeStagedQuoteStateChange at($offset) + */ +class ChangeStagedQuoteStateChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert ChangeStagedQuoteStateChange $value + * @psalm-param ChangeStagedQuoteStateChange|stdClass $value + * @throws InvalidArgumentException + * + * @return ChangeStagedQuoteStateChangeCollection + */ + public function add($value) + { + if (!$value instanceof ChangeStagedQuoteStateChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ChangeStagedQuoteStateChange + */ + protected function mapper() + { + return function (?int $index): ?ChangeStagedQuoteStateChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ChangeStagedQuoteStateChange $data */ + $data = ChangeStagedQuoteStateChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeStagedQuoteStateChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeStagedQuoteStateChangeModel.php new file mode 100644 index 00000000000..16ee768467a --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/ChangeStagedQuoteStateChangeModel.php @@ -0,0 +1,163 @@ +change = $change; + $this->nextValue = $nextValue; + $this->previousValue = $previousValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + * + * @return null|string + */ + public function getNextValue() + { + if (is_null($this->nextValue)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NEXT_VALUE); + if (is_null($data)) { + return null; + } + $this->nextValue = (string) $data; + } + + return $this->nextValue; + } + + /** + * + * @return null|string + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = (string) $data; + } + + return $this->previousValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?string $nextValue + */ + public function setNextValue(?string $nextValue): void + { + $this->nextValue = $nextValue; + } + + /** + * @param ?string $previousValue + */ + public function setPreviousValue(?string $previousValue): void + { + $this->previousValue = $previousValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeStateTypeChange.php b/lib/commercetools-history/src/Models/Change/ChangeStateTypeChange.php index f106c9a7893..b60b2844c1b 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeStateTypeChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeStateTypeChange.php @@ -18,6 +18,7 @@ interface ChangeStateTypeChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Update action for changeType on state

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeStateTypeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeStateTypeChangeBuilder.php index 4eab521dccd..36e38089085 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeStateTypeChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeStateTypeChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeStateTypeChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class ChangeStateTypeChangeBuilder implements Builder /** *

    Update action for changeType on state

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeStateTypeChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeStateTypeChangeModel.php index d4d33c6f98b..845210ae4d0 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeStateTypeChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeStateTypeChangeModel.php @@ -22,21 +22,25 @@ final class ChangeStateTypeChangeModel extends JsonObjectModel implements Change public const DISCRIMINATOR_VALUE = 'ChangeStateTypeChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class ChangeStateTypeChangeModel extends JsonObjectModel implements Change public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Update action for changeType on state

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTargetChange.php b/lib/commercetools-history/src/Models/Change/ChangeTargetChange.php index 80721be4a0e..3b71963370c 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTargetChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTargetChange.php @@ -21,21 +21,25 @@ interface ChangeTargetChange extends Change /** *

    Update action for changeTarget on cart discounts

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|ChangeTargetChangeValue */ public function getNextValue(); /** + * @return null|ChangeTargetChangeValue */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeTargetChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeTargetChangeBuilder.php index 3d3c8a9d527..a5226b6ba64 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTargetChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTargetChangeBuilder.php @@ -23,16 +23,19 @@ final class ChangeTargetChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|ChangeTargetChangeValue|ChangeTargetChangeValueBuilder */ private $nextValue; /** + * @var null|ChangeTargetChangeValue|ChangeTargetChangeValueBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class ChangeTargetChangeBuilder implements Builder /** *

    Update action for changeTarget on cart discounts

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|ChangeTargetChangeValue */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|ChangeTargetChangeValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTargetChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeTargetChangeModel.php index 66e2d04d000..1d661e1f86d 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTargetChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTargetChangeModel.php @@ -24,21 +24,25 @@ final class ChangeTargetChangeModel extends JsonObjectModel implements ChangeTar public const DISCRIMINATOR_VALUE = 'ChangeTargetChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ChangeTargetChangeValue */ protected $nextValue; /** + * * @var ?ChangeTargetChangeValue */ protected $previousValue; @@ -50,15 +54,17 @@ final class ChangeTargetChangeModel extends JsonObjectModel implements ChangeTar public function __construct( ?string $change = null, ?ChangeTargetChangeValue $nextValue = null, - ?ChangeTargetChangeValue $previousValue = null + ?ChangeTargetChangeValue $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for changeTarget on cart discounts

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|ChangeTargetChangeValue */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|ChangeTargetChangeValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTaxCalculationModeChange.php b/lib/commercetools-history/src/Models/Change/ChangeTaxCalculationModeChange.php index 13535196ee6..b4740a85421 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTaxCalculationModeChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTaxCalculationModeChange.php @@ -18,6 +18,7 @@ interface ChangeTaxCalculationModeChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for changeTaxCalculationMode

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeTaxCalculationModeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeTaxCalculationModeChangeBuilder.php index 66ea5c79900..a5d2d4cf4e4 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTaxCalculationModeChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTaxCalculationModeChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeTaxCalculationModeChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class ChangeTaxCalculationModeChangeBuilder implements Builder /** *

    Shape of the action for changeTaxCalculationMode

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTaxCalculationModeChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeTaxCalculationModeChangeModel.php index 5afc6f9e6f2..4e1ae686481 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTaxCalculationModeChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTaxCalculationModeChangeModel.php @@ -22,21 +22,25 @@ final class ChangeTaxCalculationModeChangeModel extends JsonObjectModel implemen public const DISCRIMINATOR_VALUE = 'ChangeTaxCalculationModeChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class ChangeTaxCalculationModeChangeModel extends JsonObjectModel implemen public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for changeTaxCalculationMode

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTaxModeChange.php b/lib/commercetools-history/src/Models/Change/ChangeTaxModeChange.php index 5c69b4965b6..5cb0f7c7b11 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTaxModeChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTaxModeChange.php @@ -18,6 +18,7 @@ interface ChangeTaxModeChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for changeTaxMode

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeTaxModeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeTaxModeChangeBuilder.php index d80cfd7e5c4..c3c5d317f02 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTaxModeChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTaxModeChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeTaxModeChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class ChangeTaxModeChangeBuilder implements Builder /** *

    Shape of the action for changeTaxMode

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTaxModeChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeTaxModeChangeModel.php index d246ce802ac..20e0ddbc87c 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTaxModeChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTaxModeChangeModel.php @@ -22,21 +22,25 @@ final class ChangeTaxModeChangeModel extends JsonObjectModel implements ChangeTa public const DISCRIMINATOR_VALUE = 'ChangeTaxModeChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class ChangeTaxModeChangeModel extends JsonObjectModel implements ChangeTa public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for changeTaxMode

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTaxRoundingModeChange.php b/lib/commercetools-history/src/Models/Change/ChangeTaxRoundingModeChange.php index df7349fa907..4150f1fb2dd 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTaxRoundingModeChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTaxRoundingModeChange.php @@ -18,6 +18,7 @@ interface ChangeTaxRoundingModeChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for changeTaxRoundingMode

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeTaxRoundingModeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeTaxRoundingModeChangeBuilder.php index ebf90bdf608..a8e16aa53ed 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTaxRoundingModeChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTaxRoundingModeChangeBuilder.php @@ -21,16 +21,19 @@ final class ChangeTaxRoundingModeChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class ChangeTaxRoundingModeChangeBuilder implements Builder /** *

    Shape of the action for changeTaxRoundingMode

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTaxRoundingModeChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeTaxRoundingModeChangeModel.php index 0c85aa5a8fe..81d6006b60a 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTaxRoundingModeChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTaxRoundingModeChangeModel.php @@ -22,21 +22,25 @@ final class ChangeTaxRoundingModeChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'ChangeTaxRoundingModeChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class ChangeTaxRoundingModeChangeModel extends JsonObjectModel implements public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for changeTaxRoundingMode

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemNameChange.php b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemNameChange.php index 4207596be53..3d407b47294 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemNameChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemNameChange.php @@ -21,6 +21,7 @@ interface ChangeTextLineItemNameChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -28,21 +29,25 @@ public function getType(); /** *

    Update action for changeTextLineItemName

    * + * @return null|string */ public function getChange(); /** + * @return null|TextLineItemValue */ public function getTextLineItem(); /** + * @return null|LocalizedString */ public function getNextValue(); /** + * @return null|LocalizedString */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemNameChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemNameChangeBuilder.php index adaf9380e05..60682a56b51 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemNameChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemNameChangeBuilder.php @@ -25,21 +25,25 @@ final class ChangeTextLineItemNameChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|TextLineItemValue|TextLineItemValueBuilder */ private $textLineItem; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; @@ -47,6 +51,7 @@ final class ChangeTextLineItemNameChangeBuilder implements Builder /** *

    Update action for changeTextLineItemName

    * + * @return null|string */ public function getChange() @@ -55,6 +60,7 @@ public function getChange() } /** + * @return null|TextLineItemValue */ public function getTextLineItem() @@ -63,6 +69,7 @@ public function getTextLineItem() } /** + * @return null|LocalizedString */ public function getNextValue() @@ -71,6 +78,7 @@ public function getNextValue() } /** + * @return null|LocalizedString */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemNameChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemNameChangeModel.php index c3b76ea71c0..aff2a7d25a3 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemNameChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemNameChangeModel.php @@ -26,26 +26,31 @@ final class ChangeTextLineItemNameChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'ChangeTextLineItemNameChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?TextLineItemValue */ protected $textLineItem; /** + * * @var ?LocalizedString */ protected $nextValue; /** + * * @var ?LocalizedString */ protected $previousValue; @@ -58,16 +63,18 @@ public function __construct( ?string $change = null, ?TextLineItemValue $textLineItem = null, ?LocalizedString $nextValue = null, - ?LocalizedString $previousValue = null + ?LocalizedString $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->textLineItem = $textLineItem; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -87,6 +94,7 @@ public function getType() /** *

    Update action for changeTextLineItemName

    * + * * @return null|string */ public function getChange() @@ -104,6 +112,7 @@ public function getChange() } /** + * * @return null|TextLineItemValue */ public function getTextLineItem() @@ -122,6 +131,7 @@ public function getTextLineItem() } /** + * * @return null|LocalizedString */ public function getNextValue() @@ -140,6 +150,7 @@ public function getNextValue() } /** + * * @return null|LocalizedString */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemQuantityChange.php b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemQuantityChange.php index 3b8ba43a365..651d86a6ab5 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemQuantityChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemQuantityChange.php @@ -20,26 +20,31 @@ interface ChangeTextLineItemQuantityChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|TextLineItemValue */ public function getTextLineItem(); /** + * @return null|int */ public function getPreviousValue(); /** + * @return null|int */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemQuantityChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemQuantityChangeBuilder.php index b819a639892..1d48e6ac510 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemQuantityChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemQuantityChangeBuilder.php @@ -23,26 +23,31 @@ final class ChangeTextLineItemQuantityChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|TextLineItemValue|TextLineItemValueBuilder */ private $textLineItem; /** + * @var ?int */ private $previousValue; /** + * @var ?int */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -51,6 +56,7 @@ public function getChange() } /** + * @return null|TextLineItemValue */ public function getTextLineItem() @@ -59,6 +65,7 @@ public function getTextLineItem() } /** + * @return null|int */ public function getPreviousValue() @@ -67,6 +74,7 @@ public function getPreviousValue() } /** + * @return null|int */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemQuantityChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemQuantityChangeModel.php index a0a24548980..138455abd5c 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemQuantityChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemQuantityChangeModel.php @@ -24,26 +24,31 @@ final class ChangeTextLineItemQuantityChangeModel extends JsonObjectModel implem public const DISCRIMINATOR_VALUE = 'ChangeTextLineItemQuantityChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?TextLineItemValue */ protected $textLineItem; /** + * * @var ?int */ protected $previousValue; /** + * * @var ?int */ protected $nextValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?TextLineItemValue $textLineItem = null, ?int $previousValue = null, - ?int $nextValue = null + ?int $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->textLineItem = $textLineItem; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -83,6 +90,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -100,6 +108,7 @@ public function getChange() } /** + * * @return null|TextLineItemValue */ public function getTextLineItem() @@ -118,6 +127,7 @@ public function getTextLineItem() } /** + * * @return null|int */ public function getPreviousValue() @@ -135,6 +145,7 @@ public function getPreviousValue() } /** + * * @return null|int */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemsOrderChange.php b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemsOrderChange.php index b48476ede59..164173d9944 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemsOrderChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemsOrderChange.php @@ -19,21 +19,25 @@ interface ChangeTextLineItemsOrderChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|TextLineItemValueCollection */ public function getPreviousValue(); /** + * @return null|TextLineItemValueCollection */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemsOrderChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemsOrderChangeBuilder.php index 4ec08663230..d6e3341fb29 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemsOrderChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemsOrderChangeBuilder.php @@ -22,21 +22,25 @@ final class ChangeTextLineItemsOrderChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?TextLineItemValueCollection */ private $previousValue; /** + * @var ?TextLineItemValueCollection */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -45,6 +49,7 @@ public function getChange() } /** + * @return null|TextLineItemValueCollection */ public function getPreviousValue() @@ -53,6 +58,7 @@ public function getPreviousValue() } /** + * @return null|TextLineItemValueCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemsOrderChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemsOrderChangeModel.php index 9ecec56b5e2..1bf29c0f2d1 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTextLineItemsOrderChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTextLineItemsOrderChangeModel.php @@ -23,21 +23,25 @@ final class ChangeTextLineItemsOrderChangeModel extends JsonObjectModel implemen public const DISCRIMINATOR_VALUE = 'ChangeTextLineItemsOrderChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?TextLineItemValueCollection */ protected $previousValue; /** + * * @var ?TextLineItemValueCollection */ protected $nextValue; @@ -49,15 +53,17 @@ final class ChangeTextLineItemsOrderChangeModel extends JsonObjectModel implemen public function __construct( ?string $change = null, ?TextLineItemValueCollection $previousValue = null, - ?TextLineItemValueCollection $nextValue = null + ?TextLineItemValueCollection $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -75,6 +81,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -92,6 +99,7 @@ public function getChange() } /** + * * @return null|TextLineItemValueCollection */ public function getPreviousValue() @@ -109,6 +117,7 @@ public function getPreviousValue() } /** + * * @return null|TextLineItemValueCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTransactionInteractionIdChange.php b/lib/commercetools-history/src/Models/Change/ChangeTransactionInteractionIdChange.php index 5498d9cb123..0c90646a0fc 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTransactionInteractionIdChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTransactionInteractionIdChange.php @@ -20,6 +20,7 @@ interface ChangeTransactionInteractionIdChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update action for changeTransactionInteractionId on payments

    * + * @return null|string */ public function getChange(); /** + * @return null|TransactionChangeValue */ public function getTransaction(); /** + * @return null|string */ public function getNextValue(); /** + * @return null|string */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeTransactionInteractionIdChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeTransactionInteractionIdChangeBuilder.php index 867e67e2d61..d9d32a80d34 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTransactionInteractionIdChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTransactionInteractionIdChangeBuilder.php @@ -23,21 +23,25 @@ final class ChangeTransactionInteractionIdChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|TransactionChangeValue|TransactionChangeValueBuilder */ private $transaction; /** + * @var ?string */ private $nextValue; /** + * @var ?string */ private $previousValue; @@ -45,6 +49,7 @@ final class ChangeTransactionInteractionIdChangeBuilder implements Builder /** *

    Update action for changeTransactionInteractionId on payments

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|TransactionChangeValue */ public function getTransaction() @@ -61,6 +67,7 @@ public function getTransaction() } /** + * @return null|string */ public function getNextValue() @@ -69,6 +76,7 @@ public function getNextValue() } /** + * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTransactionInteractionIdChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeTransactionInteractionIdChangeModel.php index 4f2b4592ad2..2105530b48c 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTransactionInteractionIdChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTransactionInteractionIdChangeModel.php @@ -24,26 +24,31 @@ final class ChangeTransactionInteractionIdChangeModel extends JsonObjectModel im public const DISCRIMINATOR_VALUE = 'ChangeTransactionInteractionIdChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?TransactionChangeValue */ protected $transaction; /** + * * @var ?string */ protected $nextValue; /** + * * @var ?string */ protected $previousValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?TransactionChangeValue $transaction = null, ?string $nextValue = null, - ?string $previousValue = null + ?string $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->transaction = $transaction; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for changeTransactionInteractionId on payments

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|TransactionChangeValue */ public function getTransaction() @@ -120,6 +129,7 @@ public function getTransaction() } /** + * * @return null|string */ public function getNextValue() @@ -137,6 +147,7 @@ public function getNextValue() } /** + * * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTransactionStateChange.php b/lib/commercetools-history/src/Models/Change/ChangeTransactionStateChange.php index 3568e01a1d9..999711058be 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTransactionStateChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTransactionStateChange.php @@ -22,26 +22,31 @@ interface ChangeTransactionStateChange extends Change /** *

    Update action for changeTransactionState on payments

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|TransactionChangeValue */ public function getTransaction(); /** + * @return null|string */ public function getNextValue(); /** + * @return null|string */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeTransactionStateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeTransactionStateChangeBuilder.php index 83e87e55c1b..b70ef4d4283 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTransactionStateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTransactionStateChangeBuilder.php @@ -23,21 +23,25 @@ final class ChangeTransactionStateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|TransactionChangeValue|TransactionChangeValueBuilder */ private $transaction; /** + * @var ?string */ private $nextValue; /** + * @var ?string */ private $previousValue; @@ -45,6 +49,7 @@ final class ChangeTransactionStateChangeBuilder implements Builder /** *

    Update action for changeTransactionState on payments

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|TransactionChangeValue */ public function getTransaction() @@ -61,6 +67,7 @@ public function getTransaction() } /** + * @return null|string */ public function getNextValue() @@ -69,6 +76,7 @@ public function getNextValue() } /** + * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTransactionStateChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeTransactionStateChangeModel.php index a31372ac02b..0d1bc85a8dd 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTransactionStateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTransactionStateChangeModel.php @@ -24,26 +24,31 @@ final class ChangeTransactionStateChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'ChangeTransactionStateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?TransactionChangeValue */ protected $transaction; /** + * * @var ?string */ protected $nextValue; /** + * * @var ?string */ protected $previousValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?TransactionChangeValue $transaction = null, ?string $nextValue = null, - ?string $previousValue = null + ?string $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->transaction = $transaction; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for changeTransactionState on payments

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|TransactionChangeValue */ public function getTransaction() @@ -120,6 +129,7 @@ public function getTransaction() } /** + * * @return null|string */ public function getNextValue() @@ -137,6 +147,7 @@ public function getNextValue() } /** + * * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTransactionTimestampChange.php b/lib/commercetools-history/src/Models/Change/ChangeTransactionTimestampChange.php index 6151779999f..296ba44c59b 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTransactionTimestampChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTransactionTimestampChange.php @@ -22,26 +22,31 @@ interface ChangeTransactionTimestampChange extends Change /** *

    Update action for changeTransactionTimestamp on payments

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|TransactionChangeValue */ public function getTransaction(); /** + * @return null|string */ public function getNextValue(); /** + * @return null|string */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeTransactionTimestampChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeTransactionTimestampChangeBuilder.php index 521a3fbbb96..96b5323a0d4 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTransactionTimestampChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTransactionTimestampChangeBuilder.php @@ -23,21 +23,25 @@ final class ChangeTransactionTimestampChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|TransactionChangeValue|TransactionChangeValueBuilder */ private $transaction; /** + * @var ?string */ private $nextValue; /** + * @var ?string */ private $previousValue; @@ -45,6 +49,7 @@ final class ChangeTransactionTimestampChangeBuilder implements Builder /** *

    Update action for changeTransactionTimestamp on payments

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|TransactionChangeValue */ public function getTransaction() @@ -61,6 +67,7 @@ public function getTransaction() } /** + * @return null|string */ public function getNextValue() @@ -69,6 +76,7 @@ public function getNextValue() } /** + * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeTransactionTimestampChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeTransactionTimestampChangeModel.php index 8c5d97b94e0..9dbf5b71946 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeTransactionTimestampChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeTransactionTimestampChangeModel.php @@ -24,26 +24,31 @@ final class ChangeTransactionTimestampChangeModel extends JsonObjectModel implem public const DISCRIMINATOR_VALUE = 'ChangeTransactionTimestampChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?TransactionChangeValue */ protected $transaction; /** + * * @var ?string */ protected $nextValue; /** + * * @var ?string */ protected $previousValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?TransactionChangeValue $transaction = null, ?string $nextValue = null, - ?string $previousValue = null + ?string $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->transaction = $transaction; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for changeTransactionTimestamp on payments

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|TransactionChangeValue */ public function getTransaction() @@ -120,6 +129,7 @@ public function getTransaction() } /** + * * @return null|string */ public function getNextValue() @@ -137,6 +147,7 @@ public function getNextValue() } /** + * * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeValueChange.php b/lib/commercetools-history/src/Models/Change/ChangeValueChange.php index 87df5a4c2cc..c107d54c05f 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeValueChange.php +++ b/lib/commercetools-history/src/Models/Change/ChangeValueChange.php @@ -21,21 +21,25 @@ interface ChangeValueChange extends Change /** *

    Update action for changeValue on cart discounts and product discounts

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|ChangeValueChangeValue */ public function getNextValue(); /** + * @return null|ChangeValueChangeValue */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/ChangeValueChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeValueChangeBuilder.php index f3ea0ffd093..ee40d9ffaf6 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeValueChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/ChangeValueChangeBuilder.php @@ -23,16 +23,19 @@ final class ChangeValueChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|ChangeValueChangeValue|ChangeValueChangeValueBuilder */ private $nextValue; /** + * @var null|ChangeValueChangeValue|ChangeValueChangeValueBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class ChangeValueChangeBuilder implements Builder /** *

    Update action for changeValue on cart discounts and product discounts

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|ChangeValueChangeValue */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|ChangeValueChangeValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/ChangeValueChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeValueChangeModel.php index 6a78223753d..09971bac58f 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeValueChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeValueChangeModel.php @@ -24,21 +24,25 @@ final class ChangeValueChangeModel extends JsonObjectModel implements ChangeValu public const DISCRIMINATOR_VALUE = 'ChangeValueChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ChangeValueChangeValue */ protected $nextValue; /** + * * @var ?ChangeValueChangeValue */ protected $previousValue; @@ -50,15 +54,17 @@ final class ChangeValueChangeModel extends JsonObjectModel implements ChangeValu public function __construct( ?string $change = null, ?ChangeValueChangeValue $nextValue = null, - ?ChangeValueChangeValue $previousValue = null + ?ChangeValueChangeValue $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for changeValue on cart discounts and product discounts

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|ChangeValueChangeValue */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|ChangeValueChangeValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/MoveImageToPositionChange.php b/lib/commercetools-history/src/Models/Change/MoveImageToPositionChange.php index 6d415f501dd..650066fb923 100644 --- a/lib/commercetools-history/src/Models/Change/MoveImageToPositionChange.php +++ b/lib/commercetools-history/src/Models/Change/MoveImageToPositionChange.php @@ -20,6 +20,7 @@ interface MoveImageToPositionChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update actions for moving images

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|ImageCollection */ public function getPreviousValue(); /** + * @return null|ImageCollection */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/MoveImageToPositionChangeBuilder.php b/lib/commercetools-history/src/Models/Change/MoveImageToPositionChangeBuilder.php index 35c8923d1f3..e06d53b3500 100644 --- a/lib/commercetools-history/src/Models/Change/MoveImageToPositionChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/MoveImageToPositionChangeBuilder.php @@ -22,21 +22,25 @@ final class MoveImageToPositionChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var ?ImageCollection */ private $previousValue; /** + * @var ?ImageCollection */ private $nextValue; @@ -44,6 +48,7 @@ final class MoveImageToPositionChangeBuilder implements Builder /** *

    Update actions for moving images

    * + * @return null|string */ public function getChange() @@ -52,6 +57,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -60,6 +66,7 @@ public function getCatalogData() } /** + * @return null|ImageCollection */ public function getPreviousValue() @@ -68,6 +75,7 @@ public function getPreviousValue() } /** + * @return null|ImageCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/MoveImageToPositionChangeModel.php b/lib/commercetools-history/src/Models/Change/MoveImageToPositionChangeModel.php index 829df9760a9..6900af9bfad 100644 --- a/lib/commercetools-history/src/Models/Change/MoveImageToPositionChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/MoveImageToPositionChangeModel.php @@ -23,26 +23,31 @@ final class MoveImageToPositionChangeModel extends JsonObjectModel implements Mo public const DISCRIMINATOR_VALUE = 'MoveImageToPositionChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?ImageCollection */ protected $previousValue; /** + * * @var ?ImageCollection */ protected $nextValue; @@ -55,16 +60,18 @@ public function __construct( ?string $change = null, ?string $catalogData = null, ?ImageCollection $previousValue = null, - ?ImageCollection $nextValue = null + ?ImageCollection $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -84,6 +91,7 @@ public function getType() /** *

    Update actions for moving images

    * + * * @return null|string */ public function getChange() @@ -101,6 +109,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -118,6 +127,7 @@ public function getCatalogData() } /** + * * @return null|ImageCollection */ public function getPreviousValue() @@ -135,6 +145,7 @@ public function getPreviousValue() } /** + * * @return null|ImageCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/PublishChange.php b/lib/commercetools-history/src/Models/Change/PublishChange.php index 4c79abc33bb..080f4c7efba 100644 --- a/lib/commercetools-history/src/Models/Change/PublishChange.php +++ b/lib/commercetools-history/src/Models/Change/PublishChange.php @@ -16,11 +16,13 @@ interface PublishChange extends Change /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); diff --git a/lib/commercetools-history/src/Models/Change/PublishChangeBuilder.php b/lib/commercetools-history/src/Models/Change/PublishChangeBuilder.php index 3b40211e359..cf891715d16 100644 --- a/lib/commercetools-history/src/Models/Change/PublishChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/PublishChangeBuilder.php @@ -21,11 +21,13 @@ final class PublishChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @return null|string */ public function getChange() diff --git a/lib/commercetools-history/src/Models/Change/PublishChangeModel.php b/lib/commercetools-history/src/Models/Change/PublishChangeModel.php index e037dc9b7c3..b84615294c9 100644 --- a/lib/commercetools-history/src/Models/Change/PublishChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/PublishChangeModel.php @@ -22,11 +22,13 @@ final class PublishChangeModel extends JsonObjectModel implements PublishChange public const DISCRIMINATOR_VALUE = 'PublishChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; @@ -36,13 +38,15 @@ final class PublishChangeModel extends JsonObjectModel implements PublishChange * @psalm-suppress MissingParamType */ public function __construct( - ?string $change = null + ?string $change = null, + ?string $type = null ) { $this->change = $change; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -60,6 +64,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() diff --git a/lib/commercetools-history/src/Models/Change/RemoveAddressChange.php b/lib/commercetools-history/src/Models/Change/RemoveAddressChange.php index cb8684d0fb6..b22ed73abe2 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveAddressChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveAddressChange.php @@ -20,16 +20,19 @@ interface RemoveAddressChange extends Change /** *

    Update action for removeAddress action.

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|Address */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveAddressChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveAddressChangeBuilder.php index 99f80da2e2d..fec7b5e07dd 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveAddressChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveAddressChangeBuilder.php @@ -23,11 +23,13 @@ final class RemoveAddressChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Address|AddressBuilder */ private $previousValue; @@ -35,6 +37,7 @@ final class RemoveAddressChangeBuilder implements Builder /** *

    Update action for removeAddress action.

    * + * @return null|string */ public function getChange() @@ -43,6 +46,7 @@ public function getChange() } /** + * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveAddressChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveAddressChangeModel.php index da6bee917b8..bf3fad06209 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveAddressChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveAddressChangeModel.php @@ -24,16 +24,19 @@ final class RemoveAddressChangeModel extends JsonObjectModel implements RemoveAd public const DISCRIMINATOR_VALUE = 'RemoveAddressChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Address */ protected $previousValue; @@ -44,14 +47,16 @@ final class RemoveAddressChangeModel extends JsonObjectModel implements RemoveAd */ public function __construct( ?string $change = null, - ?Address $previousValue = null + ?Address $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -71,6 +76,7 @@ public function getType() /** *

    Update action for removeAddress action.

    * + * * @return null|string */ public function getChange() @@ -88,6 +94,7 @@ public function getChange() } /** + * * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveAssetChange.php b/lib/commercetools-history/src/Models/Change/RemoveAssetChange.php index fa8b694db3f..be6a82abf09 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveAssetChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveAssetChange.php @@ -20,16 +20,19 @@ interface RemoveAssetChange extends Change /** *

    Update action for removeAsset

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|Asset */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveAssetChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveAssetChangeBuilder.php index 37a834ebf75..b869642cc45 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveAssetChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveAssetChangeBuilder.php @@ -23,11 +23,13 @@ final class RemoveAssetChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Asset|AssetBuilder */ private $previousValue; @@ -35,6 +37,7 @@ final class RemoveAssetChangeBuilder implements Builder /** *

    Update action for removeAsset

    * + * @return null|string */ public function getChange() @@ -43,6 +46,7 @@ public function getChange() } /** + * @return null|Asset */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveAssetChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveAssetChangeModel.php index 4bc35fd328c..ff243797c61 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveAssetChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveAssetChangeModel.php @@ -24,16 +24,19 @@ final class RemoveAssetChangeModel extends JsonObjectModel implements RemoveAsse public const DISCRIMINATOR_VALUE = 'RemoveAssetChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Asset */ protected $previousValue; @@ -44,14 +47,16 @@ final class RemoveAssetChangeModel extends JsonObjectModel implements RemoveAsse */ public function __construct( ?string $change = null, - ?Asset $previousValue = null + ?Asset $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -71,6 +76,7 @@ public function getType() /** *

    Update action for removeAsset

    * + * * @return null|string */ public function getChange() @@ -88,6 +94,7 @@ public function getChange() } /** + * * @return null|Asset */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveAttributeDefinitionChange.php b/lib/commercetools-history/src/Models/Change/RemoveAttributeDefinitionChange.php index a947f60a5c9..94763946ba8 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveAttributeDefinitionChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveAttributeDefinitionChange.php @@ -18,6 +18,7 @@ interface RemoveAttributeDefinitionChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -25,11 +26,13 @@ public function getType(); /** *

    Update action for removeAttributeDefinition on product types

    * + * @return null|string */ public function getChange(); /** + * @return null|AttributeDefinition */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveAttributeDefinitionChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveAttributeDefinitionChangeBuilder.php index 53e60459235..9b438d178aa 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveAttributeDefinitionChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveAttributeDefinitionChangeBuilder.php @@ -23,11 +23,13 @@ final class RemoveAttributeDefinitionChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|AttributeDefinition|AttributeDefinitionBuilder */ private $previousValue; @@ -35,6 +37,7 @@ final class RemoveAttributeDefinitionChangeBuilder implements Builder /** *

    Update action for removeAttributeDefinition on product types

    * + * @return null|string */ public function getChange() @@ -43,6 +46,7 @@ public function getChange() } /** + * @return null|AttributeDefinition */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveAttributeDefinitionChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveAttributeDefinitionChangeModel.php index 128f59abcd1..1ffc06ed232 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveAttributeDefinitionChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveAttributeDefinitionChangeModel.php @@ -24,16 +24,19 @@ final class RemoveAttributeDefinitionChangeModel extends JsonObjectModel impleme public const DISCRIMINATOR_VALUE = 'RemoveAttributeDefinitionChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?AttributeDefinition */ protected $previousValue; @@ -44,14 +47,16 @@ final class RemoveAttributeDefinitionChangeModel extends JsonObjectModel impleme */ public function __construct( ?string $change = null, - ?AttributeDefinition $previousValue = null + ?AttributeDefinition $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -71,6 +76,7 @@ public function getType() /** *

    Update action for removeAttributeDefinition on product types

    * + * * @return null|string */ public function getChange() @@ -88,6 +94,7 @@ public function getChange() } /** + * * @return null|AttributeDefinition */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveBillingAddressIdChange.php b/lib/commercetools-history/src/Models/Change/RemoveBillingAddressIdChange.php index deacdb89b61..439dd0f0395 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveBillingAddressIdChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveBillingAddressIdChange.php @@ -22,26 +22,31 @@ interface RemoveBillingAddressIdChange extends Change /** *

    Update action for removeBillingAddressId action on customers.

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|array */ public function getNextValue(); /** + * @return null|array */ public function getPreviousValue(); /** + * @return null|Address */ public function getAddress(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveBillingAddressIdChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveBillingAddressIdChangeBuilder.php index b0e43308914..c852ff66c8d 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveBillingAddressIdChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveBillingAddressIdChangeBuilder.php @@ -23,21 +23,25 @@ final class RemoveBillingAddressIdChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?array */ private $nextValue; /** + * @var ?array */ private $previousValue; /** + * @var null|Address|AddressBuilder */ private $address; @@ -45,6 +49,7 @@ final class RemoveBillingAddressIdChangeBuilder implements Builder /** *

    Update action for removeBillingAddressId action on customers.

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|array */ public function getNextValue() @@ -61,6 +67,7 @@ public function getNextValue() } /** + * @return null|array */ public function getPreviousValue() @@ -69,6 +76,7 @@ public function getPreviousValue() } /** + * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-history/src/Models/Change/RemoveBillingAddressIdChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveBillingAddressIdChangeModel.php index e0cba18c594..99569ab9ef4 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveBillingAddressIdChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveBillingAddressIdChangeModel.php @@ -24,26 +24,31 @@ final class RemoveBillingAddressIdChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'RemoveBillingAddressIdChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?array */ protected $nextValue; /** + * * @var ?array */ protected $previousValue; /** + * * @var ?Address */ protected $address; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?array $nextValue = null, ?array $previousValue = null, - ?Address $address = null + ?Address $address = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; $this->address = $address; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for removeBillingAddressId action on customers.

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|array */ public function getNextValue() @@ -119,6 +128,7 @@ public function getNextValue() } /** + * * @return null|array */ public function getPreviousValue() @@ -136,6 +146,7 @@ public function getPreviousValue() } /** + * * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-history/src/Models/Change/RemoveChannelRolesChange.php b/lib/commercetools-history/src/Models/Change/RemoveChannelRolesChange.php index 38a64a56194..34afe8d0099 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveChannelRolesChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveChannelRolesChange.php @@ -18,21 +18,25 @@ interface RemoveChannelRolesChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|array */ public function getPreviousValue(); /** + * @return null|array */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveChannelRolesChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveChannelRolesChangeBuilder.php index 2b99125ba31..1efd912869e 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveChannelRolesChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveChannelRolesChangeBuilder.php @@ -21,21 +21,25 @@ final class RemoveChannelRolesChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?array */ private $previousValue; /** + * @var ?array */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -44,6 +48,7 @@ public function getChange() } /** + * @return null|array */ public function getPreviousValue() @@ -52,6 +57,7 @@ public function getPreviousValue() } /** + * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveChannelRolesChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveChannelRolesChangeModel.php index 7c58e13211f..54aecc1b40b 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveChannelRolesChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveChannelRolesChangeModel.php @@ -22,21 +22,25 @@ final class RemoveChannelRolesChangeModel extends JsonObjectModel implements Rem public const DISCRIMINATOR_VALUE = 'RemoveChannelRolesChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?array */ protected $previousValue; /** + * * @var ?array */ protected $nextValue; @@ -48,15 +52,17 @@ final class RemoveChannelRolesChangeModel extends JsonObjectModel implements Rem public function __construct( ?string $change = null, ?array $previousValue = null, - ?array $nextValue = null + ?array $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -74,6 +80,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -91,6 +98,7 @@ public function getChange() } /** + * * @return null|array */ public function getPreviousValue() @@ -108,6 +116,7 @@ public function getPreviousValue() } /** + * * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveCustomLineItemChange.php b/lib/commercetools-history/src/Models/Change/RemoveCustomLineItemChange.php index 30ee23fed4d..3d4954da894 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveCustomLineItemChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveCustomLineItemChange.php @@ -19,6 +19,7 @@ interface RemoveCustomLineItemChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for adding and removing custom line items

    * + * @return null|string */ public function getChange(); /** + * @return null|CustomLineItem */ public function getNextValue(); /** + * @return null|CustomLineItem */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveCustomLineItemChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveCustomLineItemChangeBuilder.php index 723909680d8..0244fe279fc 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveCustomLineItemChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveCustomLineItemChangeBuilder.php @@ -23,16 +23,19 @@ final class RemoveCustomLineItemChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|CustomLineItem|CustomLineItemBuilder */ private $nextValue; /** + * @var null|CustomLineItem|CustomLineItemBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class RemoveCustomLineItemChangeBuilder implements Builder /** *

    Update action for adding and removing custom line items

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|CustomLineItem */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|CustomLineItem */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveCustomLineItemChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveCustomLineItemChangeModel.php index 81f440963e6..c7c51b5510b 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveCustomLineItemChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveCustomLineItemChangeModel.php @@ -24,21 +24,25 @@ final class RemoveCustomLineItemChangeModel extends JsonObjectModel implements R public const DISCRIMINATOR_VALUE = 'RemoveCustomLineItemChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?CustomLineItem */ protected $nextValue; /** + * * @var ?CustomLineItem */ protected $previousValue; @@ -50,15 +54,17 @@ final class RemoveCustomLineItemChangeModel extends JsonObjectModel implements R public function __construct( ?string $change = null, ?CustomLineItem $nextValue = null, - ?CustomLineItem $previousValue = null + ?CustomLineItem $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for adding and removing custom line items

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|CustomLineItem */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|CustomLineItem */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveDeliveryItemsChange.php b/lib/commercetools-history/src/Models/Change/RemoveDeliveryItemsChange.php index ba4a92c276d..8b0d2b3d5c5 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveDeliveryItemsChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveDeliveryItemsChange.php @@ -18,6 +18,7 @@ interface RemoveDeliveryItemsChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -25,11 +26,13 @@ public function getType(); /** *

    Update action for removeDelivery

    * + * @return null|string */ public function getChange(); /** + * @return null|Delivery */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveDeliveryItemsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveDeliveryItemsChangeBuilder.php index f18286008e5..e19a7fe6457 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveDeliveryItemsChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveDeliveryItemsChangeBuilder.php @@ -23,11 +23,13 @@ final class RemoveDeliveryItemsChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Delivery|DeliveryBuilder */ private $previousValue; @@ -35,6 +37,7 @@ final class RemoveDeliveryItemsChangeBuilder implements Builder /** *

    Update action for removeDelivery

    * + * @return null|string */ public function getChange() @@ -43,6 +46,7 @@ public function getChange() } /** + * @return null|Delivery */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveDeliveryItemsChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveDeliveryItemsChangeModel.php index 14c49103c5d..6e066937151 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveDeliveryItemsChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveDeliveryItemsChangeModel.php @@ -24,16 +24,19 @@ final class RemoveDeliveryItemsChangeModel extends JsonObjectModel implements Re public const DISCRIMINATOR_VALUE = 'RemoveDeliveryItemsChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Delivery */ protected $previousValue; @@ -44,14 +47,16 @@ final class RemoveDeliveryItemsChangeModel extends JsonObjectModel implements Re */ public function __construct( ?string $change = null, - ?Delivery $previousValue = null + ?Delivery $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -71,6 +76,7 @@ public function getType() /** *

    Update action for removeDelivery

    * + * * @return null|string */ public function getChange() @@ -88,6 +94,7 @@ public function getChange() } /** + * * @return null|Delivery */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveDiscountCodeChange.php b/lib/commercetools-history/src/Models/Change/RemoveDiscountCodeChange.php index f6b00d99bf6..fd6241c920e 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveDiscountCodeChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveDiscountCodeChange.php @@ -18,6 +18,7 @@ interface RemoveDiscountCodeChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -25,11 +26,13 @@ public function getType(); /** *

    Update action for removeDiscountCode

    * + * @return null|string */ public function getChange(); /** + * @return null|DiscountCodeInfo */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveDiscountCodeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveDiscountCodeChangeBuilder.php index 6b5d237546f..2b7c372c29e 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveDiscountCodeChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveDiscountCodeChangeBuilder.php @@ -23,11 +23,13 @@ final class RemoveDiscountCodeChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|DiscountCodeInfo|DiscountCodeInfoBuilder */ private $previousValue; @@ -35,6 +37,7 @@ final class RemoveDiscountCodeChangeBuilder implements Builder /** *

    Update action for removeDiscountCode

    * + * @return null|string */ public function getChange() @@ -43,6 +46,7 @@ public function getChange() } /** + * @return null|DiscountCodeInfo */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveDiscountCodeChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveDiscountCodeChangeModel.php index b2ef95c29a2..0f1c439b4fb 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveDiscountCodeChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveDiscountCodeChangeModel.php @@ -24,16 +24,19 @@ final class RemoveDiscountCodeChangeModel extends JsonObjectModel implements Rem public const DISCRIMINATOR_VALUE = 'RemoveDiscountCodeChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?DiscountCodeInfo */ protected $previousValue; @@ -44,14 +47,16 @@ final class RemoveDiscountCodeChangeModel extends JsonObjectModel implements Rem */ public function __construct( ?string $change = null, - ?DiscountCodeInfo $previousValue = null + ?DiscountCodeInfo $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -71,6 +76,7 @@ public function getType() /** *

    Update action for removeDiscountCode

    * + * * @return null|string */ public function getChange() @@ -88,6 +94,7 @@ public function getChange() } /** + * * @return null|DiscountCodeInfo */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveEnumValuesChange.php b/lib/commercetools-history/src/Models/Change/RemoveEnumValuesChange.php index 3def9c0d078..adfbd5796a8 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveEnumValuesChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveEnumValuesChange.php @@ -19,6 +19,7 @@ interface RemoveEnumValuesChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,6 +27,7 @@ public function getType(); /** *

    Update action for removeEnumValues on product types

    * + * @return null|string */ public function getChange(); @@ -33,11 +35,13 @@ public function getChange(); /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName(); /** + * @return null|EnumValue */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveEnumValuesChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveEnumValuesChangeBuilder.php index 196d623fac3..7bc5585b75c 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveEnumValuesChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveEnumValuesChangeBuilder.php @@ -23,16 +23,19 @@ final class RemoveEnumValuesChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $attributeName; /** + * @var null|EnumValue|EnumValueBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class RemoveEnumValuesChangeBuilder implements Builder /** *

    Update action for removeEnumValues on product types

    * + * @return null|string */ public function getChange() @@ -50,6 +54,7 @@ public function getChange() /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName() @@ -58,6 +63,7 @@ public function getAttributeName() } /** + * @return null|EnumValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveEnumValuesChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveEnumValuesChangeModel.php index a82b615ae76..dc2c1fc712c 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveEnumValuesChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveEnumValuesChangeModel.php @@ -24,21 +24,25 @@ final class RemoveEnumValuesChangeModel extends JsonObjectModel implements Remov public const DISCRIMINATOR_VALUE = 'RemoveEnumValuesChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?EnumValue */ protected $previousValue; @@ -50,15 +54,17 @@ final class RemoveEnumValuesChangeModel extends JsonObjectModel implements Remov public function __construct( ?string $change = null, ?string $attributeName = null, - ?EnumValue $previousValue = null + ?EnumValue $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->attributeName = $attributeName; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for removeEnumValues on product types

    * + * * @return null|string */ public function getChange() @@ -97,6 +104,7 @@ public function getChange() /** *

    The name of the attribute updated.

    * + * * @return null|string */ public function getAttributeName() @@ -114,6 +122,7 @@ public function getAttributeName() } /** + * * @return null|EnumValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveFieldDefinitionChange.php b/lib/commercetools-history/src/Models/Change/RemoveFieldDefinitionChange.php index 2baa5353bc1..f85a0aa9fb0 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveFieldDefinitionChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveFieldDefinitionChange.php @@ -18,6 +18,7 @@ interface RemoveFieldDefinitionChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -25,11 +26,13 @@ public function getType(); /** *

    Update action for removeFieldDefinition on payments

    * + * @return null|string */ public function getChange(); /** + * @return null|FieldDefinition */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveFieldDefinitionChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveFieldDefinitionChangeBuilder.php index 3e491b94178..d98024a0bf5 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveFieldDefinitionChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveFieldDefinitionChangeBuilder.php @@ -23,11 +23,13 @@ final class RemoveFieldDefinitionChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|FieldDefinition|FieldDefinitionBuilder */ private $previousValue; @@ -35,6 +37,7 @@ final class RemoveFieldDefinitionChangeBuilder implements Builder /** *

    Update action for removeFieldDefinition on payments

    * + * @return null|string */ public function getChange() @@ -43,6 +46,7 @@ public function getChange() } /** + * @return null|FieldDefinition */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveFieldDefinitionChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveFieldDefinitionChangeModel.php index 83bf0a4a8dd..2ca2c323a5a 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveFieldDefinitionChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveFieldDefinitionChangeModel.php @@ -24,16 +24,19 @@ final class RemoveFieldDefinitionChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'RemoveFieldDefinitionChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?FieldDefinition */ protected $previousValue; @@ -44,14 +47,16 @@ final class RemoveFieldDefinitionChangeModel extends JsonObjectModel implements */ public function __construct( ?string $change = null, - ?FieldDefinition $previousValue = null + ?FieldDefinition $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -71,6 +76,7 @@ public function getType() /** *

    Update action for removeFieldDefinition on payments

    * + * * @return null|string */ public function getChange() @@ -88,6 +94,7 @@ public function getChange() } /** + * * @return null|FieldDefinition */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveFromCategoryChange.php b/lib/commercetools-history/src/Models/Change/RemoveFromCategoryChange.php index 75f13dbdb40..f9592939471 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveFromCategoryChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveFromCategoryChange.php @@ -21,6 +21,7 @@ interface RemoveFromCategoryChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -28,21 +29,25 @@ public function getType(); /** *

    Update action for addToCategory

    * + * @return null|string */ public function getChange(); /** + * @return null|Reference */ public function getCategory(); /** + * @return null|ReferenceCollection */ public function getPreviousValue(); /** + * @return null|ReferenceCollection */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveFromCategoryChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveFromCategoryChangeBuilder.php index 725fc47a9d4..c084f5dfda0 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveFromCategoryChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveFromCategoryChangeBuilder.php @@ -24,21 +24,25 @@ final class RemoveFromCategoryChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Reference|ReferenceBuilder */ private $category; /** + * @var ?ReferenceCollection */ private $previousValue; /** + * @var ?ReferenceCollection */ private $nextValue; @@ -46,6 +50,7 @@ final class RemoveFromCategoryChangeBuilder implements Builder /** *

    Update action for addToCategory

    * + * @return null|string */ public function getChange() @@ -54,6 +59,7 @@ public function getChange() } /** + * @return null|Reference */ public function getCategory() @@ -62,6 +68,7 @@ public function getCategory() } /** + * @return null|ReferenceCollection */ public function getPreviousValue() @@ -70,6 +77,7 @@ public function getPreviousValue() } /** + * @return null|ReferenceCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveFromCategoryChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveFromCategoryChangeModel.php index 0875bc53887..f98e54ca1c7 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveFromCategoryChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveFromCategoryChangeModel.php @@ -25,26 +25,31 @@ final class RemoveFromCategoryChangeModel extends JsonObjectModel implements Rem public const DISCRIMINATOR_VALUE = 'RemoveFromCategoryChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Reference */ protected $category; /** + * * @var ?ReferenceCollection */ protected $previousValue; /** + * * @var ?ReferenceCollection */ protected $nextValue; @@ -57,16 +62,18 @@ public function __construct( ?string $change = null, ?Reference $category = null, ?ReferenceCollection $previousValue = null, - ?ReferenceCollection $nextValue = null + ?ReferenceCollection $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->category = $category; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -86,6 +93,7 @@ public function getType() /** *

    Update action for addToCategory

    * + * * @return null|string */ public function getChange() @@ -103,6 +111,7 @@ public function getChange() } /** + * * @return null|Reference */ public function getCategory() @@ -121,6 +130,7 @@ public function getCategory() } /** + * * @return null|ReferenceCollection */ public function getPreviousValue() @@ -138,6 +148,7 @@ public function getPreviousValue() } /** + * * @return null|ReferenceCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveImageChange.php b/lib/commercetools-history/src/Models/Change/RemoveImageChange.php index 48251a6fd2f..04a7b231a5e 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveImageChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveImageChange.php @@ -20,6 +20,7 @@ interface RemoveImageChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update actions for removing images

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|ImageCollection */ public function getPreviousValue(); /** + * @return null|ImageCollection */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveImageChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveImageChangeBuilder.php index 79d99cd4f41..b59d59af962 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveImageChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveImageChangeBuilder.php @@ -22,21 +22,25 @@ final class RemoveImageChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var ?ImageCollection */ private $previousValue; /** + * @var ?ImageCollection */ private $nextValue; @@ -44,6 +48,7 @@ final class RemoveImageChangeBuilder implements Builder /** *

    Update actions for removing images

    * + * @return null|string */ public function getChange() @@ -52,6 +57,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -60,6 +66,7 @@ public function getCatalogData() } /** + * @return null|ImageCollection */ public function getPreviousValue() @@ -68,6 +75,7 @@ public function getPreviousValue() } /** + * @return null|ImageCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveImageChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveImageChangeModel.php index 22fb63ddcc3..8954e90fd4e 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveImageChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveImageChangeModel.php @@ -23,26 +23,31 @@ final class RemoveImageChangeModel extends JsonObjectModel implements RemoveImag public const DISCRIMINATOR_VALUE = 'RemoveImageChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?ImageCollection */ protected $previousValue; /** + * * @var ?ImageCollection */ protected $nextValue; @@ -55,16 +60,18 @@ public function __construct( ?string $change = null, ?string $catalogData = null, ?ImageCollection $previousValue = null, - ?ImageCollection $nextValue = null + ?ImageCollection $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -84,6 +91,7 @@ public function getType() /** *

    Update actions for removing images

    * + * * @return null|string */ public function getChange() @@ -101,6 +109,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -118,6 +127,7 @@ public function getCatalogData() } /** + * * @return null|ImageCollection */ public function getPreviousValue() @@ -135,6 +145,7 @@ public function getPreviousValue() } /** + * * @return null|ImageCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveItemShippingAddressesChange.php b/lib/commercetools-history/src/Models/Change/RemoveItemShippingAddressesChange.php index c1b6c214357..986d0171548 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveItemShippingAddressesChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveItemShippingAddressesChange.php @@ -19,6 +19,7 @@ interface RemoveItemShippingAddressesChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for removeItemShippingAddress

    * + * @return null|string */ public function getChange(); /** + * @return null|Address */ public function getNextValue(); /** + * @return null|Address */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveItemShippingAddressesChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveItemShippingAddressesChangeBuilder.php index 6fc496ddee7..886e935fa1c 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveItemShippingAddressesChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveItemShippingAddressesChangeBuilder.php @@ -23,16 +23,19 @@ final class RemoveItemShippingAddressesChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Address|AddressBuilder */ private $nextValue; /** + * @var null|Address|AddressBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class RemoveItemShippingAddressesChangeBuilder implements Builder /** *

    Update action for removeItemShippingAddress

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Address */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveItemShippingAddressesChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveItemShippingAddressesChangeModel.php index f8fffd79d4d..d947adb31e8 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveItemShippingAddressesChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveItemShippingAddressesChangeModel.php @@ -24,21 +24,25 @@ final class RemoveItemShippingAddressesChangeModel extends JsonObjectModel imple public const DISCRIMINATOR_VALUE = 'RemoveItemShippingAddressesChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Address */ protected $nextValue; /** + * * @var ?Address */ protected $previousValue; @@ -50,15 +54,17 @@ final class RemoveItemShippingAddressesChangeModel extends JsonObjectModel imple public function __construct( ?string $change = null, ?Address $nextValue = null, - ?Address $previousValue = null + ?Address $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for removeItemShippingAddress

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Address */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveLocalizedEnumValuesChange.php b/lib/commercetools-history/src/Models/Change/RemoveLocalizedEnumValuesChange.php index 9b9a0fa3c20..2a356dddae5 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveLocalizedEnumValuesChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveLocalizedEnumValuesChange.php @@ -19,6 +19,7 @@ interface RemoveLocalizedEnumValuesChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,6 +27,7 @@ public function getType(); /** *

    Update action for removeEnumValues on product types

    * + * @return null|string */ public function getChange(); @@ -33,11 +35,13 @@ public function getChange(); /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName(); /** + * @return null|LocalizedEnumValue */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveLocalizedEnumValuesChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveLocalizedEnumValuesChangeBuilder.php index 89973baa00f..d6cf9ffb31d 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveLocalizedEnumValuesChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveLocalizedEnumValuesChangeBuilder.php @@ -23,16 +23,19 @@ final class RemoveLocalizedEnumValuesChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $attributeName; /** + * @var null|LocalizedEnumValue|LocalizedEnumValueBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class RemoveLocalizedEnumValuesChangeBuilder implements Builder /** *

    Update action for removeEnumValues on product types

    * + * @return null|string */ public function getChange() @@ -50,6 +54,7 @@ public function getChange() /** *

    The name of the attribute updated.

    * + * @return null|string */ public function getAttributeName() @@ -58,6 +63,7 @@ public function getAttributeName() } /** + * @return null|LocalizedEnumValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveLocalizedEnumValuesChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveLocalizedEnumValuesChangeModel.php index 08503357c35..040e7dac325 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveLocalizedEnumValuesChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveLocalizedEnumValuesChangeModel.php @@ -24,21 +24,25 @@ final class RemoveLocalizedEnumValuesChangeModel extends JsonObjectModel impleme public const DISCRIMINATOR_VALUE = 'RemoveLocalizedEnumValuesChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?LocalizedEnumValue */ protected $previousValue; @@ -50,15 +54,17 @@ final class RemoveLocalizedEnumValuesChangeModel extends JsonObjectModel impleme public function __construct( ?string $change = null, ?string $attributeName = null, - ?LocalizedEnumValue $previousValue = null + ?LocalizedEnumValue $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->attributeName = $attributeName; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for removeEnumValues on product types

    * + * * @return null|string */ public function getChange() @@ -97,6 +104,7 @@ public function getChange() /** *

    The name of the attribute updated.

    * + * * @return null|string */ public function getAttributeName() @@ -114,6 +122,7 @@ public function getAttributeName() } /** + * * @return null|LocalizedEnumValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveLocationChange.php b/lib/commercetools-history/src/Models/Change/RemoveLocationChange.php index 94e73888efd..465669821aa 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveLocationChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveLocationChange.php @@ -19,6 +19,7 @@ interface RemoveLocationChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,6 +27,7 @@ public function getType(); /** *

    Update action for removeLocation on zones

    * + * @return null|string */ public function getChange(); @@ -33,6 +35,7 @@ public function getChange(); /** *

    Shape of the value for addLocation and removeLocation actions

    * + * @return null|Location */ public function getPreviousValue(); @@ -40,6 +43,7 @@ public function getPreviousValue(); /** *

    Shape of the value for addLocation and removeLocation actions

    * + * @return null|Location */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveLocationChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveLocationChangeBuilder.php index dc4cfa84207..8c96a8c0c90 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveLocationChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveLocationChangeBuilder.php @@ -23,16 +23,19 @@ final class RemoveLocationChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Location|LocationBuilder */ private $previousValue; /** + * @var null|Location|LocationBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class RemoveLocationChangeBuilder implements Builder /** *

    Update action for removeLocation on zones

    * + * @return null|string */ public function getChange() @@ -50,6 +54,7 @@ public function getChange() /** *

    Shape of the value for addLocation and removeLocation actions

    * + * @return null|Location */ public function getPreviousValue() @@ -60,6 +65,7 @@ public function getPreviousValue() /** *

    Shape of the value for addLocation and removeLocation actions

    * + * @return null|Location */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveLocationChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveLocationChangeModel.php index 1948d102d35..4ae9a1304fd 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveLocationChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveLocationChangeModel.php @@ -24,21 +24,25 @@ final class RemoveLocationChangeModel extends JsonObjectModel implements RemoveL public const DISCRIMINATOR_VALUE = 'RemoveLocationChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Location */ protected $previousValue; /** + * * @var ?Location */ protected $nextValue; @@ -50,15 +54,17 @@ final class RemoveLocationChangeModel extends JsonObjectModel implements RemoveL public function __construct( ?string $change = null, ?Location $previousValue = null, - ?Location $nextValue = null + ?Location $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for removeLocation on zones

    * + * * @return null|string */ public function getChange() @@ -97,6 +104,7 @@ public function getChange() /** *

    Shape of the value for addLocation and removeLocation actions

    * + * * @return null|Location */ public function getPreviousValue() @@ -117,6 +125,7 @@ public function getPreviousValue() /** *

    Shape of the value for addLocation and removeLocation actions

    * + * * @return null|Location */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveOrderLineItemChange.php b/lib/commercetools-history/src/Models/Change/RemoveOrderLineItemChange.php index 372423254b9..8932c3c914e 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveOrderLineItemChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveOrderLineItemChange.php @@ -19,21 +19,25 @@ interface RemoveOrderLineItemChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|LineItem */ public function getPreviousValue(); /** + * @return null|LineItem */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveOrderLineItemChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveOrderLineItemChangeBuilder.php index 5f13721b790..c8105ef0ebc 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveOrderLineItemChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveOrderLineItemChangeBuilder.php @@ -23,21 +23,25 @@ final class RemoveOrderLineItemChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LineItem|LineItemBuilder */ private $previousValue; /** + * @var null|LineItem|LineItemBuilder */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|LineItem */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|LineItem */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveOrderLineItemChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveOrderLineItemChangeModel.php index 7b1d8997e5b..cf52745a84c 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveOrderLineItemChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveOrderLineItemChangeModel.php @@ -24,21 +24,25 @@ final class RemoveOrderLineItemChangeModel extends JsonObjectModel implements Re public const DISCRIMINATOR_VALUE = 'RemoveOrderLineItemChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LineItem */ protected $previousValue; /** + * * @var ?LineItem */ protected $nextValue; @@ -50,15 +54,17 @@ final class RemoveOrderLineItemChangeModel extends JsonObjectModel implements Re public function __construct( ?string $change = null, ?LineItem $previousValue = null, - ?LineItem $nextValue = null + ?LineItem $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|LineItem */ public function getPreviousValue() @@ -111,6 +119,7 @@ public function getPreviousValue() } /** + * * @return null|LineItem */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveParcelFromDeliveryChange.php b/lib/commercetools-history/src/Models/Change/RemoveParcelFromDeliveryChange.php index 98e5c1188f2..f6f7e5f614d 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveParcelFromDeliveryChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveParcelFromDeliveryChange.php @@ -19,6 +19,7 @@ interface RemoveParcelFromDeliveryChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for removeParcelFromDelivery

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getDeliveryId(); /** + * @return null|Parcel */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveParcelFromDeliveryChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveParcelFromDeliveryChangeBuilder.php index 77ca7f5dc05..085de998146 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveParcelFromDeliveryChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveParcelFromDeliveryChangeBuilder.php @@ -23,16 +23,19 @@ final class RemoveParcelFromDeliveryChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $deliveryId; /** + * @var null|Parcel|ParcelBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class RemoveParcelFromDeliveryChangeBuilder implements Builder /** *

    Update action for removeParcelFromDelivery

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|string */ public function getDeliveryId() @@ -56,6 +61,7 @@ public function getDeliveryId() } /** + * @return null|Parcel */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveParcelFromDeliveryChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveParcelFromDeliveryChangeModel.php index 0a0f9ab8012..fd9cc292ecf 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveParcelFromDeliveryChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveParcelFromDeliveryChangeModel.php @@ -24,21 +24,25 @@ final class RemoveParcelFromDeliveryChangeModel extends JsonObjectModel implemen public const DISCRIMINATOR_VALUE = 'RemoveParcelFromDeliveryChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?Parcel */ protected $previousValue; @@ -50,15 +54,17 @@ final class RemoveParcelFromDeliveryChangeModel extends JsonObjectModel implemen public function __construct( ?string $change = null, ?string $deliveryId = null, - ?Parcel $previousValue = null + ?Parcel $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->deliveryId = $deliveryId; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for removeParcelFromDelivery

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|string */ public function getDeliveryId() @@ -112,6 +120,7 @@ public function getDeliveryId() } /** + * * @return null|Parcel */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemovePaymentChange.php b/lib/commercetools-history/src/Models/Change/RemovePaymentChange.php index 957f246c4fa..957a0c81fa0 100644 --- a/lib/commercetools-history/src/Models/Change/RemovePaymentChange.php +++ b/lib/commercetools-history/src/Models/Change/RemovePaymentChange.php @@ -19,6 +19,7 @@ interface RemovePaymentChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for addPayment & removePayment

    * + * @return null|string */ public function getChange(); /** + * @return null|PaymentInfo */ public function getNextValue(); /** + * @return null|PaymentInfo */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemovePaymentChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemovePaymentChangeBuilder.php index 2135e307772..c7118a25b5d 100644 --- a/lib/commercetools-history/src/Models/Change/RemovePaymentChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemovePaymentChangeBuilder.php @@ -23,16 +23,19 @@ final class RemovePaymentChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|PaymentInfo|PaymentInfoBuilder */ private $nextValue; /** + * @var null|PaymentInfo|PaymentInfoBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class RemovePaymentChangeBuilder implements Builder /** *

    Update action for addPayment & removePayment

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|PaymentInfo */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|PaymentInfo */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemovePaymentChangeModel.php b/lib/commercetools-history/src/Models/Change/RemovePaymentChangeModel.php index 95ceada3bb7..afe06590002 100644 --- a/lib/commercetools-history/src/Models/Change/RemovePaymentChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemovePaymentChangeModel.php @@ -24,21 +24,25 @@ final class RemovePaymentChangeModel extends JsonObjectModel implements RemovePa public const DISCRIMINATOR_VALUE = 'RemovePaymentChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?PaymentInfo */ protected $nextValue; /** + * * @var ?PaymentInfo */ protected $previousValue; @@ -50,15 +54,17 @@ final class RemovePaymentChangeModel extends JsonObjectModel implements RemovePa public function __construct( ?string $change = null, ?PaymentInfo $nextValue = null, - ?PaymentInfo $previousValue = null + ?PaymentInfo $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for addPayment & removePayment

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|PaymentInfo */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|PaymentInfo */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemovePriceChange.php b/lib/commercetools-history/src/Models/Change/RemovePriceChange.php index b92d2dc2a27..7b6032ba642 100644 --- a/lib/commercetools-history/src/Models/Change/RemovePriceChange.php +++ b/lib/commercetools-history/src/Models/Change/RemovePriceChange.php @@ -21,6 +21,7 @@ interface RemovePriceChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -28,26 +29,31 @@ public function getType(); /** *

    Update action for removing prices

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|string */ public function getPriceId(); /** + * @return null|Price */ public function getPreviousValue(); /** + * @return null|Price */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemovePriceChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemovePriceChangeBuilder.php index 7f8beeb1864..39407f133c2 100644 --- a/lib/commercetools-history/src/Models/Change/RemovePriceChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemovePriceChangeBuilder.php @@ -23,26 +23,31 @@ final class RemovePriceChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var ?string */ private $priceId; /** + * @var null|Price|PriceBuilder */ private $previousValue; /** + * @var null|Price|PriceBuilder */ private $nextValue; @@ -50,6 +55,7 @@ final class RemovePriceChangeBuilder implements Builder /** *

    Update action for removing prices

    * + * @return null|string */ public function getChange() @@ -58,6 +64,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -66,6 +73,7 @@ public function getCatalogData() } /** + * @return null|string */ public function getPriceId() @@ -74,6 +82,7 @@ public function getPriceId() } /** + * @return null|Price */ public function getPreviousValue() @@ -82,6 +91,7 @@ public function getPreviousValue() } /** + * @return null|Price */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemovePriceChangeModel.php b/lib/commercetools-history/src/Models/Change/RemovePriceChangeModel.php index 46f01a01c6b..aaffce263a0 100644 --- a/lib/commercetools-history/src/Models/Change/RemovePriceChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemovePriceChangeModel.php @@ -24,31 +24,37 @@ final class RemovePriceChangeModel extends JsonObjectModel implements RemovePric public const DISCRIMINATOR_VALUE = 'RemovePriceChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?string */ protected $priceId; /** + * * @var ?Price */ protected $previousValue; /** + * * @var ?Price */ protected $nextValue; @@ -62,17 +68,19 @@ public function __construct( ?string $catalogData = null, ?string $priceId = null, ?Price $previousValue = null, - ?Price $nextValue = null + ?Price $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->priceId = $priceId; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -92,6 +100,7 @@ public function getType() /** *

    Update action for removing prices

    * + * * @return null|string */ public function getChange() @@ -109,6 +118,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -126,6 +136,7 @@ public function getCatalogData() } /** + * * @return null|string */ public function getPriceId() @@ -143,6 +154,7 @@ public function getPriceId() } /** + * * @return null|Price */ public function getPreviousValue() @@ -161,6 +173,7 @@ public function getPreviousValue() } /** + * * @return null|Price */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveProductChange.php b/lib/commercetools-history/src/Models/Change/RemoveProductChange.php new file mode 100644 index 00000000000..76958c18200 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/RemoveProductChange.php @@ -0,0 +1,49 @@ +Update action for when a product is unassigned from a product selection

    + * + + * @return null|string + */ + public function getChange(); + + /** + + * @return null|Reference + */ + public function getPreviousValue(); + + /** + * @param ?string $change + */ + public function setChange(?string $change): void; + + /** + * @param ?Reference $previousValue + */ + public function setPreviousValue(?Reference $previousValue): void; +} diff --git a/lib/commercetools-history/src/Models/Change/RemoveProductChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveProductChangeBuilder.php new file mode 100644 index 00000000000..29263b3b23c --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/RemoveProductChangeBuilder.php @@ -0,0 +1,102 @@ + + */ +final class RemoveProductChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $previousValue; + + /** + *

    Update action for when a product is unassigned from a product selection

    + * + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + + * @return null|Reference + */ + public function getPreviousValue() + { + return $this->previousValue instanceof ReferenceBuilder ? $this->previousValue->build() : $this->previousValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?Reference $previousValue + * @return $this + */ + public function withPreviousValue(?Reference $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @deprecated use withPreviousValue() instead + * @return $this + */ + public function withPreviousValueBuilder(?ReferenceBuilder $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + public function build(): RemoveProductChange + { + return new RemoveProductChangeModel( + $this->change, + $this->previousValue instanceof ReferenceBuilder ? $this->previousValue->build() : $this->previousValue + ); + } + + public static function of(): RemoveProductChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/RemoveProductChangeCollection.php b/lib/commercetools-history/src/Models/Change/RemoveProductChangeCollection.php new file mode 100644 index 00000000000..05be89ea7e5 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/RemoveProductChangeCollection.php @@ -0,0 +1,56 @@ + + * @method RemoveProductChange current() + * @method RemoveProductChange end() + * @method RemoveProductChange at($offset) + */ +class RemoveProductChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert RemoveProductChange $value + * @psalm-param RemoveProductChange|stdClass $value + * @throws InvalidArgumentException + * + * @return RemoveProductChangeCollection + */ + public function add($value) + { + if (!$value instanceof RemoveProductChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?RemoveProductChange + */ + protected function mapper() + { + return function (?int $index): ?RemoveProductChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var RemoveProductChange $data */ + $data = RemoveProductChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/RemoveProductChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveProductChangeModel.php new file mode 100644 index 00000000000..9858b85b4a7 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/RemoveProductChangeModel.php @@ -0,0 +1,134 @@ +change = $change; + $this->previousValue = $previousValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Update action for when a product is unassigned from a product selection

    + * + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + * + * @return null|Reference + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + + $this->previousValue = ReferenceModel::of($data); + } + + return $this->previousValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?Reference $previousValue + */ + public function setPreviousValue(?Reference $previousValue): void + { + $this->previousValue = $previousValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Change/RemovePropertyChange.php b/lib/commercetools-history/src/Models/Change/RemovePropertyChange.php index 1906cb28498..60974209cca 100644 --- a/lib/commercetools-history/src/Models/Change/RemovePropertyChange.php +++ b/lib/commercetools-history/src/Models/Change/RemovePropertyChange.php @@ -18,6 +18,7 @@ interface RemovePropertyChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -25,6 +26,7 @@ public function getType(); /** *

    Update action for removeProperty on custom objects

    * + * @return null|string */ public function getChange(); @@ -32,11 +34,13 @@ public function getChange(); /** *

    Value path to the property that was removed

    * + * @return null|string */ public function getPath(); /** + * @return null|mixed */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemovePropertyChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemovePropertyChangeBuilder.php index b87503ed69b..8008af2f63e 100644 --- a/lib/commercetools-history/src/Models/Change/RemovePropertyChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemovePropertyChangeBuilder.php @@ -21,16 +21,19 @@ final class RemovePropertyChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $path; /** + * @var null|mixed|mixed */ private $previousValue; @@ -38,6 +41,7 @@ final class RemovePropertyChangeBuilder implements Builder /** *

    Update action for removeProperty on custom objects

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() /** *

    Value path to the property that was removed

    * + * @return null|string */ public function getPath() @@ -56,6 +61,7 @@ public function getPath() } /** + * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemovePropertyChangeModel.php b/lib/commercetools-history/src/Models/Change/RemovePropertyChangeModel.php index 96bc5b0ec6b..571922a5e2b 100644 --- a/lib/commercetools-history/src/Models/Change/RemovePropertyChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemovePropertyChangeModel.php @@ -22,21 +22,25 @@ final class RemovePropertyChangeModel extends JsonObjectModel implements RemoveP public const DISCRIMINATOR_VALUE = 'RemovePropertyChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $path; /** + * * @var ?mixed */ protected $previousValue; @@ -48,15 +52,17 @@ final class RemovePropertyChangeModel extends JsonObjectModel implements RemoveP public function __construct( ?string $change = null, ?string $path = null, - $previousValue = null + $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->path = $path; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Update action for removeProperty on custom objects

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() /** *

    Value path to the property that was removed

    * + * * @return null|string */ public function getPath() @@ -112,6 +120,7 @@ public function getPath() } /** + * * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveShippingAddressIdChange.php b/lib/commercetools-history/src/Models/Change/RemoveShippingAddressIdChange.php index 5b3e8b840ff..6a0cf99f976 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveShippingAddressIdChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveShippingAddressIdChange.php @@ -22,26 +22,31 @@ interface RemoveShippingAddressIdChange extends Change /** *

    Update action for removeShippingAddressId action on customers.

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|array */ public function getNextValue(); /** + * @return null|array */ public function getPreviousValue(); /** + * @return null|Address */ public function getAddress(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveShippingAddressIdChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveShippingAddressIdChangeBuilder.php index 8094068815a..090aecf7594 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveShippingAddressIdChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveShippingAddressIdChangeBuilder.php @@ -23,21 +23,25 @@ final class RemoveShippingAddressIdChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?array */ private $nextValue; /** + * @var ?array */ private $previousValue; /** + * @var null|Address|AddressBuilder */ private $address; @@ -45,6 +49,7 @@ final class RemoveShippingAddressIdChangeBuilder implements Builder /** *

    Update action for removeShippingAddressId action on customers.

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|array */ public function getNextValue() @@ -61,6 +67,7 @@ public function getNextValue() } /** + * @return null|array */ public function getPreviousValue() @@ -69,6 +76,7 @@ public function getPreviousValue() } /** + * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-history/src/Models/Change/RemoveShippingAddressIdChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveShippingAddressIdChangeModel.php index cf0c8a67f91..1dec0a9e22f 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveShippingAddressIdChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveShippingAddressIdChangeModel.php @@ -24,26 +24,31 @@ final class RemoveShippingAddressIdChangeModel extends JsonObjectModel implement public const DISCRIMINATOR_VALUE = 'RemoveShippingAddressIdChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?array */ protected $nextValue; /** + * * @var ?array */ protected $previousValue; /** + * * @var ?Address */ protected $address; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?array $nextValue = null, ?array $previousValue = null, - ?Address $address = null + ?Address $address = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; $this->address = $address; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for removeShippingAddressId action on customers.

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|array */ public function getNextValue() @@ -119,6 +128,7 @@ public function getNextValue() } /** + * * @return null|array */ public function getPreviousValue() @@ -136,6 +146,7 @@ public function getPreviousValue() } /** + * * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-history/src/Models/Change/RemoveShoppingListLineItemChange.php b/lib/commercetools-history/src/Models/Change/RemoveShoppingListLineItemChange.php index 6bf478650c8..58fc19dd512 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveShoppingListLineItemChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveShoppingListLineItemChange.php @@ -19,21 +19,25 @@ interface RemoveShoppingListLineItemChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|LineItem */ public function getPreviousValue(); /** + * @return null|LineItem */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveShoppingListLineItemChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveShoppingListLineItemChangeBuilder.php index 3c3146c108e..b568a53a02a 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveShoppingListLineItemChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveShoppingListLineItemChangeBuilder.php @@ -23,21 +23,25 @@ final class RemoveShoppingListLineItemChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LineItem|LineItemBuilder */ private $previousValue; /** + * @var null|LineItem|LineItemBuilder */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|LineItem */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|LineItem */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveShoppingListLineItemChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveShoppingListLineItemChangeModel.php index dd9c08138b4..a4124c51030 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveShoppingListLineItemChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveShoppingListLineItemChangeModel.php @@ -24,21 +24,25 @@ final class RemoveShoppingListLineItemChangeModel extends JsonObjectModel implem public const DISCRIMINATOR_VALUE = 'RemoveShoppingListLineItemChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LineItem */ protected $previousValue; /** + * * @var ?LineItem */ protected $nextValue; @@ -50,15 +54,17 @@ final class RemoveShoppingListLineItemChangeModel extends JsonObjectModel implem public function __construct( ?string $change = null, ?LineItem $previousValue = null, - ?LineItem $nextValue = null + ?LineItem $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|LineItem */ public function getPreviousValue() @@ -111,6 +119,7 @@ public function getPreviousValue() } /** + * * @return null|LineItem */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveStateRolesChange.php b/lib/commercetools-history/src/Models/Change/RemoveStateRolesChange.php index e0fe1769586..0bdf4b88b4c 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveStateRolesChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveStateRolesChange.php @@ -18,21 +18,25 @@ interface RemoveStateRolesChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|array */ public function getPreviousValue(); /** + * @return null|array */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveStateRolesChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveStateRolesChangeBuilder.php index 37de9a76526..4397cbdd837 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveStateRolesChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveStateRolesChangeBuilder.php @@ -21,21 +21,25 @@ final class RemoveStateRolesChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?array */ private $previousValue; /** + * @var ?array */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -44,6 +48,7 @@ public function getChange() } /** + * @return null|array */ public function getPreviousValue() @@ -52,6 +57,7 @@ public function getPreviousValue() } /** + * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveStateRolesChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveStateRolesChangeModel.php index f839d0f210a..4ded40da1ef 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveStateRolesChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveStateRolesChangeModel.php @@ -22,21 +22,25 @@ final class RemoveStateRolesChangeModel extends JsonObjectModel implements Remov public const DISCRIMINATOR_VALUE = 'RemoveStateRolesChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?array */ protected $previousValue; /** + * * @var ?array */ protected $nextValue; @@ -48,15 +52,17 @@ final class RemoveStateRolesChangeModel extends JsonObjectModel implements Remov public function __construct( ?string $change = null, ?array $previousValue = null, - ?array $nextValue = null + ?array $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -74,6 +80,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -91,6 +98,7 @@ public function getChange() } /** + * * @return null|array */ public function getPreviousValue() @@ -108,6 +116,7 @@ public function getPreviousValue() } /** + * * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveTaxRateChange.php b/lib/commercetools-history/src/Models/Change/RemoveTaxRateChange.php index 247402a8e83..16e30b8db8f 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveTaxRateChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveTaxRateChange.php @@ -19,6 +19,7 @@ interface RemoveTaxRateChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,6 +27,7 @@ public function getType(); /** *

    Update action for removeTaxRate on tax categories

    * + * @return null|string */ public function getChange(); @@ -33,6 +35,7 @@ public function getChange(); /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getPreviousValue(); @@ -40,6 +43,7 @@ public function getPreviousValue(); /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveTaxRateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveTaxRateChangeBuilder.php index a7c9946156a..df46e91cccb 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveTaxRateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveTaxRateChangeBuilder.php @@ -23,16 +23,19 @@ final class RemoveTaxRateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|TaxRate|TaxRateBuilder */ private $previousValue; /** + * @var null|TaxRate|TaxRateBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class RemoveTaxRateChangeBuilder implements Builder /** *

    Update action for removeTaxRate on tax categories

    * + * @return null|string */ public function getChange() @@ -50,6 +54,7 @@ public function getChange() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getPreviousValue() @@ -60,6 +65,7 @@ public function getPreviousValue() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveTaxRateChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveTaxRateChangeModel.php index 88f38fa1f24..09b9db13c3b 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveTaxRateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveTaxRateChangeModel.php @@ -24,21 +24,25 @@ final class RemoveTaxRateChangeModel extends JsonObjectModel implements RemoveTa public const DISCRIMINATOR_VALUE = 'RemoveTaxRateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?TaxRate */ protected $previousValue; /** + * * @var ?TaxRate */ protected $nextValue; @@ -50,15 +54,17 @@ final class RemoveTaxRateChangeModel extends JsonObjectModel implements RemoveTa public function __construct( ?string $change = null, ?TaxRate $previousValue = null, - ?TaxRate $nextValue = null + ?TaxRate $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for removeTaxRate on tax categories

    * + * * @return null|string */ public function getChange() @@ -97,6 +104,7 @@ public function getChange() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * * @return null|TaxRate */ public function getPreviousValue() @@ -117,6 +125,7 @@ public function getPreviousValue() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * * @return null|TaxRate */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveTextLineItemChange.php b/lib/commercetools-history/src/Models/Change/RemoveTextLineItemChange.php index 28e08773d93..0aef80579f7 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveTextLineItemChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveTextLineItemChange.php @@ -19,21 +19,25 @@ interface RemoveTextLineItemChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|TextLineItem */ public function getPreviousValue(); /** + * @return null|TextLineItem */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveTextLineItemChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveTextLineItemChangeBuilder.php index 66853e04729..de24b2c38c3 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveTextLineItemChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveTextLineItemChangeBuilder.php @@ -23,21 +23,25 @@ final class RemoveTextLineItemChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|TextLineItem|TextLineItemBuilder */ private $previousValue; /** + * @var null|TextLineItem|TextLineItemBuilder */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|TextLineItem */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|TextLineItem */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveTextLineItemChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveTextLineItemChangeModel.php index 3ed126e4e96..2e7a3c5f7b9 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveTextLineItemChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveTextLineItemChangeModel.php @@ -24,21 +24,25 @@ final class RemoveTextLineItemChangeModel extends JsonObjectModel implements Rem public const DISCRIMINATOR_VALUE = 'RemoveTextLineItemChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?TextLineItem */ protected $previousValue; /** + * * @var ?TextLineItem */ protected $nextValue; @@ -50,15 +54,17 @@ final class RemoveTextLineItemChangeModel extends JsonObjectModel implements Rem public function __construct( ?string $change = null, ?TextLineItem $previousValue = null, - ?TextLineItem $nextValue = null + ?TextLineItem $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|TextLineItem */ public function getPreviousValue() @@ -111,6 +119,7 @@ public function getPreviousValue() } /** + * * @return null|TextLineItem */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveVariantChange.php b/lib/commercetools-history/src/Models/Change/RemoveVariantChange.php index 2a1a01a5914..554c1bebab7 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveVariantChange.php +++ b/lib/commercetools-history/src/Models/Change/RemoveVariantChange.php @@ -20,6 +20,7 @@ interface RemoveVariantChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update action for removeVariant

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|Variant */ public function getPreviousValue(); /** + * @return null|Variant */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/RemoveVariantChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveVariantChangeBuilder.php index a83f20abdc9..b4c0609113e 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveVariantChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/RemoveVariantChangeBuilder.php @@ -23,21 +23,25 @@ final class RemoveVariantChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var null|Variant|VariantBuilder */ private $previousValue; /** + * @var null|Variant|VariantBuilder */ private $nextValue; @@ -45,6 +49,7 @@ final class RemoveVariantChangeBuilder implements Builder /** *

    Update action for removeVariant

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -61,6 +67,7 @@ public function getCatalogData() } /** + * @return null|Variant */ public function getPreviousValue() @@ -69,6 +76,7 @@ public function getPreviousValue() } /** + * @return null|Variant */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/RemoveVariantChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveVariantChangeModel.php index 9f78c9caf4c..415ac73491e 100644 --- a/lib/commercetools-history/src/Models/Change/RemoveVariantChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/RemoveVariantChangeModel.php @@ -24,26 +24,31 @@ final class RemoveVariantChangeModel extends JsonObjectModel implements RemoveVa public const DISCRIMINATOR_VALUE = 'RemoveVariantChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?Variant */ protected $previousValue; /** + * * @var ?Variant */ protected $nextValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $catalogData = null, ?Variant $previousValue = null, - ?Variant $nextValue = null + ?Variant $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for removeVariant

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -119,6 +128,7 @@ public function getCatalogData() } /** + * * @return null|Variant */ public function getPreviousValue() @@ -137,6 +147,7 @@ public function getPreviousValue() } /** + * * @return null|Variant */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAddressChange.php b/lib/commercetools-history/src/Models/Change/SetAddressChange.php index 39b905a9ea3..9e9e908acdb 100644 --- a/lib/commercetools-history/src/Models/Change/SetAddressChange.php +++ b/lib/commercetools-history/src/Models/Change/SetAddressChange.php @@ -21,21 +21,25 @@ interface SetAddressChange extends Change /** *

    Update action for setAddress action.

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|Address */ public function getNextValue(); /** + * @return null|Address */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetAddressChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetAddressChangeBuilder.php index d614d83d1ea..377135f7271 100644 --- a/lib/commercetools-history/src/Models/Change/SetAddressChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetAddressChangeBuilder.php @@ -23,16 +23,19 @@ final class SetAddressChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Address|AddressBuilder */ private $nextValue; /** + * @var null|Address|AddressBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class SetAddressChangeBuilder implements Builder /** *

    Update action for setAddress action.

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Address */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAddressChangeModel.php b/lib/commercetools-history/src/Models/Change/SetAddressChangeModel.php index 3fbdf0b0cbc..fc64b9a7e61 100644 --- a/lib/commercetools-history/src/Models/Change/SetAddressChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetAddressChangeModel.php @@ -24,21 +24,25 @@ final class SetAddressChangeModel extends JsonObjectModel implements SetAddressC public const DISCRIMINATOR_VALUE = 'SetAddressChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Address */ protected $nextValue; /** + * * @var ?Address */ protected $previousValue; @@ -50,15 +54,17 @@ final class SetAddressChangeModel extends JsonObjectModel implements SetAddressC public function __construct( ?string $change = null, ?Address $nextValue = null, - ?Address $previousValue = null + ?Address $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for setAddress action.

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Address */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAnonymousIdChange.php b/lib/commercetools-history/src/Models/Change/SetAnonymousIdChange.php index 27d8ea2b7ea..e7e3fdb8207 100644 --- a/lib/commercetools-history/src/Models/Change/SetAnonymousIdChange.php +++ b/lib/commercetools-history/src/Models/Change/SetAnonymousIdChange.php @@ -18,6 +18,7 @@ interface SetAnonymousIdChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setAnonymousId

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetAnonymousIdChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetAnonymousIdChangeBuilder.php index d0905d82028..a244f8f1a96 100644 --- a/lib/commercetools-history/src/Models/Change/SetAnonymousIdChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetAnonymousIdChangeBuilder.php @@ -21,16 +21,19 @@ final class SetAnonymousIdChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetAnonymousIdChangeBuilder implements Builder /** *

    Shape of the action for setAnonymousId

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAnonymousIdChangeModel.php b/lib/commercetools-history/src/Models/Change/SetAnonymousIdChangeModel.php index 1078ca50d45..41ac0b10933 100644 --- a/lib/commercetools-history/src/Models/Change/SetAnonymousIdChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetAnonymousIdChangeModel.php @@ -22,21 +22,25 @@ final class SetAnonymousIdChangeModel extends JsonObjectModel implements SetAnon public const DISCRIMINATOR_VALUE = 'SetAnonymousIdChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetAnonymousIdChangeModel extends JsonObjectModel implements SetAnon public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setAnonymousId

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetApplicationVersionChange.php b/lib/commercetools-history/src/Models/Change/SetApplicationVersionChange.php index d172230a5a3..7cb601477ed 100644 --- a/lib/commercetools-history/src/Models/Change/SetApplicationVersionChange.php +++ b/lib/commercetools-history/src/Models/Change/SetApplicationVersionChange.php @@ -18,6 +18,7 @@ interface SetApplicationVersionChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Internal Update action for setApplicationVersion

    * + * @return null|string */ public function getChange(); /** + * @return null|int */ public function getPreviousValue(); /** + * @return null|int */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetApplicationVersionChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetApplicationVersionChangeBuilder.php index 4f03be21bc0..66639d8825a 100644 --- a/lib/commercetools-history/src/Models/Change/SetApplicationVersionChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetApplicationVersionChangeBuilder.php @@ -21,16 +21,19 @@ final class SetApplicationVersionChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?int */ private $previousValue; /** + * @var ?int */ private $nextValue; @@ -38,6 +41,7 @@ final class SetApplicationVersionChangeBuilder implements Builder /** *

    Internal Update action for setApplicationVersion

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|int */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|int */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetApplicationVersionChangeModel.php b/lib/commercetools-history/src/Models/Change/SetApplicationVersionChangeModel.php index 93d27655d9b..f27cb21b9dd 100644 --- a/lib/commercetools-history/src/Models/Change/SetApplicationVersionChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetApplicationVersionChangeModel.php @@ -22,21 +22,25 @@ final class SetApplicationVersionChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'SetApplicationVersionChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?int */ protected $previousValue; /** + * * @var ?int */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetApplicationVersionChangeModel extends JsonObjectModel implements public function __construct( ?string $change = null, ?int $previousValue = null, - ?int $nextValue = null + ?int $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Internal Update action for setApplicationVersion

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|int */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|int */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAssetCustomFieldChange.php b/lib/commercetools-history/src/Models/Change/SetAssetCustomFieldChange.php index ae73cc831dc..09b5d8f7d50 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetCustomFieldChange.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetCustomFieldChange.php @@ -24,36 +24,43 @@ interface SetAssetCustomFieldChange extends Change /** *

    Update action for setAssetCustomField

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getName(); /** + * @return null|string */ public function getCustomTypeId(); /** + * @return null|AssetChangeValue */ public function getAsset(); /** + * @return null|mixed */ public function getNextValue(); /** + * @return null|mixed */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetAssetCustomFieldChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetAssetCustomFieldChangeBuilder.php index a725bda4093..c47d37d1960 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetCustomFieldChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetCustomFieldChangeBuilder.php @@ -23,31 +23,37 @@ final class SetAssetCustomFieldChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $name; /** + * @var ?string */ private $customTypeId; /** + * @var null|AssetChangeValue|AssetChangeValueBuilder */ private $asset; /** + * @var null|mixed|mixed */ private $nextValue; /** + * @var null|mixed|mixed */ private $previousValue; @@ -55,6 +61,7 @@ final class SetAssetCustomFieldChangeBuilder implements Builder /** *

    Update action for setAssetCustomField

    * + * @return null|string */ public function getChange() @@ -63,6 +70,7 @@ public function getChange() } /** + * @return null|string */ public function getName() @@ -71,6 +79,7 @@ public function getName() } /** + * @return null|string */ public function getCustomTypeId() @@ -79,6 +88,7 @@ public function getCustomTypeId() } /** + * @return null|AssetChangeValue */ public function getAsset() @@ -87,6 +97,7 @@ public function getAsset() } /** + * @return null|mixed */ public function getNextValue() @@ -95,6 +106,7 @@ public function getNextValue() } /** + * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAssetCustomFieldChangeModel.php b/lib/commercetools-history/src/Models/Change/SetAssetCustomFieldChangeModel.php index 18a651d1e31..47e6b8cc739 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetCustomFieldChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetCustomFieldChangeModel.php @@ -24,36 +24,43 @@ final class SetAssetCustomFieldChangeModel extends JsonObjectModel implements Se public const DISCRIMINATOR_VALUE = 'SetAssetCustomFieldChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $customTypeId; /** + * * @var ?AssetChangeValue */ protected $asset; /** + * * @var ?mixed */ protected $nextValue; /** + * * @var ?mixed */ protected $previousValue; @@ -68,7 +75,8 @@ public function __construct( ?string $customTypeId = null, ?AssetChangeValue $asset = null, $nextValue = null, - $previousValue = null + $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->name = $name; @@ -76,10 +84,11 @@ public function __construct( $this->asset = $asset; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -99,6 +108,7 @@ public function getType() /** *

    Update action for setAssetCustomField

    * + * * @return null|string */ public function getChange() @@ -116,6 +126,7 @@ public function getChange() } /** + * * @return null|string */ public function getName() @@ -133,6 +144,7 @@ public function getName() } /** + * * @return null|string */ public function getCustomTypeId() @@ -150,6 +162,7 @@ public function getCustomTypeId() } /** + * * @return null|AssetChangeValue */ public function getAsset() @@ -168,6 +181,7 @@ public function getAsset() } /** + * * @return null|mixed */ public function getNextValue() @@ -185,6 +199,7 @@ public function getNextValue() } /** + * * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAssetCustomTypeChange.php b/lib/commercetools-history/src/Models/Change/SetAssetCustomTypeChange.php index 328867a6290..3f06f37dcca 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetCustomTypeChange.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetCustomTypeChange.php @@ -23,26 +23,31 @@ interface SetAssetCustomTypeChange extends Change /** *

    Update action for setAssetCustomType

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|AssetChangeValue */ public function getAsset(); /** + * @return null|CustomFields */ public function getNextValue(); /** + * @return null|CustomFields */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetAssetCustomTypeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetAssetCustomTypeChangeBuilder.php index f1aa12a5811..3f30fabc98a 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetCustomTypeChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetCustomTypeChangeBuilder.php @@ -25,21 +25,25 @@ final class SetAssetCustomTypeChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|AssetChangeValue|AssetChangeValueBuilder */ private $asset; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $nextValue; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $previousValue; @@ -47,6 +51,7 @@ final class SetAssetCustomTypeChangeBuilder implements Builder /** *

    Update action for setAssetCustomType

    * + * @return null|string */ public function getChange() @@ -55,6 +60,7 @@ public function getChange() } /** + * @return null|AssetChangeValue */ public function getAsset() @@ -63,6 +69,7 @@ public function getAsset() } /** + * @return null|CustomFields */ public function getNextValue() @@ -71,6 +78,7 @@ public function getNextValue() } /** + * @return null|CustomFields */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAssetCustomTypeChangeModel.php b/lib/commercetools-history/src/Models/Change/SetAssetCustomTypeChangeModel.php index 3193d051fd6..6638c31aea7 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetCustomTypeChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetCustomTypeChangeModel.php @@ -26,26 +26,31 @@ final class SetAssetCustomTypeChangeModel extends JsonObjectModel implements Set public const DISCRIMINATOR_VALUE = 'SetAssetCustomTypeChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?AssetChangeValue */ protected $asset; /** + * * @var ?CustomFields */ protected $nextValue; /** + * * @var ?CustomFields */ protected $previousValue; @@ -58,16 +63,18 @@ public function __construct( ?string $change = null, ?AssetChangeValue $asset = null, ?CustomFields $nextValue = null, - ?CustomFields $previousValue = null + ?CustomFields $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->asset = $asset; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -87,6 +94,7 @@ public function getType() /** *

    Update action for setAssetCustomType

    * + * * @return null|string */ public function getChange() @@ -104,6 +112,7 @@ public function getChange() } /** + * * @return null|AssetChangeValue */ public function getAsset() @@ -122,6 +131,7 @@ public function getAsset() } /** + * * @return null|CustomFields */ public function getNextValue() @@ -140,6 +150,7 @@ public function getNextValue() } /** + * * @return null|CustomFields */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAssetDescriptionChange.php b/lib/commercetools-history/src/Models/Change/SetAssetDescriptionChange.php index fad99441fe2..195f5614d9a 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetDescriptionChange.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetDescriptionChange.php @@ -23,26 +23,31 @@ interface SetAssetDescriptionChange extends Change /** *

    Update action for setAssetDescription

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|AssetChangeValue */ public function getAsset(); /** + * @return null|LocalizedString */ public function getNextValue(); /** + * @return null|LocalizedString */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetAssetDescriptionChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetAssetDescriptionChangeBuilder.php index 454e36606f2..88ecb20d873 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetDescriptionChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetDescriptionChangeBuilder.php @@ -25,21 +25,25 @@ final class SetAssetDescriptionChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|AssetChangeValue|AssetChangeValueBuilder */ private $asset; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; @@ -47,6 +51,7 @@ final class SetAssetDescriptionChangeBuilder implements Builder /** *

    Update action for setAssetDescription

    * + * @return null|string */ public function getChange() @@ -55,6 +60,7 @@ public function getChange() } /** + * @return null|AssetChangeValue */ public function getAsset() @@ -63,6 +69,7 @@ public function getAsset() } /** + * @return null|LocalizedString */ public function getNextValue() @@ -71,6 +78,7 @@ public function getNextValue() } /** + * @return null|LocalizedString */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAssetDescriptionChangeModel.php b/lib/commercetools-history/src/Models/Change/SetAssetDescriptionChangeModel.php index 7fc0e94cd3d..1fa479d2fa4 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetDescriptionChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetDescriptionChangeModel.php @@ -26,26 +26,31 @@ final class SetAssetDescriptionChangeModel extends JsonObjectModel implements Se public const DISCRIMINATOR_VALUE = 'SetAssetDescriptionChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?AssetChangeValue */ protected $asset; /** + * * @var ?LocalizedString */ protected $nextValue; /** + * * @var ?LocalizedString */ protected $previousValue; @@ -58,16 +63,18 @@ public function __construct( ?string $change = null, ?AssetChangeValue $asset = null, ?LocalizedString $nextValue = null, - ?LocalizedString $previousValue = null + ?LocalizedString $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->asset = $asset; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -87,6 +94,7 @@ public function getType() /** *

    Update action for setAssetDescription

    * + * * @return null|string */ public function getChange() @@ -104,6 +112,7 @@ public function getChange() } /** + * * @return null|AssetChangeValue */ public function getAsset() @@ -122,6 +131,7 @@ public function getAsset() } /** + * * @return null|LocalizedString */ public function getNextValue() @@ -140,6 +150,7 @@ public function getNextValue() } /** + * * @return null|LocalizedString */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAssetKeyChange.php b/lib/commercetools-history/src/Models/Change/SetAssetKeyChange.php index 9ee1ff483f6..02e9635c49e 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetKeyChange.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetKeyChange.php @@ -22,26 +22,31 @@ interface SetAssetKeyChange extends Change /** *

    Update action for setAssetKey

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|AssetChangeValue */ public function getAsset(); /** + * @return null|string */ public function getNextValue(); /** + * @return null|string */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetAssetKeyChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetAssetKeyChangeBuilder.php index 68476e9aa5d..596d470bfeb 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetKeyChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetKeyChangeBuilder.php @@ -23,21 +23,25 @@ final class SetAssetKeyChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|AssetChangeValue|AssetChangeValueBuilder */ private $asset; /** + * @var ?string */ private $nextValue; /** + * @var ?string */ private $previousValue; @@ -45,6 +49,7 @@ final class SetAssetKeyChangeBuilder implements Builder /** *

    Update action for setAssetKey

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|AssetChangeValue */ public function getAsset() @@ -61,6 +67,7 @@ public function getAsset() } /** + * @return null|string */ public function getNextValue() @@ -69,6 +76,7 @@ public function getNextValue() } /** + * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAssetKeyChangeModel.php b/lib/commercetools-history/src/Models/Change/SetAssetKeyChangeModel.php index 3696545847e..deb11b9cf0c 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetKeyChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetKeyChangeModel.php @@ -24,26 +24,31 @@ final class SetAssetKeyChangeModel extends JsonObjectModel implements SetAssetKe public const DISCRIMINATOR_VALUE = 'SetAssetKeyChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?AssetChangeValue */ protected $asset; /** + * * @var ?string */ protected $nextValue; /** + * * @var ?string */ protected $previousValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?AssetChangeValue $asset = null, ?string $nextValue = null, - ?string $previousValue = null + ?string $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->asset = $asset; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for setAssetKey

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|AssetChangeValue */ public function getAsset() @@ -120,6 +129,7 @@ public function getAsset() } /** + * * @return null|string */ public function getNextValue() @@ -137,6 +147,7 @@ public function getNextValue() } /** + * * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAssetSourcesChange.php b/lib/commercetools-history/src/Models/Change/SetAssetSourcesChange.php index 92086c4c27d..8a79befdb95 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetSourcesChange.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetSourcesChange.php @@ -23,26 +23,31 @@ interface SetAssetSourcesChange extends Change /** *

    Update action for setAssetSources

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|AssetChangeValue */ public function getAsset(); /** + * @return null|AssetSourceCollection */ public function getNextValue(); /** + * @return null|AssetSourceCollection */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetAssetSourcesChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetAssetSourcesChangeBuilder.php index a60ecceedba..57fb2ad947c 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetSourcesChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetSourcesChangeBuilder.php @@ -24,21 +24,25 @@ final class SetAssetSourcesChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|AssetChangeValue|AssetChangeValueBuilder */ private $asset; /** + * @var ?AssetSourceCollection */ private $nextValue; /** + * @var ?AssetSourceCollection */ private $previousValue; @@ -46,6 +50,7 @@ final class SetAssetSourcesChangeBuilder implements Builder /** *

    Update action for setAssetSources

    * + * @return null|string */ public function getChange() @@ -54,6 +59,7 @@ public function getChange() } /** + * @return null|AssetChangeValue */ public function getAsset() @@ -62,6 +68,7 @@ public function getAsset() } /** + * @return null|AssetSourceCollection */ public function getNextValue() @@ -70,6 +77,7 @@ public function getNextValue() } /** + * @return null|AssetSourceCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAssetSourcesChangeModel.php b/lib/commercetools-history/src/Models/Change/SetAssetSourcesChangeModel.php index e1ab186d19b..a1554ba00a9 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetSourcesChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetSourcesChangeModel.php @@ -25,26 +25,31 @@ final class SetAssetSourcesChangeModel extends JsonObjectModel implements SetAss public const DISCRIMINATOR_VALUE = 'SetAssetSourcesChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?AssetChangeValue */ protected $asset; /** + * * @var ?AssetSourceCollection */ protected $nextValue; /** + * * @var ?AssetSourceCollection */ protected $previousValue; @@ -57,16 +62,18 @@ public function __construct( ?string $change = null, ?AssetChangeValue $asset = null, ?AssetSourceCollection $nextValue = null, - ?AssetSourceCollection $previousValue = null + ?AssetSourceCollection $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->asset = $asset; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -86,6 +93,7 @@ public function getType() /** *

    Update action for setAssetSources

    * + * * @return null|string */ public function getChange() @@ -103,6 +111,7 @@ public function getChange() } /** + * * @return null|AssetChangeValue */ public function getAsset() @@ -121,6 +130,7 @@ public function getAsset() } /** + * * @return null|AssetSourceCollection */ public function getNextValue() @@ -138,6 +148,7 @@ public function getNextValue() } /** + * * @return null|AssetSourceCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAssetTagsChange.php b/lib/commercetools-history/src/Models/Change/SetAssetTagsChange.php index a28340560c2..f562628c728 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetTagsChange.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetTagsChange.php @@ -22,26 +22,31 @@ interface SetAssetTagsChange extends Change /** *

    Update action for setAssetTags

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|AssetChangeValue */ public function getAsset(); /** + * @return null|array */ public function getNextValue(); /** + * @return null|array */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetAssetTagsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetAssetTagsChangeBuilder.php index a1902343414..8eb6103f960 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetTagsChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetTagsChangeBuilder.php @@ -23,21 +23,25 @@ final class SetAssetTagsChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|AssetChangeValue|AssetChangeValueBuilder */ private $asset; /** + * @var ?array */ private $nextValue; /** + * @var ?array */ private $previousValue; @@ -45,6 +49,7 @@ final class SetAssetTagsChangeBuilder implements Builder /** *

    Update action for setAssetTags

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|AssetChangeValue */ public function getAsset() @@ -61,6 +67,7 @@ public function getAsset() } /** + * @return null|array */ public function getNextValue() @@ -69,6 +76,7 @@ public function getNextValue() } /** + * @return null|array */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAssetTagsChangeModel.php b/lib/commercetools-history/src/Models/Change/SetAssetTagsChangeModel.php index 6a42977c179..44c77de4f56 100644 --- a/lib/commercetools-history/src/Models/Change/SetAssetTagsChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetAssetTagsChangeModel.php @@ -24,26 +24,31 @@ final class SetAssetTagsChangeModel extends JsonObjectModel implements SetAssetT public const DISCRIMINATOR_VALUE = 'SetAssetTagsChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?AssetChangeValue */ protected $asset; /** + * * @var ?array */ protected $nextValue; /** + * * @var ?array */ protected $previousValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?AssetChangeValue $asset = null, ?array $nextValue = null, - ?array $previousValue = null + ?array $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->asset = $asset; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for setAssetTags

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|AssetChangeValue */ public function getAsset() @@ -120,6 +129,7 @@ public function getAsset() } /** + * * @return null|array */ public function getNextValue() @@ -137,6 +147,7 @@ public function getNextValue() } /** + * * @return null|array */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAttributeChange.php b/lib/commercetools-history/src/Models/Change/SetAttributeChange.php index a3dc968fa2e..ea77b174e14 100644 --- a/lib/commercetools-history/src/Models/Change/SetAttributeChange.php +++ b/lib/commercetools-history/src/Models/Change/SetAttributeChange.php @@ -20,6 +20,7 @@ interface SetAttributeChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update action for setAttribute

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|AttributeValue */ public function getPreviousValue(); /** + * @return null|AttributeValue */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetAttributeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetAttributeChangeBuilder.php index 619ffad471a..3888d4f4417 100644 --- a/lib/commercetools-history/src/Models/Change/SetAttributeChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetAttributeChangeBuilder.php @@ -23,21 +23,25 @@ final class SetAttributeChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var null|AttributeValue|AttributeValueBuilder */ private $previousValue; /** + * @var null|AttributeValue|AttributeValueBuilder */ private $nextValue; @@ -45,6 +49,7 @@ final class SetAttributeChangeBuilder implements Builder /** *

    Update action for setAttribute

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -61,6 +67,7 @@ public function getCatalogData() } /** + * @return null|AttributeValue */ public function getPreviousValue() @@ -69,6 +76,7 @@ public function getPreviousValue() } /** + * @return null|AttributeValue */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAttributeChangeModel.php b/lib/commercetools-history/src/Models/Change/SetAttributeChangeModel.php index 54e3c480419..fcf41a1f864 100644 --- a/lib/commercetools-history/src/Models/Change/SetAttributeChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetAttributeChangeModel.php @@ -24,26 +24,31 @@ final class SetAttributeChangeModel extends JsonObjectModel implements SetAttrib public const DISCRIMINATOR_VALUE = 'SetAttributeChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?AttributeValue */ protected $previousValue; /** + * * @var ?AttributeValue */ protected $nextValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $catalogData = null, ?AttributeValue $previousValue = null, - ?AttributeValue $nextValue = null + ?AttributeValue $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for setAttribute

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -119,6 +128,7 @@ public function getCatalogData() } /** + * * @return null|AttributeValue */ public function getPreviousValue() @@ -137,6 +147,7 @@ public function getPreviousValue() } /** + * * @return null|AttributeValue */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAuthenticationModeChange.php b/lib/commercetools-history/src/Models/Change/SetAuthenticationModeChange.php new file mode 100644 index 00000000000..92e7a13e116 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetAuthenticationModeChange.php @@ -0,0 +1,60 @@ +Update action for setAuthenticationMode

    + * + + * @return null|string + */ + public function getChange(); + + /** + + * @return null|string + */ + public function getPreviousValue(); + + /** + + * @return null|string + */ + public function getNextValue(); + + /** + * @param ?string $change + */ + public function setChange(?string $change): void; + + /** + * @param ?string $previousValue + */ + public function setPreviousValue(?string $previousValue): void; + + /** + * @param ?string $nextValue + */ + public function setNextValue(?string $nextValue): void; +} diff --git a/lib/commercetools-history/src/Models/Change/SetAuthenticationModeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetAuthenticationModeChangeBuilder.php new file mode 100644 index 00000000000..aa4cda7daff --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetAuthenticationModeChangeBuilder.php @@ -0,0 +1,117 @@ + + */ +final class SetAuthenticationModeChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var ?string + */ + private $previousValue; + + /** + + * @var ?string + */ + private $nextValue; + + /** + *

    Update action for setAuthenticationMode

    + * + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + + * @return null|string + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + + * @return null|string + */ + public function getNextValue() + { + return $this->nextValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?string $previousValue + * @return $this + */ + public function withPreviousValue(?string $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @param ?string $nextValue + * @return $this + */ + public function withNextValue(?string $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + + public function build(): SetAuthenticationModeChange + { + return new SetAuthenticationModeChangeModel( + $this->change, + $this->previousValue, + $this->nextValue + ); + } + + public static function of(): SetAuthenticationModeChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetAuthenticationModeChangeCollection.php b/lib/commercetools-history/src/Models/Change/SetAuthenticationModeChangeCollection.php new file mode 100644 index 00000000000..c6fc6b89dca --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetAuthenticationModeChangeCollection.php @@ -0,0 +1,56 @@ + + * @method SetAuthenticationModeChange current() + * @method SetAuthenticationModeChange end() + * @method SetAuthenticationModeChange at($offset) + */ +class SetAuthenticationModeChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert SetAuthenticationModeChange $value + * @psalm-param SetAuthenticationModeChange|stdClass $value + * @throws InvalidArgumentException + * + * @return SetAuthenticationModeChangeCollection + */ + public function add($value) + { + if (!$value instanceof SetAuthenticationModeChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?SetAuthenticationModeChange + */ + protected function mapper() + { + return function (?int $index): ?SetAuthenticationModeChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var SetAuthenticationModeChange $data */ + $data = SetAuthenticationModeChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetAuthenticationModeChangeModel.php b/lib/commercetools-history/src/Models/Change/SetAuthenticationModeChangeModel.php new file mode 100644 index 00000000000..a40f88b15f4 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetAuthenticationModeChangeModel.php @@ -0,0 +1,165 @@ +change = $change; + $this->previousValue = $previousValue; + $this->nextValue = $nextValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Update action for setAuthenticationMode

    + * + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + * + * @return null|string + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = (string) $data; + } + + return $this->previousValue; + } + + /** + * + * @return null|string + */ + public function getNextValue() + { + if (is_null($this->nextValue)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NEXT_VALUE); + if (is_null($data)) { + return null; + } + $this->nextValue = (string) $data; + } + + return $this->nextValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?string $previousValue + */ + public function setPreviousValue(?string $previousValue): void + { + $this->previousValue = $previousValue; + } + + /** + * @param ?string $nextValue + */ + public function setNextValue(?string $nextValue): void + { + $this->nextValue = $nextValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Change/SetAuthorNameChange.php b/lib/commercetools-history/src/Models/Change/SetAuthorNameChange.php index 86e83f98ad0..bd0f0180590 100644 --- a/lib/commercetools-history/src/Models/Change/SetAuthorNameChange.php +++ b/lib/commercetools-history/src/Models/Change/SetAuthorNameChange.php @@ -18,6 +18,7 @@ interface SetAuthorNameChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setAuthorName

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetAuthorNameChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetAuthorNameChangeBuilder.php index 52b0227d698..dac84066c67 100644 --- a/lib/commercetools-history/src/Models/Change/SetAuthorNameChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetAuthorNameChangeBuilder.php @@ -21,16 +21,19 @@ final class SetAuthorNameChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetAuthorNameChangeBuilder implements Builder /** *

    Shape of the action for setAuthorName

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetAuthorNameChangeModel.php b/lib/commercetools-history/src/Models/Change/SetAuthorNameChangeModel.php index 24e46a6cdf6..4ae83431747 100644 --- a/lib/commercetools-history/src/Models/Change/SetAuthorNameChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetAuthorNameChangeModel.php @@ -22,21 +22,25 @@ final class SetAuthorNameChangeModel extends JsonObjectModel implements SetAutho public const DISCRIMINATOR_VALUE = 'SetAuthorNameChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetAuthorNameChangeModel extends JsonObjectModel implements SetAutho public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setAuthorName

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetBillingAddressChange.php b/lib/commercetools-history/src/Models/Change/SetBillingAddressChange.php index d179e9846f2..fc06bcc748c 100644 --- a/lib/commercetools-history/src/Models/Change/SetBillingAddressChange.php +++ b/lib/commercetools-history/src/Models/Change/SetBillingAddressChange.php @@ -19,6 +19,7 @@ interface SetBillingAddressChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for setBillingAddress

    * + * @return null|string */ public function getChange(); /** + * @return null|Address */ public function getNextValue(); /** + * @return null|Address */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetBillingAddressChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetBillingAddressChangeBuilder.php index 300367f6974..8e1087511e2 100644 --- a/lib/commercetools-history/src/Models/Change/SetBillingAddressChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetBillingAddressChangeBuilder.php @@ -23,16 +23,19 @@ final class SetBillingAddressChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Address|AddressBuilder */ private $nextValue; /** + * @var null|Address|AddressBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class SetBillingAddressChangeBuilder implements Builder /** *

    Update action for setBillingAddress

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Address */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetBillingAddressChangeModel.php b/lib/commercetools-history/src/Models/Change/SetBillingAddressChangeModel.php index d4cb664a867..614aaccd35a 100644 --- a/lib/commercetools-history/src/Models/Change/SetBillingAddressChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetBillingAddressChangeModel.php @@ -24,21 +24,25 @@ final class SetBillingAddressChangeModel extends JsonObjectModel implements SetB public const DISCRIMINATOR_VALUE = 'SetBillingAddressChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Address */ protected $nextValue; /** + * * @var ?Address */ protected $previousValue; @@ -50,15 +54,17 @@ final class SetBillingAddressChangeModel extends JsonObjectModel implements SetB public function __construct( ?string $change = null, ?Address $nextValue = null, - ?Address $previousValue = null + ?Address $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for setBillingAddress

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Address */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCartPredicateChange.php b/lib/commercetools-history/src/Models/Change/SetCartPredicateChange.php index df7e06b3350..a00b6257cd0 100644 --- a/lib/commercetools-history/src/Models/Change/SetCartPredicateChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCartPredicateChange.php @@ -18,6 +18,7 @@ interface SetCartPredicateChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setCartPredicate

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCartPredicateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCartPredicateChangeBuilder.php index 6169fe4c227..37c6edb3fa0 100644 --- a/lib/commercetools-history/src/Models/Change/SetCartPredicateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCartPredicateChangeBuilder.php @@ -21,16 +21,19 @@ final class SetCartPredicateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetCartPredicateChangeBuilder implements Builder /** *

    Shape of the action for setCartPredicate

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCartPredicateChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCartPredicateChangeModel.php index 8e72685c847..f970bab349f 100644 --- a/lib/commercetools-history/src/Models/Change/SetCartPredicateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCartPredicateChangeModel.php @@ -22,21 +22,25 @@ final class SetCartPredicateChangeModel extends JsonObjectModel implements SetCa public const DISCRIMINATOR_VALUE = 'SetCartPredicateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetCartPredicateChangeModel extends JsonObjectModel implements SetCa public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setCartPredicate

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCategoryOrderHintChange.php b/lib/commercetools-history/src/Models/Change/SetCategoryOrderHintChange.php index 555487e24ae..f2c288bbfb6 100644 --- a/lib/commercetools-history/src/Models/Change/SetCategoryOrderHintChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCategoryOrderHintChange.php @@ -21,6 +21,7 @@ interface SetCategoryOrderHintChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -28,26 +29,31 @@ public function getType(); /** *

    Update action for setCategoryOrderHint

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|string */ public function getCategoryId(); /** + * @return null|CategoryOrderHints */ public function getPreviousValue(); /** + * @return null|CategoryOrderHints */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCategoryOrderHintChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCategoryOrderHintChangeBuilder.php index 98ae1075863..aadc3db236a 100644 --- a/lib/commercetools-history/src/Models/Change/SetCategoryOrderHintChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCategoryOrderHintChangeBuilder.php @@ -23,26 +23,31 @@ final class SetCategoryOrderHintChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var ?string */ private $categoryId; /** + * @var null|CategoryOrderHints|CategoryOrderHintsBuilder */ private $previousValue; /** + * @var null|CategoryOrderHints|CategoryOrderHintsBuilder */ private $nextValue; @@ -50,6 +55,7 @@ final class SetCategoryOrderHintChangeBuilder implements Builder /** *

    Update action for setCategoryOrderHint

    * + * @return null|string */ public function getChange() @@ -58,6 +64,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -66,6 +73,7 @@ public function getCatalogData() } /** + * @return null|string */ public function getCategoryId() @@ -74,6 +82,7 @@ public function getCategoryId() } /** + * @return null|CategoryOrderHints */ public function getPreviousValue() @@ -82,6 +91,7 @@ public function getPreviousValue() } /** + * @return null|CategoryOrderHints */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCategoryOrderHintChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCategoryOrderHintChangeModel.php index 55be689c06a..6e0cd02888d 100644 --- a/lib/commercetools-history/src/Models/Change/SetCategoryOrderHintChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCategoryOrderHintChangeModel.php @@ -24,31 +24,37 @@ final class SetCategoryOrderHintChangeModel extends JsonObjectModel implements S public const DISCRIMINATOR_VALUE = 'SetCategoryOrderHintChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?string */ protected $categoryId; /** + * * @var ?CategoryOrderHints */ protected $previousValue; /** + * * @var ?CategoryOrderHints */ protected $nextValue; @@ -62,17 +68,19 @@ public function __construct( ?string $catalogData = null, ?string $categoryId = null, ?CategoryOrderHints $previousValue = null, - ?CategoryOrderHints $nextValue = null + ?CategoryOrderHints $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->categoryId = $categoryId; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -92,6 +100,7 @@ public function getType() /** *

    Update action for setCategoryOrderHint

    * + * * @return null|string */ public function getChange() @@ -109,6 +118,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -126,6 +136,7 @@ public function getCatalogData() } /** + * * @return null|string */ public function getCategoryId() @@ -143,6 +154,7 @@ public function getCategoryId() } /** + * * @return null|CategoryOrderHints */ public function getPreviousValue() @@ -161,6 +173,7 @@ public function getPreviousValue() } /** + * * @return null|CategoryOrderHints */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetChannelRolesChange.php b/lib/commercetools-history/src/Models/Change/SetChannelRolesChange.php index e7b7ec15939..ac4cb640c44 100644 --- a/lib/commercetools-history/src/Models/Change/SetChannelRolesChange.php +++ b/lib/commercetools-history/src/Models/Change/SetChannelRolesChange.php @@ -18,21 +18,25 @@ interface SetChannelRolesChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|array */ public function getPreviousValue(); /** + * @return null|array */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetChannelRolesChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetChannelRolesChangeBuilder.php index 3a9172e2eaa..9c1390f36bd 100644 --- a/lib/commercetools-history/src/Models/Change/SetChannelRolesChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetChannelRolesChangeBuilder.php @@ -21,21 +21,25 @@ final class SetChannelRolesChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?array */ private $previousValue; /** + * @var ?array */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -44,6 +48,7 @@ public function getChange() } /** + * @return null|array */ public function getPreviousValue() @@ -52,6 +57,7 @@ public function getPreviousValue() } /** + * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetChannelRolesChangeModel.php b/lib/commercetools-history/src/Models/Change/SetChannelRolesChangeModel.php index 9fb05ce8a86..33c141bf13d 100644 --- a/lib/commercetools-history/src/Models/Change/SetChannelRolesChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetChannelRolesChangeModel.php @@ -22,21 +22,25 @@ final class SetChannelRolesChangeModel extends JsonObjectModel implements SetCha public const DISCRIMINATOR_VALUE = 'SetChannelRolesChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?array */ protected $previousValue; /** + * * @var ?array */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetChannelRolesChangeModel extends JsonObjectModel implements SetCha public function __construct( ?string $change = null, ?array $previousValue = null, - ?array $nextValue = null + ?array $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -74,6 +80,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -91,6 +98,7 @@ public function getChange() } /** + * * @return null|array */ public function getPreviousValue() @@ -108,6 +116,7 @@ public function getPreviousValue() } /** + * * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCompanyNameChange.php b/lib/commercetools-history/src/Models/Change/SetCompanyNameChange.php index 647403ad670..6a9687bf2c8 100644 --- a/lib/commercetools-history/src/Models/Change/SetCompanyNameChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCompanyNameChange.php @@ -18,6 +18,7 @@ interface SetCompanyNameChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setCompanyName

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCompanyNameChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCompanyNameChangeBuilder.php index 5218df00650..af276b9375b 100644 --- a/lib/commercetools-history/src/Models/Change/SetCompanyNameChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCompanyNameChangeBuilder.php @@ -21,16 +21,19 @@ final class SetCompanyNameChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetCompanyNameChangeBuilder implements Builder /** *

    Shape of the action for setCompanyName

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCompanyNameChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCompanyNameChangeModel.php index 623fc9b1876..c8e53d9eee5 100644 --- a/lib/commercetools-history/src/Models/Change/SetCompanyNameChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCompanyNameChangeModel.php @@ -22,21 +22,25 @@ final class SetCompanyNameChangeModel extends JsonObjectModel implements SetComp public const DISCRIMINATOR_VALUE = 'SetCompanyNameChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetCompanyNameChangeModel extends JsonObjectModel implements SetComp public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setCompanyName

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCountryChange.php b/lib/commercetools-history/src/Models/Change/SetCountryChange.php index 98030bb8d37..d188d19f5d6 100644 --- a/lib/commercetools-history/src/Models/Change/SetCountryChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCountryChange.php @@ -18,6 +18,7 @@ interface SetCountryChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,6 +26,7 @@ public function getType(); /** *

    Update action for setCountry

    * + * @return null|string */ public function getChange(); @@ -32,6 +34,7 @@ public function getChange(); /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getPreviousValue(); @@ -39,6 +42,7 @@ public function getPreviousValue(); /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCountryChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCountryChangeBuilder.php index 98a2b31893d..871a57c619f 100644 --- a/lib/commercetools-history/src/Models/Change/SetCountryChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCountryChangeBuilder.php @@ -21,16 +21,19 @@ final class SetCountryChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetCountryChangeBuilder implements Builder /** *

    Update action for setCountry

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getPreviousValue() @@ -58,6 +63,7 @@ public function getPreviousValue() /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCountryChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCountryChangeModel.php index 2fd157196a9..91ddb502c8e 100644 --- a/lib/commercetools-history/src/Models/Change/SetCountryChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCountryChangeModel.php @@ -22,21 +22,25 @@ final class SetCountryChangeModel extends JsonObjectModel implements SetCountryC public const DISCRIMINATOR_VALUE = 'SetCountryChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetCountryChangeModel extends JsonObjectModel implements SetCountryC public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Update action for setCountry

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * * @return null|string */ public function getPreviousValue() @@ -114,6 +122,7 @@ public function getPreviousValue() /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomFieldChange.php b/lib/commercetools-history/src/Models/Change/SetCustomFieldChange.php index 927edd0c492..c2363333690 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomFieldChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomFieldChange.php @@ -22,11 +22,13 @@ interface SetCustomFieldChange extends Change /** *

    Update action for setting a custom field

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); @@ -34,21 +36,25 @@ public function getType(); /** *

    Custom field name

    * + * @return null|string */ public function getName(); /** + * @return null|string */ public function getCustomTypeId(); /** + * @return null|mixed */ public function getNextValue(); /** + * @return null|mixed */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCustomFieldChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCustomFieldChangeBuilder.php index 0b9c17deaee..8edcfa18d8f 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomFieldChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomFieldChangeBuilder.php @@ -21,26 +21,31 @@ final class SetCustomFieldChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $name; /** + * @var ?string */ private $customTypeId; /** + * @var null|mixed|mixed */ private $nextValue; /** + * @var null|mixed|mixed */ private $previousValue; @@ -48,6 +53,7 @@ final class SetCustomFieldChangeBuilder implements Builder /** *

    Update action for setting a custom field

    * + * @return null|string */ public function getChange() @@ -58,6 +64,7 @@ public function getChange() /** *

    Custom field name

    * + * @return null|string */ public function getName() @@ -66,6 +73,7 @@ public function getName() } /** + * @return null|string */ public function getCustomTypeId() @@ -74,6 +82,7 @@ public function getCustomTypeId() } /** + * @return null|mixed */ public function getNextValue() @@ -82,6 +91,7 @@ public function getNextValue() } /** + * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomFieldChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCustomFieldChangeModel.php index c858251cf84..fd3b53b3f49 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomFieldChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomFieldChangeModel.php @@ -22,31 +22,37 @@ final class SetCustomFieldChangeModel extends JsonObjectModel implements SetCust public const DISCRIMINATOR_VALUE = 'SetCustomFieldChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $customTypeId; /** + * * @var ?mixed */ protected $nextValue; /** + * * @var ?mixed */ protected $previousValue; @@ -60,17 +66,19 @@ public function __construct( ?string $name = null, ?string $customTypeId = null, $nextValue = null, - $previousValue = null + $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->name = $name; $this->customTypeId = $customTypeId; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -90,6 +98,7 @@ public function getType() /** *

    Update action for setting a custom field

    * + * * @return null|string */ public function getChange() @@ -109,6 +118,7 @@ public function getChange() /** *

    Custom field name

    * + * * @return null|string */ public function getName() @@ -126,6 +136,7 @@ public function getName() } /** + * * @return null|string */ public function getCustomTypeId() @@ -143,6 +154,7 @@ public function getCustomTypeId() } /** + * * @return null|mixed */ public function getNextValue() @@ -160,6 +172,7 @@ public function getNextValue() } /** + * * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomFieldChange.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomFieldChange.php index cefce1e8a6f..c224addd952 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomFieldChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomFieldChange.php @@ -22,6 +22,7 @@ interface SetCustomLineItemCustomFieldChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -29,31 +30,37 @@ public function getType(); /** *

    Update action for setCustomLineItemCustomField

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getName(); /** + * @return null|LocalizedString */ public function getCustomLineItem(); /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|mixed */ public function getNextValue(); /** + * @return null|mixed */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomFieldChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomFieldChangeBuilder.php index 2dc5eba1b3f..c91597faa62 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomFieldChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomFieldChangeBuilder.php @@ -23,31 +23,37 @@ final class SetCustomLineItemCustomFieldChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $customLineItem; /** + * @var ?string */ private $customLineItemId; /** + * @var null|mixed|mixed */ private $nextValue; /** + * @var null|mixed|mixed */ private $previousValue; @@ -55,6 +61,7 @@ final class SetCustomLineItemCustomFieldChangeBuilder implements Builder /** *

    Update action for setCustomLineItemCustomField

    * + * @return null|string */ public function getChange() @@ -63,6 +70,7 @@ public function getChange() } /** + * @return null|string */ public function getName() @@ -71,6 +79,7 @@ public function getName() } /** + * @return null|LocalizedString */ public function getCustomLineItem() @@ -79,6 +88,7 @@ public function getCustomLineItem() } /** + * @return null|string */ public function getCustomLineItemId() @@ -87,6 +97,7 @@ public function getCustomLineItemId() } /** + * @return null|mixed */ public function getNextValue() @@ -95,6 +106,7 @@ public function getNextValue() } /** + * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomFieldChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomFieldChangeModel.php index ad54128ee1b..fcc228f439f 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomFieldChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomFieldChangeModel.php @@ -24,36 +24,43 @@ final class SetCustomLineItemCustomFieldChangeModel extends JsonObjectModel impl public const DISCRIMINATOR_VALUE = 'SetCustomLineItemCustomFieldChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $name; /** + * * @var ?LocalizedString */ protected $customLineItem; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?mixed */ protected $nextValue; /** + * * @var ?mixed */ protected $previousValue; @@ -68,7 +75,8 @@ public function __construct( ?LocalizedString $customLineItem = null, ?string $customLineItemId = null, $nextValue = null, - $previousValue = null + $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->name = $name; @@ -76,10 +84,11 @@ public function __construct( $this->customLineItemId = $customLineItemId; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -99,6 +108,7 @@ public function getType() /** *

    Update action for setCustomLineItemCustomField

    * + * * @return null|string */ public function getChange() @@ -116,6 +126,7 @@ public function getChange() } /** + * * @return null|string */ public function getName() @@ -133,6 +144,7 @@ public function getName() } /** + * * @return null|LocalizedString */ public function getCustomLineItem() @@ -151,6 +163,7 @@ public function getCustomLineItem() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -168,6 +181,7 @@ public function getCustomLineItemId() } /** + * * @return null|mixed */ public function getNextValue() @@ -185,6 +199,7 @@ public function getNextValue() } /** + * * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomTypeChange.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomTypeChange.php index 94559317edc..a7576aed5f8 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomTypeChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomTypeChange.php @@ -22,6 +22,7 @@ interface SetCustomLineItemCustomTypeChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -29,26 +30,31 @@ public function getType(); /** *

    Update action for setCustomLineItemCustomType

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getCustomLineItem(); /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|CustomFields */ public function getNextValue(); /** + * @return null|CustomFields */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomTypeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomTypeChangeBuilder.php index f668fc3f2db..67119bce12c 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomTypeChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomTypeChangeBuilder.php @@ -25,26 +25,31 @@ final class SetCustomLineItemCustomTypeChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $customLineItem; /** + * @var ?string */ private $customLineItemId; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $nextValue; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $previousValue; @@ -52,6 +57,7 @@ final class SetCustomLineItemCustomTypeChangeBuilder implements Builder /** *

    Update action for setCustomLineItemCustomType

    * + * @return null|string */ public function getChange() @@ -60,6 +66,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getCustomLineItem() @@ -68,6 +75,7 @@ public function getCustomLineItem() } /** + * @return null|string */ public function getCustomLineItemId() @@ -76,6 +84,7 @@ public function getCustomLineItemId() } /** + * @return null|CustomFields */ public function getNextValue() @@ -84,6 +93,7 @@ public function getNextValue() } /** + * @return null|CustomFields */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomTypeChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomTypeChangeModel.php index 00f6f066c66..ee6002c6aee 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomTypeChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemCustomTypeChangeModel.php @@ -26,31 +26,37 @@ final class SetCustomLineItemCustomTypeChangeModel extends JsonObjectModel imple public const DISCRIMINATOR_VALUE = 'SetCustomLineItemCustomTypeChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $customLineItem; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?CustomFields */ protected $nextValue; /** + * * @var ?CustomFields */ protected $previousValue; @@ -64,17 +70,19 @@ public function __construct( ?LocalizedString $customLineItem = null, ?string $customLineItemId = null, ?CustomFields $nextValue = null, - ?CustomFields $previousValue = null + ?CustomFields $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->customLineItem = $customLineItem; $this->customLineItemId = $customLineItemId; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -94,6 +102,7 @@ public function getType() /** *

    Update action for setCustomLineItemCustomType

    * + * * @return null|string */ public function getChange() @@ -111,6 +120,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getCustomLineItem() @@ -129,6 +139,7 @@ public function getCustomLineItem() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -146,6 +157,7 @@ public function getCustomLineItemId() } /** + * * @return null|CustomFields */ public function getNextValue() @@ -164,6 +176,7 @@ public function getNextValue() } /** + * * @return null|CustomFields */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemMoneyChange.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemMoneyChange.php index 0f5a7fc69df..bd6cdc16169 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemMoneyChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemMoneyChange.php @@ -22,6 +22,7 @@ interface SetCustomLineItemMoneyChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -29,26 +30,31 @@ public function getType(); /** *

    Update action for setCustomLineItemMoney

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getCustomLineItem(); /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|Money */ public function getNextValue(); /** + * @return null|Money */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemMoneyChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemMoneyChangeBuilder.php index f613b921083..a092a695938 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemMoneyChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemMoneyChangeBuilder.php @@ -25,26 +25,31 @@ final class SetCustomLineItemMoneyChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $customLineItem; /** + * @var ?string */ private $customLineItemId; /** + * @var null|Money|MoneyBuilder */ private $nextValue; /** + * @var null|Money|MoneyBuilder */ private $previousValue; @@ -52,6 +57,7 @@ final class SetCustomLineItemMoneyChangeBuilder implements Builder /** *

    Update action for setCustomLineItemMoney

    * + * @return null|string */ public function getChange() @@ -60,6 +66,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getCustomLineItem() @@ -68,6 +75,7 @@ public function getCustomLineItem() } /** + * @return null|string */ public function getCustomLineItemId() @@ -76,6 +84,7 @@ public function getCustomLineItemId() } /** + * @return null|Money */ public function getNextValue() @@ -84,6 +93,7 @@ public function getNextValue() } /** + * @return null|Money */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemMoneyChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemMoneyChangeModel.php index 3c09a332621..d1eec19b303 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemMoneyChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemMoneyChangeModel.php @@ -26,31 +26,37 @@ final class SetCustomLineItemMoneyChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'SetCustomLineItemMoneyChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $customLineItem; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?Money */ protected $nextValue; /** + * * @var ?Money */ protected $previousValue; @@ -64,17 +70,19 @@ public function __construct( ?LocalizedString $customLineItem = null, ?string $customLineItemId = null, ?Money $nextValue = null, - ?Money $previousValue = null + ?Money $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->customLineItem = $customLineItem; $this->customLineItemId = $customLineItemId; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -94,6 +102,7 @@ public function getType() /** *

    Update action for setCustomLineItemMoney

    * + * * @return null|string */ public function getChange() @@ -111,6 +120,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getCustomLineItem() @@ -129,6 +139,7 @@ public function getCustomLineItem() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -146,6 +157,7 @@ public function getCustomLineItemId() } /** + * * @return null|Money */ public function getNextValue() @@ -164,6 +176,7 @@ public function getNextValue() } /** + * * @return null|Money */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemShippingDetailsChange.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemShippingDetailsChange.php index a0c89e41797..9a95b44cdd4 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemShippingDetailsChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemShippingDetailsChange.php @@ -20,6 +20,7 @@ interface SetCustomLineItemShippingDetailsChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update action for setCustomLineItemShippingDetails

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|ItemShippingDetails */ public function getNextValue(); /** + * @return null|ItemShippingDetails */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemShippingDetailsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemShippingDetailsChangeBuilder.php index 1eba0d638f2..4f28c36a3a2 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemShippingDetailsChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemShippingDetailsChangeBuilder.php @@ -23,21 +23,25 @@ final class SetCustomLineItemShippingDetailsChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $customLineItemId; /** + * @var null|ItemShippingDetails|ItemShippingDetailsBuilder */ private $nextValue; /** + * @var null|ItemShippingDetails|ItemShippingDetailsBuilder */ private $previousValue; @@ -45,6 +49,7 @@ final class SetCustomLineItemShippingDetailsChangeBuilder implements Builder /** *

    Update action for setCustomLineItemShippingDetails

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|string */ public function getCustomLineItemId() @@ -61,6 +67,7 @@ public function getCustomLineItemId() } /** + * @return null|ItemShippingDetails */ public function getNextValue() @@ -69,6 +76,7 @@ public function getNextValue() } /** + * @return null|ItemShippingDetails */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemShippingDetailsChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemShippingDetailsChangeModel.php index 7075e4eba7d..9acb3482e24 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemShippingDetailsChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemShippingDetailsChangeModel.php @@ -24,26 +24,31 @@ final class SetCustomLineItemShippingDetailsChangeModel extends JsonObjectModel public const DISCRIMINATOR_VALUE = 'SetCustomLineItemShippingDetailsChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?ItemShippingDetails */ protected $nextValue; /** + * * @var ?ItemShippingDetails */ protected $previousValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $customLineItemId = null, ?ItemShippingDetails $nextValue = null, - ?ItemShippingDetails $previousValue = null + ?ItemShippingDetails $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->customLineItemId = $customLineItemId; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for setCustomLineItemShippingDetails

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -119,6 +128,7 @@ public function getCustomLineItemId() } /** + * * @return null|ItemShippingDetails */ public function getNextValue() @@ -137,6 +147,7 @@ public function getNextValue() } /** + * * @return null|ItemShippingDetails */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxAmountChange.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxAmountChange.php index 29a309b3abd..2a77ed0d1dd 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxAmountChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxAmountChange.php @@ -23,6 +23,7 @@ interface SetCustomLineItemTaxAmountChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -30,21 +31,25 @@ public function getType(); /** *

    Update action for setCustomLineItemTaxAmount

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getCustomLineItem(); /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|string */ public function getTaxMode(); @@ -52,6 +57,7 @@ public function getTaxMode(); /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getNextValue(); @@ -59,6 +65,7 @@ public function getNextValue(); /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxAmountChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxAmountChangeBuilder.php index 131074364f0..c58503622f7 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxAmountChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxAmountChangeBuilder.php @@ -25,31 +25,37 @@ final class SetCustomLineItemTaxAmountChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $customLineItem; /** + * @var ?string */ private $customLineItemId; /** + * @var ?string */ private $taxMode; /** + * @var null|TaxRate|TaxRateBuilder */ private $nextValue; /** + * @var null|TaxRate|TaxRateBuilder */ private $previousValue; @@ -57,6 +63,7 @@ final class SetCustomLineItemTaxAmountChangeBuilder implements Builder /** *

    Update action for setCustomLineItemTaxAmount

    * + * @return null|string */ public function getChange() @@ -65,6 +72,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getCustomLineItem() @@ -73,6 +81,7 @@ public function getCustomLineItem() } /** + * @return null|string */ public function getCustomLineItemId() @@ -81,6 +90,7 @@ public function getCustomLineItemId() } /** + * @return null|string */ public function getTaxMode() @@ -91,6 +101,7 @@ public function getTaxMode() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getNextValue() @@ -101,6 +112,7 @@ public function getNextValue() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxAmountChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxAmountChangeModel.php index 82f746dba5c..b8ba5c2e0ef 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxAmountChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxAmountChangeModel.php @@ -26,36 +26,43 @@ final class SetCustomLineItemTaxAmountChangeModel extends JsonObjectModel implem public const DISCRIMINATOR_VALUE = 'SetCustomLineItemTaxAmountChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $customLineItem; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?string */ protected $taxMode; /** + * * @var ?TaxRate */ protected $nextValue; /** + * * @var ?TaxRate */ protected $previousValue; @@ -70,7 +77,8 @@ public function __construct( ?string $customLineItemId = null, ?string $taxMode = null, ?TaxRate $nextValue = null, - ?TaxRate $previousValue = null + ?TaxRate $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->customLineItem = $customLineItem; @@ -78,10 +86,11 @@ public function __construct( $this->taxMode = $taxMode; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -101,6 +110,7 @@ public function getType() /** *

    Update action for setCustomLineItemTaxAmount

    * + * * @return null|string */ public function getChange() @@ -118,6 +128,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getCustomLineItem() @@ -136,6 +147,7 @@ public function getCustomLineItem() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -153,6 +165,7 @@ public function getCustomLineItemId() } /** + * * @return null|string */ public function getTaxMode() @@ -172,6 +185,7 @@ public function getTaxMode() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * * @return null|TaxRate */ public function getNextValue() @@ -192,6 +206,7 @@ public function getNextValue() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * * @return null|TaxRate */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxCategoryChange.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxCategoryChange.php index 9393c93430a..0cd6a2793e3 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxCategoryChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxCategoryChange.php @@ -22,6 +22,7 @@ interface SetCustomLineItemTaxCategoryChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -29,26 +30,31 @@ public function getType(); /** *

    Update action for setCustomLineItemTaxCategory

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getCustomLineItem(); /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|Reference */ public function getNextValue(); /** + * @return null|Reference */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxCategoryChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxCategoryChangeBuilder.php index ae79325f39d..2de6687d910 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxCategoryChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxCategoryChangeBuilder.php @@ -25,26 +25,31 @@ final class SetCustomLineItemTaxCategoryChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $customLineItem; /** + * @var ?string */ private $customLineItemId; /** + * @var null|Reference|ReferenceBuilder */ private $nextValue; /** + * @var null|Reference|ReferenceBuilder */ private $previousValue; @@ -52,6 +57,7 @@ final class SetCustomLineItemTaxCategoryChangeBuilder implements Builder /** *

    Update action for setCustomLineItemTaxCategory

    * + * @return null|string */ public function getChange() @@ -60,6 +66,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getCustomLineItem() @@ -68,6 +75,7 @@ public function getCustomLineItem() } /** + * @return null|string */ public function getCustomLineItemId() @@ -76,6 +84,7 @@ public function getCustomLineItemId() } /** + * @return null|Reference */ public function getNextValue() @@ -84,6 +93,7 @@ public function getNextValue() } /** + * @return null|Reference */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxCategoryChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxCategoryChangeModel.php index 68019c07890..059c8677669 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxCategoryChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxCategoryChangeModel.php @@ -26,31 +26,37 @@ final class SetCustomLineItemTaxCategoryChangeModel extends JsonObjectModel impl public const DISCRIMINATOR_VALUE = 'SetCustomLineItemTaxCategoryChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $customLineItem; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?Reference */ protected $nextValue; /** + * * @var ?Reference */ protected $previousValue; @@ -64,17 +70,19 @@ public function __construct( ?LocalizedString $customLineItem = null, ?string $customLineItemId = null, ?Reference $nextValue = null, - ?Reference $previousValue = null + ?Reference $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->customLineItem = $customLineItem; $this->customLineItemId = $customLineItemId; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -94,6 +102,7 @@ public function getType() /** *

    Update action for setCustomLineItemTaxCategory

    * + * * @return null|string */ public function getChange() @@ -111,6 +120,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getCustomLineItem() @@ -129,6 +139,7 @@ public function getCustomLineItem() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -146,6 +157,7 @@ public function getCustomLineItemId() } /** + * * @return null|Reference */ public function getNextValue() @@ -164,6 +176,7 @@ public function getNextValue() } /** + * * @return null|Reference */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxRateChange.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxRateChange.php index 1810a5840e2..e951cfccd1d 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxRateChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxRateChange.php @@ -23,6 +23,7 @@ interface SetCustomLineItemTaxRateChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -30,21 +31,25 @@ public function getType(); /** *

    Update action for setCustomLineItemTaxRate

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getCustomLineItem(); /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|string */ public function getTaxMode(); @@ -52,6 +57,7 @@ public function getTaxMode(); /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getNextValue(); @@ -59,6 +65,7 @@ public function getNextValue(); /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxRateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxRateChangeBuilder.php index 9fd6b9fa021..711bdc92449 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxRateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxRateChangeBuilder.php @@ -25,31 +25,37 @@ final class SetCustomLineItemTaxRateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $customLineItem; /** + * @var ?string */ private $customLineItemId; /** + * @var ?string */ private $taxMode; /** + * @var null|TaxRate|TaxRateBuilder */ private $nextValue; /** + * @var null|TaxRate|TaxRateBuilder */ private $previousValue; @@ -57,6 +63,7 @@ final class SetCustomLineItemTaxRateChangeBuilder implements Builder /** *

    Update action for setCustomLineItemTaxRate

    * + * @return null|string */ public function getChange() @@ -65,6 +72,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getCustomLineItem() @@ -73,6 +81,7 @@ public function getCustomLineItem() } /** + * @return null|string */ public function getCustomLineItemId() @@ -81,6 +90,7 @@ public function getCustomLineItemId() } /** + * @return null|string */ public function getTaxMode() @@ -91,6 +101,7 @@ public function getTaxMode() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getNextValue() @@ -101,6 +112,7 @@ public function getNextValue() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxRateChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxRateChangeModel.php index a52113b7d24..c7c9ca2bff3 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxRateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxRateChangeModel.php @@ -26,36 +26,43 @@ final class SetCustomLineItemTaxRateChangeModel extends JsonObjectModel implemen public const DISCRIMINATOR_VALUE = 'SetCustomLineItemTaxRateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $customLineItem; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?string */ protected $taxMode; /** + * * @var ?TaxRate */ protected $nextValue; /** + * * @var ?TaxRate */ protected $previousValue; @@ -70,7 +77,8 @@ public function __construct( ?string $customLineItemId = null, ?string $taxMode = null, ?TaxRate $nextValue = null, - ?TaxRate $previousValue = null + ?TaxRate $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->customLineItem = $customLineItem; @@ -78,10 +86,11 @@ public function __construct( $this->taxMode = $taxMode; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -101,6 +110,7 @@ public function getType() /** *

    Update action for setCustomLineItemTaxRate

    * + * * @return null|string */ public function getChange() @@ -118,6 +128,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getCustomLineItem() @@ -136,6 +147,7 @@ public function getCustomLineItem() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -153,6 +165,7 @@ public function getCustomLineItemId() } /** + * * @return null|string */ public function getTaxMode() @@ -172,6 +185,7 @@ public function getTaxMode() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * * @return null|TaxRate */ public function getNextValue() @@ -192,6 +206,7 @@ public function getNextValue() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * * @return null|TaxRate */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxedPriceChange.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxedPriceChange.php index da426397264..9ecb55af2e5 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxedPriceChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxedPriceChange.php @@ -22,6 +22,7 @@ interface SetCustomLineItemTaxedPriceChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -29,26 +30,31 @@ public function getType(); /** *

    Update action for setCustomLineItemTaxedPrice

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getCustomLineItem(); /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|Money */ public function getNextValue(); /** + * @return null|Money */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxedPriceChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxedPriceChangeBuilder.php index 0f45d544d6d..931215a85f6 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxedPriceChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxedPriceChangeBuilder.php @@ -25,26 +25,31 @@ final class SetCustomLineItemTaxedPriceChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $customLineItem; /** + * @var ?string */ private $customLineItemId; /** + * @var null|Money|MoneyBuilder */ private $nextValue; /** + * @var null|Money|MoneyBuilder */ private $previousValue; @@ -52,6 +57,7 @@ final class SetCustomLineItemTaxedPriceChangeBuilder implements Builder /** *

    Update action for setCustomLineItemTaxedPrice

    * + * @return null|string */ public function getChange() @@ -60,6 +66,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getCustomLineItem() @@ -68,6 +75,7 @@ public function getCustomLineItem() } /** + * @return null|string */ public function getCustomLineItemId() @@ -76,6 +84,7 @@ public function getCustomLineItemId() } /** + * @return null|Money */ public function getNextValue() @@ -84,6 +93,7 @@ public function getNextValue() } /** + * @return null|Money */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxedPriceChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxedPriceChangeModel.php index 390de8c54b1..cfe558effb0 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxedPriceChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTaxedPriceChangeModel.php @@ -26,31 +26,37 @@ final class SetCustomLineItemTaxedPriceChangeModel extends JsonObjectModel imple public const DISCRIMINATOR_VALUE = 'SetCustomLineItemTaxedPriceChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $customLineItem; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?Money */ protected $nextValue; /** + * * @var ?Money */ protected $previousValue; @@ -64,17 +70,19 @@ public function __construct( ?LocalizedString $customLineItem = null, ?string $customLineItemId = null, ?Money $nextValue = null, - ?Money $previousValue = null + ?Money $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->customLineItem = $customLineItem; $this->customLineItemId = $customLineItemId; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -94,6 +102,7 @@ public function getType() /** *

    Update action for setCustomLineItemTaxedPrice

    * + * * @return null|string */ public function getChange() @@ -111,6 +120,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getCustomLineItem() @@ -129,6 +139,7 @@ public function getCustomLineItem() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -146,6 +157,7 @@ public function getCustomLineItemId() } /** + * * @return null|Money */ public function getNextValue() @@ -164,6 +176,7 @@ public function getNextValue() } /** + * * @return null|Money */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTotalPriceChange.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTotalPriceChange.php index 48956795b81..24e7c1b8c11 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTotalPriceChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTotalPriceChange.php @@ -22,6 +22,7 @@ interface SetCustomLineItemTotalPriceChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -29,26 +30,31 @@ public function getType(); /** *

    Update action for setCustomLineItemTotalPrice

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getCustomLineItem(); /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|Money */ public function getNextValue(); /** + * @return null|Money */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTotalPriceChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTotalPriceChangeBuilder.php index 2b23d27b851..4f27f348869 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTotalPriceChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTotalPriceChangeBuilder.php @@ -25,26 +25,31 @@ final class SetCustomLineItemTotalPriceChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $customLineItem; /** + * @var ?string */ private $customLineItemId; /** + * @var null|Money|MoneyBuilder */ private $nextValue; /** + * @var null|Money|MoneyBuilder */ private $previousValue; @@ -52,6 +57,7 @@ final class SetCustomLineItemTotalPriceChangeBuilder implements Builder /** *

    Update action for setCustomLineItemTotalPrice

    * + * @return null|string */ public function getChange() @@ -60,6 +66,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getCustomLineItem() @@ -68,6 +75,7 @@ public function getCustomLineItem() } /** + * @return null|string */ public function getCustomLineItemId() @@ -76,6 +84,7 @@ public function getCustomLineItemId() } /** + * @return null|Money */ public function getNextValue() @@ -84,6 +93,7 @@ public function getNextValue() } /** + * @return null|Money */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTotalPriceChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTotalPriceChangeModel.php index 04e32ab2580..e819c4c5368 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomLineItemTotalPriceChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomLineItemTotalPriceChangeModel.php @@ -26,31 +26,37 @@ final class SetCustomLineItemTotalPriceChangeModel extends JsonObjectModel imple public const DISCRIMINATOR_VALUE = 'SetCustomLineItemTotalPriceChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $customLineItem; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?Money */ protected $nextValue; /** + * * @var ?Money */ protected $previousValue; @@ -64,17 +70,19 @@ public function __construct( ?LocalizedString $customLineItem = null, ?string $customLineItemId = null, ?Money $nextValue = null, - ?Money $previousValue = null + ?Money $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->customLineItem = $customLineItem; $this->customLineItemId = $customLineItemId; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -94,6 +102,7 @@ public function getType() /** *

    Update action for setCustomLineItemTotalPrice

    * + * * @return null|string */ public function getChange() @@ -111,6 +120,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getCustomLineItem() @@ -129,6 +139,7 @@ public function getCustomLineItem() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -146,6 +157,7 @@ public function getCustomLineItemId() } /** + * * @return null|Money */ public function getNextValue() @@ -164,6 +176,7 @@ public function getNextValue() } /** + * * @return null|Money */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomShippingMethodChange.php b/lib/commercetools-history/src/Models/Change/SetCustomShippingMethodChange.php index 10336d8ce17..7713491b37f 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomShippingMethodChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomShippingMethodChange.php @@ -19,6 +19,7 @@ interface SetCustomShippingMethodChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for setCustomShippingMethod

    * + * @return null|string */ public function getChange(); /** + * @return null|CustomShippingMethodChangeValue */ public function getNextValue(); /** + * @return null|CustomShippingMethodChangeValue */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCustomShippingMethodChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCustomShippingMethodChangeBuilder.php index c03c452f18c..ec7be4fc1a7 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomShippingMethodChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomShippingMethodChangeBuilder.php @@ -23,16 +23,19 @@ final class SetCustomShippingMethodChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|CustomShippingMethodChangeValue|CustomShippingMethodChangeValueBuilder */ private $nextValue; /** + * @var null|CustomShippingMethodChangeValue|CustomShippingMethodChangeValueBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class SetCustomShippingMethodChangeBuilder implements Builder /** *

    Update action for setCustomShippingMethod

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|CustomShippingMethodChangeValue */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|CustomShippingMethodChangeValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomShippingMethodChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCustomShippingMethodChangeModel.php index b63177d9f25..52eda6bf35c 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomShippingMethodChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomShippingMethodChangeModel.php @@ -24,21 +24,25 @@ final class SetCustomShippingMethodChangeModel extends JsonObjectModel implement public const DISCRIMINATOR_VALUE = 'SetCustomShippingMethodChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?CustomShippingMethodChangeValue */ protected $nextValue; /** + * * @var ?CustomShippingMethodChangeValue */ protected $previousValue; @@ -50,15 +54,17 @@ final class SetCustomShippingMethodChangeModel extends JsonObjectModel implement public function __construct( ?string $change = null, ?CustomShippingMethodChangeValue $nextValue = null, - ?CustomShippingMethodChangeValue $previousValue = null + ?CustomShippingMethodChangeValue $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for setCustomShippingMethod

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|CustomShippingMethodChangeValue */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|CustomShippingMethodChangeValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomTypeChange.php b/lib/commercetools-history/src/Models/Change/SetCustomTypeChange.php index 9bc5b3b044e..f05f47f97e9 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomTypeChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomTypeChange.php @@ -19,6 +19,7 @@ interface SetCustomTypeChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for setting a custom type

    * + * @return null|string */ public function getChange(); /** + * @return null|CustomFields */ public function getNextValue(); /** + * @return null|CustomFields */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCustomTypeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCustomTypeChangeBuilder.php index 0d977698ec7..9494e409525 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomTypeChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomTypeChangeBuilder.php @@ -23,16 +23,19 @@ final class SetCustomTypeChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $nextValue; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class SetCustomTypeChangeBuilder implements Builder /** *

    Update action for setting a custom type

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|CustomFields */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|CustomFields */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomTypeChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCustomTypeChangeModel.php index 639cf835b9f..c6b47d59962 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomTypeChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomTypeChangeModel.php @@ -24,21 +24,25 @@ final class SetCustomTypeChangeModel extends JsonObjectModel implements SetCusto public const DISCRIMINATOR_VALUE = 'SetCustomTypeChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?CustomFields */ protected $nextValue; /** + * * @var ?CustomFields */ protected $previousValue; @@ -50,15 +54,17 @@ final class SetCustomTypeChangeModel extends JsonObjectModel implements SetCusto public function __construct( ?string $change = null, ?CustomFields $nextValue = null, - ?CustomFields $previousValue = null + ?CustomFields $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for setting a custom type

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|CustomFields */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|CustomFields */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomerChange.php b/lib/commercetools-history/src/Models/Change/SetCustomerChange.php index 2c5d64c779b..307d9db43ac 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomerChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomerChange.php @@ -19,6 +19,7 @@ interface SetCustomerChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for setCustomer

    * + * @return null|string */ public function getChange(); /** + * @return null|Reference */ public function getPreviousValue(); /** + * @return null|Reference */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCustomerChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCustomerChangeBuilder.php index 3f7c85d33a8..7f4b3584578 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomerChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomerChangeBuilder.php @@ -23,16 +23,19 @@ final class SetCustomerChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Reference|ReferenceBuilder */ private $previousValue; /** + * @var null|Reference|ReferenceBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class SetCustomerChangeBuilder implements Builder /** *

    Shape of the action for setCustomer

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Reference */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|Reference */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomerChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCustomerChangeModel.php index 64da4e52a14..97744f5a885 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomerChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomerChangeModel.php @@ -24,21 +24,25 @@ final class SetCustomerChangeModel extends JsonObjectModel implements SetCustome public const DISCRIMINATOR_VALUE = 'SetCustomerChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Reference */ protected $previousValue; /** + * * @var ?Reference */ protected $nextValue; @@ -50,15 +54,17 @@ final class SetCustomerChangeModel extends JsonObjectModel implements SetCustome public function __construct( ?string $change = null, ?Reference $previousValue = null, - ?Reference $nextValue = null + ?Reference $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for setCustomer

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Reference */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|Reference */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomerEmailChange.php b/lib/commercetools-history/src/Models/Change/SetCustomerEmailChange.php index f9a1157cce7..0030a6de2fa 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomerEmailChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomerEmailChange.php @@ -18,6 +18,7 @@ interface SetCustomerEmailChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setCustomerEmail

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCustomerEmailChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCustomerEmailChangeBuilder.php index 12e5f9ad645..a8b838b0241 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomerEmailChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomerEmailChangeBuilder.php @@ -21,16 +21,19 @@ final class SetCustomerEmailChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetCustomerEmailChangeBuilder implements Builder /** *

    Shape of the action for setCustomerEmail

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomerEmailChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCustomerEmailChangeModel.php index a3365b64e17..35dff198fd4 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomerEmailChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomerEmailChangeModel.php @@ -22,21 +22,25 @@ final class SetCustomerEmailChangeModel extends JsonObjectModel implements SetCu public const DISCRIMINATOR_VALUE = 'SetCustomerEmailChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetCustomerEmailChangeModel extends JsonObjectModel implements SetCu public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setCustomerEmail

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomerGroupChange.php b/lib/commercetools-history/src/Models/Change/SetCustomerGroupChange.php index 4c8bbc9b8fb..2278975df84 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomerGroupChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomerGroupChange.php @@ -19,6 +19,7 @@ interface SetCustomerGroupChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for setCustomerGroup

    * + * @return null|string */ public function getChange(); /** + * @return null|Reference */ public function getPreviousValue(); /** + * @return null|Reference */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCustomerGroupChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCustomerGroupChangeBuilder.php index 54e9a3c81a1..d17a734d4c2 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomerGroupChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomerGroupChangeBuilder.php @@ -23,16 +23,19 @@ final class SetCustomerGroupChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Reference|ReferenceBuilder */ private $previousValue; /** + * @var null|Reference|ReferenceBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class SetCustomerGroupChangeBuilder implements Builder /** *

    Shape of the action for setCustomerGroup

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Reference */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|Reference */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomerGroupChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCustomerGroupChangeModel.php index 30e4f2c632a..cb7cd38e117 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomerGroupChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomerGroupChangeModel.php @@ -24,21 +24,25 @@ final class SetCustomerGroupChangeModel extends JsonObjectModel implements SetCu public const DISCRIMINATOR_VALUE = 'SetCustomerGroupChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Reference */ protected $previousValue; /** + * * @var ?Reference */ protected $nextValue; @@ -50,15 +54,17 @@ final class SetCustomerGroupChangeModel extends JsonObjectModel implements SetCu public function __construct( ?string $change = null, ?Reference $previousValue = null, - ?Reference $nextValue = null + ?Reference $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for setCustomerGroup

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Reference */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|Reference */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomerIdChange.php b/lib/commercetools-history/src/Models/Change/SetCustomerIdChange.php index c3749b10a6a..6c4b38d3e73 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomerIdChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomerIdChange.php @@ -18,6 +18,7 @@ interface SetCustomerIdChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setCustomerId

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCustomerIdChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCustomerIdChangeBuilder.php index e7365141d7c..03364d390b8 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomerIdChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomerIdChangeBuilder.php @@ -21,16 +21,19 @@ final class SetCustomerIdChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetCustomerIdChangeBuilder implements Builder /** *

    Shape of the action for setCustomerId

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomerIdChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCustomerIdChangeModel.php index a106a941480..53ec562ade9 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomerIdChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomerIdChangeModel.php @@ -22,21 +22,25 @@ final class SetCustomerIdChangeModel extends JsonObjectModel implements SetCusto public const DISCRIMINATOR_VALUE = 'SetCustomerIdChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetCustomerIdChangeModel extends JsonObjectModel implements SetCusto public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setCustomerId

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomerNumberChange.php b/lib/commercetools-history/src/Models/Change/SetCustomerNumberChange.php index 95089da4ef6..e362c92aeb3 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomerNumberChange.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomerNumberChange.php @@ -18,6 +18,7 @@ interface SetCustomerNumberChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setCustomerNumber

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetCustomerNumberChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetCustomerNumberChangeBuilder.php index b240ee4c437..06e151c08f2 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomerNumberChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomerNumberChangeBuilder.php @@ -21,16 +21,19 @@ final class SetCustomerNumberChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetCustomerNumberChangeBuilder implements Builder /** *

    Shape of the action for setCustomerNumber

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetCustomerNumberChangeModel.php b/lib/commercetools-history/src/Models/Change/SetCustomerNumberChangeModel.php index 464dacdbd91..698aa53ce8b 100644 --- a/lib/commercetools-history/src/Models/Change/SetCustomerNumberChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetCustomerNumberChangeModel.php @@ -22,21 +22,25 @@ final class SetCustomerNumberChangeModel extends JsonObjectModel implements SetC public const DISCRIMINATOR_VALUE = 'SetCustomerNumberChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetCustomerNumberChangeModel extends JsonObjectModel implements SetC public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setCustomerNumber

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDateOfBirthChange.php b/lib/commercetools-history/src/Models/Change/SetDateOfBirthChange.php index c209523a144..9b369c8dc45 100644 --- a/lib/commercetools-history/src/Models/Change/SetDateOfBirthChange.php +++ b/lib/commercetools-history/src/Models/Change/SetDateOfBirthChange.php @@ -18,6 +18,7 @@ interface SetDateOfBirthChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setDateOfBirth

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetDateOfBirthChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetDateOfBirthChangeBuilder.php index 90e467cd3f2..270198e3fe7 100644 --- a/lib/commercetools-history/src/Models/Change/SetDateOfBirthChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetDateOfBirthChangeBuilder.php @@ -21,16 +21,19 @@ final class SetDateOfBirthChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetDateOfBirthChangeBuilder implements Builder /** *

    Shape of the action for setDateOfBirth

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDateOfBirthChangeModel.php b/lib/commercetools-history/src/Models/Change/SetDateOfBirthChangeModel.php index 6a8eb76c0b6..7e4b34c2bd4 100644 --- a/lib/commercetools-history/src/Models/Change/SetDateOfBirthChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetDateOfBirthChangeModel.php @@ -22,21 +22,25 @@ final class SetDateOfBirthChangeModel extends JsonObjectModel implements SetDate public const DISCRIMINATOR_VALUE = 'SetDateOfBirthChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetDateOfBirthChangeModel extends JsonObjectModel implements SetDate public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setDateOfBirth

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDefaultBillingAddressChange.php b/lib/commercetools-history/src/Models/Change/SetDefaultBillingAddressChange.php index a654d85a2d9..4b866cd4479 100644 --- a/lib/commercetools-history/src/Models/Change/SetDefaultBillingAddressChange.php +++ b/lib/commercetools-history/src/Models/Change/SetDefaultBillingAddressChange.php @@ -21,21 +21,25 @@ interface SetDefaultBillingAddressChange extends Change /** *

    Update action for setDefaultBillingAddress action.

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|Address */ public function getNextValue(); /** + * @return null|Address */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetDefaultBillingAddressChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetDefaultBillingAddressChangeBuilder.php index 9281718a794..42390c0d8e7 100644 --- a/lib/commercetools-history/src/Models/Change/SetDefaultBillingAddressChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetDefaultBillingAddressChangeBuilder.php @@ -23,16 +23,19 @@ final class SetDefaultBillingAddressChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Address|AddressBuilder */ private $nextValue; /** + * @var null|Address|AddressBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class SetDefaultBillingAddressChangeBuilder implements Builder /** *

    Update action for setDefaultBillingAddress action.

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Address */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDefaultBillingAddressChangeModel.php b/lib/commercetools-history/src/Models/Change/SetDefaultBillingAddressChangeModel.php index 4be0b9a00db..af71a32c742 100644 --- a/lib/commercetools-history/src/Models/Change/SetDefaultBillingAddressChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetDefaultBillingAddressChangeModel.php @@ -24,21 +24,25 @@ final class SetDefaultBillingAddressChangeModel extends JsonObjectModel implemen public const DISCRIMINATOR_VALUE = 'SetDefaultBillingAddressChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Address */ protected $nextValue; /** + * * @var ?Address */ protected $previousValue; @@ -50,15 +54,17 @@ final class SetDefaultBillingAddressChangeModel extends JsonObjectModel implemen public function __construct( ?string $change = null, ?Address $nextValue = null, - ?Address $previousValue = null + ?Address $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for setDefaultBillingAddress action.

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Address */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDefaultShippingAddressChange.php b/lib/commercetools-history/src/Models/Change/SetDefaultShippingAddressChange.php index fd00311b39a..4a351e55941 100644 --- a/lib/commercetools-history/src/Models/Change/SetDefaultShippingAddressChange.php +++ b/lib/commercetools-history/src/Models/Change/SetDefaultShippingAddressChange.php @@ -21,21 +21,25 @@ interface SetDefaultShippingAddressChange extends Change /** *

    Update action for setDefaultShippingAddress action.

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|Address */ public function getNextValue(); /** + * @return null|Address */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetDefaultShippingAddressChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetDefaultShippingAddressChangeBuilder.php index 72b84f54d57..d0eb48d660e 100644 --- a/lib/commercetools-history/src/Models/Change/SetDefaultShippingAddressChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetDefaultShippingAddressChangeBuilder.php @@ -23,16 +23,19 @@ final class SetDefaultShippingAddressChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Address|AddressBuilder */ private $nextValue; /** + * @var null|Address|AddressBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class SetDefaultShippingAddressChangeBuilder implements Builder /** *

    Update action for setDefaultShippingAddress action.

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Address */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDefaultShippingAddressChangeModel.php b/lib/commercetools-history/src/Models/Change/SetDefaultShippingAddressChangeModel.php index d35bdd4d3f2..773bce5f4d9 100644 --- a/lib/commercetools-history/src/Models/Change/SetDefaultShippingAddressChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetDefaultShippingAddressChangeModel.php @@ -24,21 +24,25 @@ final class SetDefaultShippingAddressChangeModel extends JsonObjectModel impleme public const DISCRIMINATOR_VALUE = 'SetDefaultShippingAddressChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Address */ protected $nextValue; /** + * * @var ?Address */ protected $previousValue; @@ -50,15 +54,17 @@ final class SetDefaultShippingAddressChangeModel extends JsonObjectModel impleme public function __construct( ?string $change = null, ?Address $nextValue = null, - ?Address $previousValue = null + ?Address $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for setDefaultShippingAddress action.

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Address */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDeleteDaysAfterLastModificationChange.php b/lib/commercetools-history/src/Models/Change/SetDeleteDaysAfterLastModificationChange.php index 9488950b1f0..f2dea1f5dd6 100644 --- a/lib/commercetools-history/src/Models/Change/SetDeleteDaysAfterLastModificationChange.php +++ b/lib/commercetools-history/src/Models/Change/SetDeleteDaysAfterLastModificationChange.php @@ -18,6 +18,7 @@ interface SetDeleteDaysAfterLastModificationChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setDeleteDaysAfterLastModification

    * + * @return null|string */ public function getChange(); /** + * @return null|int */ public function getPreviousValue(); /** + * @return null|int */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetDeleteDaysAfterLastModificationChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetDeleteDaysAfterLastModificationChangeBuilder.php index 0347c484f36..51bed122fc7 100644 --- a/lib/commercetools-history/src/Models/Change/SetDeleteDaysAfterLastModificationChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetDeleteDaysAfterLastModificationChangeBuilder.php @@ -21,16 +21,19 @@ final class SetDeleteDaysAfterLastModificationChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?int */ private $previousValue; /** + * @var ?int */ private $nextValue; @@ -38,6 +41,7 @@ final class SetDeleteDaysAfterLastModificationChangeBuilder implements Builder /** *

    Shape of the action for setDeleteDaysAfterLastModification

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|int */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|int */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDeleteDaysAfterLastModificationChangeModel.php b/lib/commercetools-history/src/Models/Change/SetDeleteDaysAfterLastModificationChangeModel.php index 8ee89076b24..4586aa9247c 100644 --- a/lib/commercetools-history/src/Models/Change/SetDeleteDaysAfterLastModificationChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetDeleteDaysAfterLastModificationChangeModel.php @@ -22,21 +22,25 @@ final class SetDeleteDaysAfterLastModificationChangeModel extends JsonObjectMode public const DISCRIMINATOR_VALUE = 'SetDeleteDaysAfterLastModificationChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?int */ protected $previousValue; /** + * * @var ?int */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetDeleteDaysAfterLastModificationChangeModel extends JsonObjectMode public function __construct( ?string $change = null, ?int $previousValue = null, - ?int $nextValue = null + ?int $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setDeleteDaysAfterLastModification

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|int */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|int */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDeliveryAddressChange.php b/lib/commercetools-history/src/Models/Change/SetDeliveryAddressChange.php index b7bf178187a..c0e49119c9e 100644 --- a/lib/commercetools-history/src/Models/Change/SetDeliveryAddressChange.php +++ b/lib/commercetools-history/src/Models/Change/SetDeliveryAddressChange.php @@ -20,6 +20,7 @@ interface SetDeliveryAddressChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update action for setDeliveryAddress

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getDeliveryId(); /** + * @return null|Address */ public function getNextValue(); /** + * @return null|Address */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetDeliveryAddressChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetDeliveryAddressChangeBuilder.php index c6eb4d9c8d9..6e65438b642 100644 --- a/lib/commercetools-history/src/Models/Change/SetDeliveryAddressChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetDeliveryAddressChangeBuilder.php @@ -23,21 +23,25 @@ final class SetDeliveryAddressChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $deliveryId; /** + * @var null|Address|AddressBuilder */ private $nextValue; /** + * @var null|Address|AddressBuilder */ private $previousValue; @@ -45,6 +49,7 @@ final class SetDeliveryAddressChangeBuilder implements Builder /** *

    Update action for setDeliveryAddress

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|string */ public function getDeliveryId() @@ -61,6 +67,7 @@ public function getDeliveryId() } /** + * @return null|Address */ public function getNextValue() @@ -69,6 +76,7 @@ public function getNextValue() } /** + * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDeliveryAddressChangeModel.php b/lib/commercetools-history/src/Models/Change/SetDeliveryAddressChangeModel.php index 7712f4b0ad2..2538c8e066a 100644 --- a/lib/commercetools-history/src/Models/Change/SetDeliveryAddressChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetDeliveryAddressChangeModel.php @@ -24,26 +24,31 @@ final class SetDeliveryAddressChangeModel extends JsonObjectModel implements Set public const DISCRIMINATOR_VALUE = 'SetDeliveryAddressChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?Address */ protected $nextValue; /** + * * @var ?Address */ protected $previousValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $deliveryId = null, ?Address $nextValue = null, - ?Address $previousValue = null + ?Address $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->deliveryId = $deliveryId; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for setDeliveryAddress

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|string */ public function getDeliveryId() @@ -119,6 +128,7 @@ public function getDeliveryId() } /** + * * @return null|Address */ public function getNextValue() @@ -137,6 +147,7 @@ public function getNextValue() } /** + * * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDeliveryItemsChange.php b/lib/commercetools-history/src/Models/Change/SetDeliveryItemsChange.php index cfc40df0bd2..0fd55b0bc63 100644 --- a/lib/commercetools-history/src/Models/Change/SetDeliveryItemsChange.php +++ b/lib/commercetools-history/src/Models/Change/SetDeliveryItemsChange.php @@ -20,6 +20,7 @@ interface SetDeliveryItemsChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update action for setDeliveryItems

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getDeliveryId(); /** + * @return null|DeliveryItemCollection */ public function getNextValue(); /** + * @return null|DeliveryItemCollection */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetDeliveryItemsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetDeliveryItemsChangeBuilder.php index 6da26a7a5ce..b9f8be72ca7 100644 --- a/lib/commercetools-history/src/Models/Change/SetDeliveryItemsChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetDeliveryItemsChangeBuilder.php @@ -22,21 +22,25 @@ final class SetDeliveryItemsChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $deliveryId; /** + * @var ?DeliveryItemCollection */ private $nextValue; /** + * @var ?DeliveryItemCollection */ private $previousValue; @@ -44,6 +48,7 @@ final class SetDeliveryItemsChangeBuilder implements Builder /** *

    Update action for setDeliveryItems

    * + * @return null|string */ public function getChange() @@ -52,6 +57,7 @@ public function getChange() } /** + * @return null|string */ public function getDeliveryId() @@ -60,6 +66,7 @@ public function getDeliveryId() } /** + * @return null|DeliveryItemCollection */ public function getNextValue() @@ -68,6 +75,7 @@ public function getNextValue() } /** + * @return null|DeliveryItemCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDeliveryItemsChangeModel.php b/lib/commercetools-history/src/Models/Change/SetDeliveryItemsChangeModel.php index 4aaeb688c0f..e649748a9b7 100644 --- a/lib/commercetools-history/src/Models/Change/SetDeliveryItemsChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetDeliveryItemsChangeModel.php @@ -23,26 +23,31 @@ final class SetDeliveryItemsChangeModel extends JsonObjectModel implements SetDe public const DISCRIMINATOR_VALUE = 'SetDeliveryItemsChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?DeliveryItemCollection */ protected $nextValue; /** + * * @var ?DeliveryItemCollection */ protected $previousValue; @@ -55,16 +60,18 @@ public function __construct( ?string $change = null, ?string $deliveryId = null, ?DeliveryItemCollection $nextValue = null, - ?DeliveryItemCollection $previousValue = null + ?DeliveryItemCollection $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->deliveryId = $deliveryId; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -84,6 +91,7 @@ public function getType() /** *

    Update action for setDeliveryItems

    * + * * @return null|string */ public function getChange() @@ -101,6 +109,7 @@ public function getChange() } /** + * * @return null|string */ public function getDeliveryId() @@ -118,6 +127,7 @@ public function getDeliveryId() } /** + * * @return null|DeliveryItemCollection */ public function getNextValue() @@ -135,6 +145,7 @@ public function getNextValue() } /** + * * @return null|DeliveryItemCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDescriptionChange.php b/lib/commercetools-history/src/Models/Change/SetDescriptionChange.php index 648af26a87a..bb42ea0ad55 100644 --- a/lib/commercetools-history/src/Models/Change/SetDescriptionChange.php +++ b/lib/commercetools-history/src/Models/Change/SetDescriptionChange.php @@ -18,6 +18,7 @@ interface SetDescriptionChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setDescription

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetDescriptionChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetDescriptionChangeBuilder.php index fd3688ba84f..bd7e809f82c 100644 --- a/lib/commercetools-history/src/Models/Change/SetDescriptionChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetDescriptionChangeBuilder.php @@ -21,16 +21,19 @@ final class SetDescriptionChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetDescriptionChangeBuilder implements Builder /** *

    Shape of the action for setDescription

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDescriptionChangeModel.php b/lib/commercetools-history/src/Models/Change/SetDescriptionChangeModel.php index d181077e489..6fddaa932b6 100644 --- a/lib/commercetools-history/src/Models/Change/SetDescriptionChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetDescriptionChangeModel.php @@ -22,21 +22,25 @@ final class SetDescriptionChangeModel extends JsonObjectModel implements SetDesc public const DISCRIMINATOR_VALUE = 'SetDescriptionChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetDescriptionChangeModel extends JsonObjectModel implements SetDesc public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setDescription

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDiscountedPriceChange.php b/lib/commercetools-history/src/Models/Change/SetDiscountedPriceChange.php index 28f77e800ca..5d05189e411 100644 --- a/lib/commercetools-history/src/Models/Change/SetDiscountedPriceChange.php +++ b/lib/commercetools-history/src/Models/Change/SetDiscountedPriceChange.php @@ -22,6 +22,7 @@ interface SetDiscountedPriceChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -29,31 +30,37 @@ public function getType(); /** *

    Update action for setDiscountedPrice

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|string */ public function getVariant(); /** + * @return null|string */ public function getPriceId(); /** + * @return null|Price */ public function getPreviousValue(); /** + * @return null|Price */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetDiscountedPriceChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetDiscountedPriceChangeBuilder.php index 8bd35a9ad34..5c6deebfde1 100644 --- a/lib/commercetools-history/src/Models/Change/SetDiscountedPriceChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetDiscountedPriceChangeBuilder.php @@ -23,31 +23,37 @@ final class SetDiscountedPriceChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var ?string */ private $variant; /** + * @var ?string */ private $priceId; /** + * @var null|Price|PriceBuilder */ private $previousValue; /** + * @var null|Price|PriceBuilder */ private $nextValue; @@ -55,6 +61,7 @@ final class SetDiscountedPriceChangeBuilder implements Builder /** *

    Update action for setDiscountedPrice

    * + * @return null|string */ public function getChange() @@ -63,6 +70,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -71,6 +79,7 @@ public function getCatalogData() } /** + * @return null|string */ public function getVariant() @@ -79,6 +88,7 @@ public function getVariant() } /** + * @return null|string */ public function getPriceId() @@ -87,6 +97,7 @@ public function getPriceId() } /** + * @return null|Price */ public function getPreviousValue() @@ -95,6 +106,7 @@ public function getPreviousValue() } /** + * @return null|Price */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDiscountedPriceChangeModel.php b/lib/commercetools-history/src/Models/Change/SetDiscountedPriceChangeModel.php index 24cdbdb88bc..7e78d6bd9f6 100644 --- a/lib/commercetools-history/src/Models/Change/SetDiscountedPriceChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetDiscountedPriceChangeModel.php @@ -24,36 +24,43 @@ final class SetDiscountedPriceChangeModel extends JsonObjectModel implements Set public const DISCRIMINATOR_VALUE = 'SetDiscountedPriceChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?string */ protected $variant; /** + * * @var ?string */ protected $priceId; /** + * * @var ?Price */ protected $previousValue; /** + * * @var ?Price */ protected $nextValue; @@ -68,7 +75,8 @@ public function __construct( ?string $variant = null, ?string $priceId = null, ?Price $previousValue = null, - ?Price $nextValue = null + ?Price $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; @@ -76,10 +84,11 @@ public function __construct( $this->priceId = $priceId; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -99,6 +108,7 @@ public function getType() /** *

    Update action for setDiscountedPrice

    * + * * @return null|string */ public function getChange() @@ -116,6 +126,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -133,6 +144,7 @@ public function getCatalogData() } /** + * * @return null|string */ public function getVariant() @@ -150,6 +162,7 @@ public function getVariant() } /** + * * @return null|string */ public function getPriceId() @@ -167,6 +180,7 @@ public function getPriceId() } /** + * * @return null|Price */ public function getPreviousValue() @@ -185,6 +199,7 @@ public function getPreviousValue() } /** + * * @return null|Price */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDistributionChannelsChange.php b/lib/commercetools-history/src/Models/Change/SetDistributionChannelsChange.php index 8dd702caa5c..7de8e293495 100644 --- a/lib/commercetools-history/src/Models/Change/SetDistributionChannelsChange.php +++ b/lib/commercetools-history/src/Models/Change/SetDistributionChannelsChange.php @@ -19,6 +19,7 @@ interface SetDistributionChannelsChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for setDistributionChannels

    * + * @return null|string */ public function getChange(); /** + * @return null|ReferenceCollection */ public function getPreviousValue(); /** + * @return null|ReferenceCollection */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetDistributionChannelsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetDistributionChannelsChangeBuilder.php index 772efaea162..06e68f964cb 100644 --- a/lib/commercetools-history/src/Models/Change/SetDistributionChannelsChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetDistributionChannelsChangeBuilder.php @@ -22,16 +22,19 @@ final class SetDistributionChannelsChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?ReferenceCollection */ private $previousValue; /** + * @var ?ReferenceCollection */ private $nextValue; @@ -39,6 +42,7 @@ final class SetDistributionChannelsChangeBuilder implements Builder /** *

    Shape of the action for setDistributionChannels

    * + * @return null|string */ public function getChange() @@ -47,6 +51,7 @@ public function getChange() } /** + * @return null|ReferenceCollection */ public function getPreviousValue() @@ -55,6 +60,7 @@ public function getPreviousValue() } /** + * @return null|ReferenceCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetDistributionChannelsChangeModel.php b/lib/commercetools-history/src/Models/Change/SetDistributionChannelsChangeModel.php index 9476b929372..3c1c51339e5 100644 --- a/lib/commercetools-history/src/Models/Change/SetDistributionChannelsChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetDistributionChannelsChangeModel.php @@ -23,21 +23,25 @@ final class SetDistributionChannelsChangeModel extends JsonObjectModel implement public const DISCRIMINATOR_VALUE = 'SetDistributionChannelsChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ReferenceCollection */ protected $previousValue; /** + * * @var ?ReferenceCollection */ protected $nextValue; @@ -49,15 +53,17 @@ final class SetDistributionChannelsChangeModel extends JsonObjectModel implement public function __construct( ?string $change = null, ?ReferenceCollection $previousValue = null, - ?ReferenceCollection $nextValue = null + ?ReferenceCollection $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -77,6 +83,7 @@ public function getType() /** *

    Shape of the action for setDistributionChannels

    * + * * @return null|string */ public function getChange() @@ -94,6 +101,7 @@ public function getChange() } /** + * * @return null|ReferenceCollection */ public function getPreviousValue() @@ -111,6 +119,7 @@ public function getPreviousValue() } /** + * * @return null|ReferenceCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetExpectedDeliveryChange.php b/lib/commercetools-history/src/Models/Change/SetExpectedDeliveryChange.php index 6ff66d6834d..0b82763b151 100644 --- a/lib/commercetools-history/src/Models/Change/SetExpectedDeliveryChange.php +++ b/lib/commercetools-history/src/Models/Change/SetExpectedDeliveryChange.php @@ -18,6 +18,7 @@ interface SetExpectedDeliveryChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setExpectedDelivery

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetExpectedDeliveryChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetExpectedDeliveryChangeBuilder.php index 94369556528..78269116b39 100644 --- a/lib/commercetools-history/src/Models/Change/SetExpectedDeliveryChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetExpectedDeliveryChangeBuilder.php @@ -21,16 +21,19 @@ final class SetExpectedDeliveryChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetExpectedDeliveryChangeBuilder implements Builder /** *

    Shape of the action for setExpectedDelivery

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetExpectedDeliveryChangeModel.php b/lib/commercetools-history/src/Models/Change/SetExpectedDeliveryChangeModel.php index 54c85c006d7..59b0e3588e1 100644 --- a/lib/commercetools-history/src/Models/Change/SetExpectedDeliveryChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetExpectedDeliveryChangeModel.php @@ -22,21 +22,25 @@ final class SetExpectedDeliveryChangeModel extends JsonObjectModel implements Se public const DISCRIMINATOR_VALUE = 'SetExpectedDeliveryChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetExpectedDeliveryChangeModel extends JsonObjectModel implements Se public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setExpectedDelivery

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetExternalIdChange.php b/lib/commercetools-history/src/Models/Change/SetExternalIdChange.php index 3cac47b36e5..c183d7194d0 100644 --- a/lib/commercetools-history/src/Models/Change/SetExternalIdChange.php +++ b/lib/commercetools-history/src/Models/Change/SetExternalIdChange.php @@ -18,6 +18,7 @@ interface SetExternalIdChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setExternalId

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetExternalIdChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetExternalIdChangeBuilder.php index 468b8238bab..2b482e15f80 100644 --- a/lib/commercetools-history/src/Models/Change/SetExternalIdChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetExternalIdChangeBuilder.php @@ -21,16 +21,19 @@ final class SetExternalIdChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetExternalIdChangeBuilder implements Builder /** *

    Shape of the action for setExternalId

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetExternalIdChangeModel.php b/lib/commercetools-history/src/Models/Change/SetExternalIdChangeModel.php index 1fc05f9e99e..8c2f24e95fb 100644 --- a/lib/commercetools-history/src/Models/Change/SetExternalIdChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetExternalIdChangeModel.php @@ -22,21 +22,25 @@ final class SetExternalIdChangeModel extends JsonObjectModel implements SetExter public const DISCRIMINATOR_VALUE = 'SetExternalIdChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetExternalIdChangeModel extends JsonObjectModel implements SetExter public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setExternalId

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetFirstNameChange.php b/lib/commercetools-history/src/Models/Change/SetFirstNameChange.php index fe2c5292b03..c4b2bb2320f 100644 --- a/lib/commercetools-history/src/Models/Change/SetFirstNameChange.php +++ b/lib/commercetools-history/src/Models/Change/SetFirstNameChange.php @@ -18,6 +18,7 @@ interface SetFirstNameChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setFirstName

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetFirstNameChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetFirstNameChangeBuilder.php index b28c88ccc25..6be1572e77e 100644 --- a/lib/commercetools-history/src/Models/Change/SetFirstNameChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetFirstNameChangeBuilder.php @@ -21,16 +21,19 @@ final class SetFirstNameChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetFirstNameChangeBuilder implements Builder /** *

    Shape of the action for setFirstName

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetFirstNameChangeModel.php b/lib/commercetools-history/src/Models/Change/SetFirstNameChangeModel.php index ba23ba404fe..c48c106f26b 100644 --- a/lib/commercetools-history/src/Models/Change/SetFirstNameChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetFirstNameChangeModel.php @@ -22,21 +22,25 @@ final class SetFirstNameChangeModel extends JsonObjectModel implements SetFirstN public const DISCRIMINATOR_VALUE = 'SetFirstNameChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetFirstNameChangeModel extends JsonObjectModel implements SetFirstN public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setFirstName

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetGeoLocationChange.php b/lib/commercetools-history/src/Models/Change/SetGeoLocationChange.php index a6c43449bc6..27b043655c4 100644 --- a/lib/commercetools-history/src/Models/Change/SetGeoLocationChange.php +++ b/lib/commercetools-history/src/Models/Change/SetGeoLocationChange.php @@ -21,21 +21,25 @@ interface SetGeoLocationChange extends Change /** *

    Update action for setGeoLocation

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|GeoLocation */ public function getNextValue(); /** + * @return null|GeoLocation */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetGeoLocationChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetGeoLocationChangeBuilder.php index 9da3ca9d645..b8023332c28 100644 --- a/lib/commercetools-history/src/Models/Change/SetGeoLocationChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetGeoLocationChangeBuilder.php @@ -23,16 +23,19 @@ final class SetGeoLocationChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|GeoLocation|GeoLocationBuilder */ private $nextValue; /** + * @var null|GeoLocation|GeoLocationBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class SetGeoLocationChangeBuilder implements Builder /** *

    Update action for setGeoLocation

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|GeoLocation */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|GeoLocation */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetGeoLocationChangeModel.php b/lib/commercetools-history/src/Models/Change/SetGeoLocationChangeModel.php index fc18b6d044c..a8eed619bd9 100644 --- a/lib/commercetools-history/src/Models/Change/SetGeoLocationChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetGeoLocationChangeModel.php @@ -24,21 +24,25 @@ final class SetGeoLocationChangeModel extends JsonObjectModel implements SetGeoL public const DISCRIMINATOR_VALUE = 'SetGeoLocationChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?GeoLocation */ protected $nextValue; /** + * * @var ?GeoLocation */ protected $previousValue; @@ -50,15 +54,17 @@ final class SetGeoLocationChangeModel extends JsonObjectModel implements SetGeoL public function __construct( ?string $change = null, ?GeoLocation $nextValue = null, - ?GeoLocation $previousValue = null + ?GeoLocation $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for setGeoLocation

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|GeoLocation */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|GeoLocation */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetImageLabelChange.php b/lib/commercetools-history/src/Models/Change/SetImageLabelChange.php index a1cef393467..83f5e0ee2c9 100644 --- a/lib/commercetools-history/src/Models/Change/SetImageLabelChange.php +++ b/lib/commercetools-history/src/Models/Change/SetImageLabelChange.php @@ -20,6 +20,7 @@ interface SetImageLabelChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update action for setImageLabel

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|Image */ public function getPreviousValue(); /** + * @return null|Image */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetImageLabelChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetImageLabelChangeBuilder.php index 5fcf8424838..b9d5449ab10 100644 --- a/lib/commercetools-history/src/Models/Change/SetImageLabelChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetImageLabelChangeBuilder.php @@ -23,21 +23,25 @@ final class SetImageLabelChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var null|Image|ImageBuilder */ private $previousValue; /** + * @var null|Image|ImageBuilder */ private $nextValue; @@ -45,6 +49,7 @@ final class SetImageLabelChangeBuilder implements Builder /** *

    Update action for setImageLabel

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -61,6 +67,7 @@ public function getCatalogData() } /** + * @return null|Image */ public function getPreviousValue() @@ -69,6 +76,7 @@ public function getPreviousValue() } /** + * @return null|Image */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetImageLabelChangeModel.php b/lib/commercetools-history/src/Models/Change/SetImageLabelChangeModel.php index 8c24206866a..be903c0f257 100644 --- a/lib/commercetools-history/src/Models/Change/SetImageLabelChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetImageLabelChangeModel.php @@ -24,26 +24,31 @@ final class SetImageLabelChangeModel extends JsonObjectModel implements SetImage public const DISCRIMINATOR_VALUE = 'SetImageLabelChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?Image */ protected $previousValue; /** + * * @var ?Image */ protected $nextValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $catalogData = null, ?Image $previousValue = null, - ?Image $nextValue = null + ?Image $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for setImageLabel

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -119,6 +128,7 @@ public function getCatalogData() } /** + * * @return null|Image */ public function getPreviousValue() @@ -137,6 +147,7 @@ public function getPreviousValue() } /** + * * @return null|Image */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetInputTipChange.php b/lib/commercetools-history/src/Models/Change/SetInputTipChange.php index c05a3ccf6bc..991330dcbf7 100644 --- a/lib/commercetools-history/src/Models/Change/SetInputTipChange.php +++ b/lib/commercetools-history/src/Models/Change/SetInputTipChange.php @@ -20,6 +20,7 @@ interface SetInputTipChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -27,6 +28,7 @@ public function getType(); /** *

    Update action for setInputTip on product types

    * + * @return null|string */ public function getChange(); @@ -34,16 +36,19 @@ public function getChange(); /** *

    The name of the updated attribute.

    * + * @return null|string */ public function getAttributeName(); /** + * @return null|LocalizedString */ public function getNextValue(); /** + * @return null|LocalizedString */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetInputTipChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetInputTipChangeBuilder.php index 4dde4e0f7e9..4dcf67c3b9e 100644 --- a/lib/commercetools-history/src/Models/Change/SetInputTipChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetInputTipChangeBuilder.php @@ -23,21 +23,25 @@ final class SetInputTipChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $attributeName; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; @@ -45,6 +49,7 @@ final class SetInputTipChangeBuilder implements Builder /** *

    Update action for setInputTip on product types

    * + * @return null|string */ public function getChange() @@ -55,6 +60,7 @@ public function getChange() /** *

    The name of the updated attribute.

    * + * @return null|string */ public function getAttributeName() @@ -63,6 +69,7 @@ public function getAttributeName() } /** + * @return null|LocalizedString */ public function getNextValue() @@ -71,6 +78,7 @@ public function getNextValue() } /** + * @return null|LocalizedString */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetInputTipChangeModel.php b/lib/commercetools-history/src/Models/Change/SetInputTipChangeModel.php index e0b1f3e3696..e65d4b774e7 100644 --- a/lib/commercetools-history/src/Models/Change/SetInputTipChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetInputTipChangeModel.php @@ -24,26 +24,31 @@ final class SetInputTipChangeModel extends JsonObjectModel implements SetInputTi public const DISCRIMINATOR_VALUE = 'SetInputTipChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $attributeName; /** + * * @var ?LocalizedString */ protected $nextValue; /** + * * @var ?LocalizedString */ protected $previousValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $attributeName = null, ?LocalizedString $nextValue = null, - ?LocalizedString $previousValue = null + ?LocalizedString $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->attributeName = $attributeName; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for setInputTip on product types

    * + * * @return null|string */ public function getChange() @@ -104,6 +112,7 @@ public function getChange() /** *

    The name of the updated attribute.

    * + * * @return null|string */ public function getAttributeName() @@ -121,6 +130,7 @@ public function getAttributeName() } /** + * * @return null|LocalizedString */ public function getNextValue() @@ -139,6 +149,7 @@ public function getNextValue() } /** + * * @return null|LocalizedString */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetInterfaceIdChange.php b/lib/commercetools-history/src/Models/Change/SetInterfaceIdChange.php index 845df28ee46..cfc309b7bb5 100644 --- a/lib/commercetools-history/src/Models/Change/SetInterfaceIdChange.php +++ b/lib/commercetools-history/src/Models/Change/SetInterfaceIdChange.php @@ -18,6 +18,7 @@ interface SetInterfaceIdChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setInterfaceId

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetInterfaceIdChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetInterfaceIdChangeBuilder.php index 3f3bae275a0..8df2590c26a 100644 --- a/lib/commercetools-history/src/Models/Change/SetInterfaceIdChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetInterfaceIdChangeBuilder.php @@ -21,16 +21,19 @@ final class SetInterfaceIdChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetInterfaceIdChangeBuilder implements Builder /** *

    Shape of the action for setInterfaceId

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetInterfaceIdChangeModel.php b/lib/commercetools-history/src/Models/Change/SetInterfaceIdChangeModel.php index 7efcc142d4d..c8f9ea23d12 100644 --- a/lib/commercetools-history/src/Models/Change/SetInterfaceIdChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetInterfaceIdChangeModel.php @@ -22,21 +22,25 @@ final class SetInterfaceIdChangeModel extends JsonObjectModel implements SetInte public const DISCRIMINATOR_VALUE = 'SetInterfaceIdChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetInterfaceIdChangeModel extends JsonObjectModel implements SetInte public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setInterfaceId

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetIsValidChange.php b/lib/commercetools-history/src/Models/Change/SetIsValidChange.php index 1ae2ffa6484..072e35bd005 100644 --- a/lib/commercetools-history/src/Models/Change/SetIsValidChange.php +++ b/lib/commercetools-history/src/Models/Change/SetIsValidChange.php @@ -18,6 +18,7 @@ interface SetIsValidChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setIsValid

    * + * @return null|string */ public function getChange(); /** + * @return null|bool */ public function getPreviousValue(); /** + * @return null|bool */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetIsValidChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetIsValidChangeBuilder.php index 5c0538790da..f18d5d4faff 100644 --- a/lib/commercetools-history/src/Models/Change/SetIsValidChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetIsValidChangeBuilder.php @@ -21,16 +21,19 @@ final class SetIsValidChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?bool */ private $previousValue; /** + * @var ?bool */ private $nextValue; @@ -38,6 +41,7 @@ final class SetIsValidChangeBuilder implements Builder /** *

    Shape of the action for setIsValid

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|bool */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|bool */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetIsValidChangeModel.php b/lib/commercetools-history/src/Models/Change/SetIsValidChangeModel.php index a9f1c3e1dc8..e7403003f3f 100644 --- a/lib/commercetools-history/src/Models/Change/SetIsValidChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetIsValidChangeModel.php @@ -22,21 +22,25 @@ final class SetIsValidChangeModel extends JsonObjectModel implements SetIsValidC public const DISCRIMINATOR_VALUE = 'SetIsValidChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?bool */ protected $previousValue; /** + * * @var ?bool */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetIsValidChangeModel extends JsonObjectModel implements SetIsValidC public function __construct( ?string $change = null, ?bool $previousValue = null, - ?bool $nextValue = null + ?bool $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setIsValid

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|bool */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|bool */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetKeyChange.php b/lib/commercetools-history/src/Models/Change/SetKeyChange.php index 6a87baed11c..c88b8d99faf 100644 --- a/lib/commercetools-history/src/Models/Change/SetKeyChange.php +++ b/lib/commercetools-history/src/Models/Change/SetKeyChange.php @@ -18,6 +18,7 @@ interface SetKeyChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setKey

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetKeyChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetKeyChangeBuilder.php index 19e51c9de21..828b0f93a71 100644 --- a/lib/commercetools-history/src/Models/Change/SetKeyChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetKeyChangeBuilder.php @@ -21,16 +21,19 @@ final class SetKeyChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetKeyChangeBuilder implements Builder /** *

    Shape of the action for setKey

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetKeyChangeModel.php b/lib/commercetools-history/src/Models/Change/SetKeyChangeModel.php index 02e7a8a99cd..fa226aeb071 100644 --- a/lib/commercetools-history/src/Models/Change/SetKeyChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetKeyChangeModel.php @@ -22,21 +22,25 @@ final class SetKeyChangeModel extends JsonObjectModel implements SetKeyChange public const DISCRIMINATOR_VALUE = 'SetKeyChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetKeyChangeModel extends JsonObjectModel implements SetKeyChange public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setKey

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLanguagesChange.php b/lib/commercetools-history/src/Models/Change/SetLanguagesChange.php index a50c247f2b5..498fbf9a398 100644 --- a/lib/commercetools-history/src/Models/Change/SetLanguagesChange.php +++ b/lib/commercetools-history/src/Models/Change/SetLanguagesChange.php @@ -18,6 +18,7 @@ interface SetLanguagesChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Update action for setLanguages on stores

    * + * @return null|string */ public function getChange(); /** + * @return null|array */ public function getPreviousValue(); /** + * @return null|array */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetLanguagesChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetLanguagesChangeBuilder.php index 0234a1080af..151529fede1 100644 --- a/lib/commercetools-history/src/Models/Change/SetLanguagesChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetLanguagesChangeBuilder.php @@ -21,16 +21,19 @@ final class SetLanguagesChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?array */ private $previousValue; /** + * @var ?array */ private $nextValue; @@ -38,6 +41,7 @@ final class SetLanguagesChangeBuilder implements Builder /** *

    Update action for setLanguages on stores

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|array */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLanguagesChangeModel.php b/lib/commercetools-history/src/Models/Change/SetLanguagesChangeModel.php index 768a5ed3b38..a276839a95e 100644 --- a/lib/commercetools-history/src/Models/Change/SetLanguagesChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetLanguagesChangeModel.php @@ -22,21 +22,25 @@ final class SetLanguagesChangeModel extends JsonObjectModel implements SetLangua public const DISCRIMINATOR_VALUE = 'SetLanguagesChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?array */ protected $previousValue; /** + * * @var ?array */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetLanguagesChangeModel extends JsonObjectModel implements SetLangua public function __construct( ?string $change = null, ?array $previousValue = null, - ?array $nextValue = null + ?array $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Update action for setLanguages on stores

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|array */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLastNameChange.php b/lib/commercetools-history/src/Models/Change/SetLastNameChange.php index 3e9d3dd894b..d8bf571e39d 100644 --- a/lib/commercetools-history/src/Models/Change/SetLastNameChange.php +++ b/lib/commercetools-history/src/Models/Change/SetLastNameChange.php @@ -18,6 +18,7 @@ interface SetLastNameChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setLastName

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetLastNameChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetLastNameChangeBuilder.php index 554c7a93bf3..0a6e062ddfd 100644 --- a/lib/commercetools-history/src/Models/Change/SetLastNameChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetLastNameChangeBuilder.php @@ -21,16 +21,19 @@ final class SetLastNameChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetLastNameChangeBuilder implements Builder /** *

    Shape of the action for setLastName

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLastNameChangeModel.php b/lib/commercetools-history/src/Models/Change/SetLastNameChangeModel.php index f50ccf995cd..374f6dbb40a 100644 --- a/lib/commercetools-history/src/Models/Change/SetLastNameChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetLastNameChangeModel.php @@ -22,21 +22,25 @@ final class SetLastNameChangeModel extends JsonObjectModel implements SetLastNam public const DISCRIMINATOR_VALUE = 'SetLastNameChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetLastNameChangeModel extends JsonObjectModel implements SetLastNam public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setLastName

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemDeactivatedAtChange.php b/lib/commercetools-history/src/Models/Change/SetLineItemDeactivatedAtChange.php new file mode 100644 index 00000000000..31a524a11fc --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetLineItemDeactivatedAtChange.php @@ -0,0 +1,73 @@ +Update action for setLineItemDeactivatedAt

    + * + + * @return null|string + */ + public function getChange(); + + /** + + * @return null|ShoppingListLineItemValue + */ + public function getLineItem(); + + /** + + * @return null|string + */ + public function getPreviousValue(); + + /** + + * @return null|string + */ + public function getNextValue(); + + /** + * @param ?string $change + */ + public function setChange(?string $change): void; + + /** + * @param ?ShoppingListLineItemValue $lineItem + */ + public function setLineItem(?ShoppingListLineItemValue $lineItem): void; + + /** + * @param ?string $previousValue + */ + public function setPreviousValue(?string $previousValue): void; + + /** + * @param ?string $nextValue + */ + public function setNextValue(?string $nextValue): void; +} diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemDeactivatedAtChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetLineItemDeactivatedAtChangeBuilder.php new file mode 100644 index 00000000000..e0625b2358e --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetLineItemDeactivatedAtChangeBuilder.php @@ -0,0 +1,156 @@ + + */ +final class SetLineItemDeactivatedAtChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var null|ShoppingListLineItemValue|ShoppingListLineItemValueBuilder + */ + private $lineItem; + + /** + + * @var ?string + */ + private $previousValue; + + /** + + * @var ?string + */ + private $nextValue; + + /** + *

    Update action for setLineItemDeactivatedAt

    + * + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + + * @return null|ShoppingListLineItemValue + */ + public function getLineItem() + { + return $this->lineItem instanceof ShoppingListLineItemValueBuilder ? $this->lineItem->build() : $this->lineItem; + } + + /** + + * @return null|string + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + + * @return null|string + */ + public function getNextValue() + { + return $this->nextValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?ShoppingListLineItemValue $lineItem + * @return $this + */ + public function withLineItem(?ShoppingListLineItemValue $lineItem) + { + $this->lineItem = $lineItem; + + return $this; + } + + /** + * @param ?string $previousValue + * @return $this + */ + public function withPreviousValue(?string $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @param ?string $nextValue + * @return $this + */ + public function withNextValue(?string $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + /** + * @deprecated use withLineItem() instead + * @return $this + */ + public function withLineItemBuilder(?ShoppingListLineItemValueBuilder $lineItem) + { + $this->lineItem = $lineItem; + + return $this; + } + + public function build(): SetLineItemDeactivatedAtChange + { + return new SetLineItemDeactivatedAtChangeModel( + $this->change, + $this->lineItem instanceof ShoppingListLineItemValueBuilder ? $this->lineItem->build() : $this->lineItem, + $this->previousValue, + $this->nextValue + ); + } + + public static function of(): SetLineItemDeactivatedAtChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemDeactivatedAtChangeCollection.php b/lib/commercetools-history/src/Models/Change/SetLineItemDeactivatedAtChangeCollection.php new file mode 100644 index 00000000000..914f7ecfdb7 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetLineItemDeactivatedAtChangeCollection.php @@ -0,0 +1,56 @@ + + * @method SetLineItemDeactivatedAtChange current() + * @method SetLineItemDeactivatedAtChange end() + * @method SetLineItemDeactivatedAtChange at($offset) + */ +class SetLineItemDeactivatedAtChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert SetLineItemDeactivatedAtChange $value + * @psalm-param SetLineItemDeactivatedAtChange|stdClass $value + * @throws InvalidArgumentException + * + * @return SetLineItemDeactivatedAtChangeCollection + */ + public function add($value) + { + if (!$value instanceof SetLineItemDeactivatedAtChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?SetLineItemDeactivatedAtChange + */ + protected function mapper() + { + return function (?int $index): ?SetLineItemDeactivatedAtChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var SetLineItemDeactivatedAtChange $data */ + $data = SetLineItemDeactivatedAtChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemDeactivatedAtChangeModel.php b/lib/commercetools-history/src/Models/Change/SetLineItemDeactivatedAtChangeModel.php new file mode 100644 index 00000000000..546d24a11cc --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetLineItemDeactivatedAtChangeModel.php @@ -0,0 +1,202 @@ +change = $change; + $this->lineItem = $lineItem; + $this->previousValue = $previousValue; + $this->nextValue = $nextValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Update action for setLineItemDeactivatedAt

    + * + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + * + * @return null|ShoppingListLineItemValue + */ + public function getLineItem() + { + if (is_null($this->lineItem)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LINE_ITEM); + if (is_null($data)) { + return null; + } + + $this->lineItem = ShoppingListLineItemValueModel::of($data); + } + + return $this->lineItem; + } + + /** + * + * @return null|string + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = (string) $data; + } + + return $this->previousValue; + } + + /** + * + * @return null|string + */ + public function getNextValue() + { + if (is_null($this->nextValue)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NEXT_VALUE); + if (is_null($data)) { + return null; + } + $this->nextValue = (string) $data; + } + + return $this->nextValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?ShoppingListLineItemValue $lineItem + */ + public function setLineItem(?ShoppingListLineItemValue $lineItem): void + { + $this->lineItem = $lineItem; + } + + /** + * @param ?string $previousValue + */ + public function setPreviousValue(?string $previousValue): void + { + $this->previousValue = $previousValue; + } + + /** + * @param ?string $nextValue + */ + public function setNextValue(?string $nextValue): void + { + $this->nextValue = $nextValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPriceChange.php b/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPriceChange.php index 17ed3b1a917..da543506cb0 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPriceChange.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPriceChange.php @@ -22,6 +22,7 @@ interface SetLineItemDiscountedPriceChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -29,26 +30,31 @@ public function getType(); /** *

    Update action for setLineItemDiscountedPrice

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getLineItem(); /** + * @return null|string */ public function getVariant(); /** + * @return null|DiscountedLineItemPrice */ public function getNextValue(); /** + * @return null|DiscountedLineItemPrice */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPriceChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPriceChangeBuilder.php index 47027bd9cd0..602b26b5fac 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPriceChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPriceChangeBuilder.php @@ -25,26 +25,31 @@ final class SetLineItemDiscountedPriceChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $lineItem; /** + * @var ?string */ private $variant; /** + * @var null|DiscountedLineItemPrice|DiscountedLineItemPriceBuilder */ private $nextValue; /** + * @var null|DiscountedLineItemPrice|DiscountedLineItemPriceBuilder */ private $previousValue; @@ -52,6 +57,7 @@ final class SetLineItemDiscountedPriceChangeBuilder implements Builder /** *

    Update action for setLineItemDiscountedPrice

    * + * @return null|string */ public function getChange() @@ -60,6 +66,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getLineItem() @@ -68,6 +75,7 @@ public function getLineItem() } /** + * @return null|string */ public function getVariant() @@ -76,6 +84,7 @@ public function getVariant() } /** + * @return null|DiscountedLineItemPrice */ public function getNextValue() @@ -84,6 +93,7 @@ public function getNextValue() } /** + * @return null|DiscountedLineItemPrice */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPriceChangeModel.php b/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPriceChangeModel.php index 73f4eb8e5f2..8e8576d42d0 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPriceChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPriceChangeModel.php @@ -26,31 +26,37 @@ final class SetLineItemDiscountedPriceChangeModel extends JsonObjectModel implem public const DISCRIMINATOR_VALUE = 'SetLineItemDiscountedPriceChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $lineItem; /** + * * @var ?string */ protected $variant; /** + * * @var ?DiscountedLineItemPrice */ protected $nextValue; /** + * * @var ?DiscountedLineItemPrice */ protected $previousValue; @@ -64,17 +70,19 @@ public function __construct( ?LocalizedString $lineItem = null, ?string $variant = null, ?DiscountedLineItemPrice $nextValue = null, - ?DiscountedLineItemPrice $previousValue = null + ?DiscountedLineItemPrice $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->lineItem = $lineItem; $this->variant = $variant; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -94,6 +102,7 @@ public function getType() /** *

    Update action for setLineItemDiscountedPrice

    * + * * @return null|string */ public function getChange() @@ -111,6 +120,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getLineItem() @@ -129,6 +139,7 @@ public function getLineItem() } /** + * * @return null|string */ public function getVariant() @@ -146,6 +157,7 @@ public function getVariant() } /** + * * @return null|DiscountedLineItemPrice */ public function getNextValue() @@ -164,6 +176,7 @@ public function getNextValue() } /** + * * @return null|DiscountedLineItemPrice */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPricePerQuantityChange.php b/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPricePerQuantityChange.php index de2c5c8caae..0f4d116922a 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPricePerQuantityChange.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPricePerQuantityChange.php @@ -22,6 +22,7 @@ interface SetLineItemDiscountedPricePerQuantityChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -29,26 +30,31 @@ public function getType(); /** *

    Update action for setLineItemDiscountedPricePerQuantity

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getLineItem(); /** + * @return null|string */ public function getVariant(); /** + * @return null|DiscountedLineItemPriceForQuantity */ public function getNextValue(); /** + * @return null|DiscountedLineItemPriceForQuantity */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPricePerQuantityChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPricePerQuantityChangeBuilder.php index 1438373106b..989fd28ca64 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPricePerQuantityChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPricePerQuantityChangeBuilder.php @@ -25,26 +25,31 @@ final class SetLineItemDiscountedPricePerQuantityChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $lineItem; /** + * @var ?string */ private $variant; /** + * @var null|DiscountedLineItemPriceForQuantity|DiscountedLineItemPriceForQuantityBuilder */ private $nextValue; /** + * @var null|DiscountedLineItemPriceForQuantity|DiscountedLineItemPriceForQuantityBuilder */ private $previousValue; @@ -52,6 +57,7 @@ final class SetLineItemDiscountedPricePerQuantityChangeBuilder implements Builde /** *

    Update action for setLineItemDiscountedPricePerQuantity

    * + * @return null|string */ public function getChange() @@ -60,6 +66,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getLineItem() @@ -68,6 +75,7 @@ public function getLineItem() } /** + * @return null|string */ public function getVariant() @@ -76,6 +84,7 @@ public function getVariant() } /** + * @return null|DiscountedLineItemPriceForQuantity */ public function getNextValue() @@ -84,6 +93,7 @@ public function getNextValue() } /** + * @return null|DiscountedLineItemPriceForQuantity */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPricePerQuantityChangeModel.php b/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPricePerQuantityChangeModel.php index 118561c0b7e..b5a42ab54f8 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPricePerQuantityChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemDiscountedPricePerQuantityChangeModel.php @@ -26,31 +26,37 @@ final class SetLineItemDiscountedPricePerQuantityChangeModel extends JsonObjectM public const DISCRIMINATOR_VALUE = 'SetLineItemDiscountedPricePerQuantityChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $lineItem; /** + * * @var ?string */ protected $variant; /** + * * @var ?DiscountedLineItemPriceForQuantity */ protected $nextValue; /** + * * @var ?DiscountedLineItemPriceForQuantity */ protected $previousValue; @@ -64,17 +70,19 @@ public function __construct( ?LocalizedString $lineItem = null, ?string $variant = null, ?DiscountedLineItemPriceForQuantity $nextValue = null, - ?DiscountedLineItemPriceForQuantity $previousValue = null + ?DiscountedLineItemPriceForQuantity $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->lineItem = $lineItem; $this->variant = $variant; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -94,6 +102,7 @@ public function getType() /** *

    Update action for setLineItemDiscountedPricePerQuantity

    * + * * @return null|string */ public function getChange() @@ -111,6 +120,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getLineItem() @@ -129,6 +139,7 @@ public function getLineItem() } /** + * * @return null|string */ public function getVariant() @@ -146,6 +157,7 @@ public function getVariant() } /** + * * @return null|DiscountedLineItemPriceForQuantity */ public function getNextValue() @@ -164,6 +176,7 @@ public function getNextValue() } /** + * * @return null|DiscountedLineItemPriceForQuantity */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemDistributionChannelChange.php b/lib/commercetools-history/src/Models/Change/SetLineItemDistributionChannelChange.php index dcf4c8b69d9..a7e32573126 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemDistributionChannelChange.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemDistributionChannelChange.php @@ -22,6 +22,7 @@ interface SetLineItemDistributionChannelChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -29,26 +30,31 @@ public function getType(); /** *

    Update action for setLineItemDistributionChannel

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getLineItem(); /** + * @return null|string */ public function getVariant(); /** + * @return null|Reference */ public function getNextValue(); /** + * @return null|Reference */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemDistributionChannelChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetLineItemDistributionChannelChangeBuilder.php index 0423d82fe78..f773b9f703d 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemDistributionChannelChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemDistributionChannelChangeBuilder.php @@ -25,26 +25,31 @@ final class SetLineItemDistributionChannelChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $lineItem; /** + * @var ?string */ private $variant; /** + * @var null|Reference|ReferenceBuilder */ private $nextValue; /** + * @var null|Reference|ReferenceBuilder */ private $previousValue; @@ -52,6 +57,7 @@ final class SetLineItemDistributionChannelChangeBuilder implements Builder /** *

    Update action for setLineItemDistributionChannel

    * + * @return null|string */ public function getChange() @@ -60,6 +66,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getLineItem() @@ -68,6 +75,7 @@ public function getLineItem() } /** + * @return null|string */ public function getVariant() @@ -76,6 +84,7 @@ public function getVariant() } /** + * @return null|Reference */ public function getNextValue() @@ -84,6 +93,7 @@ public function getNextValue() } /** + * @return null|Reference */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemDistributionChannelChangeModel.php b/lib/commercetools-history/src/Models/Change/SetLineItemDistributionChannelChangeModel.php index 7023b4a774b..8acf90bc916 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemDistributionChannelChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemDistributionChannelChangeModel.php @@ -26,31 +26,37 @@ final class SetLineItemDistributionChannelChangeModel extends JsonObjectModel im public const DISCRIMINATOR_VALUE = 'SetLineItemDistributionChannelChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $lineItem; /** + * * @var ?string */ protected $variant; /** + * * @var ?Reference */ protected $nextValue; /** + * * @var ?Reference */ protected $previousValue; @@ -64,17 +70,19 @@ public function __construct( ?LocalizedString $lineItem = null, ?string $variant = null, ?Reference $nextValue = null, - ?Reference $previousValue = null + ?Reference $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->lineItem = $lineItem; $this->variant = $variant; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -94,6 +102,7 @@ public function getType() /** *

    Update action for setLineItemDistributionChannel

    * + * * @return null|string */ public function getChange() @@ -111,6 +120,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getLineItem() @@ -129,6 +139,7 @@ public function getLineItem() } /** + * * @return null|string */ public function getVariant() @@ -146,6 +157,7 @@ public function getVariant() } /** + * * @return null|Reference */ public function getNextValue() @@ -164,6 +176,7 @@ public function getNextValue() } /** + * * @return null|Reference */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemPriceChange.php b/lib/commercetools-history/src/Models/Change/SetLineItemPriceChange.php index ebabcd5923e..a003924d00f 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemPriceChange.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemPriceChange.php @@ -21,6 +21,7 @@ interface SetLineItemPriceChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -28,21 +29,25 @@ public function getType(); /** *

    Update action for setLineItemPrice

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getLineItem(); /** + * @return null|Price */ public function getNextValue(); /** + * @return null|Price */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemPriceChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetLineItemPriceChangeBuilder.php index 9f923b08af3..6ecfe855d15 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemPriceChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemPriceChangeBuilder.php @@ -25,21 +25,25 @@ final class SetLineItemPriceChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $lineItem; /** + * @var null|Price|PriceBuilder */ private $nextValue; /** + * @var null|Price|PriceBuilder */ private $previousValue; @@ -47,6 +51,7 @@ final class SetLineItemPriceChangeBuilder implements Builder /** *

    Update action for setLineItemPrice

    * + * @return null|string */ public function getChange() @@ -55,6 +60,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getLineItem() @@ -63,6 +69,7 @@ public function getLineItem() } /** + * @return null|Price */ public function getNextValue() @@ -71,6 +78,7 @@ public function getNextValue() } /** + * @return null|Price */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemPriceChangeModel.php b/lib/commercetools-history/src/Models/Change/SetLineItemPriceChangeModel.php index 828bc47538d..836dc346033 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemPriceChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemPriceChangeModel.php @@ -26,26 +26,31 @@ final class SetLineItemPriceChangeModel extends JsonObjectModel implements SetLi public const DISCRIMINATOR_VALUE = 'SetLineItemPriceChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $lineItem; /** + * * @var ?Price */ protected $nextValue; /** + * * @var ?Price */ protected $previousValue; @@ -58,16 +63,18 @@ public function __construct( ?string $change = null, ?LocalizedString $lineItem = null, ?Price $nextValue = null, - ?Price $previousValue = null + ?Price $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->lineItem = $lineItem; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -87,6 +94,7 @@ public function getType() /** *

    Update action for setLineItemPrice

    * + * * @return null|string */ public function getChange() @@ -104,6 +112,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getLineItem() @@ -122,6 +131,7 @@ public function getLineItem() } /** + * * @return null|Price */ public function getNextValue() @@ -140,6 +150,7 @@ public function getNextValue() } /** + * * @return null|Price */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemProductKeyChange.php b/lib/commercetools-history/src/Models/Change/SetLineItemProductKeyChange.php new file mode 100644 index 00000000000..f027b02c8f5 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetLineItemProductKeyChange.php @@ -0,0 +1,97 @@ +Update action for setLineItemProductKey

    + * + + * @return null|string + */ + public function getChange(); + + /** + + * @return null|LocalizedString + */ + public function getLineItem(); + + /** + + * @return null|string + */ + public function getLineItemId(); + + /** + + * @return null|string + */ + public function getVariant(); + + /** + + * @return null|string + */ + public function getPreviousValue(); + + /** + + * @return null|string + */ + public function getNextValue(); + + /** + * @param ?string $change + */ + public function setChange(?string $change): void; + + /** + * @param ?LocalizedString $lineItem + */ + public function setLineItem(?LocalizedString $lineItem): void; + + /** + * @param ?string $lineItemId + */ + public function setLineItemId(?string $lineItemId): void; + + /** + * @param ?string $variant + */ + public function setVariant(?string $variant): void; + + /** + * @param ?string $previousValue + */ + public function setPreviousValue(?string $previousValue): void; + + /** + * @param ?string $nextValue + */ + public function setNextValue(?string $nextValue): void; +} diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemProductKeyChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetLineItemProductKeyChangeBuilder.php new file mode 100644 index 00000000000..767cf56bc53 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetLineItemProductKeyChangeBuilder.php @@ -0,0 +1,210 @@ + + */ +final class SetLineItemProductKeyChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var null|LocalizedString|LocalizedStringBuilder + */ + private $lineItem; + + /** + + * @var ?string + */ + private $lineItemId; + + /** + + * @var ?string + */ + private $variant; + + /** + + * @var ?string + */ + private $previousValue; + + /** + + * @var ?string + */ + private $nextValue; + + /** + *

    Update action for setLineItemProductKey

    + * + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + + * @return null|LocalizedString + */ + public function getLineItem() + { + return $this->lineItem instanceof LocalizedStringBuilder ? $this->lineItem->build() : $this->lineItem; + } + + /** + + * @return null|string + */ + public function getLineItemId() + { + return $this->lineItemId; + } + + /** + + * @return null|string + */ + public function getVariant() + { + return $this->variant; + } + + /** + + * @return null|string + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + + * @return null|string + */ + public function getNextValue() + { + return $this->nextValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?LocalizedString $lineItem + * @return $this + */ + public function withLineItem(?LocalizedString $lineItem) + { + $this->lineItem = $lineItem; + + return $this; + } + + /** + * @param ?string $lineItemId + * @return $this + */ + public function withLineItemId(?string $lineItemId) + { + $this->lineItemId = $lineItemId; + + return $this; + } + + /** + * @param ?string $variant + * @return $this + */ + public function withVariant(?string $variant) + { + $this->variant = $variant; + + return $this; + } + + /** + * @param ?string $previousValue + * @return $this + */ + public function withPreviousValue(?string $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @param ?string $nextValue + * @return $this + */ + public function withNextValue(?string $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + /** + * @deprecated use withLineItem() instead + * @return $this + */ + public function withLineItemBuilder(?LocalizedStringBuilder $lineItem) + { + $this->lineItem = $lineItem; + + return $this; + } + + public function build(): SetLineItemProductKeyChange + { + return new SetLineItemProductKeyChangeModel( + $this->change, + $this->lineItem instanceof LocalizedStringBuilder ? $this->lineItem->build() : $this->lineItem, + $this->lineItemId, + $this->variant, + $this->previousValue, + $this->nextValue + ); + } + + public static function of(): SetLineItemProductKeyChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemProductKeyChangeCollection.php b/lib/commercetools-history/src/Models/Change/SetLineItemProductKeyChangeCollection.php new file mode 100644 index 00000000000..55d2e63e4ea --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetLineItemProductKeyChangeCollection.php @@ -0,0 +1,56 @@ + + * @method SetLineItemProductKeyChange current() + * @method SetLineItemProductKeyChange end() + * @method SetLineItemProductKeyChange at($offset) + */ +class SetLineItemProductKeyChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert SetLineItemProductKeyChange $value + * @psalm-param SetLineItemProductKeyChange|stdClass $value + * @throws InvalidArgumentException + * + * @return SetLineItemProductKeyChangeCollection + */ + public function add($value) + { + if (!$value instanceof SetLineItemProductKeyChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?SetLineItemProductKeyChange + */ + protected function mapper() + { + return function (?int $index): ?SetLineItemProductKeyChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var SetLineItemProductKeyChange $data */ + $data = SetLineItemProductKeyChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemProductKeyChangeModel.php b/lib/commercetools-history/src/Models/Change/SetLineItemProductKeyChangeModel.php new file mode 100644 index 00000000000..99651910968 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetLineItemProductKeyChangeModel.php @@ -0,0 +1,270 @@ +change = $change; + $this->lineItem = $lineItem; + $this->lineItemId = $lineItemId; + $this->variant = $variant; + $this->previousValue = $previousValue; + $this->nextValue = $nextValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Update action for setLineItemProductKey

    + * + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + * + * @return null|LocalizedString + */ + public function getLineItem() + { + if (is_null($this->lineItem)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LINE_ITEM); + if (is_null($data)) { + return null; + } + + $this->lineItem = LocalizedStringModel::of($data); + } + + return $this->lineItem; + } + + /** + * + * @return null|string + */ + public function getLineItemId() + { + if (is_null($this->lineItemId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_ID); + if (is_null($data)) { + return null; + } + $this->lineItemId = (string) $data; + } + + return $this->lineItemId; + } + + /** + * + * @return null|string + */ + public function getVariant() + { + if (is_null($this->variant)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_VARIANT); + if (is_null($data)) { + return null; + } + $this->variant = (string) $data; + } + + return $this->variant; + } + + /** + * + * @return null|string + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = (string) $data; + } + + return $this->previousValue; + } + + /** + * + * @return null|string + */ + public function getNextValue() + { + if (is_null($this->nextValue)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NEXT_VALUE); + if (is_null($data)) { + return null; + } + $this->nextValue = (string) $data; + } + + return $this->nextValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?LocalizedString $lineItem + */ + public function setLineItem(?LocalizedString $lineItem): void + { + $this->lineItem = $lineItem; + } + + /** + * @param ?string $lineItemId + */ + public function setLineItemId(?string $lineItemId): void + { + $this->lineItemId = $lineItemId; + } + + /** + * @param ?string $variant + */ + public function setVariant(?string $variant): void + { + $this->variant = $variant; + } + + /** + * @param ?string $previousValue + */ + public function setPreviousValue(?string $previousValue): void + { + $this->previousValue = $previousValue; + } + + /** + * @param ?string $nextValue + */ + public function setNextValue(?string $nextValue): void + { + $this->nextValue = $nextValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemProductSlugChange.php b/lib/commercetools-history/src/Models/Change/SetLineItemProductSlugChange.php index 273acc57f10..47bd31296cb 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemProductSlugChange.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemProductSlugChange.php @@ -21,6 +21,7 @@ interface SetLineItemProductSlugChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -28,26 +29,31 @@ public function getType(); /** *

    Update action for setLineItemProductSlug

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getLineItem(); /** + * @return null|string */ public function getVariant(); /** + * @return null|LocalizedString */ public function getNextValue(); /** + * @return null|LocalizedString */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemProductSlugChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetLineItemProductSlugChangeBuilder.php index 9bf5cd849f9..0961c398d46 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemProductSlugChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemProductSlugChangeBuilder.php @@ -23,26 +23,31 @@ final class SetLineItemProductSlugChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $lineItem; /** + * @var ?string */ private $variant; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; @@ -50,6 +55,7 @@ final class SetLineItemProductSlugChangeBuilder implements Builder /** *

    Update action for setLineItemProductSlug

    * + * @return null|string */ public function getChange() @@ -58,6 +64,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getLineItem() @@ -66,6 +73,7 @@ public function getLineItem() } /** + * @return null|string */ public function getVariant() @@ -74,6 +82,7 @@ public function getVariant() } /** + * @return null|LocalizedString */ public function getNextValue() @@ -82,6 +91,7 @@ public function getNextValue() } /** + * @return null|LocalizedString */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemProductSlugChangeModel.php b/lib/commercetools-history/src/Models/Change/SetLineItemProductSlugChangeModel.php index f45ce0dd14c..6898871492d 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemProductSlugChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemProductSlugChangeModel.php @@ -24,31 +24,37 @@ final class SetLineItemProductSlugChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'SetLineItemProductSlugChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $lineItem; /** + * * @var ?string */ protected $variant; /** + * * @var ?LocalizedString */ protected $nextValue; /** + * * @var ?LocalizedString */ protected $previousValue; @@ -62,17 +68,19 @@ public function __construct( ?LocalizedString $lineItem = null, ?string $variant = null, ?LocalizedString $nextValue = null, - ?LocalizedString $previousValue = null + ?LocalizedString $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->lineItem = $lineItem; $this->variant = $variant; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -92,6 +100,7 @@ public function getType() /** *

    Update action for setLineItemProductSlug

    * + * * @return null|string */ public function getChange() @@ -109,6 +118,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getLineItem() @@ -127,6 +137,7 @@ public function getLineItem() } /** + * * @return null|string */ public function getVariant() @@ -144,6 +155,7 @@ public function getVariant() } /** + * * @return null|LocalizedString */ public function getNextValue() @@ -162,6 +174,7 @@ public function getNextValue() } /** + * * @return null|LocalizedString */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemShippingDetailsChange.php b/lib/commercetools-history/src/Models/Change/SetLineItemShippingDetailsChange.php index 1bc0b96e944..1c165636455 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemShippingDetailsChange.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemShippingDetailsChange.php @@ -20,6 +20,7 @@ interface SetLineItemShippingDetailsChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update action for setLineItemShippingDetails

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getLineItemId(); /** + * @return null|ItemShippingDetails */ public function getNextValue(); /** + * @return null|ItemShippingDetails */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemShippingDetailsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetLineItemShippingDetailsChangeBuilder.php index b219c7c71a1..e54dedf1032 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemShippingDetailsChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemShippingDetailsChangeBuilder.php @@ -23,21 +23,25 @@ final class SetLineItemShippingDetailsChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $lineItemId; /** + * @var null|ItemShippingDetails|ItemShippingDetailsBuilder */ private $nextValue; /** + * @var null|ItemShippingDetails|ItemShippingDetailsBuilder */ private $previousValue; @@ -45,6 +49,7 @@ final class SetLineItemShippingDetailsChangeBuilder implements Builder /** *

    Update action for setLineItemShippingDetails

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|string */ public function getLineItemId() @@ -61,6 +67,7 @@ public function getLineItemId() } /** + * @return null|ItemShippingDetails */ public function getNextValue() @@ -69,6 +76,7 @@ public function getNextValue() } /** + * @return null|ItemShippingDetails */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemShippingDetailsChangeModel.php b/lib/commercetools-history/src/Models/Change/SetLineItemShippingDetailsChangeModel.php index 6b9b75d459a..90ae5f4a803 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemShippingDetailsChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemShippingDetailsChangeModel.php @@ -24,26 +24,31 @@ final class SetLineItemShippingDetailsChangeModel extends JsonObjectModel implem public const DISCRIMINATOR_VALUE = 'SetLineItemShippingDetailsChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?ItemShippingDetails */ protected $nextValue; /** + * * @var ?ItemShippingDetails */ protected $previousValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $lineItemId = null, ?ItemShippingDetails $nextValue = null, - ?ItemShippingDetails $previousValue = null + ?ItemShippingDetails $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->lineItemId = $lineItemId; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for setLineItemShippingDetails

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|string */ public function getLineItemId() @@ -119,6 +128,7 @@ public function getLineItemId() } /** + * * @return null|ItemShippingDetails */ public function getNextValue() @@ -137,6 +147,7 @@ public function getNextValue() } /** + * * @return null|ItemShippingDetails */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemTaxAmountChange.php b/lib/commercetools-history/src/Models/Change/SetLineItemTaxAmountChange.php index acb04ca5221..3093a399297 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemTaxAmountChange.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemTaxAmountChange.php @@ -23,6 +23,7 @@ interface SetLineItemTaxAmountChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -30,21 +31,25 @@ public function getType(); /** *

    Update action for setLineItemTaxAmount

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getLineItem(); /** + * @return null|string */ public function getVariant(); /** + * @return null|string */ public function getTaxMode(); @@ -52,6 +57,7 @@ public function getTaxMode(); /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getNextValue(); @@ -59,6 +65,7 @@ public function getNextValue(); /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemTaxAmountChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetLineItemTaxAmountChangeBuilder.php index 190e62c8139..6aac98edc6d 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemTaxAmountChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemTaxAmountChangeBuilder.php @@ -25,31 +25,37 @@ final class SetLineItemTaxAmountChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $lineItem; /** + * @var ?string */ private $variant; /** + * @var ?string */ private $taxMode; /** + * @var null|TaxRate|TaxRateBuilder */ private $nextValue; /** + * @var null|TaxRate|TaxRateBuilder */ private $previousValue; @@ -57,6 +63,7 @@ final class SetLineItemTaxAmountChangeBuilder implements Builder /** *

    Update action for setLineItemTaxAmount

    * + * @return null|string */ public function getChange() @@ -65,6 +72,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getLineItem() @@ -73,6 +81,7 @@ public function getLineItem() } /** + * @return null|string */ public function getVariant() @@ -81,6 +90,7 @@ public function getVariant() } /** + * @return null|string */ public function getTaxMode() @@ -91,6 +101,7 @@ public function getTaxMode() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getNextValue() @@ -101,6 +112,7 @@ public function getNextValue() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemTaxAmountChangeModel.php b/lib/commercetools-history/src/Models/Change/SetLineItemTaxAmountChangeModel.php index d3b0255f4bb..857393463db 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemTaxAmountChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemTaxAmountChangeModel.php @@ -26,36 +26,43 @@ final class SetLineItemTaxAmountChangeModel extends JsonObjectModel implements S public const DISCRIMINATOR_VALUE = 'SetLineItemTaxAmountChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $lineItem; /** + * * @var ?string */ protected $variant; /** + * * @var ?string */ protected $taxMode; /** + * * @var ?TaxRate */ protected $nextValue; /** + * * @var ?TaxRate */ protected $previousValue; @@ -70,7 +77,8 @@ public function __construct( ?string $variant = null, ?string $taxMode = null, ?TaxRate $nextValue = null, - ?TaxRate $previousValue = null + ?TaxRate $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->lineItem = $lineItem; @@ -78,10 +86,11 @@ public function __construct( $this->taxMode = $taxMode; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -101,6 +110,7 @@ public function getType() /** *

    Update action for setLineItemTaxAmount

    * + * * @return null|string */ public function getChange() @@ -118,6 +128,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getLineItem() @@ -136,6 +147,7 @@ public function getLineItem() } /** + * * @return null|string */ public function getVariant() @@ -153,6 +165,7 @@ public function getVariant() } /** + * * @return null|string */ public function getTaxMode() @@ -172,6 +185,7 @@ public function getTaxMode() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * * @return null|TaxRate */ public function getNextValue() @@ -192,6 +206,7 @@ public function getNextValue() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * * @return null|TaxRate */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemTaxRateChange.php b/lib/commercetools-history/src/Models/Change/SetLineItemTaxRateChange.php index c21bd48b9f3..ca955b03323 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemTaxRateChange.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemTaxRateChange.php @@ -23,6 +23,7 @@ interface SetLineItemTaxRateChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -30,21 +31,25 @@ public function getType(); /** *

    Update action for setLineItemTaxRate

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getLineItem(); /** + * @return null|string */ public function getVariant(); /** + * @return null|string */ public function getTaxMode(); @@ -52,6 +57,7 @@ public function getTaxMode(); /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getNextValue(); @@ -59,6 +65,7 @@ public function getNextValue(); /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemTaxRateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetLineItemTaxRateChangeBuilder.php index f355b1d8a7c..5758a2c7aa2 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemTaxRateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemTaxRateChangeBuilder.php @@ -25,31 +25,37 @@ final class SetLineItemTaxRateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $lineItem; /** + * @var ?string */ private $variant; /** + * @var ?string */ private $taxMode; /** + * @var null|TaxRate|TaxRateBuilder */ private $nextValue; /** + * @var null|TaxRate|TaxRateBuilder */ private $previousValue; @@ -57,6 +63,7 @@ final class SetLineItemTaxRateChangeBuilder implements Builder /** *

    Update action for setLineItemTaxRate

    * + * @return null|string */ public function getChange() @@ -65,6 +72,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getLineItem() @@ -73,6 +81,7 @@ public function getLineItem() } /** + * @return null|string */ public function getVariant() @@ -81,6 +90,7 @@ public function getVariant() } /** + * @return null|string */ public function getTaxMode() @@ -91,6 +101,7 @@ public function getTaxMode() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getNextValue() @@ -101,6 +112,7 @@ public function getNextValue() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemTaxRateChangeModel.php b/lib/commercetools-history/src/Models/Change/SetLineItemTaxRateChangeModel.php index 7d0da0c42dd..4583e4f63da 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemTaxRateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemTaxRateChangeModel.php @@ -26,36 +26,43 @@ final class SetLineItemTaxRateChangeModel extends JsonObjectModel implements Set public const DISCRIMINATOR_VALUE = 'SetLineItemTaxRateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $lineItem; /** + * * @var ?string */ protected $variant; /** + * * @var ?string */ protected $taxMode; /** + * * @var ?TaxRate */ protected $nextValue; /** + * * @var ?TaxRate */ protected $previousValue; @@ -70,7 +77,8 @@ public function __construct( ?string $variant = null, ?string $taxMode = null, ?TaxRate $nextValue = null, - ?TaxRate $previousValue = null + ?TaxRate $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->lineItem = $lineItem; @@ -78,10 +86,11 @@ public function __construct( $this->taxMode = $taxMode; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -101,6 +110,7 @@ public function getType() /** *

    Update action for setLineItemTaxRate

    * + * * @return null|string */ public function getChange() @@ -118,6 +128,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getLineItem() @@ -136,6 +147,7 @@ public function getLineItem() } /** + * * @return null|string */ public function getVariant() @@ -153,6 +165,7 @@ public function getVariant() } /** + * * @return null|string */ public function getTaxMode() @@ -172,6 +185,7 @@ public function getTaxMode() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * * @return null|TaxRate */ public function getNextValue() @@ -192,6 +206,7 @@ public function getNextValue() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * * @return null|TaxRate */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemTaxedPriceChange.php b/lib/commercetools-history/src/Models/Change/SetLineItemTaxedPriceChange.php index 49fc6895c32..fd8e9daaabc 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemTaxedPriceChange.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemTaxedPriceChange.php @@ -22,6 +22,7 @@ interface SetLineItemTaxedPriceChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -29,26 +30,31 @@ public function getType(); /** *

    Update action for setLineItemTaxedPrice

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getLineItem(); /** + * @return null|string */ public function getLineItemId(); /** + * @return null|TaxedItemPrice */ public function getNextValue(); /** + * @return null|TaxedItemPrice */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemTaxedPriceChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetLineItemTaxedPriceChangeBuilder.php index 0bd411806de..3f1d9c7aea2 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemTaxedPriceChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemTaxedPriceChangeBuilder.php @@ -25,26 +25,31 @@ final class SetLineItemTaxedPriceChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $lineItem; /** + * @var ?string */ private $lineItemId; /** + * @var null|TaxedItemPrice|TaxedItemPriceBuilder */ private $nextValue; /** + * @var null|TaxedItemPrice|TaxedItemPriceBuilder */ private $previousValue; @@ -52,6 +57,7 @@ final class SetLineItemTaxedPriceChangeBuilder implements Builder /** *

    Update action for setLineItemTaxedPrice

    * + * @return null|string */ public function getChange() @@ -60,6 +66,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getLineItem() @@ -68,6 +75,7 @@ public function getLineItem() } /** + * @return null|string */ public function getLineItemId() @@ -76,6 +84,7 @@ public function getLineItemId() } /** + * @return null|TaxedItemPrice */ public function getNextValue() @@ -84,6 +93,7 @@ public function getNextValue() } /** + * @return null|TaxedItemPrice */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemTaxedPriceChangeModel.php b/lib/commercetools-history/src/Models/Change/SetLineItemTaxedPriceChangeModel.php index 8d8758bad33..35e5ea27dba 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemTaxedPriceChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemTaxedPriceChangeModel.php @@ -26,31 +26,37 @@ final class SetLineItemTaxedPriceChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'SetLineItemTaxedPriceChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $lineItem; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?TaxedItemPrice */ protected $nextValue; /** + * * @var ?TaxedItemPrice */ protected $previousValue; @@ -64,17 +70,19 @@ public function __construct( ?LocalizedString $lineItem = null, ?string $lineItemId = null, ?TaxedItemPrice $nextValue = null, - ?TaxedItemPrice $previousValue = null + ?TaxedItemPrice $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->lineItem = $lineItem; $this->lineItemId = $lineItemId; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -94,6 +102,7 @@ public function getType() /** *

    Update action for setLineItemTaxedPrice

    * + * * @return null|string */ public function getChange() @@ -111,6 +120,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getLineItem() @@ -129,6 +139,7 @@ public function getLineItem() } /** + * * @return null|string */ public function getLineItemId() @@ -146,6 +157,7 @@ public function getLineItemId() } /** + * * @return null|TaxedItemPrice */ public function getNextValue() @@ -164,6 +176,7 @@ public function getNextValue() } /** + * * @return null|TaxedItemPrice */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemTotalPriceChange.php b/lib/commercetools-history/src/Models/Change/SetLineItemTotalPriceChange.php index 57422b74f8d..45b24236c07 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemTotalPriceChange.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemTotalPriceChange.php @@ -21,6 +21,7 @@ interface SetLineItemTotalPriceChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -28,21 +29,25 @@ public function getType(); /** *

    Update action for setLineItemTotalPrice

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getLineItem(); /** + * @return null|Money */ public function getNextValue(); /** + * @return null|Money */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemTotalPriceChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetLineItemTotalPriceChangeBuilder.php index 30370bbcc1e..fa5d2f83a54 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemTotalPriceChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemTotalPriceChangeBuilder.php @@ -25,21 +25,25 @@ final class SetLineItemTotalPriceChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $lineItem; /** + * @var null|Money|MoneyBuilder */ private $nextValue; /** + * @var null|Money|MoneyBuilder */ private $previousValue; @@ -47,6 +51,7 @@ final class SetLineItemTotalPriceChangeBuilder implements Builder /** *

    Update action for setLineItemTotalPrice

    * + * @return null|string */ public function getChange() @@ -55,6 +60,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getLineItem() @@ -63,6 +69,7 @@ public function getLineItem() } /** + * @return null|Money */ public function getNextValue() @@ -71,6 +78,7 @@ public function getNextValue() } /** + * @return null|Money */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLineItemTotalPriceChangeModel.php b/lib/commercetools-history/src/Models/Change/SetLineItemTotalPriceChangeModel.php index 9ddd73e71b5..882b10c1843 100644 --- a/lib/commercetools-history/src/Models/Change/SetLineItemTotalPriceChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetLineItemTotalPriceChangeModel.php @@ -26,26 +26,31 @@ final class SetLineItemTotalPriceChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'SetLineItemTotalPriceChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $lineItem; /** + * * @var ?Money */ protected $nextValue; /** + * * @var ?Money */ protected $previousValue; @@ -58,16 +63,18 @@ public function __construct( ?string $change = null, ?LocalizedString $lineItem = null, ?Money $nextValue = null, - ?Money $previousValue = null + ?Money $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->lineItem = $lineItem; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -87,6 +94,7 @@ public function getType() /** *

    Update action for setLineItemTotalPrice

    * + * * @return null|string */ public function getChange() @@ -104,6 +112,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getLineItem() @@ -122,6 +131,7 @@ public function getLineItem() } /** + * * @return null|Money */ public function getNextValue() @@ -140,6 +150,7 @@ public function getNextValue() } /** + * * @return null|Money */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLocaleChange.php b/lib/commercetools-history/src/Models/Change/SetLocaleChange.php index 9f99b2a5dfb..626a3bee59b 100644 --- a/lib/commercetools-history/src/Models/Change/SetLocaleChange.php +++ b/lib/commercetools-history/src/Models/Change/SetLocaleChange.php @@ -18,6 +18,7 @@ interface SetLocaleChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,6 +26,7 @@ public function getType(); /** *

    Update action for setLocale on reviews

    * + * @return null|string */ public function getChange(); @@ -32,6 +34,7 @@ public function getChange(); /** *

    A locale of IETF language tag.

    * + * @return null|string */ public function getPreviousValue(); @@ -39,6 +42,7 @@ public function getPreviousValue(); /** *

    A locale of IETF language tag.

    * + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetLocaleChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetLocaleChangeBuilder.php index 2277ac8db10..d26dcc38dba 100644 --- a/lib/commercetools-history/src/Models/Change/SetLocaleChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetLocaleChangeBuilder.php @@ -21,16 +21,19 @@ final class SetLocaleChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetLocaleChangeBuilder implements Builder /** *

    Update action for setLocale on reviews

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() /** *

    A locale of IETF language tag.

    * + * @return null|string */ public function getPreviousValue() @@ -58,6 +63,7 @@ public function getPreviousValue() /** *

    A locale of IETF language tag.

    * + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLocaleChangeModel.php b/lib/commercetools-history/src/Models/Change/SetLocaleChangeModel.php index bf8cd5c8213..3a4a6e311d9 100644 --- a/lib/commercetools-history/src/Models/Change/SetLocaleChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetLocaleChangeModel.php @@ -22,21 +22,25 @@ final class SetLocaleChangeModel extends JsonObjectModel implements SetLocaleCha public const DISCRIMINATOR_VALUE = 'SetLocaleChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetLocaleChangeModel extends JsonObjectModel implements SetLocaleCha public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Update action for setLocale on reviews

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() /** *

    A locale of IETF language tag.

    * + * * @return null|string */ public function getPreviousValue() @@ -114,6 +122,7 @@ public function getPreviousValue() /** *

    A locale of IETF language tag.

    * + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLocalizedDescriptionChange.php b/lib/commercetools-history/src/Models/Change/SetLocalizedDescriptionChange.php index 456c10bbca2..5cfbad6c2cb 100644 --- a/lib/commercetools-history/src/Models/Change/SetLocalizedDescriptionChange.php +++ b/lib/commercetools-history/src/Models/Change/SetLocalizedDescriptionChange.php @@ -19,6 +19,7 @@ interface SetLocalizedDescriptionChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for setDescription

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getPreviousValue(); /** + * @return null|LocalizedString */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetLocalizedDescriptionChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetLocalizedDescriptionChangeBuilder.php index 5d1bfabe6b7..9c1ea8d980e 100644 --- a/lib/commercetools-history/src/Models/Change/SetLocalizedDescriptionChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetLocalizedDescriptionChangeBuilder.php @@ -23,16 +23,19 @@ final class SetLocalizedDescriptionChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class SetLocalizedDescriptionChangeBuilder implements Builder /** *

    Shape of the action for setDescription

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetLocalizedDescriptionChangeModel.php b/lib/commercetools-history/src/Models/Change/SetLocalizedDescriptionChangeModel.php index 3d98ac33ab5..d83f7d2e6f2 100644 --- a/lib/commercetools-history/src/Models/Change/SetLocalizedDescriptionChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetLocalizedDescriptionChangeModel.php @@ -24,21 +24,25 @@ final class SetLocalizedDescriptionChangeModel extends JsonObjectModel implement public const DISCRIMINATOR_VALUE = 'SetLocalizedDescriptionChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $previousValue; /** + * * @var ?LocalizedString */ protected $nextValue; @@ -50,15 +54,17 @@ final class SetLocalizedDescriptionChangeModel extends JsonObjectModel implement public function __construct( ?string $change = null, ?LocalizedString $previousValue = null, - ?LocalizedString $nextValue = null + ?LocalizedString $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for setDescription

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMaxApplicationsChange.php b/lib/commercetools-history/src/Models/Change/SetMaxApplicationsChange.php index 6d9b4920c2d..5b3a70f7483 100644 --- a/lib/commercetools-history/src/Models/Change/SetMaxApplicationsChange.php +++ b/lib/commercetools-history/src/Models/Change/SetMaxApplicationsChange.php @@ -18,6 +18,7 @@ interface SetMaxApplicationsChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setMaxApplications

    * + * @return null|string */ public function getChange(); /** + * @return null|int */ public function getPreviousValue(); /** + * @return null|int */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetMaxApplicationsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetMaxApplicationsChangeBuilder.php index 650193bc4cc..96ce25a8361 100644 --- a/lib/commercetools-history/src/Models/Change/SetMaxApplicationsChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetMaxApplicationsChangeBuilder.php @@ -21,16 +21,19 @@ final class SetMaxApplicationsChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?int */ private $previousValue; /** + * @var ?int */ private $nextValue; @@ -38,6 +41,7 @@ final class SetMaxApplicationsChangeBuilder implements Builder /** *

    Shape of the action for setMaxApplications

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|int */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|int */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMaxApplicationsChangeModel.php b/lib/commercetools-history/src/Models/Change/SetMaxApplicationsChangeModel.php index 0f2ef489cb1..820b4818c3f 100644 --- a/lib/commercetools-history/src/Models/Change/SetMaxApplicationsChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetMaxApplicationsChangeModel.php @@ -22,21 +22,25 @@ final class SetMaxApplicationsChangeModel extends JsonObjectModel implements Set public const DISCRIMINATOR_VALUE = 'SetMaxApplicationsChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?int */ protected $previousValue; /** + * * @var ?int */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetMaxApplicationsChangeModel extends JsonObjectModel implements Set public function __construct( ?string $change = null, ?int $previousValue = null, - ?int $nextValue = null + ?int $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setMaxApplications

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|int */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|int */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMaxApplicationsPerCustomerChange.php b/lib/commercetools-history/src/Models/Change/SetMaxApplicationsPerCustomerChange.php index 0c3e3bb2a6a..1c53f869983 100644 --- a/lib/commercetools-history/src/Models/Change/SetMaxApplicationsPerCustomerChange.php +++ b/lib/commercetools-history/src/Models/Change/SetMaxApplicationsPerCustomerChange.php @@ -18,6 +18,7 @@ interface SetMaxApplicationsPerCustomerChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setMaxApplicationsPerCustomer

    * + * @return null|string */ public function getChange(); /** + * @return null|int */ public function getPreviousValue(); /** + * @return null|int */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetMaxApplicationsPerCustomerChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetMaxApplicationsPerCustomerChangeBuilder.php index bdbb813f5d9..b42f46c9306 100644 --- a/lib/commercetools-history/src/Models/Change/SetMaxApplicationsPerCustomerChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetMaxApplicationsPerCustomerChangeBuilder.php @@ -21,16 +21,19 @@ final class SetMaxApplicationsPerCustomerChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?int */ private $previousValue; /** + * @var ?int */ private $nextValue; @@ -38,6 +41,7 @@ final class SetMaxApplicationsPerCustomerChangeBuilder implements Builder /** *

    Shape of the action for setMaxApplicationsPerCustomer

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|int */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|int */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMaxApplicationsPerCustomerChangeModel.php b/lib/commercetools-history/src/Models/Change/SetMaxApplicationsPerCustomerChangeModel.php index 1b4de836445..0354f1d511f 100644 --- a/lib/commercetools-history/src/Models/Change/SetMaxApplicationsPerCustomerChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetMaxApplicationsPerCustomerChangeModel.php @@ -22,21 +22,25 @@ final class SetMaxApplicationsPerCustomerChangeModel extends JsonObjectModel imp public const DISCRIMINATOR_VALUE = 'SetMaxApplicationsPerCustomerChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?int */ protected $previousValue; /** + * * @var ?int */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetMaxApplicationsPerCustomerChangeModel extends JsonObjectModel imp public function __construct( ?string $change = null, ?int $previousValue = null, - ?int $nextValue = null + ?int $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setMaxApplicationsPerCustomer

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|int */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|int */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMetaDescriptionChange.php b/lib/commercetools-history/src/Models/Change/SetMetaDescriptionChange.php index 249cc5e5821..443ad529c06 100644 --- a/lib/commercetools-history/src/Models/Change/SetMetaDescriptionChange.php +++ b/lib/commercetools-history/src/Models/Change/SetMetaDescriptionChange.php @@ -19,6 +19,7 @@ interface SetMetaDescriptionChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for setMetaDescription

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getPreviousValue(); /** + * @return null|LocalizedString */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetMetaDescriptionChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetMetaDescriptionChangeBuilder.php index 2a3f22a1044..11dff21692b 100644 --- a/lib/commercetools-history/src/Models/Change/SetMetaDescriptionChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetMetaDescriptionChangeBuilder.php @@ -23,16 +23,19 @@ final class SetMetaDescriptionChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class SetMetaDescriptionChangeBuilder implements Builder /** *

    Shape of the action for setMetaDescription

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMetaDescriptionChangeModel.php b/lib/commercetools-history/src/Models/Change/SetMetaDescriptionChangeModel.php index 1b87b102cd1..59eb96c9725 100644 --- a/lib/commercetools-history/src/Models/Change/SetMetaDescriptionChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetMetaDescriptionChangeModel.php @@ -24,21 +24,25 @@ final class SetMetaDescriptionChangeModel extends JsonObjectModel implements Set public const DISCRIMINATOR_VALUE = 'SetMetaDescriptionChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $previousValue; /** + * * @var ?LocalizedString */ protected $nextValue; @@ -50,15 +54,17 @@ final class SetMetaDescriptionChangeModel extends JsonObjectModel implements Set public function __construct( ?string $change = null, ?LocalizedString $previousValue = null, - ?LocalizedString $nextValue = null + ?LocalizedString $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for setMetaDescription

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMetaKeywordsChange.php b/lib/commercetools-history/src/Models/Change/SetMetaKeywordsChange.php index f3cc05f1e03..f2b07179e94 100644 --- a/lib/commercetools-history/src/Models/Change/SetMetaKeywordsChange.php +++ b/lib/commercetools-history/src/Models/Change/SetMetaKeywordsChange.php @@ -19,6 +19,7 @@ interface SetMetaKeywordsChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for setMetaKeywords

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getPreviousValue(); /** + * @return null|LocalizedString */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetMetaKeywordsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetMetaKeywordsChangeBuilder.php index 841bf3a04ea..e53b6617c2f 100644 --- a/lib/commercetools-history/src/Models/Change/SetMetaKeywordsChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetMetaKeywordsChangeBuilder.php @@ -23,16 +23,19 @@ final class SetMetaKeywordsChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class SetMetaKeywordsChangeBuilder implements Builder /** *

    Shape of the action for setMetaKeywords

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMetaKeywordsChangeModel.php b/lib/commercetools-history/src/Models/Change/SetMetaKeywordsChangeModel.php index bd90ad053ad..97ae49753c8 100644 --- a/lib/commercetools-history/src/Models/Change/SetMetaKeywordsChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetMetaKeywordsChangeModel.php @@ -24,21 +24,25 @@ final class SetMetaKeywordsChangeModel extends JsonObjectModel implements SetMet public const DISCRIMINATOR_VALUE = 'SetMetaKeywordsChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $previousValue; /** + * * @var ?LocalizedString */ protected $nextValue; @@ -50,15 +54,17 @@ final class SetMetaKeywordsChangeModel extends JsonObjectModel implements SetMet public function __construct( ?string $change = null, ?LocalizedString $previousValue = null, - ?LocalizedString $nextValue = null + ?LocalizedString $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for setMetaKeywords

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMetaTitleChange.php b/lib/commercetools-history/src/Models/Change/SetMetaTitleChange.php index 887c9e61e98..d785b2798c1 100644 --- a/lib/commercetools-history/src/Models/Change/SetMetaTitleChange.php +++ b/lib/commercetools-history/src/Models/Change/SetMetaTitleChange.php @@ -19,6 +19,7 @@ interface SetMetaTitleChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for setMetaTitle

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getPreviousValue(); /** + * @return null|LocalizedString */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetMetaTitleChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetMetaTitleChangeBuilder.php index 6fe20bf0c26..bb7743467a7 100644 --- a/lib/commercetools-history/src/Models/Change/SetMetaTitleChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetMetaTitleChangeBuilder.php @@ -23,16 +23,19 @@ final class SetMetaTitleChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class SetMetaTitleChangeBuilder implements Builder /** *

    Shape of the action for setMetaTitle

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMetaTitleChangeModel.php b/lib/commercetools-history/src/Models/Change/SetMetaTitleChangeModel.php index 0d17ff71ae9..fbedb6b541b 100644 --- a/lib/commercetools-history/src/Models/Change/SetMetaTitleChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetMetaTitleChangeModel.php @@ -24,21 +24,25 @@ final class SetMetaTitleChangeModel extends JsonObjectModel implements SetMetaTi public const DISCRIMINATOR_VALUE = 'SetMetaTitleChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $previousValue; /** + * * @var ?LocalizedString */ protected $nextValue; @@ -50,15 +54,17 @@ final class SetMetaTitleChangeModel extends JsonObjectModel implements SetMetaTi public function __construct( ?string $change = null, ?LocalizedString $previousValue = null, - ?LocalizedString $nextValue = null + ?LocalizedString $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for setMetaTitle

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMethodInfoInterfaceChange.php b/lib/commercetools-history/src/Models/Change/SetMethodInfoInterfaceChange.php index ad6bf32cc9a..8099bd12047 100644 --- a/lib/commercetools-history/src/Models/Change/SetMethodInfoInterfaceChange.php +++ b/lib/commercetools-history/src/Models/Change/SetMethodInfoInterfaceChange.php @@ -18,6 +18,7 @@ interface SetMethodInfoInterfaceChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setMethodInfoInterface

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetMethodInfoInterfaceChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetMethodInfoInterfaceChangeBuilder.php index 1bfe123a58c..4cb8dcbd453 100644 --- a/lib/commercetools-history/src/Models/Change/SetMethodInfoInterfaceChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetMethodInfoInterfaceChangeBuilder.php @@ -21,16 +21,19 @@ final class SetMethodInfoInterfaceChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetMethodInfoInterfaceChangeBuilder implements Builder /** *

    Shape of the action for setMethodInfoInterface

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMethodInfoInterfaceChangeModel.php b/lib/commercetools-history/src/Models/Change/SetMethodInfoInterfaceChangeModel.php index 6445b270222..83f7c362a7b 100644 --- a/lib/commercetools-history/src/Models/Change/SetMethodInfoInterfaceChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetMethodInfoInterfaceChangeModel.php @@ -22,21 +22,25 @@ final class SetMethodInfoInterfaceChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'SetMethodInfoInterfaceChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetMethodInfoInterfaceChangeModel extends JsonObjectModel implements public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setMethodInfoInterface

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMethodInfoMethodChange.php b/lib/commercetools-history/src/Models/Change/SetMethodInfoMethodChange.php index 24ea1d96bb5..62f02bcc30c 100644 --- a/lib/commercetools-history/src/Models/Change/SetMethodInfoMethodChange.php +++ b/lib/commercetools-history/src/Models/Change/SetMethodInfoMethodChange.php @@ -18,6 +18,7 @@ interface SetMethodInfoMethodChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setMethodInfoMethod

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetMethodInfoMethodChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetMethodInfoMethodChangeBuilder.php index be8a029bce9..3482bb3bc83 100644 --- a/lib/commercetools-history/src/Models/Change/SetMethodInfoMethodChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetMethodInfoMethodChangeBuilder.php @@ -21,16 +21,19 @@ final class SetMethodInfoMethodChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetMethodInfoMethodChangeBuilder implements Builder /** *

    Shape of the action for setMethodInfoMethod

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMethodInfoMethodChangeModel.php b/lib/commercetools-history/src/Models/Change/SetMethodInfoMethodChangeModel.php index 491d9cf0eb2..ec5faf05632 100644 --- a/lib/commercetools-history/src/Models/Change/SetMethodInfoMethodChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetMethodInfoMethodChangeModel.php @@ -22,21 +22,25 @@ final class SetMethodInfoMethodChangeModel extends JsonObjectModel implements Se public const DISCRIMINATOR_VALUE = 'SetMethodInfoMethodChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetMethodInfoMethodChangeModel extends JsonObjectModel implements Se public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setMethodInfoMethod

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMethodInfoNameChange.php b/lib/commercetools-history/src/Models/Change/SetMethodInfoNameChange.php index 6c5349085ea..67b3509fb4d 100644 --- a/lib/commercetools-history/src/Models/Change/SetMethodInfoNameChange.php +++ b/lib/commercetools-history/src/Models/Change/SetMethodInfoNameChange.php @@ -19,6 +19,7 @@ interface SetMethodInfoNameChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for setMethodInfoName

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getPreviousValue(); /** + * @return null|LocalizedString */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetMethodInfoNameChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetMethodInfoNameChangeBuilder.php index 57b015e7d49..8c48d9fe09c 100644 --- a/lib/commercetools-history/src/Models/Change/SetMethodInfoNameChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetMethodInfoNameChangeBuilder.php @@ -23,16 +23,19 @@ final class SetMethodInfoNameChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class SetMethodInfoNameChangeBuilder implements Builder /** *

    Shape of the action for setMethodInfoName

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMethodInfoNameChangeModel.php b/lib/commercetools-history/src/Models/Change/SetMethodInfoNameChangeModel.php index 55392e162ee..759b0a6c24b 100644 --- a/lib/commercetools-history/src/Models/Change/SetMethodInfoNameChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetMethodInfoNameChangeModel.php @@ -24,21 +24,25 @@ final class SetMethodInfoNameChangeModel extends JsonObjectModel implements SetM public const DISCRIMINATOR_VALUE = 'SetMethodInfoNameChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $previousValue; /** + * * @var ?LocalizedString */ protected $nextValue; @@ -50,15 +54,17 @@ final class SetMethodInfoNameChangeModel extends JsonObjectModel implements SetM public function __construct( ?string $change = null, ?LocalizedString $previousValue = null, - ?LocalizedString $nextValue = null + ?LocalizedString $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for setMethodInfoName

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMiddleNameChange.php b/lib/commercetools-history/src/Models/Change/SetMiddleNameChange.php index 33ae7a7d9f1..0a112adba2a 100644 --- a/lib/commercetools-history/src/Models/Change/SetMiddleNameChange.php +++ b/lib/commercetools-history/src/Models/Change/SetMiddleNameChange.php @@ -18,6 +18,7 @@ interface SetMiddleNameChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setMiddleName

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetMiddleNameChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetMiddleNameChangeBuilder.php index 1c8b77769a8..3329c736e53 100644 --- a/lib/commercetools-history/src/Models/Change/SetMiddleNameChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetMiddleNameChangeBuilder.php @@ -21,16 +21,19 @@ final class SetMiddleNameChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetMiddleNameChangeBuilder implements Builder /** *

    Shape of the action for setMiddleName

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetMiddleNameChangeModel.php b/lib/commercetools-history/src/Models/Change/SetMiddleNameChangeModel.php index e4b9ed6de7b..902f9903d11 100644 --- a/lib/commercetools-history/src/Models/Change/SetMiddleNameChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetMiddleNameChangeModel.php @@ -22,21 +22,25 @@ final class SetMiddleNameChangeModel extends JsonObjectModel implements SetMiddl public const DISCRIMINATOR_VALUE = 'SetMiddleNameChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetMiddleNameChangeModel extends JsonObjectModel implements SetMiddl public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setMiddleName

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetNameChange.php b/lib/commercetools-history/src/Models/Change/SetNameChange.php index b954dd23f9e..f05ad298ef5 100644 --- a/lib/commercetools-history/src/Models/Change/SetNameChange.php +++ b/lib/commercetools-history/src/Models/Change/SetNameChange.php @@ -19,6 +19,7 @@ interface SetNameChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for setName

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getPreviousValue(); /** + * @return null|LocalizedString */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetNameChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetNameChangeBuilder.php index 0c5bcf3840e..fd64adf0be2 100644 --- a/lib/commercetools-history/src/Models/Change/SetNameChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetNameChangeBuilder.php @@ -23,16 +23,19 @@ final class SetNameChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class SetNameChangeBuilder implements Builder /** *

    Shape of the action for setName

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetNameChangeModel.php b/lib/commercetools-history/src/Models/Change/SetNameChangeModel.php index af3985af143..b1dbd58fb6b 100644 --- a/lib/commercetools-history/src/Models/Change/SetNameChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetNameChangeModel.php @@ -24,21 +24,25 @@ final class SetNameChangeModel extends JsonObjectModel implements SetNameChange public const DISCRIMINATOR_VALUE = 'SetNameChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $previousValue; /** + * * @var ?LocalizedString */ protected $nextValue; @@ -50,15 +54,17 @@ final class SetNameChangeModel extends JsonObjectModel implements SetNameChange public function __construct( ?string $change = null, ?LocalizedString $previousValue = null, - ?LocalizedString $nextValue = null + ?LocalizedString $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for setName

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomFieldChange.php b/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomFieldChange.php index b2109895e87..b62ef690c83 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomFieldChange.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomFieldChange.php @@ -23,6 +23,7 @@ interface SetOrderLineItemCustomFieldChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -30,36 +31,43 @@ public function getType(); /** *

    Update action for setLineItemCustomField

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCustomTypeId(); /** + * @return null|string */ public function getName(); /** + * @return null|string */ public function getVariant(); /** + * @return null|LocalizedString */ public function getLineItem(); /** + * @return null|mixed */ public function getNextValue(); /** + * @return null|mixed */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomFieldChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomFieldChangeBuilder.php index b850ef37084..54a23abac3d 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomFieldChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomFieldChangeBuilder.php @@ -23,36 +23,43 @@ final class SetOrderLineItemCustomFieldChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $customTypeId; /** + * @var ?string */ private $name; /** + * @var ?string */ private $variant; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $lineItem; /** + * @var null|mixed|mixed */ private $nextValue; /** + * @var null|mixed|mixed */ private $previousValue; @@ -60,6 +67,7 @@ final class SetOrderLineItemCustomFieldChangeBuilder implements Builder /** *

    Update action for setLineItemCustomField

    * + * @return null|string */ public function getChange() @@ -68,6 +76,7 @@ public function getChange() } /** + * @return null|string */ public function getCustomTypeId() @@ -76,6 +85,7 @@ public function getCustomTypeId() } /** + * @return null|string */ public function getName() @@ -84,6 +94,7 @@ public function getName() } /** + * @return null|string */ public function getVariant() @@ -92,6 +103,7 @@ public function getVariant() } /** + * @return null|LocalizedString */ public function getLineItem() @@ -100,6 +112,7 @@ public function getLineItem() } /** + * @return null|mixed */ public function getNextValue() @@ -108,6 +121,7 @@ public function getNextValue() } /** + * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomFieldChangeModel.php b/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomFieldChangeModel.php index e0b119f212d..5ce9bfc2cd4 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomFieldChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomFieldChangeModel.php @@ -24,41 +24,49 @@ final class SetOrderLineItemCustomFieldChangeModel extends JsonObjectModel imple public const DISCRIMINATOR_VALUE = 'SetOrderLineItemCustomFieldChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $customTypeId; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $variant; /** + * * @var ?LocalizedString */ protected $lineItem; /** + * * @var ?mixed */ protected $nextValue; /** + * * @var ?mixed */ protected $previousValue; @@ -74,7 +82,8 @@ public function __construct( ?string $variant = null, ?LocalizedString $lineItem = null, $nextValue = null, - $previousValue = null + $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->customTypeId = $customTypeId; @@ -83,10 +92,11 @@ public function __construct( $this->lineItem = $lineItem; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -106,6 +116,7 @@ public function getType() /** *

    Update action for setLineItemCustomField

    * + * * @return null|string */ public function getChange() @@ -123,6 +134,7 @@ public function getChange() } /** + * * @return null|string */ public function getCustomTypeId() @@ -140,6 +152,7 @@ public function getCustomTypeId() } /** + * * @return null|string */ public function getName() @@ -157,6 +170,7 @@ public function getName() } /** + * * @return null|string */ public function getVariant() @@ -174,6 +188,7 @@ public function getVariant() } /** + * * @return null|LocalizedString */ public function getLineItem() @@ -192,6 +207,7 @@ public function getLineItem() } /** + * * @return null|mixed */ public function getNextValue() @@ -209,6 +225,7 @@ public function getNextValue() } /** + * * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomTypeChange.php b/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomTypeChange.php index 73998b5bc11..f3901f82b25 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomTypeChange.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomTypeChange.php @@ -22,6 +22,7 @@ interface SetOrderLineItemCustomTypeChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -29,26 +30,31 @@ public function getType(); /** *

    Update action for setLineItemCustomType

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getLineItem(); /** + * @return null|string */ public function getVariant(); /** + * @return null|CustomFields */ public function getNextValue(); /** + * @return null|CustomFields */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomTypeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomTypeChangeBuilder.php index 82ad4878ce3..8548b4363cc 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomTypeChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomTypeChangeBuilder.php @@ -25,26 +25,31 @@ final class SetOrderLineItemCustomTypeChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $lineItem; /** + * @var ?string */ private $variant; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $nextValue; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $previousValue; @@ -52,6 +57,7 @@ final class SetOrderLineItemCustomTypeChangeBuilder implements Builder /** *

    Update action for setLineItemCustomType

    * + * @return null|string */ public function getChange() @@ -60,6 +66,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getLineItem() @@ -68,6 +75,7 @@ public function getLineItem() } /** + * @return null|string */ public function getVariant() @@ -76,6 +84,7 @@ public function getVariant() } /** + * @return null|CustomFields */ public function getNextValue() @@ -84,6 +93,7 @@ public function getNextValue() } /** + * @return null|CustomFields */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomTypeChangeModel.php b/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomTypeChangeModel.php index 0ab8726f326..ab34b19155d 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomTypeChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderLineItemCustomTypeChangeModel.php @@ -26,31 +26,37 @@ final class SetOrderLineItemCustomTypeChangeModel extends JsonObjectModel implem public const DISCRIMINATOR_VALUE = 'SetOrderLineItemCustomTypeChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $lineItem; /** + * * @var ?string */ protected $variant; /** + * * @var ?CustomFields */ protected $nextValue; /** + * * @var ?CustomFields */ protected $previousValue; @@ -64,17 +70,19 @@ public function __construct( ?LocalizedString $lineItem = null, ?string $variant = null, ?CustomFields $nextValue = null, - ?CustomFields $previousValue = null + ?CustomFields $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->lineItem = $lineItem; $this->variant = $variant; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -94,6 +102,7 @@ public function getType() /** *

    Update action for setLineItemCustomType

    * + * * @return null|string */ public function getChange() @@ -111,6 +120,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getLineItem() @@ -129,6 +139,7 @@ public function getLineItem() } /** + * * @return null|string */ public function getVariant() @@ -146,6 +157,7 @@ public function getVariant() } /** + * * @return null|CustomFields */ public function getNextValue() @@ -164,6 +176,7 @@ public function getNextValue() } /** + * * @return null|CustomFields */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetOrderNumberChange.php b/lib/commercetools-history/src/Models/Change/SetOrderNumberChange.php index 15706b1a74f..0e14c4be443 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderNumberChange.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderNumberChange.php @@ -18,6 +18,7 @@ interface SetOrderNumberChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setOrderNumber

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetOrderNumberChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetOrderNumberChangeBuilder.php index f91941d4038..9b454c27336 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderNumberChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderNumberChangeBuilder.php @@ -21,16 +21,19 @@ final class SetOrderNumberChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetOrderNumberChangeBuilder implements Builder /** *

    Shape of the action for setOrderNumber

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetOrderNumberChangeModel.php b/lib/commercetools-history/src/Models/Change/SetOrderNumberChangeModel.php index 532ef0c60a3..3c353797e2a 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderNumberChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderNumberChangeModel.php @@ -22,21 +22,25 @@ final class SetOrderNumberChangeModel extends JsonObjectModel implements SetOrde public const DISCRIMINATOR_VALUE = 'SetOrderNumberChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetOrderNumberChangeModel extends JsonObjectModel implements SetOrde public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setOrderNumber

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetOrderTaxedPriceChange.php b/lib/commercetools-history/src/Models/Change/SetOrderTaxedPriceChange.php index 9adf11d2b29..ef429318b85 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderTaxedPriceChange.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderTaxedPriceChange.php @@ -20,6 +20,7 @@ interface SetOrderTaxedPriceChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update action for setOrderTaxedPrice

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getTaxMode(); /** + * @return null|TaxedItemPrice */ public function getNextValue(); /** + * @return null|TaxedItemPrice */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetOrderTaxedPriceChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetOrderTaxedPriceChangeBuilder.php index b524fe27e0c..c433fa5b1e3 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderTaxedPriceChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderTaxedPriceChangeBuilder.php @@ -23,21 +23,25 @@ final class SetOrderTaxedPriceChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $taxMode; /** + * @var null|TaxedItemPrice|TaxedItemPriceBuilder */ private $nextValue; /** + * @var null|TaxedItemPrice|TaxedItemPriceBuilder */ private $previousValue; @@ -45,6 +49,7 @@ final class SetOrderTaxedPriceChangeBuilder implements Builder /** *

    Update action for setOrderTaxedPrice

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|string */ public function getTaxMode() @@ -61,6 +67,7 @@ public function getTaxMode() } /** + * @return null|TaxedItemPrice */ public function getNextValue() @@ -69,6 +76,7 @@ public function getNextValue() } /** + * @return null|TaxedItemPrice */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetOrderTaxedPriceChangeModel.php b/lib/commercetools-history/src/Models/Change/SetOrderTaxedPriceChangeModel.php index 498d534757a..5d6aa6d9997 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderTaxedPriceChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderTaxedPriceChangeModel.php @@ -24,26 +24,31 @@ final class SetOrderTaxedPriceChangeModel extends JsonObjectModel implements Set public const DISCRIMINATOR_VALUE = 'SetOrderTaxedPriceChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $taxMode; /** + * * @var ?TaxedItemPrice */ protected $nextValue; /** + * * @var ?TaxedItemPrice */ protected $previousValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $taxMode = null, ?TaxedItemPrice $nextValue = null, - ?TaxedItemPrice $previousValue = null + ?TaxedItemPrice $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->taxMode = $taxMode; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for setOrderTaxedPrice

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|string */ public function getTaxMode() @@ -119,6 +128,7 @@ public function getTaxMode() } /** + * * @return null|TaxedItemPrice */ public function getNextValue() @@ -137,6 +147,7 @@ public function getNextValue() } /** + * * @return null|TaxedItemPrice */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetOrderTotalPriceChange.php b/lib/commercetools-history/src/Models/Change/SetOrderTotalPriceChange.php index 63b066db870..791ef4af1b9 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderTotalPriceChange.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderTotalPriceChange.php @@ -19,6 +19,7 @@ interface SetOrderTotalPriceChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for setOrderTotalPrice

    * + * @return null|string */ public function getChange(); /** + * @return null|Money */ public function getNextValue(); /** + * @return null|Money */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetOrderTotalPriceChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetOrderTotalPriceChangeBuilder.php index a7e265fa0fc..1450edef858 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderTotalPriceChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderTotalPriceChangeBuilder.php @@ -23,16 +23,19 @@ final class SetOrderTotalPriceChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Money|MoneyBuilder */ private $nextValue; /** + * @var null|Money|MoneyBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class SetOrderTotalPriceChangeBuilder implements Builder /** *

    Update action for setOrderTotalPrice

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Money */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|Money */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetOrderTotalPriceChangeModel.php b/lib/commercetools-history/src/Models/Change/SetOrderTotalPriceChangeModel.php index 952397acb36..51e36d4d6ba 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderTotalPriceChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderTotalPriceChangeModel.php @@ -24,21 +24,25 @@ final class SetOrderTotalPriceChangeModel extends JsonObjectModel implements Set public const DISCRIMINATOR_VALUE = 'SetOrderTotalPriceChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Money */ protected $nextValue; /** + * * @var ?Money */ protected $previousValue; @@ -50,15 +54,17 @@ final class SetOrderTotalPriceChangeModel extends JsonObjectModel implements Set public function __construct( ?string $change = null, ?Money $nextValue = null, - ?Money $previousValue = null + ?Money $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for setOrderTotalPrice

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Money */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|Money */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetOrderTotalTaxChange.php b/lib/commercetools-history/src/Models/Change/SetOrderTotalTaxChange.php index d38e7cb02a3..7656ff690a8 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderTotalTaxChange.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderTotalTaxChange.php @@ -20,6 +20,7 @@ interface SetOrderTotalTaxChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update action for setOrderTotalTax

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getTaxMode(); /** + * @return null|Money */ public function getNextValue(); /** + * @return null|Money */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetOrderTotalTaxChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetOrderTotalTaxChangeBuilder.php index 02b74bcd414..993864dc96c 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderTotalTaxChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderTotalTaxChangeBuilder.php @@ -23,21 +23,25 @@ final class SetOrderTotalTaxChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $taxMode; /** + * @var null|Money|MoneyBuilder */ private $nextValue; /** + * @var null|Money|MoneyBuilder */ private $previousValue; @@ -45,6 +49,7 @@ final class SetOrderTotalTaxChangeBuilder implements Builder /** *

    Update action for setOrderTotalTax

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|string */ public function getTaxMode() @@ -61,6 +67,7 @@ public function getTaxMode() } /** + * @return null|Money */ public function getNextValue() @@ -69,6 +76,7 @@ public function getNextValue() } /** + * @return null|Money */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetOrderTotalTaxChangeModel.php b/lib/commercetools-history/src/Models/Change/SetOrderTotalTaxChangeModel.php index 4e68b255e7b..9b7283bbcc5 100644 --- a/lib/commercetools-history/src/Models/Change/SetOrderTotalTaxChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetOrderTotalTaxChangeModel.php @@ -24,26 +24,31 @@ final class SetOrderTotalTaxChangeModel extends JsonObjectModel implements SetOr public const DISCRIMINATOR_VALUE = 'SetOrderTotalTaxChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $taxMode; /** + * * @var ?Money */ protected $nextValue; /** + * * @var ?Money */ protected $previousValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $taxMode = null, ?Money $nextValue = null, - ?Money $previousValue = null + ?Money $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->taxMode = $taxMode; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for setOrderTotalTax

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|string */ public function getTaxMode() @@ -119,6 +128,7 @@ public function getTaxMode() } /** + * * @return null|Money */ public function getNextValue() @@ -137,6 +147,7 @@ public function getNextValue() } /** + * * @return null|Money */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetParcelItemsChange.php b/lib/commercetools-history/src/Models/Change/SetParcelItemsChange.php index 5487a3c3689..fbe20426a9e 100644 --- a/lib/commercetools-history/src/Models/Change/SetParcelItemsChange.php +++ b/lib/commercetools-history/src/Models/Change/SetParcelItemsChange.php @@ -21,6 +21,7 @@ interface SetParcelItemsChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -28,21 +29,25 @@ public function getType(); /** *

    Update action for setParcelItems

    * + * @return null|string */ public function getChange(); /** + * @return null|ParcelChangeValue */ public function getParcel(); /** + * @return null|DeliveryItemCollection */ public function getNextValue(); /** + * @return null|DeliveryItemCollection */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetParcelItemsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetParcelItemsChangeBuilder.php index 43ccbd53fc0..562e0ca7f12 100644 --- a/lib/commercetools-history/src/Models/Change/SetParcelItemsChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetParcelItemsChangeBuilder.php @@ -24,21 +24,25 @@ final class SetParcelItemsChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|ParcelChangeValue|ParcelChangeValueBuilder */ private $parcel; /** + * @var ?DeliveryItemCollection */ private $nextValue; /** + * @var ?DeliveryItemCollection */ private $previousValue; @@ -46,6 +50,7 @@ final class SetParcelItemsChangeBuilder implements Builder /** *

    Update action for setParcelItems

    * + * @return null|string */ public function getChange() @@ -54,6 +59,7 @@ public function getChange() } /** + * @return null|ParcelChangeValue */ public function getParcel() @@ -62,6 +68,7 @@ public function getParcel() } /** + * @return null|DeliveryItemCollection */ public function getNextValue() @@ -70,6 +77,7 @@ public function getNextValue() } /** + * @return null|DeliveryItemCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetParcelItemsChangeModel.php b/lib/commercetools-history/src/Models/Change/SetParcelItemsChangeModel.php index 1fae5391af6..4941f8bfae7 100644 --- a/lib/commercetools-history/src/Models/Change/SetParcelItemsChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetParcelItemsChangeModel.php @@ -25,26 +25,31 @@ final class SetParcelItemsChangeModel extends JsonObjectModel implements SetParc public const DISCRIMINATOR_VALUE = 'SetParcelItemsChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ParcelChangeValue */ protected $parcel; /** + * * @var ?DeliveryItemCollection */ protected $nextValue; /** + * * @var ?DeliveryItemCollection */ protected $previousValue; @@ -57,16 +62,18 @@ public function __construct( ?string $change = null, ?ParcelChangeValue $parcel = null, ?DeliveryItemCollection $nextValue = null, - ?DeliveryItemCollection $previousValue = null + ?DeliveryItemCollection $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->parcel = $parcel; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -86,6 +93,7 @@ public function getType() /** *

    Update action for setParcelItems

    * + * * @return null|string */ public function getChange() @@ -103,6 +111,7 @@ public function getChange() } /** + * * @return null|ParcelChangeValue */ public function getParcel() @@ -121,6 +130,7 @@ public function getParcel() } /** + * * @return null|DeliveryItemCollection */ public function getNextValue() @@ -138,6 +148,7 @@ public function getNextValue() } /** + * * @return null|DeliveryItemCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetParcelMeasurementsChange.php b/lib/commercetools-history/src/Models/Change/SetParcelMeasurementsChange.php index ff4778793db..fcd0624d0eb 100644 --- a/lib/commercetools-history/src/Models/Change/SetParcelMeasurementsChange.php +++ b/lib/commercetools-history/src/Models/Change/SetParcelMeasurementsChange.php @@ -21,6 +21,7 @@ interface SetParcelMeasurementsChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -28,21 +29,25 @@ public function getType(); /** *

    Update action for setParcelMeasurements

    * + * @return null|string */ public function getChange(); /** + * @return null|ParcelChangeValue */ public function getParcel(); /** + * @return null|ParcelMeasurements */ public function getNextValue(); /** + * @return null|ParcelMeasurements */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetParcelMeasurementsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetParcelMeasurementsChangeBuilder.php index cb8b9a8364a..dc5d8ae22c1 100644 --- a/lib/commercetools-history/src/Models/Change/SetParcelMeasurementsChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetParcelMeasurementsChangeBuilder.php @@ -25,21 +25,25 @@ final class SetParcelMeasurementsChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|ParcelChangeValue|ParcelChangeValueBuilder */ private $parcel; /** + * @var null|ParcelMeasurements|ParcelMeasurementsBuilder */ private $nextValue; /** + * @var null|ParcelMeasurements|ParcelMeasurementsBuilder */ private $previousValue; @@ -47,6 +51,7 @@ final class SetParcelMeasurementsChangeBuilder implements Builder /** *

    Update action for setParcelMeasurements

    * + * @return null|string */ public function getChange() @@ -55,6 +60,7 @@ public function getChange() } /** + * @return null|ParcelChangeValue */ public function getParcel() @@ -63,6 +69,7 @@ public function getParcel() } /** + * @return null|ParcelMeasurements */ public function getNextValue() @@ -71,6 +78,7 @@ public function getNextValue() } /** + * @return null|ParcelMeasurements */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetParcelMeasurementsChangeModel.php b/lib/commercetools-history/src/Models/Change/SetParcelMeasurementsChangeModel.php index f54ecb56432..203b01c0d04 100644 --- a/lib/commercetools-history/src/Models/Change/SetParcelMeasurementsChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetParcelMeasurementsChangeModel.php @@ -26,26 +26,31 @@ final class SetParcelMeasurementsChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'SetParcelMeasurementsChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ParcelChangeValue */ protected $parcel; /** + * * @var ?ParcelMeasurements */ protected $nextValue; /** + * * @var ?ParcelMeasurements */ protected $previousValue; @@ -58,16 +63,18 @@ public function __construct( ?string $change = null, ?ParcelChangeValue $parcel = null, ?ParcelMeasurements $nextValue = null, - ?ParcelMeasurements $previousValue = null + ?ParcelMeasurements $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->parcel = $parcel; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -87,6 +94,7 @@ public function getType() /** *

    Update action for setParcelMeasurements

    * + * * @return null|string */ public function getChange() @@ -104,6 +112,7 @@ public function getChange() } /** + * * @return null|ParcelChangeValue */ public function getParcel() @@ -122,6 +131,7 @@ public function getParcel() } /** + * * @return null|ParcelMeasurements */ public function getNextValue() @@ -140,6 +150,7 @@ public function getNextValue() } /** + * * @return null|ParcelMeasurements */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetParcelTrackingDataChange.php b/lib/commercetools-history/src/Models/Change/SetParcelTrackingDataChange.php index 1c8bb4c5dea..5e4fcc45e04 100644 --- a/lib/commercetools-history/src/Models/Change/SetParcelTrackingDataChange.php +++ b/lib/commercetools-history/src/Models/Change/SetParcelTrackingDataChange.php @@ -21,6 +21,7 @@ interface SetParcelTrackingDataChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -28,21 +29,25 @@ public function getType(); /** *

    Update action for setParcelTrackingData

    * + * @return null|string */ public function getChange(); /** + * @return null|ParcelChangeValue */ public function getParcel(); /** + * @return null|TrackingData */ public function getNextValue(); /** + * @return null|TrackingData */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetParcelTrackingDataChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetParcelTrackingDataChangeBuilder.php index f6ec3e415c2..2860f962c35 100644 --- a/lib/commercetools-history/src/Models/Change/SetParcelTrackingDataChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetParcelTrackingDataChangeBuilder.php @@ -25,21 +25,25 @@ final class SetParcelTrackingDataChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|ParcelChangeValue|ParcelChangeValueBuilder */ private $parcel; /** + * @var null|TrackingData|TrackingDataBuilder */ private $nextValue; /** + * @var null|TrackingData|TrackingDataBuilder */ private $previousValue; @@ -47,6 +51,7 @@ final class SetParcelTrackingDataChangeBuilder implements Builder /** *

    Update action for setParcelTrackingData

    * + * @return null|string */ public function getChange() @@ -55,6 +60,7 @@ public function getChange() } /** + * @return null|ParcelChangeValue */ public function getParcel() @@ -63,6 +69,7 @@ public function getParcel() } /** + * @return null|TrackingData */ public function getNextValue() @@ -71,6 +78,7 @@ public function getNextValue() } /** + * @return null|TrackingData */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetParcelTrackingDataChangeModel.php b/lib/commercetools-history/src/Models/Change/SetParcelTrackingDataChangeModel.php index d7d5697f4a8..925066efdfb 100644 --- a/lib/commercetools-history/src/Models/Change/SetParcelTrackingDataChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetParcelTrackingDataChangeModel.php @@ -26,26 +26,31 @@ final class SetParcelTrackingDataChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'SetParcelTrackingDataChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ParcelChangeValue */ protected $parcel; /** + * * @var ?TrackingData */ protected $nextValue; /** + * * @var ?TrackingData */ protected $previousValue; @@ -58,16 +63,18 @@ public function __construct( ?string $change = null, ?ParcelChangeValue $parcel = null, ?TrackingData $nextValue = null, - ?TrackingData $previousValue = null + ?TrackingData $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->parcel = $parcel; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -87,6 +94,7 @@ public function getType() /** *

    Update action for setParcelTrackingData

    * + * * @return null|string */ public function getChange() @@ -104,6 +112,7 @@ public function getChange() } /** + * * @return null|ParcelChangeValue */ public function getParcel() @@ -122,6 +131,7 @@ public function getParcel() } /** + * * @return null|TrackingData */ public function getNextValue() @@ -140,6 +150,7 @@ public function getNextValue() } /** + * * @return null|TrackingData */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetPricesChange.php b/lib/commercetools-history/src/Models/Change/SetPricesChange.php index e830c52a790..10382a3bf24 100644 --- a/lib/commercetools-history/src/Models/Change/SetPricesChange.php +++ b/lib/commercetools-history/src/Models/Change/SetPricesChange.php @@ -21,6 +21,7 @@ interface SetPricesChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -28,26 +29,31 @@ public function getType(); /** *

    Update action for setPrices

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|string */ public function getVariant(); /** + * @return null|PriceCollection */ public function getPreviousValue(); /** + * @return null|PriceCollection */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetPricesChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetPricesChangeBuilder.php index 3a52a2fa0f8..e648a13bd32 100644 --- a/lib/commercetools-history/src/Models/Change/SetPricesChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetPricesChangeBuilder.php @@ -22,26 +22,31 @@ final class SetPricesChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var ?string */ private $variant; /** + * @var ?PriceCollection */ private $previousValue; /** + * @var ?PriceCollection */ private $nextValue; @@ -49,6 +54,7 @@ final class SetPricesChangeBuilder implements Builder /** *

    Update action for setPrices

    * + * @return null|string */ public function getChange() @@ -57,6 +63,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -65,6 +72,7 @@ public function getCatalogData() } /** + * @return null|string */ public function getVariant() @@ -73,6 +81,7 @@ public function getVariant() } /** + * @return null|PriceCollection */ public function getPreviousValue() @@ -81,6 +90,7 @@ public function getPreviousValue() } /** + * @return null|PriceCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetPricesChangeModel.php b/lib/commercetools-history/src/Models/Change/SetPricesChangeModel.php index 2963dec93b1..76a7377c723 100644 --- a/lib/commercetools-history/src/Models/Change/SetPricesChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetPricesChangeModel.php @@ -23,31 +23,37 @@ final class SetPricesChangeModel extends JsonObjectModel implements SetPricesCha public const DISCRIMINATOR_VALUE = 'SetPricesChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?string */ protected $variant; /** + * * @var ?PriceCollection */ protected $previousValue; /** + * * @var ?PriceCollection */ protected $nextValue; @@ -61,17 +67,19 @@ public function __construct( ?string $catalogData = null, ?string $variant = null, ?PriceCollection $previousValue = null, - ?PriceCollection $nextValue = null + ?PriceCollection $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->variant = $variant; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -91,6 +99,7 @@ public function getType() /** *

    Update action for setPrices

    * + * * @return null|string */ public function getChange() @@ -108,6 +117,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -125,6 +135,7 @@ public function getCatalogData() } /** + * * @return null|string */ public function getVariant() @@ -142,6 +153,7 @@ public function getVariant() } /** + * * @return null|PriceCollection */ public function getPreviousValue() @@ -159,6 +171,7 @@ public function getPreviousValue() } /** + * * @return null|PriceCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetProductCountChange.php b/lib/commercetools-history/src/Models/Change/SetProductCountChange.php new file mode 100644 index 00000000000..6fba3024634 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetProductCountChange.php @@ -0,0 +1,60 @@ +Update action for setProductCount

    + * + + * @return null|string + */ + public function getChange(); + + /** + + * @return null|int + */ + public function getPreviousValue(); + + /** + + * @return null|int + */ + public function getNextValue(); + + /** + * @param ?string $change + */ + public function setChange(?string $change): void; + + /** + * @param ?int $previousValue + */ + public function setPreviousValue(?int $previousValue): void; + + /** + * @param ?int $nextValue + */ + public function setNextValue(?int $nextValue): void; +} diff --git a/lib/commercetools-history/src/Models/Change/SetProductCountChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetProductCountChangeBuilder.php new file mode 100644 index 00000000000..8ecd3083c93 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetProductCountChangeBuilder.php @@ -0,0 +1,117 @@ + + */ +final class SetProductCountChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var ?int + */ + private $previousValue; + + /** + + * @var ?int + */ + private $nextValue; + + /** + *

    Update action for setProductCount

    + * + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + + * @return null|int + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + + * @return null|int + */ + public function getNextValue() + { + return $this->nextValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?int $previousValue + * @return $this + */ + public function withPreviousValue(?int $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @param ?int $nextValue + * @return $this + */ + public function withNextValue(?int $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + + public function build(): SetProductCountChange + { + return new SetProductCountChangeModel( + $this->change, + $this->previousValue, + $this->nextValue + ); + } + + public static function of(): SetProductCountChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetProductCountChangeCollection.php b/lib/commercetools-history/src/Models/Change/SetProductCountChangeCollection.php new file mode 100644 index 00000000000..51e474f44c2 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetProductCountChangeCollection.php @@ -0,0 +1,56 @@ + + * @method SetProductCountChange current() + * @method SetProductCountChange end() + * @method SetProductCountChange at($offset) + */ +class SetProductCountChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert SetProductCountChange $value + * @psalm-param SetProductCountChange|stdClass $value + * @throws InvalidArgumentException + * + * @return SetProductCountChangeCollection + */ + public function add($value) + { + if (!$value instanceof SetProductCountChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?SetProductCountChange + */ + protected function mapper() + { + return function (?int $index): ?SetProductCountChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var SetProductCountChange $data */ + $data = SetProductCountChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetProductCountChangeModel.php b/lib/commercetools-history/src/Models/Change/SetProductCountChangeModel.php new file mode 100644 index 00000000000..268e7078e35 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetProductCountChangeModel.php @@ -0,0 +1,165 @@ +change = $change; + $this->previousValue = $previousValue; + $this->nextValue = $nextValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Update action for setProductCount

    + * + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + * + * @return null|int + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = (int) $data; + } + + return $this->previousValue; + } + + /** + * + * @return null|int + */ + public function getNextValue() + { + if (is_null($this->nextValue)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_NEXT_VALUE); + if (is_null($data)) { + return null; + } + $this->nextValue = (int) $data; + } + + return $this->nextValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?int $previousValue + */ + public function setPreviousValue(?int $previousValue): void + { + $this->previousValue = $previousValue; + } + + /** + * @param ?int $nextValue + */ + public function setNextValue(?int $nextValue): void + { + $this->nextValue = $nextValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Change/SetProductPriceCustomFieldChange.php b/lib/commercetools-history/src/Models/Change/SetProductPriceCustomFieldChange.php index d1193abe931..335f2c5cbf0 100644 --- a/lib/commercetools-history/src/Models/Change/SetProductPriceCustomFieldChange.php +++ b/lib/commercetools-history/src/Models/Change/SetProductPriceCustomFieldChange.php @@ -20,6 +20,7 @@ interface SetProductPriceCustomFieldChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update action for setProductPriceCustomField

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|CustomFields */ public function getPreviousValue(); /** + * @return null|CustomFields */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetProductPriceCustomFieldChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetProductPriceCustomFieldChangeBuilder.php index ec2a054eeb6..0c2cd6b7fb6 100644 --- a/lib/commercetools-history/src/Models/Change/SetProductPriceCustomFieldChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetProductPriceCustomFieldChangeBuilder.php @@ -23,21 +23,25 @@ final class SetProductPriceCustomFieldChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $previousValue; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $nextValue; @@ -45,6 +49,7 @@ final class SetProductPriceCustomFieldChangeBuilder implements Builder /** *

    Update action for setProductPriceCustomField

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -61,6 +67,7 @@ public function getCatalogData() } /** + * @return null|CustomFields */ public function getPreviousValue() @@ -69,6 +76,7 @@ public function getPreviousValue() } /** + * @return null|CustomFields */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetProductPriceCustomFieldChangeModel.php b/lib/commercetools-history/src/Models/Change/SetProductPriceCustomFieldChangeModel.php index 9b2d9185b27..664bfc6a4c9 100644 --- a/lib/commercetools-history/src/Models/Change/SetProductPriceCustomFieldChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetProductPriceCustomFieldChangeModel.php @@ -24,26 +24,31 @@ final class SetProductPriceCustomFieldChangeModel extends JsonObjectModel implem public const DISCRIMINATOR_VALUE = 'SetProductPriceCustomFieldChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?CustomFields */ protected $previousValue; /** + * * @var ?CustomFields */ protected $nextValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $catalogData = null, ?CustomFields $previousValue = null, - ?CustomFields $nextValue = null + ?CustomFields $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for setProductPriceCustomField

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -119,6 +128,7 @@ public function getCatalogData() } /** + * * @return null|CustomFields */ public function getPreviousValue() @@ -137,6 +147,7 @@ public function getPreviousValue() } /** + * * @return null|CustomFields */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetProductPriceCustomTypeChange.php b/lib/commercetools-history/src/Models/Change/SetProductPriceCustomTypeChange.php index 744b125c019..576844d42e0 100644 --- a/lib/commercetools-history/src/Models/Change/SetProductPriceCustomTypeChange.php +++ b/lib/commercetools-history/src/Models/Change/SetProductPriceCustomTypeChange.php @@ -20,6 +20,7 @@ interface SetProductPriceCustomTypeChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update action for setProductPriceCustomType

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|CustomFields */ public function getPreviousValue(); /** + * @return null|CustomFields */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetProductPriceCustomTypeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetProductPriceCustomTypeChangeBuilder.php index e20cd167264..d7b4ee91913 100644 --- a/lib/commercetools-history/src/Models/Change/SetProductPriceCustomTypeChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetProductPriceCustomTypeChangeBuilder.php @@ -23,21 +23,25 @@ final class SetProductPriceCustomTypeChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $previousValue; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $nextValue; @@ -45,6 +49,7 @@ final class SetProductPriceCustomTypeChangeBuilder implements Builder /** *

    Update action for setProductPriceCustomType

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -61,6 +67,7 @@ public function getCatalogData() } /** + * @return null|CustomFields */ public function getPreviousValue() @@ -69,6 +76,7 @@ public function getPreviousValue() } /** + * @return null|CustomFields */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetProductPriceCustomTypeChangeModel.php b/lib/commercetools-history/src/Models/Change/SetProductPriceCustomTypeChangeModel.php index 8e6fd3ef5ed..6b882e10a03 100644 --- a/lib/commercetools-history/src/Models/Change/SetProductPriceCustomTypeChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetProductPriceCustomTypeChangeModel.php @@ -24,26 +24,31 @@ final class SetProductPriceCustomTypeChangeModel extends JsonObjectModel impleme public const DISCRIMINATOR_VALUE = 'SetProductPriceCustomTypeChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?CustomFields */ protected $previousValue; /** + * * @var ?CustomFields */ protected $nextValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $catalogData = null, ?CustomFields $previousValue = null, - ?CustomFields $nextValue = null + ?CustomFields $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for setProductPriceCustomType

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -119,6 +128,7 @@ public function getCatalogData() } /** + * * @return null|CustomFields */ public function getPreviousValue() @@ -137,6 +147,7 @@ public function getPreviousValue() } /** + * * @return null|CustomFields */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetProductSelectionsChange.php b/lib/commercetools-history/src/Models/Change/SetProductSelectionsChange.php new file mode 100644 index 00000000000..287c8d9ee1a --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetProductSelectionsChange.php @@ -0,0 +1,61 @@ +Update action for setProductSelections

    + * + + * @return null|string + */ + public function getChange(); + + /** + + * @return null|ProductSelectionSettingCollection + */ + public function getPreviousValue(); + + /** + + * @return null|ProductSelectionSettingCollection + */ + public function getNextValue(); + + /** + * @param ?string $change + */ + public function setChange(?string $change): void; + + /** + * @param ?ProductSelectionSettingCollection $previousValue + */ + public function setPreviousValue(?ProductSelectionSettingCollection $previousValue): void; + + /** + * @param ?ProductSelectionSettingCollection $nextValue + */ + public function setNextValue(?ProductSelectionSettingCollection $nextValue): void; +} diff --git a/lib/commercetools-history/src/Models/Change/SetProductSelectionsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetProductSelectionsChangeBuilder.php new file mode 100644 index 00000000000..044d9e8eecc --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetProductSelectionsChangeBuilder.php @@ -0,0 +1,118 @@ + + */ +final class SetProductSelectionsChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var ?ProductSelectionSettingCollection + */ + private $previousValue; + + /** + + * @var ?ProductSelectionSettingCollection + */ + private $nextValue; + + /** + *

    Update action for setProductSelections

    + * + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + + * @return null|ProductSelectionSettingCollection + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + + * @return null|ProductSelectionSettingCollection + */ + public function getNextValue() + { + return $this->nextValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?ProductSelectionSettingCollection $previousValue + * @return $this + */ + public function withPreviousValue(?ProductSelectionSettingCollection $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @param ?ProductSelectionSettingCollection $nextValue + * @return $this + */ + public function withNextValue(?ProductSelectionSettingCollection $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + + public function build(): SetProductSelectionsChange + { + return new SetProductSelectionsChangeModel( + $this->change, + $this->previousValue, + $this->nextValue + ); + } + + public static function of(): SetProductSelectionsChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetProductSelectionsChangeCollection.php b/lib/commercetools-history/src/Models/Change/SetProductSelectionsChangeCollection.php new file mode 100644 index 00000000000..c7903d2db3e --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetProductSelectionsChangeCollection.php @@ -0,0 +1,56 @@ + + * @method SetProductSelectionsChange current() + * @method SetProductSelectionsChange end() + * @method SetProductSelectionsChange at($offset) + */ +class SetProductSelectionsChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert SetProductSelectionsChange $value + * @psalm-param SetProductSelectionsChange|stdClass $value + * @throws InvalidArgumentException + * + * @return SetProductSelectionsChangeCollection + */ + public function add($value) + { + if (!$value instanceof SetProductSelectionsChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?SetProductSelectionsChange + */ + protected function mapper() + { + return function (?int $index): ?SetProductSelectionsChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var SetProductSelectionsChange $data */ + $data = SetProductSelectionsChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetProductSelectionsChangeModel.php b/lib/commercetools-history/src/Models/Change/SetProductSelectionsChangeModel.php new file mode 100644 index 00000000000..511b353364d --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetProductSelectionsChangeModel.php @@ -0,0 +1,166 @@ +change = $change; + $this->previousValue = $previousValue; + $this->nextValue = $nextValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Update action for setProductSelections

    + * + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + * + * @return null|ProductSelectionSettingCollection + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = ProductSelectionSettingCollection::fromArray($data); + } + + return $this->previousValue; + } + + /** + * + * @return null|ProductSelectionSettingCollection + */ + public function getNextValue() + { + if (is_null($this->nextValue)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_NEXT_VALUE); + if (is_null($data)) { + return null; + } + $this->nextValue = ProductSelectionSettingCollection::fromArray($data); + } + + return $this->nextValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?ProductSelectionSettingCollection $previousValue + */ + public function setPreviousValue(?ProductSelectionSettingCollection $previousValue): void + { + $this->previousValue = $previousValue; + } + + /** + * @param ?ProductSelectionSettingCollection $nextValue + */ + public function setNextValue(?ProductSelectionSettingCollection $nextValue): void + { + $this->nextValue = $nextValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Change/SetProductVariantKeyChange.php b/lib/commercetools-history/src/Models/Change/SetProductVariantKeyChange.php index 8e3489d3e26..d046785e767 100644 --- a/lib/commercetools-history/src/Models/Change/SetProductVariantKeyChange.php +++ b/lib/commercetools-history/src/Models/Change/SetProductVariantKeyChange.php @@ -19,6 +19,7 @@ interface SetProductVariantKeyChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,21 +27,25 @@ public function getType(); /** *

    Update action for setProductVariantKey

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetProductVariantKeyChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetProductVariantKeyChangeBuilder.php index 5f67cb23794..b15c3827d87 100644 --- a/lib/commercetools-history/src/Models/Change/SetProductVariantKeyChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetProductVariantKeyChangeBuilder.php @@ -21,21 +21,25 @@ final class SetProductVariantKeyChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -43,6 +47,7 @@ final class SetProductVariantKeyChangeBuilder implements Builder /** *

    Update action for setProductVariantKey

    * + * @return null|string */ public function getChange() @@ -51,6 +56,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -59,6 +65,7 @@ public function getCatalogData() } /** + * @return null|string */ public function getPreviousValue() @@ -67,6 +74,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetProductVariantKeyChangeModel.php b/lib/commercetools-history/src/Models/Change/SetProductVariantKeyChangeModel.php index 3bb6f91b9c0..0494f4ee2e1 100644 --- a/lib/commercetools-history/src/Models/Change/SetProductVariantKeyChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetProductVariantKeyChangeModel.php @@ -22,26 +22,31 @@ final class SetProductVariantKeyChangeModel extends JsonObjectModel implements S public const DISCRIMINATOR_VALUE = 'SetProductVariantKeyChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -54,16 +59,18 @@ public function __construct( ?string $change = null, ?string $catalogData = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -83,6 +90,7 @@ public function getType() /** *

    Update action for setProductVariantKey

    * + * * @return null|string */ public function getChange() @@ -100,6 +108,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -117,6 +126,7 @@ public function getCatalogData() } /** + * * @return null|string */ public function getPreviousValue() @@ -134,6 +144,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetPropertyChange.php b/lib/commercetools-history/src/Models/Change/SetPropertyChange.php index eab418ea19a..e2050c6836f 100644 --- a/lib/commercetools-history/src/Models/Change/SetPropertyChange.php +++ b/lib/commercetools-history/src/Models/Change/SetPropertyChange.php @@ -19,6 +19,7 @@ interface SetPropertyChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,6 +27,7 @@ public function getType(); /** *

    Update action for setProperty on custom objects

    * + * @return null|string */ public function getChange(); @@ -33,16 +35,19 @@ public function getChange(); /** *

    Value path to the property that was changed

    * + * @return null|string */ public function getPath(); /** + * @return null|mixed */ public function getNextValue(); /** + * @return null|mixed */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetPropertyChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetPropertyChangeBuilder.php index 0937ffb27cc..96ee888f424 100644 --- a/lib/commercetools-history/src/Models/Change/SetPropertyChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetPropertyChangeBuilder.php @@ -21,21 +21,25 @@ final class SetPropertyChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $path; /** + * @var null|mixed|mixed */ private $nextValue; /** + * @var null|mixed|mixed */ private $previousValue; @@ -43,6 +47,7 @@ final class SetPropertyChangeBuilder implements Builder /** *

    Update action for setProperty on custom objects

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() /** *

    Value path to the property that was changed

    * + * @return null|string */ public function getPath() @@ -61,6 +67,7 @@ public function getPath() } /** + * @return null|mixed */ public function getNextValue() @@ -69,6 +76,7 @@ public function getNextValue() } /** + * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetPropertyChangeModel.php b/lib/commercetools-history/src/Models/Change/SetPropertyChangeModel.php index 30e0b9b4c1e..744690bafb3 100644 --- a/lib/commercetools-history/src/Models/Change/SetPropertyChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetPropertyChangeModel.php @@ -22,26 +22,31 @@ final class SetPropertyChangeModel extends JsonObjectModel implements SetPropert public const DISCRIMINATOR_VALUE = 'SetPropertyChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $path; /** + * * @var ?mixed */ protected $nextValue; /** + * * @var ?mixed */ protected $previousValue; @@ -54,16 +59,18 @@ public function __construct( ?string $change = null, ?string $path = null, $nextValue = null, - $previousValue = null + $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->path = $path; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -83,6 +90,7 @@ public function getType() /** *

    Update action for setProperty on custom objects

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() /** *

    Value path to the property that was changed

    * + * * @return null|string */ public function getPath() @@ -119,6 +128,7 @@ public function getPath() } /** + * * @return null|mixed */ public function getNextValue() @@ -136,6 +146,7 @@ public function getNextValue() } /** + * * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetRatingChange.php b/lib/commercetools-history/src/Models/Change/SetRatingChange.php index bcb04b3ea84..109c4cf1594 100644 --- a/lib/commercetools-history/src/Models/Change/SetRatingChange.php +++ b/lib/commercetools-history/src/Models/Change/SetRatingChange.php @@ -18,6 +18,7 @@ interface SetRatingChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setRating

    * + * @return null|string */ public function getChange(); /** + * @return null|int */ public function getPreviousValue(); /** + * @return null|int */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetRatingChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetRatingChangeBuilder.php index 05d633ccbe0..9a11dc7b0bf 100644 --- a/lib/commercetools-history/src/Models/Change/SetRatingChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetRatingChangeBuilder.php @@ -21,16 +21,19 @@ final class SetRatingChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?int */ private $previousValue; /** + * @var ?int */ private $nextValue; @@ -38,6 +41,7 @@ final class SetRatingChangeBuilder implements Builder /** *

    Shape of the action for setRating

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|int */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|int */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetRatingChangeModel.php b/lib/commercetools-history/src/Models/Change/SetRatingChangeModel.php index 2e6d20c88ed..036414fdf1e 100644 --- a/lib/commercetools-history/src/Models/Change/SetRatingChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetRatingChangeModel.php @@ -22,21 +22,25 @@ final class SetRatingChangeModel extends JsonObjectModel implements SetRatingCha public const DISCRIMINATOR_VALUE = 'SetRatingChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?int */ protected $previousValue; /** + * * @var ?int */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetRatingChangeModel extends JsonObjectModel implements SetRatingCha public function __construct( ?string $change = null, ?int $previousValue = null, - ?int $nextValue = null + ?int $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setRating

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|int */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|int */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetReservationsChange.php b/lib/commercetools-history/src/Models/Change/SetReservationsChange.php index 6cbd2376cfb..84cf68b0a54 100644 --- a/lib/commercetools-history/src/Models/Change/SetReservationsChange.php +++ b/lib/commercetools-history/src/Models/Change/SetReservationsChange.php @@ -21,21 +21,25 @@ interface SetReservationsChange extends Change /** *

    Update action for setReservations on inventories

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getType(); /** + * @return null|ReservationCollection */ public function getNextValue(); /** + * @return null|ReservationCollection */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetReservationsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetReservationsChangeBuilder.php index 5c1db832dbe..0b031b6827e 100644 --- a/lib/commercetools-history/src/Models/Change/SetReservationsChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetReservationsChangeBuilder.php @@ -22,16 +22,19 @@ final class SetReservationsChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?ReservationCollection */ private $nextValue; /** + * @var ?ReservationCollection */ private $previousValue; @@ -39,6 +42,7 @@ final class SetReservationsChangeBuilder implements Builder /** *

    Update action for setReservations on inventories

    * + * @return null|string */ public function getChange() @@ -47,6 +51,7 @@ public function getChange() } /** + * @return null|ReservationCollection */ public function getNextValue() @@ -55,6 +60,7 @@ public function getNextValue() } /** + * @return null|ReservationCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetReservationsChangeModel.php b/lib/commercetools-history/src/Models/Change/SetReservationsChangeModel.php index 5a305dde883..a6e825b3019 100644 --- a/lib/commercetools-history/src/Models/Change/SetReservationsChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetReservationsChangeModel.php @@ -23,21 +23,25 @@ final class SetReservationsChangeModel extends JsonObjectModel implements SetRes public const DISCRIMINATOR_VALUE = 'SetReservationsChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ReservationCollection */ protected $nextValue; /** + * * @var ?ReservationCollection */ protected $previousValue; @@ -49,15 +53,17 @@ final class SetReservationsChangeModel extends JsonObjectModel implements SetRes public function __construct( ?string $change = null, ?ReservationCollection $nextValue = null, - ?ReservationCollection $previousValue = null + ?ReservationCollection $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -77,6 +83,7 @@ public function getType() /** *

    Update action for setReservations on inventories

    * + * * @return null|string */ public function getChange() @@ -94,6 +101,7 @@ public function getChange() } /** + * * @return null|ReservationCollection */ public function getNextValue() @@ -111,6 +119,7 @@ public function getNextValue() } /** + * * @return null|ReservationCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetRestockableInDaysChange.php b/lib/commercetools-history/src/Models/Change/SetRestockableInDaysChange.php index a37da2fa8c1..6185d63f31c 100644 --- a/lib/commercetools-history/src/Models/Change/SetRestockableInDaysChange.php +++ b/lib/commercetools-history/src/Models/Change/SetRestockableInDaysChange.php @@ -18,6 +18,7 @@ interface SetRestockableInDaysChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setRestockableInDays

    * + * @return null|string */ public function getChange(); /** + * @return null|int */ public function getPreviousValue(); /** + * @return null|int */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetRestockableInDaysChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetRestockableInDaysChangeBuilder.php index 97ecf5180b5..be2d58f37be 100644 --- a/lib/commercetools-history/src/Models/Change/SetRestockableInDaysChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetRestockableInDaysChangeBuilder.php @@ -21,16 +21,19 @@ final class SetRestockableInDaysChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?int */ private $previousValue; /** + * @var ?int */ private $nextValue; @@ -38,6 +41,7 @@ final class SetRestockableInDaysChangeBuilder implements Builder /** *

    Shape of the action for setRestockableInDays

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|int */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|int */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetRestockableInDaysChangeModel.php b/lib/commercetools-history/src/Models/Change/SetRestockableInDaysChangeModel.php index 596efc02259..f239d8b0a6e 100644 --- a/lib/commercetools-history/src/Models/Change/SetRestockableInDaysChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetRestockableInDaysChangeModel.php @@ -22,21 +22,25 @@ final class SetRestockableInDaysChangeModel extends JsonObjectModel implements S public const DISCRIMINATOR_VALUE = 'SetRestockableInDaysChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?int */ protected $previousValue; /** + * * @var ?int */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetRestockableInDaysChangeModel extends JsonObjectModel implements S public function __construct( ?string $change = null, ?int $previousValue = null, - ?int $nextValue = null + ?int $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setRestockableInDays

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|int */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|int */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetReturnPaymentStateChange.php b/lib/commercetools-history/src/Models/Change/SetReturnPaymentStateChange.php index d7599955002..1020fa38dbe 100644 --- a/lib/commercetools-history/src/Models/Change/SetReturnPaymentStateChange.php +++ b/lib/commercetools-history/src/Models/Change/SetReturnPaymentStateChange.php @@ -18,6 +18,7 @@ interface SetReturnPaymentStateChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Update action for setReturnPaymentState

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getNextValue(); /** + * @return null|string */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetReturnPaymentStateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetReturnPaymentStateChangeBuilder.php index 1a8ac8f71a6..85400fa8bf1 100644 --- a/lib/commercetools-history/src/Models/Change/SetReturnPaymentStateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetReturnPaymentStateChangeBuilder.php @@ -21,16 +21,19 @@ final class SetReturnPaymentStateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $nextValue; /** + * @var ?string */ private $previousValue; @@ -38,6 +41,7 @@ final class SetReturnPaymentStateChangeBuilder implements Builder /** *

    Update action for setReturnPaymentState

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getNextValue() @@ -54,6 +59,7 @@ public function getNextValue() } /** + * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetReturnPaymentStateChangeModel.php b/lib/commercetools-history/src/Models/Change/SetReturnPaymentStateChangeModel.php index a744a6fdfd5..aa24bbbc8e0 100644 --- a/lib/commercetools-history/src/Models/Change/SetReturnPaymentStateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetReturnPaymentStateChangeModel.php @@ -22,21 +22,25 @@ final class SetReturnPaymentStateChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'SetReturnPaymentStateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $nextValue; /** + * * @var ?string */ protected $previousValue; @@ -48,15 +52,17 @@ final class SetReturnPaymentStateChangeModel extends JsonObjectModel implements public function __construct( ?string $change = null, ?string $nextValue = null, - ?string $previousValue = null + ?string $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Update action for setReturnPaymentState

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getNextValue() @@ -110,6 +118,7 @@ public function getNextValue() } /** + * * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetReturnShipmentStateChange.php b/lib/commercetools-history/src/Models/Change/SetReturnShipmentStateChange.php index d456483507e..b0f984a56ad 100644 --- a/lib/commercetools-history/src/Models/Change/SetReturnShipmentStateChange.php +++ b/lib/commercetools-history/src/Models/Change/SetReturnShipmentStateChange.php @@ -18,6 +18,7 @@ interface SetReturnShipmentStateChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Update action for setReturnShipmentState

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getNextValue(); /** + * @return null|string */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetReturnShipmentStateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetReturnShipmentStateChangeBuilder.php index 6438ce9741a..55e59b5e2f8 100644 --- a/lib/commercetools-history/src/Models/Change/SetReturnShipmentStateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetReturnShipmentStateChangeBuilder.php @@ -21,16 +21,19 @@ final class SetReturnShipmentStateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $nextValue; /** + * @var ?string */ private $previousValue; @@ -38,6 +41,7 @@ final class SetReturnShipmentStateChangeBuilder implements Builder /** *

    Update action for setReturnShipmentState

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getNextValue() @@ -54,6 +59,7 @@ public function getNextValue() } /** + * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetReturnShipmentStateChangeModel.php b/lib/commercetools-history/src/Models/Change/SetReturnShipmentStateChangeModel.php index 1ac84db171e..9031819085d 100644 --- a/lib/commercetools-history/src/Models/Change/SetReturnShipmentStateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetReturnShipmentStateChangeModel.php @@ -22,21 +22,25 @@ final class SetReturnShipmentStateChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'SetReturnShipmentStateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $nextValue; /** + * * @var ?string */ protected $previousValue; @@ -48,15 +52,17 @@ final class SetReturnShipmentStateChangeModel extends JsonObjectModel implements public function __construct( ?string $change = null, ?string $nextValue = null, - ?string $previousValue = null + ?string $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Update action for setReturnShipmentState

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getNextValue() @@ -110,6 +118,7 @@ public function getNextValue() } /** + * * @return null|string */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetSalutationChange.php b/lib/commercetools-history/src/Models/Change/SetSalutationChange.php index 065e5134c7c..9bda2632f18 100644 --- a/lib/commercetools-history/src/Models/Change/SetSalutationChange.php +++ b/lib/commercetools-history/src/Models/Change/SetSalutationChange.php @@ -18,6 +18,7 @@ interface SetSalutationChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setSalutation

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetSalutationChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetSalutationChangeBuilder.php index 4efb0132221..ed2bce84af8 100644 --- a/lib/commercetools-history/src/Models/Change/SetSalutationChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetSalutationChangeBuilder.php @@ -21,16 +21,19 @@ final class SetSalutationChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetSalutationChangeBuilder implements Builder /** *

    Shape of the action for setSalutation

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetSalutationChangeModel.php b/lib/commercetools-history/src/Models/Change/SetSalutationChangeModel.php index 1ad83f72bb8..0646bf7728d 100644 --- a/lib/commercetools-history/src/Models/Change/SetSalutationChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetSalutationChangeModel.php @@ -22,21 +22,25 @@ final class SetSalutationChangeModel extends JsonObjectModel implements SetSalut public const DISCRIMINATOR_VALUE = 'SetSalutationChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetSalutationChangeModel extends JsonObjectModel implements SetSalut public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setSalutation

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetSearchKeywordsChange.php b/lib/commercetools-history/src/Models/Change/SetSearchKeywordsChange.php index a8c96987e8f..0e489fca9f1 100644 --- a/lib/commercetools-history/src/Models/Change/SetSearchKeywordsChange.php +++ b/lib/commercetools-history/src/Models/Change/SetSearchKeywordsChange.php @@ -20,6 +20,7 @@ interface SetSearchKeywordsChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update action for setSearchKeywords

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|SearchKeywords */ public function getPreviousValue(); /** + * @return null|SearchKeywords */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetSearchKeywordsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetSearchKeywordsChangeBuilder.php index 852778492ce..48181c88fa5 100644 --- a/lib/commercetools-history/src/Models/Change/SetSearchKeywordsChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetSearchKeywordsChangeBuilder.php @@ -23,21 +23,25 @@ final class SetSearchKeywordsChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var null|SearchKeywords|SearchKeywordsBuilder */ private $previousValue; /** + * @var null|SearchKeywords|SearchKeywordsBuilder */ private $nextValue; @@ -45,6 +49,7 @@ final class SetSearchKeywordsChangeBuilder implements Builder /** *

    Update action for setSearchKeywords

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -61,6 +67,7 @@ public function getCatalogData() } /** + * @return null|SearchKeywords */ public function getPreviousValue() @@ -69,6 +76,7 @@ public function getPreviousValue() } /** + * @return null|SearchKeywords */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetSearchKeywordsChangeModel.php b/lib/commercetools-history/src/Models/Change/SetSearchKeywordsChangeModel.php index 5eb57cd78a2..f484d25c376 100644 --- a/lib/commercetools-history/src/Models/Change/SetSearchKeywordsChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetSearchKeywordsChangeModel.php @@ -24,26 +24,31 @@ final class SetSearchKeywordsChangeModel extends JsonObjectModel implements SetS public const DISCRIMINATOR_VALUE = 'SetSearchKeywordsChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?SearchKeywords */ protected $previousValue; /** + * * @var ?SearchKeywords */ protected $nextValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $catalogData = null, ?SearchKeywords $previousValue = null, - ?SearchKeywords $nextValue = null + ?SearchKeywords $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for setSearchKeywords

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -119,6 +128,7 @@ public function getCatalogData() } /** + * * @return null|SearchKeywords */ public function getPreviousValue() @@ -137,6 +147,7 @@ public function getPreviousValue() } /** + * * @return null|SearchKeywords */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetSellerCommentChange.php b/lib/commercetools-history/src/Models/Change/SetSellerCommentChange.php new file mode 100644 index 00000000000..0259f510076 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetSellerCommentChange.php @@ -0,0 +1,60 @@ +Shape of the action for setSellerComment

    + * + + * @return null|string + */ + public function getChange(); + + /** + + * @return null|string + */ + public function getPreviousValue(); + + /** + + * @return null|string + */ + public function getNextValue(); + + /** + * @param ?string $change + */ + public function setChange(?string $change): void; + + /** + * @param ?string $previousValue + */ + public function setPreviousValue(?string $previousValue): void; + + /** + * @param ?string $nextValue + */ + public function setNextValue(?string $nextValue): void; +} diff --git a/lib/commercetools-history/src/Models/Change/SetSellerCommentChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetSellerCommentChangeBuilder.php new file mode 100644 index 00000000000..bc948b10205 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetSellerCommentChangeBuilder.php @@ -0,0 +1,117 @@ + + */ +final class SetSellerCommentChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var ?string + */ + private $previousValue; + + /** + + * @var ?string + */ + private $nextValue; + + /** + *

    Shape of the action for setSellerComment

    + * + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + + * @return null|string + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + + * @return null|string + */ + public function getNextValue() + { + return $this->nextValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?string $previousValue + * @return $this + */ + public function withPreviousValue(?string $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @param ?string $nextValue + * @return $this + */ + public function withNextValue(?string $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + + public function build(): SetSellerCommentChange + { + return new SetSellerCommentChangeModel( + $this->change, + $this->previousValue, + $this->nextValue + ); + } + + public static function of(): SetSellerCommentChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetSellerCommentChangeCollection.php b/lib/commercetools-history/src/Models/Change/SetSellerCommentChangeCollection.php new file mode 100644 index 00000000000..92a8b44ce9a --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetSellerCommentChangeCollection.php @@ -0,0 +1,56 @@ + + * @method SetSellerCommentChange current() + * @method SetSellerCommentChange end() + * @method SetSellerCommentChange at($offset) + */ +class SetSellerCommentChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert SetSellerCommentChange $value + * @psalm-param SetSellerCommentChange|stdClass $value + * @throws InvalidArgumentException + * + * @return SetSellerCommentChangeCollection + */ + public function add($value) + { + if (!$value instanceof SetSellerCommentChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?SetSellerCommentChange + */ + protected function mapper() + { + return function (?int $index): ?SetSellerCommentChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var SetSellerCommentChange $data */ + $data = SetSellerCommentChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetSellerCommentChangeModel.php b/lib/commercetools-history/src/Models/Change/SetSellerCommentChangeModel.php new file mode 100644 index 00000000000..b93d4f8dea8 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetSellerCommentChangeModel.php @@ -0,0 +1,165 @@ +change = $change; + $this->previousValue = $previousValue; + $this->nextValue = $nextValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Shape of the action for setSellerComment

    + * + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + * + * @return null|string + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = (string) $data; + } + + return $this->previousValue; + } + + /** + * + * @return null|string + */ + public function getNextValue() + { + if (is_null($this->nextValue)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NEXT_VALUE); + if (is_null($data)) { + return null; + } + $this->nextValue = (string) $data; + } + + return $this->nextValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?string $previousValue + */ + public function setPreviousValue(?string $previousValue): void + { + $this->previousValue = $previousValue; + } + + /** + * @param ?string $nextValue + */ + public function setNextValue(?string $nextValue): void + { + $this->nextValue = $nextValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Change/SetShippingAddressChange.php b/lib/commercetools-history/src/Models/Change/SetShippingAddressChange.php index 6660c70be8c..ae3ccc8288c 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingAddressChange.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingAddressChange.php @@ -19,6 +19,7 @@ interface SetShippingAddressChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for setShippingAddress

    * + * @return null|string */ public function getChange(); /** + * @return null|Address */ public function getNextValue(); /** + * @return null|Address */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetShippingAddressChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetShippingAddressChangeBuilder.php index 4f920d1fbee..bc48153182f 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingAddressChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingAddressChangeBuilder.php @@ -23,16 +23,19 @@ final class SetShippingAddressChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Address|AddressBuilder */ private $nextValue; /** + * @var null|Address|AddressBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class SetShippingAddressChangeBuilder implements Builder /** *

    Update action for setShippingAddress

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Address */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShippingAddressChangeModel.php b/lib/commercetools-history/src/Models/Change/SetShippingAddressChangeModel.php index 658137a99b5..ed9c04473dc 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingAddressChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingAddressChangeModel.php @@ -24,21 +24,25 @@ final class SetShippingAddressChangeModel extends JsonObjectModel implements Set public const DISCRIMINATOR_VALUE = 'SetShippingAddressChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Address */ protected $nextValue; /** + * * @var ?Address */ protected $previousValue; @@ -50,15 +54,17 @@ final class SetShippingAddressChangeModel extends JsonObjectModel implements Set public function __construct( ?string $change = null, ?Address $nextValue = null, - ?Address $previousValue = null + ?Address $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for setShippingAddress

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Address */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|Address */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShippingInfoPriceChange.php b/lib/commercetools-history/src/Models/Change/SetShippingInfoPriceChange.php index c1afc87b990..8bcce431ab8 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingInfoPriceChange.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingInfoPriceChange.php @@ -19,6 +19,7 @@ interface SetShippingInfoPriceChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for setShippingInfoPrice

    * + * @return null|string */ public function getChange(); /** + * @return null|Money */ public function getNextValue(); /** + * @return null|Money */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetShippingInfoPriceChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetShippingInfoPriceChangeBuilder.php index 26dc0e68dbb..444ed6669b3 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingInfoPriceChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingInfoPriceChangeBuilder.php @@ -23,16 +23,19 @@ final class SetShippingInfoPriceChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Money|MoneyBuilder */ private $nextValue; /** + * @var null|Money|MoneyBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class SetShippingInfoPriceChangeBuilder implements Builder /** *

    Update action for setShippingInfoPrice

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Money */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|Money */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShippingInfoPriceChangeModel.php b/lib/commercetools-history/src/Models/Change/SetShippingInfoPriceChangeModel.php index 53bd99cef55..36ccce9092b 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingInfoPriceChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingInfoPriceChangeModel.php @@ -24,21 +24,25 @@ final class SetShippingInfoPriceChangeModel extends JsonObjectModel implements S public const DISCRIMINATOR_VALUE = 'SetShippingInfoPriceChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Money */ protected $nextValue; /** + * * @var ?Money */ protected $previousValue; @@ -50,15 +54,17 @@ final class SetShippingInfoPriceChangeModel extends JsonObjectModel implements S public function __construct( ?string $change = null, ?Money $nextValue = null, - ?Money $previousValue = null + ?Money $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for setShippingInfoPrice

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Money */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|Money */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShippingInfoTaxedPriceChange.php b/lib/commercetools-history/src/Models/Change/SetShippingInfoTaxedPriceChange.php index 5780a97244b..217115c7028 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingInfoTaxedPriceChange.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingInfoTaxedPriceChange.php @@ -19,6 +19,7 @@ interface SetShippingInfoTaxedPriceChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for setShippingInfoTaxedPrice

    * + * @return null|string */ public function getChange(); /** + * @return null|TaxedPrice */ public function getNextValue(); /** + * @return null|TaxedPrice */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetShippingInfoTaxedPriceChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetShippingInfoTaxedPriceChangeBuilder.php index 6c719c9da84..258971213bd 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingInfoTaxedPriceChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingInfoTaxedPriceChangeBuilder.php @@ -23,16 +23,19 @@ final class SetShippingInfoTaxedPriceChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|TaxedPrice|TaxedPriceBuilder */ private $nextValue; /** + * @var null|TaxedPrice|TaxedPriceBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class SetShippingInfoTaxedPriceChangeBuilder implements Builder /** *

    Update action for setShippingInfoTaxedPrice

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|TaxedPrice */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|TaxedPrice */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShippingInfoTaxedPriceChangeModel.php b/lib/commercetools-history/src/Models/Change/SetShippingInfoTaxedPriceChangeModel.php index 4ea33e790ed..ae5819235e9 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingInfoTaxedPriceChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingInfoTaxedPriceChangeModel.php @@ -24,21 +24,25 @@ final class SetShippingInfoTaxedPriceChangeModel extends JsonObjectModel impleme public const DISCRIMINATOR_VALUE = 'SetShippingInfoTaxedPriceChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?TaxedPrice */ protected $nextValue; /** + * * @var ?TaxedPrice */ protected $previousValue; @@ -50,15 +54,17 @@ final class SetShippingInfoTaxedPriceChangeModel extends JsonObjectModel impleme public function __construct( ?string $change = null, ?TaxedPrice $nextValue = null, - ?TaxedPrice $previousValue = null + ?TaxedPrice $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for setShippingInfoTaxedPrice

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|TaxedPrice */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|TaxedPrice */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShippingMethodChange.php b/lib/commercetools-history/src/Models/Change/SetShippingMethodChange.php index 872b3d25193..f22c1f57b11 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingMethodChange.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingMethodChange.php @@ -19,6 +19,7 @@ interface SetShippingMethodChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for setShippingMethod

    * + * @return null|string */ public function getChange(); /** + * @return null|ShippingMethodChangeValue */ public function getNextValue(); /** + * @return null|ShippingMethodChangeValue */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetShippingMethodChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetShippingMethodChangeBuilder.php index 9d3ba6d085a..40da85717d5 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingMethodChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingMethodChangeBuilder.php @@ -23,16 +23,19 @@ final class SetShippingMethodChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|ShippingMethodChangeValue|ShippingMethodChangeValueBuilder */ private $nextValue; /** + * @var null|ShippingMethodChangeValue|ShippingMethodChangeValueBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class SetShippingMethodChangeBuilder implements Builder /** *

    Update action for setShippingMethod

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|ShippingMethodChangeValue */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|ShippingMethodChangeValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShippingMethodChangeModel.php b/lib/commercetools-history/src/Models/Change/SetShippingMethodChangeModel.php index a1042b54dcb..51311105b26 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingMethodChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingMethodChangeModel.php @@ -24,21 +24,25 @@ final class SetShippingMethodChangeModel extends JsonObjectModel implements SetS public const DISCRIMINATOR_VALUE = 'SetShippingMethodChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ShippingMethodChangeValue */ protected $nextValue; /** + * * @var ?ShippingMethodChangeValue */ protected $previousValue; @@ -50,15 +54,17 @@ final class SetShippingMethodChangeModel extends JsonObjectModel implements SetS public function __construct( ?string $change = null, ?ShippingMethodChangeValue $nextValue = null, - ?ShippingMethodChangeValue $previousValue = null + ?ShippingMethodChangeValue $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for setShippingMethod

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|ShippingMethodChangeValue */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|ShippingMethodChangeValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxAmountChange.php b/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxAmountChange.php index 34a297a33da..b8bbfb6b45b 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxAmountChange.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxAmountChange.php @@ -20,6 +20,7 @@ interface SetShippingMethodTaxAmountChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -27,21 +28,25 @@ public function getType(); /** *

    Update action for setShippingMethodTaxAmount

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getTaxMode(); /** + * @return null|ShippingMethodTaxAmountChangeValue */ public function getNextValue(); /** + * @return null|ShippingMethodTaxAmountChangeValue */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxAmountChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxAmountChangeBuilder.php index 4af302a5c8d..878b38cf1d5 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxAmountChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxAmountChangeBuilder.php @@ -23,21 +23,25 @@ final class SetShippingMethodTaxAmountChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $taxMode; /** + * @var null|ShippingMethodTaxAmountChangeValue|ShippingMethodTaxAmountChangeValueBuilder */ private $nextValue; /** + * @var null|ShippingMethodTaxAmountChangeValue|ShippingMethodTaxAmountChangeValueBuilder */ private $previousValue; @@ -45,6 +49,7 @@ final class SetShippingMethodTaxAmountChangeBuilder implements Builder /** *

    Update action for setShippingMethodTaxAmount

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|string */ public function getTaxMode() @@ -61,6 +67,7 @@ public function getTaxMode() } /** + * @return null|ShippingMethodTaxAmountChangeValue */ public function getNextValue() @@ -69,6 +76,7 @@ public function getNextValue() } /** + * @return null|ShippingMethodTaxAmountChangeValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxAmountChangeModel.php b/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxAmountChangeModel.php index e150bd341cc..feabcb966a2 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxAmountChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxAmountChangeModel.php @@ -24,26 +24,31 @@ final class SetShippingMethodTaxAmountChangeModel extends JsonObjectModel implem public const DISCRIMINATOR_VALUE = 'SetShippingMethodTaxAmountChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $taxMode; /** + * * @var ?ShippingMethodTaxAmountChangeValue */ protected $nextValue; /** + * * @var ?ShippingMethodTaxAmountChangeValue */ protected $previousValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $taxMode = null, ?ShippingMethodTaxAmountChangeValue $nextValue = null, - ?ShippingMethodTaxAmountChangeValue $previousValue = null + ?ShippingMethodTaxAmountChangeValue $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->taxMode = $taxMode; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for setShippingMethodTaxAmount

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|string */ public function getTaxMode() @@ -119,6 +128,7 @@ public function getTaxMode() } /** + * * @return null|ShippingMethodTaxAmountChangeValue */ public function getNextValue() @@ -137,6 +147,7 @@ public function getNextValue() } /** + * * @return null|ShippingMethodTaxAmountChangeValue */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxRateChange.php b/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxRateChange.php index a27798a8677..249c74588cb 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxRateChange.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxRateChange.php @@ -20,6 +20,7 @@ interface SetShippingMethodTaxRateChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -27,11 +28,13 @@ public function getType(); /** *

    Update action for setShippingMethodTaxRate

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getTaxMode(); @@ -39,6 +42,7 @@ public function getTaxMode(); /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getNextValue(); @@ -46,6 +50,7 @@ public function getNextValue(); /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxRateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxRateChangeBuilder.php index b68bee35eab..f9860e8cbbd 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxRateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxRateChangeBuilder.php @@ -23,21 +23,25 @@ final class SetShippingMethodTaxRateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $taxMode; /** + * @var null|TaxRate|TaxRateBuilder */ private $nextValue; /** + * @var null|TaxRate|TaxRateBuilder */ private $previousValue; @@ -45,6 +49,7 @@ final class SetShippingMethodTaxRateChangeBuilder implements Builder /** *

    Update action for setShippingMethodTaxRate

    * + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|string */ public function getTaxMode() @@ -63,6 +69,7 @@ public function getTaxMode() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getNextValue() @@ -73,6 +80,7 @@ public function getNextValue() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxRateChangeModel.php b/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxRateChangeModel.php index 60fa569e2ef..43c6079d73b 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxRateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingMethodTaxRateChangeModel.php @@ -24,26 +24,31 @@ final class SetShippingMethodTaxRateChangeModel extends JsonObjectModel implemen public const DISCRIMINATOR_VALUE = 'SetShippingMethodTaxRateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $taxMode; /** + * * @var ?TaxRate */ protected $nextValue; /** + * * @var ?TaxRate */ protected $previousValue; @@ -56,16 +61,18 @@ public function __construct( ?string $change = null, ?string $taxMode = null, ?TaxRate $nextValue = null, - ?TaxRate $previousValue = null + ?TaxRate $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->taxMode = $taxMode; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() /** *

    Update action for setShippingMethodTaxRate

    * + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|string */ public function getTaxMode() @@ -121,6 +130,7 @@ public function getTaxMode() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * * @return null|TaxRate */ public function getNextValue() @@ -141,6 +151,7 @@ public function getNextValue() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * * @return null|TaxRate */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShippingRateChange.php b/lib/commercetools-history/src/Models/Change/SetShippingRateChange.php index 221a0828aac..b15b06a8b9c 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingRateChange.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingRateChange.php @@ -19,6 +19,7 @@ interface SetShippingRateChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for setShippingRate

    * + * @return null|string */ public function getChange(); /** + * @return null|Money */ public function getNextValue(); /** + * @return null|Money */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetShippingRateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetShippingRateChangeBuilder.php index e7448ab3961..2f079764a4d 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingRateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingRateChangeBuilder.php @@ -23,16 +23,19 @@ final class SetShippingRateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Money|MoneyBuilder */ private $nextValue; /** + * @var null|Money|MoneyBuilder */ private $previousValue; @@ -40,6 +43,7 @@ final class SetShippingRateChangeBuilder implements Builder /** *

    Update action for setShippingRate

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Money */ public function getNextValue() @@ -56,6 +61,7 @@ public function getNextValue() } /** + * @return null|Money */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShippingRateChangeModel.php b/lib/commercetools-history/src/Models/Change/SetShippingRateChangeModel.php index 059fe72c8a4..1b3f3f59f4a 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingRateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingRateChangeModel.php @@ -24,21 +24,25 @@ final class SetShippingRateChangeModel extends JsonObjectModel implements SetShi public const DISCRIMINATOR_VALUE = 'SetShippingRateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Money */ protected $nextValue; /** + * * @var ?Money */ protected $previousValue; @@ -50,15 +54,17 @@ final class SetShippingRateChangeModel extends JsonObjectModel implements SetShi public function __construct( ?string $change = null, ?Money $nextValue = null, - ?Money $previousValue = null + ?Money $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for setShippingRate

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Money */ public function getNextValue() @@ -113,6 +121,7 @@ public function getNextValue() } /** + * * @return null|Money */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShippingRateInputChange.php b/lib/commercetools-history/src/Models/Change/SetShippingRateInputChange.php index 2aa15644161..f63a787d6cc 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingRateInputChange.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingRateInputChange.php @@ -20,6 +20,7 @@ interface SetShippingRateInputChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -27,16 +28,19 @@ public function getType(); /** *

    Update action for setShippingRateInput

    * + * @return null|string */ public function getChange(); /** + * @return null|mixed */ public function getNextValue(); /** + * @return null|mixed */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetShippingRateInputChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetShippingRateInputChangeBuilder.php index 559f84dc5ca..23b4e791fad 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingRateInputChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingRateInputChangeBuilder.php @@ -21,16 +21,19 @@ final class SetShippingRateInputChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?JsonObject */ private $nextValue; /** + * @var ?JsonObject */ private $previousValue; @@ -38,6 +41,7 @@ final class SetShippingRateInputChangeBuilder implements Builder /** *

    Update action for setShippingRateInput

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|JsonObject */ public function getNextValue() @@ -54,6 +59,7 @@ public function getNextValue() } /** + * @return null|JsonObject */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShippingRateInputChangeModel.php b/lib/commercetools-history/src/Models/Change/SetShippingRateInputChangeModel.php index e476fdf818b..f4ea9d7387c 100644 --- a/lib/commercetools-history/src/Models/Change/SetShippingRateInputChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetShippingRateInputChangeModel.php @@ -26,21 +26,25 @@ final class SetShippingRateInputChangeModel extends JsonObjectModel implements S public const DISCRIMINATOR_VALUE = 'SetShippingRateInputChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?mixed */ protected $nextValue; /** + * * @var ?mixed */ protected $previousValue; @@ -52,15 +56,17 @@ final class SetShippingRateInputChangeModel extends JsonObjectModel implements S public function __construct( ?string $change = null, ?JsonObject $nextValue = null, - ?JsonObject $previousValue = null + ?JsonObject $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -80,6 +86,7 @@ public function getType() /** *

    Update action for setShippingRateInput

    * + * * @return null|string */ public function getChange() @@ -97,6 +104,7 @@ public function getChange() } /** + * * @return ?mixed */ public function getNextValue() @@ -114,6 +122,7 @@ public function getNextValue() } /** + * * @return ?mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomFieldChange.php b/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomFieldChange.php index 6b135482ff7..025c337b8c4 100644 --- a/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomFieldChange.php +++ b/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomFieldChange.php @@ -22,6 +22,7 @@ interface SetShoppingListLineItemCustomFieldChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -29,31 +30,37 @@ public function getType(); /** *

    Update action for setLineItemCustomField

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getName(); /** + * @return null|string */ public function getCustomTypeId(); /** + * @return null|ShoppingListLineItemValue */ public function getLineItem(); /** + * @return null|mixed */ public function getNextValue(); /** + * @return null|mixed */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomFieldChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomFieldChangeBuilder.php index a25eddecf5d..ac0b7e0c84f 100644 --- a/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomFieldChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomFieldChangeBuilder.php @@ -23,31 +23,37 @@ final class SetShoppingListLineItemCustomFieldChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $name; /** + * @var ?string */ private $customTypeId; /** + * @var null|ShoppingListLineItemValue|ShoppingListLineItemValueBuilder */ private $lineItem; /** + * @var null|mixed|mixed */ private $nextValue; /** + * @var null|mixed|mixed */ private $previousValue; @@ -55,6 +61,7 @@ final class SetShoppingListLineItemCustomFieldChangeBuilder implements Builder /** *

    Update action for setLineItemCustomField

    * + * @return null|string */ public function getChange() @@ -63,6 +70,7 @@ public function getChange() } /** + * @return null|string */ public function getName() @@ -71,6 +79,7 @@ public function getName() } /** + * @return null|string */ public function getCustomTypeId() @@ -79,6 +88,7 @@ public function getCustomTypeId() } /** + * @return null|ShoppingListLineItemValue */ public function getLineItem() @@ -87,6 +97,7 @@ public function getLineItem() } /** + * @return null|mixed */ public function getNextValue() @@ -95,6 +106,7 @@ public function getNextValue() } /** + * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomFieldChangeModel.php b/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomFieldChangeModel.php index 21d59306787..c4d26835149 100644 --- a/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomFieldChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomFieldChangeModel.php @@ -24,36 +24,43 @@ final class SetShoppingListLineItemCustomFieldChangeModel extends JsonObjectMode public const DISCRIMINATOR_VALUE = 'SetShoppingListLineItemCustomFieldChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $customTypeId; /** + * * @var ?ShoppingListLineItemValue */ protected $lineItem; /** + * * @var ?mixed */ protected $nextValue; /** + * * @var ?mixed */ protected $previousValue; @@ -68,7 +75,8 @@ public function __construct( ?string $customTypeId = null, ?ShoppingListLineItemValue $lineItem = null, $nextValue = null, - $previousValue = null + $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->name = $name; @@ -76,10 +84,11 @@ public function __construct( $this->lineItem = $lineItem; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -99,6 +108,7 @@ public function getType() /** *

    Update action for setLineItemCustomField

    * + * * @return null|string */ public function getChange() @@ -116,6 +126,7 @@ public function getChange() } /** + * * @return null|string */ public function getName() @@ -133,6 +144,7 @@ public function getName() } /** + * * @return null|string */ public function getCustomTypeId() @@ -150,6 +162,7 @@ public function getCustomTypeId() } /** + * * @return null|ShoppingListLineItemValue */ public function getLineItem() @@ -168,6 +181,7 @@ public function getLineItem() } /** + * * @return null|mixed */ public function getNextValue() @@ -185,6 +199,7 @@ public function getNextValue() } /** + * * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomTypeChange.php b/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomTypeChange.php index 6ef298b237f..6545f0d2da8 100644 --- a/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomTypeChange.php +++ b/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomTypeChange.php @@ -21,6 +21,7 @@ interface SetShoppingListLineItemCustomTypeChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -28,21 +29,25 @@ public function getType(); /** *

    Update action for setLineItemCustomType

    * + * @return null|string */ public function getChange(); /** + * @return null|ShoppingListLineItemValue */ public function getLineItem(); /** + * @return null|CustomFields */ public function getNextValue(); /** + * @return null|CustomFields */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomTypeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomTypeChangeBuilder.php index 230d9298e06..5aad5850158 100644 --- a/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomTypeChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomTypeChangeBuilder.php @@ -25,21 +25,25 @@ final class SetShoppingListLineItemCustomTypeChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|ShoppingListLineItemValue|ShoppingListLineItemValueBuilder */ private $lineItem; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $nextValue; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $previousValue; @@ -47,6 +51,7 @@ final class SetShoppingListLineItemCustomTypeChangeBuilder implements Builder /** *

    Update action for setLineItemCustomType

    * + * @return null|string */ public function getChange() @@ -55,6 +60,7 @@ public function getChange() } /** + * @return null|ShoppingListLineItemValue */ public function getLineItem() @@ -63,6 +69,7 @@ public function getLineItem() } /** + * @return null|CustomFields */ public function getNextValue() @@ -71,6 +78,7 @@ public function getNextValue() } /** + * @return null|CustomFields */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomTypeChangeModel.php b/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomTypeChangeModel.php index 836942b8b9b..1f6b619ee95 100644 --- a/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomTypeChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetShoppingListLineItemCustomTypeChangeModel.php @@ -26,26 +26,31 @@ final class SetShoppingListLineItemCustomTypeChangeModel extends JsonObjectModel public const DISCRIMINATOR_VALUE = 'SetShoppingListLineItemCustomTypeChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ShoppingListLineItemValue */ protected $lineItem; /** + * * @var ?CustomFields */ protected $nextValue; /** + * * @var ?CustomFields */ protected $previousValue; @@ -58,16 +63,18 @@ public function __construct( ?string $change = null, ?ShoppingListLineItemValue $lineItem = null, ?CustomFields $nextValue = null, - ?CustomFields $previousValue = null + ?CustomFields $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->lineItem = $lineItem; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -87,6 +94,7 @@ public function getType() /** *

    Update action for setLineItemCustomType

    * + * * @return null|string */ public function getChange() @@ -104,6 +112,7 @@ public function getChange() } /** + * * @return null|ShoppingListLineItemValue */ public function getLineItem() @@ -122,6 +131,7 @@ public function getLineItem() } /** + * * @return null|CustomFields */ public function getNextValue() @@ -140,6 +150,7 @@ public function getNextValue() } /** + * * @return null|CustomFields */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetSkuChange.php b/lib/commercetools-history/src/Models/Change/SetSkuChange.php index 53a20b02fa8..c3fb167fb31 100644 --- a/lib/commercetools-history/src/Models/Change/SetSkuChange.php +++ b/lib/commercetools-history/src/Models/Change/SetSkuChange.php @@ -19,6 +19,7 @@ interface SetSkuChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,21 +27,25 @@ public function getType(); /** *

    Update action for setSku

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetSkuChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetSkuChangeBuilder.php index e600c9b68a0..7bce0abfea9 100644 --- a/lib/commercetools-history/src/Models/Change/SetSkuChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetSkuChangeBuilder.php @@ -21,21 +21,25 @@ final class SetSkuChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -43,6 +47,7 @@ final class SetSkuChangeBuilder implements Builder /** *

    Update action for setSku

    * + * @return null|string */ public function getChange() @@ -51,6 +56,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -59,6 +65,7 @@ public function getCatalogData() } /** + * @return null|string */ public function getPreviousValue() @@ -67,6 +74,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetSkuChangeModel.php b/lib/commercetools-history/src/Models/Change/SetSkuChangeModel.php index c25c753c936..db77e1cfcdd 100644 --- a/lib/commercetools-history/src/Models/Change/SetSkuChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetSkuChangeModel.php @@ -22,26 +22,31 @@ final class SetSkuChangeModel extends JsonObjectModel implements SetSkuChange public const DISCRIMINATOR_VALUE = 'SetSkuChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -54,16 +59,18 @@ public function __construct( ?string $change = null, ?string $catalogData = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -83,6 +90,7 @@ public function getType() /** *

    Update action for setSku

    * + * * @return null|string */ public function getChange() @@ -100,6 +108,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -117,6 +126,7 @@ public function getCatalogData() } /** + * * @return null|string */ public function getPreviousValue() @@ -134,6 +144,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetSlugChange.php b/lib/commercetools-history/src/Models/Change/SetSlugChange.php index 880a86c6f16..ddf1ad3db17 100644 --- a/lib/commercetools-history/src/Models/Change/SetSlugChange.php +++ b/lib/commercetools-history/src/Models/Change/SetSlugChange.php @@ -19,6 +19,7 @@ interface SetSlugChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for setSlug

    * + * @return null|string */ public function getChange(); /** + * @return null|LocalizedString */ public function getPreviousValue(); /** + * @return null|LocalizedString */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetSlugChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetSlugChangeBuilder.php index 38214d9309f..b9bcd804f8e 100644 --- a/lib/commercetools-history/src/Models/Change/SetSlugChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetSlugChangeBuilder.php @@ -23,16 +23,19 @@ final class SetSlugChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class SetSlugChangeBuilder implements Builder /** *

    Shape of the action for setSlug

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|LocalizedString */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetSlugChangeModel.php b/lib/commercetools-history/src/Models/Change/SetSlugChangeModel.php index 4410c850175..af17a215cdb 100644 --- a/lib/commercetools-history/src/Models/Change/SetSlugChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetSlugChangeModel.php @@ -24,21 +24,25 @@ final class SetSlugChangeModel extends JsonObjectModel implements SetSlugChange public const DISCRIMINATOR_VALUE = 'SetSlugChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?LocalizedString */ protected $previousValue; /** + * * @var ?LocalizedString */ protected $nextValue; @@ -50,15 +54,17 @@ final class SetSlugChangeModel extends JsonObjectModel implements SetSlugChange public function __construct( ?string $change = null, ?LocalizedString $previousValue = null, - ?LocalizedString $nextValue = null + ?LocalizedString $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for setSlug

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|LocalizedString */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetStateRolesChange.php b/lib/commercetools-history/src/Models/Change/SetStateRolesChange.php index 2c260e235db..269d80535b8 100644 --- a/lib/commercetools-history/src/Models/Change/SetStateRolesChange.php +++ b/lib/commercetools-history/src/Models/Change/SetStateRolesChange.php @@ -18,21 +18,25 @@ interface SetStateRolesChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|array */ public function getPreviousValue(); /** + * @return null|array */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetStateRolesChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetStateRolesChangeBuilder.php index be65ce426d8..3e691f16053 100644 --- a/lib/commercetools-history/src/Models/Change/SetStateRolesChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetStateRolesChangeBuilder.php @@ -21,21 +21,25 @@ final class SetStateRolesChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?array */ private $previousValue; /** + * @var ?array */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -44,6 +48,7 @@ public function getChange() } /** + * @return null|array */ public function getPreviousValue() @@ -52,6 +57,7 @@ public function getPreviousValue() } /** + * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetStateRolesChangeModel.php b/lib/commercetools-history/src/Models/Change/SetStateRolesChangeModel.php index 31adf300093..c863c64f616 100644 --- a/lib/commercetools-history/src/Models/Change/SetStateRolesChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetStateRolesChangeModel.php @@ -22,21 +22,25 @@ final class SetStateRolesChangeModel extends JsonObjectModel implements SetState public const DISCRIMINATOR_VALUE = 'SetStateRolesChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?array */ protected $previousValue; /** + * * @var ?array */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetStateRolesChangeModel extends JsonObjectModel implements SetState public function __construct( ?string $change = null, ?array $previousValue = null, - ?array $nextValue = null + ?array $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -74,6 +80,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -91,6 +98,7 @@ public function getChange() } /** + * * @return null|array */ public function getPreviousValue() @@ -108,6 +116,7 @@ public function getPreviousValue() } /** + * * @return null|array */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetStatusInterfaceCodeChange.php b/lib/commercetools-history/src/Models/Change/SetStatusInterfaceCodeChange.php index e2cc8e0896e..ce0468cf80d 100644 --- a/lib/commercetools-history/src/Models/Change/SetStatusInterfaceCodeChange.php +++ b/lib/commercetools-history/src/Models/Change/SetStatusInterfaceCodeChange.php @@ -18,6 +18,7 @@ interface SetStatusInterfaceCodeChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setStatusInterfaceCode

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetStatusInterfaceCodeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetStatusInterfaceCodeChangeBuilder.php index 77c6507b48c..677eafa4ce0 100644 --- a/lib/commercetools-history/src/Models/Change/SetStatusInterfaceCodeChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetStatusInterfaceCodeChangeBuilder.php @@ -21,16 +21,19 @@ final class SetStatusInterfaceCodeChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetStatusInterfaceCodeChangeBuilder implements Builder /** *

    Shape of the action for setStatusInterfaceCode

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetStatusInterfaceCodeChangeModel.php b/lib/commercetools-history/src/Models/Change/SetStatusInterfaceCodeChangeModel.php index 95a5f00a68e..4205062b7d1 100644 --- a/lib/commercetools-history/src/Models/Change/SetStatusInterfaceCodeChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetStatusInterfaceCodeChangeModel.php @@ -22,21 +22,25 @@ final class SetStatusInterfaceCodeChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'SetStatusInterfaceCodeChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetStatusInterfaceCodeChangeModel extends JsonObjectModel implements public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setStatusInterfaceCode

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetStatusInterfaceTextChange.php b/lib/commercetools-history/src/Models/Change/SetStatusInterfaceTextChange.php index c73a0254d02..fa2e9bdb5cc 100644 --- a/lib/commercetools-history/src/Models/Change/SetStatusInterfaceTextChange.php +++ b/lib/commercetools-history/src/Models/Change/SetStatusInterfaceTextChange.php @@ -18,6 +18,7 @@ interface SetStatusInterfaceTextChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setStatusInterfaceText

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetStatusInterfaceTextChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetStatusInterfaceTextChangeBuilder.php index 92d878220dd..b8a390f5975 100644 --- a/lib/commercetools-history/src/Models/Change/SetStatusInterfaceTextChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetStatusInterfaceTextChangeBuilder.php @@ -21,16 +21,19 @@ final class SetStatusInterfaceTextChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetStatusInterfaceTextChangeBuilder implements Builder /** *

    Shape of the action for setStatusInterfaceText

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetStatusInterfaceTextChangeModel.php b/lib/commercetools-history/src/Models/Change/SetStatusInterfaceTextChangeModel.php index 0dfe3898f1a..d4816dfe5f0 100644 --- a/lib/commercetools-history/src/Models/Change/SetStatusInterfaceTextChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetStatusInterfaceTextChangeModel.php @@ -22,21 +22,25 @@ final class SetStatusInterfaceTextChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'SetStatusInterfaceTextChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetStatusInterfaceTextChangeModel extends JsonObjectModel implements public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setStatusInterfaceText

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetStoreChange.php b/lib/commercetools-history/src/Models/Change/SetStoreChange.php index 0e7517bce85..9bd269e2574 100644 --- a/lib/commercetools-history/src/Models/Change/SetStoreChange.php +++ b/lib/commercetools-history/src/Models/Change/SetStoreChange.php @@ -19,6 +19,7 @@ interface SetStoreChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for setStore

    * + * @return null|string */ public function getChange(); /** + * @return null|Reference */ public function getPreviousValue(); /** + * @return null|Reference */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetStoreChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetStoreChangeBuilder.php index 895c0a54837..daae074ea6c 100644 --- a/lib/commercetools-history/src/Models/Change/SetStoreChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetStoreChangeBuilder.php @@ -23,16 +23,19 @@ final class SetStoreChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Reference|ReferenceBuilder */ private $previousValue; /** + * @var null|Reference|ReferenceBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class SetStoreChangeBuilder implements Builder /** *

    Shape of the action for setStore

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Reference */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|Reference */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetStoreChangeModel.php b/lib/commercetools-history/src/Models/Change/SetStoreChangeModel.php index 8b71fd9e917..ea121061fc1 100644 --- a/lib/commercetools-history/src/Models/Change/SetStoreChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetStoreChangeModel.php @@ -24,21 +24,25 @@ final class SetStoreChangeModel extends JsonObjectModel implements SetStoreChang public const DISCRIMINATOR_VALUE = 'SetStoreChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Reference */ protected $previousValue; /** + * * @var ?Reference */ protected $nextValue; @@ -50,15 +54,17 @@ final class SetStoreChangeModel extends JsonObjectModel implements SetStoreChang public function __construct( ?string $change = null, ?Reference $previousValue = null, - ?Reference $nextValue = null + ?Reference $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for setStore

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Reference */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|Reference */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetStoresChange.php b/lib/commercetools-history/src/Models/Change/SetStoresChange.php index f947902d4ee..4d582c2cd27 100644 --- a/lib/commercetools-history/src/Models/Change/SetStoresChange.php +++ b/lib/commercetools-history/src/Models/Change/SetStoresChange.php @@ -19,6 +19,7 @@ interface SetStoresChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for setStores

    * + * @return null|string */ public function getChange(); /** + * @return null|ReferenceCollection */ public function getPreviousValue(); /** + * @return null|ReferenceCollection */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetStoresChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetStoresChangeBuilder.php index a757dcfc40e..789a7c8a0d4 100644 --- a/lib/commercetools-history/src/Models/Change/SetStoresChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetStoresChangeBuilder.php @@ -22,16 +22,19 @@ final class SetStoresChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?ReferenceCollection */ private $previousValue; /** + * @var ?ReferenceCollection */ private $nextValue; @@ -39,6 +42,7 @@ final class SetStoresChangeBuilder implements Builder /** *

    Shape of the action for setStores

    * + * @return null|string */ public function getChange() @@ -47,6 +51,7 @@ public function getChange() } /** + * @return null|ReferenceCollection */ public function getPreviousValue() @@ -55,6 +60,7 @@ public function getPreviousValue() } /** + * @return null|ReferenceCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetStoresChangeModel.php b/lib/commercetools-history/src/Models/Change/SetStoresChangeModel.php index a7920b2c531..9df465b7596 100644 --- a/lib/commercetools-history/src/Models/Change/SetStoresChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetStoresChangeModel.php @@ -23,21 +23,25 @@ final class SetStoresChangeModel extends JsonObjectModel implements SetStoresCha public const DISCRIMINATOR_VALUE = 'SetStoresChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ReferenceCollection */ protected $previousValue; /** + * * @var ?ReferenceCollection */ protected $nextValue; @@ -49,15 +53,17 @@ final class SetStoresChangeModel extends JsonObjectModel implements SetStoresCha public function __construct( ?string $change = null, ?ReferenceCollection $previousValue = null, - ?ReferenceCollection $nextValue = null + ?ReferenceCollection $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -77,6 +83,7 @@ public function getType() /** *

    Shape of the action for setStores

    * + * * @return null|string */ public function getChange() @@ -94,6 +101,7 @@ public function getChange() } /** + * * @return null|ReferenceCollection */ public function getPreviousValue() @@ -111,6 +119,7 @@ public function getPreviousValue() } /** + * * @return null|ReferenceCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetSupplyChannelChange.php b/lib/commercetools-history/src/Models/Change/SetSupplyChannelChange.php index 8b7e78c190a..9eb574697c9 100644 --- a/lib/commercetools-history/src/Models/Change/SetSupplyChannelChange.php +++ b/lib/commercetools-history/src/Models/Change/SetSupplyChannelChange.php @@ -19,6 +19,7 @@ interface SetSupplyChannelChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for setSupplyChannel

    * + * @return null|string */ public function getChange(); /** + * @return null|Reference */ public function getPreviousValue(); /** + * @return null|Reference */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetSupplyChannelChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetSupplyChannelChangeBuilder.php index 52da8bc44c5..f13b9a12e13 100644 --- a/lib/commercetools-history/src/Models/Change/SetSupplyChannelChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetSupplyChannelChangeBuilder.php @@ -23,16 +23,19 @@ final class SetSupplyChannelChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Reference|ReferenceBuilder */ private $previousValue; /** + * @var null|Reference|ReferenceBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class SetSupplyChannelChangeBuilder implements Builder /** *

    Shape of the action for setSupplyChannel

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Reference */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|Reference */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetSupplyChannelChangeModel.php b/lib/commercetools-history/src/Models/Change/SetSupplyChannelChangeModel.php index 412c4179faf..3c028b11876 100644 --- a/lib/commercetools-history/src/Models/Change/SetSupplyChannelChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetSupplyChannelChangeModel.php @@ -24,21 +24,25 @@ final class SetSupplyChannelChangeModel extends JsonObjectModel implements SetSu public const DISCRIMINATOR_VALUE = 'SetSupplyChannelChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Reference */ protected $previousValue; /** + * * @var ?Reference */ protected $nextValue; @@ -50,15 +54,17 @@ final class SetSupplyChannelChangeModel extends JsonObjectModel implements SetSu public function __construct( ?string $change = null, ?Reference $previousValue = null, - ?Reference $nextValue = null + ?Reference $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for setSupplyChannel

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Reference */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|Reference */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetSupplyChannelsChange.php b/lib/commercetools-history/src/Models/Change/SetSupplyChannelsChange.php index 24c57d9bb25..a1103bb96ce 100644 --- a/lib/commercetools-history/src/Models/Change/SetSupplyChannelsChange.php +++ b/lib/commercetools-history/src/Models/Change/SetSupplyChannelsChange.php @@ -19,6 +19,7 @@ interface SetSupplyChannelsChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for setSupplyChannels

    * + * @return null|string */ public function getChange(); /** + * @return null|ReferenceCollection */ public function getPreviousValue(); /** + * @return null|ReferenceCollection */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetSupplyChannelsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetSupplyChannelsChangeBuilder.php index c5405a688dd..6ddeb3c3cc3 100644 --- a/lib/commercetools-history/src/Models/Change/SetSupplyChannelsChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetSupplyChannelsChangeBuilder.php @@ -22,16 +22,19 @@ final class SetSupplyChannelsChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?ReferenceCollection */ private $previousValue; /** + * @var ?ReferenceCollection */ private $nextValue; @@ -39,6 +42,7 @@ final class SetSupplyChannelsChangeBuilder implements Builder /** *

    Shape of the action for setSupplyChannels

    * + * @return null|string */ public function getChange() @@ -47,6 +51,7 @@ public function getChange() } /** + * @return null|ReferenceCollection */ public function getPreviousValue() @@ -55,6 +60,7 @@ public function getPreviousValue() } /** + * @return null|ReferenceCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetSupplyChannelsChangeModel.php b/lib/commercetools-history/src/Models/Change/SetSupplyChannelsChangeModel.php index 6fad29f7545..137ef76f926 100644 --- a/lib/commercetools-history/src/Models/Change/SetSupplyChannelsChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetSupplyChannelsChangeModel.php @@ -23,21 +23,25 @@ final class SetSupplyChannelsChangeModel extends JsonObjectModel implements SetS public const DISCRIMINATOR_VALUE = 'SetSupplyChannelsChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ReferenceCollection */ protected $previousValue; /** + * * @var ?ReferenceCollection */ protected $nextValue; @@ -49,15 +53,17 @@ final class SetSupplyChannelsChangeModel extends JsonObjectModel implements SetS public function __construct( ?string $change = null, ?ReferenceCollection $previousValue = null, - ?ReferenceCollection $nextValue = null + ?ReferenceCollection $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -77,6 +83,7 @@ public function getType() /** *

    Shape of the action for setSupplyChannels

    * + * * @return null|string */ public function getChange() @@ -94,6 +101,7 @@ public function getChange() } /** + * * @return null|ReferenceCollection */ public function getPreviousValue() @@ -111,6 +119,7 @@ public function getPreviousValue() } /** + * * @return null|ReferenceCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetTargetChange.php b/lib/commercetools-history/src/Models/Change/SetTargetChange.php index 2da9bf5cb61..aabb62f87ec 100644 --- a/lib/commercetools-history/src/Models/Change/SetTargetChange.php +++ b/lib/commercetools-history/src/Models/Change/SetTargetChange.php @@ -19,6 +19,7 @@ interface SetTargetChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for setTarget

    * + * @return null|string */ public function getChange(); /** + * @return null|Reference */ public function getPreviousValue(); /** + * @return null|Reference */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetTargetChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetTargetChangeBuilder.php index 539eba99c02..1189e2e554d 100644 --- a/lib/commercetools-history/src/Models/Change/SetTargetChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetTargetChangeBuilder.php @@ -23,16 +23,19 @@ final class SetTargetChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Reference|ReferenceBuilder */ private $previousValue; /** + * @var null|Reference|ReferenceBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class SetTargetChangeBuilder implements Builder /** *

    Shape of the action for setTarget

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Reference */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|Reference */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetTargetChangeModel.php b/lib/commercetools-history/src/Models/Change/SetTargetChangeModel.php index eb7dcf4d623..55f28239aee 100644 --- a/lib/commercetools-history/src/Models/Change/SetTargetChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetTargetChangeModel.php @@ -24,21 +24,25 @@ final class SetTargetChangeModel extends JsonObjectModel implements SetTargetCha public const DISCRIMINATOR_VALUE = 'SetTargetChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Reference */ protected $previousValue; /** + * * @var ?Reference */ protected $nextValue; @@ -50,15 +54,17 @@ final class SetTargetChangeModel extends JsonObjectModel implements SetTargetCha public function __construct( ?string $change = null, ?Reference $previousValue = null, - ?Reference $nextValue = null + ?Reference $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for setTarget

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Reference */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|Reference */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetTaxCategoryChange.php b/lib/commercetools-history/src/Models/Change/SetTaxCategoryChange.php index 7058d6fe5c1..dc8f3d3b7f4 100644 --- a/lib/commercetools-history/src/Models/Change/SetTaxCategoryChange.php +++ b/lib/commercetools-history/src/Models/Change/SetTaxCategoryChange.php @@ -19,6 +19,7 @@ interface SetTaxCategoryChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for setTaxCategory

    * + * @return null|string */ public function getChange(); /** + * @return null|Reference */ public function getPreviousValue(); /** + * @return null|Reference */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetTaxCategoryChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetTaxCategoryChangeBuilder.php index 023e964d3ae..5e7bfd3d941 100644 --- a/lib/commercetools-history/src/Models/Change/SetTaxCategoryChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetTaxCategoryChangeBuilder.php @@ -23,16 +23,19 @@ final class SetTaxCategoryChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Reference|ReferenceBuilder */ private $previousValue; /** + * @var null|Reference|ReferenceBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class SetTaxCategoryChangeBuilder implements Builder /** *

    Shape of the action for setTaxCategory

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Reference */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|Reference */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetTaxCategoryChangeModel.php b/lib/commercetools-history/src/Models/Change/SetTaxCategoryChangeModel.php index 1266bb95181..48a3f3cdb25 100644 --- a/lib/commercetools-history/src/Models/Change/SetTaxCategoryChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetTaxCategoryChangeModel.php @@ -24,21 +24,25 @@ final class SetTaxCategoryChangeModel extends JsonObjectModel implements SetTaxC public const DISCRIMINATOR_VALUE = 'SetTaxCategoryChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Reference */ protected $previousValue; /** + * * @var ?Reference */ protected $nextValue; @@ -50,15 +54,17 @@ final class SetTaxCategoryChangeModel extends JsonObjectModel implements SetTaxC public function __construct( ?string $change = null, ?Reference $previousValue = null, - ?Reference $nextValue = null + ?Reference $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for setTaxCategory

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Reference */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|Reference */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetTextChange.php b/lib/commercetools-history/src/Models/Change/SetTextChange.php index 0a470101bfe..edbe8e6a183 100644 --- a/lib/commercetools-history/src/Models/Change/SetTextChange.php +++ b/lib/commercetools-history/src/Models/Change/SetTextChange.php @@ -18,6 +18,7 @@ interface SetTextChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setText

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetTextChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetTextChangeBuilder.php index 1e244e4a5eb..111464eb908 100644 --- a/lib/commercetools-history/src/Models/Change/SetTextChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetTextChangeBuilder.php @@ -21,16 +21,19 @@ final class SetTextChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetTextChangeBuilder implements Builder /** *

    Shape of the action for setText

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetTextChangeModel.php b/lib/commercetools-history/src/Models/Change/SetTextChangeModel.php index 654d4ece376..8ad1a0f3d10 100644 --- a/lib/commercetools-history/src/Models/Change/SetTextChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetTextChangeModel.php @@ -22,21 +22,25 @@ final class SetTextChangeModel extends JsonObjectModel implements SetTextChange public const DISCRIMINATOR_VALUE = 'SetTextChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetTextChangeModel extends JsonObjectModel implements SetTextChange public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setText

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomFieldChange.php b/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomFieldChange.php index c184822726c..ec157b41701 100644 --- a/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomFieldChange.php +++ b/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomFieldChange.php @@ -22,6 +22,7 @@ interface SetTextLineItemCustomFieldChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -29,31 +30,37 @@ public function getType(); /** *

    Update action for setTextLineItemCustomField

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getName(); /** + * @return null|string */ public function getCustomTypeId(); /** + * @return null|TextLineItemValue */ public function getTextLineItem(); /** + * @return null|mixed */ public function getNextValue(); /** + * @return null|mixed */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomFieldChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomFieldChangeBuilder.php index b24c1c51b2a..2dbfeb16fb7 100644 --- a/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomFieldChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomFieldChangeBuilder.php @@ -23,31 +23,37 @@ final class SetTextLineItemCustomFieldChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $name; /** + * @var ?string */ private $customTypeId; /** + * @var null|TextLineItemValue|TextLineItemValueBuilder */ private $textLineItem; /** + * @var null|mixed|mixed */ private $nextValue; /** + * @var null|mixed|mixed */ private $previousValue; @@ -55,6 +61,7 @@ final class SetTextLineItemCustomFieldChangeBuilder implements Builder /** *

    Update action for setTextLineItemCustomField

    * + * @return null|string */ public function getChange() @@ -63,6 +70,7 @@ public function getChange() } /** + * @return null|string */ public function getName() @@ -71,6 +79,7 @@ public function getName() } /** + * @return null|string */ public function getCustomTypeId() @@ -79,6 +88,7 @@ public function getCustomTypeId() } /** + * @return null|TextLineItemValue */ public function getTextLineItem() @@ -87,6 +97,7 @@ public function getTextLineItem() } /** + * @return null|mixed */ public function getNextValue() @@ -95,6 +106,7 @@ public function getNextValue() } /** + * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomFieldChangeModel.php b/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomFieldChangeModel.php index f346fc2f888..ba54b2de64a 100644 --- a/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomFieldChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomFieldChangeModel.php @@ -24,36 +24,43 @@ final class SetTextLineItemCustomFieldChangeModel extends JsonObjectModel implem public const DISCRIMINATOR_VALUE = 'SetTextLineItemCustomFieldChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $customTypeId; /** + * * @var ?TextLineItemValue */ protected $textLineItem; /** + * * @var ?mixed */ protected $nextValue; /** + * * @var ?mixed */ protected $previousValue; @@ -68,7 +75,8 @@ public function __construct( ?string $customTypeId = null, ?TextLineItemValue $textLineItem = null, $nextValue = null, - $previousValue = null + $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->name = $name; @@ -76,10 +84,11 @@ public function __construct( $this->textLineItem = $textLineItem; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -99,6 +108,7 @@ public function getType() /** *

    Update action for setTextLineItemCustomField

    * + * * @return null|string */ public function getChange() @@ -116,6 +126,7 @@ public function getChange() } /** + * * @return null|string */ public function getName() @@ -133,6 +144,7 @@ public function getName() } /** + * * @return null|string */ public function getCustomTypeId() @@ -150,6 +162,7 @@ public function getCustomTypeId() } /** + * * @return null|TextLineItemValue */ public function getTextLineItem() @@ -168,6 +181,7 @@ public function getTextLineItem() } /** + * * @return null|mixed */ public function getNextValue() @@ -185,6 +199,7 @@ public function getNextValue() } /** + * * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomTypeChange.php b/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomTypeChange.php index d1dd7ef073c..bc1fc61de1f 100644 --- a/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomTypeChange.php +++ b/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomTypeChange.php @@ -21,6 +21,7 @@ interface SetTextLineItemCustomTypeChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -28,21 +29,25 @@ public function getType(); /** *

    Update action for setTextLineItemCustomType

    * + * @return null|string */ public function getChange(); /** + * @return null|TextLineItemValue */ public function getTextLineItem(); /** + * @return null|CustomFields */ public function getNextValue(); /** + * @return null|CustomFields */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomTypeChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomTypeChangeBuilder.php index f65ec572bae..afe2f7756ad 100644 --- a/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomTypeChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomTypeChangeBuilder.php @@ -25,21 +25,25 @@ final class SetTextLineItemCustomTypeChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|TextLineItemValue|TextLineItemValueBuilder */ private $textLineItem; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $nextValue; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $previousValue; @@ -47,6 +51,7 @@ final class SetTextLineItemCustomTypeChangeBuilder implements Builder /** *

    Update action for setTextLineItemCustomType

    * + * @return null|string */ public function getChange() @@ -55,6 +60,7 @@ public function getChange() } /** + * @return null|TextLineItemValue */ public function getTextLineItem() @@ -63,6 +69,7 @@ public function getTextLineItem() } /** + * @return null|CustomFields */ public function getNextValue() @@ -71,6 +78,7 @@ public function getNextValue() } /** + * @return null|CustomFields */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomTypeChangeModel.php b/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomTypeChangeModel.php index e878797c3b4..ffd1677102b 100644 --- a/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomTypeChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetTextLineItemCustomTypeChangeModel.php @@ -26,26 +26,31 @@ final class SetTextLineItemCustomTypeChangeModel extends JsonObjectModel impleme public const DISCRIMINATOR_VALUE = 'SetTextLineItemCustomTypeChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?TextLineItemValue */ protected $textLineItem; /** + * * @var ?CustomFields */ protected $nextValue; /** + * * @var ?CustomFields */ protected $previousValue; @@ -58,16 +63,18 @@ public function __construct( ?string $change = null, ?TextLineItemValue $textLineItem = null, ?CustomFields $nextValue = null, - ?CustomFields $previousValue = null + ?CustomFields $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->textLineItem = $textLineItem; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -87,6 +94,7 @@ public function getType() /** *

    Update action for setTextLineItemCustomType

    * + * * @return null|string */ public function getChange() @@ -104,6 +112,7 @@ public function getChange() } /** + * * @return null|TextLineItemValue */ public function getTextLineItem() @@ -122,6 +131,7 @@ public function getTextLineItem() } /** + * * @return null|CustomFields */ public function getNextValue() @@ -140,6 +150,7 @@ public function getNextValue() } /** + * * @return null|CustomFields */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetTextLineItemDescriptionChange.php b/lib/commercetools-history/src/Models/Change/SetTextLineItemDescriptionChange.php index a8a5b546577..13558d3a9f9 100644 --- a/lib/commercetools-history/src/Models/Change/SetTextLineItemDescriptionChange.php +++ b/lib/commercetools-history/src/Models/Change/SetTextLineItemDescriptionChange.php @@ -21,26 +21,31 @@ interface SetTextLineItemDescriptionChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|TextLineItemValue */ public function getTextLineItem(); /** + * @return null|LocalizedString */ public function getPreviousValue(); /** + * @return null|LocalizedString */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetTextLineItemDescriptionChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetTextLineItemDescriptionChangeBuilder.php index 7725e8bf6b7..bbe94801d40 100644 --- a/lib/commercetools-history/src/Models/Change/SetTextLineItemDescriptionChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetTextLineItemDescriptionChangeBuilder.php @@ -25,26 +25,31 @@ final class SetTextLineItemDescriptionChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|TextLineItemValue|TextLineItemValueBuilder */ private $textLineItem; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $previousValue; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -53,6 +58,7 @@ public function getChange() } /** + * @return null|TextLineItemValue */ public function getTextLineItem() @@ -61,6 +67,7 @@ public function getTextLineItem() } /** + * @return null|LocalizedString */ public function getPreviousValue() @@ -69,6 +76,7 @@ public function getPreviousValue() } /** + * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetTextLineItemDescriptionChangeModel.php b/lib/commercetools-history/src/Models/Change/SetTextLineItemDescriptionChangeModel.php index 9714f2880f7..3e0dcf5e0bf 100644 --- a/lib/commercetools-history/src/Models/Change/SetTextLineItemDescriptionChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetTextLineItemDescriptionChangeModel.php @@ -26,26 +26,31 @@ final class SetTextLineItemDescriptionChangeModel extends JsonObjectModel implem public const DISCRIMINATOR_VALUE = 'SetTextLineItemDescriptionChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?TextLineItemValue */ protected $textLineItem; /** + * * @var ?LocalizedString */ protected $previousValue; /** + * * @var ?LocalizedString */ protected $nextValue; @@ -58,16 +63,18 @@ public function __construct( ?string $change = null, ?TextLineItemValue $textLineItem = null, ?LocalizedString $previousValue = null, - ?LocalizedString $nextValue = null + ?LocalizedString $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->textLineItem = $textLineItem; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -85,6 +92,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -102,6 +110,7 @@ public function getChange() } /** + * * @return null|TextLineItemValue */ public function getTextLineItem() @@ -120,6 +129,7 @@ public function getTextLineItem() } /** + * * @return null|LocalizedString */ public function getPreviousValue() @@ -138,6 +148,7 @@ public function getPreviousValue() } /** + * * @return null|LocalizedString */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetTitleChange.php b/lib/commercetools-history/src/Models/Change/SetTitleChange.php index 90c1bb5ebf0..b325ab5d597 100644 --- a/lib/commercetools-history/src/Models/Change/SetTitleChange.php +++ b/lib/commercetools-history/src/Models/Change/SetTitleChange.php @@ -18,6 +18,7 @@ interface SetTitleChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setTitle

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetTitleChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetTitleChangeBuilder.php index c26bd86ce84..144d01a0cd1 100644 --- a/lib/commercetools-history/src/Models/Change/SetTitleChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetTitleChangeBuilder.php @@ -21,16 +21,19 @@ final class SetTitleChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetTitleChangeBuilder implements Builder /** *

    Shape of the action for setTitle

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetTitleChangeModel.php b/lib/commercetools-history/src/Models/Change/SetTitleChangeModel.php index cd6798060d0..f084a128107 100644 --- a/lib/commercetools-history/src/Models/Change/SetTitleChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetTitleChangeModel.php @@ -22,21 +22,25 @@ final class SetTitleChangeModel extends JsonObjectModel implements SetTitleChang public const DISCRIMINATOR_VALUE = 'SetTitleChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetTitleChangeModel extends JsonObjectModel implements SetTitleChang public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setTitle

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetTransitionsChange.php b/lib/commercetools-history/src/Models/Change/SetTransitionsChange.php index 65ec860082e..189ade9e488 100644 --- a/lib/commercetools-history/src/Models/Change/SetTransitionsChange.php +++ b/lib/commercetools-history/src/Models/Change/SetTransitionsChange.php @@ -19,6 +19,7 @@ interface SetTransitionsChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for setTransitions

    * + * @return null|string */ public function getChange(); /** + * @return null|ReferenceCollection */ public function getPreviousValue(); /** + * @return null|ReferenceCollection */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetTransitionsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetTransitionsChangeBuilder.php index 8bf3e9441f3..8e21388a4e3 100644 --- a/lib/commercetools-history/src/Models/Change/SetTransitionsChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetTransitionsChangeBuilder.php @@ -22,16 +22,19 @@ final class SetTransitionsChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?ReferenceCollection */ private $previousValue; /** + * @var ?ReferenceCollection */ private $nextValue; @@ -39,6 +42,7 @@ final class SetTransitionsChangeBuilder implements Builder /** *

    Shape of the action for setTransitions

    * + * @return null|string */ public function getChange() @@ -47,6 +51,7 @@ public function getChange() } /** + * @return null|ReferenceCollection */ public function getPreviousValue() @@ -55,6 +60,7 @@ public function getPreviousValue() } /** + * @return null|ReferenceCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetTransitionsChangeModel.php b/lib/commercetools-history/src/Models/Change/SetTransitionsChangeModel.php index 4b993f23819..6fd9cf67790 100644 --- a/lib/commercetools-history/src/Models/Change/SetTransitionsChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetTransitionsChangeModel.php @@ -23,21 +23,25 @@ final class SetTransitionsChangeModel extends JsonObjectModel implements SetTran public const DISCRIMINATOR_VALUE = 'SetTransitionsChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ReferenceCollection */ protected $previousValue; /** + * * @var ?ReferenceCollection */ protected $nextValue; @@ -49,15 +53,17 @@ final class SetTransitionsChangeModel extends JsonObjectModel implements SetTran public function __construct( ?string $change = null, ?ReferenceCollection $previousValue = null, - ?ReferenceCollection $nextValue = null + ?ReferenceCollection $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -77,6 +83,7 @@ public function getType() /** *

    Shape of the action for setTransitions

    * + * * @return null|string */ public function getChange() @@ -94,6 +101,7 @@ public function getChange() } /** + * * @return null|ReferenceCollection */ public function getPreviousValue() @@ -111,6 +119,7 @@ public function getPreviousValue() } /** + * * @return null|ReferenceCollection */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetValidFromAndUntilChange.php b/lib/commercetools-history/src/Models/Change/SetValidFromAndUntilChange.php index 51ea0c1f2ea..39b58b7abf5 100644 --- a/lib/commercetools-history/src/Models/Change/SetValidFromAndUntilChange.php +++ b/lib/commercetools-history/src/Models/Change/SetValidFromAndUntilChange.php @@ -19,11 +19,13 @@ interface SetValidFromAndUntilChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); @@ -31,6 +33,7 @@ public function getChange(); /** *

    Shape of the value for setValidFromAndUntil action

    * + * @return null|ValidFromAndUntilValue */ public function getPreviousValue(); @@ -38,6 +41,7 @@ public function getPreviousValue(); /** *

    Shape of the value for setValidFromAndUntil action

    * + * @return null|ValidFromAndUntilValue */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetValidFromAndUntilChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetValidFromAndUntilChangeBuilder.php index 749c294fb46..ee930c8b47f 100644 --- a/lib/commercetools-history/src/Models/Change/SetValidFromAndUntilChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetValidFromAndUntilChangeBuilder.php @@ -23,21 +23,25 @@ final class SetValidFromAndUntilChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|ValidFromAndUntilValue|ValidFromAndUntilValueBuilder */ private $previousValue; /** + * @var null|ValidFromAndUntilValue|ValidFromAndUntilValueBuilder */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() /** *

    Shape of the value for setValidFromAndUntil action

    * + * @return null|ValidFromAndUntilValue */ public function getPreviousValue() @@ -58,6 +63,7 @@ public function getPreviousValue() /** *

    Shape of the value for setValidFromAndUntil action

    * + * @return null|ValidFromAndUntilValue */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetValidFromAndUntilChangeModel.php b/lib/commercetools-history/src/Models/Change/SetValidFromAndUntilChangeModel.php index e2783d913e7..363c2b26f86 100644 --- a/lib/commercetools-history/src/Models/Change/SetValidFromAndUntilChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetValidFromAndUntilChangeModel.php @@ -24,21 +24,25 @@ final class SetValidFromAndUntilChangeModel extends JsonObjectModel implements S public const DISCRIMINATOR_VALUE = 'SetValidFromAndUntilChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?ValidFromAndUntilValue */ protected $previousValue; /** + * * @var ?ValidFromAndUntilValue */ protected $nextValue; @@ -50,15 +54,17 @@ final class SetValidFromAndUntilChangeModel extends JsonObjectModel implements S public function __construct( ?string $change = null, ?ValidFromAndUntilValue $previousValue = null, - ?ValidFromAndUntilValue $nextValue = null + ?ValidFromAndUntilValue $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() /** *

    Shape of the value for setValidFromAndUntil action

    * + * * @return null|ValidFromAndUntilValue */ public function getPreviousValue() @@ -115,6 +123,7 @@ public function getPreviousValue() /** *

    Shape of the value for setValidFromAndUntil action

    * + * * @return null|ValidFromAndUntilValue */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetValidFromChange.php b/lib/commercetools-history/src/Models/Change/SetValidFromChange.php index 7dafeebaa9a..1744917da27 100644 --- a/lib/commercetools-history/src/Models/Change/SetValidFromChange.php +++ b/lib/commercetools-history/src/Models/Change/SetValidFromChange.php @@ -18,6 +18,7 @@ interface SetValidFromChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setValidFrom

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetValidFromChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetValidFromChangeBuilder.php index 1693d422982..9371b468587 100644 --- a/lib/commercetools-history/src/Models/Change/SetValidFromChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetValidFromChangeBuilder.php @@ -21,16 +21,19 @@ final class SetValidFromChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetValidFromChangeBuilder implements Builder /** *

    Shape of the action for setValidFrom

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetValidFromChangeModel.php b/lib/commercetools-history/src/Models/Change/SetValidFromChangeModel.php index 2deffe3140c..928ebf1bfa2 100644 --- a/lib/commercetools-history/src/Models/Change/SetValidFromChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetValidFromChangeModel.php @@ -22,21 +22,25 @@ final class SetValidFromChangeModel extends JsonObjectModel implements SetValidF public const DISCRIMINATOR_VALUE = 'SetValidFromChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetValidFromChangeModel extends JsonObjectModel implements SetValidF public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setValidFrom

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetValidToChange.php b/lib/commercetools-history/src/Models/Change/SetValidToChange.php new file mode 100644 index 00000000000..674ffd9ea5f --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetValidToChange.php @@ -0,0 +1,60 @@ +Shape of the action for setValidTo

    + * + + * @return null|string + */ + public function getChange(); + + /** + + * @return null|string + */ + public function getPreviousValue(); + + /** + + * @return null|string + */ + public function getNextValue(); + + /** + * @param ?string $change + */ + public function setChange(?string $change): void; + + /** + * @param ?string $previousValue + */ + public function setPreviousValue(?string $previousValue): void; + + /** + * @param ?string $nextValue + */ + public function setNextValue(?string $nextValue): void; +} diff --git a/lib/commercetools-history/src/Models/Change/SetValidToChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetValidToChangeBuilder.php new file mode 100644 index 00000000000..0b6812d0808 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetValidToChangeBuilder.php @@ -0,0 +1,117 @@ + + */ +final class SetValidToChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var ?string + */ + private $previousValue; + + /** + + * @var ?string + */ + private $nextValue; + + /** + *

    Shape of the action for setValidTo

    + * + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + + * @return null|string + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + + * @return null|string + */ + public function getNextValue() + { + return $this->nextValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?string $previousValue + * @return $this + */ + public function withPreviousValue(?string $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @param ?string $nextValue + * @return $this + */ + public function withNextValue(?string $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + + public function build(): SetValidToChange + { + return new SetValidToChangeModel( + $this->change, + $this->previousValue, + $this->nextValue + ); + } + + public static function of(): SetValidToChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetValidToChangeCollection.php b/lib/commercetools-history/src/Models/Change/SetValidToChangeCollection.php new file mode 100644 index 00000000000..7bc07f09181 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetValidToChangeCollection.php @@ -0,0 +1,56 @@ + + * @method SetValidToChange current() + * @method SetValidToChange end() + * @method SetValidToChange at($offset) + */ +class SetValidToChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert SetValidToChange $value + * @psalm-param SetValidToChange|stdClass $value + * @throws InvalidArgumentException + * + * @return SetValidToChangeCollection + */ + public function add($value) + { + if (!$value instanceof SetValidToChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?SetValidToChange + */ + protected function mapper() + { + return function (?int $index): ?SetValidToChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var SetValidToChange $data */ + $data = SetValidToChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetValidToChangeModel.php b/lib/commercetools-history/src/Models/Change/SetValidToChangeModel.php new file mode 100644 index 00000000000..576877d642d --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetValidToChangeModel.php @@ -0,0 +1,165 @@ +change = $change; + $this->previousValue = $previousValue; + $this->nextValue = $nextValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    Shape of the action for setValidTo

    + * + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + * + * @return null|string + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = (string) $data; + } + + return $this->previousValue; + } + + /** + * + * @return null|string + */ + public function getNextValue() + { + if (is_null($this->nextValue)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NEXT_VALUE); + if (is_null($data)) { + return null; + } + $this->nextValue = (string) $data; + } + + return $this->nextValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?string $previousValue + */ + public function setPreviousValue(?string $previousValue): void + { + $this->previousValue = $previousValue; + } + + /** + * @param ?string $nextValue + */ + public function setNextValue(?string $nextValue): void + { + $this->nextValue = $nextValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Change/SetValidUntilChange.php b/lib/commercetools-history/src/Models/Change/SetValidUntilChange.php index 97ca2414475..e95bb3c56d9 100644 --- a/lib/commercetools-history/src/Models/Change/SetValidUntilChange.php +++ b/lib/commercetools-history/src/Models/Change/SetValidUntilChange.php @@ -18,6 +18,7 @@ interface SetValidUntilChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setValidUntil

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetValidUntilChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetValidUntilChangeBuilder.php index c71a7377745..8a36dbfec49 100644 --- a/lib/commercetools-history/src/Models/Change/SetValidUntilChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetValidUntilChangeBuilder.php @@ -21,16 +21,19 @@ final class SetValidUntilChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetValidUntilChangeBuilder implements Builder /** *

    Shape of the action for setValidUntil

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetValidUntilChangeModel.php b/lib/commercetools-history/src/Models/Change/SetValidUntilChangeModel.php index cccdb0bf221..5aaa55b3b0c 100644 --- a/lib/commercetools-history/src/Models/Change/SetValidUntilChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetValidUntilChangeModel.php @@ -22,21 +22,25 @@ final class SetValidUntilChangeModel extends JsonObjectModel implements SetValid public const DISCRIMINATOR_VALUE = 'SetValidUntilChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetValidUntilChangeModel extends JsonObjectModel implements SetValid public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setValidUntil

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetValueChange.php b/lib/commercetools-history/src/Models/Change/SetValueChange.php index ee648a8293d..e5f3d965870 100644 --- a/lib/commercetools-history/src/Models/Change/SetValueChange.php +++ b/lib/commercetools-history/src/Models/Change/SetValueChange.php @@ -18,6 +18,7 @@ interface SetValueChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Update action for setValue on custom objects

    * + * @return null|string */ public function getChange(); /** + * @return null|mixed */ public function getNextValue(); /** + * @return null|mixed */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetValueChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetValueChangeBuilder.php index 590ef0dab33..ac56eca9cd3 100644 --- a/lib/commercetools-history/src/Models/Change/SetValueChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetValueChangeBuilder.php @@ -21,16 +21,19 @@ final class SetValueChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|mixed|mixed */ private $nextValue; /** + * @var null|mixed|mixed */ private $previousValue; @@ -38,6 +41,7 @@ final class SetValueChangeBuilder implements Builder /** *

    Update action for setValue on custom objects

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|mixed */ public function getNextValue() @@ -54,6 +59,7 @@ public function getNextValue() } /** + * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetValueChangeModel.php b/lib/commercetools-history/src/Models/Change/SetValueChangeModel.php index da931b774f9..b2efb0c115c 100644 --- a/lib/commercetools-history/src/Models/Change/SetValueChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetValueChangeModel.php @@ -22,21 +22,25 @@ final class SetValueChangeModel extends JsonObjectModel implements SetValueChang public const DISCRIMINATOR_VALUE = 'SetValueChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?mixed */ protected $nextValue; /** + * * @var ?mixed */ protected $previousValue; @@ -48,15 +52,17 @@ final class SetValueChangeModel extends JsonObjectModel implements SetValueChang public function __construct( ?string $change = null, $nextValue = null, - $previousValue = null + $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Update action for setValue on custom objects

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|mixed */ public function getNextValue() @@ -110,6 +118,7 @@ public function getNextValue() } /** + * * @return null|mixed */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/SetVariantAvailabilityChange.php b/lib/commercetools-history/src/Models/Change/SetVariantAvailabilityChange.php index 9ea3c7e02d8..3a715a77340 100644 --- a/lib/commercetools-history/src/Models/Change/SetVariantAvailabilityChange.php +++ b/lib/commercetools-history/src/Models/Change/SetVariantAvailabilityChange.php @@ -21,6 +21,7 @@ interface SetVariantAvailabilityChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -28,26 +29,31 @@ public function getType(); /** *

    Update action for setVariantAvailability

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getCatalogData(); /** + * @return null|string */ public function getVariant(); /** + * @return null|ProductVariantAvailability */ public function getPreviousValue(); /** + * @return null|ProductVariantAvailability */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetVariantAvailabilityChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetVariantAvailabilityChangeBuilder.php index 61edbc92e7d..86dcc3818b9 100644 --- a/lib/commercetools-history/src/Models/Change/SetVariantAvailabilityChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetVariantAvailabilityChangeBuilder.php @@ -23,26 +23,31 @@ final class SetVariantAvailabilityChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $catalogData; /** + * @var ?string */ private $variant; /** + * @var null|ProductVariantAvailability|ProductVariantAvailabilityBuilder */ private $previousValue; /** + * @var null|ProductVariantAvailability|ProductVariantAvailabilityBuilder */ private $nextValue; @@ -50,6 +55,7 @@ final class SetVariantAvailabilityChangeBuilder implements Builder /** *

    Update action for setVariantAvailability

    * + * @return null|string */ public function getChange() @@ -58,6 +64,7 @@ public function getChange() } /** + * @return null|string */ public function getCatalogData() @@ -66,6 +73,7 @@ public function getCatalogData() } /** + * @return null|string */ public function getVariant() @@ -74,6 +82,7 @@ public function getVariant() } /** + * @return null|ProductVariantAvailability */ public function getPreviousValue() @@ -82,6 +91,7 @@ public function getPreviousValue() } /** + * @return null|ProductVariantAvailability */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetVariantAvailabilityChangeModel.php b/lib/commercetools-history/src/Models/Change/SetVariantAvailabilityChangeModel.php index c14ad978c8a..9d3524246b4 100644 --- a/lib/commercetools-history/src/Models/Change/SetVariantAvailabilityChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetVariantAvailabilityChangeModel.php @@ -24,31 +24,37 @@ final class SetVariantAvailabilityChangeModel extends JsonObjectModel implements public const DISCRIMINATOR_VALUE = 'SetVariantAvailabilityChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $catalogData; /** + * * @var ?string */ protected $variant; /** + * * @var ?ProductVariantAvailability */ protected $previousValue; /** + * * @var ?ProductVariantAvailability */ protected $nextValue; @@ -62,17 +68,19 @@ public function __construct( ?string $catalogData = null, ?string $variant = null, ?ProductVariantAvailability $previousValue = null, - ?ProductVariantAvailability $nextValue = null + ?ProductVariantAvailability $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->catalogData = $catalogData; $this->variant = $variant; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -92,6 +100,7 @@ public function getType() /** *

    Update action for setVariantAvailability

    * + * * @return null|string */ public function getChange() @@ -109,6 +118,7 @@ public function getChange() } /** + * * @return null|string */ public function getCatalogData() @@ -126,6 +136,7 @@ public function getCatalogData() } /** + * * @return null|string */ public function getVariant() @@ -143,6 +154,7 @@ public function getVariant() } /** + * * @return null|ProductVariantAvailability */ public function getPreviousValue() @@ -161,6 +173,7 @@ public function getPreviousValue() } /** + * * @return null|ProductVariantAvailability */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetVatIdChange.php b/lib/commercetools-history/src/Models/Change/SetVatIdChange.php index c9ef0165ae4..89d62a3187a 100644 --- a/lib/commercetools-history/src/Models/Change/SetVatIdChange.php +++ b/lib/commercetools-history/src/Models/Change/SetVatIdChange.php @@ -18,6 +18,7 @@ interface SetVatIdChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -25,16 +26,19 @@ public function getType(); /** *

    Shape of the action for setVatId

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getPreviousValue(); /** + * @return null|string */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/SetVatIdChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetVatIdChangeBuilder.php index 6bfd113ce9b..e4adb8a7d86 100644 --- a/lib/commercetools-history/src/Models/Change/SetVatIdChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/SetVatIdChangeBuilder.php @@ -21,16 +21,19 @@ final class SetVatIdChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $previousValue; /** + * @var ?string */ private $nextValue; @@ -38,6 +41,7 @@ final class SetVatIdChangeBuilder implements Builder /** *

    Shape of the action for setVatId

    * + * @return null|string */ public function getChange() @@ -46,6 +50,7 @@ public function getChange() } /** + * @return null|string */ public function getPreviousValue() @@ -54,6 +59,7 @@ public function getPreviousValue() } /** + * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/SetVatIdChangeModel.php b/lib/commercetools-history/src/Models/Change/SetVatIdChangeModel.php index 7fcb4ed21e3..7d14f5de4d1 100644 --- a/lib/commercetools-history/src/Models/Change/SetVatIdChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/SetVatIdChangeModel.php @@ -22,21 +22,25 @@ final class SetVatIdChangeModel extends JsonObjectModel implements SetVatIdChang public const DISCRIMINATOR_VALUE = 'SetVatIdChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $previousValue; /** + * * @var ?string */ protected $nextValue; @@ -48,15 +52,17 @@ final class SetVatIdChangeModel extends JsonObjectModel implements SetVatIdChang public function __construct( ?string $change = null, ?string $previousValue = null, - ?string $nextValue = null + ?string $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -76,6 +82,7 @@ public function getType() /** *

    Shape of the action for setVatId

    * + * * @return null|string */ public function getChange() @@ -93,6 +100,7 @@ public function getChange() } /** + * * @return null|string */ public function getPreviousValue() @@ -110,6 +118,7 @@ public function getPreviousValue() } /** + * * @return null|string */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/TransitionCustomLineItemStateChange.php b/lib/commercetools-history/src/Models/Change/TransitionCustomLineItemStateChange.php index bf9cae0c475..34ede1fcbd6 100644 --- a/lib/commercetools-history/src/Models/Change/TransitionCustomLineItemStateChange.php +++ b/lib/commercetools-history/src/Models/Change/TransitionCustomLineItemStateChange.php @@ -21,6 +21,7 @@ interface TransitionCustomLineItemStateChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -28,26 +29,31 @@ public function getType(); /** *

    Update action for transitionCustomLineItemState

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getLineItemId(); /** + * @return null|string */ public function getStateId(); /** + * @return null|ItemStateCollection */ public function getNextValue(); /** + * @return null|ItemStateCollection */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/TransitionCustomLineItemStateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/TransitionCustomLineItemStateChangeBuilder.php index b9791d51034..5c4b5dae8e5 100644 --- a/lib/commercetools-history/src/Models/Change/TransitionCustomLineItemStateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/TransitionCustomLineItemStateChangeBuilder.php @@ -22,26 +22,31 @@ final class TransitionCustomLineItemStateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $lineItemId; /** + * @var ?string */ private $stateId; /** + * @var ?ItemStateCollection */ private $nextValue; /** + * @var ?ItemStateCollection */ private $previousValue; @@ -49,6 +54,7 @@ final class TransitionCustomLineItemStateChangeBuilder implements Builder /** *

    Update action for transitionCustomLineItemState

    * + * @return null|string */ public function getChange() @@ -57,6 +63,7 @@ public function getChange() } /** + * @return null|string */ public function getLineItemId() @@ -65,6 +72,7 @@ public function getLineItemId() } /** + * @return null|string */ public function getStateId() @@ -73,6 +81,7 @@ public function getStateId() } /** + * @return null|ItemStateCollection */ public function getNextValue() @@ -81,6 +90,7 @@ public function getNextValue() } /** + * @return null|ItemStateCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/TransitionCustomLineItemStateChangeModel.php b/lib/commercetools-history/src/Models/Change/TransitionCustomLineItemStateChangeModel.php index 370a448a3c2..db6bc1ae850 100644 --- a/lib/commercetools-history/src/Models/Change/TransitionCustomLineItemStateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/TransitionCustomLineItemStateChangeModel.php @@ -23,31 +23,37 @@ final class TransitionCustomLineItemStateChangeModel extends JsonObjectModel imp public const DISCRIMINATOR_VALUE = 'TransitionCustomLineItemStateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?string */ protected $stateId; /** + * * @var ?ItemStateCollection */ protected $nextValue; /** + * * @var ?ItemStateCollection */ protected $previousValue; @@ -61,17 +67,19 @@ public function __construct( ?string $lineItemId = null, ?string $stateId = null, ?ItemStateCollection $nextValue = null, - ?ItemStateCollection $previousValue = null + ?ItemStateCollection $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->lineItemId = $lineItemId; $this->stateId = $stateId; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -91,6 +99,7 @@ public function getType() /** *

    Update action for transitionCustomLineItemState

    * + * * @return null|string */ public function getChange() @@ -108,6 +117,7 @@ public function getChange() } /** + * * @return null|string */ public function getLineItemId() @@ -125,6 +135,7 @@ public function getLineItemId() } /** + * * @return null|string */ public function getStateId() @@ -142,6 +153,7 @@ public function getStateId() } /** + * * @return null|ItemStateCollection */ public function getNextValue() @@ -159,6 +171,7 @@ public function getNextValue() } /** + * * @return null|ItemStateCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/TransitionLineItemStateChange.php b/lib/commercetools-history/src/Models/Change/TransitionLineItemStateChange.php index 048cfe16d7f..c3f4d9333e0 100644 --- a/lib/commercetools-history/src/Models/Change/TransitionLineItemStateChange.php +++ b/lib/commercetools-history/src/Models/Change/TransitionLineItemStateChange.php @@ -21,6 +21,7 @@ interface TransitionLineItemStateChange extends Change public const FIELD_PREVIOUS_VALUE = 'previousValue'; /** + * @return null|string */ public function getType(); @@ -28,26 +29,31 @@ public function getType(); /** *

    Update action for transitionLineItemState

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getLineItemId(); /** + * @return null|string */ public function getStateId(); /** + * @return null|ItemStateCollection */ public function getNextValue(); /** + * @return null|ItemStateCollection */ public function getPreviousValue(); diff --git a/lib/commercetools-history/src/Models/Change/TransitionLineItemStateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/TransitionLineItemStateChangeBuilder.php index 445eef78360..52fa03a2c53 100644 --- a/lib/commercetools-history/src/Models/Change/TransitionLineItemStateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/TransitionLineItemStateChangeBuilder.php @@ -22,26 +22,31 @@ final class TransitionLineItemStateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $lineItemId; /** + * @var ?string */ private $stateId; /** + * @var ?ItemStateCollection */ private $nextValue; /** + * @var ?ItemStateCollection */ private $previousValue; @@ -49,6 +54,7 @@ final class TransitionLineItemStateChangeBuilder implements Builder /** *

    Update action for transitionLineItemState

    * + * @return null|string */ public function getChange() @@ -57,6 +63,7 @@ public function getChange() } /** + * @return null|string */ public function getLineItemId() @@ -65,6 +72,7 @@ public function getLineItemId() } /** + * @return null|string */ public function getStateId() @@ -73,6 +81,7 @@ public function getStateId() } /** + * @return null|ItemStateCollection */ public function getNextValue() @@ -81,6 +90,7 @@ public function getNextValue() } /** + * @return null|ItemStateCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/TransitionLineItemStateChangeModel.php b/lib/commercetools-history/src/Models/Change/TransitionLineItemStateChangeModel.php index b2084a99695..e3ea4d722ef 100644 --- a/lib/commercetools-history/src/Models/Change/TransitionLineItemStateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/TransitionLineItemStateChangeModel.php @@ -23,31 +23,37 @@ final class TransitionLineItemStateChangeModel extends JsonObjectModel implement public const DISCRIMINATOR_VALUE = 'TransitionLineItemStateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?string */ protected $stateId; /** + * * @var ?ItemStateCollection */ protected $nextValue; /** + * * @var ?ItemStateCollection */ protected $previousValue; @@ -61,17 +67,19 @@ public function __construct( ?string $lineItemId = null, ?string $stateId = null, ?ItemStateCollection $nextValue = null, - ?ItemStateCollection $previousValue = null + ?ItemStateCollection $previousValue = null, + ?string $type = null ) { $this->change = $change; $this->lineItemId = $lineItemId; $this->stateId = $stateId; $this->nextValue = $nextValue; $this->previousValue = $previousValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -91,6 +99,7 @@ public function getType() /** *

    Update action for transitionLineItemState

    * + * * @return null|string */ public function getChange() @@ -108,6 +117,7 @@ public function getChange() } /** + * * @return null|string */ public function getLineItemId() @@ -125,6 +135,7 @@ public function getLineItemId() } /** + * * @return null|string */ public function getStateId() @@ -142,6 +153,7 @@ public function getStateId() } /** + * * @return null|ItemStateCollection */ public function getNextValue() @@ -159,6 +171,7 @@ public function getNextValue() } /** + * * @return null|ItemStateCollection */ public function getPreviousValue() diff --git a/lib/commercetools-history/src/Models/Change/TransitionStateChange.php b/lib/commercetools-history/src/Models/Change/TransitionStateChange.php index 22e016cde72..57f0e1e476f 100644 --- a/lib/commercetools-history/src/Models/Change/TransitionStateChange.php +++ b/lib/commercetools-history/src/Models/Change/TransitionStateChange.php @@ -19,6 +19,7 @@ interface TransitionStateChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Shape of the action for transitionState

    * + * @return null|string */ public function getChange(); /** + * @return null|Reference */ public function getPreviousValue(); /** + * @return null|Reference */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/TransitionStateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/TransitionStateChangeBuilder.php index a40863c5354..e63952ddc1a 100644 --- a/lib/commercetools-history/src/Models/Change/TransitionStateChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/TransitionStateChangeBuilder.php @@ -23,16 +23,19 @@ final class TransitionStateChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|Reference|ReferenceBuilder */ private $previousValue; /** + * @var null|Reference|ReferenceBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class TransitionStateChangeBuilder implements Builder /** *

    Shape of the action for transitionState

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|Reference */ public function getPreviousValue() @@ -56,6 +61,7 @@ public function getPreviousValue() } /** + * @return null|Reference */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/TransitionStateChangeModel.php b/lib/commercetools-history/src/Models/Change/TransitionStateChangeModel.php index e121652206a..f61a0b1df09 100644 --- a/lib/commercetools-history/src/Models/Change/TransitionStateChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/TransitionStateChangeModel.php @@ -24,21 +24,25 @@ final class TransitionStateChangeModel extends JsonObjectModel implements Transi public const DISCRIMINATOR_VALUE = 'TransitionStateChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?Reference */ protected $previousValue; /** + * * @var ?Reference */ protected $nextValue; @@ -50,15 +54,17 @@ final class TransitionStateChangeModel extends JsonObjectModel implements Transi public function __construct( ?string $change = null, ?Reference $previousValue = null, - ?Reference $nextValue = null + ?Reference $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Shape of the action for transitionState

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|Reference */ public function getPreviousValue() @@ -113,6 +121,7 @@ public function getPreviousValue() } /** + * * @return null|Reference */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/UnknownChange.php b/lib/commercetools-history/src/Models/Change/UnknownChange.php index 391018646d2..e0f2556087f 100644 --- a/lib/commercetools-history/src/Models/Change/UnknownChange.php +++ b/lib/commercetools-history/src/Models/Change/UnknownChange.php @@ -18,21 +18,25 @@ interface UnknownChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); /** + * @return null|mixed */ public function getPreviousValue(); /** + * @return null|mixed */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/UnknownChangeBuilder.php b/lib/commercetools-history/src/Models/Change/UnknownChangeBuilder.php index b07ae5f51ce..acde5da508d 100644 --- a/lib/commercetools-history/src/Models/Change/UnknownChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/UnknownChangeBuilder.php @@ -21,21 +21,25 @@ final class UnknownChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var null|mixed|mixed */ private $previousValue; /** + * @var null|mixed|mixed */ private $nextValue; /** + * @return null|string */ public function getChange() @@ -44,6 +48,7 @@ public function getChange() } /** + * @return null|mixed */ public function getPreviousValue() @@ -52,6 +57,7 @@ public function getPreviousValue() } /** + * @return null|mixed */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/UnknownChangeModel.php b/lib/commercetools-history/src/Models/Change/UnknownChangeModel.php index 5a576399486..9b0fbc43f73 100644 --- a/lib/commercetools-history/src/Models/Change/UnknownChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/UnknownChangeModel.php @@ -22,21 +22,25 @@ final class UnknownChangeModel extends JsonObjectModel implements UnknownChange public const DISCRIMINATOR_VALUE = 'UnknownChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?mixed */ protected $previousValue; /** + * * @var ?mixed */ protected $nextValue; @@ -48,15 +52,17 @@ final class UnknownChangeModel extends JsonObjectModel implements UnknownChange public function __construct( ?string $change = null, $previousValue = null, - $nextValue = null + $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->previousValue = $previousValue; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -74,6 +80,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() @@ -91,6 +98,7 @@ public function getChange() } /** + * * @return null|mixed */ public function getPreviousValue() @@ -108,6 +116,7 @@ public function getPreviousValue() } /** + * * @return null|mixed */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/UnpublishChange.php b/lib/commercetools-history/src/Models/Change/UnpublishChange.php index 6caad798b65..293dd5cdd98 100644 --- a/lib/commercetools-history/src/Models/Change/UnpublishChange.php +++ b/lib/commercetools-history/src/Models/Change/UnpublishChange.php @@ -16,11 +16,13 @@ interface UnpublishChange extends Change /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); diff --git a/lib/commercetools-history/src/Models/Change/UnpublishChangeBuilder.php b/lib/commercetools-history/src/Models/Change/UnpublishChangeBuilder.php index e78c78988cc..2edf08224ac 100644 --- a/lib/commercetools-history/src/Models/Change/UnpublishChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/UnpublishChangeBuilder.php @@ -21,11 +21,13 @@ final class UnpublishChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @return null|string */ public function getChange() diff --git a/lib/commercetools-history/src/Models/Change/UnpublishChangeModel.php b/lib/commercetools-history/src/Models/Change/UnpublishChangeModel.php index f3a2859be41..9478b49515a 100644 --- a/lib/commercetools-history/src/Models/Change/UnpublishChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/UnpublishChangeModel.php @@ -22,11 +22,13 @@ final class UnpublishChangeModel extends JsonObjectModel implements UnpublishCha public const DISCRIMINATOR_VALUE = 'UnpublishChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; @@ -36,13 +38,15 @@ final class UnpublishChangeModel extends JsonObjectModel implements UnpublishCha * @psalm-suppress MissingParamType */ public function __construct( - ?string $change = null + ?string $change = null, + ?string $type = null ) { $this->change = $change; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -60,6 +64,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() diff --git a/lib/commercetools-history/src/Models/Change/UpdateSyncInfoChange.php b/lib/commercetools-history/src/Models/Change/UpdateSyncInfoChange.php index 1a1689483c5..64a7b3445a4 100644 --- a/lib/commercetools-history/src/Models/Change/UpdateSyncInfoChange.php +++ b/lib/commercetools-history/src/Models/Change/UpdateSyncInfoChange.php @@ -19,6 +19,7 @@ interface UpdateSyncInfoChange extends Change public const FIELD_NEXT_VALUE = 'nextValue'; /** + * @return null|string */ public function getType(); @@ -26,16 +27,19 @@ public function getType(); /** *

    Update action for updateSyncInfo

    * + * @return null|string */ public function getChange(); /** + * @return null|string */ public function getChannelId(); /** + * @return null|SyncInfo */ public function getNextValue(); diff --git a/lib/commercetools-history/src/Models/Change/UpdateSyncInfoChangeBuilder.php b/lib/commercetools-history/src/Models/Change/UpdateSyncInfoChangeBuilder.php index 1e009de32ab..ea1bb0f6086 100644 --- a/lib/commercetools-history/src/Models/Change/UpdateSyncInfoChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/UpdateSyncInfoChangeBuilder.php @@ -23,16 +23,19 @@ final class UpdateSyncInfoChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @var ?string */ private $channelId; /** + * @var null|SyncInfo|SyncInfoBuilder */ private $nextValue; @@ -40,6 +43,7 @@ final class UpdateSyncInfoChangeBuilder implements Builder /** *

    Update action for updateSyncInfo

    * + * @return null|string */ public function getChange() @@ -48,6 +52,7 @@ public function getChange() } /** + * @return null|string */ public function getChannelId() @@ -56,6 +61,7 @@ public function getChannelId() } /** + * @return null|SyncInfo */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/UpdateSyncInfoChangeModel.php b/lib/commercetools-history/src/Models/Change/UpdateSyncInfoChangeModel.php index e3750045e0d..f11fda4dcc6 100644 --- a/lib/commercetools-history/src/Models/Change/UpdateSyncInfoChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/UpdateSyncInfoChangeModel.php @@ -24,21 +24,25 @@ final class UpdateSyncInfoChangeModel extends JsonObjectModel implements UpdateS public const DISCRIMINATOR_VALUE = 'UpdateSyncInfoChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; /** + * * @var ?string */ protected $channelId; /** + * * @var ?SyncInfo */ protected $nextValue; @@ -50,15 +54,17 @@ final class UpdateSyncInfoChangeModel extends JsonObjectModel implements UpdateS public function __construct( ?string $change = null, ?string $channelId = null, - ?SyncInfo $nextValue = null + ?SyncInfo $nextValue = null, + ?string $type = null ) { $this->change = $change; $this->channelId = $channelId; $this->nextValue = $nextValue; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -78,6 +84,7 @@ public function getType() /** *

    Update action for updateSyncInfo

    * + * * @return null|string */ public function getChange() @@ -95,6 +102,7 @@ public function getChange() } /** + * * @return null|string */ public function getChannelId() @@ -112,6 +120,7 @@ public function getChannelId() } /** + * * @return null|SyncInfo */ public function getNextValue() diff --git a/lib/commercetools-history/src/Models/Change/VerifyEmailChange.php b/lib/commercetools-history/src/Models/Change/VerifyEmailChange.php index 80e3d2dc51f..768344dd174 100644 --- a/lib/commercetools-history/src/Models/Change/VerifyEmailChange.php +++ b/lib/commercetools-history/src/Models/Change/VerifyEmailChange.php @@ -16,11 +16,13 @@ interface VerifyEmailChange extends Change /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getChange(); diff --git a/lib/commercetools-history/src/Models/Change/VerifyEmailChangeBuilder.php b/lib/commercetools-history/src/Models/Change/VerifyEmailChangeBuilder.php index 5a16e3d7c3d..bf68a4c4287 100644 --- a/lib/commercetools-history/src/Models/Change/VerifyEmailChangeBuilder.php +++ b/lib/commercetools-history/src/Models/Change/VerifyEmailChangeBuilder.php @@ -21,11 +21,13 @@ final class VerifyEmailChangeBuilder implements Builder { /** + * @var ?string */ private $change; /** + * @return null|string */ public function getChange() diff --git a/lib/commercetools-history/src/Models/Change/VerifyEmailChangeModel.php b/lib/commercetools-history/src/Models/Change/VerifyEmailChangeModel.php index 16f42735475..7bebcef9ec8 100644 --- a/lib/commercetools-history/src/Models/Change/VerifyEmailChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/VerifyEmailChangeModel.php @@ -22,11 +22,13 @@ final class VerifyEmailChangeModel extends JsonObjectModel implements VerifyEmai public const DISCRIMINATOR_VALUE = 'VerifyEmailChange'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $change; @@ -36,13 +38,15 @@ final class VerifyEmailChangeModel extends JsonObjectModel implements VerifyEmai * @psalm-suppress MissingParamType */ public function __construct( - ?string $change = null + ?string $change = null, + ?string $type = null ) { $this->change = $change; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -60,6 +64,7 @@ public function getType() } /** + * * @return null|string */ public function getChange() diff --git a/lib/commercetools-history/src/Models/ChangeHistory/ErrorObject.php b/lib/commercetools-history/src/Models/ChangeHistory/ErrorObject.php index d9e60659cda..9a834352108 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/ErrorObject.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/ErrorObject.php @@ -18,11 +18,13 @@ interface ErrorObject extends JsonObject public const FIELD_MESSAGE = 'message'; /** + * @return null|string */ public function getCode(); /** + * @return null|string */ public function getMessage(); diff --git a/lib/commercetools-history/src/Models/ChangeHistory/ErrorObjectBuilder.php b/lib/commercetools-history/src/Models/ChangeHistory/ErrorObjectBuilder.php index 8ac3621e4af..25d1577e6c6 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/ErrorObjectBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/ErrorObjectBuilder.php @@ -21,16 +21,19 @@ final class ErrorObjectBuilder implements Builder { /** + * @var ?string */ private $code; /** + * @var ?string */ private $message; /** + * @return null|string */ public function getCode() @@ -39,6 +42,7 @@ public function getCode() } /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-history/src/Models/ChangeHistory/ErrorObjectModel.php b/lib/commercetools-history/src/Models/ChangeHistory/ErrorObjectModel.php index 1e904a6fcfa..4b3874a0731 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/ErrorObjectModel.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/ErrorObjectModel.php @@ -22,11 +22,13 @@ final class ErrorObjectModel extends JsonObjectModel implements ErrorObject /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|string */ public function getCode() @@ -62,6 +65,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-history/src/Models/ChangeHistory/ErrorResponse.php b/lib/commercetools-history/src/Models/ChangeHistory/ErrorResponse.php index b77e838ee84..421c42d87b1 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/ErrorResponse.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/ErrorResponse.php @@ -21,26 +21,31 @@ interface ErrorResponse extends JsonObject public const FIELD_ERRORS = 'errors'; /** + * @return null|int */ public function getStatusCode(); /** + * @return null|string */ public function getMessage(); /** + * @return null|string */ public function getError(); /** + * @return null|string */ public function getError_description(); /** + * @return null|ErrorObjectCollection */ public function getErrors(); diff --git a/lib/commercetools-history/src/Models/ChangeHistory/ErrorResponseBuilder.php b/lib/commercetools-history/src/Models/ChangeHistory/ErrorResponseBuilder.php index d39bee1e6e8..6c100083131 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/ErrorResponseBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/ErrorResponseBuilder.php @@ -21,31 +21,37 @@ final class ErrorResponseBuilder implements Builder { /** + * @var ?int */ private $statusCode; /** + * @var ?string */ private $message; /** + * @var ?string */ private $error; /** + * @var ?string */ private $error_description; /** + * @var ?ErrorObjectCollection */ private $errors; /** + * @return null|int */ public function getStatusCode() @@ -54,6 +60,7 @@ public function getStatusCode() } /** + * @return null|string */ public function getMessage() @@ -62,6 +69,7 @@ public function getMessage() } /** + * @return null|string */ public function getError() @@ -70,6 +78,7 @@ public function getError() } /** + * @return null|string */ public function getError_description() @@ -78,6 +87,7 @@ public function getError_description() } /** + * @return null|ErrorObjectCollection */ public function getErrors() diff --git a/lib/commercetools-history/src/Models/ChangeHistory/ErrorResponseModel.php b/lib/commercetools-history/src/Models/ChangeHistory/ErrorResponseModel.php index 3d618a259ad..4be71d51ce5 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/ErrorResponseModel.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/ErrorResponseModel.php @@ -22,26 +22,31 @@ final class ErrorResponseModel extends JsonObjectModel implements ErrorResponse /** + * * @var ?int */ protected $statusCode; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $error; /** + * * @var ?string */ protected $error_description; /** + * * @var ?ErrorObjectCollection */ protected $errors; @@ -66,6 +71,7 @@ public function __construct( } /** + * * @return null|int */ public function getStatusCode() @@ -83,6 +89,7 @@ public function getStatusCode() } /** + * * @return null|string */ public function getMessage() @@ -100,6 +107,7 @@ public function getMessage() } /** + * * @return null|string */ public function getError() @@ -117,6 +125,7 @@ public function getError() } /** + * * @return null|string */ public function getError_description() @@ -134,6 +143,7 @@ public function getError_description() } /** + * * @return null|ErrorObjectCollection */ public function getErrors() diff --git a/lib/commercetools-history/src/Models/ChangeHistory/ModifiedBy.php b/lib/commercetools-history/src/Models/ChangeHistory/ModifiedBy.php index dec2d661b9f..65e57bc18f0 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/ModifiedBy.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/ModifiedBy.php @@ -26,6 +26,7 @@ interface ModifiedBy extends JsonObject *

    ID of the Merchant Center user who made the change. * Present only if the change was made in the Merchant Center.

    * + * @return null|string */ public function getId(); @@ -34,6 +35,7 @@ public function getId(); *

    Indicates whether the change was made by a user or the API client with or without an * External user ID.

    * + * @return null|string */ public function getType(); @@ -44,6 +46,7 @@ public function getType(); * the change was made using a token from the Password * Flow.

    * + * @return null|Reference */ public function getCustomer(); @@ -52,6 +55,7 @@ public function getCustomer(); *

    Present only if the change was made using a token from an Anonymous * Session.

    * + * @return null|string */ public function getAnonymousId(); @@ -61,6 +65,7 @@ public function getAnonymousId(); * Client that made the change. Present only if * the change was made using an API Client.

    * + * @return null|string */ public function getClientId(); @@ -68,6 +73,7 @@ public function getClientId(); /** *

    true if the change was made via Merchant Center or ImpEx.

    * + * @return null|bool */ public function getIsPlatformClient(); diff --git a/lib/commercetools-history/src/Models/ChangeHistory/ModifiedByBuilder.php b/lib/commercetools-history/src/Models/ChangeHistory/ModifiedByBuilder.php index 80aba75615d..32130738cd1 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/ModifiedByBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/ModifiedByBuilder.php @@ -23,31 +23,37 @@ final class ModifiedByBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $type; /** + * @var null|Reference|ReferenceBuilder */ private $customer; /** + * @var ?string */ private $anonymousId; /** + * @var ?string */ private $clientId; /** + * @var ?bool */ private $isPlatformClient; @@ -56,6 +62,7 @@ final class ModifiedByBuilder implements Builder *

    ID of the Merchant Center user who made the change. * Present only if the change was made in the Merchant Center.

    * + * @return null|string */ public function getId() @@ -67,6 +74,7 @@ public function getId() *

    Indicates whether the change was made by a user or the API client with or without an * External user ID.

    * + * @return null|string */ public function getType() @@ -80,6 +88,7 @@ public function getType() * the change was made using a token from the Password * Flow.

    * + * @return null|Reference */ public function getCustomer() @@ -91,6 +100,7 @@ public function getCustomer() *

    Present only if the change was made using a token from an Anonymous * Session.

    * + * @return null|string */ public function getAnonymousId() @@ -103,6 +113,7 @@ public function getAnonymousId() * Client that made the change. Present only if * the change was made using an API Client.

    * + * @return null|string */ public function getClientId() @@ -113,6 +124,7 @@ public function getClientId() /** *

    true if the change was made via Merchant Center or ImpEx.

    * + * @return null|bool */ public function getIsPlatformClient() diff --git a/lib/commercetools-history/src/Models/ChangeHistory/ModifiedByModel.php b/lib/commercetools-history/src/Models/ChangeHistory/ModifiedByModel.php index 62481e5e387..cc118b051fc 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/ModifiedByModel.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/ModifiedByModel.php @@ -24,31 +24,37 @@ final class ModifiedByModel extends JsonObjectModel implements ModifiedBy /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $type; /** + * * @var ?Reference */ protected $customer; /** + * * @var ?string */ protected $anonymousId; /** + * * @var ?string */ protected $clientId; /** + * * @var ?bool */ protected $isPlatformClient; @@ -78,6 +84,7 @@ public function __construct( *

    ID of the Merchant Center user who made the change. * Present only if the change was made in the Merchant Center.

    * + * * @return null|string */ public function getId() @@ -98,6 +105,7 @@ public function getId() *

    Indicates whether the change was made by a user or the API client with or without an * External user ID.

    * + * * @return null|string */ public function getType() @@ -120,6 +128,7 @@ public function getType() * the change was made using a token from the Password * Flow.

    * + * * @return null|Reference */ public function getCustomer() @@ -141,6 +150,7 @@ public function getCustomer() *

    Present only if the change was made using a token from an Anonymous * Session.

    * + * * @return null|string */ public function getAnonymousId() @@ -162,6 +172,7 @@ public function getAnonymousId() * Client that made the change. Present only if * the change was made using an API Client.

    * + * * @return null|string */ public function getClientId() @@ -181,6 +192,7 @@ public function getClientId() /** *

    true if the change was made via Merchant Center or ImpEx.

    * + * * @return null|bool */ public function getIsPlatformClient() diff --git a/lib/commercetools-history/src/Models/ChangeHistory/Record.php b/lib/commercetools-history/src/Models/ChangeHistory/Record.php index 12ea36c32a1..133ce56ae0d 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/Record.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/Record.php @@ -33,6 +33,7 @@ interface Record extends JsonObject /** *

    Version of the resource after the change.

    * + * @return null|int */ public function getVersion(); @@ -40,6 +41,7 @@ public function getVersion(); /** *

    Version of the resource before the change.

    * + * @return null|int */ public function getPreviousVersion(); @@ -47,6 +49,7 @@ public function getPreviousVersion(); /** *

    Type of the change (creation, update or deletion).

    * + * @return null|string */ public function getType(); @@ -54,6 +57,7 @@ public function getType(); /** *

    Information about the user or the API client who performed the change.

    * + * @return null|ModifiedBy */ public function getModifiedBy(); @@ -61,6 +65,7 @@ public function getModifiedBy(); /** *

    Date and time when the change was made.

    * + * @return null|string */ public function getModifiedAt(); @@ -68,6 +73,7 @@ public function getModifiedAt(); /** *

    Information that describes the resource after the change.

    * + * @return null|Label */ public function getLabel(); @@ -75,6 +81,7 @@ public function getLabel(); /** *

    Information that describes the resource before the change.

    * + * @return null|Label */ public function getPreviousLabel(); @@ -83,6 +90,7 @@ public function getPreviousLabel(); *

    Shows the differences in the resource between previousVersion and version. * The value is not identical to the actual array of update actions sent and is not limited to update actions (see, for example, Optimistic Concurrency Control).

    * + * @return null|ChangeCollection */ public function getChanges(); @@ -90,6 +98,7 @@ public function getChanges(); /** *

    Reference to the changed resource.

    * + * @return null|Reference */ public function getResource(); @@ -97,6 +106,7 @@ public function getResource(); /** *

    References to the Stores attached to the Change.

    * + * @return null|KeyReferenceCollection */ public function getStores(); @@ -105,6 +115,7 @@ public function getStores(); *

    true if no change was detected. * The version number of the resource can be increased even without any change in the resource.

    * + * @return null|bool */ public function getWithoutChanges(); diff --git a/lib/commercetools-history/src/Models/ChangeHistory/RecordBuilder.php b/lib/commercetools-history/src/Models/ChangeHistory/RecordBuilder.php index 09684fb942e..8e2cebea2ef 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/RecordBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/RecordBuilder.php @@ -27,56 +27,67 @@ final class RecordBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?int */ private $previousVersion; /** + * @var ?string */ private $type; /** + * @var null|ModifiedBy|ModifiedByBuilder */ private $modifiedBy; /** + * @var ?string */ private $modifiedAt; /** + * @var null|Label|LabelBuilder */ private $label; /** + * @var null|Label|LabelBuilder */ private $previousLabel; /** + * @var ?ChangeCollection */ private $changes; /** + * @var null|Reference|ReferenceBuilder */ private $resource; /** + * @var ?KeyReferenceCollection */ private $stores; /** + * @var ?bool */ private $withoutChanges; @@ -84,6 +95,7 @@ final class RecordBuilder implements Builder /** *

    Version of the resource after the change.

    * + * @return null|int */ public function getVersion() @@ -94,6 +106,7 @@ public function getVersion() /** *

    Version of the resource before the change.

    * + * @return null|int */ public function getPreviousVersion() @@ -104,6 +117,7 @@ public function getPreviousVersion() /** *

    Type of the change (creation, update or deletion).

    * + * @return null|string */ public function getType() @@ -114,6 +128,7 @@ public function getType() /** *

    Information about the user or the API client who performed the change.

    * + * @return null|ModifiedBy */ public function getModifiedBy() @@ -124,6 +139,7 @@ public function getModifiedBy() /** *

    Date and time when the change was made.

    * + * @return null|string */ public function getModifiedAt() @@ -134,6 +150,7 @@ public function getModifiedAt() /** *

    Information that describes the resource after the change.

    * + * @return null|Label */ public function getLabel() @@ -144,6 +161,7 @@ public function getLabel() /** *

    Information that describes the resource before the change.

    * + * @return null|Label */ public function getPreviousLabel() @@ -155,6 +173,7 @@ public function getPreviousLabel() *

    Shows the differences in the resource between previousVersion and version. * The value is not identical to the actual array of update actions sent and is not limited to update actions (see, for example, Optimistic Concurrency Control).

    * + * @return null|ChangeCollection */ public function getChanges() @@ -165,6 +184,7 @@ public function getChanges() /** *

    Reference to the changed resource.

    * + * @return null|Reference */ public function getResource() @@ -175,6 +195,7 @@ public function getResource() /** *

    References to the Stores attached to the Change.

    * + * @return null|KeyReferenceCollection */ public function getStores() @@ -186,6 +207,7 @@ public function getStores() *

    true if no change was detected. * The version number of the resource can be increased even without any change in the resource.

    * + * @return null|bool */ public function getWithoutChanges() diff --git a/lib/commercetools-history/src/Models/ChangeHistory/RecordModel.php b/lib/commercetools-history/src/Models/ChangeHistory/RecordModel.php index 64af0bba2fd..9e66c167dc4 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/RecordModel.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/RecordModel.php @@ -28,56 +28,67 @@ final class RecordModel extends JsonObjectModel implements Record /** + * * @var ?int */ protected $version; /** + * * @var ?int */ protected $previousVersion; /** + * * @var ?string */ protected $type; /** + * * @var ?ModifiedBy */ protected $modifiedBy; /** + * * @var ?string */ protected $modifiedAt; /** + * * @var ?Label */ protected $label; /** + * * @var ?Label */ protected $previousLabel; /** + * * @var ?ChangeCollection */ protected $changes; /** + * * @var ?Reference */ protected $resource; /** + * * @var ?KeyReferenceCollection */ protected $stores; /** + * * @var ?bool */ protected $withoutChanges; @@ -116,6 +127,7 @@ public function __construct( /** *

    Version of the resource after the change.

    * + * * @return null|int */ public function getVersion() @@ -135,6 +147,7 @@ public function getVersion() /** *

    Version of the resource before the change.

    * + * * @return null|int */ public function getPreviousVersion() @@ -154,6 +167,7 @@ public function getPreviousVersion() /** *

    Type of the change (creation, update or deletion).

    * + * * @return null|string */ public function getType() @@ -173,6 +187,7 @@ public function getType() /** *

    Information about the user or the API client who performed the change.

    * + * * @return null|ModifiedBy */ public function getModifiedBy() @@ -193,6 +208,7 @@ public function getModifiedBy() /** *

    Date and time when the change was made.

    * + * * @return null|string */ public function getModifiedAt() @@ -212,6 +228,7 @@ public function getModifiedAt() /** *

    Information that describes the resource after the change.

    * + * * @return null|Label */ public function getLabel() @@ -232,6 +249,7 @@ public function getLabel() /** *

    Information that describes the resource before the change.

    * + * * @return null|Label */ public function getPreviousLabel() @@ -253,6 +271,7 @@ public function getPreviousLabel() *

    Shows the differences in the resource between previousVersion and version. * The value is not identical to the actual array of update actions sent and is not limited to update actions (see, for example, Optimistic Concurrency Control).

    * + * * @return null|ChangeCollection */ public function getChanges() @@ -272,6 +291,7 @@ public function getChanges() /** *

    Reference to the changed resource.

    * + * * @return null|Reference */ public function getResource() @@ -292,6 +312,7 @@ public function getResource() /** *

    References to the Stores attached to the Change.

    * + * * @return null|KeyReferenceCollection */ public function getStores() @@ -312,6 +333,7 @@ public function getStores() *

    true if no change was detected. * The version number of the resource can be increased even without any change in the resource.

    * + * * @return null|bool */ public function getWithoutChanges() diff --git a/lib/commercetools-history/src/Models/ChangeHistory/RecordPagedQueryResponse.php b/lib/commercetools-history/src/Models/ChangeHistory/RecordPagedQueryResponse.php index d1f99b40a89..2d556a3a613 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/RecordPagedQueryResponse.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/RecordPagedQueryResponse.php @@ -23,6 +23,7 @@ interface RecordPagedQueryResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -30,6 +31,7 @@ public function getLimit(); /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -38,6 +40,7 @@ public function getCount(); *

    Total number of results matching the query. * This number is an estimation and not strongly consistent.

    * + * @return null|int */ public function getTotal(); @@ -45,11 +48,13 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); /** + * @return null|RecordCollection */ public function getResults(); diff --git a/lib/commercetools-history/src/Models/ChangeHistory/RecordPagedQueryResponseBuilder.php b/lib/commercetools-history/src/Models/ChangeHistory/RecordPagedQueryResponseBuilder.php index a887132ea27..5af782b3905 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/RecordPagedQueryResponseBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/RecordPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class RecordPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?RecordCollection */ private $results; @@ -48,6 +53,7 @@ final class RecordPagedQueryResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -69,6 +76,7 @@ public function getCount() *

    Total number of results matching the query. * This number is an estimation and not strongly consistent.

    * + * @return null|int */ public function getTotal() @@ -79,6 +87,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -87,6 +96,7 @@ public function getOffset() } /** + * @return null|RecordCollection */ public function getResults() diff --git a/lib/commercetools-history/src/Models/ChangeHistory/RecordPagedQueryResponseModel.php b/lib/commercetools-history/src/Models/ChangeHistory/RecordPagedQueryResponseModel.php index 67225cd7b9d..0c79a90f8b6 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/RecordPagedQueryResponseModel.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/RecordPagedQueryResponseModel.php @@ -22,26 +22,31 @@ final class RecordPagedQueryResponseModel extends JsonObjectModel implements Rec /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?RecordCollection */ protected $results; @@ -68,6 +73,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -87,6 +93,7 @@ public function getLimit() /** *

    Actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -107,6 +114,7 @@ public function getCount() *

    Total number of results matching the query. * This number is an estimation and not strongly consistent.

    * + * * @return null|int */ public function getTotal() @@ -126,6 +134,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -143,6 +152,7 @@ public function getOffset() } /** + * * @return null|RecordCollection */ public function getResults() diff --git a/lib/commercetools-history/src/Models/ChangeValue/AssetChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/AssetChangeValue.php index 522bee28ae5..cc9b76f9f5d 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/AssetChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/AssetChangeValue.php @@ -19,11 +19,13 @@ interface AssetChangeValue extends JsonObject public const FIELD_NAME = 'name'; /** + * @return null|string */ public function getId(); /** + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/AssetChangeValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/AssetChangeValueBuilder.php index ad8e9c47f28..6e807ce1caf 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/AssetChangeValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/AssetChangeValueBuilder.php @@ -23,16 +23,19 @@ final class AssetChangeValueBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @return null|string */ public function getId() @@ -41,6 +44,7 @@ public function getId() } /** + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-history/src/Models/ChangeValue/AssetChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/AssetChangeValueModel.php index a50c798911a..7b163d5d29d 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/AssetChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/AssetChangeValueModel.php @@ -24,11 +24,13 @@ final class AssetChangeValueModel extends JsonObjectModel implements AssetChange /** + * * @var ?string */ protected $id; /** + * * @var ?LocalizedString */ protected $name; @@ -47,6 +49,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -64,6 +67,7 @@ public function getId() } /** + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-history/src/Models/ChangeValue/AttributeValue.php b/lib/commercetools-history/src/Models/ChangeValue/AttributeValue.php index 9295ad4a58e..16d49daa3ff 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/AttributeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/AttributeValue.php @@ -18,11 +18,13 @@ interface AttributeValue extends JsonObject public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getName(); /** + * @return null|mixed */ public function getValue(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/AttributeValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/AttributeValueBuilder.php index c76befc8caa..2240a1cea58 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/AttributeValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/AttributeValueBuilder.php @@ -21,16 +21,19 @@ final class AttributeValueBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @return null|string */ public function getName() @@ -39,6 +42,7 @@ public function getName() } /** + * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-history/src/Models/ChangeValue/AttributeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/AttributeValueModel.php index 16aa5197e7d..16e3c4ecac5 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/AttributeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/AttributeValueModel.php @@ -22,11 +22,13 @@ final class AttributeValueModel extends JsonObjectModel implements AttributeValu /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|string */ public function getName() @@ -62,6 +65,7 @@ public function getName() } /** + * * @return null|mixed */ public function getValue() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetChangeValue.php index 091551f6c64..cb48d25b9e4 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetChangeValue.php @@ -17,6 +17,7 @@ interface ChangeTargetChangeValue extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetChangeValueModel.php index 8b0b8a9e823..cd9b74f8b6d 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetChangeValueModel.php @@ -22,6 +22,7 @@ final class ChangeTargetChangeValueModel extends JsonObjectModel implements Chan public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -42,11 +43,14 @@ final class ChangeTargetChangeValueModel extends JsonObjectModel implements Chan * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; + } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetCustomLineItemsChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetCustomLineItemsChangeValue.php index e1bc76fc648..b75d21e3b37 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetCustomLineItemsChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetCustomLineItemsChangeValue.php @@ -17,11 +17,13 @@ interface ChangeTargetCustomLineItemsChangeValue extends ChangeTargetChangeValue public const FIELD_PREDICATE = 'predicate'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getPredicate(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetCustomLineItemsChangeValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetCustomLineItemsChangeValueBuilder.php index ecbf9d8299c..23569ef1078 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetCustomLineItemsChangeValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetCustomLineItemsChangeValueBuilder.php @@ -21,11 +21,13 @@ final class ChangeTargetCustomLineItemsChangeValueBuilder implements Builder { /** + * @var ?string */ private $predicate; /** + * @return null|string */ public function getPredicate() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetCustomLineItemsChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetCustomLineItemsChangeValueModel.php index ae5b2d9af5c..aa16694e7d3 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetCustomLineItemsChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetCustomLineItemsChangeValueModel.php @@ -22,11 +22,13 @@ final class ChangeTargetCustomLineItemsChangeValueModel extends JsonObjectModel public const DISCRIMINATOR_VALUE = 'customLineItems'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $predicate; @@ -36,13 +38,15 @@ final class ChangeTargetCustomLineItemsChangeValueModel extends JsonObjectModel * @psalm-suppress MissingParamType */ public function __construct( - ?string $predicate = null + ?string $predicate = null, + ?string $type = null ) { $this->predicate = $predicate; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -60,6 +64,7 @@ public function getType() } /** + * * @return null|string */ public function getPredicate() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetLineItemsChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetLineItemsChangeValue.php index c0630d055fb..78213285ae1 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetLineItemsChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetLineItemsChangeValue.php @@ -17,11 +17,13 @@ interface ChangeTargetLineItemsChangeValue extends ChangeTargetChangeValue public const FIELD_PREDICATE = 'predicate'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getPredicate(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetLineItemsChangeValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetLineItemsChangeValueBuilder.php index 5392269d848..0abe10ab4ae 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetLineItemsChangeValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetLineItemsChangeValueBuilder.php @@ -21,11 +21,13 @@ final class ChangeTargetLineItemsChangeValueBuilder implements Builder { /** + * @var ?string */ private $predicate; /** + * @return null|string */ public function getPredicate() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetLineItemsChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetLineItemsChangeValueModel.php index 24ed64f7c94..fea25fc65e2 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetLineItemsChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetLineItemsChangeValueModel.php @@ -22,11 +22,13 @@ final class ChangeTargetLineItemsChangeValueModel extends JsonObjectModel implem public const DISCRIMINATOR_VALUE = 'lineItems'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $predicate; @@ -36,13 +38,15 @@ final class ChangeTargetLineItemsChangeValueModel extends JsonObjectModel implem * @psalm-suppress MissingParamType */ public function __construct( - ?string $predicate = null + ?string $predicate = null, + ?string $type = null ) { $this->predicate = $predicate; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -60,6 +64,7 @@ public function getType() } /** + * * @return null|string */ public function getPredicate() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyCustomLineItemsChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyCustomLineItemsChangeValue.php index d26ed018834..a90201df880 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyCustomLineItemsChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyCustomLineItemsChangeValue.php @@ -21,11 +21,13 @@ interface ChangeTargetMultiBuyCustomLineItemsChangeValue extends ChangeTargetCha public const FIELD_SELECTION_MODE = 'selectionMode'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getPredicate(); @@ -33,6 +35,7 @@ public function getPredicate(); /** *

    Quantity of line items that need to be present in order to trigger an application of this discount.

    * + * @return null|int */ public function getTriggerQuantity(); @@ -40,6 +43,7 @@ public function getTriggerQuantity(); /** *

    Quantity of line items that are discounted per application of this discount.

    * + * @return null|int */ public function getDiscountedQuantity(); @@ -47,11 +51,13 @@ public function getDiscountedQuantity(); /** *

    Maximum number of applications of this discount.

    * + * @return null|int */ public function getMaxOccurrence(); /** + * @return null|string */ public function getSelectionMode(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder.php index 53995770938..37e95d0bd63 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder.php @@ -21,31 +21,37 @@ final class ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder implements Builder { /** + * @var ?string */ private $predicate; /** + * @var ?int */ private $triggerQuantity; /** + * @var ?int */ private $discountedQuantity; /** + * @var ?int */ private $maxOccurrence; /** + * @var ?string */ private $selectionMode; /** + * @return null|string */ public function getPredicate() @@ -56,6 +62,7 @@ public function getPredicate() /** *

    Quantity of line items that need to be present in order to trigger an application of this discount.

    * + * @return null|int */ public function getTriggerQuantity() @@ -66,6 +73,7 @@ public function getTriggerQuantity() /** *

    Quantity of line items that are discounted per application of this discount.

    * + * @return null|int */ public function getDiscountedQuantity() @@ -76,6 +84,7 @@ public function getDiscountedQuantity() /** *

    Maximum number of applications of this discount.

    * + * @return null|int */ public function getMaxOccurrence() @@ -84,6 +93,7 @@ public function getMaxOccurrence() } /** + * @return null|string */ public function getSelectionMode() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyCustomLineItemsChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyCustomLineItemsChangeValueModel.php index ffd4da165a6..d3f13486b5f 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyCustomLineItemsChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyCustomLineItemsChangeValueModel.php @@ -22,31 +22,37 @@ final class ChangeTargetMultiBuyCustomLineItemsChangeValueModel extends JsonObje public const DISCRIMINATOR_VALUE = 'multiBuyCustomLineItems'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $predicate; /** + * * @var ?int */ protected $triggerQuantity; /** + * * @var ?int */ protected $discountedQuantity; /** + * * @var ?int */ protected $maxOccurrence; /** + * * @var ?string */ protected $selectionMode; @@ -60,17 +66,19 @@ public function __construct( ?int $triggerQuantity = null, ?int $discountedQuantity = null, ?int $maxOccurrence = null, - ?string $selectionMode = null + ?string $selectionMode = null, + ?string $type = null ) { $this->predicate = $predicate; $this->triggerQuantity = $triggerQuantity; $this->discountedQuantity = $discountedQuantity; $this->maxOccurrence = $maxOccurrence; $this->selectionMode = $selectionMode; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -88,6 +96,7 @@ public function getType() } /** + * * @return null|string */ public function getPredicate() @@ -107,6 +116,7 @@ public function getPredicate() /** *

    Quantity of line items that need to be present in order to trigger an application of this discount.

    * + * * @return null|int */ public function getTriggerQuantity() @@ -126,6 +136,7 @@ public function getTriggerQuantity() /** *

    Quantity of line items that are discounted per application of this discount.

    * + * * @return null|int */ public function getDiscountedQuantity() @@ -145,6 +156,7 @@ public function getDiscountedQuantity() /** *

    Maximum number of applications of this discount.

    * + * * @return null|int */ public function getMaxOccurrence() @@ -162,6 +174,7 @@ public function getMaxOccurrence() } /** + * * @return null|string */ public function getSelectionMode() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyLineItemsChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyLineItemsChangeValue.php index 181b21b6233..47cc219ee3e 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyLineItemsChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyLineItemsChangeValue.php @@ -21,11 +21,13 @@ interface ChangeTargetMultiBuyLineItemsChangeValue extends ChangeTargetChangeVal public const FIELD_SELECTION_MODE = 'selectionMode'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getPredicate(); @@ -33,6 +35,7 @@ public function getPredicate(); /** *

    Quantity of line items that need to be present in order to trigger an application of this discount.

    * + * @return null|int */ public function getTriggerQuantity(); @@ -40,6 +43,7 @@ public function getTriggerQuantity(); /** *

    Quantity of line items that are discounted per application of this discount.

    * + * @return null|int */ public function getDiscountedQuantity(); @@ -47,11 +51,13 @@ public function getDiscountedQuantity(); /** *

    Maximum number of applications of this discount.

    * + * @return null|int */ public function getMaxOccurrence(); /** + * @return null|string */ public function getSelectionMode(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyLineItemsChangeValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyLineItemsChangeValueBuilder.php index d2dae806984..5a7a76789ad 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyLineItemsChangeValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyLineItemsChangeValueBuilder.php @@ -21,31 +21,37 @@ final class ChangeTargetMultiBuyLineItemsChangeValueBuilder implements Builder { /** + * @var ?string */ private $predicate; /** + * @var ?int */ private $triggerQuantity; /** + * @var ?int */ private $discountedQuantity; /** + * @var ?int */ private $maxOccurrence; /** + * @var ?string */ private $selectionMode; /** + * @return null|string */ public function getPredicate() @@ -56,6 +62,7 @@ public function getPredicate() /** *

    Quantity of line items that need to be present in order to trigger an application of this discount.

    * + * @return null|int */ public function getTriggerQuantity() @@ -66,6 +73,7 @@ public function getTriggerQuantity() /** *

    Quantity of line items that are discounted per application of this discount.

    * + * @return null|int */ public function getDiscountedQuantity() @@ -76,6 +84,7 @@ public function getDiscountedQuantity() /** *

    Maximum number of applications of this discount.

    * + * @return null|int */ public function getMaxOccurrence() @@ -84,6 +93,7 @@ public function getMaxOccurrence() } /** + * @return null|string */ public function getSelectionMode() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyLineItemsChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyLineItemsChangeValueModel.php index 7d4e84c7f0b..7f5a9087149 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyLineItemsChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetMultiBuyLineItemsChangeValueModel.php @@ -22,31 +22,37 @@ final class ChangeTargetMultiBuyLineItemsChangeValueModel extends JsonObjectMode public const DISCRIMINATOR_VALUE = 'multiBuyLineItems'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $predicate; /** + * * @var ?int */ protected $triggerQuantity; /** + * * @var ?int */ protected $discountedQuantity; /** + * * @var ?int */ protected $maxOccurrence; /** + * * @var ?string */ protected $selectionMode; @@ -60,17 +66,19 @@ public function __construct( ?int $triggerQuantity = null, ?int $discountedQuantity = null, ?int $maxOccurrence = null, - ?string $selectionMode = null + ?string $selectionMode = null, + ?string $type = null ) { $this->predicate = $predicate; $this->triggerQuantity = $triggerQuantity; $this->discountedQuantity = $discountedQuantity; $this->maxOccurrence = $maxOccurrence; $this->selectionMode = $selectionMode; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -88,6 +96,7 @@ public function getType() } /** + * * @return null|string */ public function getPredicate() @@ -107,6 +116,7 @@ public function getPredicate() /** *

    Quantity of line items that need to be present in order to trigger an application of this discount.

    * + * * @return null|int */ public function getTriggerQuantity() @@ -126,6 +136,7 @@ public function getTriggerQuantity() /** *

    Quantity of line items that are discounted per application of this discount.

    * + * * @return null|int */ public function getDiscountedQuantity() @@ -145,6 +156,7 @@ public function getDiscountedQuantity() /** *

    Maximum number of applications of this discount.

    * + * * @return null|int */ public function getMaxOccurrence() @@ -162,6 +174,7 @@ public function getMaxOccurrence() } /** + * * @return null|string */ public function getSelectionMode() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetShippingChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetShippingChangeValue.php index 9704e2e2bc2..fb63abda3b1 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetShippingChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetShippingChangeValue.php @@ -16,6 +16,7 @@ interface ChangeTargetShippingChangeValue extends ChangeTargetChangeValue /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetShippingChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetShippingChangeValueModel.php index 010ba514004..1fc2b68e479 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetShippingChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeTargetShippingChangeValueModel.php @@ -22,6 +22,7 @@ final class ChangeTargetShippingChangeValueModel extends JsonObjectModel impleme public const DISCRIMINATOR_VALUE = 'shipping'; /** + * * @var ?string */ protected $type; @@ -31,11 +32,13 @@ final class ChangeTargetShippingChangeValueModel extends JsonObjectModel impleme * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueAbsoluteChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueAbsoluteChangeValue.php index 95fa8939cdc..4e8ae404621 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueAbsoluteChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueAbsoluteChangeValue.php @@ -18,11 +18,13 @@ interface ChangeValueAbsoluteChangeValue extends ChangeValueChangeValue public const FIELD_MONEY = 'money'; /** + * @return null|string */ public function getType(); /** + * @return null|MoneyCollection */ public function getMoney(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueAbsoluteChangeValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueAbsoluteChangeValueBuilder.php index 8c8632d0238..0b27799d89b 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueAbsoluteChangeValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueAbsoluteChangeValueBuilder.php @@ -22,11 +22,13 @@ final class ChangeValueAbsoluteChangeValueBuilder implements Builder { /** + * @var ?MoneyCollection */ private $money; /** + * @return null|MoneyCollection */ public function getMoney() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueAbsoluteChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueAbsoluteChangeValueModel.php index 1c96ed1cd97..f821e1d7f07 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueAbsoluteChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueAbsoluteChangeValueModel.php @@ -23,11 +23,13 @@ final class ChangeValueAbsoluteChangeValueModel extends JsonObjectModel implemen public const DISCRIMINATOR_VALUE = 'absolute'; /** + * * @var ?string */ protected $type; /** + * * @var ?MoneyCollection */ protected $money; @@ -37,13 +39,15 @@ final class ChangeValueAbsoluteChangeValueModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?MoneyCollection $money = null + ?MoneyCollection $money = null, + ?string $type = null ) { $this->money = $money; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() } /** + * * @return null|MoneyCollection */ public function getMoney() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueChangeValue.php index 36c4b0a1b10..26c6a535ade 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueChangeValue.php @@ -17,6 +17,7 @@ interface ChangeValueChangeValue extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueChangeValueModel.php index 8dafa8beaf6..4a8b74599ae 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueChangeValueModel.php @@ -22,6 +22,7 @@ final class ChangeValueChangeValueModel extends JsonObjectModel implements Chang public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -41,11 +42,14 @@ final class ChangeValueChangeValueModel extends JsonObjectModel implements Chang * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; + } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueExternalChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueExternalChangeValue.php index 75391d87347..8a675d0f18f 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueExternalChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueExternalChangeValue.php @@ -16,6 +16,7 @@ interface ChangeValueExternalChangeValue extends ChangeValueChangeValue /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueExternalChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueExternalChangeValueModel.php index 37aef26aa36..89731c77d6d 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueExternalChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueExternalChangeValueModel.php @@ -22,6 +22,7 @@ final class ChangeValueExternalChangeValueModel extends JsonObjectModel implemen public const DISCRIMINATOR_VALUE = 'external'; /** + * * @var ?string */ protected $type; @@ -31,11 +32,13 @@ final class ChangeValueExternalChangeValueModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueGiftLineItemChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueGiftLineItemChangeValue.php index 4002a863e52..9ffec388db9 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueGiftLineItemChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueGiftLineItemChangeValue.php @@ -21,26 +21,31 @@ interface ChangeValueGiftLineItemChangeValue extends ChangeValueChangeValue public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; /** + * @return null|string */ public function getType(); /** + * @return null|Reference */ public function getProduct(); /** + * @return null|int */ public function getVariantId(); /** + * @return null|Reference */ public function getSupplyChannel(); /** + * @return null|Reference */ public function getDistributionChannel(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueGiftLineItemChangeValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueGiftLineItemChangeValueBuilder.php index 61da333d215..568c5329aa9 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueGiftLineItemChangeValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueGiftLineItemChangeValueBuilder.php @@ -23,26 +23,31 @@ final class ChangeValueGiftLineItemChangeValueBuilder implements Builder { /** + * @var null|Reference|ReferenceBuilder */ private $product; /** + * @var ?int */ private $variantId; /** + * @var null|Reference|ReferenceBuilder */ private $supplyChannel; /** + * @var null|Reference|ReferenceBuilder */ private $distributionChannel; /** + * @return null|Reference */ public function getProduct() @@ -51,6 +56,7 @@ public function getProduct() } /** + * @return null|int */ public function getVariantId() @@ -59,6 +65,7 @@ public function getVariantId() } /** + * @return null|Reference */ public function getSupplyChannel() @@ -67,6 +74,7 @@ public function getSupplyChannel() } /** + * @return null|Reference */ public function getDistributionChannel() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueGiftLineItemChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueGiftLineItemChangeValueModel.php index d4889e354c8..31dbe51ae6f 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueGiftLineItemChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueGiftLineItemChangeValueModel.php @@ -24,26 +24,31 @@ final class ChangeValueGiftLineItemChangeValueModel extends JsonObjectModel impl public const DISCRIMINATOR_VALUE = 'giftLineItem'; /** + * * @var ?string */ protected $type; /** + * * @var ?Reference */ protected $product; /** + * * @var ?int */ protected $variantId; /** + * * @var ?Reference */ protected $supplyChannel; /** + * * @var ?Reference */ protected $distributionChannel; @@ -56,16 +61,18 @@ public function __construct( ?Reference $product = null, ?int $variantId = null, ?Reference $supplyChannel = null, - ?Reference $distributionChannel = null + ?Reference $distributionChannel = null, + ?string $type = null ) { $this->product = $product; $this->variantId = $variantId; $this->supplyChannel = $supplyChannel; $this->distributionChannel = $distributionChannel; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -83,6 +90,7 @@ public function getType() } /** + * * @return null|Reference */ public function getProduct() @@ -101,6 +109,7 @@ public function getProduct() } /** + * * @return null|int */ public function getVariantId() @@ -118,6 +127,7 @@ public function getVariantId() } /** + * * @return null|Reference */ public function getSupplyChannel() @@ -136,6 +146,7 @@ public function getSupplyChannel() } /** + * * @return null|Reference */ public function getDistributionChannel() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueRelativeChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueRelativeChangeValue.php index 54dd3e46a50..3f7cc11ce39 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueRelativeChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueRelativeChangeValue.php @@ -17,11 +17,13 @@ interface ChangeValueRelativeChangeValue extends ChangeValueChangeValue public const FIELD_PERMYRIAD = 'permyriad'; /** + * @return null|string */ public function getType(); /** + * @return null|int */ public function getPermyriad(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueRelativeChangeValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueRelativeChangeValueBuilder.php index 05b4a58d3c7..c0f7711557b 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueRelativeChangeValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueRelativeChangeValueBuilder.php @@ -21,11 +21,13 @@ final class ChangeValueRelativeChangeValueBuilder implements Builder { /** + * @var ?int */ private $permyriad; /** + * @return null|int */ public function getPermyriad() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueRelativeChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueRelativeChangeValueModel.php index eb29da65ce5..01c278ffa2f 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ChangeValueRelativeChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ChangeValueRelativeChangeValueModel.php @@ -22,11 +22,13 @@ final class ChangeValueRelativeChangeValueModel extends JsonObjectModel implemen public const DISCRIMINATOR_VALUE = 'relative'; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $permyriad; @@ -36,13 +38,15 @@ final class ChangeValueRelativeChangeValueModel extends JsonObjectModel implemen * @psalm-suppress MissingParamType */ public function __construct( - ?int $permyriad = null + ?int $permyriad = null, + ?string $type = null ) { $this->permyriad = $permyriad; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -60,6 +64,7 @@ public function getType() } /** + * * @return null|int */ public function getPermyriad() diff --git a/lib/commercetools-history/src/Models/ChangeValue/CustomFieldExpandedValue.php b/lib/commercetools-history/src/Models/ChangeValue/CustomFieldExpandedValue.php index 8398cfc07d0..9a0bd6422fd 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/CustomFieldExpandedValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/CustomFieldExpandedValue.php @@ -22,16 +22,19 @@ interface CustomFieldExpandedValue extends JsonObject /** *

    Name of a custom field.

    * + * @return null|string */ public function getName(); /** + * @return null|mixed */ public function getValue(); /** + * @return null|LocalizedString */ public function getLabel(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/CustomFieldExpandedValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/CustomFieldExpandedValueBuilder.php index edaf8b9e837..4064919ad6b 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/CustomFieldExpandedValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/CustomFieldExpandedValueBuilder.php @@ -23,16 +23,19 @@ final class CustomFieldExpandedValueBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|mixed|mixed */ private $value; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; @@ -40,6 +43,7 @@ final class CustomFieldExpandedValueBuilder implements Builder /** *

    Name of a custom field.

    * + * @return null|string */ public function getName() @@ -48,6 +52,7 @@ public function getName() } /** + * @return null|mixed */ public function getValue() @@ -56,6 +61,7 @@ public function getValue() } /** + * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-history/src/Models/ChangeValue/CustomFieldExpandedValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/CustomFieldExpandedValueModel.php index 51bbdae0395..b266b623a63 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/CustomFieldExpandedValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/CustomFieldExpandedValueModel.php @@ -24,16 +24,19 @@ final class CustomFieldExpandedValueModel extends JsonObjectModel implements Cus /** + * * @var ?string */ protected $name; /** + * * @var ?mixed */ protected $value; /** + * * @var ?LocalizedString */ protected $label; @@ -56,6 +59,7 @@ public function __construct( /** *

    Name of a custom field.

    * + * * @return null|string */ public function getName() @@ -73,6 +77,7 @@ public function getName() } /** + * * @return null|mixed */ public function getValue() @@ -90,6 +95,7 @@ public function getValue() } /** + * * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-history/src/Models/ChangeValue/CustomShippingMethodChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/CustomShippingMethodChangeValue.php index daccfb0c079..4b2f0456818 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/CustomShippingMethodChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/CustomShippingMethodChangeValue.php @@ -17,6 +17,7 @@ interface CustomShippingMethodChangeValue extends JsonObject public const FIELD_NAME = 'name'; /** + * @return null|string */ public function getName(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/CustomShippingMethodChangeValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/CustomShippingMethodChangeValueBuilder.php index 1f6f732d379..8591f174256 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/CustomShippingMethodChangeValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/CustomShippingMethodChangeValueBuilder.php @@ -21,11 +21,13 @@ final class CustomShippingMethodChangeValueBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @return null|string */ public function getName() diff --git a/lib/commercetools-history/src/Models/ChangeValue/CustomShippingMethodChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/CustomShippingMethodChangeValueModel.php index 0d4bfa24e39..8b36b2fc49e 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/CustomShippingMethodChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/CustomShippingMethodChangeValueModel.php @@ -22,6 +22,7 @@ final class CustomShippingMethodChangeValueModel extends JsonObjectModel impleme /** + * * @var ?string */ protected $name; @@ -38,6 +39,7 @@ public function __construct( } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-history/src/Models/ChangeValue/DeliveryChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/DeliveryChangeValue.php index 81a447c9bb7..471f31170f5 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/DeliveryChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/DeliveryChangeValue.php @@ -22,16 +22,19 @@ interface DeliveryChangeValue extends JsonObject public const FIELD_PARCELS = 'parcels'; /** + * @return null|DeliveryItemCollection */ public function getItems(); /** + * @return null|Address */ public function getAddress(); /** + * @return null|ParcelCollection */ public function getParcels(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/DeliveryChangeValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/DeliveryChangeValueBuilder.php index eea793bef67..552f235e069 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/DeliveryChangeValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/DeliveryChangeValueBuilder.php @@ -25,21 +25,25 @@ final class DeliveryChangeValueBuilder implements Builder { /** + * @var ?DeliveryItemCollection */ private $items; /** + * @var null|Address|AddressBuilder */ private $address; /** + * @var ?ParcelCollection */ private $parcels; /** + * @return null|DeliveryItemCollection */ public function getItems() @@ -48,6 +52,7 @@ public function getItems() } /** + * @return null|Address */ public function getAddress() @@ -56,6 +61,7 @@ public function getAddress() } /** + * @return null|ParcelCollection */ public function getParcels() diff --git a/lib/commercetools-history/src/Models/ChangeValue/DeliveryChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/DeliveryChangeValueModel.php index 6ac7ee70391..6b6b31c6481 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/DeliveryChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/DeliveryChangeValueModel.php @@ -26,16 +26,19 @@ final class DeliveryChangeValueModel extends JsonObjectModel implements Delivery /** + * * @var ?DeliveryItemCollection */ protected $items; /** + * * @var ?Address */ protected $address; /** + * * @var ?ParcelCollection */ protected $parcels; @@ -56,6 +59,7 @@ public function __construct( } /** + * * @return null|DeliveryItemCollection */ public function getItems() @@ -73,6 +77,7 @@ public function getItems() } /** + * * @return null|Address */ public function getAddress() @@ -91,6 +96,7 @@ public function getAddress() } /** + * * @return null|ParcelCollection */ public function getParcels() diff --git a/lib/commercetools-history/src/Models/ChangeValue/EnumValue.php b/lib/commercetools-history/src/Models/ChangeValue/EnumValue.php index ba42e4325f8..0b339ed6f37 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/EnumValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/EnumValue.php @@ -18,11 +18,13 @@ interface EnumValue extends JsonObject public const FIELD_LABEL = 'label'; /** + * @return null|string */ public function getKey(); /** + * @return null|string */ public function getLabel(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/EnumValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/EnumValueBuilder.php index c1cc9b7ba3a..4376a50fd1c 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/EnumValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/EnumValueBuilder.php @@ -21,16 +21,19 @@ final class EnumValueBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $label; /** + * @return null|string */ public function getKey() @@ -39,6 +42,7 @@ public function getKey() } /** + * @return null|string */ public function getLabel() diff --git a/lib/commercetools-history/src/Models/ChangeValue/EnumValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/EnumValueModel.php index ddf55ff7a92..93bdf9c0645 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/EnumValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/EnumValueModel.php @@ -22,11 +22,13 @@ final class EnumValueModel extends JsonObjectModel implements EnumValue /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $label; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|string */ public function getKey() @@ -62,6 +65,7 @@ public function getKey() } /** + * * @return null|string */ public function getLabel() diff --git a/lib/commercetools-history/src/Models/ChangeValue/FieldDefinitionOrderValue.php b/lib/commercetools-history/src/Models/ChangeValue/FieldDefinitionOrderValue.php index b9d7fd625f3..986d1227197 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/FieldDefinitionOrderValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/FieldDefinitionOrderValue.php @@ -19,11 +19,13 @@ interface FieldDefinitionOrderValue extends JsonObject public const FIELD_LABEL = 'label'; /** + * @return null|string */ public function getName(); /** + * @return null|LocalizedString */ public function getLabel(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/FieldDefinitionOrderValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/FieldDefinitionOrderValueBuilder.php index 025212f60cd..0c19537611c 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/FieldDefinitionOrderValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/FieldDefinitionOrderValueBuilder.php @@ -23,16 +23,19 @@ final class FieldDefinitionOrderValueBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; /** + * @return null|string */ public function getName() @@ -41,6 +44,7 @@ public function getName() } /** + * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-history/src/Models/ChangeValue/FieldDefinitionOrderValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/FieldDefinitionOrderValueModel.php index ec906b9c0e6..9e637198892 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/FieldDefinitionOrderValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/FieldDefinitionOrderValueModel.php @@ -24,11 +24,13 @@ final class FieldDefinitionOrderValueModel extends JsonObjectModel implements Fi /** + * * @var ?string */ protected $name; /** + * * @var ?LocalizedString */ protected $label; @@ -47,6 +49,7 @@ public function __construct( } /** + * * @return null|string */ public function getName() @@ -64,6 +67,7 @@ public function getName() } /** + * * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-history/src/Models/ChangeValue/InventoryQuantityValue.php b/lib/commercetools-history/src/Models/ChangeValue/InventoryQuantityValue.php index d460e229095..4de22d76be7 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/InventoryQuantityValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/InventoryQuantityValue.php @@ -18,11 +18,13 @@ interface InventoryQuantityValue extends JsonObject public const FIELD_AVAILABLE_QUANTITY = 'availableQuantity'; /** + * @return null|int */ public function getQuantityOnStock(); /** + * @return null|int */ public function getAvailableQuantity(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/InventoryQuantityValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/InventoryQuantityValueBuilder.php index 69f85fabd64..799bd46490e 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/InventoryQuantityValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/InventoryQuantityValueBuilder.php @@ -21,16 +21,19 @@ final class InventoryQuantityValueBuilder implements Builder { /** + * @var ?int */ private $quantityOnStock; /** + * @var ?int */ private $availableQuantity; /** + * @return null|int */ public function getQuantityOnStock() @@ -39,6 +42,7 @@ public function getQuantityOnStock() } /** + * @return null|int */ public function getAvailableQuantity() diff --git a/lib/commercetools-history/src/Models/ChangeValue/InventoryQuantityValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/InventoryQuantityValueModel.php index 9bb1d046fd4..6aea2675327 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/InventoryQuantityValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/InventoryQuantityValueModel.php @@ -22,11 +22,13 @@ final class InventoryQuantityValueModel extends JsonObjectModel implements Inven /** + * * @var ?int */ protected $quantityOnStock; /** + * * @var ?int */ protected $availableQuantity; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|int */ public function getQuantityOnStock() @@ -62,6 +65,7 @@ public function getQuantityOnStock() } /** + * * @return null|int */ public function getAvailableQuantity() diff --git a/lib/commercetools-history/src/Models/ChangeValue/LocalizedEnumValue.php b/lib/commercetools-history/src/Models/ChangeValue/LocalizedEnumValue.php index d940b976f7e..4d5faf3906b 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/LocalizedEnumValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/LocalizedEnumValue.php @@ -19,11 +19,13 @@ interface LocalizedEnumValue extends JsonObject public const FIELD_LABEL = 'label'; /** + * @return null|string */ public function getKey(); /** + * @return null|LocalizedString */ public function getLabel(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/LocalizedEnumValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/LocalizedEnumValueBuilder.php index 1df566a7a4a..bff240edd85 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/LocalizedEnumValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/LocalizedEnumValueBuilder.php @@ -23,16 +23,19 @@ final class LocalizedEnumValueBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; /** + * @return null|string */ public function getKey() @@ -41,6 +44,7 @@ public function getKey() } /** + * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-history/src/Models/ChangeValue/LocalizedEnumValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/LocalizedEnumValueModel.php index a4a1e165cd3..dfcde990e00 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/LocalizedEnumValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/LocalizedEnumValueModel.php @@ -24,11 +24,13 @@ final class LocalizedEnumValueModel extends JsonObjectModel implements Localized /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $label; @@ -47,6 +49,7 @@ public function __construct( } /** + * * @return null|string */ public function getKey() @@ -64,6 +67,7 @@ public function getKey() } /** + * * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ParcelChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/ParcelChangeValue.php index 71694c5bbaa..399718e5083 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ParcelChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ParcelChangeValue.php @@ -18,11 +18,13 @@ interface ParcelChangeValue extends JsonObject public const FIELD_CREATED_AT = 'createdAt'; /** + * @return null|string */ public function getId(); /** + * @return null|string */ public function getCreatedAt(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/ParcelChangeValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/ParcelChangeValueBuilder.php index 9d3c42d97d9..9166b1e8694 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ParcelChangeValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ParcelChangeValueBuilder.php @@ -21,16 +21,19 @@ final class ParcelChangeValueBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $createdAt; /** + * @return null|string */ public function getId() @@ -39,6 +42,7 @@ public function getId() } /** + * @return null|string */ public function getCreatedAt() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ParcelChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/ParcelChangeValueModel.php index 06b2120bd11..620cdb52ddf 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ParcelChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ParcelChangeValueModel.php @@ -22,11 +22,13 @@ final class ParcelChangeValueModel extends JsonObjectModel implements ParcelChan /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $createdAt; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -62,6 +65,7 @@ public function getId() } /** + * * @return null|string */ public function getCreatedAt() diff --git a/lib/commercetools-history/src/Models/ChangeValue/SetCartClassificationShippingRateInputValue.php b/lib/commercetools-history/src/Models/ChangeValue/SetCartClassificationShippingRateInputValue.php index 3f18505bf14..54da8dbbe38 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/SetCartClassificationShippingRateInputValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/SetCartClassificationShippingRateInputValue.php @@ -20,16 +20,19 @@ interface SetCartClassificationShippingRateInputValue extends JsonObject public const FIELD_LABEL = 'label'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getKey(); /** + * @return null|LocalizedString */ public function getLabel(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/SetCartClassificationShippingRateInputValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/SetCartClassificationShippingRateInputValueBuilder.php index 021c4e2e9cc..8ea49e29028 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/SetCartClassificationShippingRateInputValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/SetCartClassificationShippingRateInputValueBuilder.php @@ -23,21 +23,25 @@ final class SetCartClassificationShippingRateInputValueBuilder implements Builder { /** + * @var ?string */ private $type; /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; /** + * @return null|string */ public function getType() @@ -46,6 +50,7 @@ public function getType() } /** + * @return null|string */ public function getKey() @@ -54,6 +59,7 @@ public function getKey() } /** + * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-history/src/Models/ChangeValue/SetCartClassificationShippingRateInputValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/SetCartClassificationShippingRateInputValueModel.php index 5b600ae534f..61aa84d0a6d 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/SetCartClassificationShippingRateInputValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/SetCartClassificationShippingRateInputValueModel.php @@ -24,16 +24,19 @@ final class SetCartClassificationShippingRateInputValueModel extends JsonObjectM /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $label; @@ -54,6 +57,7 @@ public function __construct( } /** + * * @return null|string */ public function getType() @@ -71,6 +75,7 @@ public function getType() } /** + * * @return null|string */ public function getKey() @@ -88,6 +93,7 @@ public function getKey() } /** + * * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-history/src/Models/ChangeValue/SetCartScoreShippingRateInputValue.php b/lib/commercetools-history/src/Models/ChangeValue/SetCartScoreShippingRateInputValue.php index c33fa39bd90..ccda5b802b6 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/SetCartScoreShippingRateInputValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/SetCartScoreShippingRateInputValue.php @@ -18,11 +18,13 @@ interface SetCartScoreShippingRateInputValue extends JsonObject public const FIELD_SCORE = 'score'; /** + * @return null|string */ public function getType(); /** + * @return null|int */ public function getScore(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/SetCartScoreShippingRateInputValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/SetCartScoreShippingRateInputValueBuilder.php index e8a737d3904..94f5740c1cd 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/SetCartScoreShippingRateInputValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/SetCartScoreShippingRateInputValueBuilder.php @@ -21,16 +21,19 @@ final class SetCartScoreShippingRateInputValueBuilder implements Builder { /** + * @var ?string */ private $type; /** + * @var ?int */ private $score; /** + * @return null|string */ public function getType() @@ -39,6 +42,7 @@ public function getType() } /** + * @return null|int */ public function getScore() diff --git a/lib/commercetools-history/src/Models/ChangeValue/SetCartScoreShippingRateInputValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/SetCartScoreShippingRateInputValueModel.php index 2d8ffcbb1df..5ae3f7f707a 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/SetCartScoreShippingRateInputValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/SetCartScoreShippingRateInputValueModel.php @@ -22,11 +22,13 @@ final class SetCartScoreShippingRateInputValueModel extends JsonObjectModel impl /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $score; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|string */ public function getType() @@ -62,6 +65,7 @@ public function getType() } /** + * * @return null|int */ public function getScore() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodChangeValue.php index 4a1d22fa24e..c25c2a6f890 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodChangeValue.php @@ -18,11 +18,13 @@ interface ShippingMethodChangeValue extends JsonObject public const FIELD_NAME = 'name'; /** + * @return null|string */ public function getId(); /** + * @return null|string */ public function getName(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodChangeValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodChangeValueBuilder.php index f98e85368a8..5d08bdd866c 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodChangeValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodChangeValueBuilder.php @@ -21,16 +21,19 @@ final class ShippingMethodChangeValueBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $name; /** + * @return null|string */ public function getId() @@ -39,6 +42,7 @@ public function getId() } /** + * @return null|string */ public function getName() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodChangeValueModel.php index 9d7b5794da7..e41fd78a1d6 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodChangeValueModel.php @@ -22,11 +22,13 @@ final class ShippingMethodChangeValueModel extends JsonObjectModel implements Sh /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $name; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -62,6 +65,7 @@ public function getId() } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodTaxAmountChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodTaxAmountChangeValue.php index 967d6e48fcd..ad3dd74e9b6 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodTaxAmountChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodTaxAmountChangeValue.php @@ -20,6 +20,7 @@ interface ShippingMethodTaxAmountChangeValue extends JsonObject public const FIELD_TAX_RATE = 'taxRate'; /** + * @return null|TaxedPrice */ public function getTaxedPrice(); @@ -27,6 +28,7 @@ public function getTaxedPrice(); /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getTaxRate(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodTaxAmountChangeValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodTaxAmountChangeValueBuilder.php index 910189d1e32..1d71a028fe8 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodTaxAmountChangeValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodTaxAmountChangeValueBuilder.php @@ -25,16 +25,19 @@ final class ShippingMethodTaxAmountChangeValueBuilder implements Builder { /** + * @var null|TaxedPrice|TaxedPriceBuilder */ private $taxedPrice; /** + * @var null|TaxRate|TaxRateBuilder */ private $taxRate; /** + * @return null|TaxedPrice */ public function getTaxedPrice() @@ -45,6 +48,7 @@ public function getTaxedPrice() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * @return null|TaxRate */ public function getTaxRate() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodTaxAmountChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodTaxAmountChangeValueModel.php index a69fd32b45c..63e38796f6c 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodTaxAmountChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ShippingMethodTaxAmountChangeValueModel.php @@ -26,11 +26,13 @@ final class ShippingMethodTaxAmountChangeValueModel extends JsonObjectModel impl /** + * * @var ?TaxedPrice */ protected $taxedPrice; /** + * * @var ?TaxRate */ protected $taxRate; @@ -49,6 +51,7 @@ public function __construct( } /** + * * @return null|TaxedPrice */ public function getTaxedPrice() @@ -69,6 +72,7 @@ public function getTaxedPrice() /** *

    Shape of the value for addTaxRate and removeTaxRate actions

    * + * * @return null|TaxRate */ public function getTaxRate() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ShoppingListLineItemValue.php b/lib/commercetools-history/src/Models/ChangeValue/ShoppingListLineItemValue.php index 7bb39f3d386..5452c5d7b9f 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ShoppingListLineItemValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ShoppingListLineItemValue.php @@ -20,16 +20,19 @@ interface ShoppingListLineItemValue extends JsonObject public const FIELD_VARIANT_ID = 'variantId'; /** + * @return null|string */ public function getId(); /** + * @return null|LocalizedString */ public function getName(); /** + * @return null|int */ public function getVariantId(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/ShoppingListLineItemValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/ShoppingListLineItemValueBuilder.php index e986e50f5c2..caf69412064 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ShoppingListLineItemValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ShoppingListLineItemValueBuilder.php @@ -23,21 +23,25 @@ final class ShoppingListLineItemValueBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?int */ private $variantId; /** + * @return null|string */ public function getId() @@ -46,6 +50,7 @@ public function getId() } /** + * @return null|LocalizedString */ public function getName() @@ -54,6 +59,7 @@ public function getName() } /** + * @return null|int */ public function getVariantId() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ShoppingListLineItemValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/ShoppingListLineItemValueModel.php index 2b8ff2df92a..a660c615720 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ShoppingListLineItemValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ShoppingListLineItemValueModel.php @@ -24,16 +24,19 @@ final class ShoppingListLineItemValueModel extends JsonObjectModel implements Sh /** + * * @var ?string */ protected $id; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?int */ protected $variantId; @@ -54,6 +57,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -71,6 +75,7 @@ public function getId() } /** + * * @return null|LocalizedString */ public function getName() @@ -89,6 +94,7 @@ public function getName() } /** + * * @return null|int */ public function getVariantId() diff --git a/lib/commercetools-history/src/Models/ChangeValue/TextLineItemValue.php b/lib/commercetools-history/src/Models/ChangeValue/TextLineItemValue.php index 2cc4cc23dfa..2412d3e8163 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/TextLineItemValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/TextLineItemValue.php @@ -19,11 +19,13 @@ interface TextLineItemValue extends JsonObject public const FIELD_NAME = 'name'; /** + * @return null|string */ public function getId(); /** + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/TextLineItemValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/TextLineItemValueBuilder.php index 8d0b781c2cc..3a6a18ce937 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/TextLineItemValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/TextLineItemValueBuilder.php @@ -23,16 +23,19 @@ final class TextLineItemValueBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @return null|string */ public function getId() @@ -41,6 +44,7 @@ public function getId() } /** + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-history/src/Models/ChangeValue/TextLineItemValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/TextLineItemValueModel.php index 14880367b9f..618f0f021b6 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/TextLineItemValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/TextLineItemValueModel.php @@ -24,11 +24,13 @@ final class TextLineItemValueModel extends JsonObjectModel implements TextLineIt /** + * * @var ?string */ protected $id; /** + * * @var ?LocalizedString */ protected $name; @@ -47,6 +49,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -64,6 +67,7 @@ public function getId() } /** + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-history/src/Models/ChangeValue/TransactionChangeValue.php b/lib/commercetools-history/src/Models/ChangeValue/TransactionChangeValue.php index 697666411f0..f1eee53747f 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/TransactionChangeValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/TransactionChangeValue.php @@ -19,16 +19,19 @@ interface TransactionChangeValue extends JsonObject public const FIELD_TIMESTAMP = 'timestamp'; /** + * @return null|string */ public function getId(); /** + * @return null|string */ public function getInteractionId(); /** + * @return null|string */ public function getTimestamp(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/TransactionChangeValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/TransactionChangeValueBuilder.php index 4f0e8f4f026..a8058a68929 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/TransactionChangeValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/TransactionChangeValueBuilder.php @@ -21,21 +21,25 @@ final class TransactionChangeValueBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $interactionId; /** + * @var ?string */ private $timestamp; /** + * @return null|string */ public function getId() @@ -44,6 +48,7 @@ public function getId() } /** + * @return null|string */ public function getInteractionId() @@ -52,6 +57,7 @@ public function getInteractionId() } /** + * @return null|string */ public function getTimestamp() diff --git a/lib/commercetools-history/src/Models/ChangeValue/TransactionChangeValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/TransactionChangeValueModel.php index 4fd92aada4c..fd93b5ffceb 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/TransactionChangeValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/TransactionChangeValueModel.php @@ -22,16 +22,19 @@ final class TransactionChangeValueModel extends JsonObjectModel implements Trans /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $interactionId; /** + * * @var ?string */ protected $timestamp; @@ -52,6 +55,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -69,6 +73,7 @@ public function getId() } /** + * * @return null|string */ public function getInteractionId() @@ -86,6 +91,7 @@ public function getInteractionId() } /** + * * @return null|string */ public function getTimestamp() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ValidFromAndUntilValue.php b/lib/commercetools-history/src/Models/ChangeValue/ValidFromAndUntilValue.php index 428b49fa6cd..01b857e50e3 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ValidFromAndUntilValue.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ValidFromAndUntilValue.php @@ -18,11 +18,13 @@ interface ValidFromAndUntilValue extends JsonObject public const FIELD_VALID_UNTIL = 'validUntil'; /** + * @return null|string */ public function getValidFrom(); /** + * @return null|string */ public function getValidUntil(); diff --git a/lib/commercetools-history/src/Models/ChangeValue/ValidFromAndUntilValueBuilder.php b/lib/commercetools-history/src/Models/ChangeValue/ValidFromAndUntilValueBuilder.php index e8c7cfb2d4b..2eddc22b38c 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ValidFromAndUntilValueBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ValidFromAndUntilValueBuilder.php @@ -21,16 +21,19 @@ final class ValidFromAndUntilValueBuilder implements Builder { /** + * @var ?string */ private $validFrom; /** + * @var ?string */ private $validUntil; /** + * @return null|string */ public function getValidFrom() @@ -39,6 +42,7 @@ public function getValidFrom() } /** + * @return null|string */ public function getValidUntil() diff --git a/lib/commercetools-history/src/Models/ChangeValue/ValidFromAndUntilValueModel.php b/lib/commercetools-history/src/Models/ChangeValue/ValidFromAndUntilValueModel.php index 42c81918f81..ff277839e46 100644 --- a/lib/commercetools-history/src/Models/ChangeValue/ValidFromAndUntilValueModel.php +++ b/lib/commercetools-history/src/Models/ChangeValue/ValidFromAndUntilValueModel.php @@ -22,11 +22,13 @@ final class ValidFromAndUntilValueModel extends JsonObjectModel implements Valid /** + * * @var ?string */ protected $validFrom; /** + * * @var ?string */ protected $validUntil; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|string */ public function getValidFrom() @@ -62,6 +65,7 @@ public function getValidFrom() } /** + * * @return null|string */ public function getValidUntil() diff --git a/lib/commercetools-history/src/Models/Common/Address.php b/lib/commercetools-history/src/Models/Common/Address.php index be0c56195de..2840b883574 100644 --- a/lib/commercetools-history/src/Models/Common/Address.php +++ b/lib/commercetools-history/src/Models/Common/Address.php @@ -43,66 +43,79 @@ interface Address extends JsonObject /** *

    Unique ID of the Address.

    * + * @return null|string */ public function getId(); /** + * @return null|string */ public function getKey(); /** + * @return null|string */ public function getTitle(); /** + * @return null|string */ public function getSalutation(); /** + * @return null|string */ public function getFirstName(); /** + * @return null|string */ public function getLastName(); /** + * @return null|string */ public function getStreetName(); /** + * @return null|string */ public function getStreetNumber(); /** + * @return null|string */ public function getAdditionalStreetInfo(); /** + * @return null|string */ public function getPostalCode(); /** + * @return null|string */ public function getCity(); /** + * @return null|string */ public function getRegion(); /** + * @return null|string */ public function getState(); @@ -110,61 +123,73 @@ public function getState(); /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry(); /** + * @return null|string */ public function getCompany(); /** + * @return null|string */ public function getDepartment(); /** + * @return null|string */ public function getBuilding(); /** + * @return null|string */ public function getApartment(); /** + * @return null|string */ public function getPOBox(); /** + * @return null|string */ public function getPhone(); /** + * @return null|string */ public function getMobile(); /** + * @return null|string */ public function getEmail(); /** + * @return null|string */ public function getFax(); /** + * @return null|string */ public function getAdditionalAddressInfo(); /** + * @return null|string */ public function getExternalId(); diff --git a/lib/commercetools-history/src/Models/Common/AddressBuilder.php b/lib/commercetools-history/src/Models/Common/AddressBuilder.php index d6922d0cfb9..b78b30ee88d 100644 --- a/lib/commercetools-history/src/Models/Common/AddressBuilder.php +++ b/lib/commercetools-history/src/Models/Common/AddressBuilder.php @@ -21,126 +21,151 @@ final class AddressBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; /** + * @var ?string */ private $title; /** + * @var ?string */ private $salutation; /** + * @var ?string */ private $firstName; /** + * @var ?string */ private $lastName; /** + * @var ?string */ private $streetName; /** + * @var ?string */ private $streetNumber; /** + * @var ?string */ private $additionalStreetInfo; /** + * @var ?string */ private $postalCode; /** + * @var ?string */ private $city; /** + * @var ?string */ private $region; /** + * @var ?string */ private $state; /** + * @var ?string */ private $country; /** + * @var ?string */ private $company; /** + * @var ?string */ private $department; /** + * @var ?string */ private $building; /** + * @var ?string */ private $apartment; /** + * @var ?string */ private $pOBox; /** + * @var ?string */ private $phone; /** + * @var ?string */ private $mobile; /** + * @var ?string */ private $email; /** + * @var ?string */ private $fax; /** + * @var ?string */ private $additionalAddressInfo; /** + * @var ?string */ private $externalId; @@ -148,6 +173,7 @@ final class AddressBuilder implements Builder /** *

    Unique ID of the Address.

    * + * @return null|string */ public function getId() @@ -156,6 +182,7 @@ public function getId() } /** + * @return null|string */ public function getKey() @@ -164,6 +191,7 @@ public function getKey() } /** + * @return null|string */ public function getTitle() @@ -172,6 +200,7 @@ public function getTitle() } /** + * @return null|string */ public function getSalutation() @@ -180,6 +209,7 @@ public function getSalutation() } /** + * @return null|string */ public function getFirstName() @@ -188,6 +218,7 @@ public function getFirstName() } /** + * @return null|string */ public function getLastName() @@ -196,6 +227,7 @@ public function getLastName() } /** + * @return null|string */ public function getStreetName() @@ -204,6 +236,7 @@ public function getStreetName() } /** + * @return null|string */ public function getStreetNumber() @@ -212,6 +245,7 @@ public function getStreetNumber() } /** + * @return null|string */ public function getAdditionalStreetInfo() @@ -220,6 +254,7 @@ public function getAdditionalStreetInfo() } /** + * @return null|string */ public function getPostalCode() @@ -228,6 +263,7 @@ public function getPostalCode() } /** + * @return null|string */ public function getCity() @@ -236,6 +272,7 @@ public function getCity() } /** + * @return null|string */ public function getRegion() @@ -244,6 +281,7 @@ public function getRegion() } /** + * @return null|string */ public function getState() @@ -254,6 +292,7 @@ public function getState() /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry() @@ -262,6 +301,7 @@ public function getCountry() } /** + * @return null|string */ public function getCompany() @@ -270,6 +310,7 @@ public function getCompany() } /** + * @return null|string */ public function getDepartment() @@ -278,6 +319,7 @@ public function getDepartment() } /** + * @return null|string */ public function getBuilding() @@ -286,6 +328,7 @@ public function getBuilding() } /** + * @return null|string */ public function getApartment() @@ -294,6 +337,7 @@ public function getApartment() } /** + * @return null|string */ public function getPOBox() @@ -302,6 +346,7 @@ public function getPOBox() } /** + * @return null|string */ public function getPhone() @@ -310,6 +355,7 @@ public function getPhone() } /** + * @return null|string */ public function getMobile() @@ -318,6 +364,7 @@ public function getMobile() } /** + * @return null|string */ public function getEmail() @@ -326,6 +373,7 @@ public function getEmail() } /** + * @return null|string */ public function getFax() @@ -334,6 +382,7 @@ public function getFax() } /** + * @return null|string */ public function getAdditionalAddressInfo() @@ -342,6 +391,7 @@ public function getAdditionalAddressInfo() } /** + * @return null|string */ public function getExternalId() diff --git a/lib/commercetools-history/src/Models/Common/AddressModel.php b/lib/commercetools-history/src/Models/Common/AddressModel.php index 38ce40c43e4..ccd621850f9 100644 --- a/lib/commercetools-history/src/Models/Common/AddressModel.php +++ b/lib/commercetools-history/src/Models/Common/AddressModel.php @@ -22,126 +22,151 @@ final class AddressModel extends JsonObjectModel implements Address /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $title; /** + * * @var ?string */ protected $salutation; /** + * * @var ?string */ protected $firstName; /** + * * @var ?string */ protected $lastName; /** + * * @var ?string */ protected $streetName; /** + * * @var ?string */ protected $streetNumber; /** + * * @var ?string */ protected $additionalStreetInfo; /** + * * @var ?string */ protected $postalCode; /** + * * @var ?string */ protected $city; /** + * * @var ?string */ protected $region; /** + * * @var ?string */ protected $state; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $company; /** + * * @var ?string */ protected $department; /** + * * @var ?string */ protected $building; /** + * * @var ?string */ protected $apartment; /** + * * @var ?string */ protected $pOBox; /** + * * @var ?string */ protected $phone; /** + * * @var ?string */ protected $mobile; /** + * * @var ?string */ protected $email; /** + * * @var ?string */ protected $fax; /** + * * @var ?string */ protected $additionalAddressInfo; /** + * * @var ?string */ protected $externalId; @@ -208,6 +233,7 @@ public function __construct( /** *

    Unique ID of the Address.

    * + * * @return null|string */ public function getId() @@ -225,6 +251,7 @@ public function getId() } /** + * * @return null|string */ public function getKey() @@ -242,6 +269,7 @@ public function getKey() } /** + * * @return null|string */ public function getTitle() @@ -259,6 +287,7 @@ public function getTitle() } /** + * * @return null|string */ public function getSalutation() @@ -276,6 +305,7 @@ public function getSalutation() } /** + * * @return null|string */ public function getFirstName() @@ -293,6 +323,7 @@ public function getFirstName() } /** + * * @return null|string */ public function getLastName() @@ -310,6 +341,7 @@ public function getLastName() } /** + * * @return null|string */ public function getStreetName() @@ -327,6 +359,7 @@ public function getStreetName() } /** + * * @return null|string */ public function getStreetNumber() @@ -344,6 +377,7 @@ public function getStreetNumber() } /** + * * @return null|string */ public function getAdditionalStreetInfo() @@ -361,6 +395,7 @@ public function getAdditionalStreetInfo() } /** + * * @return null|string */ public function getPostalCode() @@ -378,6 +413,7 @@ public function getPostalCode() } /** + * * @return null|string */ public function getCity() @@ -395,6 +431,7 @@ public function getCity() } /** + * * @return null|string */ public function getRegion() @@ -412,6 +449,7 @@ public function getRegion() } /** + * * @return null|string */ public function getState() @@ -431,6 +469,7 @@ public function getState() /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * * @return null|string */ public function getCountry() @@ -448,6 +487,7 @@ public function getCountry() } /** + * * @return null|string */ public function getCompany() @@ -465,6 +505,7 @@ public function getCompany() } /** + * * @return null|string */ public function getDepartment() @@ -482,6 +523,7 @@ public function getDepartment() } /** + * * @return null|string */ public function getBuilding() @@ -499,6 +541,7 @@ public function getBuilding() } /** + * * @return null|string */ public function getApartment() @@ -516,6 +559,7 @@ public function getApartment() } /** + * * @return null|string */ public function getPOBox() @@ -533,6 +577,7 @@ public function getPOBox() } /** + * * @return null|string */ public function getPhone() @@ -550,6 +595,7 @@ public function getPhone() } /** + * * @return null|string */ public function getMobile() @@ -567,6 +613,7 @@ public function getMobile() } /** + * * @return null|string */ public function getEmail() @@ -584,6 +631,7 @@ public function getEmail() } /** + * * @return null|string */ public function getFax() @@ -601,6 +649,7 @@ public function getFax() } /** + * * @return null|string */ public function getAdditionalAddressInfo() @@ -618,6 +667,7 @@ public function getAdditionalAddressInfo() } /** + * * @return null|string */ public function getExternalId() diff --git a/lib/commercetools-history/src/Models/Common/Asset.php b/lib/commercetools-history/src/Models/Common/Asset.php index 4a904755667..6f6b991784b 100644 --- a/lib/commercetools-history/src/Models/Common/Asset.php +++ b/lib/commercetools-history/src/Models/Common/Asset.php @@ -21,26 +21,31 @@ interface Asset extends JsonObject public const FIELD_KEY = 'key'; /** + * @return null|string */ public function getId(); /** + * @return null|LocalizedString */ public function getName(); /** + * @return null|LocalizedString */ public function getDescription(); /** + * @return null|CustomFields */ public function getCustom(); /** + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-history/src/Models/Common/AssetBuilder.php b/lib/commercetools-history/src/Models/Common/AssetBuilder.php index b09ff520097..040d9b756f4 100644 --- a/lib/commercetools-history/src/Models/Common/AssetBuilder.php +++ b/lib/commercetools-history/src/Models/Common/AssetBuilder.php @@ -21,31 +21,37 @@ final class AssetBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var ?string */ private $key; /** + * @return null|string */ public function getId() @@ -54,6 +60,7 @@ public function getId() } /** + * @return null|LocalizedString */ public function getName() @@ -62,6 +69,7 @@ public function getName() } /** + * @return null|LocalizedString */ public function getDescription() @@ -70,6 +78,7 @@ public function getDescription() } /** + * @return null|CustomFields */ public function getCustom() @@ -78,6 +87,7 @@ public function getCustom() } /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-history/src/Models/Common/AssetDimensions.php b/lib/commercetools-history/src/Models/Common/AssetDimensions.php index 2f5b061af93..2b41f63d69b 100644 --- a/lib/commercetools-history/src/Models/Common/AssetDimensions.php +++ b/lib/commercetools-history/src/Models/Common/AssetDimensions.php @@ -18,11 +18,13 @@ interface AssetDimensions extends JsonObject public const FIELD_H = 'h'; /** + * @return null|int */ public function getW(); /** + * @return null|int */ public function getH(); diff --git a/lib/commercetools-history/src/Models/Common/AssetDimensionsBuilder.php b/lib/commercetools-history/src/Models/Common/AssetDimensionsBuilder.php index 792586a6068..77aeb522385 100644 --- a/lib/commercetools-history/src/Models/Common/AssetDimensionsBuilder.php +++ b/lib/commercetools-history/src/Models/Common/AssetDimensionsBuilder.php @@ -21,16 +21,19 @@ final class AssetDimensionsBuilder implements Builder { /** + * @var ?int */ private $w; /** + * @var ?int */ private $h; /** + * @return null|int */ public function getW() @@ -39,6 +42,7 @@ public function getW() } /** + * @return null|int */ public function getH() diff --git a/lib/commercetools-history/src/Models/Common/AssetDimensionsModel.php b/lib/commercetools-history/src/Models/Common/AssetDimensionsModel.php index b07ef00e8e5..4b1e55646f7 100644 --- a/lib/commercetools-history/src/Models/Common/AssetDimensionsModel.php +++ b/lib/commercetools-history/src/Models/Common/AssetDimensionsModel.php @@ -22,11 +22,13 @@ final class AssetDimensionsModel extends JsonObjectModel implements AssetDimensi /** + * * @var ?int */ protected $w; /** + * * @var ?int */ protected $h; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|int */ public function getW() @@ -62,6 +65,7 @@ public function getW() } /** + * * @return null|int */ public function getH() diff --git a/lib/commercetools-history/src/Models/Common/AssetModel.php b/lib/commercetools-history/src/Models/Common/AssetModel.php index 3a7fad509c7..fca3839e50b 100644 --- a/lib/commercetools-history/src/Models/Common/AssetModel.php +++ b/lib/commercetools-history/src/Models/Common/AssetModel.php @@ -22,26 +22,31 @@ final class AssetModel extends JsonObjectModel implements Asset /** + * * @var ?string */ protected $id; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?string */ protected $key; @@ -66,6 +71,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -83,6 +89,7 @@ public function getId() } /** + * * @return null|LocalizedString */ public function getName() @@ -101,6 +108,7 @@ public function getName() } /** + * * @return null|LocalizedString */ public function getDescription() @@ -119,6 +127,7 @@ public function getDescription() } /** + * * @return null|CustomFields */ public function getCustom() @@ -137,6 +146,7 @@ public function getCustom() } /** + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-history/src/Models/Common/AssetSource.php b/lib/commercetools-history/src/Models/Common/AssetSource.php index 4e748ff7c61..2dfb0ffb485 100644 --- a/lib/commercetools-history/src/Models/Common/AssetSource.php +++ b/lib/commercetools-history/src/Models/Common/AssetSource.php @@ -20,21 +20,25 @@ interface AssetSource extends JsonObject public const FIELD_CONTENT_TYPE = 'contentType'; /** + * @return null|string */ public function getUri(); /** + * @return null|string */ public function getKey(); /** + * @return null|AssetDimensions */ public function getDimensions(); /** + * @return null|string */ public function getContentType(); diff --git a/lib/commercetools-history/src/Models/Common/AssetSourceBuilder.php b/lib/commercetools-history/src/Models/Common/AssetSourceBuilder.php index bde32e5e7a7..7fd51ce727c 100644 --- a/lib/commercetools-history/src/Models/Common/AssetSourceBuilder.php +++ b/lib/commercetools-history/src/Models/Common/AssetSourceBuilder.php @@ -21,26 +21,31 @@ final class AssetSourceBuilder implements Builder { /** + * @var ?string */ private $uri; /** + * @var ?string */ private $key; /** + * @var null|AssetDimensions|AssetDimensionsBuilder */ private $dimensions; /** + * @var ?string */ private $contentType; /** + * @return null|string */ public function getUri() @@ -49,6 +54,7 @@ public function getUri() } /** + * @return null|string */ public function getKey() @@ -57,6 +63,7 @@ public function getKey() } /** + * @return null|AssetDimensions */ public function getDimensions() @@ -65,6 +72,7 @@ public function getDimensions() } /** + * @return null|string */ public function getContentType() diff --git a/lib/commercetools-history/src/Models/Common/AssetSourceModel.php b/lib/commercetools-history/src/Models/Common/AssetSourceModel.php index c2e41446537..4f23d659eaa 100644 --- a/lib/commercetools-history/src/Models/Common/AssetSourceModel.php +++ b/lib/commercetools-history/src/Models/Common/AssetSourceModel.php @@ -22,21 +22,25 @@ final class AssetSourceModel extends JsonObjectModel implements AssetSource /** + * * @var ?string */ protected $uri; /** + * * @var ?string */ protected $key; /** + * * @var ?AssetDimensions */ protected $dimensions; /** + * * @var ?string */ protected $contentType; @@ -59,6 +63,7 @@ public function __construct( } /** + * * @return null|string */ public function getUri() @@ -76,6 +81,7 @@ public function getUri() } /** + * * @return null|string */ public function getKey() @@ -93,6 +99,7 @@ public function getKey() } /** + * * @return null|AssetDimensions */ public function getDimensions() @@ -111,6 +118,7 @@ public function getDimensions() } /** + * * @return null|string */ public function getContentType() diff --git a/lib/commercetools-history/src/Models/Common/AttributeDefinition.php b/lib/commercetools-history/src/Models/Common/AttributeDefinition.php index a64f3d09297..f8fa3c3605e 100644 --- a/lib/commercetools-history/src/Models/Common/AttributeDefinition.php +++ b/lib/commercetools-history/src/Models/Common/AttributeDefinition.php @@ -24,6 +24,7 @@ interface AttributeDefinition extends JsonObject public const FIELD_IS_SEARCHABLE = 'isSearchable'; /** + * @return null|AttributeType */ public function getType(); @@ -31,11 +32,13 @@ public function getType(); /** *

    The unique name of the attribute used in the API. The name must be between two and 256 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). When using the same name for an attribute in two or more product types all fields of the AttributeDefinition of this attribute need to be the same across the product types, otherwise an AttributeDefinitionAlreadyExists error code will be returned. An exception to this are the values of an enum or lenum type and sets thereof.

    * + * @return null|string */ public function getName(); /** + * @return null|LocalizedString */ public function getLabel(); @@ -43,21 +46,25 @@ public function getLabel(); /** *

    Whether the attribute is required to have a value.

    * + * @return null|bool */ public function getIsRequired(); /** + * @return null|string */ public function getAttributeConstraint(); /** + * @return null|LocalizedString */ public function getInputTip(); /** + * @return null|string */ public function getInputHint(); @@ -65,6 +72,7 @@ public function getInputHint(); /** *

    Whether the attribute's values should generally be enabled in product search. This determines whether the value is stored in products for matching terms in the context of full-text search queries and can be used in facets & filters as part of product search queries. The exact features that are enabled/disabled with this flag depend on the concrete attribute type and are described there. The max size of a searchable field is restricted to 10922 characters. This constraint is enforced at both product creation and product update. If the length of the input exceeds the maximum size an InvalidField error is returned.

    * + * @return null|bool */ public function getIsSearchable(); diff --git a/lib/commercetools-history/src/Models/Common/AttributeDefinitionBuilder.php b/lib/commercetools-history/src/Models/Common/AttributeDefinitionBuilder.php index 0bc19b856c9..a1f99900cab 100644 --- a/lib/commercetools-history/src/Models/Common/AttributeDefinitionBuilder.php +++ b/lib/commercetools-history/src/Models/Common/AttributeDefinitionBuilder.php @@ -21,46 +21,55 @@ final class AttributeDefinitionBuilder implements Builder { /** + * @var null|AttributeType|AttributeTypeBuilder */ private $type; /** + * @var ?string */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; /** + * @var ?bool */ private $isRequired; /** + * @var ?string */ private $attributeConstraint; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $inputTip; /** + * @var ?string */ private $inputHint; /** + * @var ?bool */ private $isSearchable; /** + * @return null|AttributeType */ public function getType() @@ -71,6 +80,7 @@ public function getType() /** *

    The unique name of the attribute used in the API. The name must be between two and 256 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). When using the same name for an attribute in two or more product types all fields of the AttributeDefinition of this attribute need to be the same across the product types, otherwise an AttributeDefinitionAlreadyExists error code will be returned. An exception to this are the values of an enum or lenum type and sets thereof.

    * + * @return null|string */ public function getName() @@ -79,6 +89,7 @@ public function getName() } /** + * @return null|LocalizedString */ public function getLabel() @@ -89,6 +100,7 @@ public function getLabel() /** *

    Whether the attribute is required to have a value.

    * + * @return null|bool */ public function getIsRequired() @@ -97,6 +109,7 @@ public function getIsRequired() } /** + * @return null|string */ public function getAttributeConstraint() @@ -105,6 +118,7 @@ public function getAttributeConstraint() } /** + * @return null|LocalizedString */ public function getInputTip() @@ -113,6 +127,7 @@ public function getInputTip() } /** + * @return null|string */ public function getInputHint() @@ -123,6 +138,7 @@ public function getInputHint() /** *

    Whether the attribute's values should generally be enabled in product search. This determines whether the value is stored in products for matching terms in the context of full-text search queries and can be used in facets & filters as part of product search queries. The exact features that are enabled/disabled with this flag depend on the concrete attribute type and are described there. The max size of a searchable field is restricted to 10922 characters. This constraint is enforced at both product creation and product update. If the length of the input exceeds the maximum size an InvalidField error is returned.

    * + * @return null|bool */ public function getIsSearchable() diff --git a/lib/commercetools-history/src/Models/Common/AttributeDefinitionModel.php b/lib/commercetools-history/src/Models/Common/AttributeDefinitionModel.php index bfcdfe2b5db..54e1743a79f 100644 --- a/lib/commercetools-history/src/Models/Common/AttributeDefinitionModel.php +++ b/lib/commercetools-history/src/Models/Common/AttributeDefinitionModel.php @@ -22,41 +22,49 @@ final class AttributeDefinitionModel extends JsonObjectModel implements Attribut /** + * * @var ?AttributeType */ protected $type; /** + * * @var ?string */ protected $name; /** + * * @var ?LocalizedString */ protected $label; /** + * * @var ?bool */ protected $isRequired; /** + * * @var ?string */ protected $attributeConstraint; /** + * * @var ?LocalizedString */ protected $inputTip; /** + * * @var ?string */ protected $inputHint; /** + * * @var ?bool */ protected $isSearchable; @@ -87,6 +95,7 @@ public function __construct( } /** + * * @return null|AttributeType */ public function getType() @@ -107,6 +116,7 @@ public function getType() /** *

    The unique name of the attribute used in the API. The name must be between two and 256 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). When using the same name for an attribute in two or more product types all fields of the AttributeDefinition of this attribute need to be the same across the product types, otherwise an AttributeDefinitionAlreadyExists error code will be returned. An exception to this are the values of an enum or lenum type and sets thereof.

    * + * * @return null|string */ public function getName() @@ -124,6 +134,7 @@ public function getName() } /** + * * @return null|LocalizedString */ public function getLabel() @@ -144,6 +155,7 @@ public function getLabel() /** *

    Whether the attribute is required to have a value.

    * + * * @return null|bool */ public function getIsRequired() @@ -161,6 +173,7 @@ public function getIsRequired() } /** + * * @return null|string */ public function getAttributeConstraint() @@ -178,6 +191,7 @@ public function getAttributeConstraint() } /** + * * @return null|LocalizedString */ public function getInputTip() @@ -196,6 +210,7 @@ public function getInputTip() } /** + * * @return null|string */ public function getInputHint() @@ -215,6 +230,7 @@ public function getInputHint() /** *

    Whether the attribute's values should generally be enabled in product search. This determines whether the value is stored in products for matching terms in the context of full-text search queries and can be used in facets & filters as part of product search queries. The exact features that are enabled/disabled with this flag depend on the concrete attribute type and are described there. The max size of a searchable field is restricted to 10922 characters. This constraint is enforced at both product creation and product update. If the length of the input exceeds the maximum size an InvalidField error is returned.

    * + * * @return null|bool */ public function getIsSearchable() diff --git a/lib/commercetools-history/src/Models/Common/AttributeType.php b/lib/commercetools-history/src/Models/Common/AttributeType.php index 34bb74202b8..267e3b0a973 100644 --- a/lib/commercetools-history/src/Models/Common/AttributeType.php +++ b/lib/commercetools-history/src/Models/Common/AttributeType.php @@ -17,6 +17,7 @@ interface AttributeType extends JsonObject public const FIELD_NAME = 'name'; /** + * @return null|string */ public function getName(); diff --git a/lib/commercetools-history/src/Models/Common/AttributeTypeBuilder.php b/lib/commercetools-history/src/Models/Common/AttributeTypeBuilder.php index 14512be01dd..608a2a7cfdf 100644 --- a/lib/commercetools-history/src/Models/Common/AttributeTypeBuilder.php +++ b/lib/commercetools-history/src/Models/Common/AttributeTypeBuilder.php @@ -21,11 +21,13 @@ final class AttributeTypeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @return null|string */ public function getName() diff --git a/lib/commercetools-history/src/Models/Common/AttributeTypeModel.php b/lib/commercetools-history/src/Models/Common/AttributeTypeModel.php index 58a7b432619..0ebb2ab94a7 100644 --- a/lib/commercetools-history/src/Models/Common/AttributeTypeModel.php +++ b/lib/commercetools-history/src/Models/Common/AttributeTypeModel.php @@ -22,6 +22,7 @@ final class AttributeTypeModel extends JsonObjectModel implements AttributeType /** + * * @var ?string */ protected $name; @@ -38,6 +39,7 @@ public function __construct( } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-history/src/Models/Common/CustomFields.php b/lib/commercetools-history/src/Models/Common/CustomFields.php index 0e201d8c932..da44aaa3c52 100644 --- a/lib/commercetools-history/src/Models/Common/CustomFields.php +++ b/lib/commercetools-history/src/Models/Common/CustomFields.php @@ -18,6 +18,7 @@ interface CustomFields extends JsonObject public const FIELD_FIELDS = 'fields'; /** + * @return null|Reference */ public function getType(); @@ -25,6 +26,7 @@ public function getType(); /** *

    A valid JSON object, based on FieldDefinition.

    * + * @return null|mixed */ public function getFields(); diff --git a/lib/commercetools-history/src/Models/Common/CustomFieldsBuilder.php b/lib/commercetools-history/src/Models/Common/CustomFieldsBuilder.php index 6a7e9f6d219..5bc347e0dfb 100644 --- a/lib/commercetools-history/src/Models/Common/CustomFieldsBuilder.php +++ b/lib/commercetools-history/src/Models/Common/CustomFieldsBuilder.php @@ -21,16 +21,19 @@ final class CustomFieldsBuilder implements Builder { /** + * @var null|Reference|ReferenceBuilder */ private $type; /** + * @var ?JsonObject */ private $fields; /** + * @return null|Reference */ public function getType() @@ -41,6 +44,7 @@ public function getType() /** *

    A valid JSON object, based on FieldDefinition.

    * + * @return null|JsonObject */ public function getFields() diff --git a/lib/commercetools-history/src/Models/Common/CustomFieldsModel.php b/lib/commercetools-history/src/Models/Common/CustomFieldsModel.php index de682e70f0d..afff4a988de 100644 --- a/lib/commercetools-history/src/Models/Common/CustomFieldsModel.php +++ b/lib/commercetools-history/src/Models/Common/CustomFieldsModel.php @@ -22,11 +22,13 @@ final class CustomFieldsModel extends JsonObjectModel implements CustomFields /** + * * @var ?Reference */ protected $type; /** + * * @var ?mixed */ protected $fields; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|Reference */ public function getType() @@ -65,6 +68,7 @@ public function getType() /** *

    A valid JSON object, based on FieldDefinition.

    * + * * @return null|mixed */ public function getFields() diff --git a/lib/commercetools-history/src/Models/Common/CustomLineItem.php b/lib/commercetools-history/src/Models/Common/CustomLineItem.php index 41cfc56a297..55436eba987 100644 --- a/lib/commercetools-history/src/Models/Common/CustomLineItem.php +++ b/lib/commercetools-history/src/Models/Common/CustomLineItem.php @@ -25,26 +25,31 @@ interface CustomLineItem extends JsonObject /** *

    The unique ID of this CustomLineItem.

    * + * @return null|string */ public function getId(); /** + * @return null|LocalizedString */ public function getName(); /** + * @return null|Money */ public function getMoney(); /** + * @return null|TaxedItemPrice */ public function getTaxedPrice(); /** + * @return null|Money */ public function getTotalPrice(); @@ -52,6 +57,7 @@ public function getTotalPrice(); /** *

    A unique String in the cart to identify this CustomLineItem.

    * + * @return null|string */ public function getSlug(); @@ -59,6 +65,7 @@ public function getSlug(); /** *

    The amount of a CustomLineItem in the cart. Must be a positive integer.

    * + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-history/src/Models/Common/CustomLineItemBuilder.php b/lib/commercetools-history/src/Models/Common/CustomLineItemBuilder.php index dff62cbe221..19fb2814c99 100644 --- a/lib/commercetools-history/src/Models/Common/CustomLineItemBuilder.php +++ b/lib/commercetools-history/src/Models/Common/CustomLineItemBuilder.php @@ -21,36 +21,43 @@ final class CustomLineItemBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|Money|MoneyBuilder */ private $money; /** + * @var null|TaxedItemPrice|TaxedItemPriceBuilder */ private $taxedPrice; /** + * @var null|Money|MoneyBuilder */ private $totalPrice; /** + * @var ?string */ private $slug; /** + * @var ?int */ private $quantity; @@ -58,6 +65,7 @@ final class CustomLineItemBuilder implements Builder /** *

    The unique ID of this CustomLineItem.

    * + * @return null|string */ public function getId() @@ -66,6 +74,7 @@ public function getId() } /** + * @return null|LocalizedString */ public function getName() @@ -74,6 +83,7 @@ public function getName() } /** + * @return null|Money */ public function getMoney() @@ -82,6 +92,7 @@ public function getMoney() } /** + * @return null|TaxedItemPrice */ public function getTaxedPrice() @@ -90,6 +101,7 @@ public function getTaxedPrice() } /** + * @return null|Money */ public function getTotalPrice() @@ -100,6 +112,7 @@ public function getTotalPrice() /** *

    A unique String in the cart to identify this CustomLineItem.

    * + * @return null|string */ public function getSlug() @@ -110,6 +123,7 @@ public function getSlug() /** *

    The amount of a CustomLineItem in the cart. Must be a positive integer.

    * + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-history/src/Models/Common/CustomLineItemModel.php b/lib/commercetools-history/src/Models/Common/CustomLineItemModel.php index ea13fe139e4..4f05917d75f 100644 --- a/lib/commercetools-history/src/Models/Common/CustomLineItemModel.php +++ b/lib/commercetools-history/src/Models/Common/CustomLineItemModel.php @@ -22,36 +22,43 @@ final class CustomLineItemModel extends JsonObjectModel implements CustomLineIte /** + * * @var ?string */ protected $id; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?Money */ protected $money; /** + * * @var ?TaxedItemPrice */ protected $taxedPrice; /** + * * @var ?Money */ protected $totalPrice; /** + * * @var ?string */ protected $slug; /** + * * @var ?int */ protected $quantity; @@ -82,6 +89,7 @@ public function __construct( /** *

    The unique ID of this CustomLineItem.

    * + * * @return null|string */ public function getId() @@ -99,6 +107,7 @@ public function getId() } /** + * * @return null|LocalizedString */ public function getName() @@ -117,6 +126,7 @@ public function getName() } /** + * * @return null|Money */ public function getMoney() @@ -135,6 +145,7 @@ public function getMoney() } /** + * * @return null|TaxedItemPrice */ public function getTaxedPrice() @@ -153,6 +164,7 @@ public function getTaxedPrice() } /** + * * @return null|Money */ public function getTotalPrice() @@ -173,6 +185,7 @@ public function getTotalPrice() /** *

    A unique String in the cart to identify this CustomLineItem.

    * + * * @return null|string */ public function getSlug() @@ -192,6 +205,7 @@ public function getSlug() /** *

    The amount of a CustomLineItem in the cart. Must be a positive integer.

    * + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-history/src/Models/Common/Delivery.php b/lib/commercetools-history/src/Models/Common/Delivery.php index 2dc9e76736b..7ad32aa985f 100644 --- a/lib/commercetools-history/src/Models/Common/Delivery.php +++ b/lib/commercetools-history/src/Models/Common/Delivery.php @@ -22,26 +22,31 @@ interface Delivery extends JsonObject public const FIELD_CUSTOM = 'custom'; /** + * @return null|string */ public function getId(); /** + * @return null|string */ public function getCreatedAt(); /** + * @return null|DeliveryItemCollection */ public function getItems(); /** + * @return null|ParcelCollection */ public function getParcels(); /** + * @return null|Address */ public function getAddress(); @@ -49,6 +54,7 @@ public function getAddress(); /** *

    Custom Fields for the Transaction.

    * + * @return null|CustomFields */ public function getCustom(); diff --git a/lib/commercetools-history/src/Models/Common/DeliveryBuilder.php b/lib/commercetools-history/src/Models/Common/DeliveryBuilder.php index 0351b07d0fc..da697682f31 100644 --- a/lib/commercetools-history/src/Models/Common/DeliveryBuilder.php +++ b/lib/commercetools-history/src/Models/Common/DeliveryBuilder.php @@ -21,36 +21,43 @@ final class DeliveryBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $createdAt; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @var ?ParcelCollection */ private $parcels; /** + * @var null|Address|AddressBuilder */ private $address; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @return null|string */ public function getId() @@ -59,6 +66,7 @@ public function getId() } /** + * @return null|string */ public function getCreatedAt() @@ -67,6 +75,7 @@ public function getCreatedAt() } /** + * @return null|DeliveryItemCollection */ public function getItems() @@ -75,6 +84,7 @@ public function getItems() } /** + * @return null|ParcelCollection */ public function getParcels() @@ -83,6 +93,7 @@ public function getParcels() } /** + * @return null|Address */ public function getAddress() @@ -93,6 +104,7 @@ public function getAddress() /** *

    Custom Fields for the Transaction.

    * + * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-history/src/Models/Common/DeliveryItem.php b/lib/commercetools-history/src/Models/Common/DeliveryItem.php index 00df4c2f45e..4896bd7e4a1 100644 --- a/lib/commercetools-history/src/Models/Common/DeliveryItem.php +++ b/lib/commercetools-history/src/Models/Common/DeliveryItem.php @@ -18,11 +18,13 @@ interface DeliveryItem extends JsonObject public const FIELD_QUANTITY = 'quantity'; /** + * @return null|string */ public function getId(); /** + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-history/src/Models/Common/DeliveryItemBuilder.php b/lib/commercetools-history/src/Models/Common/DeliveryItemBuilder.php index 8bd6396b764..7d54ddf58e6 100644 --- a/lib/commercetools-history/src/Models/Common/DeliveryItemBuilder.php +++ b/lib/commercetools-history/src/Models/Common/DeliveryItemBuilder.php @@ -21,16 +21,19 @@ final class DeliveryItemBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $quantity; /** + * @return null|string */ public function getId() @@ -39,6 +42,7 @@ public function getId() } /** + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-history/src/Models/Common/DeliveryItemModel.php b/lib/commercetools-history/src/Models/Common/DeliveryItemModel.php index d1c01cd6b2b..8ecede15345 100644 --- a/lib/commercetools-history/src/Models/Common/DeliveryItemModel.php +++ b/lib/commercetools-history/src/Models/Common/DeliveryItemModel.php @@ -22,11 +22,13 @@ final class DeliveryItemModel extends JsonObjectModel implements DeliveryItem /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $quantity; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -62,6 +65,7 @@ public function getId() } /** + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-history/src/Models/Common/DeliveryModel.php b/lib/commercetools-history/src/Models/Common/DeliveryModel.php index 19f314099c5..c965da05b90 100644 --- a/lib/commercetools-history/src/Models/Common/DeliveryModel.php +++ b/lib/commercetools-history/src/Models/Common/DeliveryModel.php @@ -22,31 +22,37 @@ final class DeliveryModel extends JsonObjectModel implements Delivery /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $createdAt; /** + * * @var ?DeliveryItemCollection */ protected $items; /** + * * @var ?ParcelCollection */ protected $parcels; /** + * * @var ?Address */ protected $address; /** + * * @var ?CustomFields */ protected $custom; @@ -73,6 +79,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -90,6 +97,7 @@ public function getId() } /** + * * @return null|string */ public function getCreatedAt() @@ -107,6 +115,7 @@ public function getCreatedAt() } /** + * * @return null|DeliveryItemCollection */ public function getItems() @@ -124,6 +133,7 @@ public function getItems() } /** + * * @return null|ParcelCollection */ public function getParcels() @@ -141,6 +151,7 @@ public function getParcels() } /** + * * @return null|Address */ public function getAddress() @@ -161,6 +172,7 @@ public function getAddress() /** *

    Custom Fields for the Transaction.

    * + * * @return null|CustomFields */ public function getCustom() diff --git a/lib/commercetools-history/src/Models/Common/DiscountCodeInfo.php b/lib/commercetools-history/src/Models/Common/DiscountCodeInfo.php index c07267baf70..f393085ad4e 100644 --- a/lib/commercetools-history/src/Models/Common/DiscountCodeInfo.php +++ b/lib/commercetools-history/src/Models/Common/DiscountCodeInfo.php @@ -18,11 +18,13 @@ interface DiscountCodeInfo extends JsonObject public const FIELD_STATE = 'state'; /** + * @return null|Reference */ public function getDiscountCode(); /** + * @return null|string */ public function getState(); diff --git a/lib/commercetools-history/src/Models/Common/DiscountCodeInfoBuilder.php b/lib/commercetools-history/src/Models/Common/DiscountCodeInfoBuilder.php index 0be9a03be93..2ca2f55fe1b 100644 --- a/lib/commercetools-history/src/Models/Common/DiscountCodeInfoBuilder.php +++ b/lib/commercetools-history/src/Models/Common/DiscountCodeInfoBuilder.php @@ -21,16 +21,19 @@ final class DiscountCodeInfoBuilder implements Builder { /** + * @var null|Reference|ReferenceBuilder */ private $discountCode; /** + * @var ?string */ private $state; /** + * @return null|Reference */ public function getDiscountCode() @@ -39,6 +42,7 @@ public function getDiscountCode() } /** + * @return null|string */ public function getState() diff --git a/lib/commercetools-history/src/Models/Common/DiscountCodeInfoModel.php b/lib/commercetools-history/src/Models/Common/DiscountCodeInfoModel.php index 222858daf72..6d7ae84ad2b 100644 --- a/lib/commercetools-history/src/Models/Common/DiscountCodeInfoModel.php +++ b/lib/commercetools-history/src/Models/Common/DiscountCodeInfoModel.php @@ -22,11 +22,13 @@ final class DiscountCodeInfoModel extends JsonObjectModel implements DiscountCod /** + * * @var ?Reference */ protected $discountCode; /** + * * @var ?string */ protected $state; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|Reference */ public function getDiscountCode() @@ -63,6 +66,7 @@ public function getDiscountCode() } /** + * * @return null|string */ public function getState() diff --git a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPortion.php b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPortion.php index a7c0ee240c3..9368c80476b 100644 --- a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPortion.php +++ b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPortion.php @@ -18,11 +18,13 @@ interface DiscountedLineItemPortion extends JsonObject public const FIELD_DISCOUNTED_AMOUNT = 'discountedAmount'; /** + * @return null|Reference */ public function getDiscount(); /** + * @return null|Money */ public function getDiscountedAmount(); diff --git a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPortionBuilder.php b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPortionBuilder.php index 01908ab67f8..4b71bc061d2 100644 --- a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPortionBuilder.php +++ b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPortionBuilder.php @@ -21,16 +21,19 @@ final class DiscountedLineItemPortionBuilder implements Builder { /** + * @var null|Reference|ReferenceBuilder */ private $discount; /** + * @var null|Money|MoneyBuilder */ private $discountedAmount; /** + * @return null|Reference */ public function getDiscount() @@ -39,6 +42,7 @@ public function getDiscount() } /** + * @return null|Money */ public function getDiscountedAmount() diff --git a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPortionModel.php b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPortionModel.php index 385ebbf1d00..50ec0982dfb 100644 --- a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPortionModel.php +++ b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPortionModel.php @@ -22,11 +22,13 @@ final class DiscountedLineItemPortionModel extends JsonObjectModel implements Di /** + * * @var ?Reference */ protected $discount; /** + * * @var ?Money */ protected $discountedAmount; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|Reference */ public function getDiscount() @@ -63,6 +66,7 @@ public function getDiscount() } /** + * * @return null|Money */ public function getDiscountedAmount() diff --git a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPrice.php b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPrice.php index f8e054857a8..6096b6a69e4 100644 --- a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPrice.php +++ b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPrice.php @@ -18,11 +18,13 @@ interface DiscountedLineItemPrice extends JsonObject public const FIELD_INCLUDED_DISCOUNTS = 'includedDiscounts'; /** + * @return null|Money */ public function getValue(); /** + * @return null|DiscountedLineItemPortionCollection */ public function getIncludedDiscounts(); diff --git a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceBuilder.php b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceBuilder.php index 15708ee3b31..43fc83302cc 100644 --- a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceBuilder.php +++ b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceBuilder.php @@ -21,16 +21,19 @@ final class DiscountedLineItemPriceBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $value; /** + * @var ?DiscountedLineItemPortionCollection */ private $includedDiscounts; /** + * @return null|Money */ public function getValue() @@ -39,6 +42,7 @@ public function getValue() } /** + * @return null|DiscountedLineItemPortionCollection */ public function getIncludedDiscounts() diff --git a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceForQuantity.php b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceForQuantity.php index ff411b37f86..72c99f24056 100644 --- a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceForQuantity.php +++ b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceForQuantity.php @@ -18,11 +18,13 @@ interface DiscountedLineItemPriceForQuantity extends JsonObject public const FIELD_DISCOUNTED_PRICE = 'discountedPrice'; /** + * @return null|int */ public function getQuantity(); /** + * @return null|DiscountedLineItemPrice */ public function getDiscountedPrice(); diff --git a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceForQuantityBuilder.php b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceForQuantityBuilder.php index b2e96d1c0fc..66ac488a12b 100644 --- a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceForQuantityBuilder.php +++ b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceForQuantityBuilder.php @@ -21,16 +21,19 @@ final class DiscountedLineItemPriceForQuantityBuilder implements Builder { /** + * @var ?int */ private $quantity; /** + * @var null|DiscountedLineItemPrice|DiscountedLineItemPriceBuilder */ private $discountedPrice; /** + * @return null|int */ public function getQuantity() @@ -39,6 +42,7 @@ public function getQuantity() } /** + * @return null|DiscountedLineItemPrice */ public function getDiscountedPrice() diff --git a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceForQuantityModel.php b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceForQuantityModel.php index 9b1619ee359..ca3d3e85fa6 100644 --- a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceForQuantityModel.php +++ b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceForQuantityModel.php @@ -22,11 +22,13 @@ final class DiscountedLineItemPriceForQuantityModel extends JsonObjectModel impl /** + * * @var ?int */ protected $quantity; /** + * * @var ?DiscountedLineItemPrice */ protected $discountedPrice; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|int */ public function getQuantity() @@ -62,6 +65,7 @@ public function getQuantity() } /** + * * @return null|DiscountedLineItemPrice */ public function getDiscountedPrice() diff --git a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceModel.php b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceModel.php index cd00738df68..7053ff1c30e 100644 --- a/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceModel.php +++ b/lib/commercetools-history/src/Models/Common/DiscountedLineItemPriceModel.php @@ -22,11 +22,13 @@ final class DiscountedLineItemPriceModel extends JsonObjectModel implements Disc /** + * * @var ?Money */ protected $value; /** + * * @var ?DiscountedLineItemPortionCollection */ protected $includedDiscounts; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|Money */ public function getValue() @@ -63,6 +66,7 @@ public function getValue() } /** + * * @return null|DiscountedLineItemPortionCollection */ public function getIncludedDiscounts() diff --git a/lib/commercetools-history/src/Models/Common/FieldDefinition.php b/lib/commercetools-history/src/Models/Common/FieldDefinition.php index 2ea96d0cb40..84d3217789f 100644 --- a/lib/commercetools-history/src/Models/Common/FieldDefinition.php +++ b/lib/commercetools-history/src/Models/Common/FieldDefinition.php @@ -20,6 +20,7 @@ interface FieldDefinition extends JsonObject public const FIELD_INPUT_HINT = 'inputHint'; /** + * @return null|FieldType */ public function getType(); @@ -27,16 +28,19 @@ public function getType(); /** *

    The name of the field. The name must be between two and 36 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). The name must be unique for a given resource type ID. In case there is a field with the same name in another type it has to have the same FieldType also.

    * + * @return null|string */ public function getName(); /** + * @return null|LocalizedString */ public function getLabel(); /** + * @return null|string */ public function getInputHint(); diff --git a/lib/commercetools-history/src/Models/Common/FieldDefinitionBuilder.php b/lib/commercetools-history/src/Models/Common/FieldDefinitionBuilder.php index bc509535094..d742a3deaf3 100644 --- a/lib/commercetools-history/src/Models/Common/FieldDefinitionBuilder.php +++ b/lib/commercetools-history/src/Models/Common/FieldDefinitionBuilder.php @@ -21,26 +21,31 @@ final class FieldDefinitionBuilder implements Builder { /** + * @var null|FieldType|FieldTypeBuilder */ private $type; /** + * @var ?string */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; /** + * @var ?string */ private $inputHint; /** + * @return null|FieldType */ public function getType() @@ -51,6 +56,7 @@ public function getType() /** *

    The name of the field. The name must be between two and 36 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). The name must be unique for a given resource type ID. In case there is a field with the same name in another type it has to have the same FieldType also.

    * + * @return null|string */ public function getName() @@ -59,6 +65,7 @@ public function getName() } /** + * @return null|LocalizedString */ public function getLabel() @@ -67,6 +74,7 @@ public function getLabel() } /** + * @return null|string */ public function getInputHint() diff --git a/lib/commercetools-history/src/Models/Common/FieldDefinitionModel.php b/lib/commercetools-history/src/Models/Common/FieldDefinitionModel.php index 0e9f371a213..331767fd414 100644 --- a/lib/commercetools-history/src/Models/Common/FieldDefinitionModel.php +++ b/lib/commercetools-history/src/Models/Common/FieldDefinitionModel.php @@ -22,21 +22,25 @@ final class FieldDefinitionModel extends JsonObjectModel implements FieldDefinit /** + * * @var ?FieldType */ protected $type; /** + * * @var ?string */ protected $name; /** + * * @var ?LocalizedString */ protected $label; /** + * * @var ?string */ protected $inputHint; @@ -59,6 +63,7 @@ public function __construct( } /** + * * @return null|FieldType */ public function getType() @@ -79,6 +84,7 @@ public function getType() /** *

    The name of the field. The name must be between two and 36 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). The name must be unique for a given resource type ID. In case there is a field with the same name in another type it has to have the same FieldType also.

    * + * * @return null|string */ public function getName() @@ -96,6 +102,7 @@ public function getName() } /** + * * @return null|LocalizedString */ public function getLabel() @@ -114,6 +121,7 @@ public function getLabel() } /** + * * @return null|string */ public function getInputHint() diff --git a/lib/commercetools-history/src/Models/Common/FieldType.php b/lib/commercetools-history/src/Models/Common/FieldType.php index 63b8ec0530d..ce986cefe17 100644 --- a/lib/commercetools-history/src/Models/Common/FieldType.php +++ b/lib/commercetools-history/src/Models/Common/FieldType.php @@ -17,6 +17,7 @@ interface FieldType extends JsonObject public const FIELD_NAME = 'name'; /** + * @return null|string */ public function getName(); diff --git a/lib/commercetools-history/src/Models/Common/FieldTypeBuilder.php b/lib/commercetools-history/src/Models/Common/FieldTypeBuilder.php index c99fdb7a313..c984c666020 100644 --- a/lib/commercetools-history/src/Models/Common/FieldTypeBuilder.php +++ b/lib/commercetools-history/src/Models/Common/FieldTypeBuilder.php @@ -21,11 +21,13 @@ final class FieldTypeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @return null|string */ public function getName() diff --git a/lib/commercetools-history/src/Models/Common/FieldTypeModel.php b/lib/commercetools-history/src/Models/Common/FieldTypeModel.php index fad74e311d4..ba7af11e788 100644 --- a/lib/commercetools-history/src/Models/Common/FieldTypeModel.php +++ b/lib/commercetools-history/src/Models/Common/FieldTypeModel.php @@ -22,6 +22,7 @@ final class FieldTypeModel extends JsonObjectModel implements FieldType /** + * * @var ?string */ protected $name; @@ -38,6 +39,7 @@ public function __construct( } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-history/src/Models/Common/GeoLocation.php b/lib/commercetools-history/src/Models/Common/GeoLocation.php index ba4702e3513..b59d3989b79 100644 --- a/lib/commercetools-history/src/Models/Common/GeoLocation.php +++ b/lib/commercetools-history/src/Models/Common/GeoLocation.php @@ -18,11 +18,13 @@ interface GeoLocation extends JsonObject public const FIELD_COORDINATES = 'coordinates'; /** + * @return null|string */ public function getType(); /** + * @return null|array */ public function getCoordinates(); diff --git a/lib/commercetools-history/src/Models/Common/GeoLocationBuilder.php b/lib/commercetools-history/src/Models/Common/GeoLocationBuilder.php index 79d1d6d80fa..c3678e6e68e 100644 --- a/lib/commercetools-history/src/Models/Common/GeoLocationBuilder.php +++ b/lib/commercetools-history/src/Models/Common/GeoLocationBuilder.php @@ -21,16 +21,19 @@ final class GeoLocationBuilder implements Builder { /** + * @var ?string */ private $type; /** + * @var ?array */ private $coordinates; /** + * @return null|string */ public function getType() @@ -39,6 +42,7 @@ public function getType() } /** + * @return null|array */ public function getCoordinates() diff --git a/lib/commercetools-history/src/Models/Common/GeoLocationModel.php b/lib/commercetools-history/src/Models/Common/GeoLocationModel.php index 3ccb991a650..a7fd183af47 100644 --- a/lib/commercetools-history/src/Models/Common/GeoLocationModel.php +++ b/lib/commercetools-history/src/Models/Common/GeoLocationModel.php @@ -22,11 +22,13 @@ final class GeoLocationModel extends JsonObjectModel implements GeoLocation /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $coordinates; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|string */ public function getType() @@ -62,6 +65,7 @@ public function getType() } /** + * * @return null|array */ public function getCoordinates() diff --git a/lib/commercetools-history/src/Models/Common/Image.php b/lib/commercetools-history/src/Models/Common/Image.php index 7c237e6e4d4..0fd7aff5ca0 100644 --- a/lib/commercetools-history/src/Models/Common/Image.php +++ b/lib/commercetools-history/src/Models/Common/Image.php @@ -19,16 +19,19 @@ interface Image extends JsonObject public const FIELD_LABEL = 'label'; /** + * @return null|string */ public function getUrl(); /** + * @return null|ImageDimensions */ public function getDimensions(); /** + * @return null|string */ public function getLabel(); diff --git a/lib/commercetools-history/src/Models/Common/ImageBuilder.php b/lib/commercetools-history/src/Models/Common/ImageBuilder.php index 9c204bf204f..2007ad2e221 100644 --- a/lib/commercetools-history/src/Models/Common/ImageBuilder.php +++ b/lib/commercetools-history/src/Models/Common/ImageBuilder.php @@ -21,21 +21,25 @@ final class ImageBuilder implements Builder { /** + * @var ?string */ private $url; /** + * @var null|ImageDimensions|ImageDimensionsBuilder */ private $dimensions; /** + * @var ?string */ private $label; /** + * @return null|string */ public function getUrl() @@ -44,6 +48,7 @@ public function getUrl() } /** + * @return null|ImageDimensions */ public function getDimensions() @@ -52,6 +57,7 @@ public function getDimensions() } /** + * @return null|string */ public function getLabel() diff --git a/lib/commercetools-history/src/Models/Common/ImageDimensions.php b/lib/commercetools-history/src/Models/Common/ImageDimensions.php index a42a6c01aaa..9059408e259 100644 --- a/lib/commercetools-history/src/Models/Common/ImageDimensions.php +++ b/lib/commercetools-history/src/Models/Common/ImageDimensions.php @@ -18,11 +18,13 @@ interface ImageDimensions extends JsonObject public const FIELD_H = 'h'; /** + * @return null|int */ public function getW(); /** + * @return null|int */ public function getH(); diff --git a/lib/commercetools-history/src/Models/Common/ImageDimensionsBuilder.php b/lib/commercetools-history/src/Models/Common/ImageDimensionsBuilder.php index 7826fca4311..b2fe6b5a830 100644 --- a/lib/commercetools-history/src/Models/Common/ImageDimensionsBuilder.php +++ b/lib/commercetools-history/src/Models/Common/ImageDimensionsBuilder.php @@ -21,16 +21,19 @@ final class ImageDimensionsBuilder implements Builder { /** + * @var ?int */ private $w; /** + * @var ?int */ private $h; /** + * @return null|int */ public function getW() @@ -39,6 +42,7 @@ public function getW() } /** + * @return null|int */ public function getH() diff --git a/lib/commercetools-history/src/Models/Common/ImageDimensionsModel.php b/lib/commercetools-history/src/Models/Common/ImageDimensionsModel.php index 83d89d59d97..e31484fd24f 100644 --- a/lib/commercetools-history/src/Models/Common/ImageDimensionsModel.php +++ b/lib/commercetools-history/src/Models/Common/ImageDimensionsModel.php @@ -22,11 +22,13 @@ final class ImageDimensionsModel extends JsonObjectModel implements ImageDimensi /** + * * @var ?int */ protected $w; /** + * * @var ?int */ protected $h; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|int */ public function getW() @@ -62,6 +65,7 @@ public function getW() } /** + * * @return null|int */ public function getH() diff --git a/lib/commercetools-history/src/Models/Common/ImageModel.php b/lib/commercetools-history/src/Models/Common/ImageModel.php index 97c359301f0..a02c0af7e31 100644 --- a/lib/commercetools-history/src/Models/Common/ImageModel.php +++ b/lib/commercetools-history/src/Models/Common/ImageModel.php @@ -22,16 +22,19 @@ final class ImageModel extends JsonObjectModel implements Image /** + * * @var ?string */ protected $url; /** + * * @var ?ImageDimensions */ protected $dimensions; /** + * * @var ?string */ protected $label; @@ -52,6 +55,7 @@ public function __construct( } /** + * * @return null|string */ public function getUrl() @@ -69,6 +73,7 @@ public function getUrl() } /** + * * @return null|ImageDimensions */ public function getDimensions() @@ -87,6 +92,7 @@ public function getDimensions() } /** + * * @return null|string */ public function getLabel() diff --git a/lib/commercetools-history/src/Models/Common/ItemShippingDetails.php b/lib/commercetools-history/src/Models/Common/ItemShippingDetails.php index 6b3c6980906..0dcee422051 100644 --- a/lib/commercetools-history/src/Models/Common/ItemShippingDetails.php +++ b/lib/commercetools-history/src/Models/Common/ItemShippingDetails.php @@ -18,6 +18,7 @@ interface ItemShippingDetails extends JsonObject public const FIELD_VALID = 'valid'; /** + * @return null|ItemShippingTargetCollection */ public function getTargets(); @@ -25,6 +26,7 @@ public function getTargets(); /** *

    true if the quantity of the (custom) line item is equal to the sum of the sub-quantities in targets, false otherwise. A cart cannot be ordered when the value is false. The error InvalidItemShippingDetails will be triggered.

    * + * @return null|bool */ public function getValid(); diff --git a/lib/commercetools-history/src/Models/Common/ItemShippingDetailsBuilder.php b/lib/commercetools-history/src/Models/Common/ItemShippingDetailsBuilder.php index bf8539023c4..77ae80ac615 100644 --- a/lib/commercetools-history/src/Models/Common/ItemShippingDetailsBuilder.php +++ b/lib/commercetools-history/src/Models/Common/ItemShippingDetailsBuilder.php @@ -21,16 +21,19 @@ final class ItemShippingDetailsBuilder implements Builder { /** + * @var ?ItemShippingTargetCollection */ private $targets; /** + * @var ?bool */ private $valid; /** + * @return null|ItemShippingTargetCollection */ public function getTargets() @@ -41,6 +44,7 @@ public function getTargets() /** *

    true if the quantity of the (custom) line item is equal to the sum of the sub-quantities in targets, false otherwise. A cart cannot be ordered when the value is false. The error InvalidItemShippingDetails will be triggered.

    * + * @return null|bool */ public function getValid() diff --git a/lib/commercetools-history/src/Models/Common/ItemShippingDetailsModel.php b/lib/commercetools-history/src/Models/Common/ItemShippingDetailsModel.php index c6946f45958..8b629565723 100644 --- a/lib/commercetools-history/src/Models/Common/ItemShippingDetailsModel.php +++ b/lib/commercetools-history/src/Models/Common/ItemShippingDetailsModel.php @@ -22,11 +22,13 @@ final class ItemShippingDetailsModel extends JsonObjectModel implements ItemShip /** + * * @var ?ItemShippingTargetCollection */ protected $targets; /** + * * @var ?bool */ protected $valid; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|ItemShippingTargetCollection */ public function getTargets() @@ -64,6 +67,7 @@ public function getTargets() /** *

    true if the quantity of the (custom) line item is equal to the sum of the sub-quantities in targets, false otherwise. A cart cannot be ordered when the value is false. The error InvalidItemShippingDetails will be triggered.

    * + * * @return null|bool */ public function getValid() diff --git a/lib/commercetools-history/src/Models/Common/ItemShippingTarget.php b/lib/commercetools-history/src/Models/Common/ItemShippingTarget.php index 9ecc06a29f8..76fde52a2d0 100644 --- a/lib/commercetools-history/src/Models/Common/ItemShippingTarget.php +++ b/lib/commercetools-history/src/Models/Common/ItemShippingTarget.php @@ -20,6 +20,7 @@ interface ItemShippingTarget extends JsonObject /** *

    The key of the address in the cart's itemShippingAddresses

    * + * @return null|string */ public function getAddressKey(); @@ -27,6 +28,7 @@ public function getAddressKey(); /** *

    The quantity of items that should go to the address with the specified addressKey. Only positive values are allowed. Using 0 as quantity is also possible in a draft object, but the element will not be present in the resulting ItemShippingDetails.

    * + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-history/src/Models/Common/ItemShippingTargetBuilder.php b/lib/commercetools-history/src/Models/Common/ItemShippingTargetBuilder.php index 6aa0181b404..d07329a6c3b 100644 --- a/lib/commercetools-history/src/Models/Common/ItemShippingTargetBuilder.php +++ b/lib/commercetools-history/src/Models/Common/ItemShippingTargetBuilder.php @@ -21,11 +21,13 @@ final class ItemShippingTargetBuilder implements Builder { /** + * @var ?string */ private $addressKey; /** + * @var ?int */ private $quantity; @@ -33,6 +35,7 @@ final class ItemShippingTargetBuilder implements Builder /** *

    The key of the address in the cart's itemShippingAddresses

    * + * @return null|string */ public function getAddressKey() @@ -43,6 +46,7 @@ public function getAddressKey() /** *

    The quantity of items that should go to the address with the specified addressKey. Only positive values are allowed. Using 0 as quantity is also possible in a draft object, but the element will not be present in the resulting ItemShippingDetails.

    * + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-history/src/Models/Common/ItemShippingTargetModel.php b/lib/commercetools-history/src/Models/Common/ItemShippingTargetModel.php index a40ea5ce7af..62b0db60763 100644 --- a/lib/commercetools-history/src/Models/Common/ItemShippingTargetModel.php +++ b/lib/commercetools-history/src/Models/Common/ItemShippingTargetModel.php @@ -22,11 +22,13 @@ final class ItemShippingTargetModel extends JsonObjectModel implements ItemShipp /** + * * @var ?string */ protected $addressKey; /** + * * @var ?int */ protected $quantity; @@ -47,6 +49,7 @@ public function __construct( /** *

    The key of the address in the cart's itemShippingAddresses

    * + * * @return null|string */ public function getAddressKey() @@ -66,6 +69,7 @@ public function getAddressKey() /** *

    The quantity of items that should go to the address with the specified addressKey. Only positive values are allowed. Using 0 as quantity is also possible in a draft object, but the element will not be present in the resulting ItemShippingDetails.

    * + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-history/src/Models/Common/ItemState.php b/lib/commercetools-history/src/Models/Common/ItemState.php index 71d013f6ae2..434cdc061d5 100644 --- a/lib/commercetools-history/src/Models/Common/ItemState.php +++ b/lib/commercetools-history/src/Models/Common/ItemState.php @@ -18,11 +18,13 @@ interface ItemState extends JsonObject public const FIELD_STATE = 'state'; /** + * @return null|int */ public function getQuantity(); /** + * @return null|Reference */ public function getState(); diff --git a/lib/commercetools-history/src/Models/Common/ItemStateBuilder.php b/lib/commercetools-history/src/Models/Common/ItemStateBuilder.php index dd402b61146..5e3076b210b 100644 --- a/lib/commercetools-history/src/Models/Common/ItemStateBuilder.php +++ b/lib/commercetools-history/src/Models/Common/ItemStateBuilder.php @@ -21,16 +21,19 @@ final class ItemStateBuilder implements Builder { /** + * @var ?int */ private $quantity; /** + * @var null|Reference|ReferenceBuilder */ private $state; /** + * @return null|int */ public function getQuantity() @@ -39,6 +42,7 @@ public function getQuantity() } /** + * @return null|Reference */ public function getState() diff --git a/lib/commercetools-history/src/Models/Common/ItemStateModel.php b/lib/commercetools-history/src/Models/Common/ItemStateModel.php index cb00050b6f9..92dd67bdc5c 100644 --- a/lib/commercetools-history/src/Models/Common/ItemStateModel.php +++ b/lib/commercetools-history/src/Models/Common/ItemStateModel.php @@ -22,11 +22,13 @@ final class ItemStateModel extends JsonObjectModel implements ItemState /** + * * @var ?int */ protected $quantity; /** + * * @var ?Reference */ protected $state; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|int */ public function getQuantity() @@ -62,6 +65,7 @@ public function getQuantity() } /** + * * @return null|Reference */ public function getState() diff --git a/lib/commercetools-history/src/Models/Common/KeyReference.php b/lib/commercetools-history/src/Models/Common/KeyReference.php index 60f29d402d1..1b1cd7da533 100644 --- a/lib/commercetools-history/src/Models/Common/KeyReference.php +++ b/lib/commercetools-history/src/Models/Common/KeyReference.php @@ -18,11 +18,13 @@ interface KeyReference extends JsonObject public const FIELD_TYPE_ID = 'typeId'; /** + * @return null|string */ public function getKey(); /** + * @return null|string */ public function getTypeId(); diff --git a/lib/commercetools-history/src/Models/Common/KeyReferenceBuilder.php b/lib/commercetools-history/src/Models/Common/KeyReferenceBuilder.php index b6794cf534a..5edad50266c 100644 --- a/lib/commercetools-history/src/Models/Common/KeyReferenceBuilder.php +++ b/lib/commercetools-history/src/Models/Common/KeyReferenceBuilder.php @@ -21,16 +21,19 @@ final class KeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $typeId; /** + * @return null|string */ public function getKey() @@ -39,6 +42,7 @@ public function getKey() } /** + * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-history/src/Models/Common/KeyReferenceModel.php b/lib/commercetools-history/src/Models/Common/KeyReferenceModel.php index 89b33e9bcc1..b40570be84d 100644 --- a/lib/commercetools-history/src/Models/Common/KeyReferenceModel.php +++ b/lib/commercetools-history/src/Models/Common/KeyReferenceModel.php @@ -22,11 +22,13 @@ final class KeyReferenceModel extends JsonObjectModel implements KeyReference /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|string */ public function getKey() @@ -62,6 +65,7 @@ public function getKey() } /** + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-history/src/Models/Common/LineItem.php b/lib/commercetools-history/src/Models/Common/LineItem.php index 177e5c17270..4688f6fa8ec 100644 --- a/lib/commercetools-history/src/Models/Common/LineItem.php +++ b/lib/commercetools-history/src/Models/Common/LineItem.php @@ -26,51 +26,61 @@ interface LineItem extends JsonObject public const FIELD_VARIANT_ID = 'variantId'; /** + * @return null|string */ public function getAddedAt(); /** + * @return null|CustomFields */ public function getCustom(); /** + * @return null|string */ public function getId(); /** + * @return null|LocalizedString */ public function getName(); /** + * @return null|string */ public function getProductId(); /** + * @return null|LocalizedString */ public function getProductSlug(); /** + * @return null|Reference */ public function getProductType(); /** + * @return null|int */ public function getQuantity(); /** + * @return null|Variant */ public function getVariant(); /** + * @return null|int */ public function getVariantId(); diff --git a/lib/commercetools-history/src/Models/Common/LineItemBuilder.php b/lib/commercetools-history/src/Models/Common/LineItemBuilder.php index d65d08f7a61..3e79b30807d 100644 --- a/lib/commercetools-history/src/Models/Common/LineItemBuilder.php +++ b/lib/commercetools-history/src/Models/Common/LineItemBuilder.php @@ -21,56 +21,67 @@ final class LineItemBuilder implements Builder { /** + * @var ?string */ private $addedAt; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var ?string */ private $id; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?string */ private $productId; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $productSlug; /** + * @var null|Reference|ReferenceBuilder */ private $productType; /** + * @var ?int */ private $quantity; /** + * @var null|Variant|VariantBuilder */ private $variant; /** + * @var ?int */ private $variantId; /** + * @return null|string */ public function getAddedAt() @@ -79,6 +90,7 @@ public function getAddedAt() } /** + * @return null|CustomFields */ public function getCustom() @@ -87,6 +99,7 @@ public function getCustom() } /** + * @return null|string */ public function getId() @@ -95,6 +108,7 @@ public function getId() } /** + * @return null|LocalizedString */ public function getName() @@ -103,6 +117,7 @@ public function getName() } /** + * @return null|string */ public function getProductId() @@ -111,6 +126,7 @@ public function getProductId() } /** + * @return null|LocalizedString */ public function getProductSlug() @@ -119,6 +135,7 @@ public function getProductSlug() } /** + * @return null|Reference */ public function getProductType() @@ -127,6 +144,7 @@ public function getProductType() } /** + * @return null|int */ public function getQuantity() @@ -135,6 +153,7 @@ public function getQuantity() } /** + * @return null|Variant */ public function getVariant() @@ -143,6 +162,7 @@ public function getVariant() } /** + * @return null|int */ public function getVariantId() diff --git a/lib/commercetools-history/src/Models/Common/LineItemModel.php b/lib/commercetools-history/src/Models/Common/LineItemModel.php index 7dd12710122..a23bab644a7 100644 --- a/lib/commercetools-history/src/Models/Common/LineItemModel.php +++ b/lib/commercetools-history/src/Models/Common/LineItemModel.php @@ -22,51 +22,61 @@ final class LineItemModel extends JsonObjectModel implements LineItem /** + * * @var ?string */ protected $addedAt; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?string */ protected $id; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?string */ protected $productId; /** + * * @var ?LocalizedString */ protected $productSlug; /** + * * @var ?Reference */ protected $productType; /** + * * @var ?int */ protected $quantity; /** + * * @var ?Variant */ protected $variant; /** + * * @var ?int */ protected $variantId; @@ -101,6 +111,7 @@ public function __construct( } /** + * * @return null|string */ public function getAddedAt() @@ -118,6 +129,7 @@ public function getAddedAt() } /** + * * @return null|CustomFields */ public function getCustom() @@ -136,6 +148,7 @@ public function getCustom() } /** + * * @return null|string */ public function getId() @@ -153,6 +166,7 @@ public function getId() } /** + * * @return null|LocalizedString */ public function getName() @@ -171,6 +185,7 @@ public function getName() } /** + * * @return null|string */ public function getProductId() @@ -188,6 +203,7 @@ public function getProductId() } /** + * * @return null|LocalizedString */ public function getProductSlug() @@ -206,6 +222,7 @@ public function getProductSlug() } /** + * * @return null|Reference */ public function getProductType() @@ -224,6 +241,7 @@ public function getProductType() } /** + * * @return null|int */ public function getQuantity() @@ -241,6 +259,7 @@ public function getQuantity() } /** + * * @return null|Variant */ public function getVariant() @@ -259,6 +278,7 @@ public function getVariant() } /** + * * @return null|int */ public function getVariantId() diff --git a/lib/commercetools-history/src/Models/Common/Location.php b/lib/commercetools-history/src/Models/Common/Location.php index 4f2d31b55bd..9419857bbd6 100644 --- a/lib/commercetools-history/src/Models/Common/Location.php +++ b/lib/commercetools-history/src/Models/Common/Location.php @@ -20,11 +20,13 @@ interface Location extends JsonObject /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry(); /** + * @return null|string */ public function getState(); diff --git a/lib/commercetools-history/src/Models/Common/LocationBuilder.php b/lib/commercetools-history/src/Models/Common/LocationBuilder.php index 9757ba24c58..49207eaf8b7 100644 --- a/lib/commercetools-history/src/Models/Common/LocationBuilder.php +++ b/lib/commercetools-history/src/Models/Common/LocationBuilder.php @@ -21,11 +21,13 @@ final class LocationBuilder implements Builder { /** + * @var ?string */ private $country; /** + * @var ?string */ private $state; @@ -33,6 +35,7 @@ final class LocationBuilder implements Builder /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry() @@ -41,6 +44,7 @@ public function getCountry() } /** + * @return null|string */ public function getState() diff --git a/lib/commercetools-history/src/Models/Common/LocationModel.php b/lib/commercetools-history/src/Models/Common/LocationModel.php index 1ad6ce4247a..477497a5b89 100644 --- a/lib/commercetools-history/src/Models/Common/LocationModel.php +++ b/lib/commercetools-history/src/Models/Common/LocationModel.php @@ -22,11 +22,13 @@ final class LocationModel extends JsonObjectModel implements Location /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $state; @@ -47,6 +49,7 @@ public function __construct( /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * * @return null|string */ public function getCountry() @@ -64,6 +67,7 @@ public function getCountry() } /** + * * @return null|string */ public function getState() diff --git a/lib/commercetools-history/src/Models/Common/Money.php b/lib/commercetools-history/src/Models/Common/Money.php index e11caf48895..25298abdfc9 100644 --- a/lib/commercetools-history/src/Models/Common/Money.php +++ b/lib/commercetools-history/src/Models/Common/Money.php @@ -22,21 +22,25 @@ interface Money extends JsonObject /** *

    Currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode(); /** + * @return null|int */ public function getCentAmount(); /** + * @return null|int */ public function getFractionDigits(); /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-history/src/Models/Common/MoneyBuilder.php b/lib/commercetools-history/src/Models/Common/MoneyBuilder.php index 6e5e0b40270..8a75da8588d 100644 --- a/lib/commercetools-history/src/Models/Common/MoneyBuilder.php +++ b/lib/commercetools-history/src/Models/Common/MoneyBuilder.php @@ -21,21 +21,25 @@ final class MoneyBuilder implements Builder { /** + * @var ?string */ private $currencyCode; /** + * @var ?int */ private $centAmount; /** + * @var ?int */ private $fractionDigits; /** + * @var ?string */ private $type; @@ -43,6 +47,7 @@ final class MoneyBuilder implements Builder /** *

    Currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode() @@ -51,6 +56,7 @@ public function getCurrencyCode() } /** + * @return null|int */ public function getCentAmount() @@ -59,6 +65,7 @@ public function getCentAmount() } /** + * @return null|int */ public function getFractionDigits() @@ -67,6 +74,7 @@ public function getFractionDigits() } /** + * @return null|string */ public function getType() diff --git a/lib/commercetools-history/src/Models/Common/MoneyModel.php b/lib/commercetools-history/src/Models/Common/MoneyModel.php index 91dd3e0eb4d..92c97a5e618 100644 --- a/lib/commercetools-history/src/Models/Common/MoneyModel.php +++ b/lib/commercetools-history/src/Models/Common/MoneyModel.php @@ -22,21 +22,25 @@ final class MoneyModel extends JsonObjectModel implements Money /** + * * @var ?string */ protected $currencyCode; /** + * * @var ?int */ protected $centAmount; /** + * * @var ?int */ protected $fractionDigits; /** + * * @var ?string */ protected $type; @@ -61,6 +65,7 @@ public function __construct( /** *

    Currency code compliant to ISO 4217.

    * + * * @return null|string */ public function getCurrencyCode() @@ -78,6 +83,7 @@ public function getCurrencyCode() } /** + * * @return null|int */ public function getCentAmount() @@ -95,6 +101,7 @@ public function getCentAmount() } /** + * * @return null|int */ public function getFractionDigits() @@ -112,6 +119,7 @@ public function getFractionDigits() } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-history/src/Models/Common/Parcel.php b/lib/commercetools-history/src/Models/Common/Parcel.php index afde9473a16..623217f1f64 100644 --- a/lib/commercetools-history/src/Models/Common/Parcel.php +++ b/lib/commercetools-history/src/Models/Common/Parcel.php @@ -21,26 +21,31 @@ interface Parcel extends JsonObject public const FIELD_ITEMS = 'items'; /** + * @return null|string */ public function getId(); /** + * @return null|string */ public function getCreatedAt(); /** + * @return null|ParcelMeasurements */ public function getMeasurements(); /** + * @return null|TrackingData */ public function getTrackingData(); /** + * @return null|DeliveryItemCollection */ public function getItems(); diff --git a/lib/commercetools-history/src/Models/Common/ParcelBuilder.php b/lib/commercetools-history/src/Models/Common/ParcelBuilder.php index 712483b4a3e..e61c7fe4812 100644 --- a/lib/commercetools-history/src/Models/Common/ParcelBuilder.php +++ b/lib/commercetools-history/src/Models/Common/ParcelBuilder.php @@ -21,31 +21,37 @@ final class ParcelBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $createdAt; /** + * @var null|ParcelMeasurements|ParcelMeasurementsBuilder */ private $measurements; /** + * @var null|TrackingData|TrackingDataBuilder */ private $trackingData; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @return null|string */ public function getId() @@ -54,6 +60,7 @@ public function getId() } /** + * @return null|string */ public function getCreatedAt() @@ -62,6 +69,7 @@ public function getCreatedAt() } /** + * @return null|ParcelMeasurements */ public function getMeasurements() @@ -70,6 +78,7 @@ public function getMeasurements() } /** + * @return null|TrackingData */ public function getTrackingData() @@ -78,6 +87,7 @@ public function getTrackingData() } /** + * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-history/src/Models/Common/ParcelMeasurements.php b/lib/commercetools-history/src/Models/Common/ParcelMeasurements.php index f07e60789cd..58aa265da85 100644 --- a/lib/commercetools-history/src/Models/Common/ParcelMeasurements.php +++ b/lib/commercetools-history/src/Models/Common/ParcelMeasurements.php @@ -20,21 +20,25 @@ interface ParcelMeasurements extends JsonObject public const FIELD_WEIGHT_IN_GRAM = 'weightInGram'; /** + * @return null|int */ public function getHeightInMillimeter(); /** + * @return null|int */ public function getLengthInMillimeter(); /** + * @return null|int */ public function getWidthInMillimeter(); /** + * @return null|int */ public function getWeightInGram(); diff --git a/lib/commercetools-history/src/Models/Common/ParcelMeasurementsBuilder.php b/lib/commercetools-history/src/Models/Common/ParcelMeasurementsBuilder.php index 2c013015c57..f6082981c69 100644 --- a/lib/commercetools-history/src/Models/Common/ParcelMeasurementsBuilder.php +++ b/lib/commercetools-history/src/Models/Common/ParcelMeasurementsBuilder.php @@ -21,26 +21,31 @@ final class ParcelMeasurementsBuilder implements Builder { /** + * @var ?int */ private $heightInMillimeter; /** + * @var ?int */ private $lengthInMillimeter; /** + * @var ?int */ private $widthInMillimeter; /** + * @var ?int */ private $weightInGram; /** + * @return null|int */ public function getHeightInMillimeter() @@ -49,6 +54,7 @@ public function getHeightInMillimeter() } /** + * @return null|int */ public function getLengthInMillimeter() @@ -57,6 +63,7 @@ public function getLengthInMillimeter() } /** + * @return null|int */ public function getWidthInMillimeter() @@ -65,6 +72,7 @@ public function getWidthInMillimeter() } /** + * @return null|int */ public function getWeightInGram() diff --git a/lib/commercetools-history/src/Models/Common/ParcelMeasurementsModel.php b/lib/commercetools-history/src/Models/Common/ParcelMeasurementsModel.php index 26f7574e072..48b604e7361 100644 --- a/lib/commercetools-history/src/Models/Common/ParcelMeasurementsModel.php +++ b/lib/commercetools-history/src/Models/Common/ParcelMeasurementsModel.php @@ -22,21 +22,25 @@ final class ParcelMeasurementsModel extends JsonObjectModel implements ParcelMea /** + * * @var ?int */ protected $heightInMillimeter; /** + * * @var ?int */ protected $lengthInMillimeter; /** + * * @var ?int */ protected $widthInMillimeter; /** + * * @var ?int */ protected $weightInGram; @@ -59,6 +63,7 @@ public function __construct( } /** + * * @return null|int */ public function getHeightInMillimeter() @@ -76,6 +81,7 @@ public function getHeightInMillimeter() } /** + * * @return null|int */ public function getLengthInMillimeter() @@ -93,6 +99,7 @@ public function getLengthInMillimeter() } /** + * * @return null|int */ public function getWidthInMillimeter() @@ -110,6 +117,7 @@ public function getWidthInMillimeter() } /** + * * @return null|int */ public function getWeightInGram() diff --git a/lib/commercetools-history/src/Models/Common/ParcelModel.php b/lib/commercetools-history/src/Models/Common/ParcelModel.php index 51dcd8ea9d2..a2f78e49313 100644 --- a/lib/commercetools-history/src/Models/Common/ParcelModel.php +++ b/lib/commercetools-history/src/Models/Common/ParcelModel.php @@ -22,26 +22,31 @@ final class ParcelModel extends JsonObjectModel implements Parcel /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $createdAt; /** + * * @var ?ParcelMeasurements */ protected $measurements; /** + * * @var ?TrackingData */ protected $trackingData; /** + * * @var ?DeliveryItemCollection */ protected $items; @@ -66,6 +71,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -83,6 +89,7 @@ public function getId() } /** + * * @return null|string */ public function getCreatedAt() @@ -100,6 +107,7 @@ public function getCreatedAt() } /** + * * @return null|ParcelMeasurements */ public function getMeasurements() @@ -118,6 +126,7 @@ public function getMeasurements() } /** + * * @return null|TrackingData */ public function getTrackingData() @@ -136,6 +145,7 @@ public function getTrackingData() } /** + * * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-history/src/Models/Common/PaymentInfo.php b/lib/commercetools-history/src/Models/Common/PaymentInfo.php index 67964fa9d0c..067e9564149 100644 --- a/lib/commercetools-history/src/Models/Common/PaymentInfo.php +++ b/lib/commercetools-history/src/Models/Common/PaymentInfo.php @@ -17,6 +17,7 @@ interface PaymentInfo extends JsonObject public const FIELD_PAYMENTS = 'payments'; /** + * @return null|ReferenceCollection */ public function getPayments(); diff --git a/lib/commercetools-history/src/Models/Common/PaymentInfoBuilder.php b/lib/commercetools-history/src/Models/Common/PaymentInfoBuilder.php index ad599f13d80..7f27db76c45 100644 --- a/lib/commercetools-history/src/Models/Common/PaymentInfoBuilder.php +++ b/lib/commercetools-history/src/Models/Common/PaymentInfoBuilder.php @@ -21,11 +21,13 @@ final class PaymentInfoBuilder implements Builder { /** + * @var ?ReferenceCollection */ private $payments; /** + * @return null|ReferenceCollection */ public function getPayments() diff --git a/lib/commercetools-history/src/Models/Common/PaymentInfoModel.php b/lib/commercetools-history/src/Models/Common/PaymentInfoModel.php index e0348b9014a..00be66ad0e9 100644 --- a/lib/commercetools-history/src/Models/Common/PaymentInfoModel.php +++ b/lib/commercetools-history/src/Models/Common/PaymentInfoModel.php @@ -22,6 +22,7 @@ final class PaymentInfoModel extends JsonObjectModel implements PaymentInfo /** + * * @var ?ReferenceCollection */ protected $payments; @@ -38,6 +39,7 @@ public function __construct( } /** + * * @return null|ReferenceCollection */ public function getPayments() diff --git a/lib/commercetools-history/src/Models/Common/Price.php b/lib/commercetools-history/src/Models/Common/Price.php index 3518f787e3f..c9cd4eb1e93 100644 --- a/lib/commercetools-history/src/Models/Common/Price.php +++ b/lib/commercetools-history/src/Models/Common/Price.php @@ -18,11 +18,13 @@ interface Price extends JsonObject public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getId(); /** + * @return null|Money */ public function getValue(); diff --git a/lib/commercetools-history/src/Models/Common/PriceBuilder.php b/lib/commercetools-history/src/Models/Common/PriceBuilder.php index dc6a940bf28..961bd9ce68f 100644 --- a/lib/commercetools-history/src/Models/Common/PriceBuilder.php +++ b/lib/commercetools-history/src/Models/Common/PriceBuilder.php @@ -21,16 +21,19 @@ final class PriceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var null|Money|MoneyBuilder */ private $value; /** + * @return null|string */ public function getId() @@ -39,6 +42,7 @@ public function getId() } /** + * @return null|Money */ public function getValue() diff --git a/lib/commercetools-history/src/Models/Common/PriceModel.php b/lib/commercetools-history/src/Models/Common/PriceModel.php index 62504200b07..955a2dc3e35 100644 --- a/lib/commercetools-history/src/Models/Common/PriceModel.php +++ b/lib/commercetools-history/src/Models/Common/PriceModel.php @@ -22,11 +22,13 @@ final class PriceModel extends JsonObjectModel implements Price /** + * * @var ?string */ protected $id; /** + * * @var ?Money */ protected $value; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -62,6 +65,7 @@ public function getId() } /** + * * @return null|Money */ public function getValue() diff --git a/lib/commercetools-history/src/Models/Common/ProductSelectionSetting.php b/lib/commercetools-history/src/Models/Common/ProductSelectionSetting.php new file mode 100644 index 00000000000..865804064a5 --- /dev/null +++ b/lib/commercetools-history/src/Models/Common/ProductSelectionSetting.php @@ -0,0 +1,41 @@ + + */ +final class ProductSelectionSettingBuilder implements Builder +{ + /** + + * @var null|Reference|ReferenceBuilder + */ + private $productSelection; + + /** + + * @var ?bool + */ + private $active; + + /** + + * @return null|Reference + */ + public function getProductSelection() + { + return $this->productSelection instanceof ReferenceBuilder ? $this->productSelection->build() : $this->productSelection; + } + + /** + + * @return null|bool + */ + public function getActive() + { + return $this->active; + } + + /** + * @param ?Reference $productSelection + * @return $this + */ + public function withProductSelection(?Reference $productSelection) + { + $this->productSelection = $productSelection; + + return $this; + } + + /** + * @param ?bool $active + * @return $this + */ + public function withActive(?bool $active) + { + $this->active = $active; + + return $this; + } + + /** + * @deprecated use withProductSelection() instead + * @return $this + */ + public function withProductSelectionBuilder(?ReferenceBuilder $productSelection) + { + $this->productSelection = $productSelection; + + return $this; + } + + public function build(): ProductSelectionSetting + { + return new ProductSelectionSettingModel( + $this->productSelection instanceof ReferenceBuilder ? $this->productSelection->build() : $this->productSelection, + $this->active + ); + } + + public static function of(): ProductSelectionSettingBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Common/ProductSelectionSettingCollection.php b/lib/commercetools-history/src/Models/Common/ProductSelectionSettingCollection.php new file mode 100644 index 00000000000..62b0fb5bec2 --- /dev/null +++ b/lib/commercetools-history/src/Models/Common/ProductSelectionSettingCollection.php @@ -0,0 +1,56 @@ + + * @method ProductSelectionSetting current() + * @method ProductSelectionSetting end() + * @method ProductSelectionSetting at($offset) + */ +class ProductSelectionSettingCollection extends MapperSequence +{ + /** + * @psalm-assert ProductSelectionSetting $value + * @psalm-param ProductSelectionSetting|stdClass $value + * @throws InvalidArgumentException + * + * @return ProductSelectionSettingCollection + */ + public function add($value) + { + if (!$value instanceof ProductSelectionSetting) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ProductSelectionSetting + */ + protected function mapper() + { + return function (?int $index): ?ProductSelectionSetting { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ProductSelectionSetting $data */ + $data = ProductSelectionSettingModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Common/ProductSelectionSettingModel.php b/lib/commercetools-history/src/Models/Common/ProductSelectionSettingModel.php new file mode 100644 index 00000000000..5da2d448d56 --- /dev/null +++ b/lib/commercetools-history/src/Models/Common/ProductSelectionSettingModel.php @@ -0,0 +1,105 @@ +productSelection = $productSelection; + $this->active = $active; + + } + + /** + * + * @return null|Reference + */ + public function getProductSelection() + { + if (is_null($this->productSelection)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_PRODUCT_SELECTION); + if (is_null($data)) { + return null; + } + + $this->productSelection = ReferenceModel::of($data); + } + + return $this->productSelection; + } + + /** + * + * @return null|bool + */ + public function getActive() + { + if (is_null($this->active)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_ACTIVE); + if (is_null($data)) { + return null; + } + $this->active = (bool) $data; + } + + return $this->active; + } + + + /** + * @param ?Reference $productSelection + */ + public function setProductSelection(?Reference $productSelection): void + { + $this->productSelection = $productSelection; + } + + /** + * @param ?bool $active + */ + public function setActive(?bool $active): void + { + $this->active = $active; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Common/ProductVariantAvailability.php b/lib/commercetools-history/src/Models/Common/ProductVariantAvailability.php index 304af44fc2a..6edf4bac201 100644 --- a/lib/commercetools-history/src/Models/Common/ProductVariantAvailability.php +++ b/lib/commercetools-history/src/Models/Common/ProductVariantAvailability.php @@ -20,21 +20,25 @@ interface ProductVariantAvailability extends JsonObject public const FIELD_CHANNELS = 'channels'; /** + * @return null|bool */ public function getIsOnStock(); /** + * @return null|int */ public function getRestockableInDays(); /** + * @return null|int */ public function getAvailableQuantity(); /** + * @return null|ProductVariantChannelAvailabilityMap */ public function getChannels(); diff --git a/lib/commercetools-history/src/Models/Common/ProductVariantAvailabilityBuilder.php b/lib/commercetools-history/src/Models/Common/ProductVariantAvailabilityBuilder.php index 530113e8e4a..b47e5925d7b 100644 --- a/lib/commercetools-history/src/Models/Common/ProductVariantAvailabilityBuilder.php +++ b/lib/commercetools-history/src/Models/Common/ProductVariantAvailabilityBuilder.php @@ -21,26 +21,31 @@ final class ProductVariantAvailabilityBuilder implements Builder { /** + * @var ?bool */ private $isOnStock; /** + * @var ?int */ private $restockableInDays; /** + * @var ?int */ private $availableQuantity; /** + * @var null|ProductVariantChannelAvailabilityMap|ProductVariantChannelAvailabilityMapBuilder */ private $channels; /** + * @return null|bool */ public function getIsOnStock() @@ -49,6 +54,7 @@ public function getIsOnStock() } /** + * @return null|int */ public function getRestockableInDays() @@ -57,6 +63,7 @@ public function getRestockableInDays() } /** + * @return null|int */ public function getAvailableQuantity() @@ -65,6 +72,7 @@ public function getAvailableQuantity() } /** + * @return null|ProductVariantChannelAvailabilityMap */ public function getChannels() diff --git a/lib/commercetools-history/src/Models/Common/ProductVariantAvailabilityModel.php b/lib/commercetools-history/src/Models/Common/ProductVariantAvailabilityModel.php index 9e2bbb8479e..cb747d99514 100644 --- a/lib/commercetools-history/src/Models/Common/ProductVariantAvailabilityModel.php +++ b/lib/commercetools-history/src/Models/Common/ProductVariantAvailabilityModel.php @@ -22,21 +22,25 @@ final class ProductVariantAvailabilityModel extends JsonObjectModel implements P /** + * * @var ?bool */ protected $isOnStock; /** + * * @var ?int */ protected $restockableInDays; /** + * * @var ?int */ protected $availableQuantity; /** + * * @var ?ProductVariantChannelAvailabilityMap */ protected $channels; @@ -59,6 +63,7 @@ public function __construct( } /** + * * @return null|bool */ public function getIsOnStock() @@ -76,6 +81,7 @@ public function getIsOnStock() } /** + * * @return null|int */ public function getRestockableInDays() @@ -93,6 +99,7 @@ public function getRestockableInDays() } /** + * * @return null|int */ public function getAvailableQuantity() @@ -110,6 +117,7 @@ public function getAvailableQuantity() } /** + * * @return null|ProductVariantChannelAvailabilityMap */ public function getChannels() diff --git a/lib/commercetools-history/src/Models/Common/ProductVariantChannelAvailability.php b/lib/commercetools-history/src/Models/Common/ProductVariantChannelAvailability.php index 1b92a6858a2..6272d7f3f6c 100644 --- a/lib/commercetools-history/src/Models/Common/ProductVariantChannelAvailability.php +++ b/lib/commercetools-history/src/Models/Common/ProductVariantChannelAvailability.php @@ -19,16 +19,19 @@ interface ProductVariantChannelAvailability extends JsonObject public const FIELD_AVAILABLE_QUANTITY = 'availableQuantity'; /** + * @return null|bool */ public function getIsOnStock(); /** + * @return null|int */ public function getRestockableInDays(); /** + * @return null|int */ public function getAvailableQuantity(); diff --git a/lib/commercetools-history/src/Models/Common/ProductVariantChannelAvailabilityBuilder.php b/lib/commercetools-history/src/Models/Common/ProductVariantChannelAvailabilityBuilder.php index 59417f1b7dd..f62eb1a945a 100644 --- a/lib/commercetools-history/src/Models/Common/ProductVariantChannelAvailabilityBuilder.php +++ b/lib/commercetools-history/src/Models/Common/ProductVariantChannelAvailabilityBuilder.php @@ -21,21 +21,25 @@ final class ProductVariantChannelAvailabilityBuilder implements Builder { /** + * @var ?bool */ private $isOnStock; /** + * @var ?int */ private $restockableInDays; /** + * @var ?int */ private $availableQuantity; /** + * @return null|bool */ public function getIsOnStock() @@ -44,6 +48,7 @@ public function getIsOnStock() } /** + * @return null|int */ public function getRestockableInDays() @@ -52,6 +57,7 @@ public function getRestockableInDays() } /** + * @return null|int */ public function getAvailableQuantity() diff --git a/lib/commercetools-history/src/Models/Common/ProductVariantChannelAvailabilityModel.php b/lib/commercetools-history/src/Models/Common/ProductVariantChannelAvailabilityModel.php index bbb380aff50..9f82f8dc43c 100644 --- a/lib/commercetools-history/src/Models/Common/ProductVariantChannelAvailabilityModel.php +++ b/lib/commercetools-history/src/Models/Common/ProductVariantChannelAvailabilityModel.php @@ -22,16 +22,19 @@ final class ProductVariantChannelAvailabilityModel extends JsonObjectModel imple /** + * * @var ?bool */ protected $isOnStock; /** + * * @var ?int */ protected $restockableInDays; /** + * * @var ?int */ protected $availableQuantity; @@ -52,6 +55,7 @@ public function __construct( } /** + * * @return null|bool */ public function getIsOnStock() @@ -69,6 +73,7 @@ public function getIsOnStock() } /** + * * @return null|int */ public function getRestockableInDays() @@ -86,6 +91,7 @@ public function getRestockableInDays() } /** + * * @return null|int */ public function getAvailableQuantity() diff --git a/lib/commercetools-history/src/Models/Common/Reference.php b/lib/commercetools-history/src/Models/Common/Reference.php index 665bba0a281..38ed3ee6e27 100644 --- a/lib/commercetools-history/src/Models/Common/Reference.php +++ b/lib/commercetools-history/src/Models/Common/Reference.php @@ -18,11 +18,13 @@ interface Reference extends JsonObject public const FIELD_TYPE_ID = 'typeId'; /** + * @return null|string */ public function getId(); /** + * @return null|string */ public function getTypeId(); diff --git a/lib/commercetools-history/src/Models/Common/ReferenceBuilder.php b/lib/commercetools-history/src/Models/Common/ReferenceBuilder.php index f58e9240c18..8c5ef208760 100644 --- a/lib/commercetools-history/src/Models/Common/ReferenceBuilder.php +++ b/lib/commercetools-history/src/Models/Common/ReferenceBuilder.php @@ -21,16 +21,19 @@ final class ReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $typeId; /** + * @return null|string */ public function getId() @@ -39,6 +42,7 @@ public function getId() } /** + * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-history/src/Models/Common/ReferenceModel.php b/lib/commercetools-history/src/Models/Common/ReferenceModel.php index 6e836c56591..516e410c2fa 100644 --- a/lib/commercetools-history/src/Models/Common/ReferenceModel.php +++ b/lib/commercetools-history/src/Models/Common/ReferenceModel.php @@ -22,11 +22,13 @@ final class ReferenceModel extends JsonObjectModel implements Reference /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $typeId; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -62,6 +65,7 @@ public function getId() } /** + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-history/src/Models/Common/Reservation.php b/lib/commercetools-history/src/Models/Common/Reservation.php index ae49a620480..7351fa30725 100644 --- a/lib/commercetools-history/src/Models/Common/Reservation.php +++ b/lib/commercetools-history/src/Models/Common/Reservation.php @@ -20,21 +20,25 @@ interface Reservation extends JsonObject public const FIELD_CHECKOUT_STARTED_AT = 'checkoutStartedAt'; /** + * @return null|int */ public function getQuantity(); /** + * @return null|Reference */ public function getOwner(); /** + * @return null|string */ public function getCreatedAt(); /** + * @return null|string */ public function getCheckoutStartedAt(); diff --git a/lib/commercetools-history/src/Models/Common/ReservationBuilder.php b/lib/commercetools-history/src/Models/Common/ReservationBuilder.php index 7d3663fd04f..b7c3fb221f2 100644 --- a/lib/commercetools-history/src/Models/Common/ReservationBuilder.php +++ b/lib/commercetools-history/src/Models/Common/ReservationBuilder.php @@ -21,26 +21,31 @@ final class ReservationBuilder implements Builder { /** + * @var ?int */ private $quantity; /** + * @var null|Reference|ReferenceBuilder */ private $owner; /** + * @var ?string */ private $createdAt; /** + * @var ?string */ private $checkoutStartedAt; /** + * @return null|int */ public function getQuantity() @@ -49,6 +54,7 @@ public function getQuantity() } /** + * @return null|Reference */ public function getOwner() @@ -57,6 +63,7 @@ public function getOwner() } /** + * @return null|string */ public function getCreatedAt() @@ -65,6 +72,7 @@ public function getCreatedAt() } /** + * @return null|string */ public function getCheckoutStartedAt() diff --git a/lib/commercetools-history/src/Models/Common/ReservationModel.php b/lib/commercetools-history/src/Models/Common/ReservationModel.php index 45b8dbaa073..9e0f3080c81 100644 --- a/lib/commercetools-history/src/Models/Common/ReservationModel.php +++ b/lib/commercetools-history/src/Models/Common/ReservationModel.php @@ -22,21 +22,25 @@ final class ReservationModel extends JsonObjectModel implements Reservation /** + * * @var ?int */ protected $quantity; /** + * * @var ?Reference */ protected $owner; /** + * * @var ?string */ protected $createdAt; /** + * * @var ?string */ protected $checkoutStartedAt; @@ -59,6 +63,7 @@ public function __construct( } /** + * * @return null|int */ public function getQuantity() @@ -76,6 +81,7 @@ public function getQuantity() } /** + * * @return null|Reference */ public function getOwner() @@ -94,6 +100,7 @@ public function getOwner() } /** + * * @return null|string */ public function getCreatedAt() @@ -111,6 +118,7 @@ public function getCreatedAt() } /** + * * @return null|string */ public function getCheckoutStartedAt() diff --git a/lib/commercetools-history/src/Models/Common/ReturnInfo.php b/lib/commercetools-history/src/Models/Common/ReturnInfo.php index 3f4d0241f93..adbefb3207a 100644 --- a/lib/commercetools-history/src/Models/Common/ReturnInfo.php +++ b/lib/commercetools-history/src/Models/Common/ReturnInfo.php @@ -19,6 +19,7 @@ interface ReturnInfo extends JsonObject public const FIELD_RETURN_DATE = 'returnDate'; /** + * @return null|ReturnItemCollection */ public function getItems(); @@ -26,11 +27,13 @@ public function getItems(); /** *

    Identifies, which return tracking ID is connected to this particular return.

    * + * @return null|string */ public function getReturnTrackingId(); /** + * @return null|string */ public function getReturnDate(); diff --git a/lib/commercetools-history/src/Models/Common/ReturnInfoBuilder.php b/lib/commercetools-history/src/Models/Common/ReturnInfoBuilder.php index 3c63a72cc14..f5ce70ed382 100644 --- a/lib/commercetools-history/src/Models/Common/ReturnInfoBuilder.php +++ b/lib/commercetools-history/src/Models/Common/ReturnInfoBuilder.php @@ -21,21 +21,25 @@ final class ReturnInfoBuilder implements Builder { /** + * @var ?ReturnItemCollection */ private $items; /** + * @var ?string */ private $returnTrackingId; /** + * @var ?string */ private $returnDate; /** + * @return null|ReturnItemCollection */ public function getItems() @@ -46,6 +50,7 @@ public function getItems() /** *

    Identifies, which return tracking ID is connected to this particular return.

    * + * @return null|string */ public function getReturnTrackingId() @@ -54,6 +59,7 @@ public function getReturnTrackingId() } /** + * @return null|string */ public function getReturnDate() diff --git a/lib/commercetools-history/src/Models/Common/ReturnInfoModel.php b/lib/commercetools-history/src/Models/Common/ReturnInfoModel.php index 7b24cac78c3..d5e447a9ece 100644 --- a/lib/commercetools-history/src/Models/Common/ReturnInfoModel.php +++ b/lib/commercetools-history/src/Models/Common/ReturnInfoModel.php @@ -22,16 +22,19 @@ final class ReturnInfoModel extends JsonObjectModel implements ReturnInfo /** + * * @var ?ReturnItemCollection */ protected $items; /** + * * @var ?string */ protected $returnTrackingId; /** + * * @var ?string */ protected $returnDate; @@ -52,6 +55,7 @@ public function __construct( } /** + * * @return null|ReturnItemCollection */ public function getItems() @@ -71,6 +75,7 @@ public function getItems() /** *

    Identifies, which return tracking ID is connected to this particular return.

    * + * * @return null|string */ public function getReturnTrackingId() @@ -88,6 +93,7 @@ public function getReturnTrackingId() } /** + * * @return null|string */ public function getReturnDate() diff --git a/lib/commercetools-history/src/Models/Common/ReturnItem.php b/lib/commercetools-history/src/Models/Common/ReturnItem.php index 9f627945ab3..20f29907d41 100644 --- a/lib/commercetools-history/src/Models/Common/ReturnItem.php +++ b/lib/commercetools-history/src/Models/Common/ReturnItem.php @@ -24,41 +24,49 @@ interface ReturnItem extends JsonObject public const FIELD_CREATED_AT = 'createdAt'; /** + * @return null|string */ public function getId(); /** + * @return null|int */ public function getQuantity(); /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getComment(); /** + * @return null|string */ public function getShipmentState(); /** + * @return null|string */ public function getPaymentState(); /** + * @return null|string */ public function getLastModifiedAt(); /** + * @return null|string */ public function getCreatedAt(); diff --git a/lib/commercetools-history/src/Models/Common/ReturnItemBuilder.php b/lib/commercetools-history/src/Models/Common/ReturnItemBuilder.php index 9726e27f030..4ddf48d935a 100644 --- a/lib/commercetools-history/src/Models/Common/ReturnItemBuilder.php +++ b/lib/commercetools-history/src/Models/Common/ReturnItemBuilder.php @@ -21,46 +21,55 @@ final class ReturnItemBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?int */ private $quantity; /** + * @var ?string */ private $type; /** + * @var ?string */ private $comment; /** + * @var ?string */ private $shipmentState; /** + * @var ?string */ private $paymentState; /** + * @var ?string */ private $lastModifiedAt; /** + * @var ?string */ private $createdAt; /** + * @return null|string */ public function getId() @@ -69,6 +78,7 @@ public function getId() } /** + * @return null|int */ public function getQuantity() @@ -77,6 +87,7 @@ public function getQuantity() } /** + * @return null|string */ public function getType() @@ -85,6 +96,7 @@ public function getType() } /** + * @return null|string */ public function getComment() @@ -93,6 +105,7 @@ public function getComment() } /** + * @return null|string */ public function getShipmentState() @@ -101,6 +114,7 @@ public function getShipmentState() } /** + * @return null|string */ public function getPaymentState() @@ -109,6 +123,7 @@ public function getPaymentState() } /** + * @return null|string */ public function getLastModifiedAt() @@ -117,6 +132,7 @@ public function getLastModifiedAt() } /** + * @return null|string */ public function getCreatedAt() diff --git a/lib/commercetools-history/src/Models/Common/ReturnItemModel.php b/lib/commercetools-history/src/Models/Common/ReturnItemModel.php index 18583f43ce3..4871f86c111 100644 --- a/lib/commercetools-history/src/Models/Common/ReturnItemModel.php +++ b/lib/commercetools-history/src/Models/Common/ReturnItemModel.php @@ -22,41 +22,49 @@ final class ReturnItemModel extends JsonObjectModel implements ReturnItem /** + * * @var ?string */ protected $id; /** + * * @var ?int */ protected $quantity; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $comment; /** + * * @var ?string */ protected $shipmentState; /** + * * @var ?string */ protected $paymentState; /** + * * @var ?string */ protected $lastModifiedAt; /** + * * @var ?string */ protected $createdAt; @@ -87,6 +95,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -104,6 +113,7 @@ public function getId() } /** + * * @return null|int */ public function getQuantity() @@ -121,6 +131,7 @@ public function getQuantity() } /** + * * @return null|string */ public function getType() @@ -138,6 +149,7 @@ public function getType() } /** + * * @return null|string */ public function getComment() @@ -155,6 +167,7 @@ public function getComment() } /** + * * @return null|string */ public function getShipmentState() @@ -172,6 +185,7 @@ public function getShipmentState() } /** + * * @return null|string */ public function getPaymentState() @@ -189,6 +203,7 @@ public function getPaymentState() } /** + * * @return null|string */ public function getLastModifiedAt() @@ -206,6 +221,7 @@ public function getLastModifiedAt() } /** + * * @return null|string */ public function getCreatedAt() diff --git a/lib/commercetools-history/src/Models/Common/ReviewRatingStatistics.php b/lib/commercetools-history/src/Models/Common/ReviewRatingStatistics.php index e2e5a391241..37412dae131 100644 --- a/lib/commercetools-history/src/Models/Common/ReviewRatingStatistics.php +++ b/lib/commercetools-history/src/Models/Common/ReviewRatingStatistics.php @@ -23,6 +23,7 @@ interface ReviewRatingStatistics extends JsonObject /** *

    Average rating of one target This number is rounded with 5 decimals.

    * + * @return null|int */ public function getAverageRating(); @@ -30,6 +31,7 @@ public function getAverageRating(); /** *

    Highest rating of one target

    * + * @return null|int */ public function getHighestRating(); @@ -37,6 +39,7 @@ public function getHighestRating(); /** *

    Lowest rating of one target

    * + * @return null|int */ public function getLowestRating(); @@ -44,6 +47,7 @@ public function getLowestRating(); /** *

    Number of ratings taken into account

    * + * @return null|int */ public function getCount(); @@ -51,6 +55,7 @@ public function getCount(); /** *

    The full distribution of the ratings. The keys are the different ratings and the values are the count of reviews having this rating. Only the used ratings appear in this object.

    * + * @return null|mixed */ public function getRatingsDistribution(); diff --git a/lib/commercetools-history/src/Models/Common/ReviewRatingStatisticsBuilder.php b/lib/commercetools-history/src/Models/Common/ReviewRatingStatisticsBuilder.php index 777f918d8f9..4b31e26a6a4 100644 --- a/lib/commercetools-history/src/Models/Common/ReviewRatingStatisticsBuilder.php +++ b/lib/commercetools-history/src/Models/Common/ReviewRatingStatisticsBuilder.php @@ -21,26 +21,31 @@ final class ReviewRatingStatisticsBuilder implements Builder { /** + * @var ?int */ private $averageRating; /** + * @var ?int */ private $highestRating; /** + * @var ?int */ private $lowestRating; /** + * @var ?int */ private $count; /** + * @var ?JsonObject */ private $ratingsDistribution; @@ -48,6 +53,7 @@ final class ReviewRatingStatisticsBuilder implements Builder /** *

    Average rating of one target This number is rounded with 5 decimals.

    * + * @return null|int */ public function getAverageRating() @@ -58,6 +64,7 @@ public function getAverageRating() /** *

    Highest rating of one target

    * + * @return null|int */ public function getHighestRating() @@ -68,6 +75,7 @@ public function getHighestRating() /** *

    Lowest rating of one target

    * + * @return null|int */ public function getLowestRating() @@ -78,6 +86,7 @@ public function getLowestRating() /** *

    Number of ratings taken into account

    * + * @return null|int */ public function getCount() @@ -88,6 +97,7 @@ public function getCount() /** *

    The full distribution of the ratings. The keys are the different ratings and the values are the count of reviews having this rating. Only the used ratings appear in this object.

    * + * @return null|JsonObject */ public function getRatingsDistribution() diff --git a/lib/commercetools-history/src/Models/Common/ReviewRatingStatisticsModel.php b/lib/commercetools-history/src/Models/Common/ReviewRatingStatisticsModel.php index c84af5a3cd5..5501379ee13 100644 --- a/lib/commercetools-history/src/Models/Common/ReviewRatingStatisticsModel.php +++ b/lib/commercetools-history/src/Models/Common/ReviewRatingStatisticsModel.php @@ -22,26 +22,31 @@ final class ReviewRatingStatisticsModel extends JsonObjectModel implements Revie /** + * * @var ?int */ protected $averageRating; /** + * * @var ?int */ protected $highestRating; /** + * * @var ?int */ protected $lowestRating; /** + * * @var ?int */ protected $count; /** + * * @var ?mixed */ protected $ratingsDistribution; @@ -68,6 +73,7 @@ public function __construct( /** *

    Average rating of one target This number is rounded with 5 decimals.

    * + * * @return null|int */ public function getAverageRating() @@ -87,6 +93,7 @@ public function getAverageRating() /** *

    Highest rating of one target

    * + * * @return null|int */ public function getHighestRating() @@ -106,6 +113,7 @@ public function getHighestRating() /** *

    Lowest rating of one target

    * + * * @return null|int */ public function getLowestRating() @@ -125,6 +133,7 @@ public function getLowestRating() /** *

    Number of ratings taken into account

    * + * * @return null|int */ public function getCount() @@ -144,6 +153,7 @@ public function getCount() /** *

    The full distribution of the ratings. The keys are the different ratings and the values are the count of reviews having this rating. Only the used ratings appear in this object.

    * + * * @return null|mixed */ public function getRatingsDistribution() diff --git a/lib/commercetools-history/src/Models/Common/SearchKeyword.php b/lib/commercetools-history/src/Models/Common/SearchKeyword.php index 56c82e26cea..eaca48b4111 100644 --- a/lib/commercetools-history/src/Models/Common/SearchKeyword.php +++ b/lib/commercetools-history/src/Models/Common/SearchKeyword.php @@ -18,11 +18,13 @@ interface SearchKeyword extends JsonObject public const FIELD_SUGGEST_TOKENIZER = 'suggestTokenizer'; /** + * @return null|string */ public function getText(); /** + * @return null|SuggestTokenizer */ public function getSuggestTokenizer(); diff --git a/lib/commercetools-history/src/Models/Common/SearchKeywordBuilder.php b/lib/commercetools-history/src/Models/Common/SearchKeywordBuilder.php index fc04d2e4996..248cdd32bb1 100644 --- a/lib/commercetools-history/src/Models/Common/SearchKeywordBuilder.php +++ b/lib/commercetools-history/src/Models/Common/SearchKeywordBuilder.php @@ -21,16 +21,19 @@ final class SearchKeywordBuilder implements Builder { /** + * @var ?string */ private $text; /** + * @var null|SuggestTokenizer|SuggestTokenizerBuilder */ private $suggestTokenizer; /** + * @return null|string */ public function getText() @@ -39,6 +42,7 @@ public function getText() } /** + * @return null|SuggestTokenizer */ public function getSuggestTokenizer() diff --git a/lib/commercetools-history/src/Models/Common/SearchKeywordModel.php b/lib/commercetools-history/src/Models/Common/SearchKeywordModel.php index 1197ad0225d..a1aa3d125d7 100644 --- a/lib/commercetools-history/src/Models/Common/SearchKeywordModel.php +++ b/lib/commercetools-history/src/Models/Common/SearchKeywordModel.php @@ -22,11 +22,13 @@ final class SearchKeywordModel extends JsonObjectModel implements SearchKeyword /** + * * @var ?string */ protected $text; /** + * * @var ?SuggestTokenizer */ protected $suggestTokenizer; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|string */ public function getText() @@ -62,6 +65,7 @@ public function getText() } /** + * * @return null|SuggestTokenizer */ public function getSuggestTokenizer() diff --git a/lib/commercetools-history/src/Models/Common/ShippingRate.php b/lib/commercetools-history/src/Models/Common/ShippingRate.php index 47bf5653070..fcacb694f7b 100644 --- a/lib/commercetools-history/src/Models/Common/ShippingRate.php +++ b/lib/commercetools-history/src/Models/Common/ShippingRate.php @@ -20,11 +20,13 @@ interface ShippingRate extends JsonObject public const FIELD_TIERS = 'tiers'; /** + * @return null|Money */ public function getPrice(); /** + * @return null|Money */ public function getFreeAbove(); @@ -32,11 +34,13 @@ public function getFreeAbove(); /** *

    Only appears in response to requests for ShippingMethods by Cart or location to mark this shipping rate as one that matches the Cart or location.

    * + * @return null|bool */ public function getIsMatching(); /** + * @return null|ShippingRatePriceTierCollection */ public function getTiers(); diff --git a/lib/commercetools-history/src/Models/Common/ShippingRateBuilder.php b/lib/commercetools-history/src/Models/Common/ShippingRateBuilder.php index 0dd87138f2f..23767bd15a9 100644 --- a/lib/commercetools-history/src/Models/Common/ShippingRateBuilder.php +++ b/lib/commercetools-history/src/Models/Common/ShippingRateBuilder.php @@ -21,26 +21,31 @@ final class ShippingRateBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $price; /** + * @var null|Money|MoneyBuilder */ private $freeAbove; /** + * @var ?bool */ private $isMatching; /** + * @var ?ShippingRatePriceTierCollection */ private $tiers; /** + * @return null|Money */ public function getPrice() @@ -49,6 +54,7 @@ public function getPrice() } /** + * @return null|Money */ public function getFreeAbove() @@ -59,6 +65,7 @@ public function getFreeAbove() /** *

    Only appears in response to requests for ShippingMethods by Cart or location to mark this shipping rate as one that matches the Cart or location.

    * + * @return null|bool */ public function getIsMatching() @@ -67,6 +74,7 @@ public function getIsMatching() } /** + * @return null|ShippingRatePriceTierCollection */ public function getTiers() diff --git a/lib/commercetools-history/src/Models/Common/ShippingRateModel.php b/lib/commercetools-history/src/Models/Common/ShippingRateModel.php index b1d314d0796..0be035c435d 100644 --- a/lib/commercetools-history/src/Models/Common/ShippingRateModel.php +++ b/lib/commercetools-history/src/Models/Common/ShippingRateModel.php @@ -22,21 +22,25 @@ final class ShippingRateModel extends JsonObjectModel implements ShippingRate /** + * * @var ?Money */ protected $price; /** + * * @var ?Money */ protected $freeAbove; /** + * * @var ?bool */ protected $isMatching; /** + * * @var ?ShippingRatePriceTierCollection */ protected $tiers; @@ -59,6 +63,7 @@ public function __construct( } /** + * * @return null|Money */ public function getPrice() @@ -77,6 +82,7 @@ public function getPrice() } /** + * * @return null|Money */ public function getFreeAbove() @@ -97,6 +103,7 @@ public function getFreeAbove() /** *

    Only appears in response to requests for ShippingMethods by Cart or location to mark this shipping rate as one that matches the Cart or location.

    * + * * @return null|bool */ public function getIsMatching() @@ -114,6 +121,7 @@ public function getIsMatching() } /** + * * @return null|ShippingRatePriceTierCollection */ public function getTiers() diff --git a/lib/commercetools-history/src/Models/Common/ShippingRatePriceTier.php b/lib/commercetools-history/src/Models/Common/ShippingRatePriceTier.php index 2dab9335d0a..244f6172bed 100644 --- a/lib/commercetools-history/src/Models/Common/ShippingRatePriceTier.php +++ b/lib/commercetools-history/src/Models/Common/ShippingRatePriceTier.php @@ -17,6 +17,7 @@ interface ShippingRatePriceTier extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-history/src/Models/Common/ShippingRatePriceTierBuilder.php b/lib/commercetools-history/src/Models/Common/ShippingRatePriceTierBuilder.php index 27661c16635..fdbd3dcd5c2 100644 --- a/lib/commercetools-history/src/Models/Common/ShippingRatePriceTierBuilder.php +++ b/lib/commercetools-history/src/Models/Common/ShippingRatePriceTierBuilder.php @@ -21,11 +21,13 @@ final class ShippingRatePriceTierBuilder implements Builder { /** + * @var ?string */ private $type; /** + * @return null|string */ public function getType() diff --git a/lib/commercetools-history/src/Models/Common/ShippingRatePriceTierModel.php b/lib/commercetools-history/src/Models/Common/ShippingRatePriceTierModel.php index c36a48bd4f8..2d878e6c6b4 100644 --- a/lib/commercetools-history/src/Models/Common/ShippingRatePriceTierModel.php +++ b/lib/commercetools-history/src/Models/Common/ShippingRatePriceTierModel.php @@ -22,6 +22,7 @@ final class ShippingRatePriceTierModel extends JsonObjectModel implements Shippi /** + * * @var ?string */ protected $type; @@ -38,6 +39,7 @@ public function __construct( } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-history/src/Models/Common/SubRate.php b/lib/commercetools-history/src/Models/Common/SubRate.php index 3b906d4a3ef..f03ca2e8f49 100644 --- a/lib/commercetools-history/src/Models/Common/SubRate.php +++ b/lib/commercetools-history/src/Models/Common/SubRate.php @@ -18,11 +18,13 @@ interface SubRate extends JsonObject public const FIELD_AMOUNT = 'amount'; /** + * @return null|string */ public function getName(); /** + * @return null|int */ public function getAmount(); diff --git a/lib/commercetools-history/src/Models/Common/SubRateBuilder.php b/lib/commercetools-history/src/Models/Common/SubRateBuilder.php index 917b5f7d445..6ad1728820e 100644 --- a/lib/commercetools-history/src/Models/Common/SubRateBuilder.php +++ b/lib/commercetools-history/src/Models/Common/SubRateBuilder.php @@ -21,16 +21,19 @@ final class SubRateBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?int */ private $amount; /** + * @return null|string */ public function getName() @@ -39,6 +42,7 @@ public function getName() } /** + * @return null|int */ public function getAmount() diff --git a/lib/commercetools-history/src/Models/Common/SubRateModel.php b/lib/commercetools-history/src/Models/Common/SubRateModel.php index a18fa4d402c..9f66d95619a 100644 --- a/lib/commercetools-history/src/Models/Common/SubRateModel.php +++ b/lib/commercetools-history/src/Models/Common/SubRateModel.php @@ -22,11 +22,13 @@ final class SubRateModel extends JsonObjectModel implements SubRate /** + * * @var ?string */ protected $name; /** + * * @var ?int */ protected $amount; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|string */ public function getName() @@ -62,6 +65,7 @@ public function getName() } /** + * * @return null|int */ public function getAmount() diff --git a/lib/commercetools-history/src/Models/Common/SuggestTokenizer.php b/lib/commercetools-history/src/Models/Common/SuggestTokenizer.php index 00531e7b771..f0f698e1bb1 100644 --- a/lib/commercetools-history/src/Models/Common/SuggestTokenizer.php +++ b/lib/commercetools-history/src/Models/Common/SuggestTokenizer.php @@ -17,6 +17,7 @@ interface SuggestTokenizer extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-history/src/Models/Common/SuggestTokenizerBuilder.php b/lib/commercetools-history/src/Models/Common/SuggestTokenizerBuilder.php index 18be290718f..7896d25575b 100644 --- a/lib/commercetools-history/src/Models/Common/SuggestTokenizerBuilder.php +++ b/lib/commercetools-history/src/Models/Common/SuggestTokenizerBuilder.php @@ -21,11 +21,13 @@ final class SuggestTokenizerBuilder implements Builder { /** + * @var ?string */ private $type; /** + * @return null|string */ public function getType() diff --git a/lib/commercetools-history/src/Models/Common/SuggestTokenizerModel.php b/lib/commercetools-history/src/Models/Common/SuggestTokenizerModel.php index 2210c3ccd9e..3025d971d13 100644 --- a/lib/commercetools-history/src/Models/Common/SuggestTokenizerModel.php +++ b/lib/commercetools-history/src/Models/Common/SuggestTokenizerModel.php @@ -22,6 +22,7 @@ final class SuggestTokenizerModel extends JsonObjectModel implements SuggestToke /** + * * @var ?string */ protected $type; @@ -38,6 +39,7 @@ public function __construct( } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-history/src/Models/Common/SyncInfo.php b/lib/commercetools-history/src/Models/Common/SyncInfo.php index 5e4e87edb58..bf058688e70 100644 --- a/lib/commercetools-history/src/Models/Common/SyncInfo.php +++ b/lib/commercetools-history/src/Models/Common/SyncInfo.php @@ -19,6 +19,7 @@ interface SyncInfo extends JsonObject public const FIELD_SYNCED_AT = 'syncedAt'; /** + * @return null|Reference */ public function getChannel(); @@ -26,11 +27,13 @@ public function getChannel(); /** *

    Can be used to reference an external order instance, file etc.

    * + * @return null|string */ public function getExternalId(); /** + * @return null|string */ public function getSyncedAt(); diff --git a/lib/commercetools-history/src/Models/Common/SyncInfoBuilder.php b/lib/commercetools-history/src/Models/Common/SyncInfoBuilder.php index e7d97500132..bdd7b3de0b1 100644 --- a/lib/commercetools-history/src/Models/Common/SyncInfoBuilder.php +++ b/lib/commercetools-history/src/Models/Common/SyncInfoBuilder.php @@ -21,21 +21,25 @@ final class SyncInfoBuilder implements Builder { /** + * @var null|Reference|ReferenceBuilder */ private $channel; /** + * @var ?string */ private $externalId; /** + * @var ?string */ private $syncedAt; /** + * @return null|Reference */ public function getChannel() @@ -46,6 +50,7 @@ public function getChannel() /** *

    Can be used to reference an external order instance, file etc.

    * + * @return null|string */ public function getExternalId() @@ -54,6 +59,7 @@ public function getExternalId() } /** + * @return null|string */ public function getSyncedAt() diff --git a/lib/commercetools-history/src/Models/Common/SyncInfoModel.php b/lib/commercetools-history/src/Models/Common/SyncInfoModel.php index 28ed7a66778..c9bc55bad53 100644 --- a/lib/commercetools-history/src/Models/Common/SyncInfoModel.php +++ b/lib/commercetools-history/src/Models/Common/SyncInfoModel.php @@ -22,16 +22,19 @@ final class SyncInfoModel extends JsonObjectModel implements SyncInfo /** + * * @var ?Reference */ protected $channel; /** + * * @var ?string */ protected $externalId; /** + * * @var ?string */ protected $syncedAt; @@ -52,6 +55,7 @@ public function __construct( } /** + * * @return null|Reference */ public function getChannel() @@ -72,6 +76,7 @@ public function getChannel() /** *

    Can be used to reference an external order instance, file etc.

    * + * * @return null|string */ public function getExternalId() @@ -89,6 +94,7 @@ public function getExternalId() } /** + * * @return null|string */ public function getSyncedAt() diff --git a/lib/commercetools-history/src/Models/Common/TaxRate.php b/lib/commercetools-history/src/Models/Common/TaxRate.php index f024773108b..559e68041f1 100644 --- a/lib/commercetools-history/src/Models/Common/TaxRate.php +++ b/lib/commercetools-history/src/Models/Common/TaxRate.php @@ -25,11 +25,13 @@ interface TaxRate extends JsonObject /** *

    The ID is always set if the tax rate is part of a TaxCategory. The external tax rates in a Cart do not contain an id.

    * + * @return null|string */ public function getId(); /** + * @return null|string */ public function getName(); @@ -37,11 +39,13 @@ public function getName(); /** *

    Percentage in the range of [0..1]. The sum of the amounts of all subRates, if there are any.

    * + * @return null|int */ public function getAmount(); /** + * @return null|bool */ public function getIncludedInPrice(); @@ -49,6 +53,7 @@ public function getIncludedInPrice(); /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry(); @@ -56,11 +61,13 @@ public function getCountry(); /** *

    The state in the country

    * + * @return null|string */ public function getState(); /** + * @return null|SubRateCollection */ public function getSubRates(); diff --git a/lib/commercetools-history/src/Models/Common/TaxRateBuilder.php b/lib/commercetools-history/src/Models/Common/TaxRateBuilder.php index e8efbdc721b..78d9d1021c6 100644 --- a/lib/commercetools-history/src/Models/Common/TaxRateBuilder.php +++ b/lib/commercetools-history/src/Models/Common/TaxRateBuilder.php @@ -21,36 +21,43 @@ final class TaxRateBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $name; /** + * @var ?int */ private $amount; /** + * @var ?bool */ private $includedInPrice; /** + * @var ?string */ private $country; /** + * @var ?string */ private $state; /** + * @var ?SubRateCollection */ private $subRates; @@ -58,6 +65,7 @@ final class TaxRateBuilder implements Builder /** *

    The ID is always set if the tax rate is part of a TaxCategory. The external tax rates in a Cart do not contain an id.

    * + * @return null|string */ public function getId() @@ -66,6 +74,7 @@ public function getId() } /** + * @return null|string */ public function getName() @@ -76,6 +85,7 @@ public function getName() /** *

    Percentage in the range of [0..1]. The sum of the amounts of all subRates, if there are any.

    * + * @return null|int */ public function getAmount() @@ -84,6 +94,7 @@ public function getAmount() } /** + * @return null|bool */ public function getIncludedInPrice() @@ -94,6 +105,7 @@ public function getIncludedInPrice() /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry() @@ -104,6 +116,7 @@ public function getCountry() /** *

    The state in the country

    * + * @return null|string */ public function getState() @@ -112,6 +125,7 @@ public function getState() } /** + * @return null|SubRateCollection */ public function getSubRates() diff --git a/lib/commercetools-history/src/Models/Common/TaxRateModel.php b/lib/commercetools-history/src/Models/Common/TaxRateModel.php index 1ae91d009f0..4a058e02259 100644 --- a/lib/commercetools-history/src/Models/Common/TaxRateModel.php +++ b/lib/commercetools-history/src/Models/Common/TaxRateModel.php @@ -22,36 +22,43 @@ final class TaxRateModel extends JsonObjectModel implements TaxRate /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $name; /** + * * @var ?int */ protected $amount; /** + * * @var ?bool */ protected $includedInPrice; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $state; /** + * * @var ?SubRateCollection */ protected $subRates; @@ -82,6 +89,7 @@ public function __construct( /** *

    The ID is always set if the tax rate is part of a TaxCategory. The external tax rates in a Cart do not contain an id.

    * + * * @return null|string */ public function getId() @@ -99,6 +107,7 @@ public function getId() } /** + * * @return null|string */ public function getName() @@ -118,6 +127,7 @@ public function getName() /** *

    Percentage in the range of [0..1]. The sum of the amounts of all subRates, if there are any.

    * + * * @return null|int */ public function getAmount() @@ -135,6 +145,7 @@ public function getAmount() } /** + * * @return null|bool */ public function getIncludedInPrice() @@ -154,6 +165,7 @@ public function getIncludedInPrice() /** *

    Two-digit country code as per ISO 3166-1 alpha-2.

    * + * * @return null|string */ public function getCountry() @@ -173,6 +185,7 @@ public function getCountry() /** *

    The state in the country

    * + * * @return null|string */ public function getState() @@ -190,6 +203,7 @@ public function getState() } /** + * * @return null|SubRateCollection */ public function getSubRates() diff --git a/lib/commercetools-history/src/Models/Common/TaxedItemPrice.php b/lib/commercetools-history/src/Models/Common/TaxedItemPrice.php index d52b3be6124..6d871e057ae 100644 --- a/lib/commercetools-history/src/Models/Common/TaxedItemPrice.php +++ b/lib/commercetools-history/src/Models/Common/TaxedItemPrice.php @@ -18,11 +18,13 @@ interface TaxedItemPrice extends JsonObject public const FIELD_TOTAL_GROSS = 'totalGross'; /** + * @return null|Money */ public function getTotalNet(); /** + * @return null|Money */ public function getTotalGross(); diff --git a/lib/commercetools-history/src/Models/Common/TaxedItemPriceBuilder.php b/lib/commercetools-history/src/Models/Common/TaxedItemPriceBuilder.php index cbe95fe6600..efa37ae519a 100644 --- a/lib/commercetools-history/src/Models/Common/TaxedItemPriceBuilder.php +++ b/lib/commercetools-history/src/Models/Common/TaxedItemPriceBuilder.php @@ -21,16 +21,19 @@ final class TaxedItemPriceBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $totalNet; /** + * @var null|Money|MoneyBuilder */ private $totalGross; /** + * @return null|Money */ public function getTotalNet() @@ -39,6 +42,7 @@ public function getTotalNet() } /** + * @return null|Money */ public function getTotalGross() diff --git a/lib/commercetools-history/src/Models/Common/TaxedItemPriceModel.php b/lib/commercetools-history/src/Models/Common/TaxedItemPriceModel.php index acaeb8f5354..8b811b189c7 100644 --- a/lib/commercetools-history/src/Models/Common/TaxedItemPriceModel.php +++ b/lib/commercetools-history/src/Models/Common/TaxedItemPriceModel.php @@ -22,11 +22,13 @@ final class TaxedItemPriceModel extends JsonObjectModel implements TaxedItemPric /** + * * @var ?Money */ protected $totalNet; /** + * * @var ?Money */ protected $totalGross; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|Money */ public function getTotalNet() @@ -63,6 +66,7 @@ public function getTotalNet() } /** + * * @return null|Money */ public function getTotalGross() diff --git a/lib/commercetools-history/src/Models/Common/TaxedPrice.php b/lib/commercetools-history/src/Models/Common/TaxedPrice.php index dfcd497a121..9eef0b7ff3b 100644 --- a/lib/commercetools-history/src/Models/Common/TaxedPrice.php +++ b/lib/commercetools-history/src/Models/Common/TaxedPrice.php @@ -18,11 +18,13 @@ interface TaxedPrice extends JsonObject public const FIELD_TOTAL_GROSS = 'totalGross'; /** + * @return null|Money */ public function getTotalNet(); /** + * @return null|Money */ public function getTotalGross(); diff --git a/lib/commercetools-history/src/Models/Common/TaxedPriceBuilder.php b/lib/commercetools-history/src/Models/Common/TaxedPriceBuilder.php index f72e3e926d8..3846b9f1763 100644 --- a/lib/commercetools-history/src/Models/Common/TaxedPriceBuilder.php +++ b/lib/commercetools-history/src/Models/Common/TaxedPriceBuilder.php @@ -21,16 +21,19 @@ final class TaxedPriceBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $totalNet; /** + * @var null|Money|MoneyBuilder */ private $totalGross; /** + * @return null|Money */ public function getTotalNet() @@ -39,6 +42,7 @@ public function getTotalNet() } /** + * @return null|Money */ public function getTotalGross() diff --git a/lib/commercetools-history/src/Models/Common/TaxedPriceModel.php b/lib/commercetools-history/src/Models/Common/TaxedPriceModel.php index 3300d63ca44..b9e2e790021 100644 --- a/lib/commercetools-history/src/Models/Common/TaxedPriceModel.php +++ b/lib/commercetools-history/src/Models/Common/TaxedPriceModel.php @@ -22,11 +22,13 @@ final class TaxedPriceModel extends JsonObjectModel implements TaxedPrice /** + * * @var ?Money */ protected $totalNet; /** + * * @var ?Money */ protected $totalGross; @@ -45,6 +47,7 @@ public function __construct( } /** + * * @return null|Money */ public function getTotalNet() @@ -63,6 +66,7 @@ public function getTotalNet() } /** + * * @return null|Money */ public function getTotalGross() diff --git a/lib/commercetools-history/src/Models/Common/TextLineItem.php b/lib/commercetools-history/src/Models/Common/TextLineItem.php index 468486e423b..42ffa4970af 100644 --- a/lib/commercetools-history/src/Models/Common/TextLineItem.php +++ b/lib/commercetools-history/src/Models/Common/TextLineItem.php @@ -22,31 +22,37 @@ interface TextLineItem extends JsonObject public const FIELD_QUANTITY = 'quantity'; /** + * @return null|string */ public function getAddedAt(); /** + * @return null|CustomFields */ public function getCustom(); /** + * @return null|LocalizedString */ public function getDescription(); /** + * @return null|string */ public function getId(); /** + * @return null|LocalizedString */ public function getName(); /** + * @return null|int */ public function getQuantity(); diff --git a/lib/commercetools-history/src/Models/Common/TextLineItemBuilder.php b/lib/commercetools-history/src/Models/Common/TextLineItemBuilder.php index ca08d7fd60b..b779bf6224e 100644 --- a/lib/commercetools-history/src/Models/Common/TextLineItemBuilder.php +++ b/lib/commercetools-history/src/Models/Common/TextLineItemBuilder.php @@ -21,36 +21,43 @@ final class TextLineItemBuilder implements Builder { /** + * @var ?string */ private $addedAt; /** + * @var null|CustomFields|CustomFieldsBuilder */ private $custom; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?string */ private $id; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var ?int */ private $quantity; /** + * @return null|string */ public function getAddedAt() @@ -59,6 +66,7 @@ public function getAddedAt() } /** + * @return null|CustomFields */ public function getCustom() @@ -67,6 +75,7 @@ public function getCustom() } /** + * @return null|LocalizedString */ public function getDescription() @@ -75,6 +84,7 @@ public function getDescription() } /** + * @return null|string */ public function getId() @@ -83,6 +93,7 @@ public function getId() } /** + * @return null|LocalizedString */ public function getName() @@ -91,6 +102,7 @@ public function getName() } /** + * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-history/src/Models/Common/TextLineItemModel.php b/lib/commercetools-history/src/Models/Common/TextLineItemModel.php index f45df911fce..75a4a0970c1 100644 --- a/lib/commercetools-history/src/Models/Common/TextLineItemModel.php +++ b/lib/commercetools-history/src/Models/Common/TextLineItemModel.php @@ -22,31 +22,37 @@ final class TextLineItemModel extends JsonObjectModel implements TextLineItem /** + * * @var ?string */ protected $addedAt; /** + * * @var ?CustomFields */ protected $custom; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?string */ protected $id; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?int */ protected $quantity; @@ -73,6 +79,7 @@ public function __construct( } /** + * * @return null|string */ public function getAddedAt() @@ -90,6 +97,7 @@ public function getAddedAt() } /** + * * @return null|CustomFields */ public function getCustom() @@ -108,6 +116,7 @@ public function getCustom() } /** + * * @return null|LocalizedString */ public function getDescription() @@ -126,6 +135,7 @@ public function getDescription() } /** + * * @return null|string */ public function getId() @@ -143,6 +153,7 @@ public function getId() } /** + * * @return null|LocalizedString */ public function getName() @@ -161,6 +172,7 @@ public function getName() } /** + * * @return null|int */ public function getQuantity() diff --git a/lib/commercetools-history/src/Models/Common/TrackingData.php b/lib/commercetools-history/src/Models/Common/TrackingData.php index bd36c1424cc..f27a22fa38a 100644 --- a/lib/commercetools-history/src/Models/Common/TrackingData.php +++ b/lib/commercetools-history/src/Models/Common/TrackingData.php @@ -23,6 +23,7 @@ interface TrackingData extends JsonObject /** *

    The ID to track one parcel.

    * + * @return null|string */ public function getTrackingId(); @@ -30,16 +31,19 @@ public function getTrackingId(); /** *

    The carrier that delivers the parcel.

    * + * @return null|string */ public function getCarrier(); /** + * @return null|string */ public function getProvider(); /** + * @return null|string */ public function getProviderTransaction(); @@ -47,6 +51,7 @@ public function getProviderTransaction(); /** *

    Flag to distinguish if the parcel is on the way to the customer (false) or on the way back (true).

    * + * @return null|bool */ public function getIsReturn(); diff --git a/lib/commercetools-history/src/Models/Common/TrackingDataBuilder.php b/lib/commercetools-history/src/Models/Common/TrackingDataBuilder.php index 137a1b9892b..c9d0adc5806 100644 --- a/lib/commercetools-history/src/Models/Common/TrackingDataBuilder.php +++ b/lib/commercetools-history/src/Models/Common/TrackingDataBuilder.php @@ -21,26 +21,31 @@ final class TrackingDataBuilder implements Builder { /** + * @var ?string */ private $trackingId; /** + * @var ?string */ private $carrier; /** + * @var ?string */ private $provider; /** + * @var ?string */ private $providerTransaction; /** + * @var ?bool */ private $isReturn; @@ -48,6 +53,7 @@ final class TrackingDataBuilder implements Builder /** *

    The ID to track one parcel.

    * + * @return null|string */ public function getTrackingId() @@ -58,6 +64,7 @@ public function getTrackingId() /** *

    The carrier that delivers the parcel.

    * + * @return null|string */ public function getCarrier() @@ -66,6 +73,7 @@ public function getCarrier() } /** + * @return null|string */ public function getProvider() @@ -74,6 +82,7 @@ public function getProvider() } /** + * @return null|string */ public function getProviderTransaction() @@ -84,6 +93,7 @@ public function getProviderTransaction() /** *

    Flag to distinguish if the parcel is on the way to the customer (false) or on the way back (true).

    * + * @return null|bool */ public function getIsReturn() diff --git a/lib/commercetools-history/src/Models/Common/TrackingDataModel.php b/lib/commercetools-history/src/Models/Common/TrackingDataModel.php index d22fa4bbce4..107e391a8a7 100644 --- a/lib/commercetools-history/src/Models/Common/TrackingDataModel.php +++ b/lib/commercetools-history/src/Models/Common/TrackingDataModel.php @@ -22,26 +22,31 @@ final class TrackingDataModel extends JsonObjectModel implements TrackingData /** + * * @var ?string */ protected $trackingId; /** + * * @var ?string */ protected $carrier; /** + * * @var ?string */ protected $provider; /** + * * @var ?string */ protected $providerTransaction; /** + * * @var ?bool */ protected $isReturn; @@ -68,6 +73,7 @@ public function __construct( /** *

    The ID to track one parcel.

    * + * * @return null|string */ public function getTrackingId() @@ -87,6 +93,7 @@ public function getTrackingId() /** *

    The carrier that delivers the parcel.

    * + * * @return null|string */ public function getCarrier() @@ -104,6 +111,7 @@ public function getCarrier() } /** + * * @return null|string */ public function getProvider() @@ -121,6 +129,7 @@ public function getProvider() } /** + * * @return null|string */ public function getProviderTransaction() @@ -140,6 +149,7 @@ public function getProviderTransaction() /** *

    Flag to distinguish if the parcel is on the way to the customer (false) or on the way back (true).

    * + * * @return null|bool */ public function getIsReturn() diff --git a/lib/commercetools-history/src/Models/Common/Transaction.php b/lib/commercetools-history/src/Models/Common/Transaction.php index 31861d78a7d..3c543871b14 100644 --- a/lib/commercetools-history/src/Models/Common/Transaction.php +++ b/lib/commercetools-history/src/Models/Common/Transaction.php @@ -24,6 +24,7 @@ interface Transaction extends JsonObject /** *

    The unique ID of this object.

    * + * @return null|string */ public function getId(); @@ -31,16 +32,19 @@ public function getId(); /** *

    The time at which the transaction took place.

    * + * @return null|string */ public function getTimestamp(); /** + * @return null|string */ public function getType(); /** + * @return null|Money */ public function getAmount(); @@ -48,11 +52,13 @@ public function getAmount(); /** *

    The identifier that is used by the interface that managed the transaction (usually the PSP). If a matching interaction was logged in the interfaceInteractions array, the corresponding interaction should be findable with this ID.

    * + * @return null|string */ public function getInteractionId(); /** + * @return null|string */ public function getState(); diff --git a/lib/commercetools-history/src/Models/Common/TransactionBuilder.php b/lib/commercetools-history/src/Models/Common/TransactionBuilder.php index 0dbc4e4ba62..d8220e76028 100644 --- a/lib/commercetools-history/src/Models/Common/TransactionBuilder.php +++ b/lib/commercetools-history/src/Models/Common/TransactionBuilder.php @@ -21,31 +21,37 @@ final class TransactionBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $timestamp; /** + * @var ?string */ private $type; /** + * @var null|Money|MoneyBuilder */ private $amount; /** + * @var ?string */ private $interactionId; /** + * @var ?string */ private $state; @@ -53,6 +59,7 @@ final class TransactionBuilder implements Builder /** *

    The unique ID of this object.

    * + * @return null|string */ public function getId() @@ -63,6 +70,7 @@ public function getId() /** *

    The time at which the transaction took place.

    * + * @return null|string */ public function getTimestamp() @@ -71,6 +79,7 @@ public function getTimestamp() } /** + * @return null|string */ public function getType() @@ -79,6 +88,7 @@ public function getType() } /** + * @return null|Money */ public function getAmount() @@ -89,6 +99,7 @@ public function getAmount() /** *

    The identifier that is used by the interface that managed the transaction (usually the PSP). If a matching interaction was logged in the interfaceInteractions array, the corresponding interaction should be findable with this ID.

    * + * @return null|string */ public function getInteractionId() @@ -97,6 +108,7 @@ public function getInteractionId() } /** + * @return null|string */ public function getState() diff --git a/lib/commercetools-history/src/Models/Common/TransactionModel.php b/lib/commercetools-history/src/Models/Common/TransactionModel.php index 3c1a190a5b0..3a37eb57e4b 100644 --- a/lib/commercetools-history/src/Models/Common/TransactionModel.php +++ b/lib/commercetools-history/src/Models/Common/TransactionModel.php @@ -22,31 +22,37 @@ final class TransactionModel extends JsonObjectModel implements Transaction /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $timestamp; /** + * * @var ?string */ protected $type; /** + * * @var ?Money */ protected $amount; /** + * * @var ?string */ protected $interactionId; /** + * * @var ?string */ protected $state; @@ -75,6 +81,7 @@ public function __construct( /** *

    The unique ID of this object.

    * + * * @return null|string */ public function getId() @@ -94,6 +101,7 @@ public function getId() /** *

    The time at which the transaction took place.

    * + * * @return null|string */ public function getTimestamp() @@ -111,6 +119,7 @@ public function getTimestamp() } /** + * * @return null|string */ public function getType() @@ -128,6 +137,7 @@ public function getType() } /** + * * @return null|Money */ public function getAmount() @@ -148,6 +158,7 @@ public function getAmount() /** *

    The identifier that is used by the interface that managed the transaction (usually the PSP). If a matching interaction was logged in the interfaceInteractions array, the corresponding interaction should be findable with this ID.

    * + * * @return null|string */ public function getInteractionId() @@ -165,6 +176,7 @@ public function getInteractionId() } /** + * * @return null|string */ public function getState() diff --git a/lib/commercetools-history/src/Models/Common/Variant.php b/lib/commercetools-history/src/Models/Common/Variant.php index 7358fb0571b..b5030b3169a 100644 --- a/lib/commercetools-history/src/Models/Common/Variant.php +++ b/lib/commercetools-history/src/Models/Common/Variant.php @@ -19,16 +19,19 @@ interface Variant extends JsonObject public const FIELD_KEY = 'key'; /** + * @return null|int */ public function getId(); /** + * @return null|string */ public function getSku(); /** + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-history/src/Models/Common/VariantBuilder.php b/lib/commercetools-history/src/Models/Common/VariantBuilder.php index 60f61fbc52f..9df79270970 100644 --- a/lib/commercetools-history/src/Models/Common/VariantBuilder.php +++ b/lib/commercetools-history/src/Models/Common/VariantBuilder.php @@ -21,21 +21,25 @@ final class VariantBuilder implements Builder { /** + * @var ?int */ private $id; /** + * @var ?string */ private $sku; /** + * @var ?string */ private $key; /** + * @return null|int */ public function getId() @@ -44,6 +48,7 @@ public function getId() } /** + * @return null|string */ public function getSku() @@ -52,6 +57,7 @@ public function getSku() } /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-history/src/Models/Common/VariantModel.php b/lib/commercetools-history/src/Models/Common/VariantModel.php index 768e6a4a23e..73805b8b97b 100644 --- a/lib/commercetools-history/src/Models/Common/VariantModel.php +++ b/lib/commercetools-history/src/Models/Common/VariantModel.php @@ -22,16 +22,19 @@ final class VariantModel extends JsonObjectModel implements Variant /** + * * @var ?int */ protected $id; /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $key; @@ -52,6 +55,7 @@ public function __construct( } /** + * * @return null|int */ public function getId() @@ -69,6 +73,7 @@ public function getId() } /** + * * @return null|string */ public function getSku() @@ -86,6 +91,7 @@ public function getSku() } /** + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-history/src/Models/Label/CustomObjectLabel.php b/lib/commercetools-history/src/Models/Label/CustomObjectLabel.php index 3eae152af81..d364fb22ff4 100644 --- a/lib/commercetools-history/src/Models/Label/CustomObjectLabel.php +++ b/lib/commercetools-history/src/Models/Label/CustomObjectLabel.php @@ -18,16 +18,19 @@ interface CustomObjectLabel extends Label public const FIELD_CONTAINER = 'container'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getKey(); /** + * @return null|string */ public function getContainer(); diff --git a/lib/commercetools-history/src/Models/Label/CustomObjectLabelBuilder.php b/lib/commercetools-history/src/Models/Label/CustomObjectLabelBuilder.php index f338e05fd75..011c7cddf52 100644 --- a/lib/commercetools-history/src/Models/Label/CustomObjectLabelBuilder.php +++ b/lib/commercetools-history/src/Models/Label/CustomObjectLabelBuilder.php @@ -21,16 +21,19 @@ final class CustomObjectLabelBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $container; /** + * @return null|string */ public function getKey() @@ -39,6 +42,7 @@ public function getKey() } /** + * @return null|string */ public function getContainer() diff --git a/lib/commercetools-history/src/Models/Label/CustomObjectLabelModel.php b/lib/commercetools-history/src/Models/Label/CustomObjectLabelModel.php index b7f43e3de57..d2f0c651d43 100644 --- a/lib/commercetools-history/src/Models/Label/CustomObjectLabelModel.php +++ b/lib/commercetools-history/src/Models/Label/CustomObjectLabelModel.php @@ -22,16 +22,19 @@ final class CustomObjectLabelModel extends JsonObjectModel implements CustomObje public const DISCRIMINATOR_VALUE = 'CustomObjectLabel'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $container; @@ -42,14 +45,16 @@ final class CustomObjectLabelModel extends JsonObjectModel implements CustomObje */ public function __construct( ?string $key = null, - ?string $container = null + ?string $container = null, + ?string $type = null ) { $this->key = $key; $this->container = $container; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -67,6 +72,7 @@ public function getType() } /** + * * @return null|string */ public function getKey() @@ -84,6 +90,7 @@ public function getKey() } /** + * * @return null|string */ public function getContainer() diff --git a/lib/commercetools-history/src/Models/Label/CustomerLabel.php b/lib/commercetools-history/src/Models/Label/CustomerLabel.php index 5c0c70b9f90..c59e8032516 100644 --- a/lib/commercetools-history/src/Models/Label/CustomerLabel.php +++ b/lib/commercetools-history/src/Models/Label/CustomerLabel.php @@ -19,21 +19,25 @@ interface CustomerLabel extends Label public const FIELD_CUSTOMER_NUMBER = 'customerNumber'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getFirstName(); /** + * @return null|string */ public function getLastName(); /** + * @return null|string */ public function getCustomerNumber(); diff --git a/lib/commercetools-history/src/Models/Label/CustomerLabelBuilder.php b/lib/commercetools-history/src/Models/Label/CustomerLabelBuilder.php index 876ca351f54..444eba7492d 100644 --- a/lib/commercetools-history/src/Models/Label/CustomerLabelBuilder.php +++ b/lib/commercetools-history/src/Models/Label/CustomerLabelBuilder.php @@ -21,21 +21,25 @@ final class CustomerLabelBuilder implements Builder { /** + * @var ?string */ private $firstName; /** + * @var ?string */ private $lastName; /** + * @var ?string */ private $customerNumber; /** + * @return null|string */ public function getFirstName() @@ -44,6 +48,7 @@ public function getFirstName() } /** + * @return null|string */ public function getLastName() @@ -52,6 +57,7 @@ public function getLastName() } /** + * @return null|string */ public function getCustomerNumber() diff --git a/lib/commercetools-history/src/Models/Label/CustomerLabelModel.php b/lib/commercetools-history/src/Models/Label/CustomerLabelModel.php index e9192b2f23c..d146e81f76c 100644 --- a/lib/commercetools-history/src/Models/Label/CustomerLabelModel.php +++ b/lib/commercetools-history/src/Models/Label/CustomerLabelModel.php @@ -22,21 +22,25 @@ final class CustomerLabelModel extends JsonObjectModel implements CustomerLabel public const DISCRIMINATOR_VALUE = 'CustomerLabel'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $firstName; /** + * * @var ?string */ protected $lastName; /** + * * @var ?string */ protected $customerNumber; @@ -48,15 +52,17 @@ final class CustomerLabelModel extends JsonObjectModel implements CustomerLabel public function __construct( ?string $firstName = null, ?string $lastName = null, - ?string $customerNumber = null + ?string $customerNumber = null, + ?string $type = null ) { $this->firstName = $firstName; $this->lastName = $lastName; $this->customerNumber = $customerNumber; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -74,6 +80,7 @@ public function getType() } /** + * * @return null|string */ public function getFirstName() @@ -91,6 +98,7 @@ public function getFirstName() } /** + * * @return null|string */ public function getLastName() @@ -108,6 +116,7 @@ public function getLastName() } /** + * * @return null|string */ public function getCustomerNumber() diff --git a/lib/commercetools-history/src/Models/Label/Label.php b/lib/commercetools-history/src/Models/Label/Label.php index 2a8983d2da2..e8202d6d796 100644 --- a/lib/commercetools-history/src/Models/Label/Label.php +++ b/lib/commercetools-history/src/Models/Label/Label.php @@ -17,6 +17,7 @@ interface Label extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-history/src/Models/Label/LabelModel.php b/lib/commercetools-history/src/Models/Label/LabelModel.php index ceceb105913..80488fcaea7 100644 --- a/lib/commercetools-history/src/Models/Label/LabelModel.php +++ b/lib/commercetools-history/src/Models/Label/LabelModel.php @@ -22,6 +22,7 @@ final class LabelModel extends JsonObjectModel implements Label public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -37,7 +38,10 @@ final class LabelModel extends JsonObjectModel implements Label 'OrderLabel' => OrderLabelModel::class, 'PaymentLabel' => PaymentLabelModel::class, 'ProductLabel' => ProductLabelModel::class, + 'QuoteLabel' => QuoteLabelModel::class, + 'QuoteRequestLabel' => QuoteRequestLabelModel::class, 'ReviewLabel' => ReviewLabelModel::class, + 'StagedQuoteLabel' => StagedQuoteLabelModel::class, 'StringLabel' => StringLabelModel::class, ]; @@ -45,11 +49,14 @@ final class LabelModel extends JsonObjectModel implements Label * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; + } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-history/src/Models/Label/LocalizedLabel.php b/lib/commercetools-history/src/Models/Label/LocalizedLabel.php index b1d72e79a05..6db6165c71c 100644 --- a/lib/commercetools-history/src/Models/Label/LocalizedLabel.php +++ b/lib/commercetools-history/src/Models/Label/LocalizedLabel.php @@ -18,11 +18,13 @@ interface LocalizedLabel extends Label public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getType(); /** + * @return null|LocalizedString */ public function getValue(); diff --git a/lib/commercetools-history/src/Models/Label/LocalizedLabelBuilder.php b/lib/commercetools-history/src/Models/Label/LocalizedLabelBuilder.php index d08ae834c29..16ba2f4ce81 100644 --- a/lib/commercetools-history/src/Models/Label/LocalizedLabelBuilder.php +++ b/lib/commercetools-history/src/Models/Label/LocalizedLabelBuilder.php @@ -23,11 +23,13 @@ final class LocalizedLabelBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $value; /** + * @return null|LocalizedString */ public function getValue() diff --git a/lib/commercetools-history/src/Models/Label/LocalizedLabelModel.php b/lib/commercetools-history/src/Models/Label/LocalizedLabelModel.php index ad22c71e0e3..78a03caf519 100644 --- a/lib/commercetools-history/src/Models/Label/LocalizedLabelModel.php +++ b/lib/commercetools-history/src/Models/Label/LocalizedLabelModel.php @@ -24,11 +24,13 @@ final class LocalizedLabelModel extends JsonObjectModel implements LocalizedLabe public const DISCRIMINATOR_VALUE = 'LocalizedLabel'; /** + * * @var ?string */ protected $type; /** + * * @var ?LocalizedString */ protected $value; @@ -38,13 +40,15 @@ final class LocalizedLabelModel extends JsonObjectModel implements LocalizedLabe * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $value = null + ?LocalizedString $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -62,6 +66,7 @@ public function getType() } /** + * * @return null|LocalizedString */ public function getValue() diff --git a/lib/commercetools-history/src/Models/Label/OrderLabel.php b/lib/commercetools-history/src/Models/Label/OrderLabel.php index 4795724aa5e..4e552566aac 100644 --- a/lib/commercetools-history/src/Models/Label/OrderLabel.php +++ b/lib/commercetools-history/src/Models/Label/OrderLabel.php @@ -18,16 +18,19 @@ interface OrderLabel extends Label public const FIELD_ORDER_NUMBER = 'orderNumber'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getCustomerEmail(); /** + * @return null|string */ public function getOrderNumber(); diff --git a/lib/commercetools-history/src/Models/Label/OrderLabelBuilder.php b/lib/commercetools-history/src/Models/Label/OrderLabelBuilder.php index 27f878cb673..c22512b91c1 100644 --- a/lib/commercetools-history/src/Models/Label/OrderLabelBuilder.php +++ b/lib/commercetools-history/src/Models/Label/OrderLabelBuilder.php @@ -21,16 +21,19 @@ final class OrderLabelBuilder implements Builder { /** + * @var ?string */ private $customerEmail; /** + * @var ?string */ private $orderNumber; /** + * @return null|string */ public function getCustomerEmail() @@ -39,6 +42,7 @@ public function getCustomerEmail() } /** + * @return null|string */ public function getOrderNumber() diff --git a/lib/commercetools-history/src/Models/Label/OrderLabelModel.php b/lib/commercetools-history/src/Models/Label/OrderLabelModel.php index 3e73e612b9b..735da3e5c2a 100644 --- a/lib/commercetools-history/src/Models/Label/OrderLabelModel.php +++ b/lib/commercetools-history/src/Models/Label/OrderLabelModel.php @@ -22,16 +22,19 @@ final class OrderLabelModel extends JsonObjectModel implements OrderLabel public const DISCRIMINATOR_VALUE = 'OrderLabel'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $customerEmail; /** + * * @var ?string */ protected $orderNumber; @@ -42,14 +45,16 @@ final class OrderLabelModel extends JsonObjectModel implements OrderLabel */ public function __construct( ?string $customerEmail = null, - ?string $orderNumber = null + ?string $orderNumber = null, + ?string $type = null ) { $this->customerEmail = $customerEmail; $this->orderNumber = $orderNumber; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -67,6 +72,7 @@ public function getType() } /** + * * @return null|string */ public function getCustomerEmail() @@ -84,6 +90,7 @@ public function getCustomerEmail() } /** + * * @return null|string */ public function getOrderNumber() diff --git a/lib/commercetools-history/src/Models/Label/PaymentLabel.php b/lib/commercetools-history/src/Models/Label/PaymentLabel.php index 66cb2f2c49b..e1163dd920f 100644 --- a/lib/commercetools-history/src/Models/Label/PaymentLabel.php +++ b/lib/commercetools-history/src/Models/Label/PaymentLabel.php @@ -19,16 +19,19 @@ interface PaymentLabel extends Label public const FIELD_AMOUNT_PLANNED = 'amountPlanned'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getKey(); /** + * @return null|Money */ public function getAmountPlanned(); diff --git a/lib/commercetools-history/src/Models/Label/PaymentLabelBuilder.php b/lib/commercetools-history/src/Models/Label/PaymentLabelBuilder.php index 1179f065a91..57a4c19b2b8 100644 --- a/lib/commercetools-history/src/Models/Label/PaymentLabelBuilder.php +++ b/lib/commercetools-history/src/Models/Label/PaymentLabelBuilder.php @@ -23,16 +23,19 @@ final class PaymentLabelBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var null|Money|MoneyBuilder */ private $amountPlanned; /** + * @return null|string */ public function getKey() @@ -41,6 +44,7 @@ public function getKey() } /** + * @return null|Money */ public function getAmountPlanned() diff --git a/lib/commercetools-history/src/Models/Label/PaymentLabelModel.php b/lib/commercetools-history/src/Models/Label/PaymentLabelModel.php index 4b2c4cb33b6..a97dcc01662 100644 --- a/lib/commercetools-history/src/Models/Label/PaymentLabelModel.php +++ b/lib/commercetools-history/src/Models/Label/PaymentLabelModel.php @@ -24,16 +24,19 @@ final class PaymentLabelModel extends JsonObjectModel implements PaymentLabel public const DISCRIMINATOR_VALUE = 'PaymentLabel'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $key; /** + * * @var ?Money */ protected $amountPlanned; @@ -44,14 +47,16 @@ final class PaymentLabelModel extends JsonObjectModel implements PaymentLabel */ public function __construct( ?string $key = null, - ?Money $amountPlanned = null + ?Money $amountPlanned = null, + ?string $type = null ) { $this->key = $key; $this->amountPlanned = $amountPlanned; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -69,6 +74,7 @@ public function getType() } /** + * * @return null|string */ public function getKey() @@ -86,6 +92,7 @@ public function getKey() } /** + * * @return null|Money */ public function getAmountPlanned() diff --git a/lib/commercetools-history/src/Models/Label/ProductLabel.php b/lib/commercetools-history/src/Models/Label/ProductLabel.php index 62e74afa48b..edb58a175ea 100644 --- a/lib/commercetools-history/src/Models/Label/ProductLabel.php +++ b/lib/commercetools-history/src/Models/Label/ProductLabel.php @@ -19,16 +19,19 @@ interface ProductLabel extends Label public const FIELD_NAME = 'name'; /** + * @return null|string */ public function getType(); /** + * @return null|LocalizedString */ public function getSlug(); /** + * @return null|LocalizedString */ public function getName(); diff --git a/lib/commercetools-history/src/Models/Label/ProductLabelBuilder.php b/lib/commercetools-history/src/Models/Label/ProductLabelBuilder.php index 9b610412cec..2ac40a5cab7 100644 --- a/lib/commercetools-history/src/Models/Label/ProductLabelBuilder.php +++ b/lib/commercetools-history/src/Models/Label/ProductLabelBuilder.php @@ -23,16 +23,19 @@ final class ProductLabelBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @return null|LocalizedString */ public function getSlug() @@ -41,6 +44,7 @@ public function getSlug() } /** + * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-history/src/Models/Label/ProductLabelModel.php b/lib/commercetools-history/src/Models/Label/ProductLabelModel.php index c11008bdc28..f2296691450 100644 --- a/lib/commercetools-history/src/Models/Label/ProductLabelModel.php +++ b/lib/commercetools-history/src/Models/Label/ProductLabelModel.php @@ -24,16 +24,19 @@ final class ProductLabelModel extends JsonObjectModel implements ProductLabel public const DISCRIMINATOR_VALUE = 'ProductLabel'; /** + * * @var ?string */ protected $type; /** + * * @var ?LocalizedString */ protected $slug; /** + * * @var ?LocalizedString */ protected $name; @@ -44,14 +47,16 @@ final class ProductLabelModel extends JsonObjectModel implements ProductLabel */ public function __construct( ?LocalizedString $slug = null, - ?LocalizedString $name = null + ?LocalizedString $name = null, + ?string $type = null ) { $this->slug = $slug; $this->name = $name; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -69,6 +74,7 @@ public function getType() } /** + * * @return null|LocalizedString */ public function getSlug() @@ -87,6 +93,7 @@ public function getSlug() } /** + * * @return null|LocalizedString */ public function getName() diff --git a/lib/commercetools-history/src/Models/Label/QuoteLabel.php b/lib/commercetools-history/src/Models/Label/QuoteLabel.php new file mode 100644 index 00000000000..f391d35f0a1 --- /dev/null +++ b/lib/commercetools-history/src/Models/Label/QuoteLabel.php @@ -0,0 +1,72 @@ + + */ +final class QuoteLabelBuilder implements Builder +{ + /** + + * @var ?string + */ + private $key; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $customer; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $stagedQuote; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $quoteRequest; + + /** + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + + * @return null|Reference + */ + public function getCustomer() + { + return $this->customer instanceof ReferenceBuilder ? $this->customer->build() : $this->customer; + } + + /** + + * @return null|Reference + */ + public function getStagedQuote() + { + return $this->stagedQuote instanceof ReferenceBuilder ? $this->stagedQuote->build() : $this->stagedQuote; + } + + /** + + * @return null|Reference + */ + public function getQuoteRequest() + { + return $this->quoteRequest instanceof ReferenceBuilder ? $this->quoteRequest->build() : $this->quoteRequest; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?Reference $customer + * @return $this + */ + public function withCustomer(?Reference $customer) + { + $this->customer = $customer; + + return $this; + } + + /** + * @param ?Reference $stagedQuote + * @return $this + */ + public function withStagedQuote(?Reference $stagedQuote) + { + $this->stagedQuote = $stagedQuote; + + return $this; + } + + /** + * @param ?Reference $quoteRequest + * @return $this + */ + public function withQuoteRequest(?Reference $quoteRequest) + { + $this->quoteRequest = $quoteRequest; + + return $this; + } + + /** + * @deprecated use withCustomer() instead + * @return $this + */ + public function withCustomerBuilder(?ReferenceBuilder $customer) + { + $this->customer = $customer; + + return $this; + } + + /** + * @deprecated use withStagedQuote() instead + * @return $this + */ + public function withStagedQuoteBuilder(?ReferenceBuilder $stagedQuote) + { + $this->stagedQuote = $stagedQuote; + + return $this; + } + + /** + * @deprecated use withQuoteRequest() instead + * @return $this + */ + public function withQuoteRequestBuilder(?ReferenceBuilder $quoteRequest) + { + $this->quoteRequest = $quoteRequest; + + return $this; + } + + public function build(): QuoteLabel + { + return new QuoteLabelModel( + $this->key, + $this->customer instanceof ReferenceBuilder ? $this->customer->build() : $this->customer, + $this->stagedQuote instanceof ReferenceBuilder ? $this->stagedQuote->build() : $this->stagedQuote, + $this->quoteRequest instanceof ReferenceBuilder ? $this->quoteRequest->build() : $this->quoteRequest + ); + } + + public static function of(): QuoteLabelBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Label/QuoteLabelCollection.php b/lib/commercetools-history/src/Models/Label/QuoteLabelCollection.php new file mode 100644 index 00000000000..87ab4fd8cf4 --- /dev/null +++ b/lib/commercetools-history/src/Models/Label/QuoteLabelCollection.php @@ -0,0 +1,56 @@ + + * @method QuoteLabel current() + * @method QuoteLabel end() + * @method QuoteLabel at($offset) + */ +class QuoteLabelCollection extends LabelCollection +{ + /** + * @psalm-assert QuoteLabel $value + * @psalm-param QuoteLabel|stdClass $value + * @throws InvalidArgumentException + * + * @return QuoteLabelCollection + */ + public function add($value) + { + if (!$value instanceof QuoteLabel) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?QuoteLabel + */ + protected function mapper() + { + return function (?int $index): ?QuoteLabel { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var QuoteLabel $data */ + $data = QuoteLabelModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Label/QuoteLabelModel.php b/lib/commercetools-history/src/Models/Label/QuoteLabelModel.php new file mode 100644 index 00000000000..80f69b1c256 --- /dev/null +++ b/lib/commercetools-history/src/Models/Label/QuoteLabelModel.php @@ -0,0 +1,202 @@ +key = $key; + $this->customer = $customer; + $this->stagedQuote = $stagedQuote; + $this->quoteRequest = $quoteRequest; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + * + * @return null|Reference + */ + public function getCustomer() + { + if (is_null($this->customer)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER); + if (is_null($data)) { + return null; + } + + $this->customer = ReferenceModel::of($data); + } + + return $this->customer; + } + + /** + * + * @return null|Reference + */ + public function getStagedQuote() + { + if (is_null($this->stagedQuote)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STAGED_QUOTE); + if (is_null($data)) { + return null; + } + + $this->stagedQuote = ReferenceModel::of($data); + } + + return $this->stagedQuote; + } + + /** + * + * @return null|Reference + */ + public function getQuoteRequest() + { + if (is_null($this->quoteRequest)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_QUOTE_REQUEST); + if (is_null($data)) { + return null; + } + + $this->quoteRequest = ReferenceModel::of($data); + } + + return $this->quoteRequest; + } + + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + + /** + * @param ?Reference $customer + */ + public function setCustomer(?Reference $customer): void + { + $this->customer = $customer; + } + + /** + * @param ?Reference $stagedQuote + */ + public function setStagedQuote(?Reference $stagedQuote): void + { + $this->stagedQuote = $stagedQuote; + } + + /** + * @param ?Reference $quoteRequest + */ + public function setQuoteRequest(?Reference $quoteRequest): void + { + $this->quoteRequest = $quoteRequest; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Label/QuoteRequestLabel.php b/lib/commercetools-history/src/Models/Label/QuoteRequestLabel.php new file mode 100644 index 00000000000..523fee9c6fb --- /dev/null +++ b/lib/commercetools-history/src/Models/Label/QuoteRequestLabel.php @@ -0,0 +1,48 @@ + + */ +final class QuoteRequestLabelBuilder implements Builder +{ + /** + + * @var ?string + */ + private $key; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $customer; + + /** + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + + * @return null|Reference + */ + public function getCustomer() + { + return $this->customer instanceof ReferenceBuilder ? $this->customer->build() : $this->customer; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?Reference $customer + * @return $this + */ + public function withCustomer(?Reference $customer) + { + $this->customer = $customer; + + return $this; + } + + /** + * @deprecated use withCustomer() instead + * @return $this + */ + public function withCustomerBuilder(?ReferenceBuilder $customer) + { + $this->customer = $customer; + + return $this; + } + + public function build(): QuoteRequestLabel + { + return new QuoteRequestLabelModel( + $this->key, + $this->customer instanceof ReferenceBuilder ? $this->customer->build() : $this->customer + ); + } + + public static function of(): QuoteRequestLabelBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Label/QuoteRequestLabelCollection.php b/lib/commercetools-history/src/Models/Label/QuoteRequestLabelCollection.php new file mode 100644 index 00000000000..0d49b977fea --- /dev/null +++ b/lib/commercetools-history/src/Models/Label/QuoteRequestLabelCollection.php @@ -0,0 +1,56 @@ + + * @method QuoteRequestLabel current() + * @method QuoteRequestLabel end() + * @method QuoteRequestLabel at($offset) + */ +class QuoteRequestLabelCollection extends LabelCollection +{ + /** + * @psalm-assert QuoteRequestLabel $value + * @psalm-param QuoteRequestLabel|stdClass $value + * @throws InvalidArgumentException + * + * @return QuoteRequestLabelCollection + */ + public function add($value) + { + if (!$value instanceof QuoteRequestLabel) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?QuoteRequestLabel + */ + protected function mapper() + { + return function (?int $index): ?QuoteRequestLabel { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var QuoteRequestLabel $data */ + $data = QuoteRequestLabelModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Label/QuoteRequestLabelModel.php b/lib/commercetools-history/src/Models/Label/QuoteRequestLabelModel.php new file mode 100644 index 00000000000..61716fdd8aa --- /dev/null +++ b/lib/commercetools-history/src/Models/Label/QuoteRequestLabelModel.php @@ -0,0 +1,132 @@ +key = $key; + $this->customer = $customer; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + * + * @return null|Reference + */ + public function getCustomer() + { + if (is_null($this->customer)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER); + if (is_null($data)) { + return null; + } + + $this->customer = ReferenceModel::of($data); + } + + return $this->customer; + } + + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + + /** + * @param ?Reference $customer + */ + public function setCustomer(?Reference $customer): void + { + $this->customer = $customer; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Label/ReviewLabel.php b/lib/commercetools-history/src/Models/Label/ReviewLabel.php index 1ad339ca4e3..d3098289792 100644 --- a/lib/commercetools-history/src/Models/Label/ReviewLabel.php +++ b/lib/commercetools-history/src/Models/Label/ReviewLabel.php @@ -18,16 +18,19 @@ interface ReviewLabel extends Label public const FIELD_TITLE = 'title'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getKey(); /** + * @return null|string */ public function getTitle(); diff --git a/lib/commercetools-history/src/Models/Label/ReviewLabelBuilder.php b/lib/commercetools-history/src/Models/Label/ReviewLabelBuilder.php index 88261f4f758..b3e9cad9d0a 100644 --- a/lib/commercetools-history/src/Models/Label/ReviewLabelBuilder.php +++ b/lib/commercetools-history/src/Models/Label/ReviewLabelBuilder.php @@ -21,16 +21,19 @@ final class ReviewLabelBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $title; /** + * @return null|string */ public function getKey() @@ -39,6 +42,7 @@ public function getKey() } /** + * @return null|string */ public function getTitle() diff --git a/lib/commercetools-history/src/Models/Label/ReviewLabelModel.php b/lib/commercetools-history/src/Models/Label/ReviewLabelModel.php index 4d385351a14..369bce135db 100644 --- a/lib/commercetools-history/src/Models/Label/ReviewLabelModel.php +++ b/lib/commercetools-history/src/Models/Label/ReviewLabelModel.php @@ -22,16 +22,19 @@ final class ReviewLabelModel extends JsonObjectModel implements ReviewLabel public const DISCRIMINATOR_VALUE = 'ReviewLabel'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $title; @@ -42,14 +45,16 @@ final class ReviewLabelModel extends JsonObjectModel implements ReviewLabel */ public function __construct( ?string $key = null, - ?string $title = null + ?string $title = null, + ?string $type = null ) { $this->key = $key; $this->title = $title; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -67,6 +72,7 @@ public function getType() } /** + * * @return null|string */ public function getKey() @@ -84,6 +90,7 @@ public function getKey() } /** + * * @return null|string */ public function getTitle() diff --git a/lib/commercetools-history/src/Models/Label/StagedQuoteLabel.php b/lib/commercetools-history/src/Models/Label/StagedQuoteLabel.php new file mode 100644 index 00000000000..a1652944563 --- /dev/null +++ b/lib/commercetools-history/src/Models/Label/StagedQuoteLabel.php @@ -0,0 +1,60 @@ + + */ +final class StagedQuoteLabelBuilder implements Builder +{ + /** + + * @var ?string + */ + private $key; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $customer; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $quoteRequest; + + /** + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + + * @return null|Reference + */ + public function getCustomer() + { + return $this->customer instanceof ReferenceBuilder ? $this->customer->build() : $this->customer; + } + + /** + + * @return null|Reference + */ + public function getQuoteRequest() + { + return $this->quoteRequest instanceof ReferenceBuilder ? $this->quoteRequest->build() : $this->quoteRequest; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?Reference $customer + * @return $this + */ + public function withCustomer(?Reference $customer) + { + $this->customer = $customer; + + return $this; + } + + /** + * @param ?Reference $quoteRequest + * @return $this + */ + public function withQuoteRequest(?Reference $quoteRequest) + { + $this->quoteRequest = $quoteRequest; + + return $this; + } + + /** + * @deprecated use withCustomer() instead + * @return $this + */ + public function withCustomerBuilder(?ReferenceBuilder $customer) + { + $this->customer = $customer; + + return $this; + } + + /** + * @deprecated use withQuoteRequest() instead + * @return $this + */ + public function withQuoteRequestBuilder(?ReferenceBuilder $quoteRequest) + { + $this->quoteRequest = $quoteRequest; + + return $this; + } + + public function build(): StagedQuoteLabel + { + return new StagedQuoteLabelModel( + $this->key, + $this->customer instanceof ReferenceBuilder ? $this->customer->build() : $this->customer, + $this->quoteRequest instanceof ReferenceBuilder ? $this->quoteRequest->build() : $this->quoteRequest + ); + } + + public static function of(): StagedQuoteLabelBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Label/StagedQuoteLabelCollection.php b/lib/commercetools-history/src/Models/Label/StagedQuoteLabelCollection.php new file mode 100644 index 00000000000..75fb3232702 --- /dev/null +++ b/lib/commercetools-history/src/Models/Label/StagedQuoteLabelCollection.php @@ -0,0 +1,56 @@ + + * @method StagedQuoteLabel current() + * @method StagedQuoteLabel end() + * @method StagedQuoteLabel at($offset) + */ +class StagedQuoteLabelCollection extends LabelCollection +{ + /** + * @psalm-assert StagedQuoteLabel $value + * @psalm-param StagedQuoteLabel|stdClass $value + * @throws InvalidArgumentException + * + * @return StagedQuoteLabelCollection + */ + public function add($value) + { + if (!$value instanceof StagedQuoteLabel) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StagedQuoteLabel + */ + protected function mapper() + { + return function (?int $index): ?StagedQuoteLabel { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StagedQuoteLabel $data */ + $data = StagedQuoteLabelModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Label/StagedQuoteLabelModel.php b/lib/commercetools-history/src/Models/Label/StagedQuoteLabelModel.php new file mode 100644 index 00000000000..42c664736e0 --- /dev/null +++ b/lib/commercetools-history/src/Models/Label/StagedQuoteLabelModel.php @@ -0,0 +1,167 @@ +key = $key; + $this->customer = $customer; + $this->quoteRequest = $quoteRequest; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + * + * @return null|Reference + */ + public function getCustomer() + { + if (is_null($this->customer)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER); + if (is_null($data)) { + return null; + } + + $this->customer = ReferenceModel::of($data); + } + + return $this->customer; + } + + /** + * + * @return null|Reference + */ + public function getQuoteRequest() + { + if (is_null($this->quoteRequest)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_QUOTE_REQUEST); + if (is_null($data)) { + return null; + } + + $this->quoteRequest = ReferenceModel::of($data); + } + + return $this->quoteRequest; + } + + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + + /** + * @param ?Reference $customer + */ + public function setCustomer(?Reference $customer): void + { + $this->customer = $customer; + } + + /** + * @param ?Reference $quoteRequest + */ + public function setQuoteRequest(?Reference $quoteRequest): void + { + $this->quoteRequest = $quoteRequest; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Label/StringLabel.php b/lib/commercetools-history/src/Models/Label/StringLabel.php index 61f6639d829..f8a2ae58f53 100644 --- a/lib/commercetools-history/src/Models/Label/StringLabel.php +++ b/lib/commercetools-history/src/Models/Label/StringLabel.php @@ -17,11 +17,13 @@ interface StringLabel extends Label public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getType(); /** + * @return null|string */ public function getValue(); diff --git a/lib/commercetools-history/src/Models/Label/StringLabelBuilder.php b/lib/commercetools-history/src/Models/Label/StringLabelBuilder.php index 41a2bfcb040..5e959f6bb3a 100644 --- a/lib/commercetools-history/src/Models/Label/StringLabelBuilder.php +++ b/lib/commercetools-history/src/Models/Label/StringLabelBuilder.php @@ -21,11 +21,13 @@ final class StringLabelBuilder implements Builder { /** + * @var ?string */ private $value; /** + * @return null|string */ public function getValue() diff --git a/lib/commercetools-history/src/Models/Label/StringLabelModel.php b/lib/commercetools-history/src/Models/Label/StringLabelModel.php index a498b25794a..0b5b81148f9 100644 --- a/lib/commercetools-history/src/Models/Label/StringLabelModel.php +++ b/lib/commercetools-history/src/Models/Label/StringLabelModel.php @@ -22,11 +22,13 @@ final class StringLabelModel extends JsonObjectModel implements StringLabel public const DISCRIMINATOR_VALUE = 'StringLabel'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $value; @@ -36,13 +38,15 @@ final class StringLabelModel extends JsonObjectModel implements StringLabel * @psalm-suppress MissingParamType */ public function __construct( - ?string $value = null + ?string $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -60,6 +64,7 @@ public function getType() } /** + * * @return null|string */ public function getValue() diff --git a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyStandalonePricesImportContainersByImportContainerKeyTest.php b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyStandalonePricesImportContainersByImportContainerKeyTest.php new file mode 100644 index 00000000000..7b944d2e394 --- /dev/null +++ b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyStandalonePricesImportContainersByImportContainerKeyTest.php @@ -0,0 +1,168 @@ +assertSame(strtolower($method), strtolower($request->getMethod())); + $this->assertSame($relativeUri, (string) $request->getUri()); + if (!is_null($body)) { + $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); + } else { + $this->assertSame("", (string) $request->getBody()); + } + } + + + + /** + * @dataProvider getRequestBuilderResponses() + */ + public function testMapFromResponse(callable $builderFunction, $statusCode) + { + $builder = new ImportRequestBuilder(); + $request = $builderFunction($builder); + $this->assertInstanceOf(ApiRequest::class, $request); + + $response = new Response($statusCode, [], "{}"); + $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteClientException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ImportRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); + + $this->expectException(ApiClientException::class); + $request->execute(); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteServerException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ImportRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); + + $this->expectException(ApiServerException::class); + $request->execute(); + } + + public function getRequests() + { + return [ + 'ByProjectKeyStandalonePricesImportContainersByImportContainerKeyPost' => [ + function (ImportRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue("test_projectKey") + ->standalonePrices() + ->importContainers() + ->withImportContainerKeyValue("test_importContainerKey") + ->post(null); + }, + 'post', + 'test_projectKey/standalone-prices/import-containers/test_importContainerKey', + ] + ]; + } + + public function getResources() + { + return [ + ]; + } + + public function getRequestBuilders() + { + return [ + 'ByProjectKeyStandalonePricesImportContainersByImportContainerKeyPost' => [ + function (ImportRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue("projectKey") + ->standalonePrices() + ->importContainers() + ->withImportContainerKeyValue("importContainerKey") + ->post(null); + } + ] + ]; + } + + public function getRequestBuilderResponses() + { + return [ + 'ByProjectKeyStandalonePricesImportContainersByImportContainerKeyPost_201' => [ + function (ImportRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue("projectKey") + ->standalonePrices() + ->importContainers() + ->withImportContainerKeyValue("importContainerKey") + ->post(null); + }, + 201 + ], + 'ByProjectKeyStandalonePricesImportContainersByImportContainerKeyPost_400' => [ + function (ImportRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue("projectKey") + ->standalonePrices() + ->importContainers() + ->withImportContainerKeyValue("importContainerKey") + ->post(null); + }, + 400 + ], + 'ByProjectKeyStandalonePricesImportContainersByImportContainerKeyPost_599' => [ + function (ImportRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue("projectKey") + ->standalonePrices() + ->importContainers() + ->withImportContainerKeyValue("importContainerKey") + ->post(null); + }, + 599 + ] + ]; + } +} diff --git a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyStandalonePricesImportContainersTest.php b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyStandalonePricesImportContainersTest.php new file mode 100644 index 00000000000..29b49d0eb70 --- /dev/null +++ b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyStandalonePricesImportContainersTest.php @@ -0,0 +1,81 @@ +assertInstanceOf($class, $resource); + $this->assertEquals($expectedArgs, $resource->getArgs()); + } + + + + + + + + public function getRequests() + { + return [ + ]; + } + + public function getResources() + { + return [ + 'ResourceByProjectKeyStandalonePricesImportContainersByImportContainerKey' => [ + function (ImportRequestBuilder $builder): ResourceByProjectKeyStandalonePricesImportContainersByImportContainerKey { + return $builder + ->withProjectKeyValue("test_projectKey") + ->standalonePrices() + ->importContainers() + ->withImportContainerKeyValue("test_importContainerKey"); + }, + ResourceByProjectKeyStandalonePricesImportContainersByImportContainerKey::class, + ['projectKey' => 'test_projectKey', 'importContainerKey' => 'test_importContainerKey'], + '/{projectKey}/standalone-prices/import-containers/{importContainerKey}' + ] + ]; + } + + public function getRequestBuilders() + { + return [ + ]; + } + + public function getRequestBuilderResponses() + { + return [ + ]; + } +} diff --git a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyStandalonePricesTest.php b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyStandalonePricesTest.php new file mode 100644 index 00000000000..73980d6424a --- /dev/null +++ b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyStandalonePricesTest.php @@ -0,0 +1,80 @@ +assertInstanceOf($class, $resource); + $this->assertEquals($expectedArgs, $resource->getArgs()); + } + + + + + + + + public function getRequests() + { + return [ + ]; + } + + public function getResources() + { + return [ + 'ResourceByProjectKeyStandalonePricesImportContainers' => [ + function (ImportRequestBuilder $builder): ResourceByProjectKeyStandalonePricesImportContainers { + return $builder + ->withProjectKeyValue("test_projectKey") + ->standalonePrices() + ->importContainers(); + }, + ResourceByProjectKeyStandalonePricesImportContainers::class, + ['projectKey' => 'test_projectKey'], + '/{projectKey}/standalone-prices/import-containers' + ] + ]; + } + + public function getRequestBuilders() + { + return [ + ]; + } + + public function getRequestBuilderResponses() + { + return [ + ]; + } +} diff --git a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyTest.php b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyTest.php index e717fa36e90..651820aeb42 100644 --- a/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyTest.php +++ b/lib/commercetools-import-tests/test/unit/Client/Resource/ResourceByProjectKeyTest.php @@ -26,6 +26,7 @@ use Commercetools\Import\Client\Resource\ResourceByProjectKeyProductTypes; use Commercetools\Import\Client\Resource\ResourceByProjectKeyProductVariantPatches; use Commercetools\Import\Client\Resource\ResourceByProjectKeyProductVariants; +use Commercetools\Import\Client\Resource\ResourceByProjectKeyStandalonePrices; use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\ClientException; use GuzzleHttp\Exception\ServerException; @@ -104,6 +105,16 @@ function (ImportRequestBuilder $builder): ResourceByProjectKeyPrices { ['projectKey' => 'test_projectKey'], '/{projectKey}/prices' ], + 'ResourceByProjectKeyStandalonePrices' => [ + function (ImportRequestBuilder $builder): ResourceByProjectKeyStandalonePrices { + return $builder + ->withProjectKeyValue("test_projectKey") + ->standalonePrices(); + }, + ResourceByProjectKeyStandalonePrices::class, + ['projectKey' => 'test_projectKey'], + '/{projectKey}/standalone-prices' + ], 'ResourceByProjectKeyProducts' => [ function (ImportRequestBuilder $builder): ResourceByProjectKeyProducts { return $builder diff --git a/lib/commercetools-import/docs/RequestBuilder.md b/lib/commercetools-import/docs/RequestBuilder.md index d553adf9418..2d01cc8502c 100644 --- a/lib/commercetools-import/docs/RequestBuilder.md +++ b/lib/commercetools-import/docs/RequestBuilder.md @@ -308,3 +308,19 @@ $request = $builder ->withImportContainerKeyValue("importContainerKey") ->post(null); ``` +## `withProjectKeyValue("projectKey")->standalonePrices()->importContainers()->withImportContainerKeyValue("importContainerKey")->post(null)` + +Creates a request for creating new Standalone Prices or updating existing ones. + +### Example +```php +use Commercetools\Import\Client\ImportRequestBuilder; + +$builder = new ImportRequestBuilder(); +$request = $builder + ->withProjectKeyValue("projectKey") + ->standalonePrices() + ->importContainers() + ->withImportContainerKeyValue("importContainerKey") + ->post(null); +``` diff --git a/lib/commercetools-import/src/Client/ImportRequestBuilder.php b/lib/commercetools-import/src/Client/ImportRequestBuilder.php index 3f0c8353304..64e6fa419c4 100644 --- a/lib/commercetools-import/src/Client/ImportRequestBuilder.php +++ b/lib/commercetools-import/src/Client/ImportRequestBuilder.php @@ -13,6 +13,9 @@ use Commercetools\Import\Client\Resource\ResourceByProjectKey; use GuzzleHttp\ClientInterface; +/** + * + */ class ImportRequestBuilder extends ApiResource { /** diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyCategoriesImportContainersByImportContainerKeyPost.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyCategoriesImportContainersByImportContainerKeyPost.php index 4ada0f0c352..68bf97a67e4 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyCategoriesImportContainersByImportContainerKeyPost.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyCategoriesImportContainersByImportContainerKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByManageProducts */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyCustomersImportContainersByImportContainerKeyPost.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyCustomersImportContainersByImportContainerKeyPost.php index 16085ea36c6..ec9b9dd2331 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyCustomersImportContainersByImportContainerKeyPost.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyCustomersImportContainersByImportContainerKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByManageCustomers */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyDelete.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyDelete.php index dbcf9ff3807..7ea526caf13 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyDelete.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyDelete.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByManageImportContainers */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyGet.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyGet.php index 47f4cbcae03..2097d833fff 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyGet.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByViewImportContainers */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyImportOperationsGet.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyImportOperationsGet.php index cf981b2b47f..7e075d79869 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyImportOperationsGet.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyImportOperationsGet.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByViewImportContainers */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyImportSummariesGet.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyImportSummariesGet.php index 4cc8d260736..7d2fafab76e 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyImportSummariesGet.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyImportSummariesGet.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByViewImportContainers */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyPut.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyPut.php index 0adaf53dcff..a4e17c710c6 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyPut.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersByImportContainerKeyPut.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByManageImportContainers */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersGet.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersGet.php index 28edf5ac5ac..e7ddd539054 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersGet.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersGet.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByViewImportContainers */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersPost.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersPost.php index c262d56438a..84f10646dc9 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersPost.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportContainersPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByManageImportContainers */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportOperationsByIdGet.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportOperationsByIdGet.php index 0d38508b9d0..bdfdd0220f4 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportOperationsByIdGet.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyImportOperationsByIdGet.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByViewImportContainers */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyInventoriesImportContainersByImportContainerKeyPost.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyInventoriesImportContainersByImportContainerKeyPost.php index ea5e7860d98..89b11808f0f 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyInventoriesImportContainersByImportContainerKeyPost.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyInventoriesImportContainersByImportContainerKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByManageProducts */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyOrderPatchesImportContainersByImportContainerKeyPost.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyOrderPatchesImportContainersByImportContainerKeyPost.php index 1a8a9eff0a0..23a1b1be83a 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyOrderPatchesImportContainersByImportContainerKeyPost.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyOrderPatchesImportContainersByImportContainerKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByManageOrders */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyOrdersImportContainersByImportContainerKeyPost.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyOrdersImportContainersByImportContainerKeyPost.php index d8882d260a6..b2408d1c14b 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyOrdersImportContainersByImportContainerKeyPost.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyOrdersImportContainersByImportContainerKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByManageOrders */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyPricesImportContainersByImportContainerKeyPost.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyPricesImportContainersByImportContainerKeyPost.php index 8b8883ade4c..8630e2bdba5 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyPricesImportContainersByImportContainerKeyPost.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyPricesImportContainersByImportContainerKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByManageProducts */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductDraftsImportContainersByImportContainerKeyPost.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductDraftsImportContainersByImportContainerKeyPost.php index b4e1d466a08..ad1364f926f 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductDraftsImportContainersByImportContainerKeyPost.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductDraftsImportContainersByImportContainerKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByManageProducts */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductTypesImportContainersByImportContainerKeyPost.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductTypesImportContainersByImportContainerKeyPost.php index 6f971a0bc61..3e880ac2f12 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductTypesImportContainersByImportContainerKeyPost.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductTypesImportContainersByImportContainerKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByManageProducts */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductVariantPatchesImportContainersByImportContainerKeyPost.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductVariantPatchesImportContainersByImportContainerKeyPost.php index 042551c45b6..9e9955c8e86 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductVariantPatchesImportContainersByImportContainerKeyPost.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductVariantPatchesImportContainersByImportContainerKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByManageProducts */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductVariantsImportContainersByImportContainerKeyPost.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductVariantsImportContainersByImportContainerKeyPost.php index fc03f446fc0..f4971ce024e 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductVariantsImportContainersByImportContainerKeyPost.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductVariantsImportContainersByImportContainerKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByManageProducts */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductsImportContainersByImportContainerKeyPost.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductsImportContainersByImportContainerKeyPost.php index 420e1505c5e..0e15eaddd73 100644 --- a/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductsImportContainersByImportContainerKeyPost.php +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyProductsImportContainersByImportContainerKeyPost.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * @template-implements SecuredByManageProducts */ diff --git a/lib/commercetools-import/src/Client/Resource/ByProjectKeyStandalonePricesImportContainersByImportContainerKeyPost.php b/lib/commercetools-import/src/Client/Resource/ByProjectKeyStandalonePricesImportContainersByImportContainerKeyPost.php new file mode 100644 index 00000000000..98ff01a59a8 --- /dev/null +++ b/lib/commercetools-import/src/Client/Resource/ByProjectKeyStandalonePricesImportContainersByImportContainerKeyPost.php @@ -0,0 +1,124 @@ + + */ +class ByProjectKeyStandalonePricesImportContainersByImportContainerKeyPost extends ApiRequest implements SecuredByManageStandalonePrices +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $importContainerKey, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{importContainerKey}'], [$projectKey, $importContainerKey], '{projectKey}/standalone-prices/import-containers/{importContainerKey}'); + parent::__construct($client, 'POST', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return ErrorResponse|ImportResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '201': + $resultType = ImportResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|ErrorResponse|ImportResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } +} diff --git a/lib/commercetools-import/src/Client/Resource/ResourceByProjectKey.php b/lib/commercetools-import/src/Client/Resource/ResourceByProjectKey.php index 502f6016e30..b2e5d247b0a 100644 --- a/lib/commercetools-import/src/Client/Resource/ResourceByProjectKey.php +++ b/lib/commercetools-import/src/Client/Resource/ResourceByProjectKey.php @@ -57,6 +57,14 @@ public function prices(): ResourceByProjectKeyPrices return new ResourceByProjectKeyPrices($args, $this->getClient()); } + /** + */ + public function standalonePrices(): ResourceByProjectKeyStandalonePrices + { + $args = $this->getArgs(); + + return new ResourceByProjectKeyStandalonePrices($args, $this->getClient()); + } /** */ public function products(): ResourceByProjectKeyProducts diff --git a/lib/commercetools-import/src/Client/Resource/ResourceByProjectKeyStandalonePrices.php b/lib/commercetools-import/src/Client/Resource/ResourceByProjectKeyStandalonePrices.php new file mode 100644 index 00000000000..54a602beee6 --- /dev/null +++ b/lib/commercetools-import/src/Client/Resource/ResourceByProjectKeyStandalonePrices.php @@ -0,0 +1,36 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/standalone-prices', $args, $client); + } + + /** + */ + public function importContainers(): ResourceByProjectKeyStandalonePricesImportContainers + { + $args = $this->getArgs(); + + return new ResourceByProjectKeyStandalonePricesImportContainers($args, $this->getClient()); + } +} diff --git a/lib/commercetools-import/src/Client/Resource/ResourceByProjectKeyStandalonePricesImportContainers.php b/lib/commercetools-import/src/Client/Resource/ResourceByProjectKeyStandalonePricesImportContainers.php new file mode 100644 index 00000000000..f5ddbdb3aea --- /dev/null +++ b/lib/commercetools-import/src/Client/Resource/ResourceByProjectKeyStandalonePricesImportContainers.php @@ -0,0 +1,39 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/standalone-prices/import-containers', $args, $client); + } + + /** + */ + public function withImportContainerKeyValue(string $importContainerKey = null): ResourceByProjectKeyStandalonePricesImportContainersByImportContainerKey + { + $args = $this->getArgs(); + if (!is_null($importContainerKey)) { + $args['importContainerKey'] = $importContainerKey; + } + + return new ResourceByProjectKeyStandalonePricesImportContainersByImportContainerKey($args, $this->getClient()); + } +} diff --git a/lib/commercetools-import/src/Client/Resource/ResourceByProjectKeyStandalonePricesImportContainersByImportContainerKey.php b/lib/commercetools-import/src/Client/Resource/ResourceByProjectKeyStandalonePricesImportContainersByImportContainerKey.php new file mode 100644 index 00000000000..7243554a177 --- /dev/null +++ b/lib/commercetools-import/src/Client/Resource/ResourceByProjectKeyStandalonePricesImportContainersByImportContainerKey.php @@ -0,0 +1,39 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/standalone-prices/import-containers/{importContainerKey}', $args, $client); + } + + /** + * @psalm-param ?StandalonePriceImportRequest $body + * @psalm-param array $headers + */ + public function post(?StandalonePriceImportRequest $body = null, array $headers = []): ByProjectKeyStandalonePricesImportContainersByImportContainerKeyPost + { + $args = $this->getArgs(); + + return new ByProjectKeyStandalonePricesImportContainersByImportContainerKeyPost($args['projectKey'], $args['importContainerKey'], $body, $headers, $this->getClient()); + } +} diff --git a/lib/commercetools-import/src/Client/Resource/SecuredByManageStandalonePrices.php b/lib/commercetools-import/src/Client/Resource/SecuredByManageStandalonePrices.php new file mode 100644 index 00000000000..d92a4cc606d --- /dev/null +++ b/lib/commercetools-import/src/Client/Resource/SecuredByManageStandalonePrices.php @@ -0,0 +1,19 @@ + + */ +interface SecuredByManageStandalonePrices extends ApiRequestInterface +{ +} diff --git a/lib/commercetools-import/src/Models/Categories/CategoryImport.php b/lib/commercetools-import/src/Models/Categories/CategoryImport.php index c225a30429a..5cf43f98885 100644 --- a/lib/commercetools-import/src/Models/Categories/CategoryImport.php +++ b/lib/commercetools-import/src/Models/Categories/CategoryImport.php @@ -33,6 +33,7 @@ interface CategoryImport extends ImportResource /** *

    Maps to Category.name.

    * + * @return null|LocalizedString */ public function getName(); @@ -41,6 +42,7 @@ public function getName(); *

    Maps to Category.slug. * Must match the pattern [-a-zA-Z0-9_]{2,256}.

    * + * @return null|LocalizedString */ public function getSlug(); @@ -48,6 +50,7 @@ public function getSlug(); /** *

    Maps to Category.description.

    * + * @return null|LocalizedString */ public function getDescription(); @@ -57,6 +60,7 @@ public function getDescription(); * The Reference to the parent Category with which the Category is associated. * If referenced Category does not exist, the state of the ImportOperation will be set to unresolved until the necessary Category is created.

    * + * @return null|CategoryKeyReference */ public function getParent(); @@ -64,6 +68,7 @@ public function getParent(); /** *

    Maps to Category.orderHint.

    * + * @return null|string */ public function getOrderHint(); @@ -71,6 +76,7 @@ public function getOrderHint(); /** *

    Maps to Category.externalId.

    * + * @return null|string */ public function getExternalId(); @@ -78,6 +84,7 @@ public function getExternalId(); /** *

    Maps to Category.metaTitle.

    * + * @return null|LocalizedString */ public function getMetaTitle(); @@ -85,6 +92,7 @@ public function getMetaTitle(); /** *

    Maps to Category.metaDescription.

    * + * @return null|LocalizedString */ public function getMetaDescription(); @@ -92,11 +100,13 @@ public function getMetaDescription(); /** *

    Maps to Category.metaKeywords.

    * + * @return null|LocalizedString */ public function getMetaKeywords(); /** + * @return null|AssetCollection */ public function getAssets(); @@ -104,6 +114,7 @@ public function getAssets(); /** *

    The custom fields for this Category.

    * + * @return null|Custom */ public function getCustom(); diff --git a/lib/commercetools-import/src/Models/Categories/CategoryImportBuilder.php b/lib/commercetools-import/src/Models/Categories/CategoryImportBuilder.php index 92b915a9c7c..35d3bf5334c 100644 --- a/lib/commercetools-import/src/Models/Categories/CategoryImportBuilder.php +++ b/lib/commercetools-import/src/Models/Categories/CategoryImportBuilder.php @@ -30,66 +30,81 @@ final class CategoryImportBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var null|CategoryKeyReference|CategoryKeyReferenceBuilder */ private $parent; /** + * @var ?string */ private $orderHint; /** + * @var ?string */ private $externalId; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaTitle; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaDescription; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaKeywords; /** + * @var ?AssetCollection */ private $assets; /** + * @var null|Custom|CustomBuilder */ private $custom; /** + *

    User-defined unique identifier.

    + * + * @return null|string */ public function getKey() @@ -100,6 +115,7 @@ public function getKey() /** *

    Maps to Category.name.

    * + * @return null|LocalizedString */ public function getName() @@ -111,6 +127,7 @@ public function getName() *

    Maps to Category.slug. * Must match the pattern [-a-zA-Z0-9_]{2,256}.

    * + * @return null|LocalizedString */ public function getSlug() @@ -121,6 +138,7 @@ public function getSlug() /** *

    Maps to Category.description.

    * + * @return null|LocalizedString */ public function getDescription() @@ -133,6 +151,7 @@ public function getDescription() * The Reference to the parent Category with which the Category is associated. * If referenced Category does not exist, the state of the ImportOperation will be set to unresolved until the necessary Category is created.

    * + * @return null|CategoryKeyReference */ public function getParent() @@ -143,6 +162,7 @@ public function getParent() /** *

    Maps to Category.orderHint.

    * + * @return null|string */ public function getOrderHint() @@ -153,6 +173,7 @@ public function getOrderHint() /** *

    Maps to Category.externalId.

    * + * @return null|string */ public function getExternalId() @@ -163,6 +184,7 @@ public function getExternalId() /** *

    Maps to Category.metaTitle.

    * + * @return null|LocalizedString */ public function getMetaTitle() @@ -173,6 +195,7 @@ public function getMetaTitle() /** *

    Maps to Category.metaDescription.

    * + * @return null|LocalizedString */ public function getMetaDescription() @@ -183,6 +206,7 @@ public function getMetaDescription() /** *

    Maps to Category.metaKeywords.

    * + * @return null|LocalizedString */ public function getMetaKeywords() @@ -191,6 +215,7 @@ public function getMetaKeywords() } /** + * @return null|AssetCollection */ public function getAssets() @@ -201,6 +226,7 @@ public function getAssets() /** *

    The custom fields for this Category.

    * + * @return null|Custom */ public function getCustom() diff --git a/lib/commercetools-import/src/Models/Categories/CategoryImportModel.php b/lib/commercetools-import/src/Models/Categories/CategoryImportModel.php index 3aa4e9885e6..06503f9f735 100644 --- a/lib/commercetools-import/src/Models/Categories/CategoryImportModel.php +++ b/lib/commercetools-import/src/Models/Categories/CategoryImportModel.php @@ -29,61 +29,73 @@ final class CategoryImportModel extends JsonObjectModel implements CategoryImport { /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $slug; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?CategoryKeyReference */ protected $parent; /** + * * @var ?string */ protected $orderHint; /** + * * @var ?string */ protected $externalId; /** + * * @var ?LocalizedString */ protected $metaTitle; /** + * * @var ?LocalizedString */ protected $metaDescription; /** + * * @var ?LocalizedString */ protected $metaKeywords; /** + * * @var ?AssetCollection */ protected $assets; /** + * * @var ?Custom */ protected $custom; @@ -121,6 +133,9 @@ public function __construct( } /** + *

    User-defined unique identifier.

    + * + * * @return null|string */ public function getKey() @@ -140,6 +155,7 @@ public function getKey() /** *

    Maps to Category.name.

    * + * * @return null|LocalizedString */ public function getName() @@ -161,6 +177,7 @@ public function getName() *

    Maps to Category.slug. * Must match the pattern [-a-zA-Z0-9_]{2,256}.

    * + * * @return null|LocalizedString */ public function getSlug() @@ -181,6 +198,7 @@ public function getSlug() /** *

    Maps to Category.description.

    * + * * @return null|LocalizedString */ public function getDescription() @@ -203,6 +221,7 @@ public function getDescription() * The Reference to the parent Category with which the Category is associated. * If referenced Category does not exist, the state of the ImportOperation will be set to unresolved until the necessary Category is created.

    * + * * @return null|CategoryKeyReference */ public function getParent() @@ -223,6 +242,7 @@ public function getParent() /** *

    Maps to Category.orderHint.

    * + * * @return null|string */ public function getOrderHint() @@ -242,6 +262,7 @@ public function getOrderHint() /** *

    Maps to Category.externalId.

    * + * * @return null|string */ public function getExternalId() @@ -261,6 +282,7 @@ public function getExternalId() /** *

    Maps to Category.metaTitle.

    * + * * @return null|LocalizedString */ public function getMetaTitle() @@ -281,6 +303,7 @@ public function getMetaTitle() /** *

    Maps to Category.metaDescription.

    * + * * @return null|LocalizedString */ public function getMetaDescription() @@ -301,6 +324,7 @@ public function getMetaDescription() /** *

    Maps to Category.metaKeywords.

    * + * * @return null|LocalizedString */ public function getMetaKeywords() @@ -319,6 +343,7 @@ public function getMetaKeywords() } /** + * * @return null|AssetCollection */ public function getAssets() @@ -338,6 +363,7 @@ public function getAssets() /** *

    The custom fields for this Category.

    * + * * @return null|Custom */ public function getCustom() diff --git a/lib/commercetools-import/src/Models/Common/Address.php b/lib/commercetools-import/src/Models/Common/Address.php index 6720ae30271..cac5bd6dc39 100644 --- a/lib/commercetools-import/src/Models/Common/Address.php +++ b/lib/commercetools-import/src/Models/Common/Address.php @@ -40,66 +40,79 @@ interface Address extends JsonObject public const FIELD_EXTERNAL_ID = 'externalId'; /** + * @return null|string */ public function getId(); /** + * @return null|string */ public function getKey(); /** + * @return null|string */ public function getTitle(); /** + * @return null|string */ public function getSalutation(); /** + * @return null|string */ public function getFirstName(); /** + * @return null|string */ public function getLastName(); /** + * @return null|string */ public function getStreetName(); /** + * @return null|string */ public function getStreetNumber(); /** + * @return null|string */ public function getAdditionalStreetInfo(); /** + * @return null|string */ public function getPostalCode(); /** + * @return null|string */ public function getCity(); /** + * @return null|string */ public function getRegion(); /** + * @return null|string */ public function getState(); @@ -107,61 +120,73 @@ public function getState(); /** *

    A two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry(); /** + * @return null|string */ public function getCompany(); /** + * @return null|string */ public function getDepartment(); /** + * @return null|string */ public function getBuilding(); /** + * @return null|string */ public function getApartment(); /** + * @return null|string */ public function getPOBox(); /** + * @return null|string */ public function getPhone(); /** + * @return null|string */ public function getMobile(); /** + * @return null|string */ public function getEmail(); /** + * @return null|string */ public function getFax(); /** + * @return null|string */ public function getAdditionalAddressInfo(); /** + * @return null|string */ public function getExternalId(); diff --git a/lib/commercetools-import/src/Models/Common/AddressBuilder.php b/lib/commercetools-import/src/Models/Common/AddressBuilder.php index 6f77e462e51..1866274e783 100644 --- a/lib/commercetools-import/src/Models/Common/AddressBuilder.php +++ b/lib/commercetools-import/src/Models/Common/AddressBuilder.php @@ -21,131 +21,157 @@ final class AddressBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $key; /** + * @var ?string */ private $title; /** + * @var ?string */ private $salutation; /** + * @var ?string */ private $firstName; /** + * @var ?string */ private $lastName; /** + * @var ?string */ private $streetName; /** + * @var ?string */ private $streetNumber; /** + * @var ?string */ private $additionalStreetInfo; /** + * @var ?string */ private $postalCode; /** + * @var ?string */ private $city; /** + * @var ?string */ private $region; /** + * @var ?string */ private $state; /** + * @var ?string */ private $country; /** + * @var ?string */ private $company; /** + * @var ?string */ private $department; /** + * @var ?string */ private $building; /** + * @var ?string */ private $apartment; /** + * @var ?string */ private $pOBox; /** + * @var ?string */ private $phone; /** + * @var ?string */ private $mobile; /** + * @var ?string */ private $email; /** + * @var ?string */ private $fax; /** + * @var ?string */ private $additionalAddressInfo; /** + * @var ?string */ private $externalId; /** + * @return null|string */ public function getId() @@ -154,6 +180,7 @@ public function getId() } /** + * @return null|string */ public function getKey() @@ -162,6 +189,7 @@ public function getKey() } /** + * @return null|string */ public function getTitle() @@ -170,6 +198,7 @@ public function getTitle() } /** + * @return null|string */ public function getSalutation() @@ -178,6 +207,7 @@ public function getSalutation() } /** + * @return null|string */ public function getFirstName() @@ -186,6 +216,7 @@ public function getFirstName() } /** + * @return null|string */ public function getLastName() @@ -194,6 +225,7 @@ public function getLastName() } /** + * @return null|string */ public function getStreetName() @@ -202,6 +234,7 @@ public function getStreetName() } /** + * @return null|string */ public function getStreetNumber() @@ -210,6 +243,7 @@ public function getStreetNumber() } /** + * @return null|string */ public function getAdditionalStreetInfo() @@ -218,6 +252,7 @@ public function getAdditionalStreetInfo() } /** + * @return null|string */ public function getPostalCode() @@ -226,6 +261,7 @@ public function getPostalCode() } /** + * @return null|string */ public function getCity() @@ -234,6 +270,7 @@ public function getCity() } /** + * @return null|string */ public function getRegion() @@ -242,6 +279,7 @@ public function getRegion() } /** + * @return null|string */ public function getState() @@ -252,6 +290,7 @@ public function getState() /** *

    A two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry() @@ -260,6 +299,7 @@ public function getCountry() } /** + * @return null|string */ public function getCompany() @@ -268,6 +308,7 @@ public function getCompany() } /** + * @return null|string */ public function getDepartment() @@ -276,6 +317,7 @@ public function getDepartment() } /** + * @return null|string */ public function getBuilding() @@ -284,6 +326,7 @@ public function getBuilding() } /** + * @return null|string */ public function getApartment() @@ -292,6 +335,7 @@ public function getApartment() } /** + * @return null|string */ public function getPOBox() @@ -300,6 +344,7 @@ public function getPOBox() } /** + * @return null|string */ public function getPhone() @@ -308,6 +353,7 @@ public function getPhone() } /** + * @return null|string */ public function getMobile() @@ -316,6 +362,7 @@ public function getMobile() } /** + * @return null|string */ public function getEmail() @@ -324,6 +371,7 @@ public function getEmail() } /** + * @return null|string */ public function getFax() @@ -332,6 +380,7 @@ public function getFax() } /** + * @return null|string */ public function getAdditionalAddressInfo() @@ -340,6 +389,7 @@ public function getAdditionalAddressInfo() } /** + * @return null|string */ public function getExternalId() diff --git a/lib/commercetools-import/src/Models/Common/AddressModel.php b/lib/commercetools-import/src/Models/Common/AddressModel.php index 916f56aa7f5..1afdb84ca6a 100644 --- a/lib/commercetools-import/src/Models/Common/AddressModel.php +++ b/lib/commercetools-import/src/Models/Common/AddressModel.php @@ -20,126 +20,151 @@ final class AddressModel extends JsonObjectModel implements Address { /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $title; /** + * * @var ?string */ protected $salutation; /** + * * @var ?string */ protected $firstName; /** + * * @var ?string */ protected $lastName; /** + * * @var ?string */ protected $streetName; /** + * * @var ?string */ protected $streetNumber; /** + * * @var ?string */ protected $additionalStreetInfo; /** + * * @var ?string */ protected $postalCode; /** + * * @var ?string */ protected $city; /** + * * @var ?string */ protected $region; /** + * * @var ?string */ protected $state; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $company; /** + * * @var ?string */ protected $department; /** + * * @var ?string */ protected $building; /** + * * @var ?string */ protected $apartment; /** + * * @var ?string */ protected $pOBox; /** + * * @var ?string */ protected $phone; /** + * * @var ?string */ protected $mobile; /** + * * @var ?string */ protected $email; /** + * * @var ?string */ protected $fax; /** + * * @var ?string */ protected $additionalAddressInfo; /** + * * @var ?string */ protected $externalId; @@ -203,6 +228,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -220,6 +246,7 @@ public function getId() } /** + * * @return null|string */ public function getKey() @@ -237,6 +264,7 @@ public function getKey() } /** + * * @return null|string */ public function getTitle() @@ -254,6 +282,7 @@ public function getTitle() } /** + * * @return null|string */ public function getSalutation() @@ -271,6 +300,7 @@ public function getSalutation() } /** + * * @return null|string */ public function getFirstName() @@ -288,6 +318,7 @@ public function getFirstName() } /** + * * @return null|string */ public function getLastName() @@ -305,6 +336,7 @@ public function getLastName() } /** + * * @return null|string */ public function getStreetName() @@ -322,6 +354,7 @@ public function getStreetName() } /** + * * @return null|string */ public function getStreetNumber() @@ -339,6 +372,7 @@ public function getStreetNumber() } /** + * * @return null|string */ public function getAdditionalStreetInfo() @@ -356,6 +390,7 @@ public function getAdditionalStreetInfo() } /** + * * @return null|string */ public function getPostalCode() @@ -373,6 +408,7 @@ public function getPostalCode() } /** + * * @return null|string */ public function getCity() @@ -390,6 +426,7 @@ public function getCity() } /** + * * @return null|string */ public function getRegion() @@ -407,6 +444,7 @@ public function getRegion() } /** + * * @return null|string */ public function getState() @@ -426,6 +464,7 @@ public function getState() /** *

    A two-digit country code as per ISO 3166-1 alpha-2.

    * + * * @return null|string */ public function getCountry() @@ -443,6 +482,7 @@ public function getCountry() } /** + * * @return null|string */ public function getCompany() @@ -460,6 +500,7 @@ public function getCompany() } /** + * * @return null|string */ public function getDepartment() @@ -477,6 +518,7 @@ public function getDepartment() } /** + * * @return null|string */ public function getBuilding() @@ -494,6 +536,7 @@ public function getBuilding() } /** + * * @return null|string */ public function getApartment() @@ -511,6 +554,7 @@ public function getApartment() } /** + * * @return null|string */ public function getPOBox() @@ -528,6 +572,7 @@ public function getPOBox() } /** + * * @return null|string */ public function getPhone() @@ -545,6 +590,7 @@ public function getPhone() } /** + * * @return null|string */ public function getMobile() @@ -562,6 +608,7 @@ public function getMobile() } /** + * * @return null|string */ public function getEmail() @@ -579,6 +626,7 @@ public function getEmail() } /** + * * @return null|string */ public function getFax() @@ -596,6 +644,7 @@ public function getFax() } /** + * * @return null|string */ public function getAdditionalAddressInfo() @@ -613,6 +662,7 @@ public function getAdditionalAddressInfo() } /** + * * @return null|string */ public function getExternalId() diff --git a/lib/commercetools-import/src/Models/Common/Asset.php b/lib/commercetools-import/src/Models/Common/Asset.php index 8aca5f1637e..97ae0a97710 100644 --- a/lib/commercetools-import/src/Models/Common/Asset.php +++ b/lib/commercetools-import/src/Models/Common/Asset.php @@ -25,11 +25,13 @@ interface Asset extends JsonObject *

    User-defined identifier for the asset. * Asset keys are unique inside their container (a product variant or a category).

    * + * @return null|string */ public function getKey(); /** + * @return null|AssetSourceCollection */ public function getSources(); @@ -42,6 +44,7 @@ public function getSources(); * } * * + * @return null|LocalizedString */ public function getName(); @@ -54,11 +57,13 @@ public function getName(); * } * * + * @return null|LocalizedString */ public function getDescription(); /** + * @return null|array */ public function getTags(); @@ -66,6 +71,7 @@ public function getTags(); /** *

    The representation to be sent to the server when creating a resource with custom fields.

    * + * @return null|Custom */ public function getCustom(); diff --git a/lib/commercetools-import/src/Models/Common/AssetBuilder.php b/lib/commercetools-import/src/Models/Common/AssetBuilder.php index 3c77acb7831..e18a2e74c0d 100644 --- a/lib/commercetools-import/src/Models/Common/AssetBuilder.php +++ b/lib/commercetools-import/src/Models/Common/AssetBuilder.php @@ -23,31 +23,37 @@ final class AssetBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?AssetSourceCollection */ private $sources; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?array */ private $tags; /** + * @var null|Custom|CustomBuilder */ private $custom; @@ -56,6 +62,7 @@ final class AssetBuilder implements Builder *

    User-defined identifier for the asset. * Asset keys are unique inside their container (a product variant or a category).

    * + * @return null|string */ public function getKey() @@ -64,6 +71,7 @@ public function getKey() } /** + * @return null|AssetSourceCollection */ public function getSources() @@ -79,6 +87,7 @@ public function getSources() * } * * + * @return null|LocalizedString */ public function getName() @@ -94,6 +103,7 @@ public function getName() * } * * + * @return null|LocalizedString */ public function getDescription() @@ -102,6 +112,7 @@ public function getDescription() } /** + * @return null|array */ public function getTags() @@ -112,6 +123,7 @@ public function getTags() /** *

    The representation to be sent to the server when creating a resource with custom fields.

    * + * @return null|Custom */ public function getCustom() diff --git a/lib/commercetools-import/src/Models/Common/AssetDimensions.php b/lib/commercetools-import/src/Models/Common/AssetDimensions.php index e406b4b958e..a2a3dc156df 100644 --- a/lib/commercetools-import/src/Models/Common/AssetDimensions.php +++ b/lib/commercetools-import/src/Models/Common/AssetDimensions.php @@ -19,6 +19,7 @@ interface AssetDimensions extends JsonObject /** *

    The width of the asset source.

    * + * @return null|int */ public function getW(); @@ -26,6 +27,7 @@ public function getW(); /** *

    The height of the asset source.

    * + * @return null|int */ public function getH(); diff --git a/lib/commercetools-import/src/Models/Common/AssetDimensionsBuilder.php b/lib/commercetools-import/src/Models/Common/AssetDimensionsBuilder.php index d5a248c54d8..b1fde3e19cd 100644 --- a/lib/commercetools-import/src/Models/Common/AssetDimensionsBuilder.php +++ b/lib/commercetools-import/src/Models/Common/AssetDimensionsBuilder.php @@ -21,11 +21,13 @@ final class AssetDimensionsBuilder implements Builder { /** + * @var ?int */ private $w; /** + * @var ?int */ private $h; @@ -33,6 +35,7 @@ final class AssetDimensionsBuilder implements Builder /** *

    The width of the asset source.

    * + * @return null|int */ public function getW() @@ -43,6 +46,7 @@ public function getW() /** *

    The height of the asset source.

    * + * @return null|int */ public function getH() diff --git a/lib/commercetools-import/src/Models/Common/AssetDimensionsModel.php b/lib/commercetools-import/src/Models/Common/AssetDimensionsModel.php index d5077a04425..a02819ff7cc 100644 --- a/lib/commercetools-import/src/Models/Common/AssetDimensionsModel.php +++ b/lib/commercetools-import/src/Models/Common/AssetDimensionsModel.php @@ -20,11 +20,13 @@ final class AssetDimensionsModel extends JsonObjectModel implements AssetDimensions { /** + * * @var ?int */ protected $w; /** + * * @var ?int */ protected $h; @@ -44,6 +46,7 @@ public function __construct( /** *

    The width of the asset source.

    * + * * @return null|int */ public function getW() @@ -63,6 +66,7 @@ public function getW() /** *

    The height of the asset source.

    * + * * @return null|int */ public function getH() diff --git a/lib/commercetools-import/src/Models/Common/AssetModel.php b/lib/commercetools-import/src/Models/Common/AssetModel.php index 4bd03b5300d..81a3ea0b84f 100644 --- a/lib/commercetools-import/src/Models/Common/AssetModel.php +++ b/lib/commercetools-import/src/Models/Common/AssetModel.php @@ -22,31 +22,37 @@ final class AssetModel extends JsonObjectModel implements Asset { /** + * * @var ?string */ protected $key; /** + * * @var ?AssetSourceCollection */ protected $sources; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?array */ protected $tags; /** + * * @var ?Custom */ protected $custom; @@ -75,6 +81,7 @@ public function __construct( *

    User-defined identifier for the asset. * Asset keys are unique inside their container (a product variant or a category).

    * + * * @return null|string */ public function getKey() @@ -92,6 +99,7 @@ public function getKey() } /** + * * @return null|AssetSourceCollection */ public function getSources() @@ -116,6 +124,7 @@ public function getSources() * } * * + * * @return null|LocalizedString */ public function getName() @@ -141,6 +150,7 @@ public function getName() * } * * + * * @return null|LocalizedString */ public function getDescription() @@ -159,6 +169,7 @@ public function getDescription() } /** + * * @return null|array */ public function getTags() @@ -178,6 +189,7 @@ public function getTags() /** *

    The representation to be sent to the server when creating a resource with custom fields.

    * + * * @return null|Custom */ public function getCustom() diff --git a/lib/commercetools-import/src/Models/Common/AssetSource.php b/lib/commercetools-import/src/Models/Common/AssetSource.php index 7c4ac9e2c91..719bba56c30 100644 --- a/lib/commercetools-import/src/Models/Common/AssetSource.php +++ b/lib/commercetools-import/src/Models/Common/AssetSource.php @@ -19,11 +19,13 @@ interface AssetSource extends JsonObject public const FIELD_CONTENT_TYPE = 'contentType'; /** + * @return null|string */ public function getUri(); /** + * @return null|string */ public function getKey(); @@ -31,11 +33,13 @@ public function getKey(); /** *

    The width and height of the Asset Source.

    * + * @return null|AssetDimensions */ public function getDimensions(); /** + * @return null|string */ public function getContentType(); diff --git a/lib/commercetools-import/src/Models/Common/AssetSourceBuilder.php b/lib/commercetools-import/src/Models/Common/AssetSourceBuilder.php index b75ea3176bc..00aa611b2af 100644 --- a/lib/commercetools-import/src/Models/Common/AssetSourceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/AssetSourceBuilder.php @@ -21,26 +21,31 @@ final class AssetSourceBuilder implements Builder { /** + * @var ?string */ private $uri; /** + * @var ?string */ private $key; /** + * @var null|AssetDimensions|AssetDimensionsBuilder */ private $dimensions; /** + * @var ?string */ private $contentType; /** + * @return null|string */ public function getUri() @@ -49,6 +54,7 @@ public function getUri() } /** + * @return null|string */ public function getKey() @@ -59,6 +65,7 @@ public function getKey() /** *

    The width and height of the Asset Source.

    * + * @return null|AssetDimensions */ public function getDimensions() @@ -67,6 +74,7 @@ public function getDimensions() } /** + * @return null|string */ public function getContentType() diff --git a/lib/commercetools-import/src/Models/Common/AssetSourceModel.php b/lib/commercetools-import/src/Models/Common/AssetSourceModel.php index 4ea3e1c34aa..9e48f4ee0b5 100644 --- a/lib/commercetools-import/src/Models/Common/AssetSourceModel.php +++ b/lib/commercetools-import/src/Models/Common/AssetSourceModel.php @@ -20,21 +20,25 @@ final class AssetSourceModel extends JsonObjectModel implements AssetSource { /** + * * @var ?string */ protected $uri; /** + * * @var ?string */ protected $key; /** + * * @var ?AssetDimensions */ protected $dimensions; /** + * * @var ?string */ protected $contentType; @@ -56,6 +60,7 @@ public function __construct( } /** + * * @return null|string */ public function getUri() @@ -73,6 +78,7 @@ public function getUri() } /** + * * @return null|string */ public function getKey() @@ -92,6 +98,7 @@ public function getKey() /** *

    The width and height of the Asset Source.

    * + * * @return null|AssetDimensions */ public function getDimensions() @@ -110,6 +117,7 @@ public function getDimensions() } /** + * * @return null|string */ public function getContentType() diff --git a/lib/commercetools-import/src/Models/Common/CartDiscountKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/CartDiscountKeyReferenceBuilder.php index cd17edf710c..918a93d6c98 100644 --- a/lib/commercetools-import/src/Models/Common/CartDiscountKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/CartDiscountKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class CartDiscountKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/CartDiscountKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/CartDiscountKeyReferenceModel.php index 7a4e4c87b41..cbd237e800f 100644 --- a/lib/commercetools-import/src/Models/Common/CartDiscountKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/CartDiscountKeyReferenceModel.php @@ -21,11 +21,13 @@ final class CartDiscountKeyReferenceModel extends JsonObjectModel implements Car { public const DISCRIMINATOR_VALUE = 'cart-discount'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class CartDiscountKeyReferenceModel extends JsonObjectModel implements Car * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/CartKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/CartKeyReferenceBuilder.php index 11138395d80..94d1f22ba30 100644 --- a/lib/commercetools-import/src/Models/Common/CartKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/CartKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class CartKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/CartKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/CartKeyReferenceModel.php index 7837490e0b6..5c4e842aec0 100644 --- a/lib/commercetools-import/src/Models/Common/CartKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/CartKeyReferenceModel.php @@ -21,11 +21,13 @@ final class CartKeyReferenceModel extends JsonObjectModel implements CartKeyRefe { public const DISCRIMINATOR_VALUE = 'cart'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class CartKeyReferenceModel extends JsonObjectModel implements CartKeyRefe * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/CategoryKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/CategoryKeyReferenceBuilder.php index 4212a8ddb26..2bd010863c2 100644 --- a/lib/commercetools-import/src/Models/Common/CategoryKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/CategoryKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class CategoryKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/CategoryKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/CategoryKeyReferenceModel.php index db0543f0716..af21380ac62 100644 --- a/lib/commercetools-import/src/Models/Common/CategoryKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/CategoryKeyReferenceModel.php @@ -21,11 +21,13 @@ final class CategoryKeyReferenceModel extends JsonObjectModel implements Categor { public const DISCRIMINATOR_VALUE = 'category'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class CategoryKeyReferenceModel extends JsonObjectModel implements Categor * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/ChannelKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/ChannelKeyReferenceBuilder.php index d95af964f28..c41a85ad8e1 100644 --- a/lib/commercetools-import/src/Models/Common/ChannelKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/ChannelKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class ChannelKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/ChannelKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/ChannelKeyReferenceModel.php index 379f6cdc96c..9edcade6ac2 100644 --- a/lib/commercetools-import/src/Models/Common/ChannelKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/ChannelKeyReferenceModel.php @@ -21,11 +21,13 @@ final class ChannelKeyReferenceModel extends JsonObjectModel implements ChannelK { public const DISCRIMINATOR_VALUE = 'channel'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class ChannelKeyReferenceModel extends JsonObjectModel implements ChannelK * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/CustomObjectKeyReference.php b/lib/commercetools-import/src/Models/Common/CustomObjectKeyReference.php index 8ffe2e17ff6..5a21a77c2f2 100644 --- a/lib/commercetools-import/src/Models/Common/CustomObjectKeyReference.php +++ b/lib/commercetools-import/src/Models/Common/CustomObjectKeyReference.php @@ -16,6 +16,7 @@ interface CustomObjectKeyReference extends KeyReference public const FIELD_CONTAINER = 'container'; /** + * @return null|string */ public function getContainer(); diff --git a/lib/commercetools-import/src/Models/Common/CustomObjectKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/CustomObjectKeyReferenceBuilder.php index d8844cd2400..16dc46e5127 100644 --- a/lib/commercetools-import/src/Models/Common/CustomObjectKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/CustomObjectKeyReferenceBuilder.php @@ -21,16 +21,19 @@ final class CustomObjectKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $container; /** + * @return null|string */ public function getKey() @@ -39,6 +42,7 @@ public function getKey() } /** + * @return null|string */ public function getContainer() diff --git a/lib/commercetools-import/src/Models/Common/CustomObjectKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/CustomObjectKeyReferenceModel.php index 4fb8e0f498f..7e2836b3d08 100644 --- a/lib/commercetools-import/src/Models/Common/CustomObjectKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/CustomObjectKeyReferenceModel.php @@ -21,16 +21,19 @@ final class CustomObjectKeyReferenceModel extends JsonObjectModel implements Cus { public const DISCRIMINATOR_VALUE = 'key-value-document'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $container; @@ -41,14 +44,16 @@ final class CustomObjectKeyReferenceModel extends JsonObjectModel implements Cus */ public function __construct( ?string $key = null, - ?string $container = null + ?string $container = null, + ?string $typeId = null ) { $this->key = $key; $this->container = $container; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -68,6 +73,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() @@ -85,6 +91,7 @@ public function getTypeId() } /** + * * @return null|string */ public function getContainer() diff --git a/lib/commercetools-import/src/Models/Common/CustomerGroupKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/CustomerGroupKeyReferenceBuilder.php index 91eb634d12c..44b45f031c9 100644 --- a/lib/commercetools-import/src/Models/Common/CustomerGroupKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/CustomerGroupKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class CustomerGroupKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/CustomerGroupKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/CustomerGroupKeyReferenceModel.php index a33920affe5..bafed1f7190 100644 --- a/lib/commercetools-import/src/Models/Common/CustomerGroupKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/CustomerGroupKeyReferenceModel.php @@ -21,11 +21,13 @@ final class CustomerGroupKeyReferenceModel extends JsonObjectModel implements Cu { public const DISCRIMINATOR_VALUE = 'customer-group'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class CustomerGroupKeyReferenceModel extends JsonObjectModel implements Cu * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/CustomerKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/CustomerKeyReferenceBuilder.php index feff327d13d..cdeb83acaa4 100644 --- a/lib/commercetools-import/src/Models/Common/CustomerKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/CustomerKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class CustomerKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/CustomerKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/CustomerKeyReferenceModel.php index 81443812006..314ea033fab 100644 --- a/lib/commercetools-import/src/Models/Common/CustomerKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/CustomerKeyReferenceModel.php @@ -21,11 +21,13 @@ final class CustomerKeyReferenceModel extends JsonObjectModel implements Custome { public const DISCRIMINATOR_VALUE = 'customer'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class CustomerKeyReferenceModel extends JsonObjectModel implements Custome * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/DiscountCodeKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/DiscountCodeKeyReferenceBuilder.php index 7bb36835d17..ebfe8db8b58 100644 --- a/lib/commercetools-import/src/Models/Common/DiscountCodeKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/DiscountCodeKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class DiscountCodeKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/DiscountCodeKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/DiscountCodeKeyReferenceModel.php index 0fae1697cc1..4fff35b47cc 100644 --- a/lib/commercetools-import/src/Models/Common/DiscountCodeKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/DiscountCodeKeyReferenceModel.php @@ -21,11 +21,13 @@ final class DiscountCodeKeyReferenceModel extends JsonObjectModel implements Dis { public const DISCRIMINATOR_VALUE = 'discount-code'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class DiscountCodeKeyReferenceModel extends JsonObjectModel implements Dis * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/DiscountedPrice.php b/lib/commercetools-import/src/Models/Common/DiscountedPrice.php index b4fcf8f9181..2feba5fdb81 100644 --- a/lib/commercetools-import/src/Models/Common/DiscountedPrice.php +++ b/lib/commercetools-import/src/Models/Common/DiscountedPrice.php @@ -17,6 +17,7 @@ interface DiscountedPrice extends JsonObject public const FIELD_DISCOUNT = 'discount'; /** + * @return null|TypedMoney */ public function getValue(); @@ -24,6 +25,7 @@ public function getValue(); /** *

    Reference to a ProductDiscount.

    * + * @return null|ProductDiscountKeyReference */ public function getDiscount(); diff --git a/lib/commercetools-import/src/Models/Common/DiscountedPriceBuilder.php b/lib/commercetools-import/src/Models/Common/DiscountedPriceBuilder.php index 3e6c53f2b4b..3ef01ea4a21 100644 --- a/lib/commercetools-import/src/Models/Common/DiscountedPriceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/DiscountedPriceBuilder.php @@ -21,16 +21,19 @@ final class DiscountedPriceBuilder implements Builder { /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $value; /** + * @var null|ProductDiscountKeyReference|ProductDiscountKeyReferenceBuilder */ private $discount; /** + * @return null|TypedMoney */ public function getValue() @@ -41,6 +44,7 @@ public function getValue() /** *

    Reference to a ProductDiscount.

    * + * @return null|ProductDiscountKeyReference */ public function getDiscount() diff --git a/lib/commercetools-import/src/Models/Common/DiscountedPriceModel.php b/lib/commercetools-import/src/Models/Common/DiscountedPriceModel.php index 5afe45f311d..6c25f78cdf8 100644 --- a/lib/commercetools-import/src/Models/Common/DiscountedPriceModel.php +++ b/lib/commercetools-import/src/Models/Common/DiscountedPriceModel.php @@ -20,11 +20,13 @@ final class DiscountedPriceModel extends JsonObjectModel implements DiscountedPrice { /** + * * @var ?TypedMoney */ protected $value; /** + * * @var ?ProductDiscountKeyReference */ protected $discount; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|TypedMoney */ public function getValue() @@ -62,6 +65,7 @@ public function getValue() /** *

    Reference to a ProductDiscount.

    * + * * @return null|ProductDiscountKeyReference */ public function getDiscount() diff --git a/lib/commercetools-import/src/Models/Common/EnumValue.php b/lib/commercetools-import/src/Models/Common/EnumValue.php index bdc1618adbc..f67589e306b 100644 --- a/lib/commercetools-import/src/Models/Common/EnumValue.php +++ b/lib/commercetools-import/src/Models/Common/EnumValue.php @@ -17,11 +17,13 @@ interface EnumValue extends JsonObject public const FIELD_LABEL = 'label'; /** + * @return null|string */ public function getKey(); /** + * @return null|string */ public function getLabel(); diff --git a/lib/commercetools-import/src/Models/Common/EnumValueBuilder.php b/lib/commercetools-import/src/Models/Common/EnumValueBuilder.php index 4824fa7a063..25db8f2c433 100644 --- a/lib/commercetools-import/src/Models/Common/EnumValueBuilder.php +++ b/lib/commercetools-import/src/Models/Common/EnumValueBuilder.php @@ -21,16 +21,19 @@ final class EnumValueBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $label; /** + * @return null|string */ public function getKey() @@ -39,6 +42,7 @@ public function getKey() } /** + * @return null|string */ public function getLabel() diff --git a/lib/commercetools-import/src/Models/Common/EnumValueModel.php b/lib/commercetools-import/src/Models/Common/EnumValueModel.php index 9ca9906f674..f4c473d10b4 100644 --- a/lib/commercetools-import/src/Models/Common/EnumValueModel.php +++ b/lib/commercetools-import/src/Models/Common/EnumValueModel.php @@ -20,11 +20,13 @@ final class EnumValueModel extends JsonObjectModel implements EnumValue { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $label; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|string */ public function getKey() @@ -59,6 +62,7 @@ public function getKey() } /** + * * @return null|string */ public function getLabel() diff --git a/lib/commercetools-import/src/Models/Common/HighPrecisionMoney.php b/lib/commercetools-import/src/Models/Common/HighPrecisionMoney.php index 6ba39166ed1..acf46f8b198 100644 --- a/lib/commercetools-import/src/Models/Common/HighPrecisionMoney.php +++ b/lib/commercetools-import/src/Models/Common/HighPrecisionMoney.php @@ -16,6 +16,7 @@ interface HighPrecisionMoney extends TypedMoney public const FIELD_PRECISE_AMOUNT = 'preciseAmount'; /** + * @return null|int */ public function getPreciseAmount(); diff --git a/lib/commercetools-import/src/Models/Common/HighPrecisionMoneyBuilder.php b/lib/commercetools-import/src/Models/Common/HighPrecisionMoneyBuilder.php index 205897b0f84..41a5ebd1663 100644 --- a/lib/commercetools-import/src/Models/Common/HighPrecisionMoneyBuilder.php +++ b/lib/commercetools-import/src/Models/Common/HighPrecisionMoneyBuilder.php @@ -21,26 +21,31 @@ final class HighPrecisionMoneyBuilder implements Builder { /** + * @var ?int */ private $fractionDigits; /** + * @var ?int */ private $centAmount; /** + * @var ?string */ private $currencyCode; /** + * @var ?int */ private $preciseAmount; /** + * @return null|int */ public function getFractionDigits() @@ -49,6 +54,7 @@ public function getFractionDigits() } /** + * @return null|int */ public function getCentAmount() @@ -59,6 +65,7 @@ public function getCentAmount() /** *

    The currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode() @@ -67,6 +74,7 @@ public function getCurrencyCode() } /** + * @return null|int */ public function getPreciseAmount() diff --git a/lib/commercetools-import/src/Models/Common/HighPrecisionMoneyModel.php b/lib/commercetools-import/src/Models/Common/HighPrecisionMoneyModel.php index 76720a662b6..fbdf66a590b 100644 --- a/lib/commercetools-import/src/Models/Common/HighPrecisionMoneyModel.php +++ b/lib/commercetools-import/src/Models/Common/HighPrecisionMoneyModel.php @@ -21,26 +21,31 @@ final class HighPrecisionMoneyModel extends JsonObjectModel implements HighPreci { public const DISCRIMINATOR_VALUE = 'highPrecision'; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $fractionDigits; /** + * * @var ?int */ protected $centAmount; /** + * * @var ?string */ protected $currencyCode; /** + * * @var ?int */ protected $preciseAmount; @@ -53,16 +58,18 @@ public function __construct( ?int $fractionDigits = null, ?int $centAmount = null, ?string $currencyCode = null, - ?int $preciseAmount = null + ?int $preciseAmount = null, + ?string $type = null ) { $this->fractionDigits = $fractionDigits; $this->centAmount = $centAmount; $this->currencyCode = $currencyCode; $this->preciseAmount = $preciseAmount; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -80,6 +87,7 @@ public function getType() } /** + * * @return null|int */ public function getFractionDigits() @@ -97,6 +105,7 @@ public function getFractionDigits() } /** + * * @return null|int */ public function getCentAmount() @@ -116,6 +125,7 @@ public function getCentAmount() /** *

    The currency code compliant to ISO 4217.

    * + * * @return null|string */ public function getCurrencyCode() @@ -133,6 +143,7 @@ public function getCurrencyCode() } /** + * * @return null|int */ public function getPreciseAmount() diff --git a/lib/commercetools-import/src/Models/Common/Image.php b/lib/commercetools-import/src/Models/Common/Image.php index bffd86812fe..ae1dc54a4e7 100644 --- a/lib/commercetools-import/src/Models/Common/Image.php +++ b/lib/commercetools-import/src/Models/Common/Image.php @@ -20,6 +20,7 @@ interface Image extends JsonObject /** *

    URL of the image in its original size. The URL must be unique within a single variant. It can be used to obtain the image in different sizes.

    * + * @return null|string */ public function getUrl(); @@ -27,6 +28,7 @@ public function getUrl(); /** *

    Dimensions of the original image. This can be used by your application, for example, to determine whether the image is large enough to display a zoom view.

    * + * @return null|AssetDimensions */ public function getDimensions(); @@ -34,6 +36,7 @@ public function getDimensions(); /** *

    Custom label that can be used, for example, as an image description.

    * + * @return null|string */ public function getLabel(); diff --git a/lib/commercetools-import/src/Models/Common/ImageBuilder.php b/lib/commercetools-import/src/Models/Common/ImageBuilder.php index 53be481d508..d528e4c7da9 100644 --- a/lib/commercetools-import/src/Models/Common/ImageBuilder.php +++ b/lib/commercetools-import/src/Models/Common/ImageBuilder.php @@ -21,16 +21,19 @@ final class ImageBuilder implements Builder { /** + * @var ?string */ private $url; /** + * @var null|AssetDimensions|AssetDimensionsBuilder */ private $dimensions; /** + * @var ?string */ private $label; @@ -38,6 +41,7 @@ final class ImageBuilder implements Builder /** *

    URL of the image in its original size. The URL must be unique within a single variant. It can be used to obtain the image in different sizes.

    * + * @return null|string */ public function getUrl() @@ -48,6 +52,7 @@ public function getUrl() /** *

    Dimensions of the original image. This can be used by your application, for example, to determine whether the image is large enough to display a zoom view.

    * + * @return null|AssetDimensions */ public function getDimensions() @@ -58,6 +63,7 @@ public function getDimensions() /** *

    Custom label that can be used, for example, as an image description.

    * + * @return null|string */ public function getLabel() diff --git a/lib/commercetools-import/src/Models/Common/ImageModel.php b/lib/commercetools-import/src/Models/Common/ImageModel.php index 2f237495e5d..1ffe9745d1e 100644 --- a/lib/commercetools-import/src/Models/Common/ImageModel.php +++ b/lib/commercetools-import/src/Models/Common/ImageModel.php @@ -20,16 +20,19 @@ final class ImageModel extends JsonObjectModel implements Image { /** + * * @var ?string */ protected $url; /** + * * @var ?AssetDimensions */ protected $dimensions; /** + * * @var ?string */ protected $label; @@ -51,6 +54,7 @@ public function __construct( /** *

    URL of the image in its original size. The URL must be unique within a single variant. It can be used to obtain the image in different sizes.

    * + * * @return null|string */ public function getUrl() @@ -70,6 +74,7 @@ public function getUrl() /** *

    Dimensions of the original image. This can be used by your application, for example, to determine whether the image is large enough to display a zoom view.

    * + * * @return null|AssetDimensions */ public function getDimensions() @@ -90,6 +95,7 @@ public function getDimensions() /** *

    Custom label that can be used, for example, as an image description.

    * + * * @return null|string */ public function getLabel() diff --git a/lib/commercetools-import/src/Models/Common/ImportResource.php b/lib/commercetools-import/src/Models/Common/ImportResource.php index 540e7ace250..b028ff1df81 100644 --- a/lib/commercetools-import/src/Models/Common/ImportResource.php +++ b/lib/commercetools-import/src/Models/Common/ImportResource.php @@ -18,12 +18,16 @@ use Commercetools\Import\Models\Products\ProductImport; use Commercetools\Import\Models\Producttypes\ProductTypeImport; use Commercetools\Import\Models\Productvariants\ProductVariantImport; +use Commercetools\Import\Models\StandalonePrices\StandalonePriceImport; interface ImportResource extends JsonObject { public const FIELD_KEY = 'key'; /** + *

    User-defined unique identifier.

    + * + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-import/src/Models/Common/ImportResourceBuilder.php b/lib/commercetools-import/src/Models/Common/ImportResourceBuilder.php index 6ea40556f6f..825b53f7b88 100644 --- a/lib/commercetools-import/src/Models/Common/ImportResourceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/ImportResourceBuilder.php @@ -29,6 +29,8 @@ use Commercetools\Import\Models\Producttypes\ProductTypeImportBuilder; use Commercetools\Import\Models\Productvariants\ProductVariantImport; use Commercetools\Import\Models\Productvariants\ProductVariantImportBuilder; +use Commercetools\Import\Models\StandalonePrices\StandalonePriceImport; +use Commercetools\Import\Models\StandalonePrices\StandalonePriceImportBuilder; use stdClass; /** @@ -37,11 +39,15 @@ final class ImportResourceBuilder implements Builder { /** + * @var ?string */ private $key; /** + *

    User-defined unique identifier.

    + * + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/ImportResourceModel.php b/lib/commercetools-import/src/Models/Common/ImportResourceModel.php index 99d46357275..ebfbc102d76 100644 --- a/lib/commercetools-import/src/Models/Common/ImportResourceModel.php +++ b/lib/commercetools-import/src/Models/Common/ImportResourceModel.php @@ -28,6 +28,8 @@ use Commercetools\Import\Models\Producttypes\ProductTypeImportModel; use Commercetools\Import\Models\Productvariants\ProductVariantImport; use Commercetools\Import\Models\Productvariants\ProductVariantImportModel; +use Commercetools\Import\Models\StandalonePrices\StandalonePriceImport; +use Commercetools\Import\Models\StandalonePrices\StandalonePriceImportModel; use stdClass; /** @@ -36,6 +38,7 @@ final class ImportResourceModel extends JsonObjectModel implements ImportResource { /** + * * @var ?string */ protected $key; @@ -51,6 +54,9 @@ public function __construct( } /** + *

    User-defined unique identifier.

    + * + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/KeyReference.php b/lib/commercetools-import/src/Models/Common/KeyReference.php index 27de0032b1c..0f4a79272f0 100644 --- a/lib/commercetools-import/src/Models/Common/KeyReference.php +++ b/lib/commercetools-import/src/Models/Common/KeyReference.php @@ -18,6 +18,7 @@ interface KeyReference extends JsonObject public const FIELD_TYPE_ID = 'typeId'; /** + * @return null|string */ public function getKey(); @@ -25,6 +26,7 @@ public function getKey(); /** *

    The type of the referenced resource.

    * + * @return null|string */ public function getTypeId(); diff --git a/lib/commercetools-import/src/Models/Common/KeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/KeyReferenceBuilder.php index 157212e2543..369a8fdeef4 100644 --- a/lib/commercetools-import/src/Models/Common/KeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/KeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class KeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/KeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/KeyReferenceModel.php index e39f2f2890a..89268c34718 100644 --- a/lib/commercetools-import/src/Models/Common/KeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/KeyReferenceModel.php @@ -21,11 +21,13 @@ final class KeyReferenceModel extends JsonObjectModel implements KeyReference { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -61,13 +63,15 @@ final class KeyReferenceModel extends JsonObjectModel implements KeyReference * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId; } /** + * * @return null|string */ public function getKey() @@ -87,6 +91,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/LocalizedEnumValue.php b/lib/commercetools-import/src/Models/Common/LocalizedEnumValue.php index 957590864bc..2670f854cf3 100644 --- a/lib/commercetools-import/src/Models/Common/LocalizedEnumValue.php +++ b/lib/commercetools-import/src/Models/Common/LocalizedEnumValue.php @@ -17,6 +17,7 @@ interface LocalizedEnumValue extends JsonObject public const FIELD_LABEL = 'label'; /** + * @return null|string */ public function getKey(); @@ -29,6 +30,7 @@ public function getKey(); * } * * + * @return null|LocalizedString */ public function getLabel(); diff --git a/lib/commercetools-import/src/Models/Common/LocalizedEnumValueBuilder.php b/lib/commercetools-import/src/Models/Common/LocalizedEnumValueBuilder.php index ee5b8c08d94..ac4ace3cf9c 100644 --- a/lib/commercetools-import/src/Models/Common/LocalizedEnumValueBuilder.php +++ b/lib/commercetools-import/src/Models/Common/LocalizedEnumValueBuilder.php @@ -21,16 +21,19 @@ final class LocalizedEnumValueBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; /** + * @return null|string */ public function getKey() @@ -46,6 +49,7 @@ public function getKey() * } * * + * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-import/src/Models/Common/LocalizedEnumValueModel.php b/lib/commercetools-import/src/Models/Common/LocalizedEnumValueModel.php index 9949d710e04..8570a4d0660 100644 --- a/lib/commercetools-import/src/Models/Common/LocalizedEnumValueModel.php +++ b/lib/commercetools-import/src/Models/Common/LocalizedEnumValueModel.php @@ -20,11 +20,13 @@ final class LocalizedEnumValueModel extends JsonObjectModel implements LocalizedEnumValue { /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $label; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|string */ public function getKey() @@ -66,6 +69,7 @@ public function getKey() * } * * + * * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-import/src/Models/Common/MoneyBuilder.php b/lib/commercetools-import/src/Models/Common/MoneyBuilder.php index 0f57d64a3c5..95c72e0c895 100644 --- a/lib/commercetools-import/src/Models/Common/MoneyBuilder.php +++ b/lib/commercetools-import/src/Models/Common/MoneyBuilder.php @@ -21,21 +21,25 @@ final class MoneyBuilder implements Builder { /** + * @var ?int */ private $fractionDigits; /** + * @var ?int */ private $centAmount; /** + * @var ?string */ private $currencyCode; /** + * @return null|int */ public function getFractionDigits() @@ -44,6 +48,7 @@ public function getFractionDigits() } /** + * @return null|int */ public function getCentAmount() @@ -54,6 +59,7 @@ public function getCentAmount() /** *

    The currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode() diff --git a/lib/commercetools-import/src/Models/Common/MoneyModel.php b/lib/commercetools-import/src/Models/Common/MoneyModel.php index 404e767c527..b644958212e 100644 --- a/lib/commercetools-import/src/Models/Common/MoneyModel.php +++ b/lib/commercetools-import/src/Models/Common/MoneyModel.php @@ -21,21 +21,25 @@ final class MoneyModel extends JsonObjectModel implements Money { public const DISCRIMINATOR_VALUE = 'centPrecision'; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $fractionDigits; /** + * * @var ?int */ protected $centAmount; /** + * * @var ?string */ protected $currencyCode; @@ -47,15 +51,17 @@ final class MoneyModel extends JsonObjectModel implements Money public function __construct( ?int $fractionDigits = null, ?int $centAmount = null, - ?string $currencyCode = null + ?string $currencyCode = null, + ?string $type = null ) { $this->fractionDigits = $fractionDigits; $this->centAmount = $centAmount; $this->currencyCode = $currencyCode; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -73,6 +79,7 @@ public function getType() } /** + * * @return null|int */ public function getFractionDigits() @@ -90,6 +97,7 @@ public function getFractionDigits() } /** + * * @return null|int */ public function getCentAmount() @@ -109,6 +117,7 @@ public function getCentAmount() /** *

    The currency code compliant to ISO 4217.

    * + * * @return null|string */ public function getCurrencyCode() diff --git a/lib/commercetools-import/src/Models/Common/OrderKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/OrderKeyReferenceBuilder.php index 5cb4262c9d3..4ef38fe4833 100644 --- a/lib/commercetools-import/src/Models/Common/OrderKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/OrderKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class OrderKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/OrderKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/OrderKeyReferenceModel.php index 511cdc273a2..1b9af3c03cd 100644 --- a/lib/commercetools-import/src/Models/Common/OrderKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/OrderKeyReferenceModel.php @@ -21,11 +21,13 @@ final class OrderKeyReferenceModel extends JsonObjectModel implements OrderKeyRe { public const DISCRIMINATOR_VALUE = 'order'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class OrderKeyReferenceModel extends JsonObjectModel implements OrderKeyRe * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/PaymentKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/PaymentKeyReferenceBuilder.php index 8047cef58f2..5924c4b0028 100644 --- a/lib/commercetools-import/src/Models/Common/PaymentKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/PaymentKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class PaymentKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/PaymentKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/PaymentKeyReferenceModel.php index 80e1955571e..e7f17e84dbf 100644 --- a/lib/commercetools-import/src/Models/Common/PaymentKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/PaymentKeyReferenceModel.php @@ -21,11 +21,13 @@ final class PaymentKeyReferenceModel extends JsonObjectModel implements PaymentK { public const DISCRIMINATOR_VALUE = 'payment'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class PaymentKeyReferenceModel extends JsonObjectModel implements PaymentK * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/PriceKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/PriceKeyReferenceBuilder.php index 49c85822096..ff3f9b68ed2 100644 --- a/lib/commercetools-import/src/Models/Common/PriceKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/PriceKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class PriceKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/PriceKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/PriceKeyReferenceModel.php index fea1cf66a09..35f77ee8d67 100644 --- a/lib/commercetools-import/src/Models/Common/PriceKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/PriceKeyReferenceModel.php @@ -21,11 +21,13 @@ final class PriceKeyReferenceModel extends JsonObjectModel implements PriceKeyRe { public const DISCRIMINATOR_VALUE = 'price'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class PriceKeyReferenceModel extends JsonObjectModel implements PriceKeyRe * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/PriceTier.php b/lib/commercetools-import/src/Models/Common/PriceTier.php index 63f7fe69c93..f619a603e65 100644 --- a/lib/commercetools-import/src/Models/Common/PriceTier.php +++ b/lib/commercetools-import/src/Models/Common/PriceTier.php @@ -19,6 +19,7 @@ interface PriceTier extends JsonObject /** *

    The minimum quantity this price tier is valid for.

    * + * @return null|int */ public function getMinimumQuantity(); @@ -26,6 +27,7 @@ public function getMinimumQuantity(); /** *

    The currency of a price tier is always the same as the currency of the base Price.

    * + * @return null|TypedMoney */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Common/PriceTierBuilder.php b/lib/commercetools-import/src/Models/Common/PriceTierBuilder.php index 728cf8005ad..ebb1b86b275 100644 --- a/lib/commercetools-import/src/Models/Common/PriceTierBuilder.php +++ b/lib/commercetools-import/src/Models/Common/PriceTierBuilder.php @@ -21,11 +21,13 @@ final class PriceTierBuilder implements Builder { /** + * @var ?int */ private $minimumQuantity; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $value; @@ -33,6 +35,7 @@ final class PriceTierBuilder implements Builder /** *

    The minimum quantity this price tier is valid for.

    * + * @return null|int */ public function getMinimumQuantity() @@ -43,6 +46,7 @@ public function getMinimumQuantity() /** *

    The currency of a price tier is always the same as the currency of the base Price.

    * + * @return null|TypedMoney */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Common/PriceTierModel.php b/lib/commercetools-import/src/Models/Common/PriceTierModel.php index d87ac6befeb..8862632315a 100644 --- a/lib/commercetools-import/src/Models/Common/PriceTierModel.php +++ b/lib/commercetools-import/src/Models/Common/PriceTierModel.php @@ -20,11 +20,13 @@ final class PriceTierModel extends JsonObjectModel implements PriceTier { /** + * * @var ?int */ protected $minimumQuantity; /** + * * @var ?TypedMoney */ protected $value; @@ -44,6 +46,7 @@ public function __construct( /** *

    The minimum quantity this price tier is valid for.

    * + * * @return null|int */ public function getMinimumQuantity() @@ -63,6 +66,7 @@ public function getMinimumQuantity() /** *

    The currency of a price tier is always the same as the currency of the base Price.

    * + * * @return null|TypedMoney */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Common/ProductDiscountKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/ProductDiscountKeyReferenceBuilder.php index cacce841832..9b1799670e5 100644 --- a/lib/commercetools-import/src/Models/Common/ProductDiscountKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/ProductDiscountKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class ProductDiscountKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/ProductDiscountKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/ProductDiscountKeyReferenceModel.php index 86e5dc4366a..827df92855b 100644 --- a/lib/commercetools-import/src/Models/Common/ProductDiscountKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/ProductDiscountKeyReferenceModel.php @@ -21,11 +21,13 @@ final class ProductDiscountKeyReferenceModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'product-discount'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class ProductDiscountKeyReferenceModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/ProductKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/ProductKeyReferenceBuilder.php index 33f6dd3d9a6..24c9e7ba0c6 100644 --- a/lib/commercetools-import/src/Models/Common/ProductKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/ProductKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class ProductKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/ProductKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/ProductKeyReferenceModel.php index b52cd7c800d..86d55ae21b3 100644 --- a/lib/commercetools-import/src/Models/Common/ProductKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/ProductKeyReferenceModel.php @@ -21,11 +21,13 @@ final class ProductKeyReferenceModel extends JsonObjectModel implements ProductK { public const DISCRIMINATOR_VALUE = 'product'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class ProductKeyReferenceModel extends JsonObjectModel implements ProductK * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/ProductTypeKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/ProductTypeKeyReferenceBuilder.php index 70e5e60a492..10022feb84b 100644 --- a/lib/commercetools-import/src/Models/Common/ProductTypeKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/ProductTypeKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class ProductTypeKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/ProductTypeKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/ProductTypeKeyReferenceModel.php index a0e6c688dde..8b1a40202b7 100644 --- a/lib/commercetools-import/src/Models/Common/ProductTypeKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/ProductTypeKeyReferenceModel.php @@ -21,11 +21,13 @@ final class ProductTypeKeyReferenceModel extends JsonObjectModel implements Prod { public const DISCRIMINATOR_VALUE = 'product-type'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class ProductTypeKeyReferenceModel extends JsonObjectModel implements Prod * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/ProductVariantKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/ProductVariantKeyReferenceBuilder.php index 4d7e15ce41d..1e647cb3e83 100644 --- a/lib/commercetools-import/src/Models/Common/ProductVariantKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/ProductVariantKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class ProductVariantKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/ProductVariantKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/ProductVariantKeyReferenceModel.php index a07caf0450b..599e8474730 100644 --- a/lib/commercetools-import/src/Models/Common/ProductVariantKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/ProductVariantKeyReferenceModel.php @@ -21,11 +21,13 @@ final class ProductVariantKeyReferenceModel extends JsonObjectModel implements P { public const DISCRIMINATOR_VALUE = 'product-variant'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class ProductVariantKeyReferenceModel extends JsonObjectModel implements P * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/ShippingMethodKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/ShippingMethodKeyReferenceBuilder.php index ce9bb3b3bfb..ea31540aeeb 100644 --- a/lib/commercetools-import/src/Models/Common/ShippingMethodKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/ShippingMethodKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class ShippingMethodKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/ShippingMethodKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/ShippingMethodKeyReferenceModel.php index 8a40984cb62..325e1b5ac09 100644 --- a/lib/commercetools-import/src/Models/Common/ShippingMethodKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/ShippingMethodKeyReferenceModel.php @@ -21,11 +21,13 @@ final class ShippingMethodKeyReferenceModel extends JsonObjectModel implements S { public const DISCRIMINATOR_VALUE = 'shipping-method'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class ShippingMethodKeyReferenceModel extends JsonObjectModel implements S * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/StateKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/StateKeyReferenceBuilder.php index 664f980ae31..14ddd94f336 100644 --- a/lib/commercetools-import/src/Models/Common/StateKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/StateKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class StateKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/StateKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/StateKeyReferenceModel.php index 5e6bf354904..d7ebdb4c810 100644 --- a/lib/commercetools-import/src/Models/Common/StateKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/StateKeyReferenceModel.php @@ -21,11 +21,13 @@ final class StateKeyReferenceModel extends JsonObjectModel implements StateKeyRe { public const DISCRIMINATOR_VALUE = 'state'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class StateKeyReferenceModel extends JsonObjectModel implements StateKeyRe * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/StoreKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/StoreKeyReferenceBuilder.php index fba0c767dde..22432c936fa 100644 --- a/lib/commercetools-import/src/Models/Common/StoreKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/StoreKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class StoreKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/StoreKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/StoreKeyReferenceModel.php index f414eb1cdd0..c2b6221b7bb 100644 --- a/lib/commercetools-import/src/Models/Common/StoreKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/StoreKeyReferenceModel.php @@ -21,11 +21,13 @@ final class StoreKeyReferenceModel extends JsonObjectModel implements StoreKeyRe { public const DISCRIMINATOR_VALUE = 'store'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class StoreKeyReferenceModel extends JsonObjectModel implements StoreKeyRe * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/TaxCategoryKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/TaxCategoryKeyReferenceBuilder.php index 2a4007c2bc0..8fe20240ef1 100644 --- a/lib/commercetools-import/src/Models/Common/TaxCategoryKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/TaxCategoryKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class TaxCategoryKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/TaxCategoryKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/TaxCategoryKeyReferenceModel.php index a7b6583d070..9fcd090eccd 100644 --- a/lib/commercetools-import/src/Models/Common/TaxCategoryKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/TaxCategoryKeyReferenceModel.php @@ -21,11 +21,13 @@ final class TaxCategoryKeyReferenceModel extends JsonObjectModel implements TaxC { public const DISCRIMINATOR_VALUE = 'tax-category'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class TaxCategoryKeyReferenceModel extends JsonObjectModel implements TaxC * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/TypeKeyReferenceBuilder.php b/lib/commercetools-import/src/Models/Common/TypeKeyReferenceBuilder.php index 34f3b181caf..c19189e8756 100644 --- a/lib/commercetools-import/src/Models/Common/TypeKeyReferenceBuilder.php +++ b/lib/commercetools-import/src/Models/Common/TypeKeyReferenceBuilder.php @@ -21,11 +21,13 @@ final class TypeKeyReferenceBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Common/TypeKeyReferenceModel.php b/lib/commercetools-import/src/Models/Common/TypeKeyReferenceModel.php index 840389e528c..f80bc8aa6d4 100644 --- a/lib/commercetools-import/src/Models/Common/TypeKeyReferenceModel.php +++ b/lib/commercetools-import/src/Models/Common/TypeKeyReferenceModel.php @@ -21,11 +21,13 @@ final class TypeKeyReferenceModel extends JsonObjectModel implements TypeKeyRefe { public const DISCRIMINATOR_VALUE = 'type'; /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -35,13 +37,15 @@ final class TypeKeyReferenceModel extends JsonObjectModel implements TypeKeyRefe * @psalm-suppress MissingParamType */ public function __construct( - ?string $key = null + ?string $key = null, + ?string $typeId = null ) { $this->key = $key; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getKey() @@ -61,6 +65,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/TypedMoney.php b/lib/commercetools-import/src/Models/Common/TypedMoney.php index 92c80ccab69..5780c416f13 100644 --- a/lib/commercetools-import/src/Models/Common/TypedMoney.php +++ b/lib/commercetools-import/src/Models/Common/TypedMoney.php @@ -20,16 +20,19 @@ interface TypedMoney extends JsonObject public const FIELD_CURRENCY_CODE = 'currencyCode'; /** + * @return null|string */ public function getType(); /** + * @return null|int */ public function getFractionDigits(); /** + * @return null|int */ public function getCentAmount(); @@ -37,6 +40,7 @@ public function getCentAmount(); /** *

    The currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode(); diff --git a/lib/commercetools-import/src/Models/Common/TypedMoneyBuilder.php b/lib/commercetools-import/src/Models/Common/TypedMoneyBuilder.php index 82f3b4d2204..794325bb2e3 100644 --- a/lib/commercetools-import/src/Models/Common/TypedMoneyBuilder.php +++ b/lib/commercetools-import/src/Models/Common/TypedMoneyBuilder.php @@ -21,21 +21,25 @@ final class TypedMoneyBuilder implements Builder { /** + * @var ?int */ private $fractionDigits; /** + * @var ?int */ private $centAmount; /** + * @var ?string */ private $currencyCode; /** + * @return null|int */ public function getFractionDigits() @@ -44,6 +48,7 @@ public function getFractionDigits() } /** + * @return null|int */ public function getCentAmount() @@ -54,6 +59,7 @@ public function getCentAmount() /** *

    The currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode() diff --git a/lib/commercetools-import/src/Models/Common/TypedMoneyModel.php b/lib/commercetools-import/src/Models/Common/TypedMoneyModel.php index fa341c2b252..c4701951fed 100644 --- a/lib/commercetools-import/src/Models/Common/TypedMoneyModel.php +++ b/lib/commercetools-import/src/Models/Common/TypedMoneyModel.php @@ -21,21 +21,25 @@ final class TypedMoneyModel extends JsonObjectModel implements TypedMoney { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; /** + * * @var ?int */ protected $fractionDigits; /** + * * @var ?int */ protected $centAmount; /** + * * @var ?string */ protected $currencyCode; @@ -55,15 +59,17 @@ final class TypedMoneyModel extends JsonObjectModel implements TypedMoney public function __construct( ?int $fractionDigits = null, ?int $centAmount = null, - ?string $currencyCode = null + ?string $currencyCode = null, + ?string $type = null ) { $this->fractionDigits = $fractionDigits; $this->centAmount = $centAmount; $this->currencyCode = $currencyCode; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() @@ -81,6 +87,7 @@ public function getType() } /** + * * @return null|int */ public function getFractionDigits() @@ -98,6 +105,7 @@ public function getFractionDigits() } /** + * * @return null|int */ public function getCentAmount() @@ -117,6 +125,7 @@ public function getCentAmount() /** *

    The currency code compliant to ISO 4217.

    * + * * @return null|string */ public function getCurrencyCode() diff --git a/lib/commercetools-import/src/Models/Common/UnresolvedReferences.php b/lib/commercetools-import/src/Models/Common/UnresolvedReferences.php index 7e07187bb2a..aefb95aa682 100644 --- a/lib/commercetools-import/src/Models/Common/UnresolvedReferences.php +++ b/lib/commercetools-import/src/Models/Common/UnresolvedReferences.php @@ -17,6 +17,7 @@ interface UnresolvedReferences extends JsonObject public const FIELD_TYPE_ID = 'typeId'; /** + * @return null|string */ public function getKey(); @@ -24,6 +25,7 @@ public function getKey(); /** *

    The type of the referenced resource.

    * + * @return null|string */ public function getTypeId(); diff --git a/lib/commercetools-import/src/Models/Common/UnresolvedReferencesBuilder.php b/lib/commercetools-import/src/Models/Common/UnresolvedReferencesBuilder.php index 945b381eafb..a066bb969b6 100644 --- a/lib/commercetools-import/src/Models/Common/UnresolvedReferencesBuilder.php +++ b/lib/commercetools-import/src/Models/Common/UnresolvedReferencesBuilder.php @@ -21,16 +21,19 @@ final class UnresolvedReferencesBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $typeId; /** + * @return null|string */ public function getKey() @@ -41,6 +44,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Common/UnresolvedReferencesModel.php b/lib/commercetools-import/src/Models/Common/UnresolvedReferencesModel.php index b41f9d60125..f1c05d1a68f 100644 --- a/lib/commercetools-import/src/Models/Common/UnresolvedReferencesModel.php +++ b/lib/commercetools-import/src/Models/Common/UnresolvedReferencesModel.php @@ -20,11 +20,13 @@ final class UnresolvedReferencesModel extends JsonObjectModel implements UnresolvedReferences { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $typeId; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|string */ public function getKey() @@ -61,6 +64,7 @@ public function getKey() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getTypeId() diff --git a/lib/commercetools-import/src/Models/Customers/CustomerAddress.php b/lib/commercetools-import/src/Models/Customers/CustomerAddress.php index 4cde9db8250..735aab0593e 100644 --- a/lib/commercetools-import/src/Models/Customers/CustomerAddress.php +++ b/lib/commercetools-import/src/Models/Customers/CustomerAddress.php @@ -10,6 +10,7 @@ use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; +use Commercetools\Import\Models\Customfields\Custom; interface CustomerAddress extends JsonObject { @@ -37,66 +38,79 @@ interface CustomerAddress extends JsonObject public const FIELD_FAX = 'fax'; public const FIELD_ADDITIONAL_ADDRESS_INFO = 'additionalAddressInfo'; public const FIELD_EXTERNAL_ID = 'externalId'; + public const FIELD_CUSTOM = 'custom'; /** *

    User-defined identifier for the address. * Must follow the pattern [a-zA-Z0-9_-]{2,256} and must be unique per customer.

    * + * @return null|string */ public function getKey(); /** + * @return null|string */ public function getTitle(); /** + * @return null|string */ public function getSalutation(); /** + * @return null|string */ public function getFirstName(); /** + * @return null|string */ public function getLastName(); /** + * @return null|string */ public function getStreetName(); /** + * @return null|string */ public function getStreetNumber(); /** + * @return null|string */ public function getAdditionalStreetInfo(); /** + * @return null|string */ public function getPostalCode(); /** + * @return null|string */ public function getCity(); /** + * @return null|string */ public function getRegion(); /** + * @return null|string */ public function getState(); @@ -104,65 +118,85 @@ public function getState(); /** *

    A two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry(); /** + * @return null|string */ public function getCompany(); /** + * @return null|string */ public function getDepartment(); /** + * @return null|string */ public function getBuilding(); /** + * @return null|string */ public function getApartment(); /** + * @return null|string */ public function getPOBox(); /** + * @return null|string */ public function getPhone(); /** + * @return null|string */ public function getMobile(); /** + * @return null|string */ public function getEmail(); /** + * @return null|string */ public function getFax(); /** + * @return null|string */ public function getAdditionalAddressInfo(); /** + * @return null|string */ public function getExternalId(); + /** + *

    Custom Fields for the address.

    + * + + * @return null|Custom + */ + public function getCustom(); + /** * @param ?string $key */ @@ -282,4 +316,9 @@ public function setAdditionalAddressInfo(?string $additionalAddressInfo): void; * @param ?string $externalId */ public function setExternalId(?string $externalId): void; + + /** + * @param ?Custom $custom + */ + public function setCustom(?Custom $custom): void; } diff --git a/lib/commercetools-import/src/Models/Customers/CustomerAddressBuilder.php b/lib/commercetools-import/src/Models/Customers/CustomerAddressBuilder.php index cf5cec28e0b..3ff77bc84a0 100644 --- a/lib/commercetools-import/src/Models/Customers/CustomerAddressBuilder.php +++ b/lib/commercetools-import/src/Models/Customers/CustomerAddressBuilder.php @@ -13,6 +13,8 @@ use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; use Commercetools\Base\MapperFactory; +use Commercetools\Import\Models\Customfields\Custom; +use Commercetools\Import\Models\Customfields\CustomBuilder; use stdClass; /** @@ -21,129 +23,160 @@ final class CustomerAddressBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $title; /** + * @var ?string */ private $salutation; /** + * @var ?string */ private $firstName; /** + * @var ?string */ private $lastName; /** + * @var ?string */ private $streetName; /** + * @var ?string */ private $streetNumber; /** + * @var ?string */ private $additionalStreetInfo; /** + * @var ?string */ private $postalCode; /** + * @var ?string */ private $city; /** + * @var ?string */ private $region; /** + * @var ?string */ private $state; /** + * @var ?string */ private $country; /** + * @var ?string */ private $company; /** + * @var ?string */ private $department; /** + * @var ?string */ private $building; /** + * @var ?string */ private $apartment; /** + * @var ?string */ private $pOBox; /** + * @var ?string */ private $phone; /** + * @var ?string */ private $mobile; /** + * @var ?string */ private $email; /** + * @var ?string */ private $fax; /** + * @var ?string */ private $additionalAddressInfo; /** + * @var ?string */ private $externalId; + /** + + * @var null|Custom|CustomBuilder + */ + private $custom; + /** *

    User-defined identifier for the address. * Must follow the pattern [a-zA-Z0-9_-]{2,256} and must be unique per customer.

    * + * @return null|string */ public function getKey() @@ -152,6 +185,7 @@ public function getKey() } /** + * @return null|string */ public function getTitle() @@ -160,6 +194,7 @@ public function getTitle() } /** + * @return null|string */ public function getSalutation() @@ -168,6 +203,7 @@ public function getSalutation() } /** + * @return null|string */ public function getFirstName() @@ -176,6 +212,7 @@ public function getFirstName() } /** + * @return null|string */ public function getLastName() @@ -184,6 +221,7 @@ public function getLastName() } /** + * @return null|string */ public function getStreetName() @@ -192,6 +230,7 @@ public function getStreetName() } /** + * @return null|string */ public function getStreetNumber() @@ -200,6 +239,7 @@ public function getStreetNumber() } /** + * @return null|string */ public function getAdditionalStreetInfo() @@ -208,6 +248,7 @@ public function getAdditionalStreetInfo() } /** + * @return null|string */ public function getPostalCode() @@ -216,6 +257,7 @@ public function getPostalCode() } /** + * @return null|string */ public function getCity() @@ -224,6 +266,7 @@ public function getCity() } /** + * @return null|string */ public function getRegion() @@ -232,6 +275,7 @@ public function getRegion() } /** + * @return null|string */ public function getState() @@ -242,6 +286,7 @@ public function getState() /** *

    A two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry() @@ -250,6 +295,7 @@ public function getCountry() } /** + * @return null|string */ public function getCompany() @@ -258,6 +304,7 @@ public function getCompany() } /** + * @return null|string */ public function getDepartment() @@ -266,6 +313,7 @@ public function getDepartment() } /** + * @return null|string */ public function getBuilding() @@ -274,6 +322,7 @@ public function getBuilding() } /** + * @return null|string */ public function getApartment() @@ -282,6 +331,7 @@ public function getApartment() } /** + * @return null|string */ public function getPOBox() @@ -290,6 +340,7 @@ public function getPOBox() } /** + * @return null|string */ public function getPhone() @@ -298,6 +349,7 @@ public function getPhone() } /** + * @return null|string */ public function getMobile() @@ -306,6 +358,7 @@ public function getMobile() } /** + * @return null|string */ public function getEmail() @@ -314,6 +367,7 @@ public function getEmail() } /** + * @return null|string */ public function getFax() @@ -322,6 +376,7 @@ public function getFax() } /** + * @return null|string */ public function getAdditionalAddressInfo() @@ -330,6 +385,7 @@ public function getAdditionalAddressInfo() } /** + * @return null|string */ public function getExternalId() @@ -337,6 +393,17 @@ public function getExternalId() return $this->externalId; } + /** + *

    Custom Fields for the address.

    + * + + * @return null|Custom + */ + public function getCustom() + { + return $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom; + } + /** * @param ?string $key * @return $this @@ -601,6 +668,27 @@ public function withExternalId(?string $externalId) return $this; } + /** + * @param ?Custom $custom + * @return $this + */ + public function withCustom(?Custom $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomBuilder $custom) + { + $this->custom = $custom; + + return $this; + } public function build(): CustomerAddress { @@ -628,7 +716,8 @@ public function build(): CustomerAddress $this->email, $this->fax, $this->additionalAddressInfo, - $this->externalId + $this->externalId, + $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-import/src/Models/Customers/CustomerAddressModel.php b/lib/commercetools-import/src/Models/Customers/CustomerAddressModel.php index 6a369edbe02..0d4d79cec5b 100644 --- a/lib/commercetools-import/src/Models/Customers/CustomerAddressModel.php +++ b/lib/commercetools-import/src/Models/Customers/CustomerAddressModel.php @@ -12,6 +12,8 @@ use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; use Commercetools\Base\MapperFactory; +use Commercetools\Import\Models\Customfields\Custom; +use Commercetools\Import\Models\Customfields\CustomModel; use stdClass; /** @@ -20,125 +22,155 @@ final class CustomerAddressModel extends JsonObjectModel implements CustomerAddress { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $title; /** + * * @var ?string */ protected $salutation; /** + * * @var ?string */ protected $firstName; /** + * * @var ?string */ protected $lastName; /** + * * @var ?string */ protected $streetName; /** + * * @var ?string */ protected $streetNumber; /** + * * @var ?string */ protected $additionalStreetInfo; /** + * * @var ?string */ protected $postalCode; /** + * * @var ?string */ protected $city; /** + * * @var ?string */ protected $region; /** + * * @var ?string */ protected $state; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $company; /** + * * @var ?string */ protected $department; /** + * * @var ?string */ protected $building; /** + * * @var ?string */ protected $apartment; /** + * * @var ?string */ protected $pOBox; /** + * * @var ?string */ protected $phone; /** + * * @var ?string */ protected $mobile; /** + * * @var ?string */ protected $email; /** + * * @var ?string */ protected $fax; /** + * * @var ?string */ protected $additionalAddressInfo; /** + * * @var ?string */ protected $externalId; + /** + * + * @var ?Custom + */ + protected $custom; + /** * @psalm-suppress MissingParamType @@ -167,7 +199,8 @@ public function __construct( ?string $email = null, ?string $fax = null, ?string $additionalAddressInfo = null, - ?string $externalId = null + ?string $externalId = null, + ?Custom $custom = null ) { $this->key = $key; $this->title = $title; @@ -193,12 +226,14 @@ public function __construct( $this->fax = $fax; $this->additionalAddressInfo = $additionalAddressInfo; $this->externalId = $externalId; + $this->custom = $custom; } /** *

    User-defined identifier for the address. * Must follow the pattern [a-zA-Z0-9_-]{2,256} and must be unique per customer.

    * + * * @return null|string */ public function getKey() @@ -216,6 +251,7 @@ public function getKey() } /** + * * @return null|string */ public function getTitle() @@ -233,6 +269,7 @@ public function getTitle() } /** + * * @return null|string */ public function getSalutation() @@ -250,6 +287,7 @@ public function getSalutation() } /** + * * @return null|string */ public function getFirstName() @@ -267,6 +305,7 @@ public function getFirstName() } /** + * * @return null|string */ public function getLastName() @@ -284,6 +323,7 @@ public function getLastName() } /** + * * @return null|string */ public function getStreetName() @@ -301,6 +341,7 @@ public function getStreetName() } /** + * * @return null|string */ public function getStreetNumber() @@ -318,6 +359,7 @@ public function getStreetNumber() } /** + * * @return null|string */ public function getAdditionalStreetInfo() @@ -335,6 +377,7 @@ public function getAdditionalStreetInfo() } /** + * * @return null|string */ public function getPostalCode() @@ -352,6 +395,7 @@ public function getPostalCode() } /** + * * @return null|string */ public function getCity() @@ -369,6 +413,7 @@ public function getCity() } /** + * * @return null|string */ public function getRegion() @@ -386,6 +431,7 @@ public function getRegion() } /** + * * @return null|string */ public function getState() @@ -405,6 +451,7 @@ public function getState() /** *

    A two-digit country code as per ISO 3166-1 alpha-2.

    * + * * @return null|string */ public function getCountry() @@ -422,6 +469,7 @@ public function getCountry() } /** + * * @return null|string */ public function getCompany() @@ -439,6 +487,7 @@ public function getCompany() } /** + * * @return null|string */ public function getDepartment() @@ -456,6 +505,7 @@ public function getDepartment() } /** + * * @return null|string */ public function getBuilding() @@ -473,6 +523,7 @@ public function getBuilding() } /** + * * @return null|string */ public function getApartment() @@ -490,6 +541,7 @@ public function getApartment() } /** + * * @return null|string */ public function getPOBox() @@ -507,6 +559,7 @@ public function getPOBox() } /** + * * @return null|string */ public function getPhone() @@ -524,6 +577,7 @@ public function getPhone() } /** + * * @return null|string */ public function getMobile() @@ -541,6 +595,7 @@ public function getMobile() } /** + * * @return null|string */ public function getEmail() @@ -558,6 +613,7 @@ public function getEmail() } /** + * * @return null|string */ public function getFax() @@ -575,6 +631,7 @@ public function getFax() } /** + * * @return null|string */ public function getAdditionalAddressInfo() @@ -592,6 +649,7 @@ public function getAdditionalAddressInfo() } /** + * * @return null|string */ public function getExternalId() @@ -608,6 +666,27 @@ public function getExternalId() return $this->externalId; } + /** + *

    Custom Fields for the address.

    + * + * + * @return null|Custom + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomModel::of($data); + } + + return $this->custom; + } + /** * @param ?string $key @@ -800,4 +879,12 @@ public function setExternalId(?string $externalId): void { $this->externalId = $externalId; } + + /** + * @param ?Custom $custom + */ + public function setCustom(?Custom $custom): void + { + $this->custom = $custom; + } } diff --git a/lib/commercetools-import/src/Models/Customers/CustomerImport.php b/lib/commercetools-import/src/Models/Customers/CustomerImport.php index e28dcfd64e7..66eb88956b0 100644 --- a/lib/commercetools-import/src/Models/Customers/CustomerImport.php +++ b/lib/commercetools-import/src/Models/Customers/CustomerImport.php @@ -44,6 +44,7 @@ interface CustomerImport extends ImportResource /** *

    Maps to Customer.customerNumber.

    * + * @return null|string */ public function getCustomerNumber(); @@ -51,6 +52,7 @@ public function getCustomerNumber(); /** *

    Maps to Customer.email.

    * + * @return null|string */ public function getEmail(); @@ -58,6 +60,7 @@ public function getEmail(); /** *

    Maps to Customer.password.

    * + * @return null|string */ public function getPassword(); @@ -65,6 +68,7 @@ public function getPassword(); /** *

    The References to the Stores with which the Customer is associated. If referenced Stores do not exist, the state of the ImportOperation will be set to unresolved until the necessary Stores are created.

    * + * @return null|StoreKeyReferenceCollection */ public function getStores(); @@ -72,6 +76,7 @@ public function getStores(); /** *

    Maps to Customer.firstName.

    * + * @return null|string */ public function getFirstName(); @@ -79,6 +84,7 @@ public function getFirstName(); /** *

    Maps to Customer.lastName.

    * + * @return null|string */ public function getLastName(); @@ -86,6 +92,7 @@ public function getLastName(); /** *

    Maps to Customer.middleName.

    * + * @return null|string */ public function getMiddleName(); @@ -93,6 +100,7 @@ public function getMiddleName(); /** *

    Maps to Customer.title.

    * + * @return null|string */ public function getTitle(); @@ -100,6 +108,7 @@ public function getTitle(); /** *

    Maps to Customer.salutation.

    * + * @return null|string */ public function getSalutation(); @@ -107,6 +116,7 @@ public function getSalutation(); /** *

    Maps to Customer.externalId.

    * + * @return null|string */ public function getExternalId(); @@ -114,6 +124,7 @@ public function getExternalId(); /** *

    Maps to Customer.dateOfBirth.

    * + * @return null|DateTimeImmutable */ public function getDateOfBirth(); @@ -121,6 +132,7 @@ public function getDateOfBirth(); /** *

    Maps to Customer.companyName.

    * + * @return null|string */ public function getCompanyName(); @@ -128,6 +140,7 @@ public function getCompanyName(); /** *

    Maps to Customer.vatId.

    * + * @return null|string */ public function getVatId(); @@ -135,6 +148,7 @@ public function getVatId(); /** *

    Maps to Customer.isEmailVerified.

    * + * @return null|bool */ public function getIsEmailVerified(); @@ -143,6 +157,7 @@ public function getIsEmailVerified(); *

    The Reference to the CustomerGroup with which the Customer is associated. * If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary CustomerGroup is created.

    * + * @return null|CustomerGroupKeyReference */ public function getCustomerGroup(); @@ -150,6 +165,7 @@ public function getCustomerGroup(); /** *

    Maps to Customer.addresses.

    * + * @return null|CustomerAddressCollection */ public function getAddresses(); @@ -157,6 +173,7 @@ public function getAddresses(); /** *

    The index of the address in the addresses array. The defaultBillingAddressId of the customer will be set to the ID of that address.

    * + * @return null|int */ public function getDefaultBillingAddress(); @@ -164,6 +181,7 @@ public function getDefaultBillingAddress(); /** *

    The indices of the billing addresses in the addresses array. The billingAddressIds of the customer will be set to the IDs of that addresses.

    * + * @return null|array */ public function getBillingAddresses(); @@ -171,6 +189,7 @@ public function getBillingAddresses(); /** *

    The index of the address in the addresses array. The defaultShippingAddressId of the customer will be set to the ID of that address.

    * + * @return null|int */ public function getDefaultShippingAddress(); @@ -178,6 +197,7 @@ public function getDefaultShippingAddress(); /** *

    The indices of the shipping addresses in the addresses array. The shippingAddressIds of the customer will be set to the IDs of that addresses.

    * + * @return null|array */ public function getShippingAddresses(); @@ -185,6 +205,7 @@ public function getShippingAddresses(); /** *

    Maps to Customer.locale.

    * + * @return null|string */ public function getLocale(); @@ -192,6 +213,7 @@ public function getLocale(); /** *

    The custom fields for this Customer.

    * + * @return null|Custom */ public function getCustom(); diff --git a/lib/commercetools-import/src/Models/Customers/CustomerImportBuilder.php b/lib/commercetools-import/src/Models/Customers/CustomerImportBuilder.php index bc02ee0d8d7..da815935da0 100644 --- a/lib/commercetools-import/src/Models/Customers/CustomerImportBuilder.php +++ b/lib/commercetools-import/src/Models/Customers/CustomerImportBuilder.php @@ -29,121 +29,147 @@ final class CustomerImportBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $customerNumber; /** + * @var ?string */ private $email; /** + * @var ?string */ private $password; /** + * @var ?StoreKeyReferenceCollection */ private $stores; /** + * @var ?string */ private $firstName; /** + * @var ?string */ private $lastName; /** + * @var ?string */ private $middleName; /** + * @var ?string */ private $title; /** + * @var ?string */ private $salutation; /** + * @var ?string */ private $externalId; /** + * @var ?DateTimeImmutable */ private $dateOfBirth; /** + * @var ?string */ private $companyName; /** + * @var ?string */ private $vatId; /** + * @var ?bool */ private $isEmailVerified; /** + * @var null|CustomerGroupKeyReference|CustomerGroupKeyReferenceBuilder */ private $customerGroup; /** + * @var ?CustomerAddressCollection */ private $addresses; /** + * @var ?int */ private $defaultBillingAddress; /** + * @var ?array */ private $billingAddresses; /** + * @var ?int */ private $defaultShippingAddress; /** + * @var ?array */ private $shippingAddresses; /** + * @var ?string */ private $locale; /** + * @var null|Custom|CustomBuilder */ private $custom; /** + *

    User-defined unique identifier.

    + * + * @return null|string */ public function getKey() @@ -154,6 +180,7 @@ public function getKey() /** *

    Maps to Customer.customerNumber.

    * + * @return null|string */ public function getCustomerNumber() @@ -164,6 +191,7 @@ public function getCustomerNumber() /** *

    Maps to Customer.email.

    * + * @return null|string */ public function getEmail() @@ -174,6 +202,7 @@ public function getEmail() /** *

    Maps to Customer.password.

    * + * @return null|string */ public function getPassword() @@ -184,6 +213,7 @@ public function getPassword() /** *

    The References to the Stores with which the Customer is associated. If referenced Stores do not exist, the state of the ImportOperation will be set to unresolved until the necessary Stores are created.

    * + * @return null|StoreKeyReferenceCollection */ public function getStores() @@ -194,6 +224,7 @@ public function getStores() /** *

    Maps to Customer.firstName.

    * + * @return null|string */ public function getFirstName() @@ -204,6 +235,7 @@ public function getFirstName() /** *

    Maps to Customer.lastName.

    * + * @return null|string */ public function getLastName() @@ -214,6 +246,7 @@ public function getLastName() /** *

    Maps to Customer.middleName.

    * + * @return null|string */ public function getMiddleName() @@ -224,6 +257,7 @@ public function getMiddleName() /** *

    Maps to Customer.title.

    * + * @return null|string */ public function getTitle() @@ -234,6 +268,7 @@ public function getTitle() /** *

    Maps to Customer.salutation.

    * + * @return null|string */ public function getSalutation() @@ -244,6 +279,7 @@ public function getSalutation() /** *

    Maps to Customer.externalId.

    * + * @return null|string */ public function getExternalId() @@ -254,6 +290,7 @@ public function getExternalId() /** *

    Maps to Customer.dateOfBirth.

    * + * @return null|DateTimeImmutable */ public function getDateOfBirth() @@ -264,6 +301,7 @@ public function getDateOfBirth() /** *

    Maps to Customer.companyName.

    * + * @return null|string */ public function getCompanyName() @@ -274,6 +312,7 @@ public function getCompanyName() /** *

    Maps to Customer.vatId.

    * + * @return null|string */ public function getVatId() @@ -284,6 +323,7 @@ public function getVatId() /** *

    Maps to Customer.isEmailVerified.

    * + * @return null|bool */ public function getIsEmailVerified() @@ -295,6 +335,7 @@ public function getIsEmailVerified() *

    The Reference to the CustomerGroup with which the Customer is associated. * If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary CustomerGroup is created.

    * + * @return null|CustomerGroupKeyReference */ public function getCustomerGroup() @@ -305,6 +346,7 @@ public function getCustomerGroup() /** *

    Maps to Customer.addresses.

    * + * @return null|CustomerAddressCollection */ public function getAddresses() @@ -315,6 +357,7 @@ public function getAddresses() /** *

    The index of the address in the addresses array. The defaultBillingAddressId of the customer will be set to the ID of that address.

    * + * @return null|int */ public function getDefaultBillingAddress() @@ -325,6 +368,7 @@ public function getDefaultBillingAddress() /** *

    The indices of the billing addresses in the addresses array. The billingAddressIds of the customer will be set to the IDs of that addresses.

    * + * @return null|array */ public function getBillingAddresses() @@ -335,6 +379,7 @@ public function getBillingAddresses() /** *

    The index of the address in the addresses array. The defaultShippingAddressId of the customer will be set to the ID of that address.

    * + * @return null|int */ public function getDefaultShippingAddress() @@ -345,6 +390,7 @@ public function getDefaultShippingAddress() /** *

    The indices of the shipping addresses in the addresses array. The shippingAddressIds of the customer will be set to the IDs of that addresses.

    * + * @return null|array */ public function getShippingAddresses() @@ -355,6 +401,7 @@ public function getShippingAddresses() /** *

    Maps to Customer.locale.

    * + * @return null|string */ public function getLocale() @@ -365,6 +412,7 @@ public function getLocale() /** *

    The custom fields for this Customer.

    * + * @return null|Custom */ public function getCustom() diff --git a/lib/commercetools-import/src/Models/Customers/CustomerImportModel.php b/lib/commercetools-import/src/Models/Customers/CustomerImportModel.php index 141c5cfc757..2483ef87b8e 100644 --- a/lib/commercetools-import/src/Models/Customers/CustomerImportModel.php +++ b/lib/commercetools-import/src/Models/Customers/CustomerImportModel.php @@ -28,116 +28,139 @@ final class CustomerImportModel extends JsonObjectModel implements CustomerImport { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $customerNumber; /** + * * @var ?string */ protected $email; /** + * * @var ?string */ protected $password; /** + * * @var ?StoreKeyReferenceCollection */ protected $stores; /** + * * @var ?string */ protected $firstName; /** + * * @var ?string */ protected $lastName; /** + * * @var ?string */ protected $middleName; /** + * * @var ?string */ protected $title; /** + * * @var ?string */ protected $salutation; /** + * * @var ?string */ protected $externalId; /** + * * @var ?DateTimeImmutable */ protected $dateOfBirth; /** + * * @var ?string */ protected $companyName; /** + * * @var ?string */ protected $vatId; /** + * * @var ?bool */ protected $isEmailVerified; /** + * * @var ?CustomerGroupKeyReference */ protected $customerGroup; /** + * * @var ?CustomerAddressCollection */ protected $addresses; /** + * * @var ?int */ protected $defaultBillingAddress; /** + * * @var ?array */ protected $billingAddresses; /** + * * @var ?int */ protected $defaultShippingAddress; /** + * * @var ?array */ protected $shippingAddresses; /** + * * @var ?string */ protected $locale; /** + * * @var ?Custom */ protected $custom; @@ -197,6 +220,9 @@ public function __construct( } /** + *

    User-defined unique identifier.

    + * + * * @return null|string */ public function getKey() @@ -216,6 +242,7 @@ public function getKey() /** *

    Maps to Customer.customerNumber.

    * + * * @return null|string */ public function getCustomerNumber() @@ -235,6 +262,7 @@ public function getCustomerNumber() /** *

    Maps to Customer.email.

    * + * * @return null|string */ public function getEmail() @@ -254,6 +282,7 @@ public function getEmail() /** *

    Maps to Customer.password.

    * + * * @return null|string */ public function getPassword() @@ -273,6 +302,7 @@ public function getPassword() /** *

    The References to the Stores with which the Customer is associated. If referenced Stores do not exist, the state of the ImportOperation will be set to unresolved until the necessary Stores are created.

    * + * * @return null|StoreKeyReferenceCollection */ public function getStores() @@ -292,6 +322,7 @@ public function getStores() /** *

    Maps to Customer.firstName.

    * + * * @return null|string */ public function getFirstName() @@ -311,6 +342,7 @@ public function getFirstName() /** *

    Maps to Customer.lastName.

    * + * * @return null|string */ public function getLastName() @@ -330,6 +362,7 @@ public function getLastName() /** *

    Maps to Customer.middleName.

    * + * * @return null|string */ public function getMiddleName() @@ -349,6 +382,7 @@ public function getMiddleName() /** *

    Maps to Customer.title.

    * + * * @return null|string */ public function getTitle() @@ -368,6 +402,7 @@ public function getTitle() /** *

    Maps to Customer.salutation.

    * + * * @return null|string */ public function getSalutation() @@ -387,6 +422,7 @@ public function getSalutation() /** *

    Maps to Customer.externalId.

    * + * * @return null|string */ public function getExternalId() @@ -406,6 +442,7 @@ public function getExternalId() /** *

    Maps to Customer.dateOfBirth.

    * + * * @return null|DateTimeImmutable */ public function getDateOfBirth() @@ -429,6 +466,7 @@ public function getDateOfBirth() /** *

    Maps to Customer.companyName.

    * + * * @return null|string */ public function getCompanyName() @@ -448,6 +486,7 @@ public function getCompanyName() /** *

    Maps to Customer.vatId.

    * + * * @return null|string */ public function getVatId() @@ -467,6 +506,7 @@ public function getVatId() /** *

    Maps to Customer.isEmailVerified.

    * + * * @return null|bool */ public function getIsEmailVerified() @@ -487,6 +527,7 @@ public function getIsEmailVerified() *

    The Reference to the CustomerGroup with which the Customer is associated. * If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary CustomerGroup is created.

    * + * * @return null|CustomerGroupKeyReference */ public function getCustomerGroup() @@ -507,6 +548,7 @@ public function getCustomerGroup() /** *

    Maps to Customer.addresses.

    * + * * @return null|CustomerAddressCollection */ public function getAddresses() @@ -526,6 +568,7 @@ public function getAddresses() /** *

    The index of the address in the addresses array. The defaultBillingAddressId of the customer will be set to the ID of that address.

    * + * * @return null|int */ public function getDefaultBillingAddress() @@ -545,6 +588,7 @@ public function getDefaultBillingAddress() /** *

    The indices of the billing addresses in the addresses array. The billingAddressIds of the customer will be set to the IDs of that addresses.

    * + * * @return null|array */ public function getBillingAddresses() @@ -564,6 +608,7 @@ public function getBillingAddresses() /** *

    The index of the address in the addresses array. The defaultShippingAddressId of the customer will be set to the ID of that address.

    * + * * @return null|int */ public function getDefaultShippingAddress() @@ -583,6 +628,7 @@ public function getDefaultShippingAddress() /** *

    The indices of the shipping addresses in the addresses array. The shippingAddressIds of the customer will be set to the IDs of that addresses.

    * + * * @return null|array */ public function getShippingAddresses() @@ -602,6 +648,7 @@ public function getShippingAddresses() /** *

    Maps to Customer.locale.

    * + * * @return null|string */ public function getLocale() @@ -621,6 +668,7 @@ public function getLocale() /** *

    The custom fields for this Customer.

    * + * * @return null|Custom */ public function getCustom() diff --git a/lib/commercetools-import/src/Models/Customfields/BooleanField.php b/lib/commercetools-import/src/Models/Customfields/BooleanField.php index 7c1c356c4e8..5620320ce80 100644 --- a/lib/commercetools-import/src/Models/Customfields/BooleanField.php +++ b/lib/commercetools-import/src/Models/Customfields/BooleanField.php @@ -16,6 +16,7 @@ interface BooleanField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|bool */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/BooleanFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/BooleanFieldBuilder.php index fbd31f00983..b46e42be6ee 100644 --- a/lib/commercetools-import/src/Models/Customfields/BooleanFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/BooleanFieldBuilder.php @@ -21,11 +21,13 @@ final class BooleanFieldBuilder implements Builder { /** + * @var ?bool */ private $value; /** + * @return null|bool */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/BooleanFieldModel.php b/lib/commercetools-import/src/Models/Customfields/BooleanFieldModel.php index c964563c1ce..0f216452f2f 100644 --- a/lib/commercetools-import/src/Models/Customfields/BooleanFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/BooleanFieldModel.php @@ -21,11 +21,13 @@ final class BooleanFieldModel extends JsonObjectModel implements BooleanField { public const DISCRIMINATOR_VALUE = 'Boolean'; /** + * * @var ?string */ protected $type; /** + * * @var ?bool */ protected $value; @@ -35,15 +37,17 @@ final class BooleanFieldModel extends JsonObjectModel implements BooleanField * @psalm-suppress MissingParamType */ public function __construct( - ?bool $value = null + ?bool $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() } /** + * * @return null|bool */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/BooleanSetField.php b/lib/commercetools-import/src/Models/Customfields/BooleanSetField.php index 21a6ba34ddf..291ad7f7d64 100644 --- a/lib/commercetools-import/src/Models/Customfields/BooleanSetField.php +++ b/lib/commercetools-import/src/Models/Customfields/BooleanSetField.php @@ -16,6 +16,7 @@ interface BooleanSetField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|array */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/BooleanSetFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/BooleanSetFieldBuilder.php index 5858b13320a..10c28124090 100644 --- a/lib/commercetools-import/src/Models/Customfields/BooleanSetFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/BooleanSetFieldBuilder.php @@ -21,11 +21,13 @@ final class BooleanSetFieldBuilder implements Builder { /** + * @var ?array */ private $value; /** + * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/BooleanSetFieldModel.php b/lib/commercetools-import/src/Models/Customfields/BooleanSetFieldModel.php index c1542e66af9..b4c0454c02f 100644 --- a/lib/commercetools-import/src/Models/Customfields/BooleanSetFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/BooleanSetFieldModel.php @@ -21,11 +21,13 @@ final class BooleanSetFieldModel extends JsonObjectModel implements BooleanSetFi { public const DISCRIMINATOR_VALUE = 'BooleanSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $value; @@ -35,15 +37,17 @@ final class BooleanSetFieldModel extends JsonObjectModel implements BooleanSetFi * @psalm-suppress MissingParamType */ public function __construct( - ?array $value = null + ?array $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() } /** + * * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/Custom.php b/lib/commercetools-import/src/Models/Customfields/Custom.php index 509a97c6a63..4c029563e1e 100644 --- a/lib/commercetools-import/src/Models/Customfields/Custom.php +++ b/lib/commercetools-import/src/Models/Customfields/Custom.php @@ -20,6 +20,7 @@ interface Custom extends JsonObject /** *

    The type that provides the field definitions for this object.

    * + * @return null|TypeKeyReference */ public function getType(); @@ -27,6 +28,7 @@ public function getType(); /** *

    The custom fields of this object.

    * + * @return null|FieldContainer */ public function getFields(); diff --git a/lib/commercetools-import/src/Models/Customfields/CustomBuilder.php b/lib/commercetools-import/src/Models/Customfields/CustomBuilder.php index 558968061d4..179a366fde4 100644 --- a/lib/commercetools-import/src/Models/Customfields/CustomBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/CustomBuilder.php @@ -23,11 +23,13 @@ final class CustomBuilder implements Builder { /** + * @var null|TypeKeyReference|TypeKeyReferenceBuilder */ private $type; /** + * @var null|FieldContainer|FieldContainerBuilder */ private $fields; @@ -35,6 +37,7 @@ final class CustomBuilder implements Builder /** *

    The type that provides the field definitions for this object.

    * + * @return null|TypeKeyReference */ public function getType() @@ -45,6 +48,7 @@ public function getType() /** *

    The custom fields of this object.

    * + * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-import/src/Models/Customfields/CustomField.php b/lib/commercetools-import/src/Models/Customfields/CustomField.php index 364286cc147..3305bbbefcb 100644 --- a/lib/commercetools-import/src/Models/Customfields/CustomField.php +++ b/lib/commercetools-import/src/Models/Customfields/CustomField.php @@ -19,6 +19,7 @@ interface CustomField extends JsonObject /** *

    The type of this field.

    * + * @return null|string */ public function getType(); diff --git a/lib/commercetools-import/src/Models/Customfields/CustomFieldModel.php b/lib/commercetools-import/src/Models/Customfields/CustomFieldModel.php index fbded411afa..32ef8196714 100644 --- a/lib/commercetools-import/src/Models/Customfields/CustomFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/CustomFieldModel.php @@ -21,6 +21,7 @@ final class CustomFieldModel extends JsonObjectModel implements CustomField { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -58,13 +59,15 @@ final class CustomFieldModel extends JsonObjectModel implements CustomField * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() diff --git a/lib/commercetools-import/src/Models/Customfields/CustomModel.php b/lib/commercetools-import/src/Models/Customfields/CustomModel.php index 72223d84b70..8963237d340 100644 --- a/lib/commercetools-import/src/Models/Customfields/CustomModel.php +++ b/lib/commercetools-import/src/Models/Customfields/CustomModel.php @@ -22,11 +22,13 @@ final class CustomModel extends JsonObjectModel implements Custom { /** + * * @var ?TypeKeyReference */ protected $type; /** + * * @var ?FieldContainer */ protected $fields; @@ -46,6 +48,7 @@ public function __construct( /** *

    The type that provides the field definitions for this object.

    * + * * @return null|TypeKeyReference */ public function getType() @@ -66,6 +69,7 @@ public function getType() /** *

    The custom fields of this object.

    * + * * @return null|FieldContainer */ public function getFields() diff --git a/lib/commercetools-import/src/Models/Customfields/DateField.php b/lib/commercetools-import/src/Models/Customfields/DateField.php index 98775cfdf73..e855d1fd895 100644 --- a/lib/commercetools-import/src/Models/Customfields/DateField.php +++ b/lib/commercetools-import/src/Models/Customfields/DateField.php @@ -17,6 +17,7 @@ interface DateField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|DateTimeImmutable */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/DateFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/DateFieldBuilder.php index 4cde41d6a95..197befa1873 100644 --- a/lib/commercetools-import/src/Models/Customfields/DateFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/DateFieldBuilder.php @@ -22,11 +22,13 @@ final class DateFieldBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $value; /** + * @return null|DateTimeImmutable */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/DateFieldModel.php b/lib/commercetools-import/src/Models/Customfields/DateFieldModel.php index 3d0fdd3072b..22b07e6fb5c 100644 --- a/lib/commercetools-import/src/Models/Customfields/DateFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/DateFieldModel.php @@ -22,11 +22,13 @@ final class DateFieldModel extends JsonObjectModel implements DateField { public const DISCRIMINATOR_VALUE = 'Date'; /** + * * @var ?string */ protected $type; /** + * * @var ?DateTimeImmutable */ protected $value; @@ -36,15 +38,17 @@ final class DateFieldModel extends JsonObjectModel implements DateField * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutable $value = null + ?DateTimeImmutable $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -62,6 +66,7 @@ public function getType() } /** + * * @return null|DateTimeImmutable */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/DateSetField.php b/lib/commercetools-import/src/Models/Customfields/DateSetField.php index b2ac4a98b94..50900becdd0 100644 --- a/lib/commercetools-import/src/Models/Customfields/DateSetField.php +++ b/lib/commercetools-import/src/Models/Customfields/DateSetField.php @@ -16,6 +16,7 @@ interface DateSetField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|DateTimeImmutableCollection */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/DateSetFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/DateSetFieldBuilder.php index 0029dda512a..60ec4972f5a 100644 --- a/lib/commercetools-import/src/Models/Customfields/DateSetFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/DateSetFieldBuilder.php @@ -21,11 +21,13 @@ final class DateSetFieldBuilder implements Builder { /** + * @var ?DateTimeImmutableCollection */ private $value; /** + * @return null|DateTimeImmutableCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/DateSetFieldModel.php b/lib/commercetools-import/src/Models/Customfields/DateSetFieldModel.php index 83cfe1c45d8..a05fe1ea4d9 100644 --- a/lib/commercetools-import/src/Models/Customfields/DateSetFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/DateSetFieldModel.php @@ -21,11 +21,13 @@ final class DateSetFieldModel extends JsonObjectModel implements DateSetField { public const DISCRIMINATOR_VALUE = 'DateSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?DateTimeImmutableCollection */ protected $value; @@ -35,15 +37,17 @@ final class DateSetFieldModel extends JsonObjectModel implements DateSetField * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutableCollection $value = null + ?DateTimeImmutableCollection $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() } /** + * * @return null|DateTimeImmutableCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/DateTimeField.php b/lib/commercetools-import/src/Models/Customfields/DateTimeField.php index 3926201e4cb..5055113a4fb 100644 --- a/lib/commercetools-import/src/Models/Customfields/DateTimeField.php +++ b/lib/commercetools-import/src/Models/Customfields/DateTimeField.php @@ -17,6 +17,7 @@ interface DateTimeField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|DateTimeImmutable */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/DateTimeFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/DateTimeFieldBuilder.php index 8159a3de447..c7a9993c92f 100644 --- a/lib/commercetools-import/src/Models/Customfields/DateTimeFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/DateTimeFieldBuilder.php @@ -22,11 +22,13 @@ final class DateTimeFieldBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $value; /** + * @return null|DateTimeImmutable */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/DateTimeFieldModel.php b/lib/commercetools-import/src/Models/Customfields/DateTimeFieldModel.php index 530287fa0b4..66daff3f552 100644 --- a/lib/commercetools-import/src/Models/Customfields/DateTimeFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/DateTimeFieldModel.php @@ -22,11 +22,13 @@ final class DateTimeFieldModel extends JsonObjectModel implements DateTimeField { public const DISCRIMINATOR_VALUE = 'DateTime'; /** + * * @var ?string */ protected $type; /** + * * @var ?DateTimeImmutable */ protected $value; @@ -36,15 +38,17 @@ final class DateTimeFieldModel extends JsonObjectModel implements DateTimeField * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutable $value = null + ?DateTimeImmutable $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -62,6 +66,7 @@ public function getType() } /** + * * @return null|DateTimeImmutable */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/DateTimeSetField.php b/lib/commercetools-import/src/Models/Customfields/DateTimeSetField.php index e0a16658645..8a58c3b1205 100644 --- a/lib/commercetools-import/src/Models/Customfields/DateTimeSetField.php +++ b/lib/commercetools-import/src/Models/Customfields/DateTimeSetField.php @@ -16,6 +16,7 @@ interface DateTimeSetField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|DateTimeImmutableCollection */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/DateTimeSetFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/DateTimeSetFieldBuilder.php index d44fa10934f..13babfcc715 100644 --- a/lib/commercetools-import/src/Models/Customfields/DateTimeSetFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/DateTimeSetFieldBuilder.php @@ -21,11 +21,13 @@ final class DateTimeSetFieldBuilder implements Builder { /** + * @var ?DateTimeImmutableCollection */ private $value; /** + * @return null|DateTimeImmutableCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/DateTimeSetFieldModel.php b/lib/commercetools-import/src/Models/Customfields/DateTimeSetFieldModel.php index 97b90db39e5..ea852d3456c 100644 --- a/lib/commercetools-import/src/Models/Customfields/DateTimeSetFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/DateTimeSetFieldModel.php @@ -21,11 +21,13 @@ final class DateTimeSetFieldModel extends JsonObjectModel implements DateTimeSet { public const DISCRIMINATOR_VALUE = 'DateTimeSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?DateTimeImmutableCollection */ protected $value; @@ -35,15 +37,17 @@ final class DateTimeSetFieldModel extends JsonObjectModel implements DateTimeSet * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutableCollection $value = null + ?DateTimeImmutableCollection $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() } /** + * * @return null|DateTimeImmutableCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/EnumField.php b/lib/commercetools-import/src/Models/Customfields/EnumField.php index 16e46d57ea8..b70f79321c1 100644 --- a/lib/commercetools-import/src/Models/Customfields/EnumField.php +++ b/lib/commercetools-import/src/Models/Customfields/EnumField.php @@ -16,6 +16,7 @@ interface EnumField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/EnumFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/EnumFieldBuilder.php index abb364af0c6..e7edf336e13 100644 --- a/lib/commercetools-import/src/Models/Customfields/EnumFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/EnumFieldBuilder.php @@ -21,11 +21,13 @@ final class EnumFieldBuilder implements Builder { /** + * @var ?string */ private $value; /** + * @return null|string */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/EnumFieldModel.php b/lib/commercetools-import/src/Models/Customfields/EnumFieldModel.php index cdd457a5c12..fdc520b0bd4 100644 --- a/lib/commercetools-import/src/Models/Customfields/EnumFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/EnumFieldModel.php @@ -21,11 +21,13 @@ final class EnumFieldModel extends JsonObjectModel implements EnumField { public const DISCRIMINATOR_VALUE = 'Enum'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $value; @@ -35,15 +37,17 @@ final class EnumFieldModel extends JsonObjectModel implements EnumField * @psalm-suppress MissingParamType */ public function __construct( - ?string $value = null + ?string $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() } /** + * * @return null|string */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/EnumSetField.php b/lib/commercetools-import/src/Models/Customfields/EnumSetField.php index 3930ec66732..0c1249b9f70 100644 --- a/lib/commercetools-import/src/Models/Customfields/EnumSetField.php +++ b/lib/commercetools-import/src/Models/Customfields/EnumSetField.php @@ -16,6 +16,7 @@ interface EnumSetField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|array */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/EnumSetFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/EnumSetFieldBuilder.php index 69596a60007..776bdcf42fe 100644 --- a/lib/commercetools-import/src/Models/Customfields/EnumSetFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/EnumSetFieldBuilder.php @@ -21,11 +21,13 @@ final class EnumSetFieldBuilder implements Builder { /** + * @var ?array */ private $value; /** + * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/EnumSetFieldModel.php b/lib/commercetools-import/src/Models/Customfields/EnumSetFieldModel.php index 86ac9d4cc6b..af18ee066d2 100644 --- a/lib/commercetools-import/src/Models/Customfields/EnumSetFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/EnumSetFieldModel.php @@ -21,11 +21,13 @@ final class EnumSetFieldModel extends JsonObjectModel implements EnumSetField { public const DISCRIMINATOR_VALUE = 'EnumSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $value; @@ -35,15 +37,17 @@ final class EnumSetFieldModel extends JsonObjectModel implements EnumSetField * @psalm-suppress MissingParamType */ public function __construct( - ?array $value = null + ?array $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() } /** + * * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/LocalizedEnumField.php b/lib/commercetools-import/src/Models/Customfields/LocalizedEnumField.php index 438620f8625..ca34670b941 100644 --- a/lib/commercetools-import/src/Models/Customfields/LocalizedEnumField.php +++ b/lib/commercetools-import/src/Models/Customfields/LocalizedEnumField.php @@ -16,6 +16,7 @@ interface LocalizedEnumField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/LocalizedEnumFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/LocalizedEnumFieldBuilder.php index 8938ac291b2..8809f12c4f2 100644 --- a/lib/commercetools-import/src/Models/Customfields/LocalizedEnumFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/LocalizedEnumFieldBuilder.php @@ -21,11 +21,13 @@ final class LocalizedEnumFieldBuilder implements Builder { /** + * @var ?string */ private $value; /** + * @return null|string */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/LocalizedEnumFieldModel.php b/lib/commercetools-import/src/Models/Customfields/LocalizedEnumFieldModel.php index c8447f21d63..1273e980aa4 100644 --- a/lib/commercetools-import/src/Models/Customfields/LocalizedEnumFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/LocalizedEnumFieldModel.php @@ -21,11 +21,13 @@ final class LocalizedEnumFieldModel extends JsonObjectModel implements Localized { public const DISCRIMINATOR_VALUE = 'LocalizedEnum'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $value; @@ -35,15 +37,17 @@ final class LocalizedEnumFieldModel extends JsonObjectModel implements Localized * @psalm-suppress MissingParamType */ public function __construct( - ?string $value = null + ?string $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() } /** + * * @return null|string */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/LocalizedEnumSetField.php b/lib/commercetools-import/src/Models/Customfields/LocalizedEnumSetField.php index 4308a1f3e13..0d893dc6d9a 100644 --- a/lib/commercetools-import/src/Models/Customfields/LocalizedEnumSetField.php +++ b/lib/commercetools-import/src/Models/Customfields/LocalizedEnumSetField.php @@ -16,6 +16,7 @@ interface LocalizedEnumSetField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|array */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/LocalizedEnumSetFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/LocalizedEnumSetFieldBuilder.php index 7cf125200e3..fea09cf32d5 100644 --- a/lib/commercetools-import/src/Models/Customfields/LocalizedEnumSetFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/LocalizedEnumSetFieldBuilder.php @@ -21,11 +21,13 @@ final class LocalizedEnumSetFieldBuilder implements Builder { /** + * @var ?array */ private $value; /** + * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/LocalizedEnumSetFieldModel.php b/lib/commercetools-import/src/Models/Customfields/LocalizedEnumSetFieldModel.php index 9ca230b541f..cf98b04074e 100644 --- a/lib/commercetools-import/src/Models/Customfields/LocalizedEnumSetFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/LocalizedEnumSetFieldModel.php @@ -21,11 +21,13 @@ final class LocalizedEnumSetFieldModel extends JsonObjectModel implements Locali { public const DISCRIMINATOR_VALUE = 'LocalizedEnumSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $value; @@ -35,15 +37,17 @@ final class LocalizedEnumSetFieldModel extends JsonObjectModel implements Locali * @psalm-suppress MissingParamType */ public function __construct( - ?array $value = null + ?array $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() } /** + * * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/LocalizedStringField.php b/lib/commercetools-import/src/Models/Customfields/LocalizedStringField.php index f6ed235340e..f1c2139d02f 100644 --- a/lib/commercetools-import/src/Models/Customfields/LocalizedStringField.php +++ b/lib/commercetools-import/src/Models/Customfields/LocalizedStringField.php @@ -24,6 +24,7 @@ interface LocalizedStringField extends CustomField * } * * + * @return null|LocalizedString */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/LocalizedStringFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/LocalizedStringFieldBuilder.php index d16233f1063..88c3bcf4ac8 100644 --- a/lib/commercetools-import/src/Models/Customfields/LocalizedStringFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/LocalizedStringFieldBuilder.php @@ -23,6 +23,7 @@ final class LocalizedStringFieldBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $value; @@ -35,6 +36,7 @@ final class LocalizedStringFieldBuilder implements Builder * } * * + * @return null|LocalizedString */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/LocalizedStringFieldModel.php b/lib/commercetools-import/src/Models/Customfields/LocalizedStringFieldModel.php index 1ffbb410c9d..4dcab2c70e1 100644 --- a/lib/commercetools-import/src/Models/Customfields/LocalizedStringFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/LocalizedStringFieldModel.php @@ -23,11 +23,13 @@ final class LocalizedStringFieldModel extends JsonObjectModel implements Localiz { public const DISCRIMINATOR_VALUE = 'LocalizedString'; /** + * * @var ?string */ protected $type; /** + * * @var ?LocalizedString */ protected $value; @@ -37,15 +39,17 @@ final class LocalizedStringFieldModel extends JsonObjectModel implements Localiz * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedString $value = null + ?LocalizedString $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -70,6 +74,7 @@ public function getType() * } * * + * * @return null|LocalizedString */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/LocalizedStringSetField.php b/lib/commercetools-import/src/Models/Customfields/LocalizedStringSetField.php index 58ecd2602b8..2ca87355de3 100644 --- a/lib/commercetools-import/src/Models/Customfields/LocalizedStringSetField.php +++ b/lib/commercetools-import/src/Models/Customfields/LocalizedStringSetField.php @@ -17,6 +17,7 @@ interface LocalizedStringSetField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|LocalizedStringCollection */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/LocalizedStringSetFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/LocalizedStringSetFieldBuilder.php index 3f8239201de..080b461ee1f 100644 --- a/lib/commercetools-import/src/Models/Customfields/LocalizedStringSetFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/LocalizedStringSetFieldBuilder.php @@ -22,11 +22,13 @@ final class LocalizedStringSetFieldBuilder implements Builder { /** + * @var ?LocalizedStringCollection */ private $value; /** + * @return null|LocalizedStringCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/LocalizedStringSetFieldModel.php b/lib/commercetools-import/src/Models/Customfields/LocalizedStringSetFieldModel.php index 53afa7a10f5..4886acdc934 100644 --- a/lib/commercetools-import/src/Models/Customfields/LocalizedStringSetFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/LocalizedStringSetFieldModel.php @@ -22,11 +22,13 @@ final class LocalizedStringSetFieldModel extends JsonObjectModel implements Loca { public const DISCRIMINATOR_VALUE = 'LocalizedStringSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?LocalizedStringCollection */ protected $value; @@ -36,15 +38,17 @@ final class LocalizedStringSetFieldModel extends JsonObjectModel implements Loca * @psalm-suppress MissingParamType */ public function __construct( - ?LocalizedStringCollection $value = null + ?LocalizedStringCollection $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -62,6 +66,7 @@ public function getType() } /** + * * @return null|LocalizedStringCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/MoneyField.php b/lib/commercetools-import/src/Models/Customfields/MoneyField.php index a0f56e43c76..642c30ea532 100644 --- a/lib/commercetools-import/src/Models/Customfields/MoneyField.php +++ b/lib/commercetools-import/src/Models/Customfields/MoneyField.php @@ -17,6 +17,7 @@ interface MoneyField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|TypedMoney */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/MoneyFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/MoneyFieldBuilder.php index 917adfa7b5f..43d6b2b28d9 100644 --- a/lib/commercetools-import/src/Models/Customfields/MoneyFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/MoneyFieldBuilder.php @@ -23,11 +23,13 @@ final class MoneyFieldBuilder implements Builder { /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $value; /** + * @return null|TypedMoney */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/MoneyFieldModel.php b/lib/commercetools-import/src/Models/Customfields/MoneyFieldModel.php index eaeaabf4a34..4a71c71f96c 100644 --- a/lib/commercetools-import/src/Models/Customfields/MoneyFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/MoneyFieldModel.php @@ -23,11 +23,13 @@ final class MoneyFieldModel extends JsonObjectModel implements MoneyField { public const DISCRIMINATOR_VALUE = 'Money'; /** + * * @var ?string */ protected $type; /** + * * @var ?TypedMoney */ protected $value; @@ -37,15 +39,17 @@ final class MoneyFieldModel extends JsonObjectModel implements MoneyField * @psalm-suppress MissingParamType */ public function __construct( - ?TypedMoney $value = null + ?TypedMoney $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -63,6 +67,7 @@ public function getType() } /** + * * @return null|TypedMoney */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/MoneySetField.php b/lib/commercetools-import/src/Models/Customfields/MoneySetField.php index 16da278d5e6..18daabda3d9 100644 --- a/lib/commercetools-import/src/Models/Customfields/MoneySetField.php +++ b/lib/commercetools-import/src/Models/Customfields/MoneySetField.php @@ -17,6 +17,7 @@ interface MoneySetField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|MoneyCollection */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/MoneySetFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/MoneySetFieldBuilder.php index cbe4b7292d9..8fc742693b3 100644 --- a/lib/commercetools-import/src/Models/Customfields/MoneySetFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/MoneySetFieldBuilder.php @@ -22,11 +22,13 @@ final class MoneySetFieldBuilder implements Builder { /** + * @var ?MoneyCollection */ private $value; /** + * @return null|MoneyCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/MoneySetFieldModel.php b/lib/commercetools-import/src/Models/Customfields/MoneySetFieldModel.php index df8419570ce..0ff7db42bcb 100644 --- a/lib/commercetools-import/src/Models/Customfields/MoneySetFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/MoneySetFieldModel.php @@ -22,11 +22,13 @@ final class MoneySetFieldModel extends JsonObjectModel implements MoneySetField { public const DISCRIMINATOR_VALUE = 'MoneySet'; /** + * * @var ?string */ protected $type; /** + * * @var ?MoneyCollection */ protected $value; @@ -36,15 +38,17 @@ final class MoneySetFieldModel extends JsonObjectModel implements MoneySetField * @psalm-suppress MissingParamType */ public function __construct( - ?MoneyCollection $value = null + ?MoneyCollection $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -62,6 +66,7 @@ public function getType() } /** + * * @return null|MoneyCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/NumberField.php b/lib/commercetools-import/src/Models/Customfields/NumberField.php index 0b0f9a66fbd..718d16c75c1 100644 --- a/lib/commercetools-import/src/Models/Customfields/NumberField.php +++ b/lib/commercetools-import/src/Models/Customfields/NumberField.php @@ -16,6 +16,7 @@ interface NumberField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|float */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/NumberFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/NumberFieldBuilder.php index 4dcf7372f31..cdb8d273733 100644 --- a/lib/commercetools-import/src/Models/Customfields/NumberFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/NumberFieldBuilder.php @@ -21,11 +21,13 @@ final class NumberFieldBuilder implements Builder { /** + * @var ?float */ private $value; /** + * @return null|float */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/NumberFieldModel.php b/lib/commercetools-import/src/Models/Customfields/NumberFieldModel.php index 8d397e68f3c..ff8fa9bf0ff 100644 --- a/lib/commercetools-import/src/Models/Customfields/NumberFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/NumberFieldModel.php @@ -21,11 +21,13 @@ final class NumberFieldModel extends JsonObjectModel implements NumberField { public const DISCRIMINATOR_VALUE = 'Number'; /** + * * @var ?string */ protected $type; /** + * * @var ?float */ protected $value; @@ -35,15 +37,17 @@ final class NumberFieldModel extends JsonObjectModel implements NumberField * @psalm-suppress MissingParamType */ public function __construct( - ?float $value = null + ?float $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() } /** + * * @return null|float */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/NumberSetField.php b/lib/commercetools-import/src/Models/Customfields/NumberSetField.php index 527259d24f5..cad72c6069b 100644 --- a/lib/commercetools-import/src/Models/Customfields/NumberSetField.php +++ b/lib/commercetools-import/src/Models/Customfields/NumberSetField.php @@ -16,6 +16,7 @@ interface NumberSetField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|array */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/NumberSetFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/NumberSetFieldBuilder.php index c51a0684316..bda8fe55029 100644 --- a/lib/commercetools-import/src/Models/Customfields/NumberSetFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/NumberSetFieldBuilder.php @@ -21,11 +21,13 @@ final class NumberSetFieldBuilder implements Builder { /** + * @var ?array */ private $value; /** + * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/NumberSetFieldModel.php b/lib/commercetools-import/src/Models/Customfields/NumberSetFieldModel.php index 063d4d384ee..7a5c951205a 100644 --- a/lib/commercetools-import/src/Models/Customfields/NumberSetFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/NumberSetFieldModel.php @@ -21,11 +21,13 @@ final class NumberSetFieldModel extends JsonObjectModel implements NumberSetFiel { public const DISCRIMINATOR_VALUE = 'NumberSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $value; @@ -35,15 +37,17 @@ final class NumberSetFieldModel extends JsonObjectModel implements NumberSetFiel * @psalm-suppress MissingParamType */ public function __construct( - ?array $value = null + ?array $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() } /** + * * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/ReferenceField.php b/lib/commercetools-import/src/Models/Customfields/ReferenceField.php index 3a090eaba80..455694e3bb5 100644 --- a/lib/commercetools-import/src/Models/Customfields/ReferenceField.php +++ b/lib/commercetools-import/src/Models/Customfields/ReferenceField.php @@ -19,6 +19,7 @@ interface ReferenceField extends CustomField /** *

    References a resource by key

    * + * @return null|KeyReference */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/ReferenceFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/ReferenceFieldBuilder.php index fbacdd5df7d..8bbc58618bb 100644 --- a/lib/commercetools-import/src/Models/Customfields/ReferenceFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/ReferenceFieldBuilder.php @@ -23,6 +23,7 @@ final class ReferenceFieldBuilder implements Builder { /** + * @var null|KeyReference|KeyReferenceBuilder */ private $value; @@ -30,6 +31,7 @@ final class ReferenceFieldBuilder implements Builder /** *

    References a resource by key

    * + * @return null|KeyReference */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/ReferenceFieldModel.php b/lib/commercetools-import/src/Models/Customfields/ReferenceFieldModel.php index bafd90a40b9..38864fa1d9f 100644 --- a/lib/commercetools-import/src/Models/Customfields/ReferenceFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/ReferenceFieldModel.php @@ -23,11 +23,13 @@ final class ReferenceFieldModel extends JsonObjectModel implements ReferenceFiel { public const DISCRIMINATOR_VALUE = 'Reference'; /** + * * @var ?string */ protected $type; /** + * * @var ?KeyReference */ protected $value; @@ -37,15 +39,17 @@ final class ReferenceFieldModel extends JsonObjectModel implements ReferenceFiel * @psalm-suppress MissingParamType */ public function __construct( - ?KeyReference $value = null + ?KeyReference $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -65,6 +69,7 @@ public function getType() /** *

    References a resource by key

    * + * * @return null|KeyReference */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/ReferenceSetField.php b/lib/commercetools-import/src/Models/Customfields/ReferenceSetField.php index 789e1c33a25..17cae2f101e 100644 --- a/lib/commercetools-import/src/Models/Customfields/ReferenceSetField.php +++ b/lib/commercetools-import/src/Models/Customfields/ReferenceSetField.php @@ -17,6 +17,7 @@ interface ReferenceSetField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|KeyReferenceCollection */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/ReferenceSetFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/ReferenceSetFieldBuilder.php index ec1b79846b5..c11fbec8d7e 100644 --- a/lib/commercetools-import/src/Models/Customfields/ReferenceSetFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/ReferenceSetFieldBuilder.php @@ -22,11 +22,13 @@ final class ReferenceSetFieldBuilder implements Builder { /** + * @var ?KeyReferenceCollection */ private $value; /** + * @return null|KeyReferenceCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/ReferenceSetFieldModel.php b/lib/commercetools-import/src/Models/Customfields/ReferenceSetFieldModel.php index 8324537f60d..6ca0da8a058 100644 --- a/lib/commercetools-import/src/Models/Customfields/ReferenceSetFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/ReferenceSetFieldModel.php @@ -22,11 +22,13 @@ final class ReferenceSetFieldModel extends JsonObjectModel implements ReferenceS { public const DISCRIMINATOR_VALUE = 'ReferenceSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?KeyReferenceCollection */ protected $value; @@ -36,15 +38,17 @@ final class ReferenceSetFieldModel extends JsonObjectModel implements ReferenceS * @psalm-suppress MissingParamType */ public function __construct( - ?KeyReferenceCollection $value = null + ?KeyReferenceCollection $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -62,6 +66,7 @@ public function getType() } /** + * * @return null|KeyReferenceCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/StringField.php b/lib/commercetools-import/src/Models/Customfields/StringField.php index 48eadc8f20a..c68fbe54a93 100644 --- a/lib/commercetools-import/src/Models/Customfields/StringField.php +++ b/lib/commercetools-import/src/Models/Customfields/StringField.php @@ -16,6 +16,7 @@ interface StringField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/StringFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/StringFieldBuilder.php index 7d0f3802202..0908fe9a232 100644 --- a/lib/commercetools-import/src/Models/Customfields/StringFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/StringFieldBuilder.php @@ -21,11 +21,13 @@ final class StringFieldBuilder implements Builder { /** + * @var ?string */ private $value; /** + * @return null|string */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/StringFieldModel.php b/lib/commercetools-import/src/Models/Customfields/StringFieldModel.php index e3a9328f3cc..6256d102519 100644 --- a/lib/commercetools-import/src/Models/Customfields/StringFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/StringFieldModel.php @@ -21,11 +21,13 @@ final class StringFieldModel extends JsonObjectModel implements StringField { public const DISCRIMINATOR_VALUE = 'String'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $value; @@ -35,15 +37,17 @@ final class StringFieldModel extends JsonObjectModel implements StringField * @psalm-suppress MissingParamType */ public function __construct( - ?string $value = null + ?string $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() } /** + * * @return null|string */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/StringSetField.php b/lib/commercetools-import/src/Models/Customfields/StringSetField.php index f1a94f1dfb2..4a698c9afa9 100644 --- a/lib/commercetools-import/src/Models/Customfields/StringSetField.php +++ b/lib/commercetools-import/src/Models/Customfields/StringSetField.php @@ -16,6 +16,7 @@ interface StringSetField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|array */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/StringSetFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/StringSetFieldBuilder.php index dd33d08d9fe..4c282e4ec24 100644 --- a/lib/commercetools-import/src/Models/Customfields/StringSetFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/StringSetFieldBuilder.php @@ -21,11 +21,13 @@ final class StringSetFieldBuilder implements Builder { /** + * @var ?array */ private $value; /** + * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/StringSetFieldModel.php b/lib/commercetools-import/src/Models/Customfields/StringSetFieldModel.php index d696160c414..f53d52bb725 100644 --- a/lib/commercetools-import/src/Models/Customfields/StringSetFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/StringSetFieldModel.php @@ -21,11 +21,13 @@ final class StringSetFieldModel extends JsonObjectModel implements StringSetFiel { public const DISCRIMINATOR_VALUE = 'StringSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $value; @@ -35,15 +37,17 @@ final class StringSetFieldModel extends JsonObjectModel implements StringSetFiel * @psalm-suppress MissingParamType */ public function __construct( - ?array $value = null + ?array $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() } /** + * * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/TimeField.php b/lib/commercetools-import/src/Models/Customfields/TimeField.php index f8562c7b403..133bc36b798 100644 --- a/lib/commercetools-import/src/Models/Customfields/TimeField.php +++ b/lib/commercetools-import/src/Models/Customfields/TimeField.php @@ -17,6 +17,7 @@ interface TimeField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|DateTimeImmutable */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/TimeFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/TimeFieldBuilder.php index d6a35fdfe24..644fc5f0728 100644 --- a/lib/commercetools-import/src/Models/Customfields/TimeFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/TimeFieldBuilder.php @@ -22,11 +22,13 @@ final class TimeFieldBuilder implements Builder { /** + * @var ?DateTimeImmutable */ private $value; /** + * @return null|DateTimeImmutable */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/TimeFieldModel.php b/lib/commercetools-import/src/Models/Customfields/TimeFieldModel.php index fb1ffedb106..adad853d5d8 100644 --- a/lib/commercetools-import/src/Models/Customfields/TimeFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/TimeFieldModel.php @@ -22,11 +22,13 @@ final class TimeFieldModel extends JsonObjectModel implements TimeField { public const DISCRIMINATOR_VALUE = 'Time'; /** + * * @var ?string */ protected $type; /** + * * @var ?DateTimeImmutable */ protected $value; @@ -36,15 +38,17 @@ final class TimeFieldModel extends JsonObjectModel implements TimeField * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutable $value = null + ?DateTimeImmutable $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -62,6 +66,7 @@ public function getType() } /** + * * @return null|DateTimeImmutable */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/TimeSetField.php b/lib/commercetools-import/src/Models/Customfields/TimeSetField.php index 95c422d22aa..a99274cb129 100644 --- a/lib/commercetools-import/src/Models/Customfields/TimeSetField.php +++ b/lib/commercetools-import/src/Models/Customfields/TimeSetField.php @@ -16,6 +16,7 @@ interface TimeSetField extends CustomField public const FIELD_VALUE = 'value'; /** + * @return null|DateTimeImmutableCollection */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Customfields/TimeSetFieldBuilder.php b/lib/commercetools-import/src/Models/Customfields/TimeSetFieldBuilder.php index df2e50cdc29..09f20b1ae3c 100644 --- a/lib/commercetools-import/src/Models/Customfields/TimeSetFieldBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/TimeSetFieldBuilder.php @@ -21,11 +21,13 @@ final class TimeSetFieldBuilder implements Builder { /** + * @var ?DateTimeImmutableCollection */ private $value; /** + * @return null|DateTimeImmutableCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Customfields/TimeSetFieldModel.php b/lib/commercetools-import/src/Models/Customfields/TimeSetFieldModel.php index ecb826f6155..b380a9fa7b2 100644 --- a/lib/commercetools-import/src/Models/Customfields/TimeSetFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/TimeSetFieldModel.php @@ -21,11 +21,13 @@ final class TimeSetFieldModel extends JsonObjectModel implements TimeSetField { public const DISCRIMINATOR_VALUE = 'TimeSet'; /** + * * @var ?string */ protected $type; /** + * * @var ?DateTimeImmutableCollection */ protected $value; @@ -35,15 +37,17 @@ final class TimeSetFieldModel extends JsonObjectModel implements TimeSetField * @psalm-suppress MissingParamType */ public function __construct( - ?DateTimeImmutableCollection $value = null + ?DateTimeImmutableCollection $value = null, + ?string $type = null ) { $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of this field.

    * + * * @return null|string */ public function getType() @@ -61,6 +65,7 @@ public function getType() } /** + * * @return null|DateTimeImmutableCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Errors/AccessDeniedErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/AccessDeniedErrorBuilder.php index 7060e0ef0af..4c52e50ecba 100644 --- a/lib/commercetools-import/src/Models/Errors/AccessDeniedErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/AccessDeniedErrorBuilder.php @@ -21,11 +21,13 @@ final class AccessDeniedErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/AccessDeniedErrorModel.php b/lib/commercetools-import/src/Models/Errors/AccessDeniedErrorModel.php index 0a0d4916676..264d7545d7b 100644 --- a/lib/commercetools-import/src/Models/Errors/AccessDeniedErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/AccessDeniedErrorModel.php @@ -21,11 +21,13 @@ final class AccessDeniedErrorModel extends JsonObjectModel implements AccessDeni { public const DISCRIMINATOR_VALUE = 'access_denied'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class AccessDeniedErrorModel extends JsonObjectModel implements AccessDeni * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/ConcurrentModificationError.php b/lib/commercetools-import/src/Models/Errors/ConcurrentModificationError.php index ab978c2c44c..ac82dd2c9ae 100644 --- a/lib/commercetools-import/src/Models/Errors/ConcurrentModificationError.php +++ b/lib/commercetools-import/src/Models/Errors/ConcurrentModificationError.php @@ -20,6 +20,7 @@ interface ConcurrentModificationError extends ErrorObject /** *

    The version specified in the failed request.

    * + * @return null|int */ public function getSpecifiedVersion(); @@ -27,6 +28,7 @@ public function getSpecifiedVersion(); /** *

    The current version of the resource.

    * + * @return null|int */ public function getCurrentVersion(); @@ -34,6 +36,7 @@ public function getCurrentVersion(); /** *

    The resource in conflict.

    * + * @return null|mixed */ public function getConflictedResource(); diff --git a/lib/commercetools-import/src/Models/Errors/ConcurrentModificationErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/ConcurrentModificationErrorBuilder.php index 2ddf2616075..97ed75a0627 100644 --- a/lib/commercetools-import/src/Models/Errors/ConcurrentModificationErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/ConcurrentModificationErrorBuilder.php @@ -21,26 +21,31 @@ final class ConcurrentModificationErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?int */ private $specifiedVersion; /** + * @var ?int */ private $currentVersion; /** + * @var null|mixed|mixed */ private $conflictedResource; /** + * @return null|string */ public function getMessage() @@ -51,6 +56,7 @@ public function getMessage() /** *

    The version specified in the failed request.

    * + * @return null|int */ public function getSpecifiedVersion() @@ -61,6 +67,7 @@ public function getSpecifiedVersion() /** *

    The current version of the resource.

    * + * @return null|int */ public function getCurrentVersion() @@ -71,6 +78,7 @@ public function getCurrentVersion() /** *

    The resource in conflict.

    * + * @return null|mixed */ public function getConflictedResource() diff --git a/lib/commercetools-import/src/Models/Errors/ConcurrentModificationErrorModel.php b/lib/commercetools-import/src/Models/Errors/ConcurrentModificationErrorModel.php index 2ddcb90036f..d0b0ec8f368 100644 --- a/lib/commercetools-import/src/Models/Errors/ConcurrentModificationErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/ConcurrentModificationErrorModel.php @@ -21,26 +21,31 @@ final class ConcurrentModificationErrorModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'ConcurrentModification'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?int */ protected $specifiedVersion; /** + * * @var ?int */ protected $currentVersion; /** + * * @var ?mixed */ protected $conflictedResource; @@ -53,16 +58,18 @@ public function __construct( ?string $message = null, ?int $specifiedVersion = null, ?int $currentVersion = null, - $conflictedResource = null + $conflictedResource = null, + ?string $code = null ) { $this->message = $message; $this->specifiedVersion = $specifiedVersion; $this->currentVersion = $currentVersion; $this->conflictedResource = $conflictedResource; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -80,6 +87,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -99,6 +107,7 @@ public function getMessage() /** *

    The version specified in the failed request.

    * + * * @return null|int */ public function getSpecifiedVersion() @@ -118,6 +127,7 @@ public function getSpecifiedVersion() /** *

    The current version of the resource.

    * + * * @return null|int */ public function getCurrentVersion() @@ -137,6 +147,7 @@ public function getCurrentVersion() /** *

    The resource in conflict.

    * + * * @return null|mixed */ public function getConflictedResource() diff --git a/lib/commercetools-import/src/Models/Errors/ContentionErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/ContentionErrorBuilder.php index 041a4b84747..7f17ded3a50 100644 --- a/lib/commercetools-import/src/Models/Errors/ContentionErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/ContentionErrorBuilder.php @@ -21,11 +21,13 @@ final class ContentionErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/ContentionErrorModel.php b/lib/commercetools-import/src/Models/Errors/ContentionErrorModel.php index 54bc3d8ffe7..7e8f760f1d9 100644 --- a/lib/commercetools-import/src/Models/Errors/ContentionErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/ContentionErrorModel.php @@ -21,11 +21,13 @@ final class ContentionErrorModel extends JsonObjectModel implements ContentionEr { public const DISCRIMINATOR_VALUE = 'Contention'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class ContentionErrorModel extends JsonObjectModel implements ContentionEr * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValueError.php b/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValueError.php index 10f51ca233f..05b14407298 100644 --- a/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValueError.php +++ b/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValueError.php @@ -19,6 +19,7 @@ interface DuplicateAttributeValueError extends ErrorObject /** *

    The attribute in conflict.

    * + * @return null|Attribute */ public function getAttribute(); diff --git a/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValueErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValueErrorBuilder.php index 92d48125429..5218ce0a155 100644 --- a/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValueErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValueErrorBuilder.php @@ -23,16 +23,19 @@ final class DuplicateAttributeValueErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var null|Attribute|AttributeBuilder */ private $attribute; /** + * @return null|string */ public function getMessage() @@ -43,6 +46,7 @@ public function getMessage() /** *

    The attribute in conflict.

    * + * @return null|Attribute */ public function getAttribute() diff --git a/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValueErrorModel.php b/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValueErrorModel.php index 62e33e888e4..2df0bd1d41b 100644 --- a/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValueErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValueErrorModel.php @@ -23,16 +23,19 @@ final class DuplicateAttributeValueErrorModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'DuplicateAttributeValue'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?Attribute */ protected $attribute; @@ -43,14 +46,16 @@ final class DuplicateAttributeValueErrorModel extends JsonObjectModel implements */ public function __construct( ?string $message = null, - ?Attribute $attribute = null + ?Attribute $attribute = null, + ?string $code = null ) { $this->message = $message; $this->attribute = $attribute; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -68,6 +73,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -87,6 +93,7 @@ public function getMessage() /** *

    The attribute in conflict.

    * + * * @return null|Attribute */ public function getAttribute() diff --git a/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValuesError.php b/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValuesError.php index b59db03bc1b..7d648971401 100644 --- a/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValuesError.php +++ b/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValuesError.php @@ -17,6 +17,7 @@ interface DuplicateAttributeValuesError extends ErrorObject public const FIELD_ATTRIBUTES = 'attributes'; /** + * @return null|AttributeCollection */ public function getAttributes(); diff --git a/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValuesErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValuesErrorBuilder.php index e3f64955c2b..85d7d11092c 100644 --- a/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValuesErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValuesErrorBuilder.php @@ -22,16 +22,19 @@ final class DuplicateAttributeValuesErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?AttributeCollection */ private $attributes; /** + * @return null|string */ public function getMessage() @@ -40,6 +43,7 @@ public function getMessage() } /** + * @return null|AttributeCollection */ public function getAttributes() diff --git a/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValuesErrorModel.php b/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValuesErrorModel.php index e370358c738..b81aaea8014 100644 --- a/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValuesErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/DuplicateAttributeValuesErrorModel.php @@ -22,16 +22,19 @@ final class DuplicateAttributeValuesErrorModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = 'DuplicateAttributeValues'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?AttributeCollection */ protected $attributes; @@ -42,14 +45,16 @@ final class DuplicateAttributeValuesErrorModel extends JsonObjectModel implement */ public function __construct( ?string $message = null, - ?AttributeCollection $attributes = null + ?AttributeCollection $attributes = null, + ?string $code = null ) { $this->message = $message; $this->attributes = $attributes; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -67,6 +72,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -84,6 +90,7 @@ public function getMessage() } /** + * * @return null|AttributeCollection */ public function getAttributes() diff --git a/lib/commercetools-import/src/Models/Errors/DuplicateFieldError.php b/lib/commercetools-import/src/Models/Errors/DuplicateFieldError.php index c26bfb70fe5..c1df61f7571 100644 --- a/lib/commercetools-import/src/Models/Errors/DuplicateFieldError.php +++ b/lib/commercetools-import/src/Models/Errors/DuplicateFieldError.php @@ -19,6 +19,7 @@ interface DuplicateFieldError extends ErrorObject /** *

    The name of the field.

    * + * @return null|string */ public function getField(); @@ -26,6 +27,7 @@ public function getField(); /** *

    The offending duplicate value.

    * + * @return null|mixed */ public function getDuplicateValue(); diff --git a/lib/commercetools-import/src/Models/Errors/DuplicateFieldErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/DuplicateFieldErrorBuilder.php index bf6de127827..45d727be853 100644 --- a/lib/commercetools-import/src/Models/Errors/DuplicateFieldErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/DuplicateFieldErrorBuilder.php @@ -21,21 +21,25 @@ final class DuplicateFieldErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $field; /** + * @var null|mixed|mixed */ private $duplicateValue; /** + * @return null|string */ public function getMessage() @@ -46,6 +50,7 @@ public function getMessage() /** *

    The name of the field.

    * + * @return null|string */ public function getField() @@ -56,6 +61,7 @@ public function getField() /** *

    The offending duplicate value.

    * + * @return null|mixed */ public function getDuplicateValue() diff --git a/lib/commercetools-import/src/Models/Errors/DuplicateFieldErrorModel.php b/lib/commercetools-import/src/Models/Errors/DuplicateFieldErrorModel.php index b0b2858b83d..a6411d8a5eb 100644 --- a/lib/commercetools-import/src/Models/Errors/DuplicateFieldErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/DuplicateFieldErrorModel.php @@ -21,21 +21,25 @@ final class DuplicateFieldErrorModel extends JsonObjectModel implements Duplicat { public const DISCRIMINATOR_VALUE = 'DuplicateField'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $field; /** + * * @var ?mixed */ protected $duplicateValue; @@ -47,15 +51,17 @@ final class DuplicateFieldErrorModel extends JsonObjectModel implements Duplicat public function __construct( ?string $message = null, ?string $field = null, - $duplicateValue = null + $duplicateValue = null, + ?string $code = null ) { $this->message = $message; $this->field = $field; $this->duplicateValue = $duplicateValue; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -73,6 +79,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -92,6 +99,7 @@ public function getMessage() /** *

    The name of the field.

    * + * * @return null|string */ public function getField() @@ -111,6 +119,7 @@ public function getField() /** *

    The offending duplicate value.

    * + * * @return null|mixed */ public function getDuplicateValue() diff --git a/lib/commercetools-import/src/Models/Errors/DuplicateVariantValuesError.php b/lib/commercetools-import/src/Models/Errors/DuplicateVariantValuesError.php index 57e88a1e423..24c2621b043 100644 --- a/lib/commercetools-import/src/Models/Errors/DuplicateVariantValuesError.php +++ b/lib/commercetools-import/src/Models/Errors/DuplicateVariantValuesError.php @@ -18,6 +18,7 @@ interface DuplicateVariantValuesError extends ErrorObject /** *

    The offending variant values.

    * + * @return null|VariantValues */ public function getVariantValues(); diff --git a/lib/commercetools-import/src/Models/Errors/DuplicateVariantValuesErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/DuplicateVariantValuesErrorBuilder.php index ef3309c2380..2bb2e3017f1 100644 --- a/lib/commercetools-import/src/Models/Errors/DuplicateVariantValuesErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/DuplicateVariantValuesErrorBuilder.php @@ -21,16 +21,19 @@ final class DuplicateVariantValuesErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var null|VariantValues|VariantValuesBuilder */ private $variantValues; /** + * @return null|string */ public function getMessage() @@ -41,6 +44,7 @@ public function getMessage() /** *

    The offending variant values.

    * + * @return null|VariantValues */ public function getVariantValues() diff --git a/lib/commercetools-import/src/Models/Errors/DuplicateVariantValuesErrorModel.php b/lib/commercetools-import/src/Models/Errors/DuplicateVariantValuesErrorModel.php index 061b6e5c4e4..58da8da7f5c 100644 --- a/lib/commercetools-import/src/Models/Errors/DuplicateVariantValuesErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/DuplicateVariantValuesErrorModel.php @@ -21,16 +21,19 @@ final class DuplicateVariantValuesErrorModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'DuplicateVariantValues'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?VariantValues */ protected $variantValues; @@ -41,14 +44,16 @@ final class DuplicateVariantValuesErrorModel extends JsonObjectModel implements */ public function __construct( ?string $message = null, - ?VariantValues $variantValues = null + ?VariantValues $variantValues = null, + ?string $code = null ) { $this->message = $message; $this->variantValues = $variantValues; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -66,6 +71,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -85,6 +91,7 @@ public function getMessage() /** *

    The offending variant values.

    * + * * @return null|VariantValues */ public function getVariantValues() diff --git a/lib/commercetools-import/src/Models/Errors/ErrorObject.php b/lib/commercetools-import/src/Models/Errors/ErrorObject.php index 1af390609e0..0f355ca60e1 100644 --- a/lib/commercetools-import/src/Models/Errors/ErrorObject.php +++ b/lib/commercetools-import/src/Models/Errors/ErrorObject.php @@ -18,11 +18,13 @@ interface ErrorObject extends JsonObject public const FIELD_MESSAGE = 'message'; /** + * @return null|string */ public function getCode(); /** + * @return null|string */ public function getMessage(); diff --git a/lib/commercetools-import/src/Models/Errors/ErrorObjectBuilder.php b/lib/commercetools-import/src/Models/Errors/ErrorObjectBuilder.php index 5dfe70c6300..c2a94507fa0 100644 --- a/lib/commercetools-import/src/Models/Errors/ErrorObjectBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/ErrorObjectBuilder.php @@ -21,11 +21,13 @@ final class ErrorObjectBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/ErrorObjectModel.php b/lib/commercetools-import/src/Models/Errors/ErrorObjectModel.php index 5ea02f43496..d884995a2c9 100644 --- a/lib/commercetools-import/src/Models/Errors/ErrorObjectModel.php +++ b/lib/commercetools-import/src/Models/Errors/ErrorObjectModel.php @@ -21,11 +21,13 @@ final class ErrorObjectModel extends JsonObjectModel implements ErrorObject { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -63,13 +65,15 @@ final class ErrorObjectModel extends JsonObjectModel implements ErrorObject * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code; } /** + * * @return null|string */ public function getCode() @@ -87,6 +91,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/ErrorResponse.php b/lib/commercetools-import/src/Models/Errors/ErrorResponse.php index f67e1ed5fff..2cd5a989b3c 100644 --- a/lib/commercetools-import/src/Models/Errors/ErrorResponse.php +++ b/lib/commercetools-import/src/Models/Errors/ErrorResponse.php @@ -22,6 +22,7 @@ interface ErrorResponse extends JsonObject /** *

    The http status code of the response.

    * + * @return null|int */ public function getStatusCode(); @@ -29,6 +30,7 @@ public function getStatusCode(); /** *

    Describes the error.

    * + * @return null|string */ public function getMessage(); @@ -37,6 +39,7 @@ public function getMessage(); *

    This property is only used for OAuth2 errors. * Contains the error code.

    * + * @return null|string */ public function getError(); @@ -46,6 +49,7 @@ public function getError(); * Additional information to assist the client developer in * understanding the error.

    * + * @return null|string */ public function getError_description(); @@ -53,6 +57,7 @@ public function getError_description(); /** *

    The errors that caused this error response.

    * + * @return null|ErrorObjectCollection */ public function getErrors(); diff --git a/lib/commercetools-import/src/Models/Errors/ErrorResponseBuilder.php b/lib/commercetools-import/src/Models/Errors/ErrorResponseBuilder.php index 85bb9390413..da061a3e706 100644 --- a/lib/commercetools-import/src/Models/Errors/ErrorResponseBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/ErrorResponseBuilder.php @@ -21,26 +21,31 @@ final class ErrorResponseBuilder implements Builder { /** + * @var ?int */ private $statusCode; /** + * @var ?string */ private $message; /** + * @var ?string */ private $error; /** + * @var ?string */ private $error_description; /** + * @var ?ErrorObjectCollection */ private $errors; @@ -48,6 +53,7 @@ final class ErrorResponseBuilder implements Builder /** *

    The http status code of the response.

    * + * @return null|int */ public function getStatusCode() @@ -58,6 +64,7 @@ public function getStatusCode() /** *

    Describes the error.

    * + * @return null|string */ public function getMessage() @@ -69,6 +76,7 @@ public function getMessage() *

    This property is only used for OAuth2 errors. * Contains the error code.

    * + * @return null|string */ public function getError() @@ -81,6 +89,7 @@ public function getError() * Additional information to assist the client developer in * understanding the error.

    * + * @return null|string */ public function getError_description() @@ -91,6 +100,7 @@ public function getError_description() /** *

    The errors that caused this error response.

    * + * @return null|ErrorObjectCollection */ public function getErrors() diff --git a/lib/commercetools-import/src/Models/Errors/ErrorResponseModel.php b/lib/commercetools-import/src/Models/Errors/ErrorResponseModel.php index c258f3c546d..a9a2fc4d27b 100644 --- a/lib/commercetools-import/src/Models/Errors/ErrorResponseModel.php +++ b/lib/commercetools-import/src/Models/Errors/ErrorResponseModel.php @@ -20,26 +20,31 @@ final class ErrorResponseModel extends JsonObjectModel implements ErrorResponse { /** + * * @var ?int */ protected $statusCode; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $error; /** + * * @var ?string */ protected $error_description; /** + * * @var ?ErrorObjectCollection */ protected $errors; @@ -65,6 +70,7 @@ public function __construct( /** *

    The http status code of the response.

    * + * * @return null|int */ public function getStatusCode() @@ -84,6 +90,7 @@ public function getStatusCode() /** *

    Describes the error.

    * + * * @return null|string */ public function getMessage() @@ -104,6 +111,7 @@ public function getMessage() *

    This property is only used for OAuth2 errors. * Contains the error code.

    * + * * @return null|string */ public function getError() @@ -125,6 +133,7 @@ public function getError() * Additional information to assist the client developer in * understanding the error.

    * + * * @return null|string */ public function getError_description() @@ -144,6 +153,7 @@ public function getError_description() /** *

    The errors that caused this error response.

    * + * * @return null|ErrorObjectCollection */ public function getErrors() diff --git a/lib/commercetools-import/src/Models/Errors/GenericErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/GenericErrorBuilder.php index 18657ff2f02..e8c2a1765c5 100644 --- a/lib/commercetools-import/src/Models/Errors/GenericErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/GenericErrorBuilder.php @@ -21,11 +21,13 @@ final class GenericErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/GenericErrorModel.php b/lib/commercetools-import/src/Models/Errors/GenericErrorModel.php index de4d39a23d7..9a9ad5e959b 100644 --- a/lib/commercetools-import/src/Models/Errors/GenericErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/GenericErrorModel.php @@ -21,11 +21,13 @@ final class GenericErrorModel extends JsonObjectModel implements GenericError { public const DISCRIMINATOR_VALUE = 'Generic'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class GenericErrorModel extends JsonObjectModel implements GenericError * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/InsufficientScopeErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/InsufficientScopeErrorBuilder.php index a9c17b12cb4..539c41ed6ec 100644 --- a/lib/commercetools-import/src/Models/Errors/InsufficientScopeErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/InsufficientScopeErrorBuilder.php @@ -21,11 +21,13 @@ final class InsufficientScopeErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/InsufficientScopeErrorModel.php b/lib/commercetools-import/src/Models/Errors/InsufficientScopeErrorModel.php index c427c29a3aa..16a08e5d424 100644 --- a/lib/commercetools-import/src/Models/Errors/InsufficientScopeErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/InsufficientScopeErrorModel.php @@ -21,11 +21,13 @@ final class InsufficientScopeErrorModel extends JsonObjectModel implements Insuf { public const DISCRIMINATOR_VALUE = 'insufficient_scope'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class InsufficientScopeErrorModel extends JsonObjectModel implements Insuf * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/InvalidCredentialsErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/InvalidCredentialsErrorBuilder.php index 231cbf1cdb4..9b7ae4349c1 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidCredentialsErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidCredentialsErrorBuilder.php @@ -21,11 +21,13 @@ final class InvalidCredentialsErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/InvalidCredentialsErrorModel.php b/lib/commercetools-import/src/Models/Errors/InvalidCredentialsErrorModel.php index b1199b237c3..50c42cc9a2f 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidCredentialsErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidCredentialsErrorModel.php @@ -21,11 +21,13 @@ final class InvalidCredentialsErrorModel extends JsonObjectModel implements Inva { public const DISCRIMINATOR_VALUE = 'InvalidCredentials'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class InvalidCredentialsErrorModel extends JsonObjectModel implements Inva * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/InvalidFieldError.php b/lib/commercetools-import/src/Models/Errors/InvalidFieldError.php index a6f8ff417cf..eb2bb07f78a 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidFieldError.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidFieldError.php @@ -21,6 +21,7 @@ interface InvalidFieldError extends ErrorObject /** *

    The name of the field.

    * + * @return null|string */ public function getField(); @@ -28,6 +29,7 @@ public function getField(); /** *

    The invalid value.

    * + * @return null|mixed */ public function getInvalidValue(); @@ -35,11 +37,13 @@ public function getInvalidValue(); /** *

    The set of allowed values for the field, if any.

    * + * @return null|array */ public function getAllowedValues(); /** + * @return null|int */ public function getResourceIndex(); diff --git a/lib/commercetools-import/src/Models/Errors/InvalidFieldErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/InvalidFieldErrorBuilder.php index 3c237bfa21c..06398d8917c 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidFieldErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidFieldErrorBuilder.php @@ -21,31 +21,37 @@ final class InvalidFieldErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $field; /** + * @var null|mixed|mixed */ private $invalidValue; /** + * @var ?array */ private $allowedValues; /** + * @var ?int */ private $resourceIndex; /** + * @return null|string */ public function getMessage() @@ -56,6 +62,7 @@ public function getMessage() /** *

    The name of the field.

    * + * @return null|string */ public function getField() @@ -66,6 +73,7 @@ public function getField() /** *

    The invalid value.

    * + * @return null|mixed */ public function getInvalidValue() @@ -76,6 +84,7 @@ public function getInvalidValue() /** *

    The set of allowed values for the field, if any.

    * + * @return null|array */ public function getAllowedValues() @@ -84,6 +93,7 @@ public function getAllowedValues() } /** + * @return null|int */ public function getResourceIndex() diff --git a/lib/commercetools-import/src/Models/Errors/InvalidFieldErrorModel.php b/lib/commercetools-import/src/Models/Errors/InvalidFieldErrorModel.php index a24df68ee19..7fb55eb8a22 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidFieldErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidFieldErrorModel.php @@ -21,31 +21,37 @@ final class InvalidFieldErrorModel extends JsonObjectModel implements InvalidFie { public const DISCRIMINATOR_VALUE = 'InvalidField'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $field; /** + * * @var ?mixed */ protected $invalidValue; /** + * * @var ?array */ protected $allowedValues; /** + * * @var ?int */ protected $resourceIndex; @@ -59,17 +65,19 @@ public function __construct( ?string $field = null, $invalidValue = null, ?array $allowedValues = null, - ?int $resourceIndex = null + ?int $resourceIndex = null, + ?string $code = null ) { $this->message = $message; $this->field = $field; $this->invalidValue = $invalidValue; $this->allowedValues = $allowedValues; $this->resourceIndex = $resourceIndex; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -87,6 +95,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -106,6 +115,7 @@ public function getMessage() /** *

    The name of the field.

    * + * * @return null|string */ public function getField() @@ -125,6 +135,7 @@ public function getField() /** *

    The invalid value.

    * + * * @return null|mixed */ public function getInvalidValue() @@ -144,6 +155,7 @@ public function getInvalidValue() /** *

    The set of allowed values for the field, if any.

    * + * * @return null|array */ public function getAllowedValues() @@ -161,6 +173,7 @@ public function getAllowedValues() } /** + * * @return null|int */ public function getResourceIndex() diff --git a/lib/commercetools-import/src/Models/Errors/InvalidInputBuilder.php b/lib/commercetools-import/src/Models/Errors/InvalidInputBuilder.php index 51410bbb124..d5ad6e1e926 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidInputBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidInputBuilder.php @@ -21,11 +21,13 @@ final class InvalidInputBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/InvalidInputModel.php b/lib/commercetools-import/src/Models/Errors/InvalidInputModel.php index ee885cfff11..a4ba3065bd2 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidInputModel.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidInputModel.php @@ -21,11 +21,13 @@ final class InvalidInputModel extends JsonObjectModel implements InvalidInput { public const DISCRIMINATOR_VALUE = 'InvalidInput'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class InvalidInputModel extends JsonObjectModel implements InvalidInput * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/InvalidJsonInputBuilder.php b/lib/commercetools-import/src/Models/Errors/InvalidJsonInputBuilder.php index 94631be815f..48d5ae9b180 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidJsonInputBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidJsonInputBuilder.php @@ -21,11 +21,13 @@ final class InvalidJsonInputBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/InvalidJsonInputModel.php b/lib/commercetools-import/src/Models/Errors/InvalidJsonInputModel.php index b31941046eb..9b67b77d220 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidJsonInputModel.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidJsonInputModel.php @@ -21,11 +21,13 @@ final class InvalidJsonInputModel extends JsonObjectModel implements InvalidJson { public const DISCRIMINATOR_VALUE = 'InvalidJsonInput'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class InvalidJsonInputModel extends JsonObjectModel implements InvalidJson * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/InvalidOperationBuilder.php b/lib/commercetools-import/src/Models/Errors/InvalidOperationBuilder.php index cf0b2599021..4c26ca7a001 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidOperationBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidOperationBuilder.php @@ -21,11 +21,13 @@ final class InvalidOperationBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/InvalidOperationModel.php b/lib/commercetools-import/src/Models/Errors/InvalidOperationModel.php index 82eef1dc749..61542d4b128 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidOperationModel.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidOperationModel.php @@ -21,11 +21,13 @@ final class InvalidOperationModel extends JsonObjectModel implements InvalidOper { public const DISCRIMINATOR_VALUE = 'InvalidOperation'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class InvalidOperationModel extends JsonObjectModel implements InvalidOper * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/InvalidScopeErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/InvalidScopeErrorBuilder.php index 67093b48d24..2f3bcae5701 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidScopeErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidScopeErrorBuilder.php @@ -21,11 +21,13 @@ final class InvalidScopeErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/InvalidScopeErrorModel.php b/lib/commercetools-import/src/Models/Errors/InvalidScopeErrorModel.php index 4aa8430d59c..93d0b04502f 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidScopeErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidScopeErrorModel.php @@ -21,11 +21,13 @@ final class InvalidScopeErrorModel extends JsonObjectModel implements InvalidSco { public const DISCRIMINATOR_VALUE = 'invalid_scope'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class InvalidScopeErrorModel extends JsonObjectModel implements InvalidSco * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionError.php b/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionError.php index 1a5e32c0559..5cc7633db24 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionError.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionError.php @@ -19,6 +19,7 @@ interface InvalidStateTransitionError extends ErrorObject /** *

    Every Import Operation is assigned with one of the following states.

    * + * @return null|string */ public function getCurrentState(); @@ -26,6 +27,7 @@ public function getCurrentState(); /** *

    Every Import Operation is assigned with one of the following states.

    * + * @return null|string */ public function getNewState(); diff --git a/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionErrorBuilder.php index e1c39ab927f..17e03ab8583 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionErrorBuilder.php @@ -21,21 +21,25 @@ final class InvalidStateTransitionErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $currentState; /** + * @var ?string */ private $newState; /** + * @return null|string */ public function getMessage() @@ -46,6 +50,7 @@ public function getMessage() /** *

    Every Import Operation is assigned with one of the following states.

    * + * @return null|string */ public function getCurrentState() @@ -56,6 +61,7 @@ public function getCurrentState() /** *

    Every Import Operation is assigned with one of the following states.

    * + * @return null|string */ public function getNewState() diff --git a/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionErrorModel.php b/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionErrorModel.php index 5a19d7e2920..6a43f491950 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionErrorModel.php @@ -21,21 +21,25 @@ final class InvalidStateTransitionErrorModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'InvalidTransition'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $currentState; /** + * * @var ?string */ protected $newState; @@ -47,15 +51,17 @@ final class InvalidStateTransitionErrorModel extends JsonObjectModel implements public function __construct( ?string $message = null, ?string $currentState = null, - ?string $newState = null + ?string $newState = null, + ?string $code = null ) { $this->message = $message; $this->currentState = $currentState; $this->newState = $newState; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -73,6 +79,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -92,6 +99,7 @@ public function getMessage() /** *

    Every Import Operation is assigned with one of the following states.

    * + * * @return null|string */ public function getCurrentState() @@ -111,6 +119,7 @@ public function getCurrentState() /** *

    Every Import Operation is assigned with one of the following states.

    * + * * @return null|string */ public function getNewState() diff --git a/lib/commercetools-import/src/Models/Errors/InvalidTokenErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/InvalidTokenErrorBuilder.php index 99695568849..45051829377 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidTokenErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidTokenErrorBuilder.php @@ -21,11 +21,13 @@ final class InvalidTokenErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/InvalidTokenErrorModel.php b/lib/commercetools-import/src/Models/Errors/InvalidTokenErrorModel.php index 49c34b97526..6723712522c 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidTokenErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidTokenErrorModel.php @@ -21,11 +21,13 @@ final class InvalidTokenErrorModel extends JsonObjectModel implements InvalidTok { public const DISCRIMINATOR_VALUE = 'invalid_token'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; @@ -35,13 +37,15 @@ final class InvalidTokenErrorModel extends JsonObjectModel implements InvalidTok * @psalm-suppress MissingParamType */ public function __construct( - ?string $message = null + ?string $message = null, + ?string $code = null ) { $this->message = $message; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -59,6 +63,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() diff --git a/lib/commercetools-import/src/Models/Errors/RequiredFieldError.php b/lib/commercetools-import/src/Models/Errors/RequiredFieldError.php index fe5552512aa..42561061a6a 100644 --- a/lib/commercetools-import/src/Models/Errors/RequiredFieldError.php +++ b/lib/commercetools-import/src/Models/Errors/RequiredFieldError.php @@ -18,6 +18,7 @@ interface RequiredFieldError extends ErrorObject /** *

    The name of the field.

    * + * @return null|string */ public function getField(); diff --git a/lib/commercetools-import/src/Models/Errors/RequiredFieldErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/RequiredFieldErrorBuilder.php index a49237c57ba..ba45eef7e79 100644 --- a/lib/commercetools-import/src/Models/Errors/RequiredFieldErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/RequiredFieldErrorBuilder.php @@ -21,16 +21,19 @@ final class RequiredFieldErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var ?string */ private $field; /** + * @return null|string */ public function getMessage() @@ -41,6 +44,7 @@ public function getMessage() /** *

    The name of the field.

    * + * @return null|string */ public function getField() diff --git a/lib/commercetools-import/src/Models/Errors/RequiredFieldErrorModel.php b/lib/commercetools-import/src/Models/Errors/RequiredFieldErrorModel.php index bc6318f63fa..dadc15d9ef8 100644 --- a/lib/commercetools-import/src/Models/Errors/RequiredFieldErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/RequiredFieldErrorModel.php @@ -21,16 +21,19 @@ final class RequiredFieldErrorModel extends JsonObjectModel implements RequiredF { public const DISCRIMINATOR_VALUE = 'RequiredField'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?string */ protected $field; @@ -41,14 +44,16 @@ final class RequiredFieldErrorModel extends JsonObjectModel implements RequiredF */ public function __construct( ?string $message = null, - ?string $field = null + ?string $field = null, + ?string $code = null ) { $this->message = $message; $this->field = $field; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -66,6 +71,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -85,6 +91,7 @@ public function getMessage() /** *

    The name of the field.

    * + * * @return null|string */ public function getField() diff --git a/lib/commercetools-import/src/Models/Errors/ResourceCreationError.php b/lib/commercetools-import/src/Models/Errors/ResourceCreationError.php index 8f443ebd5a6..c3a9876ab2b 100644 --- a/lib/commercetools-import/src/Models/Errors/ResourceCreationError.php +++ b/lib/commercetools-import/src/Models/Errors/ResourceCreationError.php @@ -16,6 +16,7 @@ interface ResourceCreationError extends ErrorObject public const FIELD_RESOURCE = 'resource'; /** + * @return null|mixed */ public function getResource(); diff --git a/lib/commercetools-import/src/Models/Errors/ResourceCreationErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/ResourceCreationErrorBuilder.php index 6d57a9b356b..d40a584d8b9 100644 --- a/lib/commercetools-import/src/Models/Errors/ResourceCreationErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/ResourceCreationErrorBuilder.php @@ -21,16 +21,19 @@ final class ResourceCreationErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var null|mixed|mixed */ private $resource; /** + * @return null|string */ public function getMessage() @@ -39,6 +42,7 @@ public function getMessage() } /** + * @return null|mixed */ public function getResource() diff --git a/lib/commercetools-import/src/Models/Errors/ResourceCreationErrorModel.php b/lib/commercetools-import/src/Models/Errors/ResourceCreationErrorModel.php index f22fa3ef08b..2706923cc77 100644 --- a/lib/commercetools-import/src/Models/Errors/ResourceCreationErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/ResourceCreationErrorModel.php @@ -21,16 +21,19 @@ final class ResourceCreationErrorModel extends JsonObjectModel implements Resour { public const DISCRIMINATOR_VALUE = 'ResourceCreation'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?mixed */ protected $resource; @@ -41,14 +44,16 @@ final class ResourceCreationErrorModel extends JsonObjectModel implements Resour */ public function __construct( ?string $message = null, - $resource = null + $resource = null, + ?string $code = null ) { $this->message = $message; $this->resource = $resource; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -66,6 +71,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -83,6 +89,7 @@ public function getMessage() } /** + * * @return null|mixed */ public function getResource() diff --git a/lib/commercetools-import/src/Models/Errors/ResourceDeletionError.php b/lib/commercetools-import/src/Models/Errors/ResourceDeletionError.php index 18b138d9240..f4f3a509b96 100644 --- a/lib/commercetools-import/src/Models/Errors/ResourceDeletionError.php +++ b/lib/commercetools-import/src/Models/Errors/ResourceDeletionError.php @@ -16,6 +16,7 @@ interface ResourceDeletionError extends ErrorObject public const FIELD_RESOURCE = 'resource'; /** + * @return null|mixed */ public function getResource(); diff --git a/lib/commercetools-import/src/Models/Errors/ResourceDeletionErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/ResourceDeletionErrorBuilder.php index 5552c4f9022..21632addf10 100644 --- a/lib/commercetools-import/src/Models/Errors/ResourceDeletionErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/ResourceDeletionErrorBuilder.php @@ -21,16 +21,19 @@ final class ResourceDeletionErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var null|mixed|mixed */ private $resource; /** + * @return null|string */ public function getMessage() @@ -39,6 +42,7 @@ public function getMessage() } /** + * @return null|mixed */ public function getResource() diff --git a/lib/commercetools-import/src/Models/Errors/ResourceDeletionErrorModel.php b/lib/commercetools-import/src/Models/Errors/ResourceDeletionErrorModel.php index f71f2323472..922ce13834d 100644 --- a/lib/commercetools-import/src/Models/Errors/ResourceDeletionErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/ResourceDeletionErrorModel.php @@ -21,16 +21,19 @@ final class ResourceDeletionErrorModel extends JsonObjectModel implements Resour { public const DISCRIMINATOR_VALUE = 'ResourceDeletion'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?mixed */ protected $resource; @@ -41,14 +44,16 @@ final class ResourceDeletionErrorModel extends JsonObjectModel implements Resour */ public function __construct( ?string $message = null, - $resource = null + $resource = null, + ?string $code = null ) { $this->message = $message; $this->resource = $resource; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -66,6 +71,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -83,6 +89,7 @@ public function getMessage() } /** + * * @return null|mixed */ public function getResource() diff --git a/lib/commercetools-import/src/Models/Errors/ResourceNotFoundError.php b/lib/commercetools-import/src/Models/Errors/ResourceNotFoundError.php index e2d0c477d88..504e2f1b188 100644 --- a/lib/commercetools-import/src/Models/Errors/ResourceNotFoundError.php +++ b/lib/commercetools-import/src/Models/Errors/ResourceNotFoundError.php @@ -16,6 +16,7 @@ interface ResourceNotFoundError extends ErrorObject public const FIELD_RESOURCE = 'resource'; /** + * @return null|mixed */ public function getResource(); diff --git a/lib/commercetools-import/src/Models/Errors/ResourceNotFoundErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/ResourceNotFoundErrorBuilder.php index 21329ed2978..422c6d67b76 100644 --- a/lib/commercetools-import/src/Models/Errors/ResourceNotFoundErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/ResourceNotFoundErrorBuilder.php @@ -21,16 +21,19 @@ final class ResourceNotFoundErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var null|mixed|mixed */ private $resource; /** + * @return null|string */ public function getMessage() @@ -39,6 +42,7 @@ public function getMessage() } /** + * @return null|mixed */ public function getResource() diff --git a/lib/commercetools-import/src/Models/Errors/ResourceNotFoundErrorModel.php b/lib/commercetools-import/src/Models/Errors/ResourceNotFoundErrorModel.php index 6add350814e..507341db370 100644 --- a/lib/commercetools-import/src/Models/Errors/ResourceNotFoundErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/ResourceNotFoundErrorModel.php @@ -21,16 +21,19 @@ final class ResourceNotFoundErrorModel extends JsonObjectModel implements Resour { public const DISCRIMINATOR_VALUE = 'ResourceNotFound'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?mixed */ protected $resource; @@ -41,14 +44,16 @@ final class ResourceNotFoundErrorModel extends JsonObjectModel implements Resour */ public function __construct( ?string $message = null, - $resource = null + $resource = null, + ?string $code = null ) { $this->message = $message; $this->resource = $resource; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -66,6 +71,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -83,6 +89,7 @@ public function getMessage() } /** + * * @return null|mixed */ public function getResource() diff --git a/lib/commercetools-import/src/Models/Errors/ResourceUpdateError.php b/lib/commercetools-import/src/Models/Errors/ResourceUpdateError.php index 24c28705460..dc625d4c641 100644 --- a/lib/commercetools-import/src/Models/Errors/ResourceUpdateError.php +++ b/lib/commercetools-import/src/Models/Errors/ResourceUpdateError.php @@ -16,6 +16,7 @@ interface ResourceUpdateError extends ErrorObject public const FIELD_RESOURCE = 'resource'; /** + * @return null|mixed */ public function getResource(); diff --git a/lib/commercetools-import/src/Models/Errors/ResourceUpdateErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/ResourceUpdateErrorBuilder.php index b8f4b9bc0e2..ec56849732f 100644 --- a/lib/commercetools-import/src/Models/Errors/ResourceUpdateErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/ResourceUpdateErrorBuilder.php @@ -21,16 +21,19 @@ final class ResourceUpdateErrorBuilder implements Builder { /** + * @var ?string */ private $message; /** + * @var null|mixed|mixed */ private $resource; /** + * @return null|string */ public function getMessage() @@ -39,6 +42,7 @@ public function getMessage() } /** + * @return null|mixed */ public function getResource() diff --git a/lib/commercetools-import/src/Models/Errors/ResourceUpdateErrorModel.php b/lib/commercetools-import/src/Models/Errors/ResourceUpdateErrorModel.php index 70f502b7d58..4340318adbb 100644 --- a/lib/commercetools-import/src/Models/Errors/ResourceUpdateErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/ResourceUpdateErrorModel.php @@ -21,16 +21,19 @@ final class ResourceUpdateErrorModel extends JsonObjectModel implements Resource { public const DISCRIMINATOR_VALUE = 'ResourceUpdate'; /** + * * @var ?string */ protected $code; /** + * * @var ?string */ protected $message; /** + * * @var ?mixed */ protected $resource; @@ -41,14 +44,16 @@ final class ResourceUpdateErrorModel extends JsonObjectModel implements Resource */ public function __construct( ?string $message = null, - $resource = null + $resource = null, + ?string $code = null ) { $this->message = $message; $this->resource = $resource; - $this->code = static::DISCRIMINATOR_VALUE; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getCode() @@ -66,6 +71,7 @@ public function getCode() } /** + * * @return null|string */ public function getMessage() @@ -83,6 +89,7 @@ public function getMessage() } /** + * * @return null|mixed */ public function getResource() diff --git a/lib/commercetools-import/src/Models/Errors/VariantValues.php b/lib/commercetools-import/src/Models/Errors/VariantValues.php index 39407e16a0c..e1c013a41e4 100644 --- a/lib/commercetools-import/src/Models/Errors/VariantValues.php +++ b/lib/commercetools-import/src/Models/Errors/VariantValues.php @@ -20,16 +20,19 @@ interface VariantValues extends JsonObject public const FIELD_ATTRIBUTES = 'attributes'; /** + * @return null|string */ public function getSku(); /** + * @return null|PriceImportCollection */ public function getPrices(); /** + * @return null|AttributeCollection */ public function getAttributes(); diff --git a/lib/commercetools-import/src/Models/Errors/VariantValuesBuilder.php b/lib/commercetools-import/src/Models/Errors/VariantValuesBuilder.php index fc3b20890ea..7f5885ff9b5 100644 --- a/lib/commercetools-import/src/Models/Errors/VariantValuesBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/VariantValuesBuilder.php @@ -23,21 +23,25 @@ final class VariantValuesBuilder implements Builder { /** + * @var ?string */ private $sku; /** + * @var ?PriceImportCollection */ private $prices; /** + * @var ?AttributeCollection */ private $attributes; /** + * @return null|string */ public function getSku() @@ -46,6 +50,7 @@ public function getSku() } /** + * @return null|PriceImportCollection */ public function getPrices() @@ -54,6 +59,7 @@ public function getPrices() } /** + * @return null|AttributeCollection */ public function getAttributes() diff --git a/lib/commercetools-import/src/Models/Errors/VariantValuesModel.php b/lib/commercetools-import/src/Models/Errors/VariantValuesModel.php index d38b62ee29c..b18380d0e88 100644 --- a/lib/commercetools-import/src/Models/Errors/VariantValuesModel.php +++ b/lib/commercetools-import/src/Models/Errors/VariantValuesModel.php @@ -22,16 +22,19 @@ final class VariantValuesModel extends JsonObjectModel implements VariantValues { /** + * * @var ?string */ protected $sku; /** + * * @var ?PriceImportCollection */ protected $prices; /** + * * @var ?AttributeCollection */ protected $attributes; @@ -51,6 +54,7 @@ public function __construct( } /** + * * @return null|string */ public function getSku() @@ -68,6 +72,7 @@ public function getSku() } /** + * * @return null|PriceImportCollection */ public function getPrices() @@ -85,6 +90,7 @@ public function getPrices() } /** + * * @return null|AttributeCollection */ public function getAttributes() diff --git a/lib/commercetools-import/src/Models/Importcontainers/ImportContainer.php b/lib/commercetools-import/src/Models/Importcontainers/ImportContainer.php index f124b60eaac..d6c9020e36f 100644 --- a/lib/commercetools-import/src/Models/Importcontainers/ImportContainer.php +++ b/lib/commercetools-import/src/Models/Importcontainers/ImportContainer.php @@ -24,6 +24,7 @@ interface ImportContainer extends JsonObject *

    User-defined unique identifier for the ImportContainer. * Keys can only contain alphanumeric characters (a-Z, 0-9), underscores and hyphens (_, -).

    * + * @return null|string */ public function getKey(); @@ -32,6 +33,7 @@ public function getKey(); *

    The resource type the ImportContainer is able to handle. * If not present, the ImportContainer is able to import all of the supported ImportResourceTypes.

    * + * @return null|string */ public function getResourceType(); @@ -39,6 +41,7 @@ public function getResourceType(); /** *

    The version of the ImportContainer.

    * + * @return null|int */ public function getVersion(); @@ -46,6 +49,7 @@ public function getVersion(); /** *

    The time when the ImportContainer was created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -53,6 +57,7 @@ public function getCreatedAt(); /** *

    The last time when the ImportContainer was modified.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); diff --git a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerBuilder.php b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerBuilder.php index cff84efa5b4..227e174e70b 100644 --- a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerBuilder.php +++ b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerBuilder.php @@ -22,26 +22,31 @@ final class ImportContainerBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $resourceType; /** + * @var ?int */ private $version; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; @@ -50,6 +55,7 @@ final class ImportContainerBuilder implements Builder *

    User-defined unique identifier for the ImportContainer. * Keys can only contain alphanumeric characters (a-Z, 0-9), underscores and hyphens (_, -).

    * + * @return null|string */ public function getKey() @@ -61,6 +67,7 @@ public function getKey() *

    The resource type the ImportContainer is able to handle. * If not present, the ImportContainer is able to import all of the supported ImportResourceTypes.

    * + * @return null|string */ public function getResourceType() @@ -71,6 +78,7 @@ public function getResourceType() /** *

    The version of the ImportContainer.

    * + * @return null|int */ public function getVersion() @@ -81,6 +89,7 @@ public function getVersion() /** *

    The time when the ImportContainer was created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -91,6 +100,7 @@ public function getCreatedAt() /** *

    The last time when the ImportContainer was modified.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() diff --git a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerDraft.php b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerDraft.php index 8cc1fe7d110..51ee0f0883e 100644 --- a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerDraft.php +++ b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerDraft.php @@ -20,6 +20,7 @@ interface ImportContainerDraft extends JsonObject *

    User-defined unique identifier of the ImportContainer. * Keys can only contain alphanumeric characters (a-Z, 0-9), underscores and hyphens (_, -).

    * + * @return null|string */ public function getKey(); @@ -28,6 +29,7 @@ public function getKey(); *

    The resource type to be imported. * If not given, the ImportContainer is able to import all of the supported ImportResourceTypes.

    * + * @return null|string */ public function getResourceType(); diff --git a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerDraftBuilder.php b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerDraftBuilder.php index f4b63e95fc2..cad651540df 100644 --- a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerDraftBuilder.php +++ b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerDraftBuilder.php @@ -21,11 +21,13 @@ final class ImportContainerDraftBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $resourceType; @@ -34,6 +36,7 @@ final class ImportContainerDraftBuilder implements Builder *

    User-defined unique identifier of the ImportContainer. * Keys can only contain alphanumeric characters (a-Z, 0-9), underscores and hyphens (_, -).

    * + * @return null|string */ public function getKey() @@ -45,6 +48,7 @@ public function getKey() *

    The resource type to be imported. * If not given, the ImportContainer is able to import all of the supported ImportResourceTypes.

    * + * @return null|string */ public function getResourceType() diff --git a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerDraftModel.php b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerDraftModel.php index a6b49144198..9c740642769 100644 --- a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerDraftModel.php +++ b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerDraftModel.php @@ -20,11 +20,13 @@ final class ImportContainerDraftModel extends JsonObjectModel implements ImportContainerDraft { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $resourceType; @@ -45,6 +47,7 @@ public function __construct( *

    User-defined unique identifier of the ImportContainer. * Keys can only contain alphanumeric characters (a-Z, 0-9), underscores and hyphens (_, -).

    * + * * @return null|string */ public function getKey() @@ -65,6 +68,7 @@ public function getKey() *

    The resource type to be imported. * If not given, the ImportContainer is able to import all of the supported ImportResourceTypes.

    * + * * @return null|string */ public function getResourceType() diff --git a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerModel.php b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerModel.php index 1116cc978eb..f3a00412215 100644 --- a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerModel.php +++ b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerModel.php @@ -21,26 +21,31 @@ final class ImportContainerModel extends JsonObjectModel implements ImportContainer { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $resourceType; /** + * * @var ?int */ protected $version; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; @@ -67,6 +72,7 @@ public function __construct( *

    User-defined unique identifier for the ImportContainer. * Keys can only contain alphanumeric characters (a-Z, 0-9), underscores and hyphens (_, -).

    * + * * @return null|string */ public function getKey() @@ -87,6 +93,7 @@ public function getKey() *

    The resource type the ImportContainer is able to handle. * If not present, the ImportContainer is able to import all of the supported ImportResourceTypes.

    * + * * @return null|string */ public function getResourceType() @@ -106,6 +113,7 @@ public function getResourceType() /** *

    The version of the ImportContainer.

    * + * * @return null|int */ public function getVersion() @@ -125,6 +133,7 @@ public function getVersion() /** *

    The time when the ImportContainer was created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -148,6 +157,7 @@ public function getCreatedAt() /** *

    The last time when the ImportContainer was modified.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() diff --git a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerPagedResponse.php b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerPagedResponse.php index 46809bf04c7..0110d7d910f 100644 --- a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerPagedResponse.php +++ b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerPagedResponse.php @@ -22,6 +22,7 @@ interface ImportContainerPagedResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    The actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -43,6 +46,7 @@ public function getCount(); /** *

    The total number of results matching the query.

    * + * @return null|int */ public function getTotal(); @@ -50,6 +54,7 @@ public function getTotal(); /** *

    The array of Import Containers matching the query.

    * + * @return null|ImportContainerCollection */ public function getResults(); diff --git a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerPagedResponseBuilder.php b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerPagedResponseBuilder.php index 45fa3bcfd4c..25d7fc24826 100644 --- a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerPagedResponseBuilder.php +++ b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerPagedResponseBuilder.php @@ -21,26 +21,31 @@ final class ImportContainerPagedResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?ImportContainerCollection */ private $results; @@ -48,6 +53,7 @@ final class ImportContainerPagedResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    The actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -78,6 +86,7 @@ public function getCount() /** *

    The total number of results matching the query.

    * + * @return null|int */ public function getTotal() @@ -88,6 +97,7 @@ public function getTotal() /** *

    The array of Import Containers matching the query.

    * + * @return null|ImportContainerCollection */ public function getResults() diff --git a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerPagedResponseModel.php b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerPagedResponseModel.php index b4febc39aba..2a268400c3f 100644 --- a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerPagedResponseModel.php +++ b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerPagedResponseModel.php @@ -20,26 +20,31 @@ final class ImportContainerPagedResponseModel extends JsonObjectModel implements ImportContainerPagedResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?ImportContainerCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    The actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -122,6 +130,7 @@ public function getCount() /** *

    The total number of results matching the query.

    * + * * @return null|int */ public function getTotal() @@ -141,6 +150,7 @@ public function getTotal() /** *

    The array of Import Containers matching the query.

    * + * * @return null|ImportContainerCollection */ public function getResults() diff --git a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerUpdateDraft.php b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerUpdateDraft.php index 852bffb8068..0834e783b96 100644 --- a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerUpdateDraft.php +++ b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerUpdateDraft.php @@ -19,6 +19,7 @@ interface ImportContainerUpdateDraft extends JsonObject /** *

    Current version of the ImportContainer.

    * + * @return null|int */ public function getVersion(); @@ -27,6 +28,7 @@ public function getVersion(); *

    The resource type to be imported. * If not given, the ImportContainer is able to import all of the supported ImportResourceTypes.

    * + * @return null|string */ public function getResourceType(); diff --git a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerUpdateDraftBuilder.php b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerUpdateDraftBuilder.php index 1124aab5344..4d4bd148a99 100644 --- a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerUpdateDraftBuilder.php +++ b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerUpdateDraftBuilder.php @@ -21,11 +21,13 @@ final class ImportContainerUpdateDraftBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?string */ private $resourceType; @@ -33,6 +35,7 @@ final class ImportContainerUpdateDraftBuilder implements Builder /** *

    Current version of the ImportContainer.

    * + * @return null|int */ public function getVersion() @@ -44,6 +47,7 @@ public function getVersion() *

    The resource type to be imported. * If not given, the ImportContainer is able to import all of the supported ImportResourceTypes.

    * + * @return null|string */ public function getResourceType() diff --git a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerUpdateDraftModel.php b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerUpdateDraftModel.php index c4d29ee7bf4..0b06227ba91 100644 --- a/lib/commercetools-import/src/Models/Importcontainers/ImportContainerUpdateDraftModel.php +++ b/lib/commercetools-import/src/Models/Importcontainers/ImportContainerUpdateDraftModel.php @@ -20,11 +20,13 @@ final class ImportContainerUpdateDraftModel extends JsonObjectModel implements ImportContainerUpdateDraft { /** + * * @var ?int */ protected $version; /** + * * @var ?string */ protected $resourceType; @@ -44,6 +46,7 @@ public function __construct( /** *

    Current version of the ImportContainer.

    * + * * @return null|int */ public function getVersion() @@ -64,6 +67,7 @@ public function getVersion() *

    The resource type to be imported. * If not given, the ImportContainer is able to import all of the supported ImportResourceTypes.

    * + * * @return null|string */ public function getResourceType() diff --git a/lib/commercetools-import/src/Models/Importoperations/ImportOperation.php b/lib/commercetools-import/src/Models/Importoperations/ImportOperation.php index 1712e9776a9..60b8fc986b7 100644 --- a/lib/commercetools-import/src/Models/Importoperations/ImportOperation.php +++ b/lib/commercetools-import/src/Models/Importoperations/ImportOperation.php @@ -31,6 +31,7 @@ interface ImportOperation extends JsonObject /** *

    The version of the ImportOperation.

    * + * @return null|int */ public function getVersion(); @@ -38,6 +39,7 @@ public function getVersion(); /** *

    The key of the importContainer.

    * + * @return null|string */ public function getImportContainerKey(); @@ -45,6 +47,7 @@ public function getImportContainerKey(); /** *

    The key of the resource.

    * + * @return null|string */ public function getResourceKey(); @@ -52,6 +55,7 @@ public function getResourceKey(); /** *

    The ID of the ImportOperation.

    * + * @return null|string */ public function getId(); @@ -59,13 +63,15 @@ public function getId(); /** *

    The import status of the resource. Set to rejected or validationFailed if the import of the resource was not successful.

    * + * @return null|string */ public function getState(); /** - *

    The version of the impmorted resource when the import was successful.

    + *

    The version of the imported resource when the import was successful.

    * + * @return null|int */ public function getResourceVersion(); @@ -73,6 +79,7 @@ public function getResourceVersion(); /** *

    Contains an error if the import of the resource was not successful. See Errors.

    * + * @return null|ErrorObjectCollection */ public function getErrors(); @@ -80,6 +87,7 @@ public function getErrors(); /** *

    In case of unresolved status this array will show the unresolved references

    * + * @return null|UnresolvedReferencesCollection */ public function getUnresolvedReferences(); @@ -87,6 +95,7 @@ public function getUnresolvedReferences(); /** *

    The time when the ImportOperation was created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt(); @@ -94,6 +103,7 @@ public function getCreatedAt(); /** *

    The last time When the ImportOperation was modified.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); @@ -101,6 +111,7 @@ public function getLastModifiedAt(); /** *

    The expiration time of the ImportOperation.

    * + * @return null|DateTimeImmutable */ public function getExpiresAt(); diff --git a/lib/commercetools-import/src/Models/Importoperations/ImportOperationBuilder.php b/lib/commercetools-import/src/Models/Importoperations/ImportOperationBuilder.php index fdcc562b157..5dac43e312c 100644 --- a/lib/commercetools-import/src/Models/Importoperations/ImportOperationBuilder.php +++ b/lib/commercetools-import/src/Models/Importoperations/ImportOperationBuilder.php @@ -24,56 +24,67 @@ final class ImportOperationBuilder implements Builder { /** + * @var ?int */ private $version; /** + * @var ?string */ private $importContainerKey; /** + * @var ?string */ private $resourceKey; /** + * @var ?string */ private $id; /** + * @var ?string */ private $state; /** + * @var ?int */ private $resourceVersion; /** + * @var ?ErrorObjectCollection */ private $errors; /** + * @var ?UnresolvedReferencesCollection */ private $unresolvedReferences; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; /** + * @var ?DateTimeImmutable */ private $expiresAt; @@ -81,6 +92,7 @@ final class ImportOperationBuilder implements Builder /** *

    The version of the ImportOperation.

    * + * @return null|int */ public function getVersion() @@ -91,6 +103,7 @@ public function getVersion() /** *

    The key of the importContainer.

    * + * @return null|string */ public function getImportContainerKey() @@ -101,6 +114,7 @@ public function getImportContainerKey() /** *

    The key of the resource.

    * + * @return null|string */ public function getResourceKey() @@ -111,6 +125,7 @@ public function getResourceKey() /** *

    The ID of the ImportOperation.

    * + * @return null|string */ public function getId() @@ -121,6 +136,7 @@ public function getId() /** *

    The import status of the resource. Set to rejected or validationFailed if the import of the resource was not successful.

    * + * @return null|string */ public function getState() @@ -129,8 +145,9 @@ public function getState() } /** - *

    The version of the impmorted resource when the import was successful.

    + *

    The version of the imported resource when the import was successful.

    * + * @return null|int */ public function getResourceVersion() @@ -141,6 +158,7 @@ public function getResourceVersion() /** *

    Contains an error if the import of the resource was not successful. See Errors.

    * + * @return null|ErrorObjectCollection */ public function getErrors() @@ -151,6 +169,7 @@ public function getErrors() /** *

    In case of unresolved status this array will show the unresolved references

    * + * @return null|UnresolvedReferencesCollection */ public function getUnresolvedReferences() @@ -161,6 +180,7 @@ public function getUnresolvedReferences() /** *

    The time when the ImportOperation was created.

    * + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -171,6 +191,7 @@ public function getCreatedAt() /** *

    The last time When the ImportOperation was modified.

    * + * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -181,6 +202,7 @@ public function getLastModifiedAt() /** *

    The expiration time of the ImportOperation.

    * + * @return null|DateTimeImmutable */ public function getExpiresAt() diff --git a/lib/commercetools-import/src/Models/Importoperations/ImportOperationModel.php b/lib/commercetools-import/src/Models/Importoperations/ImportOperationModel.php index dc23751e402..2e96ac9def3 100644 --- a/lib/commercetools-import/src/Models/Importoperations/ImportOperationModel.php +++ b/lib/commercetools-import/src/Models/Importoperations/ImportOperationModel.php @@ -23,56 +23,67 @@ final class ImportOperationModel extends JsonObjectModel implements ImportOperation { /** + * * @var ?int */ protected $version; /** + * * @var ?string */ protected $importContainerKey; /** + * * @var ?string */ protected $resourceKey; /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $state; /** + * * @var ?int */ protected $resourceVersion; /** + * * @var ?ErrorObjectCollection */ protected $errors; /** + * * @var ?UnresolvedReferencesCollection */ protected $unresolvedReferences; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; /** + * * @var ?DateTimeImmutable */ protected $expiresAt; @@ -110,6 +121,7 @@ public function __construct( /** *

    The version of the ImportOperation.

    * + * * @return null|int */ public function getVersion() @@ -129,6 +141,7 @@ public function getVersion() /** *

    The key of the importContainer.

    * + * * @return null|string */ public function getImportContainerKey() @@ -148,6 +161,7 @@ public function getImportContainerKey() /** *

    The key of the resource.

    * + * * @return null|string */ public function getResourceKey() @@ -167,6 +181,7 @@ public function getResourceKey() /** *

    The ID of the ImportOperation.

    * + * * @return null|string */ public function getId() @@ -186,6 +201,7 @@ public function getId() /** *

    The import status of the resource. Set to rejected or validationFailed if the import of the resource was not successful.

    * + * * @return null|string */ public function getState() @@ -203,7 +219,8 @@ public function getState() } /** - *

    The version of the impmorted resource when the import was successful.

    + *

    The version of the imported resource when the import was successful.

    + * * * @return null|int */ @@ -224,6 +241,7 @@ public function getResourceVersion() /** *

    Contains an error if the import of the resource was not successful. See Errors.

    * + * * @return null|ErrorObjectCollection */ public function getErrors() @@ -243,6 +261,7 @@ public function getErrors() /** *

    In case of unresolved status this array will show the unresolved references

    * + * * @return null|UnresolvedReferencesCollection */ public function getUnresolvedReferences() @@ -262,6 +281,7 @@ public function getUnresolvedReferences() /** *

    The time when the ImportOperation was created.

    * + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -285,6 +305,7 @@ public function getCreatedAt() /** *

    The last time When the ImportOperation was modified.

    * + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() @@ -308,6 +329,7 @@ public function getLastModifiedAt() /** *

    The expiration time of the ImportOperation.

    * + * * @return null|DateTimeImmutable */ public function getExpiresAt() diff --git a/lib/commercetools-import/src/Models/Importoperations/ImportOperationPagedResponse.php b/lib/commercetools-import/src/Models/Importoperations/ImportOperationPagedResponse.php index 1ceb25d7f67..a8a4b48b31f 100644 --- a/lib/commercetools-import/src/Models/Importoperations/ImportOperationPagedResponse.php +++ b/lib/commercetools-import/src/Models/Importoperations/ImportOperationPagedResponse.php @@ -22,6 +22,7 @@ interface ImportOperationPagedResponse extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -29,6 +30,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -36,6 +38,7 @@ public function getOffset(); /** *

    The actual number of results returned.

    * + * @return null|int */ public function getCount(); @@ -43,6 +46,7 @@ public function getCount(); /** *

    The total number of import operations matching the query.

    * + * @return null|int */ public function getTotal(); @@ -50,6 +54,7 @@ public function getTotal(); /** *

    The array of Import Operations matching the query.

    * + * @return null|ImportOperationCollection */ public function getResults(); diff --git a/lib/commercetools-import/src/Models/Importoperations/ImportOperationPagedResponseBuilder.php b/lib/commercetools-import/src/Models/Importoperations/ImportOperationPagedResponseBuilder.php index bc3ea09f860..04e9af63961 100644 --- a/lib/commercetools-import/src/Models/Importoperations/ImportOperationPagedResponseBuilder.php +++ b/lib/commercetools-import/src/Models/Importoperations/ImportOperationPagedResponseBuilder.php @@ -21,26 +21,31 @@ final class ImportOperationPagedResponseBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?ImportOperationCollection */ private $results; @@ -48,6 +53,7 @@ final class ImportOperationPagedResponseBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -58,6 +64,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -68,6 +75,7 @@ public function getOffset() /** *

    The actual number of results returned.

    * + * @return null|int */ public function getCount() @@ -78,6 +86,7 @@ public function getCount() /** *

    The total number of import operations matching the query.

    * + * @return null|int */ public function getTotal() @@ -88,6 +97,7 @@ public function getTotal() /** *

    The array of Import Operations matching the query.

    * + * @return null|ImportOperationCollection */ public function getResults() diff --git a/lib/commercetools-import/src/Models/Importoperations/ImportOperationPagedResponseModel.php b/lib/commercetools-import/src/Models/Importoperations/ImportOperationPagedResponseModel.php index 81141b5c3c4..346f2cf5c8b 100644 --- a/lib/commercetools-import/src/Models/Importoperations/ImportOperationPagedResponseModel.php +++ b/lib/commercetools-import/src/Models/Importoperations/ImportOperationPagedResponseModel.php @@ -20,26 +20,31 @@ final class ImportOperationPagedResponseModel extends JsonObjectModel implements ImportOperationPagedResponse { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?ImportOperationCollection */ protected $results; @@ -65,6 +70,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -84,6 +90,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -103,6 +110,7 @@ public function getOffset() /** *

    The actual number of results returned.

    * + * * @return null|int */ public function getCount() @@ -122,6 +130,7 @@ public function getCount() /** *

    The total number of import operations matching the query.

    * + * * @return null|int */ public function getTotal() @@ -141,6 +150,7 @@ public function getTotal() /** *

    The array of Import Operations matching the query.

    * + * * @return null|ImportOperationCollection */ public function getResults() diff --git a/lib/commercetools-import/src/Models/Importoperations/ImportOperationStatus.php b/lib/commercetools-import/src/Models/Importoperations/ImportOperationStatus.php index 45aad1511c2..883659ec965 100644 --- a/lib/commercetools-import/src/Models/Importoperations/ImportOperationStatus.php +++ b/lib/commercetools-import/src/Models/Importoperations/ImportOperationStatus.php @@ -21,6 +21,7 @@ interface ImportOperationStatus extends JsonObject /** *

    The ID of the ImportOperation.

    * + * @return null|string */ public function getOperationId(); @@ -28,6 +29,7 @@ public function getOperationId(); /** *

    The validation state of the ImportOperation.

    * + * @return null|string */ public function getState(); @@ -36,6 +38,7 @@ public function getState(); *

    The validation errors for the ImportOperation. * See Errors.

    * + * @return null|ErrorObjectCollection */ public function getErrors(); diff --git a/lib/commercetools-import/src/Models/Importoperations/ImportOperationStatusBuilder.php b/lib/commercetools-import/src/Models/Importoperations/ImportOperationStatusBuilder.php index 17b90bbc7fc..9098d21cee7 100644 --- a/lib/commercetools-import/src/Models/Importoperations/ImportOperationStatusBuilder.php +++ b/lib/commercetools-import/src/Models/Importoperations/ImportOperationStatusBuilder.php @@ -22,16 +22,19 @@ final class ImportOperationStatusBuilder implements Builder { /** + * @var ?string */ private $operationId; /** + * @var ?string */ private $state; /** + * @var ?ErrorObjectCollection */ private $errors; @@ -39,6 +42,7 @@ final class ImportOperationStatusBuilder implements Builder /** *

    The ID of the ImportOperation.

    * + * @return null|string */ public function getOperationId() @@ -49,6 +53,7 @@ public function getOperationId() /** *

    The validation state of the ImportOperation.

    * + * @return null|string */ public function getState() @@ -60,6 +65,7 @@ public function getState() *

    The validation errors for the ImportOperation. * See Errors.

    * + * @return null|ErrorObjectCollection */ public function getErrors() diff --git a/lib/commercetools-import/src/Models/Importoperations/ImportOperationStatusModel.php b/lib/commercetools-import/src/Models/Importoperations/ImportOperationStatusModel.php index e93f0d6c269..fa753b19717 100644 --- a/lib/commercetools-import/src/Models/Importoperations/ImportOperationStatusModel.php +++ b/lib/commercetools-import/src/Models/Importoperations/ImportOperationStatusModel.php @@ -21,16 +21,19 @@ final class ImportOperationStatusModel extends JsonObjectModel implements ImportOperationStatus { /** + * * @var ?string */ protected $operationId; /** + * * @var ?string */ protected $state; /** + * * @var ?ErrorObjectCollection */ protected $errors; @@ -52,6 +55,7 @@ public function __construct( /** *

    The ID of the ImportOperation.

    * + * * @return null|string */ public function getOperationId() @@ -71,6 +75,7 @@ public function getOperationId() /** *

    The validation state of the ImportOperation.

    * + * * @return null|string */ public function getState() @@ -91,6 +96,7 @@ public function getState() *

    The validation errors for the ImportOperation. * See Errors.

    * + * * @return null|ErrorObjectCollection */ public function getErrors() diff --git a/lib/commercetools-import/src/Models/Importrequests/CategoryImportRequest.php b/lib/commercetools-import/src/Models/Importrequests/CategoryImportRequest.php index 84d69bc0160..b51e4f4f3b6 100644 --- a/lib/commercetools-import/src/Models/Importrequests/CategoryImportRequest.php +++ b/lib/commercetools-import/src/Models/Importrequests/CategoryImportRequest.php @@ -19,6 +19,7 @@ interface CategoryImportRequest extends ImportRequest /** *

    The category import resources of this request.

    * + * @return null|CategoryImportCollection */ public function getResources(); diff --git a/lib/commercetools-import/src/Models/Importrequests/CategoryImportRequestBuilder.php b/lib/commercetools-import/src/Models/Importrequests/CategoryImportRequestBuilder.php index 7082af9ba94..507df196acc 100644 --- a/lib/commercetools-import/src/Models/Importrequests/CategoryImportRequestBuilder.php +++ b/lib/commercetools-import/src/Models/Importrequests/CategoryImportRequestBuilder.php @@ -22,6 +22,7 @@ final class CategoryImportRequestBuilder implements Builder { /** + * @var ?CategoryImportCollection */ private $resources; @@ -29,6 +30,7 @@ final class CategoryImportRequestBuilder implements Builder /** *

    The category import resources of this request.

    * + * @return null|CategoryImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/CategoryImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/CategoryImportRequestModel.php index d05cc4d5eb9..7206a289e55 100644 --- a/lib/commercetools-import/src/Models/Importrequests/CategoryImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/CategoryImportRequestModel.php @@ -22,11 +22,13 @@ final class CategoryImportRequestModel extends JsonObjectModel implements Catego { public const DISCRIMINATOR_VALUE = 'category'; /** + * * @var ?string */ protected $type; /** + * * @var ?CategoryImportCollection */ protected $resources; @@ -36,15 +38,17 @@ final class CategoryImportRequestModel extends JsonObjectModel implements Catego * @psalm-suppress MissingParamType */ public function __construct( - ?CategoryImportCollection $resources = null + ?CategoryImportCollection $resources = null, + ?string $type = null ) { $this->resources = $resources; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of the import resource.

    * + * * @return null|string */ public function getType() @@ -64,6 +68,7 @@ public function getType() /** *

    The category import resources of this request.

    * + * * @return null|CategoryImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/CustomerImportRequest.php b/lib/commercetools-import/src/Models/Importrequests/CustomerImportRequest.php index ac95791b0cb..f15505ad8a9 100644 --- a/lib/commercetools-import/src/Models/Importrequests/CustomerImportRequest.php +++ b/lib/commercetools-import/src/Models/Importrequests/CustomerImportRequest.php @@ -19,6 +19,7 @@ interface CustomerImportRequest extends ImportRequest /** *

    The customer import resources of this request.

    * + * @return null|CustomerImportCollection */ public function getResources(); diff --git a/lib/commercetools-import/src/Models/Importrequests/CustomerImportRequestBuilder.php b/lib/commercetools-import/src/Models/Importrequests/CustomerImportRequestBuilder.php index 7b84297894d..ee65630c05e 100644 --- a/lib/commercetools-import/src/Models/Importrequests/CustomerImportRequestBuilder.php +++ b/lib/commercetools-import/src/Models/Importrequests/CustomerImportRequestBuilder.php @@ -22,6 +22,7 @@ final class CustomerImportRequestBuilder implements Builder { /** + * @var ?CustomerImportCollection */ private $resources; @@ -29,6 +30,7 @@ final class CustomerImportRequestBuilder implements Builder /** *

    The customer import resources of this request.

    * + * @return null|CustomerImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/CustomerImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/CustomerImportRequestModel.php index 82e41d5597a..62de8197092 100644 --- a/lib/commercetools-import/src/Models/Importrequests/CustomerImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/CustomerImportRequestModel.php @@ -22,11 +22,13 @@ final class CustomerImportRequestModel extends JsonObjectModel implements Custom { public const DISCRIMINATOR_VALUE = 'customer'; /** + * * @var ?string */ protected $type; /** + * * @var ?CustomerImportCollection */ protected $resources; @@ -36,15 +38,17 @@ final class CustomerImportRequestModel extends JsonObjectModel implements Custom * @psalm-suppress MissingParamType */ public function __construct( - ?CustomerImportCollection $resources = null + ?CustomerImportCollection $resources = null, + ?string $type = null ) { $this->resources = $resources; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of the import resource.

    * + * * @return null|string */ public function getType() @@ -64,6 +68,7 @@ public function getType() /** *

    The customer import resources of this request.

    * + * * @return null|CustomerImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/ImportRequest.php b/lib/commercetools-import/src/Models/Importrequests/ImportRequest.php index c577c2138e1..0784cb781db 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ImportRequest.php +++ b/lib/commercetools-import/src/Models/Importrequests/ImportRequest.php @@ -19,6 +19,7 @@ interface ImportRequest extends JsonObject /** *

    The type of the import resource.

    * + * @return null|string */ public function getType(); diff --git a/lib/commercetools-import/src/Models/Importrequests/ImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/ImportRequestModel.php index 0ea016b3e31..3c348942ab5 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/ImportRequestModel.php @@ -21,6 +21,7 @@ final class ImportRequestModel extends JsonObjectModel implements ImportRequest { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -41,19 +42,22 @@ final class ImportRequestModel extends JsonObjectModel implements ImportRequest 'product-type' => ProductTypeImportRequestModel::class, 'product-variant' => ProductVariantImportRequestModel::class, 'product-variant-patch' => ProductVariantPatchRequestModel::class, + 'standalone-price' => StandalonePriceImportRequestModel::class, ]; /** * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** *

    The type of the import resource.

    * + * * @return null|string */ public function getType() diff --git a/lib/commercetools-import/src/Models/Importrequests/ImportResponse.php b/lib/commercetools-import/src/Models/Importrequests/ImportResponse.php index 0731f25e015..21758a0e851 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ImportResponse.php +++ b/lib/commercetools-import/src/Models/Importrequests/ImportResponse.php @@ -17,6 +17,7 @@ interface ImportResponse extends JsonObject public const FIELD_OPERATION_STATUS = 'operationStatus'; /** + * @return null|ImportOperationStatusCollection */ public function getOperationStatus(); diff --git a/lib/commercetools-import/src/Models/Importrequests/ImportResponseBuilder.php b/lib/commercetools-import/src/Models/Importrequests/ImportResponseBuilder.php index 620d4196184..c287a5916ba 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ImportResponseBuilder.php +++ b/lib/commercetools-import/src/Models/Importrequests/ImportResponseBuilder.php @@ -22,11 +22,13 @@ final class ImportResponseBuilder implements Builder { /** + * @var ?ImportOperationStatusCollection */ private $operationStatus; /** + * @return null|ImportOperationStatusCollection */ public function getOperationStatus() diff --git a/lib/commercetools-import/src/Models/Importrequests/ImportResponseModel.php b/lib/commercetools-import/src/Models/Importrequests/ImportResponseModel.php index 2ea1848b3bd..a504da30526 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ImportResponseModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/ImportResponseModel.php @@ -21,6 +21,7 @@ final class ImportResponseModel extends JsonObjectModel implements ImportResponse { /** + * * @var ?ImportOperationStatusCollection */ protected $operationStatus; @@ -36,6 +37,7 @@ public function __construct( } /** + * * @return null|ImportOperationStatusCollection */ public function getOperationStatus() diff --git a/lib/commercetools-import/src/Models/Importrequests/InventoryImportRequest.php b/lib/commercetools-import/src/Models/Importrequests/InventoryImportRequest.php index 3c5ac81edee..8fff17b6723 100644 --- a/lib/commercetools-import/src/Models/Importrequests/InventoryImportRequest.php +++ b/lib/commercetools-import/src/Models/Importrequests/InventoryImportRequest.php @@ -19,6 +19,7 @@ interface InventoryImportRequest extends ImportRequest /** *

    The inventory import resources of this request.

    * + * @return null|InventoryImportCollection */ public function getResources(); diff --git a/lib/commercetools-import/src/Models/Importrequests/InventoryImportRequestBuilder.php b/lib/commercetools-import/src/Models/Importrequests/InventoryImportRequestBuilder.php index 18c150b2a2b..552b03b1e0b 100644 --- a/lib/commercetools-import/src/Models/Importrequests/InventoryImportRequestBuilder.php +++ b/lib/commercetools-import/src/Models/Importrequests/InventoryImportRequestBuilder.php @@ -22,6 +22,7 @@ final class InventoryImportRequestBuilder implements Builder { /** + * @var ?InventoryImportCollection */ private $resources; @@ -29,6 +30,7 @@ final class InventoryImportRequestBuilder implements Builder /** *

    The inventory import resources of this request.

    * + * @return null|InventoryImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/InventoryImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/InventoryImportRequestModel.php index 78c89bf7128..940d5874569 100644 --- a/lib/commercetools-import/src/Models/Importrequests/InventoryImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/InventoryImportRequestModel.php @@ -22,11 +22,13 @@ final class InventoryImportRequestModel extends JsonObjectModel implements Inven { public const DISCRIMINATOR_VALUE = 'inventory'; /** + * * @var ?string */ protected $type; /** + * * @var ?InventoryImportCollection */ protected $resources; @@ -36,15 +38,17 @@ final class InventoryImportRequestModel extends JsonObjectModel implements Inven * @psalm-suppress MissingParamType */ public function __construct( - ?InventoryImportCollection $resources = null + ?InventoryImportCollection $resources = null, + ?string $type = null ) { $this->resources = $resources; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of the import resource.

    * + * * @return null|string */ public function getType() @@ -64,6 +68,7 @@ public function getType() /** *

    The inventory import resources of this request.

    * + * * @return null|InventoryImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/OrderImportRequest.php b/lib/commercetools-import/src/Models/Importrequests/OrderImportRequest.php index 2cb8289f3f9..d887e5d389d 100644 --- a/lib/commercetools-import/src/Models/Importrequests/OrderImportRequest.php +++ b/lib/commercetools-import/src/Models/Importrequests/OrderImportRequest.php @@ -19,6 +19,7 @@ interface OrderImportRequest extends ImportRequest /** *

    The order import resources of this request.

    * + * @return null|OrderImportCollection */ public function getResources(); diff --git a/lib/commercetools-import/src/Models/Importrequests/OrderImportRequestBuilder.php b/lib/commercetools-import/src/Models/Importrequests/OrderImportRequestBuilder.php index b194e67a883..fa08dc0aa49 100644 --- a/lib/commercetools-import/src/Models/Importrequests/OrderImportRequestBuilder.php +++ b/lib/commercetools-import/src/Models/Importrequests/OrderImportRequestBuilder.php @@ -22,6 +22,7 @@ final class OrderImportRequestBuilder implements Builder { /** + * @var ?OrderImportCollection */ private $resources; @@ -29,6 +30,7 @@ final class OrderImportRequestBuilder implements Builder /** *

    The order import resources of this request.

    * + * @return null|OrderImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/OrderImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/OrderImportRequestModel.php index 5c450b59c8a..13ec5b57499 100644 --- a/lib/commercetools-import/src/Models/Importrequests/OrderImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/OrderImportRequestModel.php @@ -22,11 +22,13 @@ final class OrderImportRequestModel extends JsonObjectModel implements OrderImpo { public const DISCRIMINATOR_VALUE = 'order'; /** + * * @var ?string */ protected $type; /** + * * @var ?OrderImportCollection */ protected $resources; @@ -36,15 +38,17 @@ final class OrderImportRequestModel extends JsonObjectModel implements OrderImpo * @psalm-suppress MissingParamType */ public function __construct( - ?OrderImportCollection $resources = null + ?OrderImportCollection $resources = null, + ?string $type = null ) { $this->resources = $resources; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of the import resource.

    * + * * @return null|string */ public function getType() @@ -64,6 +68,7 @@ public function getType() /** *

    The order import resources of this request.

    * + * * @return null|OrderImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/OrderPatchImportRequest.php b/lib/commercetools-import/src/Models/Importrequests/OrderPatchImportRequest.php index 26495226aa7..62fdada4f18 100644 --- a/lib/commercetools-import/src/Models/Importrequests/OrderPatchImportRequest.php +++ b/lib/commercetools-import/src/Models/Importrequests/OrderPatchImportRequest.php @@ -19,6 +19,7 @@ interface OrderPatchImportRequest extends ImportRequest /** *

    The order patches of this request

    * + * @return null|OrderPatchImportCollection */ public function getPatches(); diff --git a/lib/commercetools-import/src/Models/Importrequests/OrderPatchImportRequestBuilder.php b/lib/commercetools-import/src/Models/Importrequests/OrderPatchImportRequestBuilder.php index 909d0d8fd53..2a228523109 100644 --- a/lib/commercetools-import/src/Models/Importrequests/OrderPatchImportRequestBuilder.php +++ b/lib/commercetools-import/src/Models/Importrequests/OrderPatchImportRequestBuilder.php @@ -22,6 +22,7 @@ final class OrderPatchImportRequestBuilder implements Builder { /** + * @var ?OrderPatchImportCollection */ private $patches; @@ -29,6 +30,7 @@ final class OrderPatchImportRequestBuilder implements Builder /** *

    The order patches of this request

    * + * @return null|OrderPatchImportCollection */ public function getPatches() diff --git a/lib/commercetools-import/src/Models/Importrequests/OrderPatchImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/OrderPatchImportRequestModel.php index a1206af4b78..d780ca24436 100644 --- a/lib/commercetools-import/src/Models/Importrequests/OrderPatchImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/OrderPatchImportRequestModel.php @@ -22,11 +22,13 @@ final class OrderPatchImportRequestModel extends JsonObjectModel implements Orde { public const DISCRIMINATOR_VALUE = 'order-patch'; /** + * * @var ?string */ protected $type; /** + * * @var ?OrderPatchImportCollection */ protected $patches; @@ -36,15 +38,17 @@ final class OrderPatchImportRequestModel extends JsonObjectModel implements Orde * @psalm-suppress MissingParamType */ public function __construct( - ?OrderPatchImportCollection $patches = null + ?OrderPatchImportCollection $patches = null, + ?string $type = null ) { $this->patches = $patches; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of the import resource.

    * + * * @return null|string */ public function getType() @@ -64,6 +68,7 @@ public function getType() /** *

    The order patches of this request

    * + * * @return null|OrderPatchImportCollection */ public function getPatches() diff --git a/lib/commercetools-import/src/Models/Importrequests/PriceImportRequest.php b/lib/commercetools-import/src/Models/Importrequests/PriceImportRequest.php index e3195b7834c..49e54ef1950 100644 --- a/lib/commercetools-import/src/Models/Importrequests/PriceImportRequest.php +++ b/lib/commercetools-import/src/Models/Importrequests/PriceImportRequest.php @@ -19,6 +19,7 @@ interface PriceImportRequest extends ImportRequest /** *

    The price import resources of this request.

    * + * @return null|PriceImportCollection */ public function getResources(); diff --git a/lib/commercetools-import/src/Models/Importrequests/PriceImportRequestBuilder.php b/lib/commercetools-import/src/Models/Importrequests/PriceImportRequestBuilder.php index 12bc6b4404b..338c134773f 100644 --- a/lib/commercetools-import/src/Models/Importrequests/PriceImportRequestBuilder.php +++ b/lib/commercetools-import/src/Models/Importrequests/PriceImportRequestBuilder.php @@ -22,6 +22,7 @@ final class PriceImportRequestBuilder implements Builder { /** + * @var ?PriceImportCollection */ private $resources; @@ -29,6 +30,7 @@ final class PriceImportRequestBuilder implements Builder /** *

    The price import resources of this request.

    * + * @return null|PriceImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/PriceImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/PriceImportRequestModel.php index 7be4edbe1dd..0a766596c9a 100644 --- a/lib/commercetools-import/src/Models/Importrequests/PriceImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/PriceImportRequestModel.php @@ -22,11 +22,13 @@ final class PriceImportRequestModel extends JsonObjectModel implements PriceImpo { public const DISCRIMINATOR_VALUE = 'price'; /** + * * @var ?string */ protected $type; /** + * * @var ?PriceImportCollection */ protected $resources; @@ -36,15 +38,17 @@ final class PriceImportRequestModel extends JsonObjectModel implements PriceImpo * @psalm-suppress MissingParamType */ public function __construct( - ?PriceImportCollection $resources = null + ?PriceImportCollection $resources = null, + ?string $type = null ) { $this->resources = $resources; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of the import resource.

    * + * * @return null|string */ public function getType() @@ -64,6 +68,7 @@ public function getType() /** *

    The price import resources of this request.

    * + * * @return null|PriceImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductDraftImportRequest.php b/lib/commercetools-import/src/Models/Importrequests/ProductDraftImportRequest.php index 3268ef2db90..2aa9bba6210 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductDraftImportRequest.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductDraftImportRequest.php @@ -19,6 +19,7 @@ interface ProductDraftImportRequest extends ImportRequest /** *

    The product draft import resources of this request.

    * + * @return null|ProductDraftImportCollection */ public function getResources(); diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductDraftImportRequestBuilder.php b/lib/commercetools-import/src/Models/Importrequests/ProductDraftImportRequestBuilder.php index 2ab3a6b0e5d..6fb3cab2904 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductDraftImportRequestBuilder.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductDraftImportRequestBuilder.php @@ -22,6 +22,7 @@ final class ProductDraftImportRequestBuilder implements Builder { /** + * @var ?ProductDraftImportCollection */ private $resources; @@ -29,6 +30,7 @@ final class ProductDraftImportRequestBuilder implements Builder /** *

    The product draft import resources of this request.

    * + * @return null|ProductDraftImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductDraftImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/ProductDraftImportRequestModel.php index 4dd61f4588b..a056cdb7c60 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductDraftImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductDraftImportRequestModel.php @@ -22,11 +22,13 @@ final class ProductDraftImportRequestModel extends JsonObjectModel implements Pr { public const DISCRIMINATOR_VALUE = 'product-draft'; /** + * * @var ?string */ protected $type; /** + * * @var ?ProductDraftImportCollection */ protected $resources; @@ -36,15 +38,17 @@ final class ProductDraftImportRequestModel extends JsonObjectModel implements Pr * @psalm-suppress MissingParamType */ public function __construct( - ?ProductDraftImportCollection $resources = null + ?ProductDraftImportCollection $resources = null, + ?string $type = null ) { $this->resources = $resources; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of the import resource.

    * + * * @return null|string */ public function getType() @@ -64,6 +68,7 @@ public function getType() /** *

    The product draft import resources of this request.

    * + * * @return null|ProductDraftImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductImportRequest.php b/lib/commercetools-import/src/Models/Importrequests/ProductImportRequest.php index c7550c05125..1e4379b979e 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductImportRequest.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductImportRequest.php @@ -19,6 +19,7 @@ interface ProductImportRequest extends ImportRequest /** *

    The product import resources of this request.

    * + * @return null|ProductImportCollection */ public function getResources(); diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductImportRequestBuilder.php b/lib/commercetools-import/src/Models/Importrequests/ProductImportRequestBuilder.php index 8461296aaef..2572f2c3b60 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductImportRequestBuilder.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductImportRequestBuilder.php @@ -22,6 +22,7 @@ final class ProductImportRequestBuilder implements Builder { /** + * @var ?ProductImportCollection */ private $resources; @@ -29,6 +30,7 @@ final class ProductImportRequestBuilder implements Builder /** *

    The product import resources of this request.

    * + * @return null|ProductImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/ProductImportRequestModel.php index bf86b0ee860..427ad9af99a 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductImportRequestModel.php @@ -22,11 +22,13 @@ final class ProductImportRequestModel extends JsonObjectModel implements Product { public const DISCRIMINATOR_VALUE = 'product'; /** + * * @var ?string */ protected $type; /** + * * @var ?ProductImportCollection */ protected $resources; @@ -36,15 +38,17 @@ final class ProductImportRequestModel extends JsonObjectModel implements Product * @psalm-suppress MissingParamType */ public function __construct( - ?ProductImportCollection $resources = null + ?ProductImportCollection $resources = null, + ?string $type = null ) { $this->resources = $resources; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of the import resource.

    * + * * @return null|string */ public function getType() @@ -64,6 +68,7 @@ public function getType() /** *

    The product import resources of this request.

    * + * * @return null|ProductImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductTypeImportRequest.php b/lib/commercetools-import/src/Models/Importrequests/ProductTypeImportRequest.php index 23c7b7f4e2d..8a7d92f72d2 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductTypeImportRequest.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductTypeImportRequest.php @@ -19,6 +19,7 @@ interface ProductTypeImportRequest extends ImportRequest /** *

    The product type import resources of this request.

    * + * @return null|ProductTypeImportCollection */ public function getResources(); diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductTypeImportRequestBuilder.php b/lib/commercetools-import/src/Models/Importrequests/ProductTypeImportRequestBuilder.php index 7edaab354bf..90c468bec80 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductTypeImportRequestBuilder.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductTypeImportRequestBuilder.php @@ -22,6 +22,7 @@ final class ProductTypeImportRequestBuilder implements Builder { /** + * @var ?ProductTypeImportCollection */ private $resources; @@ -29,6 +30,7 @@ final class ProductTypeImportRequestBuilder implements Builder /** *

    The product type import resources of this request.

    * + * @return null|ProductTypeImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductTypeImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/ProductTypeImportRequestModel.php index 995b9503615..fa3da10a20a 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductTypeImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductTypeImportRequestModel.php @@ -22,11 +22,13 @@ final class ProductTypeImportRequestModel extends JsonObjectModel implements Pro { public const DISCRIMINATOR_VALUE = 'product-type'; /** + * * @var ?string */ protected $type; /** + * * @var ?ProductTypeImportCollection */ protected $resources; @@ -36,15 +38,17 @@ final class ProductTypeImportRequestModel extends JsonObjectModel implements Pro * @psalm-suppress MissingParamType */ public function __construct( - ?ProductTypeImportCollection $resources = null + ?ProductTypeImportCollection $resources = null, + ?string $type = null ) { $this->resources = $resources; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of the import resource.

    * + * * @return null|string */ public function getType() @@ -64,6 +68,7 @@ public function getType() /** *

    The product type import resources of this request.

    * + * * @return null|ProductTypeImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductVariantImportRequest.php b/lib/commercetools-import/src/Models/Importrequests/ProductVariantImportRequest.php index 64c2f8fc481..2da1c7abeac 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductVariantImportRequest.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductVariantImportRequest.php @@ -19,6 +19,7 @@ interface ProductVariantImportRequest extends ImportRequest /** *

    The product variant import resources of this request.

    * + * @return null|ProductVariantImportCollection */ public function getResources(); diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductVariantImportRequestBuilder.php b/lib/commercetools-import/src/Models/Importrequests/ProductVariantImportRequestBuilder.php index f6d269c3c5b..10370cd44ba 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductVariantImportRequestBuilder.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductVariantImportRequestBuilder.php @@ -22,6 +22,7 @@ final class ProductVariantImportRequestBuilder implements Builder { /** + * @var ?ProductVariantImportCollection */ private $resources; @@ -29,6 +30,7 @@ final class ProductVariantImportRequestBuilder implements Builder /** *

    The product variant import resources of this request.

    * + * @return null|ProductVariantImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductVariantImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/ProductVariantImportRequestModel.php index 3e8cddf8127..ac39ce4df4e 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductVariantImportRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductVariantImportRequestModel.php @@ -22,11 +22,13 @@ final class ProductVariantImportRequestModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'product-variant'; /** + * * @var ?string */ protected $type; /** + * * @var ?ProductVariantImportCollection */ protected $resources; @@ -36,15 +38,17 @@ final class ProductVariantImportRequestModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?ProductVariantImportCollection $resources = null + ?ProductVariantImportCollection $resources = null, + ?string $type = null ) { $this->resources = $resources; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of the import resource.

    * + * * @return null|string */ public function getType() @@ -64,6 +68,7 @@ public function getType() /** *

    The product variant import resources of this request.

    * + * * @return null|ProductVariantImportCollection */ public function getResources() diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductVariantPatchRequest.php b/lib/commercetools-import/src/Models/Importrequests/ProductVariantPatchRequest.php index 8b044a56d1c..085183ebdd8 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductVariantPatchRequest.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductVariantPatchRequest.php @@ -19,6 +19,7 @@ interface ProductVariantPatchRequest extends ImportRequest /** *

    The product variant patches of this request.

    * + * @return null|ProductVariantPatchCollection */ public function getPatches(); diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductVariantPatchRequestBuilder.php b/lib/commercetools-import/src/Models/Importrequests/ProductVariantPatchRequestBuilder.php index 37e3eda2e34..523ca2ed767 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductVariantPatchRequestBuilder.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductVariantPatchRequestBuilder.php @@ -22,6 +22,7 @@ final class ProductVariantPatchRequestBuilder implements Builder { /** + * @var ?ProductVariantPatchCollection */ private $patches; @@ -29,6 +30,7 @@ final class ProductVariantPatchRequestBuilder implements Builder /** *

    The product variant patches of this request.

    * + * @return null|ProductVariantPatchCollection */ public function getPatches() diff --git a/lib/commercetools-import/src/Models/Importrequests/ProductVariantPatchRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/ProductVariantPatchRequestModel.php index 4abf9bfa176..9894891373f 100644 --- a/lib/commercetools-import/src/Models/Importrequests/ProductVariantPatchRequestModel.php +++ b/lib/commercetools-import/src/Models/Importrequests/ProductVariantPatchRequestModel.php @@ -22,11 +22,13 @@ final class ProductVariantPatchRequestModel extends JsonObjectModel implements P { public const DISCRIMINATOR_VALUE = 'product-variant-patch'; /** + * * @var ?string */ protected $type; /** + * * @var ?ProductVariantPatchCollection */ protected $patches; @@ -36,15 +38,17 @@ final class ProductVariantPatchRequestModel extends JsonObjectModel implements P * @psalm-suppress MissingParamType */ public function __construct( - ?ProductVariantPatchCollection $patches = null + ?ProductVariantPatchCollection $patches = null, + ?string $type = null ) { $this->patches = $patches; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** *

    The type of the import resource.

    * + * * @return null|string */ public function getType() @@ -64,6 +68,7 @@ public function getType() /** *

    The product variant patches of this request.

    * + * * @return null|ProductVariantPatchCollection */ public function getPatches() diff --git a/lib/commercetools-import/src/Models/Importrequests/StandalonePriceImportRequest.php b/lib/commercetools-import/src/Models/Importrequests/StandalonePriceImportRequest.php new file mode 100644 index 00000000000..77f447b0d42 --- /dev/null +++ b/lib/commercetools-import/src/Models/Importrequests/StandalonePriceImportRequest.php @@ -0,0 +1,31 @@ +The Standalone Price import resources of this request.

    + * + + * @return null|StandalonePriceImportCollection + */ + public function getResources(); + + /** + * @param ?StandalonePriceImportCollection $resources + */ + public function setResources(?StandalonePriceImportCollection $resources): void; +} diff --git a/lib/commercetools-import/src/Models/Importrequests/StandalonePriceImportRequestBuilder.php b/lib/commercetools-import/src/Models/Importrequests/StandalonePriceImportRequestBuilder.php new file mode 100644 index 00000000000..65b2902bf65 --- /dev/null +++ b/lib/commercetools-import/src/Models/Importrequests/StandalonePriceImportRequestBuilder.php @@ -0,0 +1,64 @@ + + */ +final class StandalonePriceImportRequestBuilder implements Builder +{ + /** + + * @var ?StandalonePriceImportCollection + */ + private $resources; + + /** + *

    The Standalone Price import resources of this request.

    + * + + * @return null|StandalonePriceImportCollection + */ + public function getResources() + { + return $this->resources; + } + + /** + * @param ?StandalonePriceImportCollection $resources + * @return $this + */ + public function withResources(?StandalonePriceImportCollection $resources) + { + $this->resources = $resources; + + return $this; + } + + + public function build(): StandalonePriceImportRequest + { + return new StandalonePriceImportRequestModel( + $this->resources + ); + } + + public static function of(): StandalonePriceImportRequestBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-import/src/Models/Importrequests/StandalonePriceImportRequestCollection.php b/lib/commercetools-import/src/Models/Importrequests/StandalonePriceImportRequestCollection.php new file mode 100644 index 00000000000..72ab7a63482 --- /dev/null +++ b/lib/commercetools-import/src/Models/Importrequests/StandalonePriceImportRequestCollection.php @@ -0,0 +1,56 @@ + + * @method StandalonePriceImportRequest current() + * @method StandalonePriceImportRequest end() + * @method StandalonePriceImportRequest at($offset) + */ +class StandalonePriceImportRequestCollection extends ImportRequestCollection +{ + /** + * @psalm-assert StandalonePriceImportRequest $value + * @psalm-param StandalonePriceImportRequest|stdClass $value + * @throws InvalidArgumentException + * + * @return StandalonePriceImportRequestCollection + */ + public function add($value) + { + if (!$value instanceof StandalonePriceImportRequest) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StandalonePriceImportRequest + */ + protected function mapper() + { + return function (?int $index): ?StandalonePriceImportRequest { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StandalonePriceImportRequest $data */ + $data = StandalonePriceImportRequestModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-import/src/Models/Importrequests/StandalonePriceImportRequestModel.php b/lib/commercetools-import/src/Models/Importrequests/StandalonePriceImportRequestModel.php new file mode 100644 index 00000000000..87d270e1b06 --- /dev/null +++ b/lib/commercetools-import/src/Models/Importrequests/StandalonePriceImportRequestModel.php @@ -0,0 +1,96 @@ +resources = $resources; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

    The type of the import resource.

    + * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

    The Standalone Price import resources of this request.

    + * + * + * @return null|StandalonePriceImportCollection + */ + public function getResources() + { + if (is_null($this->resources)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_RESOURCES); + if (is_null($data)) { + return null; + } + $this->resources = StandalonePriceImportCollection::fromArray($data); + } + + return $this->resources; + } + + + /** + * @param ?StandalonePriceImportCollection $resources + */ + public function setResources(?StandalonePriceImportCollection $resources): void + { + $this->resources = $resources; + } +} diff --git a/lib/commercetools-import/src/Models/Importsummaries/ImportSummary.php b/lib/commercetools-import/src/Models/Importsummaries/ImportSummary.php index 336157b8759..07755a4c92f 100644 --- a/lib/commercetools-import/src/Models/Importsummaries/ImportSummary.php +++ b/lib/commercetools-import/src/Models/Importsummaries/ImportSummary.php @@ -19,6 +19,7 @@ interface ImportSummary extends JsonObject /** *

    The import status of an ImportContainer given by the number of resources in each Processing State.

    * + * @return null|OperationStates */ public function getStates(); @@ -26,6 +27,7 @@ public function getStates(); /** *

    The total number of ImportOperations received for this Import Summary.

    * + * @return null|int */ public function getTotal(); diff --git a/lib/commercetools-import/src/Models/Importsummaries/ImportSummaryBuilder.php b/lib/commercetools-import/src/Models/Importsummaries/ImportSummaryBuilder.php index d3957327c74..d7a3213b205 100644 --- a/lib/commercetools-import/src/Models/Importsummaries/ImportSummaryBuilder.php +++ b/lib/commercetools-import/src/Models/Importsummaries/ImportSummaryBuilder.php @@ -21,11 +21,13 @@ final class ImportSummaryBuilder implements Builder { /** + * @var null|OperationStates|OperationStatesBuilder */ private $states; /** + * @var ?int */ private $total; @@ -33,6 +35,7 @@ final class ImportSummaryBuilder implements Builder /** *

    The import status of an ImportContainer given by the number of resources in each Processing State.

    * + * @return null|OperationStates */ public function getStates() @@ -43,6 +46,7 @@ public function getStates() /** *

    The total number of ImportOperations received for this Import Summary.

    * + * @return null|int */ public function getTotal() diff --git a/lib/commercetools-import/src/Models/Importsummaries/ImportSummaryModel.php b/lib/commercetools-import/src/Models/Importsummaries/ImportSummaryModel.php index 10061a0236f..c42add39191 100644 --- a/lib/commercetools-import/src/Models/Importsummaries/ImportSummaryModel.php +++ b/lib/commercetools-import/src/Models/Importsummaries/ImportSummaryModel.php @@ -20,11 +20,13 @@ final class ImportSummaryModel extends JsonObjectModel implements ImportSummary { /** + * * @var ?OperationStates */ protected $states; /** + * * @var ?int */ protected $total; @@ -44,6 +46,7 @@ public function __construct( /** *

    The import status of an ImportContainer given by the number of resources in each Processing State.

    * + * * @return null|OperationStates */ public function getStates() @@ -64,6 +67,7 @@ public function getStates() /** *

    The total number of ImportOperations received for this Import Summary.

    * + * * @return null|int */ public function getTotal() diff --git a/lib/commercetools-import/src/Models/Importsummaries/OperationStates.php b/lib/commercetools-import/src/Models/Importsummaries/OperationStates.php index a549d105512..b61739f42fc 100644 --- a/lib/commercetools-import/src/Models/Importsummaries/OperationStates.php +++ b/lib/commercetools-import/src/Models/Importsummaries/OperationStates.php @@ -23,6 +23,7 @@ interface OperationStates extends JsonObject /** *

    The number of resources in the processing state.

    * + * @return null|int */ public function getProcessing(); @@ -30,6 +31,7 @@ public function getProcessing(); /** *

    The number of resources in the validationFailed state.

    * + * @return null|int */ public function getValidationFailed(); @@ -37,6 +39,7 @@ public function getValidationFailed(); /** *

    The number of resources in the unresolved state.

    * + * @return null|int */ public function getUnresolved(); @@ -44,6 +47,7 @@ public function getUnresolved(); /** *

    The number of resources in the waitForMasterVariant state.

    * + * @return null|int */ public function getWaitForMasterVariant(); @@ -51,6 +55,7 @@ public function getWaitForMasterVariant(); /** *

    The number of resources in the imported state.

    * + * @return null|int */ public function getImported(); @@ -58,6 +63,7 @@ public function getImported(); /** *

    The number of resources in the rejected state.

    * + * @return null|int */ public function getRejected(); diff --git a/lib/commercetools-import/src/Models/Importsummaries/OperationStatesBuilder.php b/lib/commercetools-import/src/Models/Importsummaries/OperationStatesBuilder.php index e7650a6a837..a8f94ea2886 100644 --- a/lib/commercetools-import/src/Models/Importsummaries/OperationStatesBuilder.php +++ b/lib/commercetools-import/src/Models/Importsummaries/OperationStatesBuilder.php @@ -21,31 +21,37 @@ final class OperationStatesBuilder implements Builder { /** + * @var ?int */ private $processing; /** + * @var ?int */ private $validationFailed; /** + * @var ?int */ private $unresolved; /** + * @var ?int */ private $waitForMasterVariant; /** + * @var ?int */ private $imported; /** + * @var ?int */ private $rejected; @@ -53,6 +59,7 @@ final class OperationStatesBuilder implements Builder /** *

    The number of resources in the processing state.

    * + * @return null|int */ public function getProcessing() @@ -63,6 +70,7 @@ public function getProcessing() /** *

    The number of resources in the validationFailed state.

    * + * @return null|int */ public function getValidationFailed() @@ -73,6 +81,7 @@ public function getValidationFailed() /** *

    The number of resources in the unresolved state.

    * + * @return null|int */ public function getUnresolved() @@ -83,6 +92,7 @@ public function getUnresolved() /** *

    The number of resources in the waitForMasterVariant state.

    * + * @return null|int */ public function getWaitForMasterVariant() @@ -93,6 +103,7 @@ public function getWaitForMasterVariant() /** *

    The number of resources in the imported state.

    * + * @return null|int */ public function getImported() @@ -103,6 +114,7 @@ public function getImported() /** *

    The number of resources in the rejected state.

    * + * @return null|int */ public function getRejected() diff --git a/lib/commercetools-import/src/Models/Importsummaries/OperationStatesModel.php b/lib/commercetools-import/src/Models/Importsummaries/OperationStatesModel.php index 2fd56ff3383..7de8524da60 100644 --- a/lib/commercetools-import/src/Models/Importsummaries/OperationStatesModel.php +++ b/lib/commercetools-import/src/Models/Importsummaries/OperationStatesModel.php @@ -20,31 +20,37 @@ final class OperationStatesModel extends JsonObjectModel implements OperationStates { /** + * * @var ?int */ protected $processing; /** + * * @var ?int */ protected $validationFailed; /** + * * @var ?int */ protected $unresolved; /** + * * @var ?int */ protected $waitForMasterVariant; /** + * * @var ?int */ protected $imported; /** + * * @var ?int */ protected $rejected; @@ -72,6 +78,7 @@ public function __construct( /** *

    The number of resources in the processing state.

    * + * * @return null|int */ public function getProcessing() @@ -91,6 +98,7 @@ public function getProcessing() /** *

    The number of resources in the validationFailed state.

    * + * * @return null|int */ public function getValidationFailed() @@ -110,6 +118,7 @@ public function getValidationFailed() /** *

    The number of resources in the unresolved state.

    * + * * @return null|int */ public function getUnresolved() @@ -129,6 +138,7 @@ public function getUnresolved() /** *

    The number of resources in the waitForMasterVariant state.

    * + * * @return null|int */ public function getWaitForMasterVariant() @@ -148,6 +158,7 @@ public function getWaitForMasterVariant() /** *

    The number of resources in the imported state.

    * + * * @return null|int */ public function getImported() @@ -167,6 +178,7 @@ public function getImported() /** *

    The number of resources in the rejected state.

    * + * * @return null|int */ public function getRejected() diff --git a/lib/commercetools-import/src/Models/Inventories/InventoryImport.php b/lib/commercetools-import/src/Models/Inventories/InventoryImport.php index a9e33ee6061..6a7926e026f 100644 --- a/lib/commercetools-import/src/Models/Inventories/InventoryImport.php +++ b/lib/commercetools-import/src/Models/Inventories/InventoryImport.php @@ -27,6 +27,7 @@ interface InventoryImport extends ImportResource /** *

    Maps to Inventory.sku

    * + * @return null|string */ public function getSku(); @@ -34,6 +35,7 @@ public function getSku(); /** *

    Maps to Inventory.quantityOnStock

    * + * @return null|int */ public function getQuantityOnStock(); @@ -41,6 +43,7 @@ public function getQuantityOnStock(); /** *

    Maps to Inventory.restockableInDays

    * + * @return null|int */ public function getRestockableInDays(); @@ -48,6 +51,7 @@ public function getRestockableInDays(); /** *

    Maps to Inventory.expectedDelivery

    * + * @return null|DateTimeImmutable */ public function getExpectedDelivery(); @@ -55,6 +59,7 @@ public function getExpectedDelivery(); /** *

    Maps to Inventory.supplyChannel

    * + * @return null|ChannelKeyReference */ public function getSupplyChannel(); @@ -62,6 +67,7 @@ public function getSupplyChannel(); /** *

    Maps to Inventory.custom.

    * + * @return null|Custom */ public function getCustom(); diff --git a/lib/commercetools-import/src/Models/Inventories/InventoryImportBuilder.php b/lib/commercetools-import/src/Models/Inventories/InventoryImportBuilder.php index 11a7288eb99..655edf0b226 100644 --- a/lib/commercetools-import/src/Models/Inventories/InventoryImportBuilder.php +++ b/lib/commercetools-import/src/Models/Inventories/InventoryImportBuilder.php @@ -28,41 +28,51 @@ final class InventoryImportBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $sku; /** + * @var ?int */ private $quantityOnStock; /** + * @var ?int */ private $restockableInDays; /** + * @var ?DateTimeImmutable */ private $expectedDelivery; /** + * @var null|ChannelKeyReference|ChannelKeyReferenceBuilder */ private $supplyChannel; /** + * @var null|Custom|CustomBuilder */ private $custom; /** + *

    User-defined unique identifier.

    + * + * @return null|string */ public function getKey() @@ -73,6 +83,7 @@ public function getKey() /** *

    Maps to Inventory.sku

    * + * @return null|string */ public function getSku() @@ -83,6 +94,7 @@ public function getSku() /** *

    Maps to Inventory.quantityOnStock

    * + * @return null|int */ public function getQuantityOnStock() @@ -93,6 +105,7 @@ public function getQuantityOnStock() /** *

    Maps to Inventory.restockableInDays

    * + * @return null|int */ public function getRestockableInDays() @@ -103,6 +116,7 @@ public function getRestockableInDays() /** *

    Maps to Inventory.expectedDelivery

    * + * @return null|DateTimeImmutable */ public function getExpectedDelivery() @@ -113,6 +127,7 @@ public function getExpectedDelivery() /** *

    Maps to Inventory.supplyChannel

    * + * @return null|ChannelKeyReference */ public function getSupplyChannel() @@ -123,6 +138,7 @@ public function getSupplyChannel() /** *

    Maps to Inventory.custom.

    * + * @return null|Custom */ public function getCustom() diff --git a/lib/commercetools-import/src/Models/Inventories/InventoryImportModel.php b/lib/commercetools-import/src/Models/Inventories/InventoryImportModel.php index 3aec062eeeb..a3c59a39394 100644 --- a/lib/commercetools-import/src/Models/Inventories/InventoryImportModel.php +++ b/lib/commercetools-import/src/Models/Inventories/InventoryImportModel.php @@ -27,36 +27,43 @@ final class InventoryImportModel extends JsonObjectModel implements InventoryImport { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $sku; /** + * * @var ?int */ protected $quantityOnStock; /** + * * @var ?int */ protected $restockableInDays; /** + * * @var ?DateTimeImmutable */ protected $expectedDelivery; /** + * * @var ?ChannelKeyReference */ protected $supplyChannel; /** + * * @var ?Custom */ protected $custom; @@ -84,6 +91,9 @@ public function __construct( } /** + *

    User-defined unique identifier.

    + * + * * @return null|string */ public function getKey() @@ -103,6 +113,7 @@ public function getKey() /** *

    Maps to Inventory.sku

    * + * * @return null|string */ public function getSku() @@ -122,6 +133,7 @@ public function getSku() /** *

    Maps to Inventory.quantityOnStock

    * + * * @return null|int */ public function getQuantityOnStock() @@ -141,6 +153,7 @@ public function getQuantityOnStock() /** *

    Maps to Inventory.restockableInDays

    * + * * @return null|int */ public function getRestockableInDays() @@ -160,6 +173,7 @@ public function getRestockableInDays() /** *

    Maps to Inventory.expectedDelivery

    * + * * @return null|DateTimeImmutable */ public function getExpectedDelivery() @@ -183,6 +197,7 @@ public function getExpectedDelivery() /** *

    Maps to Inventory.supplyChannel

    * + * * @return null|ChannelKeyReference */ public function getSupplyChannel() @@ -203,6 +218,7 @@ public function getSupplyChannel() /** *

    Maps to Inventory.custom.

    * + * * @return null|Custom */ public function getCustom() diff --git a/lib/commercetools-import/src/Models/OrderPatches/DeliveryAddressDraft.php b/lib/commercetools-import/src/Models/OrderPatches/DeliveryAddressDraft.php index c94968768ae..2f325594aa6 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/DeliveryAddressDraft.php +++ b/lib/commercetools-import/src/Models/OrderPatches/DeliveryAddressDraft.php @@ -18,11 +18,13 @@ interface DeliveryAddressDraft extends JsonObject public const FIELD_ADDRESS = 'address'; /** + * @return null|string */ public function getDeliveryId(); /** + * @return null|Address */ public function getAddress(); diff --git a/lib/commercetools-import/src/Models/OrderPatches/DeliveryAddressDraftBuilder.php b/lib/commercetools-import/src/Models/OrderPatches/DeliveryAddressDraftBuilder.php index 757b90910db..84153dc3695 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/DeliveryAddressDraftBuilder.php +++ b/lib/commercetools-import/src/Models/OrderPatches/DeliveryAddressDraftBuilder.php @@ -23,16 +23,19 @@ final class DeliveryAddressDraftBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var null|Address|AddressBuilder */ private $address; /** + * @return null|string */ public function getDeliveryId() @@ -41,6 +44,7 @@ public function getDeliveryId() } /** + * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-import/src/Models/OrderPatches/DeliveryAddressDraftModel.php b/lib/commercetools-import/src/Models/OrderPatches/DeliveryAddressDraftModel.php index a0bdbea9b29..60097b2ca8b 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/DeliveryAddressDraftModel.php +++ b/lib/commercetools-import/src/Models/OrderPatches/DeliveryAddressDraftModel.php @@ -22,11 +22,13 @@ final class DeliveryAddressDraftModel extends JsonObjectModel implements DeliveryAddressDraft { /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?Address */ protected $address; @@ -44,6 +46,7 @@ public function __construct( } /** + * * @return null|string */ public function getDeliveryId() @@ -61,6 +64,7 @@ public function getDeliveryId() } /** + * * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-import/src/Models/OrderPatches/DeliveryDraft.php b/lib/commercetools-import/src/Models/OrderPatches/DeliveryDraft.php index 8aa9bcd1b84..4fa72d3c3e9 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/DeliveryDraft.php +++ b/lib/commercetools-import/src/Models/OrderPatches/DeliveryDraft.php @@ -20,16 +20,19 @@ interface DeliveryDraft extends JsonObject public const FIELD_PARCELS = 'parcels'; /** + * @return null|DeliveryItemCollection */ public function getItems(); /** + * @return null|Address */ public function getAddress(); /** + * @return null|DeliveryParcelDraftCollection */ public function getParcels(); diff --git a/lib/commercetools-import/src/Models/OrderPatches/DeliveryDraftBuilder.php b/lib/commercetools-import/src/Models/OrderPatches/DeliveryDraftBuilder.php index acb43c0f6be..fe7e89b6c29 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/DeliveryDraftBuilder.php +++ b/lib/commercetools-import/src/Models/OrderPatches/DeliveryDraftBuilder.php @@ -24,21 +24,25 @@ final class DeliveryDraftBuilder implements Builder { /** + * @var ?DeliveryItemCollection */ private $items; /** + * @var null|Address|AddressBuilder */ private $address; /** + * @var ?DeliveryParcelDraftCollection */ private $parcels; /** + * @return null|DeliveryItemCollection */ public function getItems() @@ -47,6 +51,7 @@ public function getItems() } /** + * @return null|Address */ public function getAddress() @@ -55,6 +60,7 @@ public function getAddress() } /** + * @return null|DeliveryParcelDraftCollection */ public function getParcels() diff --git a/lib/commercetools-import/src/Models/OrderPatches/DeliveryDraftModel.php b/lib/commercetools-import/src/Models/OrderPatches/DeliveryDraftModel.php index fb0a257dd1c..40256d13bc9 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/DeliveryDraftModel.php +++ b/lib/commercetools-import/src/Models/OrderPatches/DeliveryDraftModel.php @@ -23,16 +23,19 @@ final class DeliveryDraftModel extends JsonObjectModel implements DeliveryDraft { /** + * * @var ?DeliveryItemCollection */ protected $items; /** + * * @var ?Address */ protected $address; /** + * * @var ?DeliveryParcelDraftCollection */ protected $parcels; @@ -52,6 +55,7 @@ public function __construct( } /** + * * @return null|DeliveryItemCollection */ public function getItems() @@ -69,6 +73,7 @@ public function getItems() } /** + * * @return null|Address */ public function getAddress() @@ -87,6 +92,7 @@ public function getAddress() } /** + * * @return null|DeliveryParcelDraftCollection */ public function getParcels() diff --git a/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcel.php b/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcel.php index 750ef562f17..a9e9797054c 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcel.php +++ b/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcel.php @@ -22,21 +22,25 @@ interface DeliveryParcel extends JsonObject public const FIELD_ITEMS = 'items'; /** + * @return null|string */ public function getDeliveryId(); /** + * @return null|ParcelMeasurements */ public function getMeasurements(); /** + * @return null|TrackingData */ public function getTrackingData(); /** + * @return null|DeliveryItemCollection */ public function getItems(); diff --git a/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelBuilder.php b/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelBuilder.php index b5050318f2b..09103fb10a0 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelBuilder.php +++ b/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelBuilder.php @@ -26,26 +26,31 @@ final class DeliveryParcelBuilder implements Builder { /** + * @var ?string */ private $deliveryId; /** + * @var null|ParcelMeasurements|ParcelMeasurementsBuilder */ private $measurements; /** + * @var null|TrackingData|TrackingDataBuilder */ private $trackingData; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @return null|string */ public function getDeliveryId() @@ -54,6 +59,7 @@ public function getDeliveryId() } /** + * @return null|ParcelMeasurements */ public function getMeasurements() @@ -62,6 +68,7 @@ public function getMeasurements() } /** + * @return null|TrackingData */ public function getTrackingData() @@ -70,6 +77,7 @@ public function getTrackingData() } /** + * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelDraft.php b/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelDraft.php index 731326fce06..0f8dbd6a24a 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelDraft.php +++ b/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelDraft.php @@ -21,16 +21,19 @@ interface DeliveryParcelDraft extends JsonObject public const FIELD_ITEMS = 'items'; /** + * @return null|ParcelMeasurements */ public function getMeasurements(); /** + * @return null|TrackingData */ public function getTrackingData(); /** + * @return null|DeliveryItemCollection */ public function getItems(); diff --git a/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelDraftBuilder.php b/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelDraftBuilder.php index 69c3352606b..9cc0c3bea9b 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelDraftBuilder.php +++ b/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelDraftBuilder.php @@ -26,21 +26,25 @@ final class DeliveryParcelDraftBuilder implements Builder { /** + * @var null|ParcelMeasurements|ParcelMeasurementsBuilder */ private $measurements; /** + * @var null|TrackingData|TrackingDataBuilder */ private $trackingData; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @return null|ParcelMeasurements */ public function getMeasurements() @@ -49,6 +53,7 @@ public function getMeasurements() } /** + * @return null|TrackingData */ public function getTrackingData() @@ -57,6 +62,7 @@ public function getTrackingData() } /** + * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelDraftModel.php b/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelDraftModel.php index 401884a784f..b76ef9ae253 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelDraftModel.php +++ b/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelDraftModel.php @@ -25,16 +25,19 @@ final class DeliveryParcelDraftModel extends JsonObjectModel implements DeliveryParcelDraft { /** + * * @var ?ParcelMeasurements */ protected $measurements; /** + * * @var ?TrackingData */ protected $trackingData; /** + * * @var ?DeliveryItemCollection */ protected $items; @@ -54,6 +57,7 @@ public function __construct( } /** + * * @return null|ParcelMeasurements */ public function getMeasurements() @@ -72,6 +76,7 @@ public function getMeasurements() } /** + * * @return null|TrackingData */ public function getTrackingData() @@ -90,6 +95,7 @@ public function getTrackingData() } /** + * * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelModel.php b/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelModel.php index 276318035eb..9dd46de032c 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelModel.php +++ b/lib/commercetools-import/src/Models/OrderPatches/DeliveryParcelModel.php @@ -25,21 +25,25 @@ final class DeliveryParcelModel extends JsonObjectModel implements DeliveryParcel { /** + * * @var ?string */ protected $deliveryId; /** + * * @var ?ParcelMeasurements */ protected $measurements; /** + * * @var ?TrackingData */ protected $trackingData; /** + * * @var ?DeliveryItemCollection */ protected $items; @@ -61,6 +65,7 @@ public function __construct( } /** + * * @return null|string */ public function getDeliveryId() @@ -78,6 +83,7 @@ public function getDeliveryId() } /** + * * @return null|ParcelMeasurements */ public function getMeasurements() @@ -96,6 +102,7 @@ public function getMeasurements() } /** + * * @return null|TrackingData */ public function getTrackingData() @@ -114,6 +121,7 @@ public function getTrackingData() } /** + * * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-import/src/Models/OrderPatches/OrderField.php b/lib/commercetools-import/src/Models/OrderPatches/OrderField.php index 72558d945fc..ad37b76de15 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/OrderField.php +++ b/lib/commercetools-import/src/Models/OrderPatches/OrderField.php @@ -26,6 +26,7 @@ interface OrderField extends JsonObject /** *

    Maps to Order.returnInfo

    * + * @return null|ReturnInfo */ public function getAddReturnInfo(); @@ -33,6 +34,7 @@ public function getAddReturnInfo(); /** *

    Maps to Order.delivery

    * + * @return null|DeliveryParcel */ public function getAddParcelToDelivery(); @@ -40,6 +42,7 @@ public function getAddParcelToDelivery(); /** *

    Maps to Order.delivery

    * + * @return null|DeliveryDraftCollection */ public function getAddDeliveries(); @@ -47,6 +50,7 @@ public function getAddDeliveries(); /** *

    Maps to Order.removeDelivery

    * + * @return null|RemoveDeliveryDraft */ public function getRemoveDelivery(); @@ -54,6 +58,7 @@ public function getRemoveDelivery(); /** *

    Maps to Order.removeParcelFromDelivery

    * + * @return null|RemoveParcelFromDeliveryDraft */ public function getRemoveParcelFromDelivery(); @@ -61,6 +66,7 @@ public function getRemoveParcelFromDelivery(); /** *

    Maps to Order.addressDraft

    * + * @return null|DeliveryAddressDraft */ public function getSetDeliveryAddress(); @@ -68,6 +74,7 @@ public function getSetDeliveryAddress(); /** *

    Maps to Order.parcelMeasurements

    * + * @return null|ParcelMeasurementDraft */ public function getSetParcelMeasurements(); @@ -75,6 +82,7 @@ public function getSetParcelMeasurements(); /** *

    Maps to Order.parcelTrackingData

    * + * @return null|ParcelTrackingData */ public function getSetParcelTrackingData(); @@ -82,6 +90,7 @@ public function getSetParcelTrackingData(); /** *

    Maps to Order.parcelItems

    * + * @return null|ParcelItemsCollection */ public function getSetParcelItems(); diff --git a/lib/commercetools-import/src/Models/OrderPatches/OrderFieldBuilder.php b/lib/commercetools-import/src/Models/OrderPatches/OrderFieldBuilder.php index c79b43138aa..f44ddcacebd 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/OrderFieldBuilder.php +++ b/lib/commercetools-import/src/Models/OrderPatches/OrderFieldBuilder.php @@ -21,46 +21,55 @@ final class OrderFieldBuilder implements Builder { /** + * @var null|ReturnInfo|ReturnInfoBuilder */ private $addReturnInfo; /** + * @var null|DeliveryParcel|DeliveryParcelBuilder */ private $addParcelToDelivery; /** + * @var ?DeliveryDraftCollection */ private $addDeliveries; /** + * @var null|RemoveDeliveryDraft|RemoveDeliveryDraftBuilder */ private $removeDelivery; /** + * @var null|RemoveParcelFromDeliveryDraft|RemoveParcelFromDeliveryDraftBuilder */ private $removeParcelFromDelivery; /** + * @var null|DeliveryAddressDraft|DeliveryAddressDraftBuilder */ private $setDeliveryAddress; /** + * @var null|ParcelMeasurementDraft|ParcelMeasurementDraftBuilder */ private $setParcelMeasurements; /** + * @var null|ParcelTrackingData|ParcelTrackingDataBuilder */ private $setParcelTrackingData; /** + * @var ?ParcelItemsCollection */ private $setParcelItems; @@ -68,6 +77,7 @@ final class OrderFieldBuilder implements Builder /** *

    Maps to Order.returnInfo

    * + * @return null|ReturnInfo */ public function getAddReturnInfo() @@ -78,6 +88,7 @@ public function getAddReturnInfo() /** *

    Maps to Order.delivery

    * + * @return null|DeliveryParcel */ public function getAddParcelToDelivery() @@ -88,6 +99,7 @@ public function getAddParcelToDelivery() /** *

    Maps to Order.delivery

    * + * @return null|DeliveryDraftCollection */ public function getAddDeliveries() @@ -98,6 +110,7 @@ public function getAddDeliveries() /** *

    Maps to Order.removeDelivery

    * + * @return null|RemoveDeliveryDraft */ public function getRemoveDelivery() @@ -108,6 +121,7 @@ public function getRemoveDelivery() /** *

    Maps to Order.removeParcelFromDelivery

    * + * @return null|RemoveParcelFromDeliveryDraft */ public function getRemoveParcelFromDelivery() @@ -118,6 +132,7 @@ public function getRemoveParcelFromDelivery() /** *

    Maps to Order.addressDraft

    * + * @return null|DeliveryAddressDraft */ public function getSetDeliveryAddress() @@ -128,6 +143,7 @@ public function getSetDeliveryAddress() /** *

    Maps to Order.parcelMeasurements

    * + * @return null|ParcelMeasurementDraft */ public function getSetParcelMeasurements() @@ -138,6 +154,7 @@ public function getSetParcelMeasurements() /** *

    Maps to Order.parcelTrackingData

    * + * @return null|ParcelTrackingData */ public function getSetParcelTrackingData() @@ -148,6 +165,7 @@ public function getSetParcelTrackingData() /** *

    Maps to Order.parcelItems

    * + * @return null|ParcelItemsCollection */ public function getSetParcelItems() diff --git a/lib/commercetools-import/src/Models/OrderPatches/OrderFieldModel.php b/lib/commercetools-import/src/Models/OrderPatches/OrderFieldModel.php index ff2232dcfcb..0d8d9a521b3 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/OrderFieldModel.php +++ b/lib/commercetools-import/src/Models/OrderPatches/OrderFieldModel.php @@ -20,46 +20,55 @@ final class OrderFieldModel extends JsonObjectModel implements OrderField { /** + * * @var ?ReturnInfo */ protected $addReturnInfo; /** + * * @var ?DeliveryParcel */ protected $addParcelToDelivery; /** + * * @var ?DeliveryDraftCollection */ protected $addDeliveries; /** + * * @var ?RemoveDeliveryDraft */ protected $removeDelivery; /** + * * @var ?RemoveParcelFromDeliveryDraft */ protected $removeParcelFromDelivery; /** + * * @var ?DeliveryAddressDraft */ protected $setDeliveryAddress; /** + * * @var ?ParcelMeasurementDraft */ protected $setParcelMeasurements; /** + * * @var ?ParcelTrackingData */ protected $setParcelTrackingData; /** + * * @var ?ParcelItemsCollection */ protected $setParcelItems; @@ -93,6 +102,7 @@ public function __construct( /** *

    Maps to Order.returnInfo

    * + * * @return null|ReturnInfo */ public function getAddReturnInfo() @@ -113,6 +123,7 @@ public function getAddReturnInfo() /** *

    Maps to Order.delivery

    * + * * @return null|DeliveryParcel */ public function getAddParcelToDelivery() @@ -133,6 +144,7 @@ public function getAddParcelToDelivery() /** *

    Maps to Order.delivery

    * + * * @return null|DeliveryDraftCollection */ public function getAddDeliveries() @@ -152,6 +164,7 @@ public function getAddDeliveries() /** *

    Maps to Order.removeDelivery

    * + * * @return null|RemoveDeliveryDraft */ public function getRemoveDelivery() @@ -172,6 +185,7 @@ public function getRemoveDelivery() /** *

    Maps to Order.removeParcelFromDelivery

    * + * * @return null|RemoveParcelFromDeliveryDraft */ public function getRemoveParcelFromDelivery() @@ -192,6 +206,7 @@ public function getRemoveParcelFromDelivery() /** *

    Maps to Order.addressDraft

    * + * * @return null|DeliveryAddressDraft */ public function getSetDeliveryAddress() @@ -212,6 +227,7 @@ public function getSetDeliveryAddress() /** *

    Maps to Order.parcelMeasurements

    * + * * @return null|ParcelMeasurementDraft */ public function getSetParcelMeasurements() @@ -232,6 +248,7 @@ public function getSetParcelMeasurements() /** *

    Maps to Order.parcelTrackingData

    * + * * @return null|ParcelTrackingData */ public function getSetParcelTrackingData() @@ -252,6 +269,7 @@ public function getSetParcelTrackingData() /** *

    Maps to Order.parcelItems

    * + * * @return null|ParcelItemsCollection */ public function getSetParcelItems() diff --git a/lib/commercetools-import/src/Models/OrderPatches/OrderPatchImport.php b/lib/commercetools-import/src/Models/OrderPatches/OrderPatchImport.php index 39505ed448a..a8165bc6275 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/OrderPatchImport.php +++ b/lib/commercetools-import/src/Models/OrderPatches/OrderPatchImport.php @@ -19,6 +19,7 @@ interface OrderPatchImport extends JsonObject /** *

    Maps to Order.orderNumber, String that uniquely identifies an order, unique across a project.

    * + * @return null|string */ public function getOrderNumber(); @@ -26,6 +27,7 @@ public function getOrderNumber(); /** *

    Each field referenced must be defined in an already existing order in the project or the import operation state is set to validationFailed.

    * + * @return null|OrderField */ public function getFields(); diff --git a/lib/commercetools-import/src/Models/OrderPatches/OrderPatchImportBuilder.php b/lib/commercetools-import/src/Models/OrderPatches/OrderPatchImportBuilder.php index b02e0e0ab4f..21253edaa8f 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/OrderPatchImportBuilder.php +++ b/lib/commercetools-import/src/Models/OrderPatches/OrderPatchImportBuilder.php @@ -21,11 +21,13 @@ final class OrderPatchImportBuilder implements Builder { /** + * @var ?string */ private $orderNumber; /** + * @var null|OrderField|OrderFieldBuilder */ private $fields; @@ -33,6 +35,7 @@ final class OrderPatchImportBuilder implements Builder /** *

    Maps to Order.orderNumber, String that uniquely identifies an order, unique across a project.

    * + * @return null|string */ public function getOrderNumber() @@ -43,6 +46,7 @@ public function getOrderNumber() /** *

    Each field referenced must be defined in an already existing order in the project or the import operation state is set to validationFailed.

    * + * @return null|OrderField */ public function getFields() diff --git a/lib/commercetools-import/src/Models/OrderPatches/OrderPatchImportModel.php b/lib/commercetools-import/src/Models/OrderPatches/OrderPatchImportModel.php index a84e0bb4306..ec31414f911 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/OrderPatchImportModel.php +++ b/lib/commercetools-import/src/Models/OrderPatches/OrderPatchImportModel.php @@ -20,11 +20,13 @@ final class OrderPatchImportModel extends JsonObjectModel implements OrderPatchImport { /** + * * @var ?string */ protected $orderNumber; /** + * * @var ?OrderField */ protected $fields; @@ -44,6 +46,7 @@ public function __construct( /** *

    Maps to Order.orderNumber, String that uniquely identifies an order, unique across a project.

    * + * * @return null|string */ public function getOrderNumber() @@ -63,6 +66,7 @@ public function getOrderNumber() /** *

    Each field referenced must be defined in an already existing order in the project or the import operation state is set to validationFailed.

    * + * * @return null|OrderField */ public function getFields() diff --git a/lib/commercetools-import/src/Models/OrderPatches/ParcelItems.php b/lib/commercetools-import/src/Models/OrderPatches/ParcelItems.php index f76bd7ffb22..ecc9e5ca153 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/ParcelItems.php +++ b/lib/commercetools-import/src/Models/OrderPatches/ParcelItems.php @@ -18,11 +18,13 @@ interface ParcelItems extends JsonObject public const FIELD_ITEMS = 'items'; /** + * @return null|string */ public function getParcelId(); /** + * @return null|DeliveryItemCollection */ public function getItems(); diff --git a/lib/commercetools-import/src/Models/OrderPatches/ParcelItemsBuilder.php b/lib/commercetools-import/src/Models/OrderPatches/ParcelItemsBuilder.php index ef17769a643..566876c72db 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/ParcelItemsBuilder.php +++ b/lib/commercetools-import/src/Models/OrderPatches/ParcelItemsBuilder.php @@ -22,16 +22,19 @@ final class ParcelItemsBuilder implements Builder { /** + * @var ?string */ private $parcelId; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @return null|string */ public function getParcelId() @@ -40,6 +43,7 @@ public function getParcelId() } /** + * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-import/src/Models/OrderPatches/ParcelItemsModel.php b/lib/commercetools-import/src/Models/OrderPatches/ParcelItemsModel.php index fbb447573f3..3d206df7010 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/ParcelItemsModel.php +++ b/lib/commercetools-import/src/Models/OrderPatches/ParcelItemsModel.php @@ -21,11 +21,13 @@ final class ParcelItemsModel extends JsonObjectModel implements ParcelItems { /** + * * @var ?string */ protected $parcelId; /** + * * @var ?DeliveryItemCollection */ protected $items; @@ -43,6 +45,7 @@ public function __construct( } /** + * * @return null|string */ public function getParcelId() @@ -60,6 +63,7 @@ public function getParcelId() } /** + * * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-import/src/Models/OrderPatches/ParcelMeasurementDraft.php b/lib/commercetools-import/src/Models/OrderPatches/ParcelMeasurementDraft.php index 56b73ce5aae..81b51217c3a 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/ParcelMeasurementDraft.php +++ b/lib/commercetools-import/src/Models/OrderPatches/ParcelMeasurementDraft.php @@ -18,11 +18,13 @@ interface ParcelMeasurementDraft extends JsonObject public const FIELD_MEASUREMENTS = 'measurements'; /** + * @return null|string */ public function getParcelId(); /** + * @return null|ParcelMeasurements */ public function getMeasurements(); diff --git a/lib/commercetools-import/src/Models/OrderPatches/ParcelMeasurementDraftBuilder.php b/lib/commercetools-import/src/Models/OrderPatches/ParcelMeasurementDraftBuilder.php index a77ee27a910..954e99a1cc2 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/ParcelMeasurementDraftBuilder.php +++ b/lib/commercetools-import/src/Models/OrderPatches/ParcelMeasurementDraftBuilder.php @@ -23,16 +23,19 @@ final class ParcelMeasurementDraftBuilder implements Builder { /** + * @var ?string */ private $parcelId; /** + * @var null|ParcelMeasurements|ParcelMeasurementsBuilder */ private $measurements; /** + * @return null|string */ public function getParcelId() @@ -41,6 +44,7 @@ public function getParcelId() } /** + * @return null|ParcelMeasurements */ public function getMeasurements() diff --git a/lib/commercetools-import/src/Models/OrderPatches/ParcelMeasurementDraftModel.php b/lib/commercetools-import/src/Models/OrderPatches/ParcelMeasurementDraftModel.php index ad5e5b75645..3f14664d03b 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/ParcelMeasurementDraftModel.php +++ b/lib/commercetools-import/src/Models/OrderPatches/ParcelMeasurementDraftModel.php @@ -22,11 +22,13 @@ final class ParcelMeasurementDraftModel extends JsonObjectModel implements ParcelMeasurementDraft { /** + * * @var ?string */ protected $parcelId; /** + * * @var ?ParcelMeasurements */ protected $measurements; @@ -44,6 +46,7 @@ public function __construct( } /** + * * @return null|string */ public function getParcelId() @@ -61,6 +64,7 @@ public function getParcelId() } /** + * * @return null|ParcelMeasurements */ public function getMeasurements() diff --git a/lib/commercetools-import/src/Models/OrderPatches/ParcelTrackingData.php b/lib/commercetools-import/src/Models/OrderPatches/ParcelTrackingData.php index 2d7067f3723..d0503902aae 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/ParcelTrackingData.php +++ b/lib/commercetools-import/src/Models/OrderPatches/ParcelTrackingData.php @@ -18,11 +18,13 @@ interface ParcelTrackingData extends JsonObject public const FIELD_TRACKING_DATA = 'trackingData'; /** + * @return null|string */ public function getParcelId(); /** + * @return null|TrackingData */ public function getTrackingData(); diff --git a/lib/commercetools-import/src/Models/OrderPatches/ParcelTrackingDataBuilder.php b/lib/commercetools-import/src/Models/OrderPatches/ParcelTrackingDataBuilder.php index f29faf1587f..0b6729ac6c4 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/ParcelTrackingDataBuilder.php +++ b/lib/commercetools-import/src/Models/OrderPatches/ParcelTrackingDataBuilder.php @@ -23,16 +23,19 @@ final class ParcelTrackingDataBuilder implements Builder { /** + * @var ?string */ private $parcelId; /** + * @var null|TrackingData|TrackingDataBuilder */ private $trackingData; /** + * @return null|string */ public function getParcelId() @@ -41,6 +44,7 @@ public function getParcelId() } /** + * @return null|TrackingData */ public function getTrackingData() diff --git a/lib/commercetools-import/src/Models/OrderPatches/ParcelTrackingDataModel.php b/lib/commercetools-import/src/Models/OrderPatches/ParcelTrackingDataModel.php index b7b68af04d3..35c85517f1f 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/ParcelTrackingDataModel.php +++ b/lib/commercetools-import/src/Models/OrderPatches/ParcelTrackingDataModel.php @@ -22,11 +22,13 @@ final class ParcelTrackingDataModel extends JsonObjectModel implements ParcelTrackingData { /** + * * @var ?string */ protected $parcelId; /** + * * @var ?TrackingData */ protected $trackingData; @@ -44,6 +46,7 @@ public function __construct( } /** + * * @return null|string */ public function getParcelId() @@ -61,6 +64,7 @@ public function getParcelId() } /** + * * @return null|TrackingData */ public function getTrackingData() diff --git a/lib/commercetools-import/src/Models/OrderPatches/RemoveDeliveryDraft.php b/lib/commercetools-import/src/Models/OrderPatches/RemoveDeliveryDraft.php index af1dffe059d..2266e83cf8c 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/RemoveDeliveryDraft.php +++ b/lib/commercetools-import/src/Models/OrderPatches/RemoveDeliveryDraft.php @@ -16,6 +16,7 @@ interface RemoveDeliveryDraft extends JsonObject public const FIELD_ID = 'id'; /** + * @return null|string */ public function getId(); diff --git a/lib/commercetools-import/src/Models/OrderPatches/RemoveDeliveryDraftBuilder.php b/lib/commercetools-import/src/Models/OrderPatches/RemoveDeliveryDraftBuilder.php index 10d6617d00c..327b4de0708 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/RemoveDeliveryDraftBuilder.php +++ b/lib/commercetools-import/src/Models/OrderPatches/RemoveDeliveryDraftBuilder.php @@ -21,11 +21,13 @@ final class RemoveDeliveryDraftBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @return null|string */ public function getId() diff --git a/lib/commercetools-import/src/Models/OrderPatches/RemoveDeliveryDraftModel.php b/lib/commercetools-import/src/Models/OrderPatches/RemoveDeliveryDraftModel.php index 86761bbf5c0..81da6b163d8 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/RemoveDeliveryDraftModel.php +++ b/lib/commercetools-import/src/Models/OrderPatches/RemoveDeliveryDraftModel.php @@ -20,6 +20,7 @@ final class RemoveDeliveryDraftModel extends JsonObjectModel implements RemoveDeliveryDraft { /** + * * @var ?string */ protected $id; @@ -35,6 +36,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() diff --git a/lib/commercetools-import/src/Models/OrderPatches/RemoveParcelFromDeliveryDraft.php b/lib/commercetools-import/src/Models/OrderPatches/RemoveParcelFromDeliveryDraft.php index f4a9d7b3419..2ce1e602c63 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/RemoveParcelFromDeliveryDraft.php +++ b/lib/commercetools-import/src/Models/OrderPatches/RemoveParcelFromDeliveryDraft.php @@ -16,6 +16,7 @@ interface RemoveParcelFromDeliveryDraft extends JsonObject public const FIELD_PARCEL_ID = 'parcelId'; /** + * @return null|string */ public function getParcelId(); diff --git a/lib/commercetools-import/src/Models/OrderPatches/RemoveParcelFromDeliveryDraftBuilder.php b/lib/commercetools-import/src/Models/OrderPatches/RemoveParcelFromDeliveryDraftBuilder.php index c388fadda47..71826a5adad 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/RemoveParcelFromDeliveryDraftBuilder.php +++ b/lib/commercetools-import/src/Models/OrderPatches/RemoveParcelFromDeliveryDraftBuilder.php @@ -21,11 +21,13 @@ final class RemoveParcelFromDeliveryDraftBuilder implements Builder { /** + * @var ?string */ private $parcelId; /** + * @return null|string */ public function getParcelId() diff --git a/lib/commercetools-import/src/Models/OrderPatches/RemoveParcelFromDeliveryDraftModel.php b/lib/commercetools-import/src/Models/OrderPatches/RemoveParcelFromDeliveryDraftModel.php index fd425ce4460..4239fe06614 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/RemoveParcelFromDeliveryDraftModel.php +++ b/lib/commercetools-import/src/Models/OrderPatches/RemoveParcelFromDeliveryDraftModel.php @@ -20,6 +20,7 @@ final class RemoveParcelFromDeliveryDraftModel extends JsonObjectModel implements RemoveParcelFromDeliveryDraft { /** + * * @var ?string */ protected $parcelId; @@ -35,6 +36,7 @@ public function __construct( } /** + * * @return null|string */ public function getParcelId() diff --git a/lib/commercetools-import/src/Models/OrderPatches/ReturnInfo.php b/lib/commercetools-import/src/Models/OrderPatches/ReturnInfo.php index ed8c7834aab..cee84506b21 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/ReturnInfo.php +++ b/lib/commercetools-import/src/Models/OrderPatches/ReturnInfo.php @@ -19,6 +19,7 @@ interface ReturnInfo extends JsonObject public const FIELD_RETURN_DATE = 'returnDate'; /** + * @return null|ReturnItemDraftCollection */ public function getItems(); @@ -26,6 +27,7 @@ public function getItems(); /** *

    Maps to ReturnInfo.returnTrackingId

    * + * @return null|string */ public function getReturnTrackingId(); @@ -33,6 +35,7 @@ public function getReturnTrackingId(); /** *

    Maps to ReturnInfo.returnDate

    * + * @return null|DateTimeImmutable */ public function getReturnDate(); diff --git a/lib/commercetools-import/src/Models/OrderPatches/ReturnInfoBuilder.php b/lib/commercetools-import/src/Models/OrderPatches/ReturnInfoBuilder.php index 2f2346db79d..e41015d110c 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/ReturnInfoBuilder.php +++ b/lib/commercetools-import/src/Models/OrderPatches/ReturnInfoBuilder.php @@ -22,21 +22,25 @@ final class ReturnInfoBuilder implements Builder { /** + * @var ?ReturnItemDraftCollection */ private $items; /** + * @var ?string */ private $returnTrackingId; /** + * @var ?DateTimeImmutable */ private $returnDate; /** + * @return null|ReturnItemDraftCollection */ public function getItems() @@ -47,6 +51,7 @@ public function getItems() /** *

    Maps to ReturnInfo.returnTrackingId

    * + * @return null|string */ public function getReturnTrackingId() @@ -57,6 +62,7 @@ public function getReturnTrackingId() /** *

    Maps to ReturnInfo.returnDate

    * + * @return null|DateTimeImmutable */ public function getReturnDate() diff --git a/lib/commercetools-import/src/Models/OrderPatches/ReturnInfoModel.php b/lib/commercetools-import/src/Models/OrderPatches/ReturnInfoModel.php index b1530b65048..9bb07f31cf3 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/ReturnInfoModel.php +++ b/lib/commercetools-import/src/Models/OrderPatches/ReturnInfoModel.php @@ -21,16 +21,19 @@ final class ReturnInfoModel extends JsonObjectModel implements ReturnInfo { /** + * * @var ?ReturnItemDraftCollection */ protected $items; /** + * * @var ?string */ protected $returnTrackingId; /** + * * @var ?DateTimeImmutable */ protected $returnDate; @@ -50,6 +53,7 @@ public function __construct( } /** + * * @return null|ReturnItemDraftCollection */ public function getItems() @@ -69,6 +73,7 @@ public function getItems() /** *

    Maps to ReturnInfo.returnTrackingId

    * + * * @return null|string */ public function getReturnTrackingId() @@ -88,6 +93,7 @@ public function getReturnTrackingId() /** *

    Maps to ReturnInfo.returnDate

    * + * * @return null|DateTimeImmutable */ public function getReturnDate() diff --git a/lib/commercetools-import/src/Models/OrderPatches/ReturnItemDraft.php b/lib/commercetools-import/src/Models/OrderPatches/ReturnItemDraft.php index b5b49c03012..cb0d517545f 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/ReturnItemDraft.php +++ b/lib/commercetools-import/src/Models/OrderPatches/ReturnItemDraft.php @@ -20,21 +20,25 @@ interface ReturnItemDraft extends JsonObject public const FIELD_SHIPMENT_STATE = 'shipmentState'; /** + * @return null|float */ public function getQuantity(); /** + * @return null|string */ public function getLineItemId(); /** + * @return null|string */ public function getCustomLineItemId(); /** + * @return null|string */ public function getComment(); @@ -42,6 +46,7 @@ public function getComment(); /** *

    Maps to ReturnItem.shipmentState

    * + * @return null|string */ public function getShipmentState(); diff --git a/lib/commercetools-import/src/Models/OrderPatches/ReturnItemDraftBuilder.php b/lib/commercetools-import/src/Models/OrderPatches/ReturnItemDraftBuilder.php index 74be646fe38..ca8af276573 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/ReturnItemDraftBuilder.php +++ b/lib/commercetools-import/src/Models/OrderPatches/ReturnItemDraftBuilder.php @@ -21,31 +21,37 @@ final class ReturnItemDraftBuilder implements Builder { /** + * @var ?float */ private $quantity; /** + * @var ?string */ private $lineItemId; /** + * @var ?string */ private $customLineItemId; /** + * @var ?string */ private $comment; /** + * @var ?string */ private $shipmentState; /** + * @return null|float */ public function getQuantity() @@ -54,6 +60,7 @@ public function getQuantity() } /** + * @return null|string */ public function getLineItemId() @@ -62,6 +69,7 @@ public function getLineItemId() } /** + * @return null|string */ public function getCustomLineItemId() @@ -70,6 +78,7 @@ public function getCustomLineItemId() } /** + * @return null|string */ public function getComment() @@ -80,6 +89,7 @@ public function getComment() /** *

    Maps to ReturnItem.shipmentState

    * + * @return null|string */ public function getShipmentState() diff --git a/lib/commercetools-import/src/Models/OrderPatches/ReturnItemDraftModel.php b/lib/commercetools-import/src/Models/OrderPatches/ReturnItemDraftModel.php index 88665dcd9e1..660c5048dd4 100644 --- a/lib/commercetools-import/src/Models/OrderPatches/ReturnItemDraftModel.php +++ b/lib/commercetools-import/src/Models/OrderPatches/ReturnItemDraftModel.php @@ -20,26 +20,31 @@ final class ReturnItemDraftModel extends JsonObjectModel implements ReturnItemDraft { /** + * * @var ?float */ protected $quantity; /** + * * @var ?string */ protected $lineItemId; /** + * * @var ?string */ protected $customLineItemId; /** + * * @var ?string */ protected $comment; /** + * * @var ?string */ protected $shipmentState; @@ -63,6 +68,7 @@ public function __construct( } /** + * * @return null|float */ public function getQuantity() @@ -80,6 +86,7 @@ public function getQuantity() } /** + * * @return null|string */ public function getLineItemId() @@ -97,6 +104,7 @@ public function getLineItemId() } /** + * * @return null|string */ public function getCustomLineItemId() @@ -114,6 +122,7 @@ public function getCustomLineItemId() } /** + * * @return null|string */ public function getComment() @@ -133,6 +142,7 @@ public function getComment() /** *

    Maps to ReturnItem.shipmentState

    * + * * @return null|string */ public function getShipmentState() diff --git a/lib/commercetools-import/src/Models/Orders/CartClassificationTier.php b/lib/commercetools-import/src/Models/Orders/CartClassificationTier.php index f4602711e3f..bf05915ab77 100644 --- a/lib/commercetools-import/src/Models/Orders/CartClassificationTier.php +++ b/lib/commercetools-import/src/Models/Orders/CartClassificationTier.php @@ -20,21 +20,25 @@ interface CartClassificationTier extends ShippingRatePriceTier public const FIELD_IS_MATCHING = 'isMatching'; /** + * @return null|string */ public function getValue(); /** + * @return null|Money */ public function getPrice(); /** + * @return null|ShippingRatePriceTierCollection */ public function getTiers(); /** + * @return null|bool */ public function getIsMatching(); diff --git a/lib/commercetools-import/src/Models/Orders/CartClassificationTierBuilder.php b/lib/commercetools-import/src/Models/Orders/CartClassificationTierBuilder.php index f606b91b9fb..b5e8374384f 100644 --- a/lib/commercetools-import/src/Models/Orders/CartClassificationTierBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/CartClassificationTierBuilder.php @@ -23,26 +23,31 @@ final class CartClassificationTierBuilder implements Builder { /** + * @var ?string */ private $value; /** + * @var null|Money|MoneyBuilder */ private $price; /** + * @var ?ShippingRatePriceTierCollection */ private $tiers; /** + * @var ?bool */ private $isMatching; /** + * @return null|string */ public function getValue() @@ -51,6 +56,7 @@ public function getValue() } /** + * @return null|Money */ public function getPrice() @@ -59,6 +65,7 @@ public function getPrice() } /** + * @return null|ShippingRatePriceTierCollection */ public function getTiers() @@ -67,6 +74,7 @@ public function getTiers() } /** + * @return null|bool */ public function getIsMatching() diff --git a/lib/commercetools-import/src/Models/Orders/CartClassificationTierModel.php b/lib/commercetools-import/src/Models/Orders/CartClassificationTierModel.php index 856f32d604b..6fa0c144de9 100644 --- a/lib/commercetools-import/src/Models/Orders/CartClassificationTierModel.php +++ b/lib/commercetools-import/src/Models/Orders/CartClassificationTierModel.php @@ -23,26 +23,31 @@ final class CartClassificationTierModel extends JsonObjectModel implements CartC { public const DISCRIMINATOR_VALUE = 'CartClassification'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $value; /** + * * @var ?Money */ protected $price; /** + * * @var ?ShippingRatePriceTierCollection */ protected $tiers; /** + * * @var ?bool */ protected $isMatching; @@ -55,16 +60,18 @@ public function __construct( ?string $value = null, ?Money $price = null, ?ShippingRatePriceTierCollection $tiers = null, - ?bool $isMatching = null + ?bool $isMatching = null, + ?string $type = null ) { $this->value = $value; $this->price = $price; $this->tiers = $tiers; $this->isMatching = $isMatching; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -82,6 +89,7 @@ public function getType() } /** + * * @return null|string */ public function getValue() @@ -99,6 +107,7 @@ public function getValue() } /** + * * @return null|Money */ public function getPrice() @@ -117,6 +126,7 @@ public function getPrice() } /** + * * @return null|ShippingRatePriceTierCollection */ public function getTiers() @@ -134,6 +144,7 @@ public function getTiers() } /** + * * @return null|bool */ public function getIsMatching() diff --git a/lib/commercetools-import/src/Models/Orders/ClassificationShippingRateInput.php b/lib/commercetools-import/src/Models/Orders/ClassificationShippingRateInput.php index d191a285be4..87c3ba70e0d 100644 --- a/lib/commercetools-import/src/Models/Orders/ClassificationShippingRateInput.php +++ b/lib/commercetools-import/src/Models/Orders/ClassificationShippingRateInput.php @@ -18,6 +18,7 @@ interface ClassificationShippingRateInput extends ShippingRateInput public const FIELD_LABEL = 'label'; /** + * @return null|string */ public function getKey(); @@ -30,6 +31,7 @@ public function getKey(); * } * * + * @return null|LocalizedString */ public function getLabel(); diff --git a/lib/commercetools-import/src/Models/Orders/ClassificationShippingRateInputBuilder.php b/lib/commercetools-import/src/Models/Orders/ClassificationShippingRateInputBuilder.php index e4d96527582..33b3c385046 100644 --- a/lib/commercetools-import/src/Models/Orders/ClassificationShippingRateInputBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/ClassificationShippingRateInputBuilder.php @@ -23,16 +23,19 @@ final class ClassificationShippingRateInputBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; /** + * @return null|string */ public function getKey() @@ -48,6 +51,7 @@ public function getKey() * } * * + * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-import/src/Models/Orders/ClassificationShippingRateInputModel.php b/lib/commercetools-import/src/Models/Orders/ClassificationShippingRateInputModel.php index d80f0592902..d19822ba7f0 100644 --- a/lib/commercetools-import/src/Models/Orders/ClassificationShippingRateInputModel.php +++ b/lib/commercetools-import/src/Models/Orders/ClassificationShippingRateInputModel.php @@ -23,16 +23,19 @@ final class ClassificationShippingRateInputModel extends JsonObjectModel impleme { public const DISCRIMINATOR_VALUE = 'Classification'; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $label; @@ -43,14 +46,16 @@ final class ClassificationShippingRateInputModel extends JsonObjectModel impleme */ public function __construct( ?string $key = null, - ?LocalizedString $label = null + ?LocalizedString $label = null, + ?string $type = null ) { $this->key = $key; $this->label = $label; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -68,6 +73,7 @@ public function getType() } /** + * * @return null|string */ public function getKey() @@ -92,6 +98,7 @@ public function getKey() * } * * + * * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-import/src/Models/Orders/CustomLineItemDraft.php b/lib/commercetools-import/src/Models/Orders/CustomLineItemDraft.php index b288e3a01e6..f787948dfbb 100644 --- a/lib/commercetools-import/src/Models/Orders/CustomLineItemDraft.php +++ b/lib/commercetools-import/src/Models/Orders/CustomLineItemDraft.php @@ -38,36 +38,43 @@ interface CustomLineItemDraft extends JsonObject * } * * + * @return null|LocalizedString */ public function getName(); /** + * @return null|TypedMoney */ public function getMoney(); /** + * @return null|CustomLineItemTaxedPrice */ public function getTaxedPrice(); /** + * @return null|TypedMoney */ public function getTotalPrice(); /** + * @return null|string */ public function getSlug(); /** + * @return null|float */ public function getQuantity(); /** + * @return null|ItemStateCollection */ public function getState(); @@ -75,26 +82,31 @@ public function getState(); /** *

    References a tax category by key.

    * + * @return null|TaxCategoryKeyReference */ public function getTaxCategory(); /** + * @return null|TaxRate */ public function getTaxRate(); /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); /** + * @return null|DiscountedLineItemPriceDraftCollection */ public function getDiscountedPricePerQuantity(); /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); diff --git a/lib/commercetools-import/src/Models/Orders/CustomLineItemDraftBuilder.php b/lib/commercetools-import/src/Models/Orders/CustomLineItemDraftBuilder.php index 1265f08453a..c4d1a504db0 100644 --- a/lib/commercetools-import/src/Models/Orders/CustomLineItemDraftBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/CustomLineItemDraftBuilder.php @@ -29,61 +29,73 @@ final class CustomLineItemDraftBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $money; /** + * @var null|CustomLineItemTaxedPrice|CustomLineItemTaxedPriceBuilder */ private $taxedPrice; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalPrice; /** + * @var ?string */ private $slug; /** + * @var ?float */ private $quantity; /** + * @var ?ItemStateCollection */ private $state; /** + * @var null|TaxCategoryKeyReference|TaxCategoryKeyReferenceBuilder */ private $taxCategory; /** + * @var null|TaxRate|TaxRateBuilder */ private $taxRate; /** + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ private $externalTaxRate; /** + * @var ?DiscountedLineItemPriceDraftCollection */ private $discountedPricePerQuantity; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetails; @@ -96,6 +108,7 @@ final class CustomLineItemDraftBuilder implements Builder * } * * + * @return null|LocalizedString */ public function getName() @@ -104,6 +117,7 @@ public function getName() } /** + * @return null|TypedMoney */ public function getMoney() @@ -112,6 +126,7 @@ public function getMoney() } /** + * @return null|CustomLineItemTaxedPrice */ public function getTaxedPrice() @@ -120,6 +135,7 @@ public function getTaxedPrice() } /** + * @return null|TypedMoney */ public function getTotalPrice() @@ -128,6 +144,7 @@ public function getTotalPrice() } /** + * @return null|string */ public function getSlug() @@ -136,6 +153,7 @@ public function getSlug() } /** + * @return null|float */ public function getQuantity() @@ -144,6 +162,7 @@ public function getQuantity() } /** + * @return null|ItemStateCollection */ public function getState() @@ -154,6 +173,7 @@ public function getState() /** *

    References a tax category by key.

    * + * @return null|TaxCategoryKeyReference */ public function getTaxCategory() @@ -162,6 +182,7 @@ public function getTaxCategory() } /** + * @return null|TaxRate */ public function getTaxRate() @@ -170,6 +191,7 @@ public function getTaxRate() } /** + * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() @@ -178,6 +200,7 @@ public function getExternalTaxRate() } /** + * @return null|DiscountedLineItemPriceDraftCollection */ public function getDiscountedPricePerQuantity() @@ -186,6 +209,7 @@ public function getDiscountedPricePerQuantity() } /** + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-import/src/Models/Orders/CustomLineItemDraftModel.php b/lib/commercetools-import/src/Models/Orders/CustomLineItemDraftModel.php index 03792fd6875..5ccd8712c1d 100644 --- a/lib/commercetools-import/src/Models/Orders/CustomLineItemDraftModel.php +++ b/lib/commercetools-import/src/Models/Orders/CustomLineItemDraftModel.php @@ -28,61 +28,73 @@ final class CustomLineItemDraftModel extends JsonObjectModel implements CustomLineItemDraft { /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?TypedMoney */ protected $money; /** + * * @var ?CustomLineItemTaxedPrice */ protected $taxedPrice; /** + * * @var ?TypedMoney */ protected $totalPrice; /** + * * @var ?string */ protected $slug; /** + * * @var ?float */ protected $quantity; /** + * * @var ?ItemStateCollection */ protected $state; /** + * * @var ?TaxCategoryKeyReference */ protected $taxCategory; /** + * * @var ?TaxRate */ protected $taxRate; /** + * * @var ?ExternalTaxRateDraft */ protected $externalTaxRate; /** + * * @var ?DiscountedLineItemPriceDraftCollection */ protected $discountedPricePerQuantity; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; @@ -127,6 +139,7 @@ public function __construct( * } * * + * * @return null|LocalizedString */ public function getName() @@ -145,6 +158,7 @@ public function getName() } /** + * * @return null|TypedMoney */ public function getMoney() @@ -163,6 +177,7 @@ public function getMoney() } /** + * * @return null|CustomLineItemTaxedPrice */ public function getTaxedPrice() @@ -181,6 +196,7 @@ public function getTaxedPrice() } /** + * * @return null|TypedMoney */ public function getTotalPrice() @@ -199,6 +215,7 @@ public function getTotalPrice() } /** + * * @return null|string */ public function getSlug() @@ -216,6 +233,7 @@ public function getSlug() } /** + * * @return null|float */ public function getQuantity() @@ -233,6 +251,7 @@ public function getQuantity() } /** + * * @return null|ItemStateCollection */ public function getState() @@ -252,6 +271,7 @@ public function getState() /** *

    References a tax category by key.

    * + * * @return null|TaxCategoryKeyReference */ public function getTaxCategory() @@ -270,6 +290,7 @@ public function getTaxCategory() } /** + * * @return null|TaxRate */ public function getTaxRate() @@ -288,6 +309,7 @@ public function getTaxRate() } /** + * * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate() @@ -306,6 +328,7 @@ public function getExternalTaxRate() } /** + * * @return null|DiscountedLineItemPriceDraftCollection */ public function getDiscountedPricePerQuantity() @@ -323,6 +346,7 @@ public function getDiscountedPricePerQuantity() } /** + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() diff --git a/lib/commercetools-import/src/Models/Orders/CustomLineItemTaxedPrice.php b/lib/commercetools-import/src/Models/Orders/CustomLineItemTaxedPrice.php index 1360b9a3849..035dfd8c394 100644 --- a/lib/commercetools-import/src/Models/Orders/CustomLineItemTaxedPrice.php +++ b/lib/commercetools-import/src/Models/Orders/CustomLineItemTaxedPrice.php @@ -18,11 +18,13 @@ interface CustomLineItemTaxedPrice extends JsonObject public const FIELD_TOTAL_GROSS = 'totalGross'; /** + * @return null|TypedMoney */ public function getTotalNet(); /** + * @return null|TypedMoney */ public function getTotalGross(); diff --git a/lib/commercetools-import/src/Models/Orders/CustomLineItemTaxedPriceBuilder.php b/lib/commercetools-import/src/Models/Orders/CustomLineItemTaxedPriceBuilder.php index 1ac0287eb90..a86738797ed 100644 --- a/lib/commercetools-import/src/Models/Orders/CustomLineItemTaxedPriceBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/CustomLineItemTaxedPriceBuilder.php @@ -23,16 +23,19 @@ final class CustomLineItemTaxedPriceBuilder implements Builder { /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalNet; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalGross; /** + * @return null|TypedMoney */ public function getTotalNet() @@ -41,6 +44,7 @@ public function getTotalNet() } /** + * @return null|TypedMoney */ public function getTotalGross() diff --git a/lib/commercetools-import/src/Models/Orders/CustomLineItemTaxedPriceModel.php b/lib/commercetools-import/src/Models/Orders/CustomLineItemTaxedPriceModel.php index 39335ca0640..b34bca970f5 100644 --- a/lib/commercetools-import/src/Models/Orders/CustomLineItemTaxedPriceModel.php +++ b/lib/commercetools-import/src/Models/Orders/CustomLineItemTaxedPriceModel.php @@ -22,11 +22,13 @@ final class CustomLineItemTaxedPriceModel extends JsonObjectModel implements CustomLineItemTaxedPrice { /** + * * @var ?TypedMoney */ protected $totalNet; /** + * * @var ?TypedMoney */ protected $totalGross; @@ -44,6 +46,7 @@ public function __construct( } /** + * * @return null|TypedMoney */ public function getTotalNet() @@ -62,6 +65,7 @@ public function getTotalNet() } /** + * * @return null|TypedMoney */ public function getTotalGross() diff --git a/lib/commercetools-import/src/Models/Orders/Delivery.php b/lib/commercetools-import/src/Models/Orders/Delivery.php index 2c21687da2f..9d6340b4bd5 100644 --- a/lib/commercetools-import/src/Models/Orders/Delivery.php +++ b/lib/commercetools-import/src/Models/Orders/Delivery.php @@ -22,26 +22,31 @@ interface Delivery extends JsonObject public const FIELD_ADDRESS = 'address'; /** + * @return null|string */ public function getId(); /** + * @return null|DateTimeImmutable */ public function getCreatedAt(); /** + * @return null|DeliveryItemCollection */ public function getItems(); /** + * @return null|ParcelCollection */ public function getParcels(); /** + * @return null|Address */ public function getAddress(); diff --git a/lib/commercetools-import/src/Models/Orders/DeliveryBuilder.php b/lib/commercetools-import/src/Models/Orders/DeliveryBuilder.php index b182a61efb2..a510f81c3ec 100644 --- a/lib/commercetools-import/src/Models/Orders/DeliveryBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/DeliveryBuilder.php @@ -24,31 +24,37 @@ final class DeliveryBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @var ?ParcelCollection */ private $parcels; /** + * @var null|Address|AddressBuilder */ private $address; /** + * @return null|string */ public function getId() @@ -57,6 +63,7 @@ public function getId() } /** + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -65,6 +72,7 @@ public function getCreatedAt() } /** + * @return null|DeliveryItemCollection */ public function getItems() @@ -73,6 +81,7 @@ public function getItems() } /** + * @return null|ParcelCollection */ public function getParcels() @@ -81,6 +90,7 @@ public function getParcels() } /** + * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-import/src/Models/Orders/DeliveryItem.php b/lib/commercetools-import/src/Models/Orders/DeliveryItem.php index a10c50ce7c5..1211e3debe4 100644 --- a/lib/commercetools-import/src/Models/Orders/DeliveryItem.php +++ b/lib/commercetools-import/src/Models/Orders/DeliveryItem.php @@ -17,11 +17,13 @@ interface DeliveryItem extends JsonObject public const FIELD_QUANTITY = 'quantity'; /** + * @return null|string */ public function getId(); /** + * @return null|float */ public function getQuantity(); diff --git a/lib/commercetools-import/src/Models/Orders/DeliveryItemBuilder.php b/lib/commercetools-import/src/Models/Orders/DeliveryItemBuilder.php index 9d99bc73aa2..52795b91d53 100644 --- a/lib/commercetools-import/src/Models/Orders/DeliveryItemBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/DeliveryItemBuilder.php @@ -21,16 +21,19 @@ final class DeliveryItemBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?float */ private $quantity; /** + * @return null|string */ public function getId() @@ -39,6 +42,7 @@ public function getId() } /** + * @return null|float */ public function getQuantity() diff --git a/lib/commercetools-import/src/Models/Orders/DeliveryItemModel.php b/lib/commercetools-import/src/Models/Orders/DeliveryItemModel.php index 437069a7b39..cc2ce127289 100644 --- a/lib/commercetools-import/src/Models/Orders/DeliveryItemModel.php +++ b/lib/commercetools-import/src/Models/Orders/DeliveryItemModel.php @@ -20,11 +20,13 @@ final class DeliveryItemModel extends JsonObjectModel implements DeliveryItem { /** + * * @var ?string */ protected $id; /** + * * @var ?float */ protected $quantity; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -59,6 +62,7 @@ public function getId() } /** + * * @return null|float */ public function getQuantity() diff --git a/lib/commercetools-import/src/Models/Orders/DeliveryModel.php b/lib/commercetools-import/src/Models/Orders/DeliveryModel.php index 39d14c1bbf3..11020860dc1 100644 --- a/lib/commercetools-import/src/Models/Orders/DeliveryModel.php +++ b/lib/commercetools-import/src/Models/Orders/DeliveryModel.php @@ -23,26 +23,31 @@ final class DeliveryModel extends JsonObjectModel implements Delivery { /** + * * @var ?string */ protected $id; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?DeliveryItemCollection */ protected $items; /** + * * @var ?ParcelCollection */ protected $parcels; /** + * * @var ?Address */ protected $address; @@ -66,6 +71,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -83,6 +89,7 @@ public function getId() } /** + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -104,6 +111,7 @@ public function getCreatedAt() } /** + * * @return null|DeliveryItemCollection */ public function getItems() @@ -121,6 +129,7 @@ public function getItems() } /** + * * @return null|ParcelCollection */ public function getParcels() @@ -138,6 +147,7 @@ public function getParcels() } /** + * * @return null|Address */ public function getAddress() diff --git a/lib/commercetools-import/src/Models/Orders/DiscountCodeInfo.php b/lib/commercetools-import/src/Models/Orders/DiscountCodeInfo.php index f8c3b6eb3a8..9e1aa5016d1 100644 --- a/lib/commercetools-import/src/Models/Orders/DiscountCodeInfo.php +++ b/lib/commercetools-import/src/Models/Orders/DiscountCodeInfo.php @@ -20,6 +20,7 @@ interface DiscountCodeInfo extends JsonObject /** *

    References a discount code by key.

    * + * @return null|DiscountCodeKeyReference */ public function getDiscountCode(); @@ -27,6 +28,7 @@ public function getDiscountCode(); /** *

    Maps to DiscountCodeInfo.state

    * + * @return null|string */ public function getState(); diff --git a/lib/commercetools-import/src/Models/Orders/DiscountCodeInfoBuilder.php b/lib/commercetools-import/src/Models/Orders/DiscountCodeInfoBuilder.php index 26c5de16c1d..8e96c83416a 100644 --- a/lib/commercetools-import/src/Models/Orders/DiscountCodeInfoBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/DiscountCodeInfoBuilder.php @@ -23,11 +23,13 @@ final class DiscountCodeInfoBuilder implements Builder { /** + * @var null|DiscountCodeKeyReference|DiscountCodeKeyReferenceBuilder */ private $discountCode; /** + * @var ?string */ private $state; @@ -35,6 +37,7 @@ final class DiscountCodeInfoBuilder implements Builder /** *

    References a discount code by key.

    * + * @return null|DiscountCodeKeyReference */ public function getDiscountCode() @@ -45,6 +48,7 @@ public function getDiscountCode() /** *

    Maps to DiscountCodeInfo.state

    * + * @return null|string */ public function getState() diff --git a/lib/commercetools-import/src/Models/Orders/DiscountCodeInfoModel.php b/lib/commercetools-import/src/Models/Orders/DiscountCodeInfoModel.php index 2ab34f9a626..35de2cc7c94 100644 --- a/lib/commercetools-import/src/Models/Orders/DiscountCodeInfoModel.php +++ b/lib/commercetools-import/src/Models/Orders/DiscountCodeInfoModel.php @@ -22,11 +22,13 @@ final class DiscountCodeInfoModel extends JsonObjectModel implements DiscountCodeInfo { /** + * * @var ?DiscountCodeKeyReference */ protected $discountCode; /** + * * @var ?string */ protected $state; @@ -46,6 +48,7 @@ public function __construct( /** *

    References a discount code by key.

    * + * * @return null|DiscountCodeKeyReference */ public function getDiscountCode() @@ -66,6 +69,7 @@ public function getDiscountCode() /** *

    Maps to DiscountCodeInfo.state

    * + * * @return null|string */ public function getState() diff --git a/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPortion.php b/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPortion.php index 3f58503bd8e..49a31b739b3 100644 --- a/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPortion.php +++ b/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPortion.php @@ -21,11 +21,13 @@ interface DiscountedLineItemPortion extends JsonObject /** *

    References a cart discount by key.

    * + * @return null|CartDiscountKeyReference */ public function getDiscount(); /** + * @return null|Money */ public function getDiscountedAmount(); diff --git a/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPortionBuilder.php b/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPortionBuilder.php index f9b71d8ea7c..31921c1ff86 100644 --- a/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPortionBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPortionBuilder.php @@ -25,11 +25,13 @@ final class DiscountedLineItemPortionBuilder implements Builder { /** + * @var null|CartDiscountKeyReference|CartDiscountKeyReferenceBuilder */ private $discount; /** + * @var null|Money|MoneyBuilder */ private $discountedAmount; @@ -37,6 +39,7 @@ final class DiscountedLineItemPortionBuilder implements Builder /** *

    References a cart discount by key.

    * + * @return null|CartDiscountKeyReference */ public function getDiscount() @@ -45,6 +48,7 @@ public function getDiscount() } /** + * @return null|Money */ public function getDiscountedAmount() diff --git a/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPortionModel.php b/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPortionModel.php index e13986aa2bb..a4b03a76281 100644 --- a/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPortionModel.php +++ b/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPortionModel.php @@ -24,11 +24,13 @@ final class DiscountedLineItemPortionModel extends JsonObjectModel implements DiscountedLineItemPortion { /** + * * @var ?CartDiscountKeyReference */ protected $discount; /** + * * @var ?Money */ protected $discountedAmount; @@ -48,6 +50,7 @@ public function __construct( /** *

    References a cart discount by key.

    * + * * @return null|CartDiscountKeyReference */ public function getDiscount() @@ -66,6 +69,7 @@ public function getDiscount() } /** + * * @return null|Money */ public function getDiscountedAmount() diff --git a/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPriceDraft.php b/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPriceDraft.php index d929573f68e..c7b2e5f5576 100644 --- a/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPriceDraft.php +++ b/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPriceDraft.php @@ -18,11 +18,13 @@ interface DiscountedLineItemPriceDraft extends JsonObject public const FIELD_INCLUDED_DISCOUNTS = 'includedDiscounts'; /** + * @return null|Money */ public function getValue(); /** + * @return null|DiscountedLineItemPortionCollection */ public function getIncludedDiscounts(); diff --git a/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPriceDraftBuilder.php b/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPriceDraftBuilder.php index 4f234086e86..bd0511aff64 100644 --- a/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPriceDraftBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPriceDraftBuilder.php @@ -23,16 +23,19 @@ final class DiscountedLineItemPriceDraftBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $value; /** + * @var ?DiscountedLineItemPortionCollection */ private $includedDiscounts; /** + * @return null|Money */ public function getValue() @@ -41,6 +44,7 @@ public function getValue() } /** + * @return null|DiscountedLineItemPortionCollection */ public function getIncludedDiscounts() diff --git a/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPriceDraftModel.php b/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPriceDraftModel.php index ed2b355ab65..00c919202e5 100644 --- a/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPriceDraftModel.php +++ b/lib/commercetools-import/src/Models/Orders/DiscountedLineItemPriceDraftModel.php @@ -22,11 +22,13 @@ final class DiscountedLineItemPriceDraftModel extends JsonObjectModel implements DiscountedLineItemPriceDraft { /** + * * @var ?Money */ protected $value; /** + * * @var ?DiscountedLineItemPortionCollection */ protected $includedDiscounts; @@ -44,6 +46,7 @@ public function __construct( } /** + * * @return null|Money */ public function getValue() @@ -62,6 +65,7 @@ public function getValue() } /** + * * @return null|DiscountedLineItemPortionCollection */ public function getIncludedDiscounts() diff --git a/lib/commercetools-import/src/Models/Orders/ExternalTaxRateDraft.php b/lib/commercetools-import/src/Models/Orders/ExternalTaxRateDraft.php index a19a518b67a..760b379ce49 100644 --- a/lib/commercetools-import/src/Models/Orders/ExternalTaxRateDraft.php +++ b/lib/commercetools-import/src/Models/Orders/ExternalTaxRateDraft.php @@ -22,31 +22,37 @@ interface ExternalTaxRateDraft extends JsonObject public const FIELD_INCLUDED_IN_PRICE = 'includedInPrice'; /** + * @return null|string */ public function getName(); /** + * @return null|float */ public function getAmount(); /** + * @return null|string */ public function getCountry(); /** + * @return null|string */ public function getState(); /** + * @return null|SubRateCollection */ public function getSubRates(); /** + * @return null|bool */ public function getIncludedInPrice(); diff --git a/lib/commercetools-import/src/Models/Orders/ExternalTaxRateDraftBuilder.php b/lib/commercetools-import/src/Models/Orders/ExternalTaxRateDraftBuilder.php index 17044702838..8b10bb6dc1c 100644 --- a/lib/commercetools-import/src/Models/Orders/ExternalTaxRateDraftBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/ExternalTaxRateDraftBuilder.php @@ -22,36 +22,43 @@ final class ExternalTaxRateDraftBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?float */ private $amount; /** + * @var ?string */ private $country; /** + * @var ?string */ private $state; /** + * @var ?SubRateCollection */ private $subRates; /** + * @var ?bool */ private $includedInPrice; /** + * @return null|string */ public function getName() @@ -60,6 +67,7 @@ public function getName() } /** + * @return null|float */ public function getAmount() @@ -68,6 +76,7 @@ public function getAmount() } /** + * @return null|string */ public function getCountry() @@ -76,6 +85,7 @@ public function getCountry() } /** + * @return null|string */ public function getState() @@ -84,6 +94,7 @@ public function getState() } /** + * @return null|SubRateCollection */ public function getSubRates() @@ -92,6 +103,7 @@ public function getSubRates() } /** + * @return null|bool */ public function getIncludedInPrice() diff --git a/lib/commercetools-import/src/Models/Orders/ExternalTaxRateDraftModel.php b/lib/commercetools-import/src/Models/Orders/ExternalTaxRateDraftModel.php index 90f8c88da85..8644d97e45f 100644 --- a/lib/commercetools-import/src/Models/Orders/ExternalTaxRateDraftModel.php +++ b/lib/commercetools-import/src/Models/Orders/ExternalTaxRateDraftModel.php @@ -21,31 +21,37 @@ final class ExternalTaxRateDraftModel extends JsonObjectModel implements ExternalTaxRateDraft { /** + * * @var ?string */ protected $name; /** + * * @var ?float */ protected $amount; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $state; /** + * * @var ?SubRateCollection */ protected $subRates; /** + * * @var ?bool */ protected $includedInPrice; @@ -71,6 +77,7 @@ public function __construct( } /** + * * @return null|string */ public function getName() @@ -88,6 +95,7 @@ public function getName() } /** + * * @return null|float */ public function getAmount() @@ -105,6 +113,7 @@ public function getAmount() } /** + * * @return null|string */ public function getCountry() @@ -122,6 +131,7 @@ public function getCountry() } /** + * * @return null|string */ public function getState() @@ -139,6 +149,7 @@ public function getState() } /** + * * @return null|SubRateCollection */ public function getSubRates() @@ -156,6 +167,7 @@ public function getSubRates() } /** + * * @return null|bool */ public function getIncludedInPrice() diff --git a/lib/commercetools-import/src/Models/Orders/ItemShippingDetailsDraft.php b/lib/commercetools-import/src/Models/Orders/ItemShippingDetailsDraft.php index 94444832ece..d35a5dff485 100644 --- a/lib/commercetools-import/src/Models/Orders/ItemShippingDetailsDraft.php +++ b/lib/commercetools-import/src/Models/Orders/ItemShippingDetailsDraft.php @@ -18,6 +18,7 @@ interface ItemShippingDetailsDraft extends JsonObject /** *

    Maps to ItemShippingDetailsDraft.targets.

    * + * @return null|ItemShippingTargetCollection */ public function getTargets(); diff --git a/lib/commercetools-import/src/Models/Orders/ItemShippingDetailsDraftBuilder.php b/lib/commercetools-import/src/Models/Orders/ItemShippingDetailsDraftBuilder.php index 2f054b4ed9a..643d84b10a1 100644 --- a/lib/commercetools-import/src/Models/Orders/ItemShippingDetailsDraftBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/ItemShippingDetailsDraftBuilder.php @@ -21,6 +21,7 @@ final class ItemShippingDetailsDraftBuilder implements Builder { /** + * @var ?ItemShippingTargetCollection */ private $targets; @@ -28,6 +29,7 @@ final class ItemShippingDetailsDraftBuilder implements Builder /** *

    Maps to ItemShippingDetailsDraft.targets.

    * + * @return null|ItemShippingTargetCollection */ public function getTargets() diff --git a/lib/commercetools-import/src/Models/Orders/ItemShippingDetailsDraftModel.php b/lib/commercetools-import/src/Models/Orders/ItemShippingDetailsDraftModel.php index 38a52a0395f..c925f4c4ae0 100644 --- a/lib/commercetools-import/src/Models/Orders/ItemShippingDetailsDraftModel.php +++ b/lib/commercetools-import/src/Models/Orders/ItemShippingDetailsDraftModel.php @@ -20,6 +20,7 @@ final class ItemShippingDetailsDraftModel extends JsonObjectModel implements ItemShippingDetailsDraft { /** + * * @var ?ItemShippingTargetCollection */ protected $targets; @@ -37,6 +38,7 @@ public function __construct( /** *

    Maps to ItemShippingDetailsDraft.targets.

    * + * * @return null|ItemShippingTargetCollection */ public function getTargets() diff --git a/lib/commercetools-import/src/Models/Orders/ItemShippingTarget.php b/lib/commercetools-import/src/Models/Orders/ItemShippingTarget.php index 0f4336a4bef..6fe4df5467b 100644 --- a/lib/commercetools-import/src/Models/Orders/ItemShippingTarget.php +++ b/lib/commercetools-import/src/Models/Orders/ItemShippingTarget.php @@ -19,6 +19,7 @@ interface ItemShippingTarget extends JsonObject /** *

    Maps to ItemShippingTarget.addressKey.

    * + * @return null|string */ public function getAddressKey(); @@ -26,6 +27,7 @@ public function getAddressKey(); /** *

    Maps to ItemShippingTarget.quantity.

    * + * @return null|float */ public function getQuantity(); diff --git a/lib/commercetools-import/src/Models/Orders/ItemShippingTargetBuilder.php b/lib/commercetools-import/src/Models/Orders/ItemShippingTargetBuilder.php index f5d846d8193..4ffacd04cb2 100644 --- a/lib/commercetools-import/src/Models/Orders/ItemShippingTargetBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/ItemShippingTargetBuilder.php @@ -21,11 +21,13 @@ final class ItemShippingTargetBuilder implements Builder { /** + * @var ?string */ private $addressKey; /** + * @var ?float */ private $quantity; @@ -33,6 +35,7 @@ final class ItemShippingTargetBuilder implements Builder /** *

    Maps to ItemShippingTarget.addressKey.

    * + * @return null|string */ public function getAddressKey() @@ -43,6 +46,7 @@ public function getAddressKey() /** *

    Maps to ItemShippingTarget.quantity.

    * + * @return null|float */ public function getQuantity() diff --git a/lib/commercetools-import/src/Models/Orders/ItemShippingTargetModel.php b/lib/commercetools-import/src/Models/Orders/ItemShippingTargetModel.php index e52a6552207..33e6d2253e6 100644 --- a/lib/commercetools-import/src/Models/Orders/ItemShippingTargetModel.php +++ b/lib/commercetools-import/src/Models/Orders/ItemShippingTargetModel.php @@ -20,11 +20,13 @@ final class ItemShippingTargetModel extends JsonObjectModel implements ItemShippingTarget { /** + * * @var ?string */ protected $addressKey; /** + * * @var ?float */ protected $quantity; @@ -44,6 +46,7 @@ public function __construct( /** *

    Maps to ItemShippingTarget.addressKey.

    * + * * @return null|string */ public function getAddressKey() @@ -63,6 +66,7 @@ public function getAddressKey() /** *

    Maps to ItemShippingTarget.quantity.

    * + * * @return null|float */ public function getQuantity() diff --git a/lib/commercetools-import/src/Models/Orders/ItemState.php b/lib/commercetools-import/src/Models/Orders/ItemState.php index 37e5a980eca..5057523da99 100644 --- a/lib/commercetools-import/src/Models/Orders/ItemState.php +++ b/lib/commercetools-import/src/Models/Orders/ItemState.php @@ -18,6 +18,7 @@ interface ItemState extends JsonObject public const FIELD_STATE = 'state'; /** + * @return null|float */ public function getQuantity(); @@ -25,6 +26,7 @@ public function getQuantity(); /** *

    Maps to ItemState.state.

    * + * @return null|StateKeyReference */ public function getState(); diff --git a/lib/commercetools-import/src/Models/Orders/ItemStateBuilder.php b/lib/commercetools-import/src/Models/Orders/ItemStateBuilder.php index 228135b97fb..cf64fd0033c 100644 --- a/lib/commercetools-import/src/Models/Orders/ItemStateBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/ItemStateBuilder.php @@ -23,16 +23,19 @@ final class ItemStateBuilder implements Builder { /** + * @var ?float */ private $quantity; /** + * @var null|StateKeyReference|StateKeyReferenceBuilder */ private $state; /** + * @return null|float */ public function getQuantity() @@ -43,6 +46,7 @@ public function getQuantity() /** *

    Maps to ItemState.state.

    * + * @return null|StateKeyReference */ public function getState() diff --git a/lib/commercetools-import/src/Models/Orders/ItemStateModel.php b/lib/commercetools-import/src/Models/Orders/ItemStateModel.php index 9df5f1153e7..5d044c550d6 100644 --- a/lib/commercetools-import/src/Models/Orders/ItemStateModel.php +++ b/lib/commercetools-import/src/Models/Orders/ItemStateModel.php @@ -22,11 +22,13 @@ final class ItemStateModel extends JsonObjectModel implements ItemState { /** + * * @var ?float */ protected $quantity; /** + * * @var ?StateKeyReference */ protected $state; @@ -44,6 +46,7 @@ public function __construct( } /** + * * @return null|float */ public function getQuantity() @@ -63,6 +66,7 @@ public function getQuantity() /** *

    Maps to ItemState.state.

    * + * * @return null|StateKeyReference */ public function getState() diff --git a/lib/commercetools-import/src/Models/Orders/LineItemImportDraft.php b/lib/commercetools-import/src/Models/Orders/LineItemImportDraft.php index c9b1d5a20a6..e3329f073b6 100644 --- a/lib/commercetools-import/src/Models/Orders/LineItemImportDraft.php +++ b/lib/commercetools-import/src/Models/Orders/LineItemImportDraft.php @@ -13,6 +13,7 @@ use Commercetools\Import\Models\Common\ChannelKeyReference; use Commercetools\Import\Models\Common\LocalizedString; use Commercetools\Import\Models\Common\ProductKeyReference; +use Commercetools\Import\Models\Customfields\Custom; use Commercetools\Import\Models\Prices\TaxRate; interface LineItemImportDraft extends JsonObject @@ -27,10 +28,12 @@ interface LineItemImportDraft extends JsonObject public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; public const FIELD_TAX_RATE = 'taxRate'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; + public const FIELD_CUSTOM = 'custom'; /** *

    Maps to LineItem.productId.

    * + * @return null|ProductKeyReference */ public function getProduct(); @@ -38,6 +41,7 @@ public function getProduct(); /** *

    Maps to LineItem.name.

    * + * @return null|LocalizedString */ public function getName(); @@ -45,6 +49,7 @@ public function getName(); /** *

    Maps to ProductVariantImportDraft.

    * + * @return null|LineItemProductVariantImportDraft */ public function getVariant(); @@ -52,6 +57,7 @@ public function getVariant(); /** *

    Maps to LineItem.price.

    * + * @return null|LineItemPrice */ public function getPrice(); @@ -59,11 +65,13 @@ public function getPrice(); /** *

    Maps to LineItem.quantity.

    * + * @return null|float */ public function getQuantity(); /** + * @return null|ItemStateCollection */ public function getState(); @@ -73,6 +81,7 @@ public function getState(); * The Reference to the Supply Channel with which the LineItem is associated. * If referenced Supply Channel does not exist, the state of the ImportOperation will be set to unresolved until the necessary Supply Channel is created.

    * + * @return null|ChannelKeyReference */ public function getSupplyChannel(); @@ -82,6 +91,7 @@ public function getSupplyChannel(); * The Reference to the Distribution Channel with which the LineItem is associated. * If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary Distribution Channel is created.

    * + * @return null|ChannelKeyReference */ public function getDistributionChannel(); @@ -89,6 +99,7 @@ public function getDistributionChannel(); /** *

    Maps to LineItem.taxRate.

    * + * @return null|TaxRate */ public function getTaxRate(); @@ -96,10 +107,19 @@ public function getTaxRate(); /** *

    Maps to LineItem.shippingDetails.

    * + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); + /** + *

    Custom Fields for this Line Item.

    + * + + * @return null|Custom + */ + public function getCustom(); + /** * @param ?ProductKeyReference $product */ @@ -149,4 +169,9 @@ public function setTaxRate(?TaxRate $taxRate): void; * @param ?ItemShippingDetailsDraft $shippingDetails */ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): void; + + /** + * @param ?Custom $custom + */ + public function setCustom(?Custom $custom): void; } diff --git a/lib/commercetools-import/src/Models/Orders/LineItemImportDraftBuilder.php b/lib/commercetools-import/src/Models/Orders/LineItemImportDraftBuilder.php index 9ec1fb31e48..dc44952123b 100644 --- a/lib/commercetools-import/src/Models/Orders/LineItemImportDraftBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/LineItemImportDraftBuilder.php @@ -19,6 +19,8 @@ use Commercetools\Import\Models\Common\LocalizedStringBuilder; use Commercetools\Import\Models\Common\ProductKeyReference; use Commercetools\Import\Models\Common\ProductKeyReferenceBuilder; +use Commercetools\Import\Models\Customfields\Custom; +use Commercetools\Import\Models\Customfields\CustomBuilder; use Commercetools\Import\Models\Prices\TaxRate; use Commercetools\Import\Models\Prices\TaxRateBuilder; use stdClass; @@ -29,58 +31,75 @@ final class LineItemImportDraftBuilder implements Builder { /** + * @var null|ProductKeyReference|ProductKeyReferenceBuilder */ private $product; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LineItemProductVariantImportDraft|LineItemProductVariantImportDraftBuilder */ private $variant; /** + * @var null|LineItemPrice|LineItemPriceBuilder */ private $price; /** + * @var ?float */ private $quantity; /** + * @var ?ItemStateCollection */ private $state; /** + * @var null|ChannelKeyReference|ChannelKeyReferenceBuilder */ private $supplyChannel; /** + * @var null|ChannelKeyReference|ChannelKeyReferenceBuilder */ private $distributionChannel; /** + * @var null|TaxRate|TaxRateBuilder */ private $taxRate; /** + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ private $shippingDetails; + /** + + * @var null|Custom|CustomBuilder + */ + private $custom; + /** *

    Maps to LineItem.productId.

    * + * @return null|ProductKeyReference */ public function getProduct() @@ -91,6 +110,7 @@ public function getProduct() /** *

    Maps to LineItem.name.

    * + * @return null|LocalizedString */ public function getName() @@ -101,6 +121,7 @@ public function getName() /** *

    Maps to ProductVariantImportDraft.

    * + * @return null|LineItemProductVariantImportDraft */ public function getVariant() @@ -111,6 +132,7 @@ public function getVariant() /** *

    Maps to LineItem.price.

    * + * @return null|LineItemPrice */ public function getPrice() @@ -121,6 +143,7 @@ public function getPrice() /** *

    Maps to LineItem.quantity.

    * + * @return null|float */ public function getQuantity() @@ -129,6 +152,7 @@ public function getQuantity() } /** + * @return null|ItemStateCollection */ public function getState() @@ -141,6 +165,7 @@ public function getState() * The Reference to the Supply Channel with which the LineItem is associated. * If referenced Supply Channel does not exist, the state of the ImportOperation will be set to unresolved until the necessary Supply Channel is created.

    * + * @return null|ChannelKeyReference */ public function getSupplyChannel() @@ -153,6 +178,7 @@ public function getSupplyChannel() * The Reference to the Distribution Channel with which the LineItem is associated. * If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary Distribution Channel is created.

    * + * @return null|ChannelKeyReference */ public function getDistributionChannel() @@ -163,6 +189,7 @@ public function getDistributionChannel() /** *

    Maps to LineItem.taxRate.

    * + * @return null|TaxRate */ public function getTaxRate() @@ -173,6 +200,7 @@ public function getTaxRate() /** *

    Maps to LineItem.shippingDetails.

    * + * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() @@ -180,6 +208,17 @@ public function getShippingDetails() return $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails; } + /** + *

    Custom Fields for this Line Item.

    + * + + * @return null|Custom + */ + public function getCustom() + { + return $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom; + } + /** * @param ?ProductKeyReference $product * @return $this @@ -290,6 +329,17 @@ public function withShippingDetails(?ItemShippingDetailsDraft $shippingDetails) return $this; } + /** + * @param ?Custom $custom + * @return $this + */ + public function withCustom(?Custom $custom) + { + $this->custom = $custom; + + return $this; + } + /** * @deprecated use withProduct() instead * @return $this @@ -378,6 +428,17 @@ public function withShippingDetailsBuilder(?ItemShippingDetailsDraftBuilder $shi return $this; } + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + public function build(): LineItemImportDraft { return new LineItemImportDraftModel( @@ -390,7 +451,8 @@ public function build(): LineItemImportDraft $this->supplyChannel instanceof ChannelKeyReferenceBuilder ? $this->supplyChannel->build() : $this->supplyChannel, $this->distributionChannel instanceof ChannelKeyReferenceBuilder ? $this->distributionChannel->build() : $this->distributionChannel, $this->taxRate instanceof TaxRateBuilder ? $this->taxRate->build() : $this->taxRate, - $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails + $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails, + $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-import/src/Models/Orders/LineItemImportDraftModel.php b/lib/commercetools-import/src/Models/Orders/LineItemImportDraftModel.php index 854fd29f6a1..d0257a35d8a 100644 --- a/lib/commercetools-import/src/Models/Orders/LineItemImportDraftModel.php +++ b/lib/commercetools-import/src/Models/Orders/LineItemImportDraftModel.php @@ -18,6 +18,8 @@ use Commercetools\Import\Models\Common\LocalizedStringModel; use Commercetools\Import\Models\Common\ProductKeyReference; use Commercetools\Import\Models\Common\ProductKeyReferenceModel; +use Commercetools\Import\Models\Customfields\Custom; +use Commercetools\Import\Models\Customfields\CustomModel; use Commercetools\Import\Models\Prices\TaxRate; use Commercetools\Import\Models\Prices\TaxRateModel; use stdClass; @@ -28,55 +30,71 @@ final class LineItemImportDraftModel extends JsonObjectModel implements LineItemImportDraft { /** + * * @var ?ProductKeyReference */ protected $product; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LineItemProductVariantImportDraft */ protected $variant; /** + * * @var ?LineItemPrice */ protected $price; /** + * * @var ?float */ protected $quantity; /** + * * @var ?ItemStateCollection */ protected $state; /** + * * @var ?ChannelKeyReference */ protected $supplyChannel; /** + * * @var ?ChannelKeyReference */ protected $distributionChannel; /** + * * @var ?TaxRate */ protected $taxRate; /** + * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; + /** + * + * @var ?Custom + */ + protected $custom; + /** * @psalm-suppress MissingParamType @@ -91,7 +109,8 @@ public function __construct( ?ChannelKeyReference $supplyChannel = null, ?ChannelKeyReference $distributionChannel = null, ?TaxRate $taxRate = null, - ?ItemShippingDetailsDraft $shippingDetails = null + ?ItemShippingDetailsDraft $shippingDetails = null, + ?Custom $custom = null ) { $this->product = $product; $this->name = $name; @@ -103,11 +122,13 @@ public function __construct( $this->distributionChannel = $distributionChannel; $this->taxRate = $taxRate; $this->shippingDetails = $shippingDetails; + $this->custom = $custom; } /** *

    Maps to LineItem.productId.

    * + * * @return null|ProductKeyReference */ public function getProduct() @@ -128,6 +149,7 @@ public function getProduct() /** *

    Maps to LineItem.name.

    * + * * @return null|LocalizedString */ public function getName() @@ -148,6 +170,7 @@ public function getName() /** *

    Maps to ProductVariantImportDraft.

    * + * * @return null|LineItemProductVariantImportDraft */ public function getVariant() @@ -168,6 +191,7 @@ public function getVariant() /** *

    Maps to LineItem.price.

    * + * * @return null|LineItemPrice */ public function getPrice() @@ -188,6 +212,7 @@ public function getPrice() /** *

    Maps to LineItem.quantity.

    * + * * @return null|float */ public function getQuantity() @@ -205,6 +230,7 @@ public function getQuantity() } /** + * * @return null|ItemStateCollection */ public function getState() @@ -226,6 +252,7 @@ public function getState() * The Reference to the Supply Channel with which the LineItem is associated. * If referenced Supply Channel does not exist, the state of the ImportOperation will be set to unresolved until the necessary Supply Channel is created.

    * + * * @return null|ChannelKeyReference */ public function getSupplyChannel() @@ -248,6 +275,7 @@ public function getSupplyChannel() * The Reference to the Distribution Channel with which the LineItem is associated. * If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary Distribution Channel is created.

    * + * * @return null|ChannelKeyReference */ public function getDistributionChannel() @@ -268,6 +296,7 @@ public function getDistributionChannel() /** *

    Maps to LineItem.taxRate.

    * + * * @return null|TaxRate */ public function getTaxRate() @@ -288,6 +317,7 @@ public function getTaxRate() /** *

    Maps to LineItem.shippingDetails.

    * + * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails() @@ -305,6 +335,27 @@ public function getShippingDetails() return $this->shippingDetails; } + /** + *

    Custom Fields for this Line Item.

    + * + * + * @return null|Custom + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomModel::of($data); + } + + return $this->custom; + } + /** * @param ?ProductKeyReference $product @@ -385,4 +436,12 @@ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): { $this->shippingDetails = $shippingDetails; } + + /** + * @param ?Custom $custom + */ + public function setCustom(?Custom $custom): void + { + $this->custom = $custom; + } } diff --git a/lib/commercetools-import/src/Models/Orders/LineItemPrice.php b/lib/commercetools-import/src/Models/Orders/LineItemPrice.php index 32318d93436..5c2d6fcd5ba 100644 --- a/lib/commercetools-import/src/Models/Orders/LineItemPrice.php +++ b/lib/commercetools-import/src/Models/Orders/LineItemPrice.php @@ -33,6 +33,7 @@ interface LineItemPrice extends JsonObject /** *

    Maps to Price.value.

    * + * @return null|TypedMoney */ public function getValue(); @@ -40,6 +41,7 @@ public function getValue(); /** *

    Maps to Price.county.

    * + * @return null|string */ public function getCountry(); @@ -47,6 +49,7 @@ public function getCountry(); /** *

    Maps to Price.validFrom.

    * + * @return null|DateTimeImmutable */ public function getValidFrom(); @@ -54,6 +57,7 @@ public function getValidFrom(); /** *

    Maps to Price.validUntil.

    * + * @return null|DateTimeImmutable */ public function getValidUntil(); @@ -61,6 +65,7 @@ public function getValidUntil(); /** *

    References a customer group by key.

    * + * @return null|CustomerGroupKeyReference */ public function getCustomerGroup(); @@ -68,6 +73,7 @@ public function getCustomerGroup(); /** *

    References a channel by key.

    * + * @return null|ChannelKeyReference */ public function getChannel(); @@ -75,6 +81,7 @@ public function getChannel(); /** *

    Sets a discounted price from an external service.

    * + * @return null|DiscountedPrice */ public function getDiscounted(); @@ -82,6 +89,7 @@ public function getDiscounted(); /** *

    The tiered prices for this price.

    * + * @return null|PriceTierCollection */ public function getTiers(); @@ -89,6 +97,7 @@ public function getTiers(); /** *

    Maps to Price.custom.

    * + * @return null|Custom */ public function getCustom(); diff --git a/lib/commercetools-import/src/Models/Orders/LineItemPriceBuilder.php b/lib/commercetools-import/src/Models/Orders/LineItemPriceBuilder.php index 27987f83cf4..e9e1167d730 100644 --- a/lib/commercetools-import/src/Models/Orders/LineItemPriceBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/LineItemPriceBuilder.php @@ -33,46 +33,55 @@ final class LineItemPriceBuilder implements Builder { /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $value; /** + * @var ?string */ private $country; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; /** + * @var null|CustomerGroupKeyReference|CustomerGroupKeyReferenceBuilder */ private $customerGroup; /** + * @var null|ChannelKeyReference|ChannelKeyReferenceBuilder */ private $channel; /** + * @var null|DiscountedPrice|DiscountedPriceBuilder */ private $discounted; /** + * @var ?PriceTierCollection */ private $tiers; /** + * @var null|Custom|CustomBuilder */ private $custom; @@ -80,6 +89,7 @@ final class LineItemPriceBuilder implements Builder /** *

    Maps to Price.value.

    * + * @return null|TypedMoney */ public function getValue() @@ -90,6 +100,7 @@ public function getValue() /** *

    Maps to Price.county.

    * + * @return null|string */ public function getCountry() @@ -100,6 +111,7 @@ public function getCountry() /** *

    Maps to Price.validFrom.

    * + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -110,6 +122,7 @@ public function getValidFrom() /** *

    Maps to Price.validUntil.

    * + * @return null|DateTimeImmutable */ public function getValidUntil() @@ -120,6 +133,7 @@ public function getValidUntil() /** *

    References a customer group by key.

    * + * @return null|CustomerGroupKeyReference */ public function getCustomerGroup() @@ -130,6 +144,7 @@ public function getCustomerGroup() /** *

    References a channel by key.

    * + * @return null|ChannelKeyReference */ public function getChannel() @@ -140,6 +155,7 @@ public function getChannel() /** *

    Sets a discounted price from an external service.

    * + * @return null|DiscountedPrice */ public function getDiscounted() @@ -150,6 +166,7 @@ public function getDiscounted() /** *

    The tiered prices for this price.

    * + * @return null|PriceTierCollection */ public function getTiers() @@ -160,6 +177,7 @@ public function getTiers() /** *

    Maps to Price.custom.

    * + * @return null|Custom */ public function getCustom() diff --git a/lib/commercetools-import/src/Models/Orders/LineItemPriceModel.php b/lib/commercetools-import/src/Models/Orders/LineItemPriceModel.php index d465e6919ee..a74f0ed171d 100644 --- a/lib/commercetools-import/src/Models/Orders/LineItemPriceModel.php +++ b/lib/commercetools-import/src/Models/Orders/LineItemPriceModel.php @@ -32,46 +32,55 @@ final class LineItemPriceModel extends JsonObjectModel implements LineItemPrice { /** + * * @var ?TypedMoney */ protected $value; /** + * * @var ?string */ protected $country; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; /** + * * @var ?CustomerGroupKeyReference */ protected $customerGroup; /** + * * @var ?ChannelKeyReference */ protected $channel; /** + * * @var ?DiscountedPrice */ protected $discounted; /** + * * @var ?PriceTierCollection */ protected $tiers; /** + * * @var ?Custom */ protected $custom; @@ -105,6 +114,7 @@ public function __construct( /** *

    Maps to Price.value.

    * + * * @return null|TypedMoney */ public function getValue() @@ -125,6 +135,7 @@ public function getValue() /** *

    Maps to Price.county.

    * + * * @return null|string */ public function getCountry() @@ -144,6 +155,7 @@ public function getCountry() /** *

    Maps to Price.validFrom.

    * + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -167,6 +179,7 @@ public function getValidFrom() /** *

    Maps to Price.validUntil.

    * + * * @return null|DateTimeImmutable */ public function getValidUntil() @@ -190,6 +203,7 @@ public function getValidUntil() /** *

    References a customer group by key.

    * + * * @return null|CustomerGroupKeyReference */ public function getCustomerGroup() @@ -210,6 +224,7 @@ public function getCustomerGroup() /** *

    References a channel by key.

    * + * * @return null|ChannelKeyReference */ public function getChannel() @@ -230,6 +245,7 @@ public function getChannel() /** *

    Sets a discounted price from an external service.

    * + * * @return null|DiscountedPrice */ public function getDiscounted() @@ -250,6 +266,7 @@ public function getDiscounted() /** *

    The tiered prices for this price.

    * + * * @return null|PriceTierCollection */ public function getTiers() @@ -269,6 +286,7 @@ public function getTiers() /** *

    Maps to Price.custom.

    * + * * @return null|Custom */ public function getCustom() diff --git a/lib/commercetools-import/src/Models/Orders/LineItemProductVariantImportDraft.php b/lib/commercetools-import/src/Models/Orders/LineItemProductVariantImportDraft.php index 4fa00a09ce5..61c54292498 100644 --- a/lib/commercetools-import/src/Models/Orders/LineItemProductVariantImportDraft.php +++ b/lib/commercetools-import/src/Models/Orders/LineItemProductVariantImportDraft.php @@ -25,6 +25,7 @@ interface LineItemProductVariantImportDraft extends JsonObject /** *

    Maps to ProductVariant.product.

    * + * @return null|ProductVariantKeyReference */ public function getProductVariant(); @@ -32,6 +33,7 @@ public function getProductVariant(); /** *

    Maps to ProductVariantImportDraft.sku.

    * + * @return null|string */ public function getSku(); @@ -39,6 +41,7 @@ public function getSku(); /** *

    Maps to ProductVariantImportDraft.prices

    * + * @return null|LineItemPriceCollection */ public function getPrices(); @@ -46,6 +49,7 @@ public function getPrices(); /** *

    Maps to ProductVariantImportDraft.attributes

    * + * @return null|AttributeCollection */ public function getAttributes(); @@ -53,6 +57,7 @@ public function getAttributes(); /** *

    Maps to ProductVariantImportDraft.images.

    * + * @return null|ImageCollection */ public function getImages(); diff --git a/lib/commercetools-import/src/Models/Orders/LineItemProductVariantImportDraftBuilder.php b/lib/commercetools-import/src/Models/Orders/LineItemProductVariantImportDraftBuilder.php index 6422b7116b7..53ebd21f75a 100644 --- a/lib/commercetools-import/src/Models/Orders/LineItemProductVariantImportDraftBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/LineItemProductVariantImportDraftBuilder.php @@ -25,26 +25,31 @@ final class LineItemProductVariantImportDraftBuilder implements Builder { /** + * @var null|ProductVariantKeyReference|ProductVariantKeyReferenceBuilder */ private $productVariant; /** + * @var ?string */ private $sku; /** + * @var ?LineItemPriceCollection */ private $prices; /** + * @var ?AttributeCollection */ private $attributes; /** + * @var ?ImageCollection */ private $images; @@ -52,6 +57,7 @@ final class LineItemProductVariantImportDraftBuilder implements Builder /** *

    Maps to ProductVariant.product.

    * + * @return null|ProductVariantKeyReference */ public function getProductVariant() @@ -62,6 +68,7 @@ public function getProductVariant() /** *

    Maps to ProductVariantImportDraft.sku.

    * + * @return null|string */ public function getSku() @@ -72,6 +79,7 @@ public function getSku() /** *

    Maps to ProductVariantImportDraft.prices

    * + * @return null|LineItemPriceCollection */ public function getPrices() @@ -82,6 +90,7 @@ public function getPrices() /** *

    Maps to ProductVariantImportDraft.attributes

    * + * @return null|AttributeCollection */ public function getAttributes() @@ -92,6 +101,7 @@ public function getAttributes() /** *

    Maps to ProductVariantImportDraft.images.

    * + * @return null|ImageCollection */ public function getImages() diff --git a/lib/commercetools-import/src/Models/Orders/LineItemProductVariantImportDraftModel.php b/lib/commercetools-import/src/Models/Orders/LineItemProductVariantImportDraftModel.php index dfe6f428c9b..f7d9b76faac 100644 --- a/lib/commercetools-import/src/Models/Orders/LineItemProductVariantImportDraftModel.php +++ b/lib/commercetools-import/src/Models/Orders/LineItemProductVariantImportDraftModel.php @@ -24,26 +24,31 @@ final class LineItemProductVariantImportDraftModel extends JsonObjectModel implements LineItemProductVariantImportDraft { /** + * * @var ?ProductVariantKeyReference */ protected $productVariant; /** + * * @var ?string */ protected $sku; /** + * * @var ?LineItemPriceCollection */ protected $prices; /** + * * @var ?AttributeCollection */ protected $attributes; /** + * * @var ?ImageCollection */ protected $images; @@ -69,6 +74,7 @@ public function __construct( /** *

    Maps to ProductVariant.product.

    * + * * @return null|ProductVariantKeyReference */ public function getProductVariant() @@ -89,6 +95,7 @@ public function getProductVariant() /** *

    Maps to ProductVariantImportDraft.sku.

    * + * * @return null|string */ public function getSku() @@ -108,6 +115,7 @@ public function getSku() /** *

    Maps to ProductVariantImportDraft.prices

    * + * * @return null|LineItemPriceCollection */ public function getPrices() @@ -127,6 +135,7 @@ public function getPrices() /** *

    Maps to ProductVariantImportDraft.attributes

    * + * * @return null|AttributeCollection */ public function getAttributes() @@ -146,6 +155,7 @@ public function getAttributes() /** *

    Maps to ProductVariantImportDraft.images.

    * + * * @return null|ImageCollection */ public function getImages() diff --git a/lib/commercetools-import/src/Models/Orders/OrderImport.php b/lib/commercetools-import/src/Models/Orders/OrderImport.php index f7b6984200b..c55c9276052 100644 --- a/lib/commercetools-import/src/Models/Orders/OrderImport.php +++ b/lib/commercetools-import/src/Models/Orders/OrderImport.php @@ -14,6 +14,7 @@ use Commercetools\Import\Models\Common\AddressCollection; use Commercetools\Import\Models\Common\CustomerGroupKeyReference; use Commercetools\Import\Models\Common\CustomerKeyReference; +use Commercetools\Import\Models\Common\StoreKeyReference; use Commercetools\Import\Models\Common\TypedMoney; use Commercetools\Import\Models\Customfields\Custom; use DateTimeImmutable; @@ -42,15 +43,18 @@ interface OrderImport extends JsonObject public const FIELD_TAX_CALCULATION_MODE = 'taxCalculationMode'; public const FIELD_ORIGIN = 'origin'; public const FIELD_ITEM_SHIPPING_ADDRESSES = 'itemShippingAddresses'; + public const FIELD_STORE = 'store'; /** *

    Maps to Order.orderNumber, String that uniquely identifies an order. It should be unique across a project. Once it's set it cannot be changed.

    * + * @return null|string */ public function getOrderNumber(); /** + * @return null|CustomerKeyReference */ public function getCustomer(); @@ -58,6 +62,7 @@ public function getCustomer(); /** *

    Maps to Order.customerEmail.

    * + * @return null|string */ public function getCustomerEmail(); @@ -65,6 +70,7 @@ public function getCustomerEmail(); /** *

    Maps to Order.lineItems.

    * + * @return null|LineItemImportDraftCollection */ public function getLineItems(); @@ -72,6 +78,7 @@ public function getLineItems(); /** *

    Maps to Order.customLineItems

    * + * @return null|CustomLineItemDraftCollection */ public function getCustomLineItems(); @@ -79,6 +86,7 @@ public function getCustomLineItems(); /** *

    Maps to Order.totalPrice.

    * + * @return null|TypedMoney */ public function getTotalPrice(); @@ -86,6 +94,7 @@ public function getTotalPrice(); /** *

    Maps to Order.taxedPrice.

    * + * @return null|TaxedPrice */ public function getTaxedPrice(); @@ -93,6 +102,7 @@ public function getTaxedPrice(); /** *

    Maps to Order.shippingAddress.

    * + * @return null|Address */ public function getShippingAddress(); @@ -100,6 +110,7 @@ public function getShippingAddress(); /** *

    Maps to Order.billingAddress.

    * + * @return null|Address */ public function getBillingAddress(); @@ -107,6 +118,7 @@ public function getBillingAddress(); /** *

    Maps to Order.customerGroup.

    * + * @return null|CustomerGroupKeyReference */ public function getCustomerGroup(); @@ -114,6 +126,7 @@ public function getCustomerGroup(); /** *

    Maps to Order.country.

    * + * @return null|string */ public function getCountry(); @@ -121,6 +134,7 @@ public function getCountry(); /** *

    Maps to Order.orderState.

    * + * @return null|string */ public function getOrderState(); @@ -128,6 +142,7 @@ public function getOrderState(); /** *

    Maps to Order.shipmentState.

    * + * @return null|string */ public function getShipmentState(); @@ -135,6 +150,7 @@ public function getShipmentState(); /** *

    Maps to Order.paymentState.

    * + * @return null|string */ public function getPaymentState(); @@ -142,6 +158,7 @@ public function getPaymentState(); /** *

    Maps to Order.shippingInfo.

    * + * @return null|ShippingInfoImportDraft */ public function getShippingInfo(); @@ -149,6 +166,7 @@ public function getShippingInfo(); /** *

    Maps to Order.completedAt.

    * + * @return null|DateTimeImmutable */ public function getCompletedAt(); @@ -156,6 +174,7 @@ public function getCompletedAt(); /** *

    Maps to Order.custom.

    * + * @return null|Custom */ public function getCustom(); @@ -163,6 +182,7 @@ public function getCustom(); /** *

    Maps to Order.inventoryMode.

    * + * @return null|string */ public function getInventoryMode(); @@ -170,6 +190,7 @@ public function getInventoryMode(); /** *

    Maps to Order.taxRoundingMode.

    * + * @return null|string */ public function getTaxRoundingMode(); @@ -177,6 +198,7 @@ public function getTaxRoundingMode(); /** *

    Maps to Order.taxCalculationMode.

    * + * @return null|string */ public function getTaxCalculationMode(); @@ -184,6 +206,7 @@ public function getTaxCalculationMode(); /** *

    Maps to Order.origin.

    * + * @return null|string */ public function getOrigin(); @@ -191,10 +214,19 @@ public function getOrigin(); /** *

    Maps to Order.itemShippingAddresses.

    * + * @return null|AddressCollection */ public function getItemShippingAddresses(); + /** + *

    Reference to the Store in which the Order is associated. If referenced Store does not exist, the state of the ImportOperation will be set to unresolved until the necessary Store exists.

    + * + + * @return null|StoreKeyReference + */ + public function getStore(); + /** * @param ?string $orderNumber */ @@ -304,4 +336,9 @@ public function setOrigin(?string $origin): void; * @param ?AddressCollection $itemShippingAddresses */ public function setItemShippingAddresses(?AddressCollection $itemShippingAddresses): void; + + /** + * @param ?StoreKeyReference $store + */ + public function setStore(?StoreKeyReference $store): void; } diff --git a/lib/commercetools-import/src/Models/Orders/OrderImportBuilder.php b/lib/commercetools-import/src/Models/Orders/OrderImportBuilder.php index 5ec7b66e538..6f59a8e22f7 100644 --- a/lib/commercetools-import/src/Models/Orders/OrderImportBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/OrderImportBuilder.php @@ -20,6 +20,8 @@ use Commercetools\Import\Models\Common\CustomerGroupKeyReferenceBuilder; use Commercetools\Import\Models\Common\CustomerKeyReference; use Commercetools\Import\Models\Common\CustomerKeyReferenceBuilder; +use Commercetools\Import\Models\Common\StoreKeyReference; +use Commercetools\Import\Models\Common\StoreKeyReferenceBuilder; use Commercetools\Import\Models\Common\TypedMoney; use Commercetools\Import\Models\Common\TypedMoneyBuilder; use Commercetools\Import\Models\Customfields\Custom; @@ -33,118 +35,147 @@ final class OrderImportBuilder implements Builder { /** + * @var ?string */ private $orderNumber; /** + * @var null|CustomerKeyReference|CustomerKeyReferenceBuilder */ private $customer; /** + * @var ?string */ private $customerEmail; /** + * @var ?LineItemImportDraftCollection */ private $lineItems; /** + * @var ?CustomLineItemDraftCollection */ private $customLineItems; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $totalPrice; /** + * @var null|TaxedPrice|TaxedPriceBuilder */ private $taxedPrice; /** + * @var null|Address|AddressBuilder */ private $shippingAddress; /** + * @var null|Address|AddressBuilder */ private $billingAddress; /** + * @var null|CustomerGroupKeyReference|CustomerGroupKeyReferenceBuilder */ private $customerGroup; /** + * @var ?string */ private $country; /** + * @var ?string */ private $orderState; /** + * @var ?string */ private $shipmentState; /** + * @var ?string */ private $paymentState; /** + * @var null|ShippingInfoImportDraft|ShippingInfoImportDraftBuilder */ private $shippingInfo; /** + * @var ?DateTimeImmutable */ private $completedAt; /** + * @var null|Custom|CustomBuilder */ private $custom; /** + * @var ?string */ private $inventoryMode; /** + * @var ?string */ private $taxRoundingMode; /** + * @var ?string */ private $taxCalculationMode; /** + * @var ?string */ private $origin; /** + * @var ?AddressCollection */ private $itemShippingAddresses; + /** + + * @var null|StoreKeyReference|StoreKeyReferenceBuilder + */ + private $store; + /** *

    Maps to Order.orderNumber, String that uniquely identifies an order. It should be unique across a project. Once it's set it cannot be changed.

    * + * @return null|string */ public function getOrderNumber() @@ -153,6 +184,7 @@ public function getOrderNumber() } /** + * @return null|CustomerKeyReference */ public function getCustomer() @@ -163,6 +195,7 @@ public function getCustomer() /** *

    Maps to Order.customerEmail.

    * + * @return null|string */ public function getCustomerEmail() @@ -173,6 +206,7 @@ public function getCustomerEmail() /** *

    Maps to Order.lineItems.

    * + * @return null|LineItemImportDraftCollection */ public function getLineItems() @@ -183,6 +217,7 @@ public function getLineItems() /** *

    Maps to Order.customLineItems

    * + * @return null|CustomLineItemDraftCollection */ public function getCustomLineItems() @@ -193,6 +228,7 @@ public function getCustomLineItems() /** *

    Maps to Order.totalPrice.

    * + * @return null|TypedMoney */ public function getTotalPrice() @@ -203,6 +239,7 @@ public function getTotalPrice() /** *

    Maps to Order.taxedPrice.

    * + * @return null|TaxedPrice */ public function getTaxedPrice() @@ -213,6 +250,7 @@ public function getTaxedPrice() /** *

    Maps to Order.shippingAddress.

    * + * @return null|Address */ public function getShippingAddress() @@ -223,6 +261,7 @@ public function getShippingAddress() /** *

    Maps to Order.billingAddress.

    * + * @return null|Address */ public function getBillingAddress() @@ -233,6 +272,7 @@ public function getBillingAddress() /** *

    Maps to Order.customerGroup.

    * + * @return null|CustomerGroupKeyReference */ public function getCustomerGroup() @@ -243,6 +283,7 @@ public function getCustomerGroup() /** *

    Maps to Order.country.

    * + * @return null|string */ public function getCountry() @@ -253,6 +294,7 @@ public function getCountry() /** *

    Maps to Order.orderState.

    * + * @return null|string */ public function getOrderState() @@ -263,6 +305,7 @@ public function getOrderState() /** *

    Maps to Order.shipmentState.

    * + * @return null|string */ public function getShipmentState() @@ -273,6 +316,7 @@ public function getShipmentState() /** *

    Maps to Order.paymentState.

    * + * @return null|string */ public function getPaymentState() @@ -283,6 +327,7 @@ public function getPaymentState() /** *

    Maps to Order.shippingInfo.

    * + * @return null|ShippingInfoImportDraft */ public function getShippingInfo() @@ -293,6 +338,7 @@ public function getShippingInfo() /** *

    Maps to Order.completedAt.

    * + * @return null|DateTimeImmutable */ public function getCompletedAt() @@ -303,6 +349,7 @@ public function getCompletedAt() /** *

    Maps to Order.custom.

    * + * @return null|Custom */ public function getCustom() @@ -313,6 +360,7 @@ public function getCustom() /** *

    Maps to Order.inventoryMode.

    * + * @return null|string */ public function getInventoryMode() @@ -323,6 +371,7 @@ public function getInventoryMode() /** *

    Maps to Order.taxRoundingMode.

    * + * @return null|string */ public function getTaxRoundingMode() @@ -333,6 +382,7 @@ public function getTaxRoundingMode() /** *

    Maps to Order.taxCalculationMode.

    * + * @return null|string */ public function getTaxCalculationMode() @@ -343,6 +393,7 @@ public function getTaxCalculationMode() /** *

    Maps to Order.origin.

    * + * @return null|string */ public function getOrigin() @@ -353,6 +404,7 @@ public function getOrigin() /** *

    Maps to Order.itemShippingAddresses.

    * + * @return null|AddressCollection */ public function getItemShippingAddresses() @@ -360,6 +412,17 @@ public function getItemShippingAddresses() return $this->itemShippingAddresses; } + /** + *

    Reference to the Store in which the Order is associated. If referenced Store does not exist, the state of the ImportOperation will be set to unresolved until the necessary Store exists.

    + * + + * @return null|StoreKeyReference + */ + public function getStore() + { + return $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store; + } + /** * @param ?string $orderNumber * @return $this @@ -602,6 +665,17 @@ public function withItemShippingAddresses(?AddressCollection $itemShippingAddres return $this; } + /** + * @param ?StoreKeyReference $store + * @return $this + */ + public function withStore(?StoreKeyReference $store) + { + $this->store = $store; + + return $this; + } + /** * @deprecated use withCustomer() instead * @return $this @@ -690,6 +764,17 @@ public function withCustomBuilder(?CustomBuilder $custom) return $this; } + /** + * @deprecated use withStore() instead + * @return $this + */ + public function withStoreBuilder(?StoreKeyReferenceBuilder $store) + { + $this->store = $store; + + return $this; + } + public function build(): OrderImport { return new OrderImportModel( @@ -714,7 +799,8 @@ public function build(): OrderImport $this->taxRoundingMode, $this->taxCalculationMode, $this->origin, - $this->itemShippingAddresses + $this->itemShippingAddresses, + $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store ); } diff --git a/lib/commercetools-import/src/Models/Orders/OrderImportModel.php b/lib/commercetools-import/src/Models/Orders/OrderImportModel.php index eb1ff0387a5..a5d0f5c8c25 100644 --- a/lib/commercetools-import/src/Models/Orders/OrderImportModel.php +++ b/lib/commercetools-import/src/Models/Orders/OrderImportModel.php @@ -19,6 +19,8 @@ use Commercetools\Import\Models\Common\CustomerGroupKeyReferenceModel; use Commercetools\Import\Models\Common\CustomerKeyReference; use Commercetools\Import\Models\Common\CustomerKeyReferenceModel; +use Commercetools\Import\Models\Common\StoreKeyReference; +use Commercetools\Import\Models\Common\StoreKeyReferenceModel; use Commercetools\Import\Models\Common\TypedMoney; use Commercetools\Import\Models\Common\TypedMoneyModel; use Commercetools\Import\Models\Customfields\Custom; @@ -32,115 +34,143 @@ final class OrderImportModel extends JsonObjectModel implements OrderImport { /** + * * @var ?string */ protected $orderNumber; /** + * * @var ?CustomerKeyReference */ protected $customer; /** + * * @var ?string */ protected $customerEmail; /** + * * @var ?LineItemImportDraftCollection */ protected $lineItems; /** + * * @var ?CustomLineItemDraftCollection */ protected $customLineItems; /** + * * @var ?TypedMoney */ protected $totalPrice; /** + * * @var ?TaxedPrice */ protected $taxedPrice; /** + * * @var ?Address */ protected $shippingAddress; /** + * * @var ?Address */ protected $billingAddress; /** + * * @var ?CustomerGroupKeyReference */ protected $customerGroup; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $orderState; /** + * * @var ?string */ protected $shipmentState; /** + * * @var ?string */ protected $paymentState; /** + * * @var ?ShippingInfoImportDraft */ protected $shippingInfo; /** + * * @var ?DateTimeImmutable */ protected $completedAt; /** + * * @var ?Custom */ protected $custom; /** + * * @var ?string */ protected $inventoryMode; /** + * * @var ?string */ protected $taxRoundingMode; /** + * * @var ?string */ protected $taxCalculationMode; /** + * * @var ?string */ protected $origin; /** + * * @var ?AddressCollection */ protected $itemShippingAddresses; + /** + * + * @var ?StoreKeyReference + */ + protected $store; + /** * @psalm-suppress MissingParamType @@ -167,7 +197,8 @@ public function __construct( ?string $taxRoundingMode = null, ?string $taxCalculationMode = null, ?string $origin = null, - ?AddressCollection $itemShippingAddresses = null + ?AddressCollection $itemShippingAddresses = null, + ?StoreKeyReference $store = null ) { $this->orderNumber = $orderNumber; $this->customer = $customer; @@ -191,11 +222,13 @@ public function __construct( $this->taxCalculationMode = $taxCalculationMode; $this->origin = $origin; $this->itemShippingAddresses = $itemShippingAddresses; + $this->store = $store; } /** *

    Maps to Order.orderNumber, String that uniquely identifies an order. It should be unique across a project. Once it's set it cannot be changed.

    * + * * @return null|string */ public function getOrderNumber() @@ -213,6 +246,7 @@ public function getOrderNumber() } /** + * * @return null|CustomerKeyReference */ public function getCustomer() @@ -233,6 +267,7 @@ public function getCustomer() /** *

    Maps to Order.customerEmail.

    * + * * @return null|string */ public function getCustomerEmail() @@ -252,6 +287,7 @@ public function getCustomerEmail() /** *

    Maps to Order.lineItems.

    * + * * @return null|LineItemImportDraftCollection */ public function getLineItems() @@ -271,6 +307,7 @@ public function getLineItems() /** *

    Maps to Order.customLineItems

    * + * * @return null|CustomLineItemDraftCollection */ public function getCustomLineItems() @@ -290,6 +327,7 @@ public function getCustomLineItems() /** *

    Maps to Order.totalPrice.

    * + * * @return null|TypedMoney */ public function getTotalPrice() @@ -310,6 +348,7 @@ public function getTotalPrice() /** *

    Maps to Order.taxedPrice.

    * + * * @return null|TaxedPrice */ public function getTaxedPrice() @@ -330,6 +369,7 @@ public function getTaxedPrice() /** *

    Maps to Order.shippingAddress.

    * + * * @return null|Address */ public function getShippingAddress() @@ -350,6 +390,7 @@ public function getShippingAddress() /** *

    Maps to Order.billingAddress.

    * + * * @return null|Address */ public function getBillingAddress() @@ -370,6 +411,7 @@ public function getBillingAddress() /** *

    Maps to Order.customerGroup.

    * + * * @return null|CustomerGroupKeyReference */ public function getCustomerGroup() @@ -390,6 +432,7 @@ public function getCustomerGroup() /** *

    Maps to Order.country.

    * + * * @return null|string */ public function getCountry() @@ -409,6 +452,7 @@ public function getCountry() /** *

    Maps to Order.orderState.

    * + * * @return null|string */ public function getOrderState() @@ -428,6 +472,7 @@ public function getOrderState() /** *

    Maps to Order.shipmentState.

    * + * * @return null|string */ public function getShipmentState() @@ -447,6 +492,7 @@ public function getShipmentState() /** *

    Maps to Order.paymentState.

    * + * * @return null|string */ public function getPaymentState() @@ -466,6 +512,7 @@ public function getPaymentState() /** *

    Maps to Order.shippingInfo.

    * + * * @return null|ShippingInfoImportDraft */ public function getShippingInfo() @@ -486,6 +533,7 @@ public function getShippingInfo() /** *

    Maps to Order.completedAt.

    * + * * @return null|DateTimeImmutable */ public function getCompletedAt() @@ -509,6 +557,7 @@ public function getCompletedAt() /** *

    Maps to Order.custom.

    * + * * @return null|Custom */ public function getCustom() @@ -529,6 +578,7 @@ public function getCustom() /** *

    Maps to Order.inventoryMode.

    * + * * @return null|string */ public function getInventoryMode() @@ -548,6 +598,7 @@ public function getInventoryMode() /** *

    Maps to Order.taxRoundingMode.

    * + * * @return null|string */ public function getTaxRoundingMode() @@ -567,6 +618,7 @@ public function getTaxRoundingMode() /** *

    Maps to Order.taxCalculationMode.

    * + * * @return null|string */ public function getTaxCalculationMode() @@ -586,6 +638,7 @@ public function getTaxCalculationMode() /** *

    Maps to Order.origin.

    * + * * @return null|string */ public function getOrigin() @@ -605,6 +658,7 @@ public function getOrigin() /** *

    Maps to Order.itemShippingAddresses.

    * + * * @return null|AddressCollection */ public function getItemShippingAddresses() @@ -621,6 +675,27 @@ public function getItemShippingAddresses() return $this->itemShippingAddresses; } + /** + *

    Reference to the Store in which the Order is associated. If referenced Store does not exist, the state of the ImportOperation will be set to unresolved until the necessary Store exists.

    + * + * + * @return null|StoreKeyReference + */ + public function getStore() + { + if (is_null($this->store)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STORE); + if (is_null($data)) { + return null; + } + + $this->store = StoreKeyReferenceModel::of($data); + } + + return $this->store; + } + /** * @param ?string $orderNumber @@ -798,6 +873,14 @@ public function setItemShippingAddresses(?AddressCollection $itemShippingAddress $this->itemShippingAddresses = $itemShippingAddresses; } + /** + * @param ?StoreKeyReference $store + */ + public function setStore(?StoreKeyReference $store): void + { + $this->store = $store; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-import/src/Models/Orders/Parcel.php b/lib/commercetools-import/src/Models/Orders/Parcel.php index fcac8142ce0..53b327b51de 100644 --- a/lib/commercetools-import/src/Models/Orders/Parcel.php +++ b/lib/commercetools-import/src/Models/Orders/Parcel.php @@ -21,26 +21,31 @@ interface Parcel extends JsonObject public const FIELD_ITEMS = 'items'; /** + * @return null|string */ public function getId(); /** + * @return null|DateTimeImmutable */ public function getCreatedAt(); /** + * @return null|ParcelMeasurements */ public function getMeasurements(); /** + * @return null|TrackingData */ public function getTrackingData(); /** + * @return null|DeliveryItemCollection */ public function getItems(); diff --git a/lib/commercetools-import/src/Models/Orders/ParcelBuilder.php b/lib/commercetools-import/src/Models/Orders/ParcelBuilder.php index 7bd6e28eb2f..7f86847d3e1 100644 --- a/lib/commercetools-import/src/Models/Orders/ParcelBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/ParcelBuilder.php @@ -22,31 +22,37 @@ final class ParcelBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?DateTimeImmutable */ private $createdAt; /** + * @var null|ParcelMeasurements|ParcelMeasurementsBuilder */ private $measurements; /** + * @var null|TrackingData|TrackingDataBuilder */ private $trackingData; /** + * @var ?DeliveryItemCollection */ private $items; /** + * @return null|string */ public function getId() @@ -55,6 +61,7 @@ public function getId() } /** + * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -63,6 +70,7 @@ public function getCreatedAt() } /** + * @return null|ParcelMeasurements */ public function getMeasurements() @@ -71,6 +79,7 @@ public function getMeasurements() } /** + * @return null|TrackingData */ public function getTrackingData() @@ -79,6 +88,7 @@ public function getTrackingData() } /** + * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-import/src/Models/Orders/ParcelMeasurements.php b/lib/commercetools-import/src/Models/Orders/ParcelMeasurements.php index 35a5eb54ef5..068397cbe67 100644 --- a/lib/commercetools-import/src/Models/Orders/ParcelMeasurements.php +++ b/lib/commercetools-import/src/Models/Orders/ParcelMeasurements.php @@ -19,21 +19,25 @@ interface ParcelMeasurements extends JsonObject public const FIELD_WEIGHT_IN_GRAM = 'weightInGram'; /** + * @return null|float */ public function getHeightInMillimeter(); /** + * @return null|float */ public function getLengthInMillimeter(); /** + * @return null|float */ public function getWidthInMillimeter(); /** + * @return null|float */ public function getWeightInGram(); diff --git a/lib/commercetools-import/src/Models/Orders/ParcelMeasurementsBuilder.php b/lib/commercetools-import/src/Models/Orders/ParcelMeasurementsBuilder.php index 48aaa73318a..171c93d641b 100644 --- a/lib/commercetools-import/src/Models/Orders/ParcelMeasurementsBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/ParcelMeasurementsBuilder.php @@ -21,26 +21,31 @@ final class ParcelMeasurementsBuilder implements Builder { /** + * @var ?float */ private $heightInMillimeter; /** + * @var ?float */ private $lengthInMillimeter; /** + * @var ?float */ private $widthInMillimeter; /** + * @var ?float */ private $weightInGram; /** + * @return null|float */ public function getHeightInMillimeter() @@ -49,6 +54,7 @@ public function getHeightInMillimeter() } /** + * @return null|float */ public function getLengthInMillimeter() @@ -57,6 +63,7 @@ public function getLengthInMillimeter() } /** + * @return null|float */ public function getWidthInMillimeter() @@ -65,6 +72,7 @@ public function getWidthInMillimeter() } /** + * @return null|float */ public function getWeightInGram() diff --git a/lib/commercetools-import/src/Models/Orders/ParcelMeasurementsModel.php b/lib/commercetools-import/src/Models/Orders/ParcelMeasurementsModel.php index 20e4cfd61c2..7c1baa77e9b 100644 --- a/lib/commercetools-import/src/Models/Orders/ParcelMeasurementsModel.php +++ b/lib/commercetools-import/src/Models/Orders/ParcelMeasurementsModel.php @@ -20,21 +20,25 @@ final class ParcelMeasurementsModel extends JsonObjectModel implements ParcelMeasurements { /** + * * @var ?float */ protected $heightInMillimeter; /** + * * @var ?float */ protected $lengthInMillimeter; /** + * * @var ?float */ protected $widthInMillimeter; /** + * * @var ?float */ protected $weightInGram; @@ -56,6 +60,7 @@ public function __construct( } /** + * * @return null|float */ public function getHeightInMillimeter() @@ -73,6 +78,7 @@ public function getHeightInMillimeter() } /** + * * @return null|float */ public function getLengthInMillimeter() @@ -90,6 +96,7 @@ public function getLengthInMillimeter() } /** + * * @return null|float */ public function getWidthInMillimeter() @@ -107,6 +114,7 @@ public function getWidthInMillimeter() } /** + * * @return null|float */ public function getWeightInGram() diff --git a/lib/commercetools-import/src/Models/Orders/ParcelModel.php b/lib/commercetools-import/src/Models/Orders/ParcelModel.php index bc4ff908abe..cb283c40411 100644 --- a/lib/commercetools-import/src/Models/Orders/ParcelModel.php +++ b/lib/commercetools-import/src/Models/Orders/ParcelModel.php @@ -21,26 +21,31 @@ final class ParcelModel extends JsonObjectModel implements Parcel { /** + * * @var ?string */ protected $id; /** + * * @var ?DateTimeImmutable */ protected $createdAt; /** + * * @var ?ParcelMeasurements */ protected $measurements; /** + * * @var ?TrackingData */ protected $trackingData; /** + * * @var ?DeliveryItemCollection */ protected $items; @@ -64,6 +69,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -81,6 +87,7 @@ public function getId() } /** + * * @return null|DateTimeImmutable */ public function getCreatedAt() @@ -102,6 +109,7 @@ public function getCreatedAt() } /** + * * @return null|ParcelMeasurements */ public function getMeasurements() @@ -120,6 +128,7 @@ public function getMeasurements() } /** + * * @return null|TrackingData */ public function getTrackingData() @@ -138,6 +147,7 @@ public function getTrackingData() } /** + * * @return null|DeliveryItemCollection */ public function getItems() diff --git a/lib/commercetools-import/src/Models/Orders/ScoreShippingRateInput.php b/lib/commercetools-import/src/Models/Orders/ScoreShippingRateInput.php index 14e061f4dce..6754fc4ac28 100644 --- a/lib/commercetools-import/src/Models/Orders/ScoreShippingRateInput.php +++ b/lib/commercetools-import/src/Models/Orders/ScoreShippingRateInput.php @@ -16,6 +16,7 @@ interface ScoreShippingRateInput extends ShippingRateInput public const FIELD_SCORE = 'score'; /** + * @return null|float */ public function getScore(); diff --git a/lib/commercetools-import/src/Models/Orders/ScoreShippingRateInputBuilder.php b/lib/commercetools-import/src/Models/Orders/ScoreShippingRateInputBuilder.php index 5e497b82866..5ab106df174 100644 --- a/lib/commercetools-import/src/Models/Orders/ScoreShippingRateInputBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/ScoreShippingRateInputBuilder.php @@ -21,11 +21,13 @@ final class ScoreShippingRateInputBuilder implements Builder { /** + * @var ?float */ private $score; /** + * @return null|float */ public function getScore() diff --git a/lib/commercetools-import/src/Models/Orders/ScoreShippingRateInputModel.php b/lib/commercetools-import/src/Models/Orders/ScoreShippingRateInputModel.php index cdd408b7c6f..ac4e97e2655 100644 --- a/lib/commercetools-import/src/Models/Orders/ScoreShippingRateInputModel.php +++ b/lib/commercetools-import/src/Models/Orders/ScoreShippingRateInputModel.php @@ -21,11 +21,13 @@ final class ScoreShippingRateInputModel extends JsonObjectModel implements Score { public const DISCRIMINATOR_VALUE = 'Score'; /** + * * @var ?string */ protected $type; /** + * * @var ?float */ protected $score; @@ -35,13 +37,15 @@ final class ScoreShippingRateInputModel extends JsonObjectModel implements Score * @psalm-suppress MissingParamType */ public function __construct( - ?float $score = null + ?float $score = null, + ?string $type = null ) { $this->score = $score; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,6 +63,7 @@ public function getType() } /** + * * @return null|float */ public function getScore() diff --git a/lib/commercetools-import/src/Models/Orders/ShippingInfoImportDraft.php b/lib/commercetools-import/src/Models/Orders/ShippingInfoImportDraft.php index 7ed8fe0b53e..c769f006396 100644 --- a/lib/commercetools-import/src/Models/Orders/ShippingInfoImportDraft.php +++ b/lib/commercetools-import/src/Models/Orders/ShippingInfoImportDraft.php @@ -28,21 +28,25 @@ interface ShippingInfoImportDraft extends JsonObject public const FIELD_SHIPPING_METHOD_STATE = 'shippingMethodState'; /** + * @return null|string */ public function getShippingMethodName(); /** + * @return null|TypedMoney */ public function getPrice(); /** + * @return null|ShippingRateDraft */ public function getShippingRate(); /** + * @return null|TaxRate */ public function getTaxRate(); @@ -50,6 +54,7 @@ public function getTaxRate(); /** *

    References a tax category by key.

    * + * @return null|TaxCategoryKeyReference */ public function getTaxCategory(); @@ -57,6 +62,7 @@ public function getTaxCategory(); /** *

    References a shipping method by key.

    * + * @return null|ShippingMethodKeyReference */ public function getShippingMethod(); @@ -64,16 +70,19 @@ public function getShippingMethod(); /** *

    Note that you can not add a DeliveryItem on import, as LineItems and CustomLineItems are not yet referencable by an id.

    * + * @return null|DeliveryCollection */ public function getDeliveries(); /** + * @return null|DiscountedLineItemPriceDraft */ public function getDiscountedPrice(); /** + * @return null|string */ public function getShippingMethodState(); diff --git a/lib/commercetools-import/src/Models/Orders/ShippingInfoImportDraftBuilder.php b/lib/commercetools-import/src/Models/Orders/ShippingInfoImportDraftBuilder.php index b230dc110fc..2f30c40a990 100644 --- a/lib/commercetools-import/src/Models/Orders/ShippingInfoImportDraftBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/ShippingInfoImportDraftBuilder.php @@ -29,51 +29,61 @@ final class ShippingInfoImportDraftBuilder implements Builder { /** + * @var ?string */ private $shippingMethodName; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $price; /** + * @var null|ShippingRateDraft|ShippingRateDraftBuilder */ private $shippingRate; /** + * @var null|TaxRate|TaxRateBuilder */ private $taxRate; /** + * @var null|TaxCategoryKeyReference|TaxCategoryKeyReferenceBuilder */ private $taxCategory; /** + * @var null|ShippingMethodKeyReference|ShippingMethodKeyReferenceBuilder */ private $shippingMethod; /** + * @var ?DeliveryCollection */ private $deliveries; /** + * @var null|DiscountedLineItemPriceDraft|DiscountedLineItemPriceDraftBuilder */ private $discountedPrice; /** + * @var ?string */ private $shippingMethodState; /** + * @return null|string */ public function getShippingMethodName() @@ -82,6 +92,7 @@ public function getShippingMethodName() } /** + * @return null|TypedMoney */ public function getPrice() @@ -90,6 +101,7 @@ public function getPrice() } /** + * @return null|ShippingRateDraft */ public function getShippingRate() @@ -98,6 +110,7 @@ public function getShippingRate() } /** + * @return null|TaxRate */ public function getTaxRate() @@ -108,6 +121,7 @@ public function getTaxRate() /** *

    References a tax category by key.

    * + * @return null|TaxCategoryKeyReference */ public function getTaxCategory() @@ -118,6 +132,7 @@ public function getTaxCategory() /** *

    References a shipping method by key.

    * + * @return null|ShippingMethodKeyReference */ public function getShippingMethod() @@ -128,6 +143,7 @@ public function getShippingMethod() /** *

    Note that you can not add a DeliveryItem on import, as LineItems and CustomLineItems are not yet referencable by an id.

    * + * @return null|DeliveryCollection */ public function getDeliveries() @@ -136,6 +152,7 @@ public function getDeliveries() } /** + * @return null|DiscountedLineItemPriceDraft */ public function getDiscountedPrice() @@ -144,6 +161,7 @@ public function getDiscountedPrice() } /** + * @return null|string */ public function getShippingMethodState() diff --git a/lib/commercetools-import/src/Models/Orders/ShippingInfoImportDraftModel.php b/lib/commercetools-import/src/Models/Orders/ShippingInfoImportDraftModel.php index 4545bd28be9..804d5977f87 100644 --- a/lib/commercetools-import/src/Models/Orders/ShippingInfoImportDraftModel.php +++ b/lib/commercetools-import/src/Models/Orders/ShippingInfoImportDraftModel.php @@ -28,46 +28,55 @@ final class ShippingInfoImportDraftModel extends JsonObjectModel implements ShippingInfoImportDraft { /** + * * @var ?string */ protected $shippingMethodName; /** + * * @var ?TypedMoney */ protected $price; /** + * * @var ?ShippingRateDraft */ protected $shippingRate; /** + * * @var ?TaxRate */ protected $taxRate; /** + * * @var ?TaxCategoryKeyReference */ protected $taxCategory; /** + * * @var ?ShippingMethodKeyReference */ protected $shippingMethod; /** + * * @var ?DeliveryCollection */ protected $deliveries; /** + * * @var ?DiscountedLineItemPriceDraft */ protected $discountedPrice; /** + * * @var ?string */ protected $shippingMethodState; @@ -99,6 +108,7 @@ public function __construct( } /** + * * @return null|string */ public function getShippingMethodName() @@ -116,6 +126,7 @@ public function getShippingMethodName() } /** + * * @return null|TypedMoney */ public function getPrice() @@ -134,6 +145,7 @@ public function getPrice() } /** + * * @return null|ShippingRateDraft */ public function getShippingRate() @@ -152,6 +164,7 @@ public function getShippingRate() } /** + * * @return null|TaxRate */ public function getTaxRate() @@ -172,6 +185,7 @@ public function getTaxRate() /** *

    References a tax category by key.

    * + * * @return null|TaxCategoryKeyReference */ public function getTaxCategory() @@ -192,6 +206,7 @@ public function getTaxCategory() /** *

    References a shipping method by key.

    * + * * @return null|ShippingMethodKeyReference */ public function getShippingMethod() @@ -212,6 +227,7 @@ public function getShippingMethod() /** *

    Note that you can not add a DeliveryItem on import, as LineItems and CustomLineItems are not yet referencable by an id.

    * + * * @return null|DeliveryCollection */ public function getDeliveries() @@ -229,6 +245,7 @@ public function getDeliveries() } /** + * * @return null|DiscountedLineItemPriceDraft */ public function getDiscountedPrice() @@ -247,6 +264,7 @@ public function getDiscountedPrice() } /** + * * @return null|string */ public function getShippingMethodState() diff --git a/lib/commercetools-import/src/Models/Orders/ShippingRateDraft.php b/lib/commercetools-import/src/Models/Orders/ShippingRateDraft.php index a3490e56f6d..7acf4356d20 100644 --- a/lib/commercetools-import/src/Models/Orders/ShippingRateDraft.php +++ b/lib/commercetools-import/src/Models/Orders/ShippingRateDraft.php @@ -19,16 +19,19 @@ interface ShippingRateDraft extends JsonObject public const FIELD_TIERS = 'tiers'; /** + * @return null|Money */ public function getPrice(); /** + * @return null|Money */ public function getFreeAbove(); /** + * @return null|ShippingRatePriceTierCollection */ public function getTiers(); diff --git a/lib/commercetools-import/src/Models/Orders/ShippingRateDraftBuilder.php b/lib/commercetools-import/src/Models/Orders/ShippingRateDraftBuilder.php index 06bdfdf594f..ef6d31377fd 100644 --- a/lib/commercetools-import/src/Models/Orders/ShippingRateDraftBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/ShippingRateDraftBuilder.php @@ -23,21 +23,25 @@ final class ShippingRateDraftBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $price; /** + * @var null|Money|MoneyBuilder */ private $freeAbove; /** + * @var ?ShippingRatePriceTierCollection */ private $tiers; /** + * @return null|Money */ public function getPrice() @@ -46,6 +50,7 @@ public function getPrice() } /** + * @return null|Money */ public function getFreeAbove() @@ -54,6 +59,7 @@ public function getFreeAbove() } /** + * @return null|ShippingRatePriceTierCollection */ public function getTiers() diff --git a/lib/commercetools-import/src/Models/Orders/ShippingRateDraftModel.php b/lib/commercetools-import/src/Models/Orders/ShippingRateDraftModel.php index 3bb313e8d02..4c199ac13ac 100644 --- a/lib/commercetools-import/src/Models/Orders/ShippingRateDraftModel.php +++ b/lib/commercetools-import/src/Models/Orders/ShippingRateDraftModel.php @@ -22,16 +22,19 @@ final class ShippingRateDraftModel extends JsonObjectModel implements ShippingRateDraft { /** + * * @var ?Money */ protected $price; /** + * * @var ?Money */ protected $freeAbove; /** + * * @var ?ShippingRatePriceTierCollection */ protected $tiers; @@ -51,6 +54,7 @@ public function __construct( } /** + * * @return null|Money */ public function getPrice() @@ -69,6 +73,7 @@ public function getPrice() } /** + * * @return null|Money */ public function getFreeAbove() @@ -87,6 +92,7 @@ public function getFreeAbove() } /** + * * @return null|ShippingRatePriceTierCollection */ public function getTiers() diff --git a/lib/commercetools-import/src/Models/Orders/ShippingRateInput.php b/lib/commercetools-import/src/Models/Orders/ShippingRateInput.php index 2217bb6c540..dff8eec0c7b 100644 --- a/lib/commercetools-import/src/Models/Orders/ShippingRateInput.php +++ b/lib/commercetools-import/src/Models/Orders/ShippingRateInput.php @@ -17,6 +17,7 @@ interface ShippingRateInput extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-import/src/Models/Orders/ShippingRateInputModel.php b/lib/commercetools-import/src/Models/Orders/ShippingRateInputModel.php index aac57b67e51..cfc615633a9 100644 --- a/lib/commercetools-import/src/Models/Orders/ShippingRateInputModel.php +++ b/lib/commercetools-import/src/Models/Orders/ShippingRateInputModel.php @@ -21,6 +21,7 @@ final class ShippingRateInputModel extends JsonObjectModel implements ShippingRa { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -38,11 +39,13 @@ final class ShippingRateInputModel extends JsonObjectModel implements ShippingRa * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-import/src/Models/Orders/ShippingRatePriceTier.php b/lib/commercetools-import/src/Models/Orders/ShippingRatePriceTier.php index ce5c8101d15..4692c6f9676 100644 --- a/lib/commercetools-import/src/Models/Orders/ShippingRatePriceTier.php +++ b/lib/commercetools-import/src/Models/Orders/ShippingRatePriceTier.php @@ -17,6 +17,7 @@ interface ShippingRatePriceTier extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-import/src/Models/Orders/ShippingRatePriceTierModel.php b/lib/commercetools-import/src/Models/Orders/ShippingRatePriceTierModel.php index d5594517c20..f7ab0944810 100644 --- a/lib/commercetools-import/src/Models/Orders/ShippingRatePriceTierModel.php +++ b/lib/commercetools-import/src/Models/Orders/ShippingRatePriceTierModel.php @@ -21,6 +21,7 @@ final class ShippingRatePriceTierModel extends JsonObjectModel implements Shippi { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -37,11 +38,13 @@ final class ShippingRatePriceTierModel extends JsonObjectModel implements Shippi * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-import/src/Models/Orders/SyncInfo.php b/lib/commercetools-import/src/Models/Orders/SyncInfo.php index 3ded5f324ed..ab22edd59fc 100644 --- a/lib/commercetools-import/src/Models/Orders/SyncInfo.php +++ b/lib/commercetools-import/src/Models/Orders/SyncInfo.php @@ -22,6 +22,7 @@ interface SyncInfo extends JsonObject /** *

    Maps to SyncInfo.channel

    * + * @return null|ChannelKeyReference */ public function getChannel(); @@ -29,6 +30,7 @@ public function getChannel(); /** *

    Maps to SyncInfo.externalId

    * + * @return null|string */ public function getExternalId(); @@ -36,6 +38,7 @@ public function getExternalId(); /** *

    Maps to SyncInfo.syncedAt

    * + * @return null|DateTimeImmutable */ public function getSyncedAt(); diff --git a/lib/commercetools-import/src/Models/Orders/SyncInfoBuilder.php b/lib/commercetools-import/src/Models/Orders/SyncInfoBuilder.php index f0e3f50a48e..25c0ff872d6 100644 --- a/lib/commercetools-import/src/Models/Orders/SyncInfoBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/SyncInfoBuilder.php @@ -24,16 +24,19 @@ final class SyncInfoBuilder implements Builder { /** + * @var null|ChannelKeyReference|ChannelKeyReferenceBuilder */ private $channel; /** + * @var ?string */ private $externalId; /** + * @var ?DateTimeImmutable */ private $syncedAt; @@ -41,6 +44,7 @@ final class SyncInfoBuilder implements Builder /** *

    Maps to SyncInfo.channel

    * + * @return null|ChannelKeyReference */ public function getChannel() @@ -51,6 +55,7 @@ public function getChannel() /** *

    Maps to SyncInfo.externalId

    * + * @return null|string */ public function getExternalId() @@ -61,6 +66,7 @@ public function getExternalId() /** *

    Maps to SyncInfo.syncedAt

    * + * @return null|DateTimeImmutable */ public function getSyncedAt() diff --git a/lib/commercetools-import/src/Models/Orders/SyncInfoModel.php b/lib/commercetools-import/src/Models/Orders/SyncInfoModel.php index 2c86b4ed8c7..18151bf5fc4 100644 --- a/lib/commercetools-import/src/Models/Orders/SyncInfoModel.php +++ b/lib/commercetools-import/src/Models/Orders/SyncInfoModel.php @@ -23,16 +23,19 @@ final class SyncInfoModel extends JsonObjectModel implements SyncInfo { /** + * * @var ?ChannelKeyReference */ protected $channel; /** + * * @var ?string */ protected $externalId; /** + * * @var ?DateTimeImmutable */ protected $syncedAt; @@ -54,6 +57,7 @@ public function __construct( /** *

    Maps to SyncInfo.channel

    * + * * @return null|ChannelKeyReference */ public function getChannel() @@ -74,6 +78,7 @@ public function getChannel() /** *

    Maps to SyncInfo.externalId

    * + * * @return null|string */ public function getExternalId() @@ -93,6 +98,7 @@ public function getExternalId() /** *

    Maps to SyncInfo.syncedAt

    * + * * @return null|DateTimeImmutable */ public function getSyncedAt() diff --git a/lib/commercetools-import/src/Models/Orders/TaxPortion.php b/lib/commercetools-import/src/Models/Orders/TaxPortion.php index 654670511e6..32ae74930d6 100644 --- a/lib/commercetools-import/src/Models/Orders/TaxPortion.php +++ b/lib/commercetools-import/src/Models/Orders/TaxPortion.php @@ -19,16 +19,19 @@ interface TaxPortion extends JsonObject public const FIELD_AMOUNT = 'amount'; /** + * @return null|string */ public function getName(); /** + * @return null|float */ public function getRate(); /** + * @return null|TypedMoney */ public function getAmount(); diff --git a/lib/commercetools-import/src/Models/Orders/TaxPortionBuilder.php b/lib/commercetools-import/src/Models/Orders/TaxPortionBuilder.php index 43716093052..628d1ed6f30 100644 --- a/lib/commercetools-import/src/Models/Orders/TaxPortionBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/TaxPortionBuilder.php @@ -23,21 +23,25 @@ final class TaxPortionBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?float */ private $rate; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $amount; /** + * @return null|string */ public function getName() @@ -46,6 +50,7 @@ public function getName() } /** + * @return null|float */ public function getRate() @@ -54,6 +59,7 @@ public function getRate() } /** + * @return null|TypedMoney */ public function getAmount() diff --git a/lib/commercetools-import/src/Models/Orders/TaxPortionModel.php b/lib/commercetools-import/src/Models/Orders/TaxPortionModel.php index 338e25c681a..b1623fccd06 100644 --- a/lib/commercetools-import/src/Models/Orders/TaxPortionModel.php +++ b/lib/commercetools-import/src/Models/Orders/TaxPortionModel.php @@ -22,16 +22,19 @@ final class TaxPortionModel extends JsonObjectModel implements TaxPortion { /** + * * @var ?string */ protected $name; /** + * * @var ?float */ protected $rate; /** + * * @var ?TypedMoney */ protected $amount; @@ -51,6 +54,7 @@ public function __construct( } /** + * * @return null|string */ public function getName() @@ -68,6 +72,7 @@ public function getName() } /** + * * @return null|float */ public function getRate() @@ -85,6 +90,7 @@ public function getRate() } /** + * * @return null|TypedMoney */ public function getAmount() diff --git a/lib/commercetools-import/src/Models/Orders/TaxedPrice.php b/lib/commercetools-import/src/Models/Orders/TaxedPrice.php index 77c7ac5c268..9dddacbb0d9 100644 --- a/lib/commercetools-import/src/Models/Orders/TaxedPrice.php +++ b/lib/commercetools-import/src/Models/Orders/TaxedPrice.php @@ -17,11 +17,11 @@ interface TaxedPrice extends JsonObject public const FIELD_TOTAL_NET = 'totalNet'; public const FIELD_TOTAL_GROSS = 'totalGross'; public const FIELD_TAX_PORTIONS = 'taxPortions'; - public const FIELD_TOTAL_TAX = 'totalTax'; /** *

    Maps to TaxedPrice.totalNet.

    * + * @return null|Money */ public function getTotalNet(); @@ -29,6 +29,7 @@ public function getTotalNet(); /** *

    Maps to TaxedPrice.totalGross.

    * + * @return null|Money */ public function getTotalGross(); @@ -36,17 +37,11 @@ public function getTotalGross(); /** *

    Maps to TaxedPrice.taxPortions.

    * + * @return null|TaxPortionCollection */ public function getTaxPortions(); - /** - *

    Maps to TaxedPrice.totalTax.

    - * - * @return null|Money - */ - public function getTotalTax(); - /** * @param ?Money $totalNet */ @@ -61,9 +56,4 @@ public function setTotalGross(?Money $totalGross): void; * @param ?TaxPortionCollection $taxPortions */ public function setTaxPortions(?TaxPortionCollection $taxPortions): void; - - /** - * @param ?Money $totalTax - */ - public function setTotalTax(?Money $totalTax): void; } diff --git a/lib/commercetools-import/src/Models/Orders/TaxedPriceBuilder.php b/lib/commercetools-import/src/Models/Orders/TaxedPriceBuilder.php index 10bcdf6efce..ddf4ba74cf8 100644 --- a/lib/commercetools-import/src/Models/Orders/TaxedPriceBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/TaxedPriceBuilder.php @@ -23,28 +23,27 @@ final class TaxedPriceBuilder implements Builder { /** + * @var null|Money|MoneyBuilder */ private $totalNet; /** + * @var null|Money|MoneyBuilder */ private $totalGross; /** + * @var ?TaxPortionCollection */ private $taxPortions; - /** - * @var null|Money|MoneyBuilder - */ - private $totalTax; - /** *

    Maps to TaxedPrice.totalNet.

    * + * @return null|Money */ public function getTotalNet() @@ -55,6 +54,7 @@ public function getTotalNet() /** *

    Maps to TaxedPrice.totalGross.

    * + * @return null|Money */ public function getTotalGross() @@ -65,6 +65,7 @@ public function getTotalGross() /** *

    Maps to TaxedPrice.taxPortions.

    * + * @return null|TaxPortionCollection */ public function getTaxPortions() @@ -72,16 +73,6 @@ public function getTaxPortions() return $this->taxPortions; } - /** - *

    Maps to TaxedPrice.totalTax.

    - * - * @return null|Money - */ - public function getTotalTax() - { - return $this->totalTax instanceof MoneyBuilder ? $this->totalTax->build() : $this->totalTax; - } - /** * @param ?Money $totalNet * @return $this @@ -115,17 +106,6 @@ public function withTaxPortions(?TaxPortionCollection $taxPortions) return $this; } - /** - * @param ?Money $totalTax - * @return $this - */ - public function withTotalTax(?Money $totalTax) - { - $this->totalTax = $totalTax; - - return $this; - } - /** * @deprecated use withTotalNet() instead * @return $this @@ -148,24 +128,12 @@ public function withTotalGrossBuilder(?MoneyBuilder $totalGross) return $this; } - /** - * @deprecated use withTotalTax() instead - * @return $this - */ - public function withTotalTaxBuilder(?MoneyBuilder $totalTax) - { - $this->totalTax = $totalTax; - - return $this; - } - public function build(): TaxedPrice { return new TaxedPriceModel( $this->totalNet instanceof MoneyBuilder ? $this->totalNet->build() : $this->totalNet, $this->totalGross instanceof MoneyBuilder ? $this->totalGross->build() : $this->totalGross, - $this->taxPortions, - $this->totalTax instanceof MoneyBuilder ? $this->totalTax->build() : $this->totalTax + $this->taxPortions ); } diff --git a/lib/commercetools-import/src/Models/Orders/TaxedPriceModel.php b/lib/commercetools-import/src/Models/Orders/TaxedPriceModel.php index 470a4f9a479..8336680655d 100644 --- a/lib/commercetools-import/src/Models/Orders/TaxedPriceModel.php +++ b/lib/commercetools-import/src/Models/Orders/TaxedPriceModel.php @@ -22,25 +22,23 @@ final class TaxedPriceModel extends JsonObjectModel implements TaxedPrice { /** + * * @var ?Money */ protected $totalNet; /** + * * @var ?Money */ protected $totalGross; /** + * * @var ?TaxPortionCollection */ protected $taxPortions; - /** - * @var ?Money - */ - protected $totalTax; - /** * @psalm-suppress MissingParamType @@ -48,18 +46,17 @@ final class TaxedPriceModel extends JsonObjectModel implements TaxedPrice public function __construct( ?Money $totalNet = null, ?Money $totalGross = null, - ?TaxPortionCollection $taxPortions = null, - ?Money $totalTax = null + ?TaxPortionCollection $taxPortions = null ) { $this->totalNet = $totalNet; $this->totalGross = $totalGross; $this->taxPortions = $taxPortions; - $this->totalTax = $totalTax; } /** *

    Maps to TaxedPrice.totalNet.

    * + * * @return null|Money */ public function getTotalNet() @@ -80,6 +77,7 @@ public function getTotalNet() /** *

    Maps to TaxedPrice.totalGross.

    * + * * @return null|Money */ public function getTotalGross() @@ -100,6 +98,7 @@ public function getTotalGross() /** *

    Maps to TaxedPrice.taxPortions.

    * + * * @return null|TaxPortionCollection */ public function getTaxPortions() @@ -116,26 +115,6 @@ public function getTaxPortions() return $this->taxPortions; } - /** - *

    Maps to TaxedPrice.totalTax.

    - * - * @return null|Money - */ - public function getTotalTax() - { - if (is_null($this->totalTax)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_TOTAL_TAX); - if (is_null($data)) { - return null; - } - - $this->totalTax = MoneyModel::of($data); - } - - return $this->totalTax; - } - /** * @param ?Money $totalNet @@ -160,12 +139,4 @@ public function setTaxPortions(?TaxPortionCollection $taxPortions): void { $this->taxPortions = $taxPortions; } - - /** - * @param ?Money $totalTax - */ - public function setTotalTax(?Money $totalTax): void - { - $this->totalTax = $totalTax; - } } diff --git a/lib/commercetools-import/src/Models/Orders/TrackingData.php b/lib/commercetools-import/src/Models/Orders/TrackingData.php index 76d5910ccd0..23383d7392e 100644 --- a/lib/commercetools-import/src/Models/Orders/TrackingData.php +++ b/lib/commercetools-import/src/Models/Orders/TrackingData.php @@ -20,26 +20,31 @@ interface TrackingData extends JsonObject public const FIELD_IS_RETURN = 'isReturn'; /** + * @return null|string */ public function getTrackingId(); /** + * @return null|string */ public function getCarrier(); /** + * @return null|string */ public function getProvider(); /** + * @return null|string */ public function getProviderTransaction(); /** + * @return null|bool */ public function getIsReturn(); diff --git a/lib/commercetools-import/src/Models/Orders/TrackingDataBuilder.php b/lib/commercetools-import/src/Models/Orders/TrackingDataBuilder.php index 1078fe79f3a..89d5fef218b 100644 --- a/lib/commercetools-import/src/Models/Orders/TrackingDataBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/TrackingDataBuilder.php @@ -21,31 +21,37 @@ final class TrackingDataBuilder implements Builder { /** + * @var ?string */ private $trackingId; /** + * @var ?string */ private $carrier; /** + * @var ?string */ private $provider; /** + * @var ?string */ private $providerTransaction; /** + * @var ?bool */ private $isReturn; /** + * @return null|string */ public function getTrackingId() @@ -54,6 +60,7 @@ public function getTrackingId() } /** + * @return null|string */ public function getCarrier() @@ -62,6 +69,7 @@ public function getCarrier() } /** + * @return null|string */ public function getProvider() @@ -70,6 +78,7 @@ public function getProvider() } /** + * @return null|string */ public function getProviderTransaction() @@ -78,6 +87,7 @@ public function getProviderTransaction() } /** + * @return null|bool */ public function getIsReturn() diff --git a/lib/commercetools-import/src/Models/Orders/TrackingDataModel.php b/lib/commercetools-import/src/Models/Orders/TrackingDataModel.php index a6f1d598526..a13dd4a7c90 100644 --- a/lib/commercetools-import/src/Models/Orders/TrackingDataModel.php +++ b/lib/commercetools-import/src/Models/Orders/TrackingDataModel.php @@ -20,26 +20,31 @@ final class TrackingDataModel extends JsonObjectModel implements TrackingData { /** + * * @var ?string */ protected $trackingId; /** + * * @var ?string */ protected $carrier; /** + * * @var ?string */ protected $provider; /** + * * @var ?string */ protected $providerTransaction; /** + * * @var ?bool */ protected $isReturn; @@ -63,6 +68,7 @@ public function __construct( } /** + * * @return null|string */ public function getTrackingId() @@ -80,6 +86,7 @@ public function getTrackingId() } /** + * * @return null|string */ public function getCarrier() @@ -97,6 +104,7 @@ public function getCarrier() } /** + * * @return null|string */ public function getProvider() @@ -114,6 +122,7 @@ public function getProvider() } /** + * * @return null|string */ public function getProviderTransaction() @@ -131,6 +140,7 @@ public function getProviderTransaction() } /** + * * @return null|bool */ public function getIsReturn() diff --git a/lib/commercetools-import/src/Models/Prices/PriceImport.php b/lib/commercetools-import/src/Models/Prices/PriceImport.php index 90a91b2819f..920e8564373 100644 --- a/lib/commercetools-import/src/Models/Prices/PriceImport.php +++ b/lib/commercetools-import/src/Models/Prices/PriceImport.php @@ -36,9 +36,18 @@ interface PriceImport extends ImportResource public const FIELD_PRODUCT_VARIANT = 'productVariant'; public const FIELD_PRODUCT = 'product'; + /** + *

    User-defined unique identifier for the Embedded Price.

    + * + + * @return null|string + */ + public function getKey(); + /** *

    Maps to Price.value.

    * + * @return null|TypedMoney */ public function getValue(); @@ -46,6 +55,7 @@ public function getValue(); /** *

    Maps to Price.county.

    * + * @return null|string */ public function getCountry(); @@ -53,6 +63,7 @@ public function getCountry(); /** *

    Maps to Price.validFrom.

    * + * @return null|DateTimeImmutable */ public function getValidFrom(); @@ -60,22 +71,25 @@ public function getValidFrom(); /** *

    Maps to Price.validUntil.

    * + * @return null|DateTimeImmutable */ public function getValidUntil(); /** - *

    The Reference to the CustomerGroup with which the EmbeddedPrice is associated. + *

    The Reference to the CustomerGroup with which the Embedded Price is associated. * If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary CustomerGroup is created.

    * + * @return null|CustomerGroupKeyReference */ public function getCustomerGroup(); /** - *

    The Reference to the Channel with which the EmbeddedPrice is associated. + *

    The Reference to the Channel with which the Embedded Price is associated. * If referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the necessary Channel is created.

    * + * @return null|ChannelKeyReference */ public function getChannel(); @@ -83,13 +97,15 @@ public function getChannel(); /** *

    Sets a discounted price from an external service.

    * + * @return null|DiscountedPrice */ public function getDiscounted(); /** - *

    Only the EmbeddedPrice updates will be published to staged and current projection.

    + *

    Only the Embedded Price updates will be published to staged and current projection.

    * + * @return null|bool */ public function getPublish(); @@ -97,6 +113,7 @@ public function getPublish(); /** *

    The tiered prices for this price.

    * + * @return null|PriceTierCollection */ public function getTiers(); @@ -104,28 +121,36 @@ public function getTiers(); /** *

    The custom fields for this price.

    * + * @return null|Custom */ public function getCustom(); /** - *

    The ProductVariant in which this EmbeddedPrice is contained. - * The Reference to the ProductVariant with which the EmbeddedPrice is associated. + *

    The ProductVariant in which this Embedded Price is contained. + * The Reference to the ProductVariant with which the Embedded Price is associated. * If referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

    * + * @return null|ProductVariantKeyReference */ public function getProductVariant(); /** - *

    The Product in which the Product Variant containing this EmbeddedPrice is contained. Maps to ProductVariant.product. - * The Reference to the Product with which the EmbeddedPrice is associated. + *

    The Product in which the Product Variant containing this Embedded Price is contained. Maps to ProductVariant.product. + * The Reference to the Product with which the Embedded Price is associated. * If referenced Product does not exist, the state of the ImportOperation will be set to unresolved until the necessary Product is created.

    * + * @return null|ProductKeyReference */ public function getProduct(); + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?TypedMoney $value */ diff --git a/lib/commercetools-import/src/Models/Prices/PriceImportBuilder.php b/lib/commercetools-import/src/Models/Prices/PriceImportBuilder.php index 5d021e5aab1..3a6dd03d222 100644 --- a/lib/commercetools-import/src/Models/Prices/PriceImportBuilder.php +++ b/lib/commercetools-import/src/Models/Prices/PriceImportBuilder.php @@ -39,71 +39,87 @@ final class PriceImportBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $value; /** + * @var ?string */ private $country; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; /** + * @var null|CustomerGroupKeyReference|CustomerGroupKeyReferenceBuilder */ private $customerGroup; /** + * @var null|ChannelKeyReference|ChannelKeyReferenceBuilder */ private $channel; /** + * @var null|DiscountedPrice|DiscountedPriceBuilder */ private $discounted; /** + * @var ?bool */ private $publish; /** + * @var ?PriceTierCollection */ private $tiers; /** + * @var null|Custom|CustomBuilder */ private $custom; /** + * @var null|ProductVariantKeyReference|ProductVariantKeyReferenceBuilder */ private $productVariant; /** + * @var null|ProductKeyReference|ProductKeyReferenceBuilder */ private $product; /** + *

    User-defined unique identifier for the Embedded Price.

    + * + * @return null|string */ public function getKey() @@ -114,6 +130,7 @@ public function getKey() /** *

    Maps to Price.value.

    * + * @return null|TypedMoney */ public function getValue() @@ -124,6 +141,7 @@ public function getValue() /** *

    Maps to Price.county.

    * + * @return null|string */ public function getCountry() @@ -134,6 +152,7 @@ public function getCountry() /** *

    Maps to Price.validFrom.

    * + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -144,6 +163,7 @@ public function getValidFrom() /** *

    Maps to Price.validUntil.

    * + * @return null|DateTimeImmutable */ public function getValidUntil() @@ -152,9 +172,10 @@ public function getValidUntil() } /** - *

    The Reference to the CustomerGroup with which the EmbeddedPrice is associated. + *

    The Reference to the CustomerGroup with which the Embedded Price is associated. * If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary CustomerGroup is created.

    * + * @return null|CustomerGroupKeyReference */ public function getCustomerGroup() @@ -163,9 +184,10 @@ public function getCustomerGroup() } /** - *

    The Reference to the Channel with which the EmbeddedPrice is associated. + *

    The Reference to the Channel with which the Embedded Price is associated. * If referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the necessary Channel is created.

    * + * @return null|ChannelKeyReference */ public function getChannel() @@ -176,6 +198,7 @@ public function getChannel() /** *

    Sets a discounted price from an external service.

    * + * @return null|DiscountedPrice */ public function getDiscounted() @@ -184,8 +207,9 @@ public function getDiscounted() } /** - *

    Only the EmbeddedPrice updates will be published to staged and current projection.

    + *

    Only the Embedded Price updates will be published to staged and current projection.

    * + * @return null|bool */ public function getPublish() @@ -196,6 +220,7 @@ public function getPublish() /** *

    The tiered prices for this price.

    * + * @return null|PriceTierCollection */ public function getTiers() @@ -206,6 +231,7 @@ public function getTiers() /** *

    The custom fields for this price.

    * + * @return null|Custom */ public function getCustom() @@ -214,10 +240,11 @@ public function getCustom() } /** - *

    The ProductVariant in which this EmbeddedPrice is contained. - * The Reference to the ProductVariant with which the EmbeddedPrice is associated. + *

    The ProductVariant in which this Embedded Price is contained. + * The Reference to the ProductVariant with which the Embedded Price is associated. * If referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

    * + * @return null|ProductVariantKeyReference */ public function getProductVariant() @@ -226,10 +253,11 @@ public function getProductVariant() } /** - *

    The Product in which the Product Variant containing this EmbeddedPrice is contained. Maps to ProductVariant.product. - * The Reference to the Product with which the EmbeddedPrice is associated. + *

    The Product in which the Product Variant containing this Embedded Price is contained. Maps to ProductVariant.product. + * The Reference to the Product with which the Embedded Price is associated. * If referenced Product does not exist, the state of the ImportOperation will be set to unresolved until the necessary Product is created.

    * + * @return null|ProductKeyReference */ public function getProduct() diff --git a/lib/commercetools-import/src/Models/Prices/PriceImportModel.php b/lib/commercetools-import/src/Models/Prices/PriceImportModel.php index 38a7d150371..889cbe59d6c 100644 --- a/lib/commercetools-import/src/Models/Prices/PriceImportModel.php +++ b/lib/commercetools-import/src/Models/Prices/PriceImportModel.php @@ -38,66 +38,79 @@ final class PriceImportModel extends JsonObjectModel implements PriceImport { /** + * * @var ?string */ protected $key; /** + * * @var ?TypedMoney */ protected $value; /** + * * @var ?string */ protected $country; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; /** + * * @var ?CustomerGroupKeyReference */ protected $customerGroup; /** + * * @var ?ChannelKeyReference */ protected $channel; /** + * * @var ?DiscountedPrice */ protected $discounted; /** + * * @var ?bool */ protected $publish; /** + * * @var ?PriceTierCollection */ protected $tiers; /** + * * @var ?Custom */ protected $custom; /** + * * @var ?ProductVariantKeyReference */ protected $productVariant; /** + * * @var ?ProductKeyReference */ protected $product; @@ -137,6 +150,9 @@ public function __construct( } /** + *

    User-defined unique identifier for the Embedded Price.

    + * + * * @return null|string */ public function getKey() @@ -156,6 +172,7 @@ public function getKey() /** *

    Maps to Price.value.

    * + * * @return null|TypedMoney */ public function getValue() @@ -176,6 +193,7 @@ public function getValue() /** *

    Maps to Price.county.

    * + * * @return null|string */ public function getCountry() @@ -195,6 +213,7 @@ public function getCountry() /** *

    Maps to Price.validFrom.

    * + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -218,6 +237,7 @@ public function getValidFrom() /** *

    Maps to Price.validUntil.

    * + * * @return null|DateTimeImmutable */ public function getValidUntil() @@ -239,9 +259,10 @@ public function getValidUntil() } /** - *

    The Reference to the CustomerGroup with which the EmbeddedPrice is associated. + *

    The Reference to the CustomerGroup with which the Embedded Price is associated. * If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary CustomerGroup is created.

    * + * * @return null|CustomerGroupKeyReference */ public function getCustomerGroup() @@ -260,9 +281,10 @@ public function getCustomerGroup() } /** - *

    The Reference to the Channel with which the EmbeddedPrice is associated. + *

    The Reference to the Channel with which the Embedded Price is associated. * If referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the necessary Channel is created.

    * + * * @return null|ChannelKeyReference */ public function getChannel() @@ -283,6 +305,7 @@ public function getChannel() /** *

    Sets a discounted price from an external service.

    * + * * @return null|DiscountedPrice */ public function getDiscounted() @@ -301,7 +324,8 @@ public function getDiscounted() } /** - *

    Only the EmbeddedPrice updates will be published to staged and current projection.

    + *

    Only the Embedded Price updates will be published to staged and current projection.

    + * * * @return null|bool */ @@ -322,6 +346,7 @@ public function getPublish() /** *

    The tiered prices for this price.

    * + * * @return null|PriceTierCollection */ public function getTiers() @@ -341,6 +366,7 @@ public function getTiers() /** *

    The custom fields for this price.

    * + * * @return null|Custom */ public function getCustom() @@ -359,10 +385,11 @@ public function getCustom() } /** - *

    The ProductVariant in which this EmbeddedPrice is contained. - * The Reference to the ProductVariant with which the EmbeddedPrice is associated. + *

    The ProductVariant in which this Embedded Price is contained. + * The Reference to the ProductVariant with which the Embedded Price is associated. * If referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

    * + * * @return null|ProductVariantKeyReference */ public function getProductVariant() @@ -381,10 +408,11 @@ public function getProductVariant() } /** - *

    The Product in which the Product Variant containing this EmbeddedPrice is contained. Maps to ProductVariant.product. - * The Reference to the Product with which the EmbeddedPrice is associated. + *

    The Product in which the Product Variant containing this Embedded Price is contained. Maps to ProductVariant.product. + * The Reference to the Product with which the Embedded Price is associated. * If referenced Product does not exist, the state of the ImportOperation will be set to unresolved until the necessary Product is created.

    * + * * @return null|ProductKeyReference */ public function getProduct() diff --git a/lib/commercetools-import/src/Models/Prices/SubRate.php b/lib/commercetools-import/src/Models/Prices/SubRate.php index 49cb1c3933d..101888af556 100644 --- a/lib/commercetools-import/src/Models/Prices/SubRate.php +++ b/lib/commercetools-import/src/Models/Prices/SubRate.php @@ -17,11 +17,13 @@ interface SubRate extends JsonObject public const FIELD_AMOUNT = 'amount'; /** + * @return null|string */ public function getName(); /** + * @return null|float */ public function getAmount(); diff --git a/lib/commercetools-import/src/Models/Prices/SubRateBuilder.php b/lib/commercetools-import/src/Models/Prices/SubRateBuilder.php index 732b876e0ef..24a9240aae5 100644 --- a/lib/commercetools-import/src/Models/Prices/SubRateBuilder.php +++ b/lib/commercetools-import/src/Models/Prices/SubRateBuilder.php @@ -21,16 +21,19 @@ final class SubRateBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?float */ private $amount; /** + * @return null|string */ public function getName() @@ -39,6 +42,7 @@ public function getName() } /** + * @return null|float */ public function getAmount() diff --git a/lib/commercetools-import/src/Models/Prices/SubRateModel.php b/lib/commercetools-import/src/Models/Prices/SubRateModel.php index f108d7bbcbb..8f9ee91a8e3 100644 --- a/lib/commercetools-import/src/Models/Prices/SubRateModel.php +++ b/lib/commercetools-import/src/Models/Prices/SubRateModel.php @@ -20,11 +20,13 @@ final class SubRateModel extends JsonObjectModel implements SubRate { /** + * * @var ?string */ protected $name; /** + * * @var ?float */ protected $amount; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|string */ public function getName() @@ -59,6 +62,7 @@ public function getName() } /** + * * @return null|float */ public function getAmount() diff --git a/lib/commercetools-import/src/Models/Prices/TaxRate.php b/lib/commercetools-import/src/Models/Prices/TaxRate.php index 15d0b1533db..415e0ae0841 100644 --- a/lib/commercetools-import/src/Models/Prices/TaxRate.php +++ b/lib/commercetools-import/src/Models/Prices/TaxRate.php @@ -22,21 +22,25 @@ interface TaxRate extends JsonObject public const FIELD_SUB_RATES = 'subRates'; /** + * @return null|string */ public function getId(); /** + * @return null|string */ public function getName(); /** + * @return null|float */ public function getAmount(); /** + * @return null|bool */ public function getIncludedInPrice(); @@ -44,16 +48,19 @@ public function getIncludedInPrice(); /** *

    A two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry(); /** + * @return null|string */ public function getState(); /** + * @return null|SubRateCollection */ public function getSubRates(); diff --git a/lib/commercetools-import/src/Models/Prices/TaxRateBuilder.php b/lib/commercetools-import/src/Models/Prices/TaxRateBuilder.php index 4f9a3aa7a6d..c39ff26e891 100644 --- a/lib/commercetools-import/src/Models/Prices/TaxRateBuilder.php +++ b/lib/commercetools-import/src/Models/Prices/TaxRateBuilder.php @@ -21,41 +21,49 @@ final class TaxRateBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @var ?string */ private $name; /** + * @var ?float */ private $amount; /** + * @var ?bool */ private $includedInPrice; /** + * @var ?string */ private $country; /** + * @var ?string */ private $state; /** + * @var ?SubRateCollection */ private $subRates; /** + * @return null|string */ public function getId() @@ -64,6 +72,7 @@ public function getId() } /** + * @return null|string */ public function getName() @@ -72,6 +81,7 @@ public function getName() } /** + * @return null|float */ public function getAmount() @@ -80,6 +90,7 @@ public function getAmount() } /** + * @return null|bool */ public function getIncludedInPrice() @@ -90,6 +101,7 @@ public function getIncludedInPrice() /** *

    A two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry() @@ -98,6 +110,7 @@ public function getCountry() } /** + * @return null|string */ public function getState() @@ -106,6 +119,7 @@ public function getState() } /** + * @return null|SubRateCollection */ public function getSubRates() diff --git a/lib/commercetools-import/src/Models/Prices/TaxRateModel.php b/lib/commercetools-import/src/Models/Prices/TaxRateModel.php index 25976f4b323..da99a3e891a 100644 --- a/lib/commercetools-import/src/Models/Prices/TaxRateModel.php +++ b/lib/commercetools-import/src/Models/Prices/TaxRateModel.php @@ -20,36 +20,43 @@ final class TaxRateModel extends JsonObjectModel implements TaxRate { /** + * * @var ?string */ protected $id; /** + * * @var ?string */ protected $name; /** + * * @var ?float */ protected $amount; /** + * * @var ?bool */ protected $includedInPrice; /** + * * @var ?string */ protected $country; /** + * * @var ?string */ protected $state; /** + * * @var ?SubRateCollection */ protected $subRates; @@ -77,6 +84,7 @@ public function __construct( } /** + * * @return null|string */ public function getId() @@ -94,6 +102,7 @@ public function getId() } /** + * * @return null|string */ public function getName() @@ -111,6 +120,7 @@ public function getName() } /** + * * @return null|float */ public function getAmount() @@ -128,6 +138,7 @@ public function getAmount() } /** + * * @return null|bool */ public function getIncludedInPrice() @@ -147,6 +158,7 @@ public function getIncludedInPrice() /** *

    A two-digit country code as per ISO 3166-1 alpha-2.

    * + * * @return null|string */ public function getCountry() @@ -164,6 +176,7 @@ public function getCountry() } /** + * * @return null|string */ public function getState() @@ -181,6 +194,7 @@ public function getState() } /** + * * @return null|SubRateCollection */ public function getSubRates() diff --git a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImport.php b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImport.php index 77763e0ab8d..8bc74b4ade2 100644 --- a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImport.php +++ b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImport.php @@ -32,6 +32,7 @@ interface PriceDraftImport extends JsonObject public const FIELD_KEY = 'key'; /** + * @return null|TypedMoney */ public function getValue(); @@ -39,6 +40,7 @@ public function getValue(); /** *

    A two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry(); @@ -46,6 +48,7 @@ public function getCountry(); /** *

    References a customer group by key.

    * + * @return null|CustomerGroupKeyReference */ public function getCustomerGroup(); @@ -53,16 +56,19 @@ public function getCustomerGroup(); /** *

    References a channel by key.

    * + * @return null|ChannelKeyReference */ public function getChannel(); /** + * @return null|DateTimeImmutable */ public function getValidFrom(); /** + * @return null|DateTimeImmutable */ public function getValidUntil(); @@ -70,6 +76,7 @@ public function getValidUntil(); /** *

    The custom fields for this category.

    * + * @return null|Custom */ public function getCustom(); @@ -77,6 +84,7 @@ public function getCustom(); /** *

    Sets a discounted price from an external service.

    * + * @return null|DiscountedPrice */ public function getDiscounted(); @@ -84,11 +92,13 @@ public function getDiscounted(); /** *

    The tiered prices for this price.

    * + * @return null|PriceTierCollection */ public function getTiers(); /** + * @return null|string */ public function getKey(); diff --git a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportBuilder.php b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportBuilder.php index 25619f352d4..19553026dae 100644 --- a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportBuilder.php +++ b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportBuilder.php @@ -33,56 +33,67 @@ final class PriceDraftImportBuilder implements Builder { /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $value; /** + * @var ?string */ private $country; /** + * @var null|CustomerGroupKeyReference|CustomerGroupKeyReferenceBuilder */ private $customerGroup; /** + * @var null|ChannelKeyReference|ChannelKeyReferenceBuilder */ private $channel; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; /** + * @var null|Custom|CustomBuilder */ private $custom; /** + * @var null|DiscountedPrice|DiscountedPriceBuilder */ private $discounted; /** + * @var ?PriceTierCollection */ private $tiers; /** + * @var ?string */ private $key; /** + * @return null|TypedMoney */ public function getValue() @@ -93,6 +104,7 @@ public function getValue() /** *

    A two-digit country code as per ISO 3166-1 alpha-2.

    * + * @return null|string */ public function getCountry() @@ -103,6 +115,7 @@ public function getCountry() /** *

    References a customer group by key.

    * + * @return null|CustomerGroupKeyReference */ public function getCustomerGroup() @@ -113,6 +126,7 @@ public function getCustomerGroup() /** *

    References a channel by key.

    * + * @return null|ChannelKeyReference */ public function getChannel() @@ -121,6 +135,7 @@ public function getChannel() } /** + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -129,6 +144,7 @@ public function getValidFrom() } /** + * @return null|DateTimeImmutable */ public function getValidUntil() @@ -139,6 +155,7 @@ public function getValidUntil() /** *

    The custom fields for this category.

    * + * @return null|Custom */ public function getCustom() @@ -149,6 +166,7 @@ public function getCustom() /** *

    Sets a discounted price from an external service.

    * + * @return null|DiscountedPrice */ public function getDiscounted() @@ -159,6 +177,7 @@ public function getDiscounted() /** *

    The tiered prices for this price.

    * + * @return null|PriceTierCollection */ public function getTiers() @@ -167,6 +186,7 @@ public function getTiers() } /** + * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportModel.php b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportModel.php index cb8ff5be1d2..246ad29ce7d 100644 --- a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportModel.php +++ b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportModel.php @@ -32,51 +32,61 @@ final class PriceDraftImportModel extends JsonObjectModel implements PriceDraftImport { /** + * * @var ?TypedMoney */ protected $value; /** + * * @var ?string */ protected $country; /** + * * @var ?CustomerGroupKeyReference */ protected $customerGroup; /** + * * @var ?ChannelKeyReference */ protected $channel; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; /** + * * @var ?Custom */ protected $custom; /** + * * @var ?DiscountedPrice */ protected $discounted; /** + * * @var ?PriceTierCollection */ protected $tiers; /** + * * @var ?string */ protected $key; @@ -110,6 +120,7 @@ public function __construct( } /** + * * @return null|TypedMoney */ public function getValue() @@ -130,6 +141,7 @@ public function getValue() /** *

    A two-digit country code as per ISO 3166-1 alpha-2.

    * + * * @return null|string */ public function getCountry() @@ -149,6 +161,7 @@ public function getCountry() /** *

    References a customer group by key.

    * + * * @return null|CustomerGroupKeyReference */ public function getCustomerGroup() @@ -169,6 +182,7 @@ public function getCustomerGroup() /** *

    References a channel by key.

    * + * * @return null|ChannelKeyReference */ public function getChannel() @@ -187,6 +201,7 @@ public function getChannel() } /** + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -208,6 +223,7 @@ public function getValidFrom() } /** + * * @return null|DateTimeImmutable */ public function getValidUntil() @@ -231,6 +247,7 @@ public function getValidUntil() /** *

    The custom fields for this category.

    * + * * @return null|Custom */ public function getCustom() @@ -251,6 +268,7 @@ public function getCustom() /** *

    Sets a discounted price from an external service.

    * + * * @return null|DiscountedPrice */ public function getDiscounted() @@ -271,6 +289,7 @@ public function getDiscounted() /** *

    The tiered prices for this price.

    * + * * @return null|PriceTierCollection */ public function getTiers() @@ -288,6 +307,7 @@ public function getTiers() } /** + * * @return null|string */ public function getKey() diff --git a/lib/commercetools-import/src/Models/Productdrafts/ProductDraftImport.php b/lib/commercetools-import/src/Models/Productdrafts/ProductDraftImport.php index d78b7abbcb6..b8d9a1b68f5 100644 --- a/lib/commercetools-import/src/Models/Productdrafts/ProductDraftImport.php +++ b/lib/commercetools-import/src/Models/Productdrafts/ProductDraftImport.php @@ -34,6 +34,7 @@ interface ProductDraftImport extends ImportResource public const FIELD_SEARCH_KEYWORDS = 'searchKeywords'; public const FIELD_STATE = 'state'; public const FIELD_PUBLISH = 'publish'; + public const FIELD_PRICE_MODE = 'priceMode'; /** *

    The productType of a Product. @@ -41,11 +42,13 @@ interface ProductDraftImport extends ImportResource * The Reference to the ProductType with which the ProductDraft is associated. * If referenced ProductType does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductType is created.

    * + * @return null|ProductTypeKeyReference */ public function getProductType(); /** + * @return null|LocalizedString */ public function getName(); @@ -54,6 +57,7 @@ public function getName(); *

    Human-readable identifiers usually used as deep-link URL to the related product. Each slug must be unique across a project, * but a product can have the same slug for different languages. Allowed are alphabetic, numeric, underscore (_) and hyphen (-) characters.

    * + * @return null|LocalizedString */ public function getSlug(); @@ -61,6 +65,7 @@ public function getSlug(); /** *

    Maps to Product.description.

    * + * @return null|LocalizedString */ public function getDescription(); @@ -69,6 +74,7 @@ public function getDescription(); *

    The Reference to the Categories with which the ProductDraft is associated. * If referenced Categories do not exist, the state of the ImportOperation will be set to unresolved until the necessary Categories are created.

    * + * @return null|CategoryKeyReferenceCollection */ public function getCategories(); @@ -81,6 +87,7 @@ public function getCategories(); * } * * + * @return null|LocalizedString */ public function getMetaTitle(); @@ -93,6 +100,7 @@ public function getMetaTitle(); * } * * + * @return null|LocalizedString */ public function getMetaDescription(); @@ -105,6 +113,7 @@ public function getMetaDescription(); * } * * + * @return null|LocalizedString */ public function getMetaKeywords(); @@ -113,6 +122,7 @@ public function getMetaKeywords(); *

    The master Product variant. * Required if the variants array contains a Product Variant.

    * + * @return null|ProductVariantDraftImport */ public function getMasterVariant(); @@ -120,6 +130,7 @@ public function getMasterVariant(); /** *

    An array of related Product Variants.

    * + * @return null|ProductVariantDraftImportCollection */ public function getVariants(); @@ -128,6 +139,7 @@ public function getVariants(); *

    The Reference to the TaxCategory with which the ProductDraft is associated. * If referenced TaxCategory does not exist, the state of the ImportOperation will be set to unresolved until the necessary TaxCategory is created.

    * + * @return null|TaxCategoryKeyReference */ public function getTaxCategory(); @@ -151,6 +163,7 @@ public function getTaxCategory(); * } * * + * @return null|SearchKeywords */ public function getSearchKeywords(); @@ -159,6 +172,7 @@ public function getSearchKeywords(); *

    The Reference to the State with which the ProductDraft is associated. * If referenced State does not exist, the state of the ImportOperation will be set to unresolved until the necessary State is created.

    * + * @return null|StateKeyReference */ public function getState(); @@ -168,10 +182,19 @@ public function getState(); * If publish is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. * However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whether publish is set or not.

    * + * @return null|bool */ public function getPublish(); + /** + *

    Determines the type of Prices the API uses. See ProductPriceMode for more details. If not provided, the existing Product.priceMode is not changed.

    + * + + * @return null|string + */ + public function getPriceMode(); + /** * @param ?ProductTypeKeyReference $productType */ @@ -241,4 +264,9 @@ public function setState(?StateKeyReference $state): void; * @param ?bool $publish */ public function setPublish(?bool $publish): void; + + /** + * @param ?string $priceMode + */ + public function setPriceMode(?string $priceMode): void; } diff --git a/lib/commercetools-import/src/Models/Productdrafts/ProductDraftImportBuilder.php b/lib/commercetools-import/src/Models/Productdrafts/ProductDraftImportBuilder.php index 42eca08510d..3d09b4aa009 100644 --- a/lib/commercetools-import/src/Models/Productdrafts/ProductDraftImportBuilder.php +++ b/lib/commercetools-import/src/Models/Productdrafts/ProductDraftImportBuilder.php @@ -34,81 +34,105 @@ final class ProductDraftImportBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var null|ProductTypeKeyReference|ProductTypeKeyReferenceBuilder */ private $productType; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?CategoryKeyReferenceCollection */ private $categories; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaTitle; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaDescription; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaKeywords; /** + * @var null|ProductVariantDraftImport|ProductVariantDraftImportBuilder */ private $masterVariant; /** + * @var ?ProductVariantDraftImportCollection */ private $variants; /** + * @var null|TaxCategoryKeyReference|TaxCategoryKeyReferenceBuilder */ private $taxCategory; /** + * @var null|SearchKeywords|SearchKeywordsBuilder */ private $searchKeywords; /** + * @var null|StateKeyReference|StateKeyReferenceBuilder */ private $state; /** + * @var ?bool */ private $publish; /** + + * @var ?string + */ + private $priceMode; + + /** + *

    User-defined unique identifier.

    + * + * @return null|string */ public function getKey() @@ -122,6 +146,7 @@ public function getKey() * The Reference to the ProductType with which the ProductDraft is associated. * If referenced ProductType does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductType is created.

    * + * @return null|ProductTypeKeyReference */ public function getProductType() @@ -130,6 +155,7 @@ public function getProductType() } /** + * @return null|LocalizedString */ public function getName() @@ -141,6 +167,7 @@ public function getName() *

    Human-readable identifiers usually used as deep-link URL to the related product. Each slug must be unique across a project, * but a product can have the same slug for different languages. Allowed are alphabetic, numeric, underscore (_) and hyphen (-) characters.

    * + * @return null|LocalizedString */ public function getSlug() @@ -151,6 +178,7 @@ public function getSlug() /** *

    Maps to Product.description.

    * + * @return null|LocalizedString */ public function getDescription() @@ -162,6 +190,7 @@ public function getDescription() *

    The Reference to the Categories with which the ProductDraft is associated. * If referenced Categories do not exist, the state of the ImportOperation will be set to unresolved until the necessary Categories are created.

    * + * @return null|CategoryKeyReferenceCollection */ public function getCategories() @@ -177,6 +206,7 @@ public function getCategories() * } * * + * @return null|LocalizedString */ public function getMetaTitle() @@ -192,6 +222,7 @@ public function getMetaTitle() * } * * + * @return null|LocalizedString */ public function getMetaDescription() @@ -207,6 +238,7 @@ public function getMetaDescription() * } * * + * @return null|LocalizedString */ public function getMetaKeywords() @@ -218,6 +250,7 @@ public function getMetaKeywords() *

    The master Product variant. * Required if the variants array contains a Product Variant.

    * + * @return null|ProductVariantDraftImport */ public function getMasterVariant() @@ -228,6 +261,7 @@ public function getMasterVariant() /** *

    An array of related Product Variants.

    * + * @return null|ProductVariantDraftImportCollection */ public function getVariants() @@ -239,6 +273,7 @@ public function getVariants() *

    The Reference to the TaxCategory with which the ProductDraft is associated. * If referenced TaxCategory does not exist, the state of the ImportOperation will be set to unresolved until the necessary TaxCategory is created.

    * + * @return null|TaxCategoryKeyReference */ public function getTaxCategory() @@ -265,6 +300,7 @@ public function getTaxCategory() * } * * + * @return null|SearchKeywords */ public function getSearchKeywords() @@ -276,6 +312,7 @@ public function getSearchKeywords() *

    The Reference to the State with which the ProductDraft is associated. * If referenced State does not exist, the state of the ImportOperation will be set to unresolved until the necessary State is created.

    * + * @return null|StateKeyReference */ public function getState() @@ -288,6 +325,7 @@ public function getState() * If publish is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. * However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whether publish is set or not.

    * + * @return null|bool */ public function getPublish() @@ -295,6 +333,17 @@ public function getPublish() return $this->publish; } + /** + *

    Determines the type of Prices the API uses. See ProductPriceMode for more details. If not provided, the existing Product.priceMode is not changed.

    + * + + * @return null|string + */ + public function getPriceMode() + { + return $this->priceMode; + } + /** * @param ?string $key * @return $this @@ -460,6 +509,17 @@ public function withPublish(?bool $publish) return $this; } + /** + * @param ?string $priceMode + * @return $this + */ + public function withPriceMode(?string $priceMode) + { + $this->priceMode = $priceMode; + + return $this; + } + /** * @deprecated use withProductType() instead * @return $this @@ -598,7 +658,8 @@ public function build(): ProductDraftImport $this->taxCategory instanceof TaxCategoryKeyReferenceBuilder ? $this->taxCategory->build() : $this->taxCategory, $this->searchKeywords instanceof SearchKeywordsBuilder ? $this->searchKeywords->build() : $this->searchKeywords, $this->state instanceof StateKeyReferenceBuilder ? $this->state->build() : $this->state, - $this->publish + $this->publish, + $this->priceMode ); } diff --git a/lib/commercetools-import/src/Models/Productdrafts/ProductDraftImportModel.php b/lib/commercetools-import/src/Models/Productdrafts/ProductDraftImportModel.php index fbc3e7c839e..b1fb04a2b01 100644 --- a/lib/commercetools-import/src/Models/Productdrafts/ProductDraftImportModel.php +++ b/lib/commercetools-import/src/Models/Productdrafts/ProductDraftImportModel.php @@ -33,80 +33,101 @@ final class ProductDraftImportModel extends JsonObjectModel implements ProductDraftImport { /** + * * @var ?string */ protected $key; /** + * * @var ?ProductTypeKeyReference */ protected $productType; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $slug; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?CategoryKeyReferenceCollection */ protected $categories; /** + * * @var ?LocalizedString */ protected $metaTitle; /** + * * @var ?LocalizedString */ protected $metaDescription; /** + * * @var ?LocalizedString */ protected $metaKeywords; /** + * * @var ?ProductVariantDraftImport */ protected $masterVariant; /** + * * @var ?ProductVariantDraftImportCollection */ protected $variants; /** + * * @var ?TaxCategoryKeyReference */ protected $taxCategory; /** + * * @var ?SearchKeywords */ protected $searchKeywords; /** + * * @var ?StateKeyReference */ protected $state; /** + * * @var ?bool */ protected $publish; + /** + * + * @var ?string + */ + protected $priceMode; + /** * @psalm-suppress MissingParamType @@ -126,7 +147,8 @@ public function __construct( ?TaxCategoryKeyReference $taxCategory = null, ?SearchKeywords $searchKeywords = null, ?StateKeyReference $state = null, - ?bool $publish = null + ?bool $publish = null, + ?string $priceMode = null ) { $this->key = $key; $this->productType = $productType; @@ -143,9 +165,13 @@ public function __construct( $this->searchKeywords = $searchKeywords; $this->state = $state; $this->publish = $publish; + $this->priceMode = $priceMode; } /** + *

    User-defined unique identifier.

    + * + * * @return null|string */ public function getKey() @@ -168,6 +194,7 @@ public function getKey() * The Reference to the ProductType with which the ProductDraft is associated. * If referenced ProductType does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductType is created.

    * + * * @return null|ProductTypeKeyReference */ public function getProductType() @@ -186,6 +213,7 @@ public function getProductType() } /** + * * @return null|LocalizedString */ public function getName() @@ -207,6 +235,7 @@ public function getName() *

    Human-readable identifiers usually used as deep-link URL to the related product. Each slug must be unique across a project, * but a product can have the same slug for different languages. Allowed are alphabetic, numeric, underscore (_) and hyphen (-) characters.

    * + * * @return null|LocalizedString */ public function getSlug() @@ -227,6 +256,7 @@ public function getSlug() /** *

    Maps to Product.description.

    * + * * @return null|LocalizedString */ public function getDescription() @@ -248,6 +278,7 @@ public function getDescription() *

    The Reference to the Categories with which the ProductDraft is associated. * If referenced Categories do not exist, the state of the ImportOperation will be set to unresolved until the necessary Categories are created.

    * + * * @return null|CategoryKeyReferenceCollection */ public function getCategories() @@ -272,6 +303,7 @@ public function getCategories() * } * * + * * @return null|LocalizedString */ public function getMetaTitle() @@ -297,6 +329,7 @@ public function getMetaTitle() * } * * + * * @return null|LocalizedString */ public function getMetaDescription() @@ -322,6 +355,7 @@ public function getMetaDescription() * } * * + * * @return null|LocalizedString */ public function getMetaKeywords() @@ -343,6 +377,7 @@ public function getMetaKeywords() *

    The master Product variant. * Required if the variants array contains a Product Variant.

    * + * * @return null|ProductVariantDraftImport */ public function getMasterVariant() @@ -363,6 +398,7 @@ public function getMasterVariant() /** *

    An array of related Product Variants.

    * + * * @return null|ProductVariantDraftImportCollection */ public function getVariants() @@ -383,6 +419,7 @@ public function getVariants() *

    The Reference to the TaxCategory with which the ProductDraft is associated. * If referenced TaxCategory does not exist, the state of the ImportOperation will be set to unresolved until the necessary TaxCategory is created.

    * + * * @return null|TaxCategoryKeyReference */ public function getTaxCategory() @@ -419,6 +456,7 @@ public function getTaxCategory() * } * * + * * @return null|SearchKeywords */ public function getSearchKeywords() @@ -440,6 +478,7 @@ public function getSearchKeywords() *

    The Reference to the State with which the ProductDraft is associated. * If referenced State does not exist, the state of the ImportOperation will be set to unresolved until the necessary State is created.

    * + * * @return null|StateKeyReference */ public function getState() @@ -462,6 +501,7 @@ public function getState() * If publish is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. * However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whether publish is set or not.

    * + * * @return null|bool */ public function getPublish() @@ -478,6 +518,26 @@ public function getPublish() return $this->publish; } + /** + *

    Determines the type of Prices the API uses. See ProductPriceMode for more details. If not provided, the existing Product.priceMode is not changed.

    + * + * + * @return null|string + */ + public function getPriceMode() + { + if (is_null($this->priceMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PRICE_MODE); + if (is_null($data)) { + return null; + } + $this->priceMode = (string) $data; + } + + return $this->priceMode; + } + /** * @param ?string $key @@ -598,4 +658,12 @@ public function setPublish(?bool $publish): void { $this->publish = $publish; } + + /** + * @param ?string $priceMode + */ + public function setPriceMode(?string $priceMode): void + { + $this->priceMode = $priceMode; + } } diff --git a/lib/commercetools-import/src/Models/Productdrafts/ProductVariantDraftImport.php b/lib/commercetools-import/src/Models/Productdrafts/ProductVariantDraftImport.php index 4ae49766b29..6f473db4518 100644 --- a/lib/commercetools-import/src/Models/Productdrafts/ProductVariantDraftImport.php +++ b/lib/commercetools-import/src/Models/Productdrafts/ProductVariantDraftImport.php @@ -24,31 +24,37 @@ interface ProductVariantDraftImport extends JsonObject public const FIELD_ASSETS = 'assets'; /** + * @return null|string */ public function getSku(); /** + * @return null|string */ public function getKey(); /** + * @return null|PriceDraftImportCollection */ public function getPrices(); /** + * @return null|AttributeCollection */ public function getAttributes(); /** + * @return null|ImageCollection */ public function getImages(); /** + * @return null|AssetCollection */ public function getAssets(); diff --git a/lib/commercetools-import/src/Models/Productdrafts/ProductVariantDraftImportBuilder.php b/lib/commercetools-import/src/Models/Productdrafts/ProductVariantDraftImportBuilder.php index 444e83bcc50..2a3f85ed375 100644 --- a/lib/commercetools-import/src/Models/Productdrafts/ProductVariantDraftImportBuilder.php +++ b/lib/commercetools-import/src/Models/Productdrafts/ProductVariantDraftImportBuilder.php @@ -24,36 +24,43 @@ final class ProductVariantDraftImportBuilder implements Builder { /** + * @var ?string */ private $sku; /** + * @var ?string */ private $key; /** + * @var ?PriceDraftImportCollection */ private $prices; /** + * @var ?AttributeCollection */ private $attributes; /** + * @var ?ImageCollection */ private $images; /** + * @var ?AssetCollection */ private $assets; /** + * @return null|string */ public function getSku() @@ -62,6 +69,7 @@ public function getSku() } /** + * @return null|string */ public function getKey() @@ -70,6 +78,7 @@ public function getKey() } /** + * @return null|PriceDraftImportCollection */ public function getPrices() @@ -78,6 +87,7 @@ public function getPrices() } /** + * @return null|AttributeCollection */ public function getAttributes() @@ -86,6 +96,7 @@ public function getAttributes() } /** + * @return null|ImageCollection */ public function getImages() @@ -94,6 +105,7 @@ public function getImages() } /** + * @return null|AssetCollection */ public function getAssets() diff --git a/lib/commercetools-import/src/Models/Productdrafts/ProductVariantDraftImportModel.php b/lib/commercetools-import/src/Models/Productdrafts/ProductVariantDraftImportModel.php index 0ea1246ef36..b46b9bbf59d 100644 --- a/lib/commercetools-import/src/Models/Productdrafts/ProductVariantDraftImportModel.php +++ b/lib/commercetools-import/src/Models/Productdrafts/ProductVariantDraftImportModel.php @@ -23,31 +23,37 @@ final class ProductVariantDraftImportModel extends JsonObjectModel implements ProductVariantDraftImport { /** + * * @var ?string */ protected $sku; /** + * * @var ?string */ protected $key; /** + * * @var ?PriceDraftImportCollection */ protected $prices; /** + * * @var ?AttributeCollection */ protected $attributes; /** + * * @var ?ImageCollection */ protected $images; /** + * * @var ?AssetCollection */ protected $assets; @@ -73,6 +79,7 @@ public function __construct( } /** + * * @return null|string */ public function getSku() @@ -90,6 +97,7 @@ public function getSku() } /** + * * @return null|string */ public function getKey() @@ -107,6 +115,7 @@ public function getKey() } /** + * * @return null|PriceDraftImportCollection */ public function getPrices() @@ -124,6 +133,7 @@ public function getPrices() } /** + * * @return null|AttributeCollection */ public function getAttributes() @@ -141,6 +151,7 @@ public function getAttributes() } /** + * * @return null|ImageCollection */ public function getImages() @@ -158,6 +169,7 @@ public function getImages() } /** + * * @return null|AssetCollection */ public function getAssets() diff --git a/lib/commercetools-import/src/Models/Products/CustomTokenizer.php b/lib/commercetools-import/src/Models/Products/CustomTokenizer.php index 521837faf67..75cdac9954b 100644 --- a/lib/commercetools-import/src/Models/Products/CustomTokenizer.php +++ b/lib/commercetools-import/src/Models/Products/CustomTokenizer.php @@ -16,6 +16,7 @@ interface CustomTokenizer extends SuggestTokenizer public const FIELD_INPUTS = 'inputs'; /** + * @return null|array */ public function getInputs(); diff --git a/lib/commercetools-import/src/Models/Products/CustomTokenizerBuilder.php b/lib/commercetools-import/src/Models/Products/CustomTokenizerBuilder.php index 19f7d5e008f..dda936355db 100644 --- a/lib/commercetools-import/src/Models/Products/CustomTokenizerBuilder.php +++ b/lib/commercetools-import/src/Models/Products/CustomTokenizerBuilder.php @@ -21,11 +21,13 @@ final class CustomTokenizerBuilder implements Builder { /** + * @var ?array */ private $inputs; /** + * @return null|array */ public function getInputs() diff --git a/lib/commercetools-import/src/Models/Products/CustomTokenizerModel.php b/lib/commercetools-import/src/Models/Products/CustomTokenizerModel.php index 4b97a4b386f..246f604b2af 100644 --- a/lib/commercetools-import/src/Models/Products/CustomTokenizerModel.php +++ b/lib/commercetools-import/src/Models/Products/CustomTokenizerModel.php @@ -21,11 +21,13 @@ final class CustomTokenizerModel extends JsonObjectModel implements CustomTokeni { public const DISCRIMINATOR_VALUE = 'custom'; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $inputs; @@ -35,13 +37,15 @@ final class CustomTokenizerModel extends JsonObjectModel implements CustomTokeni * @psalm-suppress MissingParamType */ public function __construct( - ?array $inputs = null + ?array $inputs = null, + ?string $type = null ) { $this->inputs = $inputs; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() @@ -59,6 +63,7 @@ public function getType() } /** + * * @return null|array */ public function getInputs() diff --git a/lib/commercetools-import/src/Models/Products/ProductImport.php b/lib/commercetools-import/src/Models/Products/ProductImport.php index 3679f0fbf7d..81e09d43e75 100644 --- a/lib/commercetools-import/src/Models/Products/ProductImport.php +++ b/lib/commercetools-import/src/Models/Products/ProductImport.php @@ -31,10 +31,12 @@ interface ProductImport extends ImportResource public const FIELD_SEARCH_KEYWORDS = 'searchKeywords'; public const FIELD_STATE = 'state'; public const FIELD_PUBLISH = 'publish'; + public const FIELD_PRICE_MODE = 'priceMode'; /** *

    Maps to Product.name.

    * + * @return null|LocalizedString */ public function getName(); @@ -45,6 +47,7 @@ public function getName(); * The Reference to the ProductType with which the Product is associated. * If referenced ProductType does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductType is created.

    * + * @return null|ProductTypeKeyReference */ public function getProductType(); @@ -53,6 +56,7 @@ public function getProductType(); *

    Human-readable identifiers usually used as deep-link URL to the related product. Each slug must be unique across a Project, * but a product can have the same slug for different languages. Allowed are alphabetic, numeric, underscore (_) and hyphen (-) characters.

    * + * @return null|LocalizedString */ public function getSlug(); @@ -60,6 +64,7 @@ public function getSlug(); /** *

    Maps to Product.description.

    * + * @return null|LocalizedString */ public function getDescription(); @@ -69,6 +74,7 @@ public function getDescription(); * The References to the Categories with which the Product is associated. * If referenced Categories do not exist, the state of the ImportOperation will be set to unresolved until the necessary Categories are created.

    * + * @return null|CategoryKeyReferenceCollection */ public function getCategories(); @@ -81,6 +87,7 @@ public function getCategories(); * } * * + * @return null|LocalizedString */ public function getMetaTitle(); @@ -93,6 +100,7 @@ public function getMetaTitle(); * } * * + * @return null|LocalizedString */ public function getMetaDescription(); @@ -105,6 +113,7 @@ public function getMetaDescription(); * } * * + * @return null|LocalizedString */ public function getMetaKeywords(); @@ -113,6 +122,7 @@ public function getMetaKeywords(); *

    The Reference to the TaxCategory with which the Product is associated. * If referenced TaxCategory does not exist, the state of the ImportOperation will be set to unresolved until the necessary TaxCategory is created.

    * + * @return null|TaxCategoryKeyReference */ public function getTaxCategory(); @@ -136,6 +146,7 @@ public function getTaxCategory(); * } * * + * @return null|SearchKeywords */ public function getSearchKeywords(); @@ -144,6 +155,7 @@ public function getSearchKeywords(); *

    The Reference to the State with which the Product is associated. * If referenced State does not exist, the state of the ImportOperation will be set to unresolved until the necessary State is created.

    * + * @return null|StateKeyReference */ public function getState(); @@ -153,10 +165,19 @@ public function getState(); * If publish is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. * However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whether publish is set or not.

    * + * @return null|bool */ public function getPublish(); + /** + *

    Determines the type of Prices the API uses. See ProductPriceMode for more details. If not provided, the existing Product.priceMode is not changed.

    + * + + * @return null|string + */ + public function getPriceMode(); + /** * @param ?LocalizedString $name */ @@ -216,4 +237,9 @@ public function setState(?StateKeyReference $state): void; * @param ?bool $publish */ public function setPublish(?bool $publish): void; + + /** + * @param ?string $priceMode + */ + public function setPriceMode(?string $priceMode): void; } diff --git a/lib/commercetools-import/src/Models/Products/ProductImportBuilder.php b/lib/commercetools-import/src/Models/Products/ProductImportBuilder.php index df8e1f80e09..52624497ed8 100644 --- a/lib/commercetools-import/src/Models/Products/ProductImportBuilder.php +++ b/lib/commercetools-import/src/Models/Products/ProductImportBuilder.php @@ -32,71 +32,93 @@ final class ProductImportBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|ProductTypeKeyReference|ProductTypeKeyReferenceBuilder */ private $productType; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $slug; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var ?CategoryKeyReferenceCollection */ private $categories; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaTitle; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaDescription; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $metaKeywords; /** + * @var null|TaxCategoryKeyReference|TaxCategoryKeyReferenceBuilder */ private $taxCategory; /** + * @var null|SearchKeywords|SearchKeywordsBuilder */ private $searchKeywords; /** + * @var null|StateKeyReference|StateKeyReferenceBuilder */ private $state; /** + * @var ?bool */ private $publish; /** + + * @var ?string + */ + private $priceMode; + + /** + *

    User-defined unique identifier.

    + * + * @return null|string */ public function getKey() @@ -107,6 +129,7 @@ public function getKey() /** *

    Maps to Product.name.

    * + * @return null|LocalizedString */ public function getName() @@ -120,6 +143,7 @@ public function getName() * The Reference to the ProductType with which the Product is associated. * If referenced ProductType does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductType is created.

    * + * @return null|ProductTypeKeyReference */ public function getProductType() @@ -131,6 +155,7 @@ public function getProductType() *

    Human-readable identifiers usually used as deep-link URL to the related product. Each slug must be unique across a Project, * but a product can have the same slug for different languages. Allowed are alphabetic, numeric, underscore (_) and hyphen (-) characters.

    * + * @return null|LocalizedString */ public function getSlug() @@ -141,6 +166,7 @@ public function getSlug() /** *

    Maps to Product.description.

    * + * @return null|LocalizedString */ public function getDescription() @@ -153,6 +179,7 @@ public function getDescription() * The References to the Categories with which the Product is associated. * If referenced Categories do not exist, the state of the ImportOperation will be set to unresolved until the necessary Categories are created.

    * + * @return null|CategoryKeyReferenceCollection */ public function getCategories() @@ -168,6 +195,7 @@ public function getCategories() * } * * + * @return null|LocalizedString */ public function getMetaTitle() @@ -183,6 +211,7 @@ public function getMetaTitle() * } * * + * @return null|LocalizedString */ public function getMetaDescription() @@ -198,6 +227,7 @@ public function getMetaDescription() * } * * + * @return null|LocalizedString */ public function getMetaKeywords() @@ -209,6 +239,7 @@ public function getMetaKeywords() *

    The Reference to the TaxCategory with which the Product is associated. * If referenced TaxCategory does not exist, the state of the ImportOperation will be set to unresolved until the necessary TaxCategory is created.

    * + * @return null|TaxCategoryKeyReference */ public function getTaxCategory() @@ -235,6 +266,7 @@ public function getTaxCategory() * } * * + * @return null|SearchKeywords */ public function getSearchKeywords() @@ -246,6 +278,7 @@ public function getSearchKeywords() *

    The Reference to the State with which the Product is associated. * If referenced State does not exist, the state of the ImportOperation will be set to unresolved until the necessary State is created.

    * + * @return null|StateKeyReference */ public function getState() @@ -258,6 +291,7 @@ public function getState() * If publish is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. * However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whether publish is set or not.

    * + * @return null|bool */ public function getPublish() @@ -265,6 +299,17 @@ public function getPublish() return $this->publish; } + /** + *

    Determines the type of Prices the API uses. See ProductPriceMode for more details. If not provided, the existing Product.priceMode is not changed.

    + * + + * @return null|string + */ + public function getPriceMode() + { + return $this->priceMode; + } + /** * @param ?string $key * @return $this @@ -408,6 +453,17 @@ public function withPublish(?bool $publish) return $this; } + /** + * @param ?string $priceMode + * @return $this + */ + public function withPriceMode(?string $priceMode) + { + $this->priceMode = $priceMode; + + return $this; + } + /** * @deprecated use withName() instead * @return $this @@ -533,7 +589,8 @@ public function build(): ProductImport $this->taxCategory instanceof TaxCategoryKeyReferenceBuilder ? $this->taxCategory->build() : $this->taxCategory, $this->searchKeywords instanceof SearchKeywordsBuilder ? $this->searchKeywords->build() : $this->searchKeywords, $this->state instanceof StateKeyReferenceBuilder ? $this->state->build() : $this->state, - $this->publish + $this->publish, + $this->priceMode ); } diff --git a/lib/commercetools-import/src/Models/Products/ProductImportModel.php b/lib/commercetools-import/src/Models/Products/ProductImportModel.php index cbfd81cf879..d6c3e4cf527 100644 --- a/lib/commercetools-import/src/Models/Products/ProductImportModel.php +++ b/lib/commercetools-import/src/Models/Products/ProductImportModel.php @@ -31,70 +31,89 @@ final class ProductImportModel extends JsonObjectModel implements ProductImport { /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?ProductTypeKeyReference */ protected $productType; /** + * * @var ?LocalizedString */ protected $slug; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?CategoryKeyReferenceCollection */ protected $categories; /** + * * @var ?LocalizedString */ protected $metaTitle; /** + * * @var ?LocalizedString */ protected $metaDescription; /** + * * @var ?LocalizedString */ protected $metaKeywords; /** + * * @var ?TaxCategoryKeyReference */ protected $taxCategory; /** + * * @var ?SearchKeywords */ protected $searchKeywords; /** + * * @var ?StateKeyReference */ protected $state; /** + * * @var ?bool */ protected $publish; + /** + * + * @var ?string + */ + protected $priceMode; + /** * @psalm-suppress MissingParamType @@ -112,7 +131,8 @@ public function __construct( ?TaxCategoryKeyReference $taxCategory = null, ?SearchKeywords $searchKeywords = null, ?StateKeyReference $state = null, - ?bool $publish = null + ?bool $publish = null, + ?string $priceMode = null ) { $this->key = $key; $this->name = $name; @@ -127,9 +147,13 @@ public function __construct( $this->searchKeywords = $searchKeywords; $this->state = $state; $this->publish = $publish; + $this->priceMode = $priceMode; } /** + *

    User-defined unique identifier.

    + * + * * @return null|string */ public function getKey() @@ -149,6 +173,7 @@ public function getKey() /** *

    Maps to Product.name.

    * + * * @return null|LocalizedString */ public function getName() @@ -172,6 +197,7 @@ public function getName() * The Reference to the ProductType with which the Product is associated. * If referenced ProductType does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductType is created.

    * + * * @return null|ProductTypeKeyReference */ public function getProductType() @@ -193,6 +219,7 @@ public function getProductType() *

    Human-readable identifiers usually used as deep-link URL to the related product. Each slug must be unique across a Project, * but a product can have the same slug for different languages. Allowed are alphabetic, numeric, underscore (_) and hyphen (-) characters.

    * + * * @return null|LocalizedString */ public function getSlug() @@ -213,6 +240,7 @@ public function getSlug() /** *

    Maps to Product.description.

    * + * * @return null|LocalizedString */ public function getDescription() @@ -235,6 +263,7 @@ public function getDescription() * The References to the Categories with which the Product is associated. * If referenced Categories do not exist, the state of the ImportOperation will be set to unresolved until the necessary Categories are created.

    * + * * @return null|CategoryKeyReferenceCollection */ public function getCategories() @@ -259,6 +288,7 @@ public function getCategories() * } * * + * * @return null|LocalizedString */ public function getMetaTitle() @@ -284,6 +314,7 @@ public function getMetaTitle() * } * * + * * @return null|LocalizedString */ public function getMetaDescription() @@ -309,6 +340,7 @@ public function getMetaDescription() * } * * + * * @return null|LocalizedString */ public function getMetaKeywords() @@ -330,6 +362,7 @@ public function getMetaKeywords() *

    The Reference to the TaxCategory with which the Product is associated. * If referenced TaxCategory does not exist, the state of the ImportOperation will be set to unresolved until the necessary TaxCategory is created.

    * + * * @return null|TaxCategoryKeyReference */ public function getTaxCategory() @@ -366,6 +399,7 @@ public function getTaxCategory() * } * * + * * @return null|SearchKeywords */ public function getSearchKeywords() @@ -387,6 +421,7 @@ public function getSearchKeywords() *

    The Reference to the State with which the Product is associated. * If referenced State does not exist, the state of the ImportOperation will be set to unresolved until the necessary State is created.

    * + * * @return null|StateKeyReference */ public function getState() @@ -409,6 +444,7 @@ public function getState() * If publish is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. * However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whether publish is set or not.

    * + * * @return null|bool */ public function getPublish() @@ -425,6 +461,26 @@ public function getPublish() return $this->publish; } + /** + *

    Determines the type of Prices the API uses. See ProductPriceMode for more details. If not provided, the existing Product.priceMode is not changed.

    + * + * + * @return null|string + */ + public function getPriceMode() + { + if (is_null($this->priceMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PRICE_MODE); + if (is_null($data)) { + return null; + } + $this->priceMode = (string) $data; + } + + return $this->priceMode; + } + /** * @param ?string $key @@ -529,4 +585,12 @@ public function setPublish(?bool $publish): void { $this->publish = $publish; } + + /** + * @param ?string $priceMode + */ + public function setPriceMode(?string $priceMode): void + { + $this->priceMode = $priceMode; + } } diff --git a/lib/commercetools-import/src/Models/Products/SearchKeyword.php b/lib/commercetools-import/src/Models/Products/SearchKeyword.php index 3939955e6cd..cdb5dd71a47 100644 --- a/lib/commercetools-import/src/Models/Products/SearchKeyword.php +++ b/lib/commercetools-import/src/Models/Products/SearchKeyword.php @@ -17,6 +17,7 @@ interface SearchKeyword extends JsonObject public const FIELD_SUGGEST_TOKENIZER = 'suggestTokenizer'; /** + * @return null|string */ public function getText(); @@ -24,6 +25,7 @@ public function getText(); /** *

    The tokenizer defines the tokens that are used to match against the Suggest Query input.

    * + * @return null|SuggestTokenizer */ public function getSuggestTokenizer(); diff --git a/lib/commercetools-import/src/Models/Products/SearchKeywordBuilder.php b/lib/commercetools-import/src/Models/Products/SearchKeywordBuilder.php index be23d363ffd..0bccdd4484d 100644 --- a/lib/commercetools-import/src/Models/Products/SearchKeywordBuilder.php +++ b/lib/commercetools-import/src/Models/Products/SearchKeywordBuilder.php @@ -21,16 +21,19 @@ final class SearchKeywordBuilder implements Builder { /** + * @var ?string */ private $text; /** + * @var null|SuggestTokenizer|SuggestTokenizerBuilder */ private $suggestTokenizer; /** + * @return null|string */ public function getText() @@ -41,6 +44,7 @@ public function getText() /** *

    The tokenizer defines the tokens that are used to match against the Suggest Query input.

    * + * @return null|SuggestTokenizer */ public function getSuggestTokenizer() diff --git a/lib/commercetools-import/src/Models/Products/SearchKeywordModel.php b/lib/commercetools-import/src/Models/Products/SearchKeywordModel.php index 1d4e3879f3f..65cf4970ea5 100644 --- a/lib/commercetools-import/src/Models/Products/SearchKeywordModel.php +++ b/lib/commercetools-import/src/Models/Products/SearchKeywordModel.php @@ -20,11 +20,13 @@ final class SearchKeywordModel extends JsonObjectModel implements SearchKeyword { /** + * * @var ?string */ protected $text; /** + * * @var ?SuggestTokenizer */ protected $suggestTokenizer; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|string */ public function getText() @@ -61,6 +64,7 @@ public function getText() /** *

    The tokenizer defines the tokens that are used to match against the Suggest Query input.

    * + * * @return null|SuggestTokenizer */ public function getSuggestTokenizer() diff --git a/lib/commercetools-import/src/Models/Products/SuggestTokenizer.php b/lib/commercetools-import/src/Models/Products/SuggestTokenizer.php index 3c1938fbd9a..b55de3aba8e 100644 --- a/lib/commercetools-import/src/Models/Products/SuggestTokenizer.php +++ b/lib/commercetools-import/src/Models/Products/SuggestTokenizer.php @@ -17,6 +17,7 @@ interface SuggestTokenizer extends JsonObject public const FIELD_TYPE = 'type'; /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-import/src/Models/Products/SuggestTokenizerModel.php b/lib/commercetools-import/src/Models/Products/SuggestTokenizerModel.php index dfb792d93a7..e71facdfa9c 100644 --- a/lib/commercetools-import/src/Models/Products/SuggestTokenizerModel.php +++ b/lib/commercetools-import/src/Models/Products/SuggestTokenizerModel.php @@ -21,6 +21,7 @@ final class SuggestTokenizerModel extends JsonObjectModel implements SuggestToke { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $type; @@ -38,11 +39,13 @@ final class SuggestTokenizerModel extends JsonObjectModel implements SuggestToke * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-import/src/Models/Products/WhitespaceTokenizerModel.php b/lib/commercetools-import/src/Models/Products/WhitespaceTokenizerModel.php index 808e933d34a..840ad62eab5 100644 --- a/lib/commercetools-import/src/Models/Products/WhitespaceTokenizerModel.php +++ b/lib/commercetools-import/src/Models/Products/WhitespaceTokenizerModel.php @@ -21,6 +21,7 @@ final class WhitespaceTokenizerModel extends JsonObjectModel implements Whitespa { public const DISCRIMINATOR_VALUE = 'whitespace'; /** + * * @var ?string */ protected $type; @@ -30,11 +31,13 @@ final class WhitespaceTokenizerModel extends JsonObjectModel implements Whitespa * @psalm-suppress MissingParamType */ public function __construct( + ?string $type = null ) { - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeBooleanTypeModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributeBooleanTypeModel.php index e9957082f67..a881c360040 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeBooleanTypeModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeBooleanTypeModel.php @@ -21,6 +21,7 @@ final class AttributeBooleanTypeModel extends JsonObjectModel implements Attribu { public const DISCRIMINATOR_VALUE = 'boolean'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class AttributeBooleanTypeModel extends JsonObjectModel implements Attribu * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeDateTimeTypeModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributeDateTimeTypeModel.php index be7def144f9..f446bfa61f2 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeDateTimeTypeModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeDateTimeTypeModel.php @@ -21,6 +21,7 @@ final class AttributeDateTimeTypeModel extends JsonObjectModel implements Attrib { public const DISCRIMINATOR_VALUE = 'datetime'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class AttributeDateTimeTypeModel extends JsonObjectModel implements Attrib * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeDateTypeModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributeDateTypeModel.php index 52a3c2496ad..ac82c4c27d1 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeDateTypeModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeDateTypeModel.php @@ -21,6 +21,7 @@ final class AttributeDateTypeModel extends JsonObjectModel implements AttributeD { public const DISCRIMINATOR_VALUE = 'date'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class AttributeDateTypeModel extends JsonObjectModel implements AttributeD * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeDefinition.php b/lib/commercetools-import/src/Models/Producttypes/AttributeDefinition.php index 2f9c451381e..cd1e626b1a1 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeDefinition.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeDefinition.php @@ -24,11 +24,13 @@ interface AttributeDefinition extends JsonObject public const FIELD_IS_SEARCHABLE = 'isSearchable'; /** + * @return null|AttributeType */ public function getType(); /** + * @return null|string */ public function getName(); @@ -41,16 +43,19 @@ public function getName(); * } * * + * @return null|LocalizedString */ public function getLabel(); /** + * @return null|bool */ public function getIsRequired(); /** + * @return null|string */ public function getAttributeConstraint(); @@ -63,16 +68,19 @@ public function getAttributeConstraint(); * } * * + * @return null|LocalizedString */ public function getInputTip(); /** + * @return null|string */ public function getInputHint(); /** + * @return null|bool */ public function getIsSearchable(); diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeDefinitionBuilder.php b/lib/commercetools-import/src/Models/Producttypes/AttributeDefinitionBuilder.php index 5e58697681b..9c357115091 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeDefinitionBuilder.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeDefinitionBuilder.php @@ -23,46 +23,55 @@ final class AttributeDefinitionBuilder implements Builder { /** + * @var null|AttributeType|AttributeTypeBuilder */ private $type; /** + * @var ?string */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; /** + * @var ?bool */ private $isRequired; /** + * @var ?string */ private $attributeConstraint; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $inputTip; /** + * @var ?string */ private $inputHint; /** + * @var ?bool */ private $isSearchable; /** + * @return null|AttributeType */ public function getType() @@ -71,6 +80,7 @@ public function getType() } /** + * @return null|string */ public function getName() @@ -86,6 +96,7 @@ public function getName() * } * * + * @return null|LocalizedString */ public function getLabel() @@ -94,6 +105,7 @@ public function getLabel() } /** + * @return null|bool */ public function getIsRequired() @@ -102,6 +114,7 @@ public function getIsRequired() } /** + * @return null|string */ public function getAttributeConstraint() @@ -117,6 +130,7 @@ public function getAttributeConstraint() * } * * + * @return null|LocalizedString */ public function getInputTip() @@ -125,6 +139,7 @@ public function getInputTip() } /** + * @return null|string */ public function getInputHint() @@ -133,6 +148,7 @@ public function getInputHint() } /** + * @return null|bool */ public function getIsSearchable() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeDefinitionModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributeDefinitionModel.php index 6c1c49830e7..3467ba8df9c 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeDefinitionModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeDefinitionModel.php @@ -22,41 +22,49 @@ final class AttributeDefinitionModel extends JsonObjectModel implements AttributeDefinition { /** + * * @var ?AttributeType */ protected $type; /** + * * @var ?string */ protected $name; /** + * * @var ?LocalizedString */ protected $label; /** + * * @var ?bool */ protected $isRequired; /** + * * @var ?string */ protected $attributeConstraint; /** + * * @var ?LocalizedString */ protected $inputTip; /** + * * @var ?string */ protected $inputHint; /** + * * @var ?bool */ protected $isSearchable; @@ -86,6 +94,7 @@ public function __construct( } /** + * * @return null|AttributeType */ public function getType() @@ -104,6 +113,7 @@ public function getType() } /** + * * @return null|string */ public function getName() @@ -128,6 +138,7 @@ public function getName() * } * * + * * @return null|LocalizedString */ public function getLabel() @@ -146,6 +157,7 @@ public function getLabel() } /** + * * @return null|bool */ public function getIsRequired() @@ -163,6 +175,7 @@ public function getIsRequired() } /** + * * @return null|string */ public function getAttributeConstraint() @@ -187,6 +200,7 @@ public function getAttributeConstraint() * } * * + * * @return null|LocalizedString */ public function getInputTip() @@ -205,6 +219,7 @@ public function getInputTip() } /** + * * @return null|string */ public function getInputHint() @@ -222,6 +237,7 @@ public function getInputHint() } /** + * * @return null|bool */ public function getIsSearchable() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeEnumType.php b/lib/commercetools-import/src/Models/Producttypes/AttributeEnumType.php index d9c355a05e8..109978e066e 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeEnumType.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeEnumType.php @@ -16,6 +16,7 @@ interface AttributeEnumType extends AttributeType public const FIELD_VALUES = 'values'; /** + * @return null|AttributePlainEnumValueCollection */ public function getValues(); diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeEnumTypeBuilder.php b/lib/commercetools-import/src/Models/Producttypes/AttributeEnumTypeBuilder.php index fd872f32399..2ccbf3f4bbf 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeEnumTypeBuilder.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeEnumTypeBuilder.php @@ -21,11 +21,13 @@ final class AttributeEnumTypeBuilder implements Builder { /** + * @var ?AttributePlainEnumValueCollection */ private $values; /** + * @return null|AttributePlainEnumValueCollection */ public function getValues() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeEnumTypeModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributeEnumTypeModel.php index c8e78323553..a584efba7f7 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeEnumTypeModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeEnumTypeModel.php @@ -21,11 +21,13 @@ final class AttributeEnumTypeModel extends JsonObjectModel implements AttributeE { public const DISCRIMINATOR_VALUE = 'enum'; /** + * * @var ?string */ protected $name; /** + * * @var ?AttributePlainEnumValueCollection */ protected $values; @@ -35,13 +37,15 @@ final class AttributeEnumTypeModel extends JsonObjectModel implements AttributeE * @psalm-suppress MissingParamType */ public function __construct( - ?AttributePlainEnumValueCollection $values = null + ?AttributePlainEnumValueCollection $values = null, + ?string $name = null ) { $this->values = $values; - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() @@ -59,6 +63,7 @@ public function getName() } /** + * * @return null|AttributePlainEnumValueCollection */ public function getValues() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizableTextTypeModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizableTextTypeModel.php index 24649596081..2930c90527f 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizableTextTypeModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizableTextTypeModel.php @@ -21,6 +21,7 @@ final class AttributeLocalizableTextTypeModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'ltext'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class AttributeLocalizableTextTypeModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumType.php b/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumType.php index 2f2f0a6c825..e3a8536980f 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumType.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumType.php @@ -16,6 +16,7 @@ interface AttributeLocalizedEnumType extends AttributeType public const FIELD_VALUES = 'values'; /** + * @return null|AttributeLocalizedEnumValueCollection */ public function getValues(); diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumTypeBuilder.php b/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumTypeBuilder.php index 11daefb60c5..7cdc5074957 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumTypeBuilder.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumTypeBuilder.php @@ -21,11 +21,13 @@ final class AttributeLocalizedEnumTypeBuilder implements Builder { /** + * @var ?AttributeLocalizedEnumValueCollection */ private $values; /** + * @return null|AttributeLocalizedEnumValueCollection */ public function getValues() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumTypeModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumTypeModel.php index ce90aa5d904..569c29aad28 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumTypeModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumTypeModel.php @@ -21,11 +21,13 @@ final class AttributeLocalizedEnumTypeModel extends JsonObjectModel implements A { public const DISCRIMINATOR_VALUE = 'lenum'; /** + * * @var ?string */ protected $name; /** + * * @var ?AttributeLocalizedEnumValueCollection */ protected $values; @@ -35,13 +37,15 @@ final class AttributeLocalizedEnumTypeModel extends JsonObjectModel implements A * @psalm-suppress MissingParamType */ public function __construct( - ?AttributeLocalizedEnumValueCollection $values = null + ?AttributeLocalizedEnumValueCollection $values = null, + ?string $name = null ) { $this->values = $values; - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() @@ -59,6 +63,7 @@ public function getName() } /** + * * @return null|AttributeLocalizedEnumValueCollection */ public function getValues() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumValue.php b/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumValue.php index 4cd45485cc5..616dabc5a48 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumValue.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumValue.php @@ -18,6 +18,7 @@ interface AttributeLocalizedEnumValue extends JsonObject public const FIELD_LABEL = 'label'; /** + * @return null|string */ public function getKey(); @@ -30,6 +31,7 @@ public function getKey(); * } * * + * @return null|LocalizedString */ public function getLabel(); diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumValueBuilder.php b/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumValueBuilder.php index cab3b1c8b62..d660f109eee 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumValueBuilder.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumValueBuilder.php @@ -23,16 +23,19 @@ final class AttributeLocalizedEnumValueBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $label; /** + * @return null|string */ public function getKey() @@ -48,6 +51,7 @@ public function getKey() * } * * + * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumValueModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumValueModel.php index 69d85142034..55113f1a3d1 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumValueModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeLocalizedEnumValueModel.php @@ -22,11 +22,13 @@ final class AttributeLocalizedEnumValueModel extends JsonObjectModel implements AttributeLocalizedEnumValue { /** + * * @var ?string */ protected $key; /** + * * @var ?LocalizedString */ protected $label; @@ -44,6 +46,7 @@ public function __construct( } /** + * * @return null|string */ public function getKey() @@ -68,6 +71,7 @@ public function getKey() * } * * + * * @return null|LocalizedString */ public function getLabel() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeMoneyTypeModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributeMoneyTypeModel.php index 9f714bcff78..3e17a62ca0a 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeMoneyTypeModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeMoneyTypeModel.php @@ -21,6 +21,7 @@ final class AttributeMoneyTypeModel extends JsonObjectModel implements Attribute { public const DISCRIMINATOR_VALUE = 'money'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class AttributeMoneyTypeModel extends JsonObjectModel implements Attribute * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeNestedType.php b/lib/commercetools-import/src/Models/Producttypes/AttributeNestedType.php index 203d9938173..4347cb9dcdb 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeNestedType.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeNestedType.php @@ -19,6 +19,7 @@ interface AttributeNestedType extends AttributeType /** *

    References a product type by key.

    * + * @return null|ProductTypeKeyReference */ public function getTypeReference(); diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeNestedTypeBuilder.php b/lib/commercetools-import/src/Models/Producttypes/AttributeNestedTypeBuilder.php index e0e1f124820..4751cf3e197 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeNestedTypeBuilder.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeNestedTypeBuilder.php @@ -23,6 +23,7 @@ final class AttributeNestedTypeBuilder implements Builder { /** + * @var null|ProductTypeKeyReference|ProductTypeKeyReferenceBuilder */ private $typeReference; @@ -30,6 +31,7 @@ final class AttributeNestedTypeBuilder implements Builder /** *

    References a product type by key.

    * + * @return null|ProductTypeKeyReference */ public function getTypeReference() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeNestedTypeModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributeNestedTypeModel.php index 283a4f8d2bc..65506f91603 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeNestedTypeModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeNestedTypeModel.php @@ -23,11 +23,13 @@ final class AttributeNestedTypeModel extends JsonObjectModel implements Attribut { public const DISCRIMINATOR_VALUE = 'nested'; /** + * * @var ?string */ protected $name; /** + * * @var ?ProductTypeKeyReference */ protected $typeReference; @@ -37,13 +39,15 @@ final class AttributeNestedTypeModel extends JsonObjectModel implements Attribut * @psalm-suppress MissingParamType */ public function __construct( - ?ProductTypeKeyReference $typeReference = null + ?ProductTypeKeyReference $typeReference = null, + ?string $name = null ) { $this->typeReference = $typeReference; - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() @@ -63,6 +67,7 @@ public function getName() /** *

    References a product type by key.

    * + * * @return null|ProductTypeKeyReference */ public function getTypeReference() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeNumberTypeModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributeNumberTypeModel.php index b74217141e9..287a2f4ceda 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeNumberTypeModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeNumberTypeModel.php @@ -21,6 +21,7 @@ final class AttributeNumberTypeModel extends JsonObjectModel implements Attribut { public const DISCRIMINATOR_VALUE = 'number'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class AttributeNumberTypeModel extends JsonObjectModel implements Attribut * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributePlainEnumValue.php b/lib/commercetools-import/src/Models/Producttypes/AttributePlainEnumValue.php index 041755d8adf..4cbe96c43a2 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributePlainEnumValue.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributePlainEnumValue.php @@ -17,11 +17,13 @@ interface AttributePlainEnumValue extends JsonObject public const FIELD_LABEL = 'label'; /** + * @return null|string */ public function getKey(); /** + * @return null|string */ public function getLabel(); diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributePlainEnumValueBuilder.php b/lib/commercetools-import/src/Models/Producttypes/AttributePlainEnumValueBuilder.php index 6a97db19b53..2adae01edac 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributePlainEnumValueBuilder.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributePlainEnumValueBuilder.php @@ -21,16 +21,19 @@ final class AttributePlainEnumValueBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $label; /** + * @return null|string */ public function getKey() @@ -39,6 +42,7 @@ public function getKey() } /** + * @return null|string */ public function getLabel() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributePlainEnumValueModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributePlainEnumValueModel.php index fa1d9e639ac..6cf467a387b 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributePlainEnumValueModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributePlainEnumValueModel.php @@ -20,11 +20,13 @@ final class AttributePlainEnumValueModel extends JsonObjectModel implements AttributePlainEnumValue { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $label; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|string */ public function getKey() @@ -59,6 +62,7 @@ public function getKey() } /** + * * @return null|string */ public function getLabel() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeReferenceType.php b/lib/commercetools-import/src/Models/Producttypes/AttributeReferenceType.php index 35ebb190fb7..1cd71623a05 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeReferenceType.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeReferenceType.php @@ -18,6 +18,7 @@ interface AttributeReferenceType extends AttributeType /** *

    The type of the referenced resource.

    * + * @return null|string */ public function getReferenceTypeId(); diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeReferenceTypeBuilder.php b/lib/commercetools-import/src/Models/Producttypes/AttributeReferenceTypeBuilder.php index 02b2b001f0e..8387fe8298e 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeReferenceTypeBuilder.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeReferenceTypeBuilder.php @@ -21,6 +21,7 @@ final class AttributeReferenceTypeBuilder implements Builder { /** + * @var ?string */ private $referenceTypeId; @@ -28,6 +29,7 @@ final class AttributeReferenceTypeBuilder implements Builder /** *

    The type of the referenced resource.

    * + * @return null|string */ public function getReferenceTypeId() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeReferenceTypeModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributeReferenceTypeModel.php index fc4cfa9ceb1..588d7ffdf0f 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeReferenceTypeModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeReferenceTypeModel.php @@ -21,11 +21,13 @@ final class AttributeReferenceTypeModel extends JsonObjectModel implements Attri { public const DISCRIMINATOR_VALUE = 'reference'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $referenceTypeId; @@ -35,13 +37,15 @@ final class AttributeReferenceTypeModel extends JsonObjectModel implements Attri * @psalm-suppress MissingParamType */ public function __construct( - ?string $referenceTypeId = null + ?string $referenceTypeId = null, + ?string $name = null ) { $this->referenceTypeId = $referenceTypeId; - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() @@ -61,6 +65,7 @@ public function getName() /** *

    The type of the referenced resource.

    * + * * @return null|string */ public function getReferenceTypeId() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeSetType.php b/lib/commercetools-import/src/Models/Producttypes/AttributeSetType.php index 332d2f49170..5202224a994 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeSetType.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeSetType.php @@ -16,6 +16,7 @@ interface AttributeSetType extends AttributeType public const FIELD_ELEMENT_TYPE = 'elementType'; /** + * @return null|AttributeType */ public function getElementType(); diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeSetTypeBuilder.php b/lib/commercetools-import/src/Models/Producttypes/AttributeSetTypeBuilder.php index 05da9537b5f..6d83a361119 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeSetTypeBuilder.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeSetTypeBuilder.php @@ -21,11 +21,13 @@ final class AttributeSetTypeBuilder implements Builder { /** + * @var null|AttributeType|AttributeTypeBuilder */ private $elementType; /** + * @return null|AttributeType */ public function getElementType() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeSetTypeModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributeSetTypeModel.php index 903e28f8538..423c44236a1 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeSetTypeModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeSetTypeModel.php @@ -21,11 +21,13 @@ final class AttributeSetTypeModel extends JsonObjectModel implements AttributeSe { public const DISCRIMINATOR_VALUE = 'set'; /** + * * @var ?string */ protected $name; /** + * * @var ?AttributeType */ protected $elementType; @@ -35,13 +37,15 @@ final class AttributeSetTypeModel extends JsonObjectModel implements AttributeSe * @psalm-suppress MissingParamType */ public function __construct( - ?AttributeType $elementType = null + ?AttributeType $elementType = null, + ?string $name = null ) { $this->elementType = $elementType; - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() @@ -59,6 +63,7 @@ public function getName() } /** + * * @return null|AttributeType */ public function getElementType() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeTextTypeModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributeTextTypeModel.php index e5d324f08f9..f59e5ade958 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeTextTypeModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeTextTypeModel.php @@ -21,6 +21,7 @@ final class AttributeTextTypeModel extends JsonObjectModel implements AttributeT { public const DISCRIMINATOR_VALUE = 'text'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class AttributeTextTypeModel extends JsonObjectModel implements AttributeT * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeTimeTypeModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributeTimeTypeModel.php index d3435d513b2..72b804fabb7 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeTimeTypeModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeTimeTypeModel.php @@ -21,6 +21,7 @@ final class AttributeTimeTypeModel extends JsonObjectModel implements AttributeT { public const DISCRIMINATOR_VALUE = 'time'; /** + * * @var ?string */ protected $name; @@ -30,11 +31,13 @@ final class AttributeTimeTypeModel extends JsonObjectModel implements AttributeT * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeType.php b/lib/commercetools-import/src/Models/Producttypes/AttributeType.php index 7e441008266..bedec2c1a56 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeType.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeType.php @@ -17,6 +17,7 @@ interface AttributeType extends JsonObject public const FIELD_NAME = 'name'; /** + * @return null|string */ public function getName(); diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeTypeModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributeTypeModel.php index 0fff179055f..687e034ef3e 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeTypeModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeTypeModel.php @@ -21,6 +21,7 @@ final class AttributeTypeModel extends JsonObjectModel implements AttributeType { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $name; @@ -49,11 +50,13 @@ final class AttributeTypeModel extends JsonObjectModel implements AttributeType * @psalm-suppress MissingParamType */ public function __construct( + ?string $name = null ) { - $this->name = static::DISCRIMINATOR_VALUE; + $this->name = $name; } /** + * * @return null|string */ public function getName() diff --git a/lib/commercetools-import/src/Models/Producttypes/ProductTypeImport.php b/lib/commercetools-import/src/Models/Producttypes/ProductTypeImport.php index 19051351ab8..308e16823c1 100644 --- a/lib/commercetools-import/src/Models/Producttypes/ProductTypeImport.php +++ b/lib/commercetools-import/src/Models/Producttypes/ProductTypeImport.php @@ -21,6 +21,7 @@ interface ProductTypeImport extends ImportResource /** *

    Maps to ProductType.name.

    * + * @return null|string */ public function getName(); @@ -28,6 +29,7 @@ public function getName(); /** *

    Maps to ProductType.description.

    * + * @return null|string */ public function getDescription(); @@ -35,6 +37,7 @@ public function getDescription(); /** *

    The attributes of ProductType.

    * + * @return null|AttributeDefinitionCollection */ public function getAttributes(); diff --git a/lib/commercetools-import/src/Models/Producttypes/ProductTypeImportBuilder.php b/lib/commercetools-import/src/Models/Producttypes/ProductTypeImportBuilder.php index 867413a4007..cd66b5ca3f1 100644 --- a/lib/commercetools-import/src/Models/Producttypes/ProductTypeImportBuilder.php +++ b/lib/commercetools-import/src/Models/Producttypes/ProductTypeImportBuilder.php @@ -23,26 +23,33 @@ final class ProductTypeImportBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $name; /** + * @var ?string */ private $description; /** + * @var ?AttributeDefinitionCollection */ private $attributes; /** + *

    User-defined unique identifier.

    + * + * @return null|string */ public function getKey() @@ -53,6 +60,7 @@ public function getKey() /** *

    Maps to ProductType.name.

    * + * @return null|string */ public function getName() @@ -63,6 +71,7 @@ public function getName() /** *

    Maps to ProductType.description.

    * + * @return null|string */ public function getDescription() @@ -73,6 +82,7 @@ public function getDescription() /** *

    The attributes of ProductType.

    * + * @return null|AttributeDefinitionCollection */ public function getAttributes() diff --git a/lib/commercetools-import/src/Models/Producttypes/ProductTypeImportModel.php b/lib/commercetools-import/src/Models/Producttypes/ProductTypeImportModel.php index c5a1ddf7533..f7a2c434f4e 100644 --- a/lib/commercetools-import/src/Models/Producttypes/ProductTypeImportModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/ProductTypeImportModel.php @@ -22,21 +22,25 @@ final class ProductTypeImportModel extends JsonObjectModel implements ProductTypeImport { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $description; /** + * * @var ?AttributeDefinitionCollection */ protected $attributes; @@ -58,6 +62,9 @@ public function __construct( } /** + *

    User-defined unique identifier.

    + * + * * @return null|string */ public function getKey() @@ -77,6 +84,7 @@ public function getKey() /** *

    Maps to ProductType.name.

    * + * * @return null|string */ public function getName() @@ -96,6 +104,7 @@ public function getName() /** *

    Maps to ProductType.description.

    * + * * @return null|string */ public function getDescription() @@ -115,6 +124,7 @@ public function getDescription() /** *

    The attributes of ProductType.

    * + * * @return null|AttributeDefinitionCollection */ public function getAttributes() diff --git a/lib/commercetools-import/src/Models/Productvariants/Attribute.php b/lib/commercetools-import/src/Models/Productvariants/Attribute.php index b81bec561dd..52b86dd6d05 100644 --- a/lib/commercetools-import/src/Models/Productvariants/Attribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/Attribute.php @@ -22,11 +22,13 @@ interface Attribute extends JsonObject * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName(); /** + * @return null|string */ public function getType(); diff --git a/lib/commercetools-import/src/Models/Productvariants/AttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/AttributeBuilder.php index d9a63bbf7de..059556d9f07 100644 --- a/lib/commercetools-import/src/Models/Productvariants/AttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/AttributeBuilder.php @@ -21,6 +21,7 @@ final class AttributeBuilder implements Builder { /** + * @var ?string */ private $name; @@ -30,6 +31,7 @@ final class AttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() diff --git a/lib/commercetools-import/src/Models/Productvariants/AttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/AttributeModel.php index f520286ac35..e4e8baa2d2d 100644 --- a/lib/commercetools-import/src/Models/Productvariants/AttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/AttributeModel.php @@ -21,11 +21,13 @@ final class AttributeModel extends JsonObjectModel implements Attribute { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; @@ -63,10 +65,11 @@ final class AttributeModel extends JsonObjectModel implements Attribute * @psalm-suppress MissingParamType */ public function __construct( - ?string $name = null + ?string $name = null, + ?string $type = null ) { $this->name = $name; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type; } /** @@ -74,6 +77,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -91,6 +95,7 @@ public function getName() } /** + * * @return null|string */ public function getType() diff --git a/lib/commercetools-import/src/Models/Productvariants/BooleanAttribute.php b/lib/commercetools-import/src/Models/Productvariants/BooleanAttribute.php index 77bd823cd6a..21b76baa23b 100644 --- a/lib/commercetools-import/src/Models/Productvariants/BooleanAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/BooleanAttribute.php @@ -16,6 +16,7 @@ interface BooleanAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|bool */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/BooleanAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/BooleanAttributeBuilder.php index 376748121d5..0c83a77204d 100644 --- a/lib/commercetools-import/src/Models/Productvariants/BooleanAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/BooleanAttributeBuilder.php @@ -21,11 +21,13 @@ final class BooleanAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?bool */ private $value; @@ -35,6 +37,7 @@ final class BooleanAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -43,6 +46,7 @@ public function getName() } /** + * @return null|bool */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/BooleanAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/BooleanAttributeModel.php index 88927f5571a..be4792dc6fa 100644 --- a/lib/commercetools-import/src/Models/Productvariants/BooleanAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/BooleanAttributeModel.php @@ -21,16 +21,19 @@ final class BooleanAttributeModel extends JsonObjectModel implements BooleanAttr { public const DISCRIMINATOR_VALUE = 'boolean'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?bool */ protected $value; @@ -41,11 +44,12 @@ final class BooleanAttributeModel extends JsonObjectModel implements BooleanAttr */ public function __construct( ?string $name = null, - ?bool $value = null + ?bool $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -53,6 +57,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -70,6 +75,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -87,6 +93,7 @@ public function getType() } /** + * * @return null|bool */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/BooleanSetAttribute.php b/lib/commercetools-import/src/Models/Productvariants/BooleanSetAttribute.php index a2b947c6c5a..106ce15ae7b 100644 --- a/lib/commercetools-import/src/Models/Productvariants/BooleanSetAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/BooleanSetAttribute.php @@ -16,6 +16,7 @@ interface BooleanSetAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|array */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/BooleanSetAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/BooleanSetAttributeBuilder.php index 1bae8fc1b61..31d58989477 100644 --- a/lib/commercetools-import/src/Models/Productvariants/BooleanSetAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/BooleanSetAttributeBuilder.php @@ -21,11 +21,13 @@ final class BooleanSetAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?array */ private $value; @@ -35,6 +37,7 @@ final class BooleanSetAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -43,6 +46,7 @@ public function getName() } /** + * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/BooleanSetAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/BooleanSetAttributeModel.php index 3a63b5267e2..3c24261d288 100644 --- a/lib/commercetools-import/src/Models/Productvariants/BooleanSetAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/BooleanSetAttributeModel.php @@ -21,16 +21,19 @@ final class BooleanSetAttributeModel extends JsonObjectModel implements BooleanS { public const DISCRIMINATOR_VALUE = 'boolean-set'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $value; @@ -41,11 +44,12 @@ final class BooleanSetAttributeModel extends JsonObjectModel implements BooleanS */ public function __construct( ?string $name = null, - ?array $value = null + ?array $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -53,6 +57,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -70,6 +75,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -87,6 +93,7 @@ public function getType() } /** + * * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/DateAttribute.php b/lib/commercetools-import/src/Models/Productvariants/DateAttribute.php index 1837a925ed5..94156f9fd93 100644 --- a/lib/commercetools-import/src/Models/Productvariants/DateAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/DateAttribute.php @@ -17,6 +17,7 @@ interface DateAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|DateTimeImmutable */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/DateAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/DateAttributeBuilder.php index b546e327336..38d5989b677 100644 --- a/lib/commercetools-import/src/Models/Productvariants/DateAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/DateAttributeBuilder.php @@ -22,11 +22,13 @@ final class DateAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?DateTimeImmutable */ private $value; @@ -36,6 +38,7 @@ final class DateAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -44,6 +47,7 @@ public function getName() } /** + * @return null|DateTimeImmutable */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/DateAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/DateAttributeModel.php index 6eea19905b5..e65ca05a046 100644 --- a/lib/commercetools-import/src/Models/Productvariants/DateAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/DateAttributeModel.php @@ -22,16 +22,19 @@ final class DateAttributeModel extends JsonObjectModel implements DateAttribute { public const DISCRIMINATOR_VALUE = 'date'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?DateTimeImmutable */ protected $value; @@ -42,11 +45,12 @@ final class DateAttributeModel extends JsonObjectModel implements DateAttribute */ public function __construct( ?string $name = null, - ?DateTimeImmutable $value = null + ?DateTimeImmutable $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -54,6 +58,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -71,6 +76,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -88,6 +94,7 @@ public function getType() } /** + * * @return null|DateTimeImmutable */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/DateSetAttribute.php b/lib/commercetools-import/src/Models/Productvariants/DateSetAttribute.php index a240b71ad3c..763f98520d1 100644 --- a/lib/commercetools-import/src/Models/Productvariants/DateSetAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/DateSetAttribute.php @@ -16,6 +16,7 @@ interface DateSetAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|DateTimeImmutableCollection */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/DateSetAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/DateSetAttributeBuilder.php index d088cdfe6fd..f056d47a3e0 100644 --- a/lib/commercetools-import/src/Models/Productvariants/DateSetAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/DateSetAttributeBuilder.php @@ -21,11 +21,13 @@ final class DateSetAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?DateTimeImmutableCollection */ private $value; @@ -35,6 +37,7 @@ final class DateSetAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -43,6 +46,7 @@ public function getName() } /** + * @return null|DateTimeImmutableCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/DateSetAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/DateSetAttributeModel.php index e968b87844f..a805803e613 100644 --- a/lib/commercetools-import/src/Models/Productvariants/DateSetAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/DateSetAttributeModel.php @@ -21,16 +21,19 @@ final class DateSetAttributeModel extends JsonObjectModel implements DateSetAttr { public const DISCRIMINATOR_VALUE = 'date-set'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?DateTimeImmutableCollection */ protected $value; @@ -41,11 +44,12 @@ final class DateSetAttributeModel extends JsonObjectModel implements DateSetAttr */ public function __construct( ?string $name = null, - ?DateTimeImmutableCollection $value = null + ?DateTimeImmutableCollection $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -53,6 +57,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -70,6 +75,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -87,6 +93,7 @@ public function getType() } /** + * * @return null|DateTimeImmutableCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/DateTimeAttribute.php b/lib/commercetools-import/src/Models/Productvariants/DateTimeAttribute.php index 8072cf778da..91ae04221d6 100644 --- a/lib/commercetools-import/src/Models/Productvariants/DateTimeAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/DateTimeAttribute.php @@ -17,6 +17,7 @@ interface DateTimeAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|DateTimeImmutable */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/DateTimeAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/DateTimeAttributeBuilder.php index 71d82bbef33..5785da37052 100644 --- a/lib/commercetools-import/src/Models/Productvariants/DateTimeAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/DateTimeAttributeBuilder.php @@ -22,11 +22,13 @@ final class DateTimeAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?DateTimeImmutable */ private $value; @@ -36,6 +38,7 @@ final class DateTimeAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -44,6 +47,7 @@ public function getName() } /** + * @return null|DateTimeImmutable */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/DateTimeAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/DateTimeAttributeModel.php index 2b161986196..9c414417b91 100644 --- a/lib/commercetools-import/src/Models/Productvariants/DateTimeAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/DateTimeAttributeModel.php @@ -22,16 +22,19 @@ final class DateTimeAttributeModel extends JsonObjectModel implements DateTimeAt { public const DISCRIMINATOR_VALUE = 'datetime'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?DateTimeImmutable */ protected $value; @@ -42,11 +45,12 @@ final class DateTimeAttributeModel extends JsonObjectModel implements DateTimeAt */ public function __construct( ?string $name = null, - ?DateTimeImmutable $value = null + ?DateTimeImmutable $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -54,6 +58,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -71,6 +76,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -88,6 +94,7 @@ public function getType() } /** + * * @return null|DateTimeImmutable */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/DateTimeSetAttribute.php b/lib/commercetools-import/src/Models/Productvariants/DateTimeSetAttribute.php index 09f7d57b94b..ea7bda6845c 100644 --- a/lib/commercetools-import/src/Models/Productvariants/DateTimeSetAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/DateTimeSetAttribute.php @@ -16,6 +16,7 @@ interface DateTimeSetAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|DateTimeImmutableCollection */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/DateTimeSetAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/DateTimeSetAttributeBuilder.php index d5d8255586f..c50a888acf2 100644 --- a/lib/commercetools-import/src/Models/Productvariants/DateTimeSetAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/DateTimeSetAttributeBuilder.php @@ -21,11 +21,13 @@ final class DateTimeSetAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?DateTimeImmutableCollection */ private $value; @@ -35,6 +37,7 @@ final class DateTimeSetAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -43,6 +46,7 @@ public function getName() } /** + * @return null|DateTimeImmutableCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/DateTimeSetAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/DateTimeSetAttributeModel.php index 25486fa3016..25c16f00787 100644 --- a/lib/commercetools-import/src/Models/Productvariants/DateTimeSetAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/DateTimeSetAttributeModel.php @@ -21,16 +21,19 @@ final class DateTimeSetAttributeModel extends JsonObjectModel implements DateTim { public const DISCRIMINATOR_VALUE = 'datetime-set'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?DateTimeImmutableCollection */ protected $value; @@ -41,11 +44,12 @@ final class DateTimeSetAttributeModel extends JsonObjectModel implements DateTim */ public function __construct( ?string $name = null, - ?DateTimeImmutableCollection $value = null + ?DateTimeImmutableCollection $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -53,6 +57,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -70,6 +75,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -87,6 +93,7 @@ public function getType() } /** + * * @return null|DateTimeImmutableCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/EnumAttribute.php b/lib/commercetools-import/src/Models/Productvariants/EnumAttribute.php index 593699c25a5..06bbd4a4f56 100644 --- a/lib/commercetools-import/src/Models/Productvariants/EnumAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/EnumAttribute.php @@ -16,6 +16,7 @@ interface EnumAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/EnumAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/EnumAttributeBuilder.php index 55254bc5bdf..8a74ca7998a 100644 --- a/lib/commercetools-import/src/Models/Productvariants/EnumAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/EnumAttributeBuilder.php @@ -21,11 +21,13 @@ final class EnumAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?string */ private $value; @@ -35,6 +37,7 @@ final class EnumAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -43,6 +46,7 @@ public function getName() } /** + * @return null|string */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/EnumAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/EnumAttributeModel.php index c4400cc8158..a977bcea93d 100644 --- a/lib/commercetools-import/src/Models/Productvariants/EnumAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/EnumAttributeModel.php @@ -21,16 +21,19 @@ final class EnumAttributeModel extends JsonObjectModel implements EnumAttribute { public const DISCRIMINATOR_VALUE = 'enum'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $value; @@ -41,11 +44,12 @@ final class EnumAttributeModel extends JsonObjectModel implements EnumAttribute */ public function __construct( ?string $name = null, - ?string $value = null + ?string $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -53,6 +57,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -70,6 +75,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -87,6 +93,7 @@ public function getType() } /** + * * @return null|string */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/EnumSetAttribute.php b/lib/commercetools-import/src/Models/Productvariants/EnumSetAttribute.php index bfdfa965e2d..babc3e6f327 100644 --- a/lib/commercetools-import/src/Models/Productvariants/EnumSetAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/EnumSetAttribute.php @@ -16,6 +16,7 @@ interface EnumSetAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|array */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/EnumSetAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/EnumSetAttributeBuilder.php index 37cd14ccc42..c0bb97babdb 100644 --- a/lib/commercetools-import/src/Models/Productvariants/EnumSetAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/EnumSetAttributeBuilder.php @@ -21,11 +21,13 @@ final class EnumSetAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?array */ private $value; @@ -35,6 +37,7 @@ final class EnumSetAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -43,6 +46,7 @@ public function getName() } /** + * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/EnumSetAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/EnumSetAttributeModel.php index a002c27edab..bc9a8502a72 100644 --- a/lib/commercetools-import/src/Models/Productvariants/EnumSetAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/EnumSetAttributeModel.php @@ -21,16 +21,19 @@ final class EnumSetAttributeModel extends JsonObjectModel implements EnumSetAttr { public const DISCRIMINATOR_VALUE = 'enum-set'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $value; @@ -41,11 +44,12 @@ final class EnumSetAttributeModel extends JsonObjectModel implements EnumSetAttr */ public function __construct( ?string $name = null, - ?array $value = null + ?array $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -53,6 +57,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -70,6 +75,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -87,6 +93,7 @@ public function getType() } /** + * * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumAttribute.php b/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumAttribute.php index 101be3827b6..3afe9f1263b 100644 --- a/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumAttribute.php @@ -16,6 +16,7 @@ interface LocalizableEnumAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumAttributeBuilder.php index ec0ad835ce4..f0128c7e492 100644 --- a/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumAttributeBuilder.php @@ -21,11 +21,13 @@ final class LocalizableEnumAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?string */ private $value; @@ -35,6 +37,7 @@ final class LocalizableEnumAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -43,6 +46,7 @@ public function getName() } /** + * @return null|string */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumAttributeModel.php index 931fc6faec0..368763a937d 100644 --- a/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumAttributeModel.php @@ -21,16 +21,19 @@ final class LocalizableEnumAttributeModel extends JsonObjectModel implements Loc { public const DISCRIMINATOR_VALUE = 'lenum'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $value; @@ -41,11 +44,12 @@ final class LocalizableEnumAttributeModel extends JsonObjectModel implements Loc */ public function __construct( ?string $name = null, - ?string $value = null + ?string $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -53,6 +57,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -70,6 +75,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -87,6 +93,7 @@ public function getType() } /** + * * @return null|string */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumSetAttribute.php b/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumSetAttribute.php index c9a5753cfe0..aea7a31de5e 100644 --- a/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumSetAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumSetAttribute.php @@ -16,6 +16,7 @@ interface LocalizableEnumSetAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|array */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumSetAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumSetAttributeBuilder.php index b5773b4f627..9ff5267239f 100644 --- a/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumSetAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumSetAttributeBuilder.php @@ -21,11 +21,13 @@ final class LocalizableEnumSetAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?array */ private $value; @@ -35,6 +37,7 @@ final class LocalizableEnumSetAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -43,6 +46,7 @@ public function getName() } /** + * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumSetAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumSetAttributeModel.php index 7a11b4194de..7cdbfb0c378 100644 --- a/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumSetAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/LocalizableEnumSetAttributeModel.php @@ -21,16 +21,19 @@ final class LocalizableEnumSetAttributeModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'lenum-set'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $value; @@ -41,11 +44,12 @@ final class LocalizableEnumSetAttributeModel extends JsonObjectModel implements */ public function __construct( ?string $name = null, - ?array $value = null + ?array $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -53,6 +57,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -70,6 +75,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -87,6 +93,7 @@ public function getType() } /** + * * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/LocalizableTextAttribute.php b/lib/commercetools-import/src/Models/Productvariants/LocalizableTextAttribute.php index e9d5d6981fb..04dbde3bdf2 100644 --- a/lib/commercetools-import/src/Models/Productvariants/LocalizableTextAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/LocalizableTextAttribute.php @@ -24,6 +24,7 @@ interface LocalizableTextAttribute extends Attribute * } * * + * @return null|LocalizedString */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/LocalizableTextAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/LocalizableTextAttributeBuilder.php index d3b001b355f..21ee0c1bb6f 100644 --- a/lib/commercetools-import/src/Models/Productvariants/LocalizableTextAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/LocalizableTextAttributeBuilder.php @@ -23,11 +23,13 @@ final class LocalizableTextAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $value; @@ -37,6 +39,7 @@ final class LocalizableTextAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -52,6 +55,7 @@ public function getName() * } * * + * @return null|LocalizedString */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/LocalizableTextAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/LocalizableTextAttributeModel.php index 4a37f388ac8..85dac39977f 100644 --- a/lib/commercetools-import/src/Models/Productvariants/LocalizableTextAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/LocalizableTextAttributeModel.php @@ -23,16 +23,19 @@ final class LocalizableTextAttributeModel extends JsonObjectModel implements Loc { public const DISCRIMINATOR_VALUE = 'ltext'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?LocalizedString */ protected $value; @@ -43,11 +46,12 @@ final class LocalizableTextAttributeModel extends JsonObjectModel implements Loc */ public function __construct( ?string $name = null, - ?LocalizedString $value = null + ?LocalizedString $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -55,6 +59,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -72,6 +77,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -96,6 +102,7 @@ public function getType() * } * * + * * @return null|LocalizedString */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/LocalizableTextSetAttribute.php b/lib/commercetools-import/src/Models/Productvariants/LocalizableTextSetAttribute.php index 2e1a5739452..aa90774b8fe 100644 --- a/lib/commercetools-import/src/Models/Productvariants/LocalizableTextSetAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/LocalizableTextSetAttribute.php @@ -17,6 +17,7 @@ interface LocalizableTextSetAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|LocalizedStringCollection */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/LocalizableTextSetAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/LocalizableTextSetAttributeBuilder.php index 90aee2cc820..abf879b2379 100644 --- a/lib/commercetools-import/src/Models/Productvariants/LocalizableTextSetAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/LocalizableTextSetAttributeBuilder.php @@ -22,11 +22,13 @@ final class LocalizableTextSetAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?LocalizedStringCollection */ private $value; @@ -36,6 +38,7 @@ final class LocalizableTextSetAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -44,6 +47,7 @@ public function getName() } /** + * @return null|LocalizedStringCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/LocalizableTextSetAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/LocalizableTextSetAttributeModel.php index dd4c228ac76..46376452f9a 100644 --- a/lib/commercetools-import/src/Models/Productvariants/LocalizableTextSetAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/LocalizableTextSetAttributeModel.php @@ -22,16 +22,19 @@ final class LocalizableTextSetAttributeModel extends JsonObjectModel implements { public const DISCRIMINATOR_VALUE = 'ltext-set'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?LocalizedStringCollection */ protected $value; @@ -42,11 +45,12 @@ final class LocalizableTextSetAttributeModel extends JsonObjectModel implements */ public function __construct( ?string $name = null, - ?LocalizedStringCollection $value = null + ?LocalizedStringCollection $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -54,6 +58,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -71,6 +76,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -88,6 +94,7 @@ public function getType() } /** + * * @return null|LocalizedStringCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/MoneyAttribute.php b/lib/commercetools-import/src/Models/Productvariants/MoneyAttribute.php index c3c7e2870ef..d57f075564e 100644 --- a/lib/commercetools-import/src/Models/Productvariants/MoneyAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/MoneyAttribute.php @@ -17,6 +17,7 @@ interface MoneyAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|TypedMoney */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/MoneyAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/MoneyAttributeBuilder.php index dc385824750..4dc7f22afcc 100644 --- a/lib/commercetools-import/src/Models/Productvariants/MoneyAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/MoneyAttributeBuilder.php @@ -23,11 +23,13 @@ final class MoneyAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|TypedMoney|TypedMoneyBuilder */ private $value; @@ -37,6 +39,7 @@ final class MoneyAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -45,6 +48,7 @@ public function getName() } /** + * @return null|TypedMoney */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/MoneyAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/MoneyAttributeModel.php index d707811b573..e1553e9f737 100644 --- a/lib/commercetools-import/src/Models/Productvariants/MoneyAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/MoneyAttributeModel.php @@ -23,16 +23,19 @@ final class MoneyAttributeModel extends JsonObjectModel implements MoneyAttribut { public const DISCRIMINATOR_VALUE = 'money'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?TypedMoney */ protected $value; @@ -43,11 +46,12 @@ final class MoneyAttributeModel extends JsonObjectModel implements MoneyAttribut */ public function __construct( ?string $name = null, - ?TypedMoney $value = null + ?TypedMoney $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -55,6 +59,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -72,6 +77,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -89,6 +95,7 @@ public function getType() } /** + * * @return null|TypedMoney */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/MoneySetAttribute.php b/lib/commercetools-import/src/Models/Productvariants/MoneySetAttribute.php index 3526bf466e5..0a527bcbc0f 100644 --- a/lib/commercetools-import/src/Models/Productvariants/MoneySetAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/MoneySetAttribute.php @@ -17,6 +17,7 @@ interface MoneySetAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|TypedMoneyCollection */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/MoneySetAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/MoneySetAttributeBuilder.php index 0f64e4b2a79..505be5dd5a8 100644 --- a/lib/commercetools-import/src/Models/Productvariants/MoneySetAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/MoneySetAttributeBuilder.php @@ -22,11 +22,13 @@ final class MoneySetAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?TypedMoneyCollection */ private $value; @@ -36,6 +38,7 @@ final class MoneySetAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -44,6 +47,7 @@ public function getName() } /** + * @return null|TypedMoneyCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/MoneySetAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/MoneySetAttributeModel.php index 14ce11603d1..65e45d3b4b7 100644 --- a/lib/commercetools-import/src/Models/Productvariants/MoneySetAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/MoneySetAttributeModel.php @@ -22,16 +22,19 @@ final class MoneySetAttributeModel extends JsonObjectModel implements MoneySetAt { public const DISCRIMINATOR_VALUE = 'money-set'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?TypedMoneyCollection */ protected $value; @@ -42,11 +45,12 @@ final class MoneySetAttributeModel extends JsonObjectModel implements MoneySetAt */ public function __construct( ?string $name = null, - ?TypedMoneyCollection $value = null + ?TypedMoneyCollection $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -54,6 +58,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -71,6 +76,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -88,6 +94,7 @@ public function getType() } /** + * * @return null|TypedMoneyCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/NumberAttribute.php b/lib/commercetools-import/src/Models/Productvariants/NumberAttribute.php index 4bfefa35b9f..025eaf797d7 100644 --- a/lib/commercetools-import/src/Models/Productvariants/NumberAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/NumberAttribute.php @@ -16,6 +16,7 @@ interface NumberAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|float */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/NumberAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/NumberAttributeBuilder.php index 660c10db99a..9c8effbb5a3 100644 --- a/lib/commercetools-import/src/Models/Productvariants/NumberAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/NumberAttributeBuilder.php @@ -21,11 +21,13 @@ final class NumberAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?float */ private $value; @@ -35,6 +37,7 @@ final class NumberAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -43,6 +46,7 @@ public function getName() } /** + * @return null|float */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/NumberAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/NumberAttributeModel.php index ef926898af0..bdfe79dfc63 100644 --- a/lib/commercetools-import/src/Models/Productvariants/NumberAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/NumberAttributeModel.php @@ -21,16 +21,19 @@ final class NumberAttributeModel extends JsonObjectModel implements NumberAttrib { public const DISCRIMINATOR_VALUE = 'number'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?float */ protected $value; @@ -41,11 +44,12 @@ final class NumberAttributeModel extends JsonObjectModel implements NumberAttrib */ public function __construct( ?string $name = null, - ?float $value = null + ?float $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -53,6 +57,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -70,6 +75,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -87,6 +93,7 @@ public function getType() } /** + * * @return null|float */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/NumberSetAttribute.php b/lib/commercetools-import/src/Models/Productvariants/NumberSetAttribute.php index ed1ff03146a..e111873c85b 100644 --- a/lib/commercetools-import/src/Models/Productvariants/NumberSetAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/NumberSetAttribute.php @@ -16,6 +16,7 @@ interface NumberSetAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|array */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/NumberSetAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/NumberSetAttributeBuilder.php index b1620435bfc..60acdd39845 100644 --- a/lib/commercetools-import/src/Models/Productvariants/NumberSetAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/NumberSetAttributeBuilder.php @@ -21,11 +21,13 @@ final class NumberSetAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?array */ private $value; @@ -35,6 +37,7 @@ final class NumberSetAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -43,6 +46,7 @@ public function getName() } /** + * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/NumberSetAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/NumberSetAttributeModel.php index 145d96fc032..aa2e5e8c9ac 100644 --- a/lib/commercetools-import/src/Models/Productvariants/NumberSetAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/NumberSetAttributeModel.php @@ -21,16 +21,19 @@ final class NumberSetAttributeModel extends JsonObjectModel implements NumberSet { public const DISCRIMINATOR_VALUE = 'number-set'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $value; @@ -41,11 +44,12 @@ final class NumberSetAttributeModel extends JsonObjectModel implements NumberSet */ public function __construct( ?string $name = null, - ?array $value = null + ?array $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -53,6 +57,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -70,6 +75,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -87,6 +93,7 @@ public function getType() } /** + * * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/ProductVariantImport.php b/lib/commercetools-import/src/Models/Productvariants/ProductVariantImport.php index 62bb764d738..fd2c8c1bfa6 100644 --- a/lib/commercetools-import/src/Models/Productvariants/ProductVariantImport.php +++ b/lib/commercetools-import/src/Models/Productvariants/ProductVariantImport.php @@ -28,6 +28,7 @@ interface ProductVariantImport extends ImportResource /** *

    Maps to ProductVariant.sku.

    * + * @return null|string */ public function getSku(); @@ -35,6 +36,7 @@ public function getSku(); /** *

    Maps to ProductVariant.isMasterVariant.

    * + * @return null|bool */ public function getIsMasterVariant(); @@ -43,6 +45,7 @@ public function getIsMasterVariant(); *

    Maps to ProductVariant.attributes. * The referenced attribute must be defined in an already existing ProductType in the project, or the state of the ImportOperation will be unresolved.

    * + * @return null|AttributeCollection */ public function getAttributes(); @@ -50,6 +53,7 @@ public function getAttributes(); /** *

    Maps to ProductVariant.images.

    * + * @return null|ImageCollection */ public function getImages(); @@ -57,6 +61,7 @@ public function getImages(); /** *

    Maps to ProductVariant.assets.

    * + * @return null|AssetCollection */ public function getAssets(); @@ -66,6 +71,7 @@ public function getAssets(); * If publish is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. * However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whether publish is set or not.

    * + * @return null|bool */ public function getPublish(); @@ -75,6 +81,7 @@ public function getPublish(); * The Reference to the Product with which the ProductVariant is associated. * If referenced Product does not exist, the state of the ImportOperation will be set to unresolved until the necessary Product is created.

    * + * @return null|ProductKeyReference */ public function getProduct(); diff --git a/lib/commercetools-import/src/Models/Productvariants/ProductVariantImportBuilder.php b/lib/commercetools-import/src/Models/Productvariants/ProductVariantImportBuilder.php index 3d263d67e25..35a3f97267f 100644 --- a/lib/commercetools-import/src/Models/Productvariants/ProductVariantImportBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/ProductVariantImportBuilder.php @@ -27,46 +27,57 @@ final class ProductVariantImportBuilder implements Builder { /** + * @var ?string */ private $key; /** + * @var ?string */ private $sku; /** + * @var ?bool */ private $isMasterVariant; /** + * @var ?AttributeCollection */ private $attributes; /** + * @var ?ImageCollection */ private $images; /** + * @var ?AssetCollection */ private $assets; /** + * @var ?bool */ private $publish; /** + * @var null|ProductKeyReference|ProductKeyReferenceBuilder */ private $product; /** + *

    User-defined unique identifier.

    + * + * @return null|string */ public function getKey() @@ -77,6 +88,7 @@ public function getKey() /** *

    Maps to ProductVariant.sku.

    * + * @return null|string */ public function getSku() @@ -87,6 +99,7 @@ public function getSku() /** *

    Maps to ProductVariant.isMasterVariant.

    * + * @return null|bool */ public function getIsMasterVariant() @@ -98,6 +111,7 @@ public function getIsMasterVariant() *

    Maps to ProductVariant.attributes. * The referenced attribute must be defined in an already existing ProductType in the project, or the state of the ImportOperation will be unresolved.

    * + * @return null|AttributeCollection */ public function getAttributes() @@ -108,6 +122,7 @@ public function getAttributes() /** *

    Maps to ProductVariant.images.

    * + * @return null|ImageCollection */ public function getImages() @@ -118,6 +133,7 @@ public function getImages() /** *

    Maps to ProductVariant.assets.

    * + * @return null|AssetCollection */ public function getAssets() @@ -130,6 +146,7 @@ public function getAssets() * If publish is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. * However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whether publish is set or not.

    * + * @return null|bool */ public function getPublish() @@ -142,6 +159,7 @@ public function getPublish() * The Reference to the Product with which the ProductVariant is associated. * If referenced Product does not exist, the state of the ImportOperation will be set to unresolved until the necessary Product is created.

    * + * @return null|ProductKeyReference */ public function getProduct() diff --git a/lib/commercetools-import/src/Models/Productvariants/ProductVariantImportModel.php b/lib/commercetools-import/src/Models/Productvariants/ProductVariantImportModel.php index 6d31674be7a..26aae6213fa 100644 --- a/lib/commercetools-import/src/Models/Productvariants/ProductVariantImportModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/ProductVariantImportModel.php @@ -26,41 +26,49 @@ final class ProductVariantImportModel extends JsonObjectModel implements ProductVariantImport { /** + * * @var ?string */ protected $key; /** + * * @var ?string */ protected $sku; /** + * * @var ?bool */ protected $isMasterVariant; /** + * * @var ?AttributeCollection */ protected $attributes; /** + * * @var ?ImageCollection */ protected $images; /** + * * @var ?AssetCollection */ protected $assets; /** + * * @var ?bool */ protected $publish; /** + * * @var ?ProductKeyReference */ protected $product; @@ -90,6 +98,9 @@ public function __construct( } /** + *

    User-defined unique identifier.

    + * + * * @return null|string */ public function getKey() @@ -109,6 +120,7 @@ public function getKey() /** *

    Maps to ProductVariant.sku.

    * + * * @return null|string */ public function getSku() @@ -128,6 +140,7 @@ public function getSku() /** *

    Maps to ProductVariant.isMasterVariant.

    * + * * @return null|bool */ public function getIsMasterVariant() @@ -148,6 +161,7 @@ public function getIsMasterVariant() *

    Maps to ProductVariant.attributes. * The referenced attribute must be defined in an already existing ProductType in the project, or the state of the ImportOperation will be unresolved.

    * + * * @return null|AttributeCollection */ public function getAttributes() @@ -167,6 +181,7 @@ public function getAttributes() /** *

    Maps to ProductVariant.images.

    * + * * @return null|ImageCollection */ public function getImages() @@ -186,6 +201,7 @@ public function getImages() /** *

    Maps to ProductVariant.assets.

    * + * * @return null|AssetCollection */ public function getAssets() @@ -207,6 +223,7 @@ public function getAssets() * If publish is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. * However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whether publish is set or not.

    * + * * @return null|bool */ public function getPublish() @@ -228,6 +245,7 @@ public function getPublish() * The Reference to the Product with which the ProductVariant is associated. * If referenced Product does not exist, the state of the ImportOperation will be set to unresolved until the necessary Product is created.

    * + * * @return null|ProductKeyReference */ public function getProduct() diff --git a/lib/commercetools-import/src/Models/Productvariants/ProductVariantPatch.php b/lib/commercetools-import/src/Models/Productvariants/ProductVariantPatch.php index c9597e966c6..23e86d4d397 100644 --- a/lib/commercetools-import/src/Models/Productvariants/ProductVariantPatch.php +++ b/lib/commercetools-import/src/Models/Productvariants/ProductVariantPatch.php @@ -23,6 +23,7 @@ interface ProductVariantPatch extends JsonObject * The Reference to the ProductVariant with which the ProductVariantPatch is associated. * If referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

    * + * @return null|ProductVariantKeyReference */ public function getProductVariant(); @@ -31,6 +32,7 @@ public function getProductVariant(); *

    Maps to ProductVariant.attributes. * The referenced attribute must be defined in an already existing ProductType in the Project, or the state of the ImportOperation will be unresolved.

    * + * @return null|Attributes */ public function getAttributes(); @@ -38,6 +40,7 @@ public function getAttributes(); /** *

    If false, the attribute changes are applied to both current and staged projected representations of the Product.

    * + * @return null|bool */ public function getStaged(); diff --git a/lib/commercetools-import/src/Models/Productvariants/ProductVariantPatchBuilder.php b/lib/commercetools-import/src/Models/Productvariants/ProductVariantPatchBuilder.php index 58dd970e471..ff87a0cb15f 100644 --- a/lib/commercetools-import/src/Models/Productvariants/ProductVariantPatchBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/ProductVariantPatchBuilder.php @@ -23,16 +23,19 @@ final class ProductVariantPatchBuilder implements Builder { /** + * @var null|ProductVariantKeyReference|ProductVariantKeyReferenceBuilder */ private $productVariant; /** + * @var null|Attributes|AttributesBuilder */ private $attributes; /** + * @var ?bool */ private $staged; @@ -42,6 +45,7 @@ final class ProductVariantPatchBuilder implements Builder * The Reference to the ProductVariant with which the ProductVariantPatch is associated. * If referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

    * + * @return null|ProductVariantKeyReference */ public function getProductVariant() @@ -53,6 +57,7 @@ public function getProductVariant() *

    Maps to ProductVariant.attributes. * The referenced attribute must be defined in an already existing ProductType in the Project, or the state of the ImportOperation will be unresolved.

    * + * @return null|Attributes */ public function getAttributes() @@ -63,6 +68,7 @@ public function getAttributes() /** *

    If false, the attribute changes are applied to both current and staged projected representations of the Product.

    * + * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-import/src/Models/Productvariants/ProductVariantPatchModel.php b/lib/commercetools-import/src/Models/Productvariants/ProductVariantPatchModel.php index 2393d63ff86..e887dd222aa 100644 --- a/lib/commercetools-import/src/Models/Productvariants/ProductVariantPatchModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/ProductVariantPatchModel.php @@ -22,16 +22,19 @@ final class ProductVariantPatchModel extends JsonObjectModel implements ProductVariantPatch { /** + * * @var ?ProductVariantKeyReference */ protected $productVariant; /** + * * @var ?Attributes */ protected $attributes; /** + * * @var ?bool */ protected $staged; @@ -55,6 +58,7 @@ public function __construct( * The Reference to the ProductVariant with which the ProductVariantPatch is associated. * If referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

    * + * * @return null|ProductVariantKeyReference */ public function getProductVariant() @@ -76,6 +80,7 @@ public function getProductVariant() *

    Maps to ProductVariant.attributes. * The referenced attribute must be defined in an already existing ProductType in the Project, or the state of the ImportOperation will be unresolved.

    * + * * @return null|Attributes */ public function getAttributes() @@ -96,6 +101,7 @@ public function getAttributes() /** *

    If false, the attribute changes are applied to both current and staged projected representations of the Product.

    * + * * @return null|bool */ public function getStaged() diff --git a/lib/commercetools-import/src/Models/Productvariants/ReferenceAttribute.php b/lib/commercetools-import/src/Models/Productvariants/ReferenceAttribute.php index 030f2416b9b..8b0c0942f0b 100644 --- a/lib/commercetools-import/src/Models/Productvariants/ReferenceAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/ReferenceAttribute.php @@ -19,6 +19,7 @@ interface ReferenceAttribute extends Attribute /** *

    References a resource by key.

    * + * @return null|KeyReference */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/ReferenceAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/ReferenceAttributeBuilder.php index 5878dfe98da..ef4ed98c731 100644 --- a/lib/commercetools-import/src/Models/Productvariants/ReferenceAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/ReferenceAttributeBuilder.php @@ -23,11 +23,13 @@ final class ReferenceAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var null|KeyReference|KeyReferenceBuilder */ private $value; @@ -37,6 +39,7 @@ final class ReferenceAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -47,6 +50,7 @@ public function getName() /** *

    References a resource by key.

    * + * @return null|KeyReference */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/ReferenceAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/ReferenceAttributeModel.php index 5b59da3703c..4a62fd81f8d 100644 --- a/lib/commercetools-import/src/Models/Productvariants/ReferenceAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/ReferenceAttributeModel.php @@ -23,16 +23,19 @@ final class ReferenceAttributeModel extends JsonObjectModel implements Reference { public const DISCRIMINATOR_VALUE = 'reference'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?KeyReference */ protected $value; @@ -43,11 +46,12 @@ final class ReferenceAttributeModel extends JsonObjectModel implements Reference */ public function __construct( ?string $name = null, - ?KeyReference $value = null + ?KeyReference $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -55,6 +59,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -72,6 +77,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -91,6 +97,7 @@ public function getType() /** *

    References a resource by key.

    * + * * @return null|KeyReference */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/ReferenceSetAttribute.php b/lib/commercetools-import/src/Models/Productvariants/ReferenceSetAttribute.php index 8050a384b54..bb54b59f0fb 100644 --- a/lib/commercetools-import/src/Models/Productvariants/ReferenceSetAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/ReferenceSetAttribute.php @@ -17,6 +17,7 @@ interface ReferenceSetAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|KeyReferenceCollection */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/ReferenceSetAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/ReferenceSetAttributeBuilder.php index 61da157a004..1772ba22a2e 100644 --- a/lib/commercetools-import/src/Models/Productvariants/ReferenceSetAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/ReferenceSetAttributeBuilder.php @@ -22,11 +22,13 @@ final class ReferenceSetAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?KeyReferenceCollection */ private $value; @@ -36,6 +38,7 @@ final class ReferenceSetAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -44,6 +47,7 @@ public function getName() } /** + * @return null|KeyReferenceCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/ReferenceSetAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/ReferenceSetAttributeModel.php index 3e14517e4a9..1ffcbbadede 100644 --- a/lib/commercetools-import/src/Models/Productvariants/ReferenceSetAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/ReferenceSetAttributeModel.php @@ -22,16 +22,19 @@ final class ReferenceSetAttributeModel extends JsonObjectModel implements Refere { public const DISCRIMINATOR_VALUE = 'reference-set'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?KeyReferenceCollection */ protected $value; @@ -42,11 +45,12 @@ final class ReferenceSetAttributeModel extends JsonObjectModel implements Refere */ public function __construct( ?string $name = null, - ?KeyReferenceCollection $value = null + ?KeyReferenceCollection $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -54,6 +58,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -71,6 +76,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -88,6 +94,7 @@ public function getType() } /** + * * @return null|KeyReferenceCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/TextAttribute.php b/lib/commercetools-import/src/Models/Productvariants/TextAttribute.php index 8f71168a9a9..903324a7acf 100644 --- a/lib/commercetools-import/src/Models/Productvariants/TextAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/TextAttribute.php @@ -16,6 +16,7 @@ interface TextAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|string */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/TextAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/TextAttributeBuilder.php index 3797eb1be25..d144aec48b0 100644 --- a/lib/commercetools-import/src/Models/Productvariants/TextAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/TextAttributeBuilder.php @@ -21,11 +21,13 @@ final class TextAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?string */ private $value; @@ -35,6 +37,7 @@ final class TextAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -43,6 +46,7 @@ public function getName() } /** + * @return null|string */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/TextAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/TextAttributeModel.php index 34d7ac2133e..d1efca5c7c1 100644 --- a/lib/commercetools-import/src/Models/Productvariants/TextAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/TextAttributeModel.php @@ -21,16 +21,19 @@ final class TextAttributeModel extends JsonObjectModel implements TextAttribute { public const DISCRIMINATOR_VALUE = 'text'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?string */ protected $value; @@ -41,11 +44,12 @@ final class TextAttributeModel extends JsonObjectModel implements TextAttribute */ public function __construct( ?string $name = null, - ?string $value = null + ?string $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -53,6 +57,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -70,6 +75,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -87,6 +93,7 @@ public function getType() } /** + * * @return null|string */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/TextSetAttribute.php b/lib/commercetools-import/src/Models/Productvariants/TextSetAttribute.php index 2f8778fada4..15548ea8fb9 100644 --- a/lib/commercetools-import/src/Models/Productvariants/TextSetAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/TextSetAttribute.php @@ -16,6 +16,7 @@ interface TextSetAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|array */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/TextSetAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/TextSetAttributeBuilder.php index b43162247f5..7902f222688 100644 --- a/lib/commercetools-import/src/Models/Productvariants/TextSetAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/TextSetAttributeBuilder.php @@ -21,11 +21,13 @@ final class TextSetAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?array */ private $value; @@ -35,6 +37,7 @@ final class TextSetAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -43,6 +46,7 @@ public function getName() } /** + * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/TextSetAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/TextSetAttributeModel.php index fd1a52d9976..f76f7a6903e 100644 --- a/lib/commercetools-import/src/Models/Productvariants/TextSetAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/TextSetAttributeModel.php @@ -21,16 +21,19 @@ final class TextSetAttributeModel extends JsonObjectModel implements TextSetAttr { public const DISCRIMINATOR_VALUE = 'text-set'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?array */ protected $value; @@ -41,11 +44,12 @@ final class TextSetAttributeModel extends JsonObjectModel implements TextSetAttr */ public function __construct( ?string $name = null, - ?array $value = null + ?array $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -53,6 +57,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -70,6 +75,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -87,6 +93,7 @@ public function getType() } /** + * * @return null|array */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/TimeAttribute.php b/lib/commercetools-import/src/Models/Productvariants/TimeAttribute.php index 1c5b6e2d8d2..c97c615a58a 100644 --- a/lib/commercetools-import/src/Models/Productvariants/TimeAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/TimeAttribute.php @@ -17,6 +17,7 @@ interface TimeAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|DateTimeImmutable */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/TimeAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/TimeAttributeBuilder.php index c0fc160a1a3..1c399271e74 100644 --- a/lib/commercetools-import/src/Models/Productvariants/TimeAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/TimeAttributeBuilder.php @@ -22,11 +22,13 @@ final class TimeAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?DateTimeImmutable */ private $value; @@ -36,6 +38,7 @@ final class TimeAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -44,6 +47,7 @@ public function getName() } /** + * @return null|DateTimeImmutable */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/TimeAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/TimeAttributeModel.php index b693c48f3c4..633bfd2bfe6 100644 --- a/lib/commercetools-import/src/Models/Productvariants/TimeAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/TimeAttributeModel.php @@ -22,16 +22,19 @@ final class TimeAttributeModel extends JsonObjectModel implements TimeAttribute { public const DISCRIMINATOR_VALUE = 'time'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?DateTimeImmutable */ protected $value; @@ -42,11 +45,12 @@ final class TimeAttributeModel extends JsonObjectModel implements TimeAttribute */ public function __construct( ?string $name = null, - ?DateTimeImmutable $value = null + ?DateTimeImmutable $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -54,6 +58,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -71,6 +76,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -88,6 +94,7 @@ public function getType() } /** + * * @return null|DateTimeImmutable */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/TimeSetAttribute.php b/lib/commercetools-import/src/Models/Productvariants/TimeSetAttribute.php index 162a7c847c3..9284615d955 100644 --- a/lib/commercetools-import/src/Models/Productvariants/TimeSetAttribute.php +++ b/lib/commercetools-import/src/Models/Productvariants/TimeSetAttribute.php @@ -16,6 +16,7 @@ interface TimeSetAttribute extends Attribute public const FIELD_VALUE = 'value'; /** + * @return null|DateTimeImmutableCollection */ public function getValue(); diff --git a/lib/commercetools-import/src/Models/Productvariants/TimeSetAttributeBuilder.php b/lib/commercetools-import/src/Models/Productvariants/TimeSetAttributeBuilder.php index f4593b678af..ce23331a1e9 100644 --- a/lib/commercetools-import/src/Models/Productvariants/TimeSetAttributeBuilder.php +++ b/lib/commercetools-import/src/Models/Productvariants/TimeSetAttributeBuilder.php @@ -21,11 +21,13 @@ final class TimeSetAttributeBuilder implements Builder { /** + * @var ?string */ private $name; /** + * @var ?DateTimeImmutableCollection */ private $value; @@ -35,6 +37,7 @@ final class TimeSetAttributeBuilder implements Builder * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * @return null|string */ public function getName() @@ -43,6 +46,7 @@ public function getName() } /** + * @return null|DateTimeImmutableCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/Productvariants/TimeSetAttributeModel.php b/lib/commercetools-import/src/Models/Productvariants/TimeSetAttributeModel.php index f905ec6de64..4e3e63e2034 100644 --- a/lib/commercetools-import/src/Models/Productvariants/TimeSetAttributeModel.php +++ b/lib/commercetools-import/src/Models/Productvariants/TimeSetAttributeModel.php @@ -21,16 +21,19 @@ final class TimeSetAttributeModel extends JsonObjectModel implements TimeSetAttr { public const DISCRIMINATOR_VALUE = 'time-set'; /** + * * @var ?string */ protected $name; /** + * * @var ?string */ protected $type; /** + * * @var ?DateTimeImmutableCollection */ protected $value; @@ -41,11 +44,12 @@ final class TimeSetAttributeModel extends JsonObjectModel implements TimeSetAttr */ public function __construct( ?string $name = null, - ?DateTimeImmutableCollection $value = null + ?DateTimeImmutableCollection $value = null, + ?string $type = null ) { $this->name = $name; $this->value = $value; - $this->type = static::DISCRIMINATOR_VALUE; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; } /** @@ -53,6 +57,7 @@ public function __construct( * The name is required if this type is used in a product variant and must not be set when * used in a product variant patch.

    * + * * @return null|string */ public function getName() @@ -70,6 +75,7 @@ public function getName() } /** + * * @return null|string */ public function getType() @@ -87,6 +93,7 @@ public function getType() } /** + * * @return null|DateTimeImmutableCollection */ public function getValue() diff --git a/lib/commercetools-import/src/Models/StandalonePrices/StandalonePriceImport.php b/lib/commercetools-import/src/Models/StandalonePrices/StandalonePriceImport.php new file mode 100644 index 00000000000..fb1f6e67ca0 --- /dev/null +++ b/lib/commercetools-import/src/Models/StandalonePrices/StandalonePriceImport.php @@ -0,0 +1,177 @@ +User-defined unique identifier for the Standalone Price.

    + * + + * @return null|string + */ + public function getKey(); + + /** + *

    Specifies to which ProductVariant the API associates this Price. It is not validated to exist in product variants.

    + * + + * @return null|string + */ + public function getSku(); + + /** + *

    Sets the money value of this Price.

    + * + + * @return null|TypedMoney + */ + public function getValue(); + + /** + *

    Sets the country for which this Price is valid.

    + * + + * @return null|string + */ + public function getCountry(); + + /** + *

    Sets the CustomerGroup for which this Price is valid.

    + * + + * @return null|CustomerGroupKeyReference + */ + public function getCustomerGroup(); + + /** + *

    Sets the product distribution Channel for which this Price is valid

    + * + + * @return null|ChannelKeyReference + */ + public function getChannel(); + + /** + *

    Sets the date from which the Price is valid.

    + * + + * @return null|DateTimeImmutable + */ + public function getValidFrom(); + + /** + *

    Sets the date until the Price is valid.

    + * + + * @return null|DateTimeImmutable + */ + public function getValidUntil(); + + /** + *

    Sets price tiers.

    + * + + * @return null|PriceTierCollection + */ + public function getTiers(); + + /** + *

    Sets a discounted price for this Price that is different from the base price with value.

    + * + + * @return null|DiscountedPrice + */ + public function getDiscounted(); + + /** + *

    Custom Fields for the StandalonePrice.

    + * + + * @return null|Custom + */ + public function getCustom(); + + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + + /** + * @param ?string $sku + */ + public function setSku(?string $sku): void; + + /** + * @param ?TypedMoney $value + */ + public function setValue(?TypedMoney $value): void; + + /** + * @param ?string $country + */ + public function setCountry(?string $country): void; + + /** + * @param ?CustomerGroupKeyReference $customerGroup + */ + public function setCustomerGroup(?CustomerGroupKeyReference $customerGroup): void; + + /** + * @param ?ChannelKeyReference $channel + */ + public function setChannel(?ChannelKeyReference $channel): void; + + /** + * @param ?DateTimeImmutable $validFrom + */ + public function setValidFrom(?DateTimeImmutable $validFrom): void; + + /** + * @param ?DateTimeImmutable $validUntil + */ + public function setValidUntil(?DateTimeImmutable $validUntil): void; + + /** + * @param ?PriceTierCollection $tiers + */ + public function setTiers(?PriceTierCollection $tiers): void; + + /** + * @param ?DiscountedPrice $discounted + */ + public function setDiscounted(?DiscountedPrice $discounted): void; + + /** + * @param ?Custom $custom + */ + public function setCustom(?Custom $custom): void; +} diff --git a/lib/commercetools-import/src/Models/StandalonePrices/StandalonePriceImportBuilder.php b/lib/commercetools-import/src/Models/StandalonePrices/StandalonePriceImportBuilder.php new file mode 100644 index 00000000000..d2f9ef4112e --- /dev/null +++ b/lib/commercetools-import/src/Models/StandalonePrices/StandalonePriceImportBuilder.php @@ -0,0 +1,421 @@ + + */ +final class StandalonePriceImportBuilder implements Builder +{ + /** + + * @var ?string + */ + private $key; + + /** + + * @var ?string + */ + private $sku; + + /** + + * @var null|TypedMoney|TypedMoneyBuilder + */ + private $value; + + /** + + * @var ?string + */ + private $country; + + /** + + * @var null|CustomerGroupKeyReference|CustomerGroupKeyReferenceBuilder + */ + private $customerGroup; + + /** + + * @var null|ChannelKeyReference|ChannelKeyReferenceBuilder + */ + private $channel; + + /** + + * @var ?DateTimeImmutable + */ + private $validFrom; + + /** + + * @var ?DateTimeImmutable + */ + private $validUntil; + + /** + + * @var ?PriceTierCollection + */ + private $tiers; + + /** + + * @var null|DiscountedPrice|DiscountedPriceBuilder + */ + private $discounted; + + /** + + * @var null|Custom|CustomBuilder + */ + private $custom; + + /** + *

    User-defined unique identifier for the Standalone Price.

    + * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + *

    Specifies to which ProductVariant the API associates this Price. It is not validated to exist in product variants.

    + * + + * @return null|string + */ + public function getSku() + { + return $this->sku; + } + + /** + *

    Sets the money value of this Price.

    + * + + * @return null|TypedMoney + */ + public function getValue() + { + return $this->value instanceof TypedMoneyBuilder ? $this->value->build() : $this->value; + } + + /** + *

    Sets the country for which this Price is valid.

    + * + + * @return null|string + */ + public function getCountry() + { + return $this->country; + } + + /** + *

    Sets the CustomerGroup for which this Price is valid.

    + * + + * @return null|CustomerGroupKeyReference + */ + public function getCustomerGroup() + { + return $this->customerGroup instanceof CustomerGroupKeyReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup; + } + + /** + *

    Sets the product distribution Channel for which this Price is valid

    + * + + * @return null|ChannelKeyReference + */ + public function getChannel() + { + return $this->channel instanceof ChannelKeyReferenceBuilder ? $this->channel->build() : $this->channel; + } + + /** + *

    Sets the date from which the Price is valid.

    + * + + * @return null|DateTimeImmutable + */ + public function getValidFrom() + { + return $this->validFrom; + } + + /** + *

    Sets the date until the Price is valid.

    + * + + * @return null|DateTimeImmutable + */ + public function getValidUntil() + { + return $this->validUntil; + } + + /** + *

    Sets price tiers.

    + * + + * @return null|PriceTierCollection + */ + public function getTiers() + { + return $this->tiers; + } + + /** + *

    Sets a discounted price for this Price that is different from the base price with value.

    + * + + * @return null|DiscountedPrice + */ + public function getDiscounted() + { + return $this->discounted instanceof DiscountedPriceBuilder ? $this->discounted->build() : $this->discounted; + } + + /** + *

    Custom Fields for the StandalonePrice.

    + * + + * @return null|Custom + */ + public function getCustom() + { + return $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?string $sku + * @return $this + */ + public function withSku(?string $sku) + { + $this->sku = $sku; + + return $this; + } + + /** + * @param ?TypedMoney $value + * @return $this + */ + public function withValue(?TypedMoney $value) + { + $this->value = $value; + + return $this; + } + + /** + * @param ?string $country + * @return $this + */ + public function withCountry(?string $country) + { + $this->country = $country; + + return $this; + } + + /** + * @param ?CustomerGroupKeyReference $customerGroup + * @return $this + */ + public function withCustomerGroup(?CustomerGroupKeyReference $customerGroup) + { + $this->customerGroup = $customerGroup; + + return $this; + } + + /** + * @param ?ChannelKeyReference $channel + * @return $this + */ + public function withChannel(?ChannelKeyReference $channel) + { + $this->channel = $channel; + + return $this; + } + + /** + * @param ?DateTimeImmutable $validFrom + * @return $this + */ + public function withValidFrom(?DateTimeImmutable $validFrom) + { + $this->validFrom = $validFrom; + + return $this; + } + + /** + * @param ?DateTimeImmutable $validUntil + * @return $this + */ + public function withValidUntil(?DateTimeImmutable $validUntil) + { + $this->validUntil = $validUntil; + + return $this; + } + + /** + * @param ?PriceTierCollection $tiers + * @return $this + */ + public function withTiers(?PriceTierCollection $tiers) + { + $this->tiers = $tiers; + + return $this; + } + + /** + * @param ?DiscountedPrice $discounted + * @return $this + */ + public function withDiscounted(?DiscountedPrice $discounted) + { + $this->discounted = $discounted; + + return $this; + } + + /** + * @param ?Custom $custom + * @return $this + */ + public function withCustom(?Custom $custom) + { + $this->custom = $custom; + + return $this; + } + + /** + * @deprecated use withValue() instead + * @return $this + */ + public function withValueBuilder(?TypedMoneyBuilder $value) + { + $this->value = $value; + + return $this; + } + + /** + * @deprecated use withCustomerGroup() instead + * @return $this + */ + public function withCustomerGroupBuilder(?CustomerGroupKeyReferenceBuilder $customerGroup) + { + $this->customerGroup = $customerGroup; + + return $this; + } + + /** + * @deprecated use withChannel() instead + * @return $this + */ + public function withChannelBuilder(?ChannelKeyReferenceBuilder $channel) + { + $this->channel = $channel; + + return $this; + } + + /** + * @deprecated use withDiscounted() instead + * @return $this + */ + public function withDiscountedBuilder(?DiscountedPriceBuilder $discounted) + { + $this->discounted = $discounted; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + + public function build(): StandalonePriceImport + { + return new StandalonePriceImportModel( + $this->key, + $this->sku, + $this->value instanceof TypedMoneyBuilder ? $this->value->build() : $this->value, + $this->country, + $this->customerGroup instanceof CustomerGroupKeyReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup, + $this->channel instanceof ChannelKeyReferenceBuilder ? $this->channel->build() : $this->channel, + $this->validFrom, + $this->validUntil, + $this->tiers, + $this->discounted instanceof DiscountedPriceBuilder ? $this->discounted->build() : $this->discounted, + $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom + ); + } + + public static function of(): StandalonePriceImportBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-import/src/Models/StandalonePrices/StandalonePriceImportCollection.php b/lib/commercetools-import/src/Models/StandalonePrices/StandalonePriceImportCollection.php new file mode 100644 index 00000000000..687ab86c788 --- /dev/null +++ b/lib/commercetools-import/src/Models/StandalonePrices/StandalonePriceImportCollection.php @@ -0,0 +1,56 @@ + + * @method StandalonePriceImport current() + * @method StandalonePriceImport end() + * @method StandalonePriceImport at($offset) + */ +class StandalonePriceImportCollection extends ImportResourceCollection +{ + /** + * @psalm-assert StandalonePriceImport $value + * @psalm-param StandalonePriceImport|stdClass $value + * @throws InvalidArgumentException + * + * @return StandalonePriceImportCollection + */ + public function add($value) + { + if (!$value instanceof StandalonePriceImport) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StandalonePriceImport + */ + protected function mapper() + { + return function (?int $index): ?StandalonePriceImport { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StandalonePriceImport $data */ + $data = StandalonePriceImportModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-import/src/Models/StandalonePrices/StandalonePriceImportModel.php b/lib/commercetools-import/src/Models/StandalonePrices/StandalonePriceImportModel.php new file mode 100644 index 00000000000..6fd980eee2e --- /dev/null +++ b/lib/commercetools-import/src/Models/StandalonePrices/StandalonePriceImportModel.php @@ -0,0 +1,468 @@ +key = $key; + $this->sku = $sku; + $this->value = $value; + $this->country = $country; + $this->customerGroup = $customerGroup; + $this->channel = $channel; + $this->validFrom = $validFrom; + $this->validUntil = $validUntil; + $this->tiers = $tiers; + $this->discounted = $discounted; + $this->custom = $custom; + } + + /** + *

    User-defined unique identifier for the Standalone Price.

    + * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + *

    Specifies to which ProductVariant the API associates this Price. It is not validated to exist in product variants.

    + * + * + * @return null|string + */ + public function getSku() + { + if (is_null($this->sku)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SKU); + if (is_null($data)) { + return null; + } + $this->sku = (string) $data; + } + + return $this->sku; + } + + /** + *

    Sets the money value of this Price.

    + * + * + * @return null|TypedMoney + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $className = TypedMoneyModel::resolveDiscriminatorClass($data); + $this->value = $className::of($data); + } + + return $this->value; + } + + /** + *

    Sets the country for which this Price is valid.

    + * + * + * @return null|string + */ + public function getCountry() + { + if (is_null($this->country)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_COUNTRY); + if (is_null($data)) { + return null; + } + $this->country = (string) $data; + } + + return $this->country; + } + + /** + *

    Sets the CustomerGroup for which this Price is valid.

    + * + * + * @return null|CustomerGroupKeyReference + */ + public function getCustomerGroup() + { + if (is_null($this->customerGroup)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP); + if (is_null($data)) { + return null; + } + + $this->customerGroup = CustomerGroupKeyReferenceModel::of($data); + } + + return $this->customerGroup; + } + + /** + *

    Sets the product distribution Channel for which this Price is valid

    + * + * + * @return null|ChannelKeyReference + */ + public function getChannel() + { + if (is_null($this->channel)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CHANNEL); + if (is_null($data)) { + return null; + } + + $this->channel = ChannelKeyReferenceModel::of($data); + } + + return $this->channel; + } + + /** + *

    Sets the date from which the Price is valid.

    + * + * + * @return null|DateTimeImmutable + */ + public function getValidFrom() + { + if (is_null($this->validFrom)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_VALID_FROM); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->validFrom = $data; + } + + return $this->validFrom; + } + + /** + *

    Sets the date until the Price is valid.

    + * + * + * @return null|DateTimeImmutable + */ + public function getValidUntil() + { + if (is_null($this->validUntil)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_VALID_UNTIL); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->validUntil = $data; + } + + return $this->validUntil; + } + + /** + *

    Sets price tiers.

    + * + * + * @return null|PriceTierCollection + */ + public function getTiers() + { + if (is_null($this->tiers)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_TIERS); + if (is_null($data)) { + return null; + } + $this->tiers = PriceTierCollection::fromArray($data); + } + + return $this->tiers; + } + + /** + *

    Sets a discounted price for this Price that is different from the base price with value.

    + * + * + * @return null|DiscountedPrice + */ + public function getDiscounted() + { + if (is_null($this->discounted)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_DISCOUNTED); + if (is_null($data)) { + return null; + } + + $this->discounted = DiscountedPriceModel::of($data); + } + + return $this->discounted; + } + + /** + *

    Custom Fields for the StandalonePrice.

    + * + * + * @return null|Custom + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomModel::of($data); + } + + return $this->custom; + } + + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + + /** + * @param ?string $sku + */ + public function setSku(?string $sku): void + { + $this->sku = $sku; + } + + /** + * @param ?TypedMoney $value + */ + public function setValue(?TypedMoney $value): void + { + $this->value = $value; + } + + /** + * @param ?string $country + */ + public function setCountry(?string $country): void + { + $this->country = $country; + } + + /** + * @param ?CustomerGroupKeyReference $customerGroup + */ + public function setCustomerGroup(?CustomerGroupKeyReference $customerGroup): void + { + $this->customerGroup = $customerGroup; + } + + /** + * @param ?ChannelKeyReference $channel + */ + public function setChannel(?ChannelKeyReference $channel): void + { + $this->channel = $channel; + } + + /** + * @param ?DateTimeImmutable $validFrom + */ + public function setValidFrom(?DateTimeImmutable $validFrom): void + { + $this->validFrom = $validFrom; + } + + /** + * @param ?DateTimeImmutable $validUntil + */ + public function setValidUntil(?DateTimeImmutable $validUntil): void + { + $this->validUntil = $validUntil; + } + + /** + * @param ?PriceTierCollection $tiers + */ + public function setTiers(?PriceTierCollection $tiers): void + { + $this->tiers = $tiers; + } + + /** + * @param ?DiscountedPrice $discounted + */ + public function setDiscounted(?DiscountedPrice $discounted): void + { + $this->discounted = $discounted; + } + + /** + * @param ?Custom $custom + */ + public function setCustom(?Custom $custom): void + { + $this->custom = $custom; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[StandalonePriceImport::FIELD_VALID_FROM]) && $data[StandalonePriceImport::FIELD_VALID_FROM] instanceof \DateTimeImmutable) { + $data[StandalonePriceImport::FIELD_VALID_FROM] = $data[StandalonePriceImport::FIELD_VALID_FROM]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[StandalonePriceImport::FIELD_VALID_UNTIL]) && $data[StandalonePriceImport::FIELD_VALID_UNTIL] instanceof \DateTimeImmutable) { + $data[StandalonePriceImport::FIELD_VALID_UNTIL] = $data[StandalonePriceImport::FIELD_VALID_UNTIL]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-ml/src/Client/MlRequestBuilder.php b/lib/commercetools-ml/src/Client/MlRequestBuilder.php index a28166293f4..88e2d89f8db 100644 --- a/lib/commercetools-ml/src/Client/MlRequestBuilder.php +++ b/lib/commercetools-ml/src/Client/MlRequestBuilder.php @@ -13,6 +13,9 @@ use Commercetools\Ml\Client\Resource\ResourceByProjectKey; use GuzzleHttp\ClientInterface; +/** + * + */ class MlRequestBuilder extends ApiResource { /** diff --git a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyImageSearchConfigGet.php b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyImageSearchConfigGet.php index 8d6a23c461e..43d7425f29c 100644 --- a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyImageSearchConfigGet.php +++ b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyImageSearchConfigGet.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyImageSearchConfigPost.php b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyImageSearchConfigPost.php index c5ac908e1eb..f5ae3aeffe4 100644 --- a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyImageSearchConfigPost.php +++ b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyImageSearchConfigPost.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyImageSearchPost.php b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyImageSearchPost.php index 24e7730e9fa..7ecf74dd9fe 100644 --- a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyImageSearchPost.php +++ b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyImageSearchPost.php @@ -26,6 +26,7 @@ use Psr\Http\Message\UploadedFileInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataAttributesPost.php b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataAttributesPost.php index 2526dfce2e8..67cb2986b61 100644 --- a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataAttributesPost.php +++ b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataAttributesPost.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @deprecated * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataAttributesStatusByTaskIdGet.php b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataAttributesStatusByTaskIdGet.php index 106605d960c..866d58bdc13 100644 --- a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataAttributesStatusByTaskIdGet.php +++ b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataAttributesStatusByTaskIdGet.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @deprecated * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataImagesPost.php b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataImagesPost.php index 5a1805065e2..b1ab346668e 100644 --- a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataImagesPost.php +++ b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataImagesPost.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @deprecated * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataImagesStatusByTaskIdGet.php b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataImagesStatusByTaskIdGet.php index f2a11803057..cc67ba7af0b 100644 --- a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataImagesStatusByTaskIdGet.php +++ b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataImagesStatusByTaskIdGet.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @deprecated * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataPricesPost.php b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataPricesPost.php index 3e6837abc55..a3628a6e2f3 100644 --- a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataPricesPost.php +++ b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataPricesPost.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @deprecated * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataPricesStatusByTaskIdGet.php b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataPricesStatusByTaskIdGet.php index db636a79531..80950d1e7c2 100644 --- a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataPricesStatusByTaskIdGet.php +++ b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyMissingDataPricesStatusByTaskIdGet.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @deprecated * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyRecommendationsGeneralCategoriesGet.php b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyRecommendationsGeneralCategoriesGet.php index afffcf707b4..546ef7cd3af 100644 --- a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyRecommendationsGeneralCategoriesGet.php +++ b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyRecommendationsGeneralCategoriesGet.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyRecommendationsProjectCategoriesByProductIdGet.php b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyRecommendationsProjectCategoriesByProductIdGet.php index 697fe473dd1..73ffcd48aff 100644 --- a/lib/commercetools-ml/src/Client/Resource/ByProjectKeyRecommendationsProjectCategoriesByProductIdGet.php +++ b/lib/commercetools-ml/src/Client/Resource/ByProjectKeyRecommendationsProjectCategoriesByProductIdGet.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-ml/src/Client/Resource/ByProjectKeySimilaritiesProductsPost.php b/lib/commercetools-ml/src/Client/Resource/ByProjectKeySimilaritiesProductsPost.php index b30047c72dc..655fac40936 100644 --- a/lib/commercetools-ml/src/Client/Resource/ByProjectKeySimilaritiesProductsPost.php +++ b/lib/commercetools-ml/src/Client/Resource/ByProjectKeySimilaritiesProductsPost.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-ml/src/Client/Resource/ByProjectKeySimilaritiesProductsStatusByTaskIdGet.php b/lib/commercetools-ml/src/Client/Resource/ByProjectKeySimilaritiesProductsStatusByTaskIdGet.php index 014ee0bf600..1cfc3365232 100644 --- a/lib/commercetools-ml/src/Client/Resource/ByProjectKeySimilaritiesProductsStatusByTaskIdGet.php +++ b/lib/commercetools-ml/src/Client/Resource/ByProjectKeySimilaritiesProductsStatusByTaskIdGet.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; /** + * @psalm-suppress PropertyNotSetInConstructor * */ diff --git a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKey.php b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKey.php index eaaeca3fbbf..49a6b704f7e 100644 --- a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKey.php +++ b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKey.php @@ -42,6 +42,7 @@ public function recommendations(): ResourceByProjectKeyRecommendations return new ResourceByProjectKeyRecommendations($args, $this->getClient()); } /** + * @deprecated */ public function missingData(): ResourceByProjectKeyMissingData { diff --git a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingData.php b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingData.php index ad088ce286d..fb67148cb38 100644 --- a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingData.php +++ b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingData.php @@ -14,6 +14,7 @@ /** * @psalm-suppress PropertyNotSetInConstructor + * @deprecated */ class ResourceByProjectKeyMissingData extends ApiResource { @@ -26,6 +27,7 @@ public function __construct(array $args = [], ClientInterface $client = null) } /** + * @deprecated */ public function attributes(): ResourceByProjectKeyMissingDataAttributes { @@ -34,6 +36,7 @@ public function attributes(): ResourceByProjectKeyMissingDataAttributes return new ResourceByProjectKeyMissingDataAttributes($args, $this->getClient()); } /** + * @deprecated */ public function images(): ResourceByProjectKeyMissingDataImages { @@ -42,6 +45,7 @@ public function images(): ResourceByProjectKeyMissingDataImages return new ResourceByProjectKeyMissingDataImages($args, $this->getClient()); } /** + * @deprecated */ public function prices(): ResourceByProjectKeyMissingDataPrices { diff --git a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataAttributes.php b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataAttributes.php index 65818fdbda5..34655c25a36 100644 --- a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataAttributes.php +++ b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataAttributes.php @@ -15,6 +15,7 @@ /** * @psalm-suppress PropertyNotSetInConstructor + * @deprecated */ class ResourceByProjectKeyMissingDataAttributes extends ApiResource { @@ -27,6 +28,7 @@ public function __construct(array $args = [], ClientInterface $client = null) } /** + * @deprecated */ public function status(): ResourceByProjectKeyMissingDataAttributesStatus { @@ -38,6 +40,7 @@ public function status(): ResourceByProjectKeyMissingDataAttributesStatus /** * @psalm-param ?MissingAttributesSearchRequest $body * @psalm-param array $headers + * @deprecated */ public function post(?MissingAttributesSearchRequest $body = null, array $headers = []): ByProjectKeyMissingDataAttributesPost { diff --git a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataAttributesStatus.php b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataAttributesStatus.php index b997ded5676..ff12481fd59 100644 --- a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataAttributesStatus.php +++ b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataAttributesStatus.php @@ -14,6 +14,7 @@ /** * @psalm-suppress PropertyNotSetInConstructor + * @deprecated */ class ResourceByProjectKeyMissingDataAttributesStatus extends ApiResource { @@ -26,6 +27,7 @@ public function __construct(array $args = [], ClientInterface $client = null) } /** + * @deprecated */ public function withTaskId(string $taskId = null): ResourceByProjectKeyMissingDataAttributesStatusByTaskId { diff --git a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataAttributesStatusByTaskId.php b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataAttributesStatusByTaskId.php index 0f2d8dd0375..a76844f2aaa 100644 --- a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataAttributesStatusByTaskId.php +++ b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataAttributesStatusByTaskId.php @@ -14,6 +14,7 @@ /** * @psalm-suppress PropertyNotSetInConstructor + * @deprecated */ class ResourceByProjectKeyMissingDataAttributesStatusByTaskId extends ApiResource { @@ -28,6 +29,7 @@ public function __construct(array $args = [], ClientInterface $client = null) /** * @psalm-param ?object|array|string $body * @psalm-param array $headers + * @deprecated */ public function get($body = null, array $headers = []): ByProjectKeyMissingDataAttributesStatusByTaskIdGet { diff --git a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataImages.php b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataImages.php index 902770421cf..85db9c67e4e 100644 --- a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataImages.php +++ b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataImages.php @@ -15,6 +15,7 @@ /** * @psalm-suppress PropertyNotSetInConstructor + * @deprecated */ class ResourceByProjectKeyMissingDataImages extends ApiResource { @@ -27,6 +28,7 @@ public function __construct(array $args = [], ClientInterface $client = null) } /** + * @deprecated */ public function status(): ResourceByProjectKeyMissingDataImagesStatus { @@ -38,6 +40,7 @@ public function status(): ResourceByProjectKeyMissingDataImagesStatus /** * @psalm-param ?MissingImagesSearchRequest $body * @psalm-param array $headers + * @deprecated */ public function post(?MissingImagesSearchRequest $body = null, array $headers = []): ByProjectKeyMissingDataImagesPost { diff --git a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataImagesStatus.php b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataImagesStatus.php index 730c2d76d93..ef6b28fe0b9 100644 --- a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataImagesStatus.php +++ b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataImagesStatus.php @@ -14,6 +14,7 @@ /** * @psalm-suppress PropertyNotSetInConstructor + * @deprecated */ class ResourceByProjectKeyMissingDataImagesStatus extends ApiResource { @@ -26,6 +27,7 @@ public function __construct(array $args = [], ClientInterface $client = null) } /** + * @deprecated */ public function withTaskId(string $taskId = null): ResourceByProjectKeyMissingDataImagesStatusByTaskId { diff --git a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataImagesStatusByTaskId.php b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataImagesStatusByTaskId.php index 7f1d7cf4c42..93bf721b2fb 100644 --- a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataImagesStatusByTaskId.php +++ b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataImagesStatusByTaskId.php @@ -14,6 +14,7 @@ /** * @psalm-suppress PropertyNotSetInConstructor + * @deprecated */ class ResourceByProjectKeyMissingDataImagesStatusByTaskId extends ApiResource { @@ -28,6 +29,7 @@ public function __construct(array $args = [], ClientInterface $client = null) /** * @psalm-param ?object|array|string $body * @psalm-param array $headers + * @deprecated */ public function get($body = null, array $headers = []): ByProjectKeyMissingDataImagesStatusByTaskIdGet { diff --git a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataPrices.php b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataPrices.php index 90c149f9b45..70c38f3ea9e 100644 --- a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataPrices.php +++ b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataPrices.php @@ -15,6 +15,7 @@ /** * @psalm-suppress PropertyNotSetInConstructor + * @deprecated */ class ResourceByProjectKeyMissingDataPrices extends ApiResource { @@ -27,6 +28,7 @@ public function __construct(array $args = [], ClientInterface $client = null) } /** + * @deprecated */ public function status(): ResourceByProjectKeyMissingDataPricesStatus { @@ -38,6 +40,7 @@ public function status(): ResourceByProjectKeyMissingDataPricesStatus /** * @psalm-param ?MissingPricesSearchRequest $body * @psalm-param array $headers + * @deprecated */ public function post(?MissingPricesSearchRequest $body = null, array $headers = []): ByProjectKeyMissingDataPricesPost { diff --git a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataPricesStatus.php b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataPricesStatus.php index b552db902ac..f834085d441 100644 --- a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataPricesStatus.php +++ b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataPricesStatus.php @@ -14,6 +14,7 @@ /** * @psalm-suppress PropertyNotSetInConstructor + * @deprecated */ class ResourceByProjectKeyMissingDataPricesStatus extends ApiResource { @@ -26,6 +27,7 @@ public function __construct(array $args = [], ClientInterface $client = null) } /** + * @deprecated */ public function withTaskId(string $taskId = null): ResourceByProjectKeyMissingDataPricesStatusByTaskId { diff --git a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataPricesStatusByTaskId.php b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataPricesStatusByTaskId.php index eb09623da4c..660dcb385ee 100644 --- a/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataPricesStatusByTaskId.php +++ b/lib/commercetools-ml/src/Client/Resource/ResourceByProjectKeyMissingDataPricesStatusByTaskId.php @@ -14,6 +14,7 @@ /** * @psalm-suppress PropertyNotSetInConstructor + * @deprecated */ class ResourceByProjectKeyMissingDataPricesStatusByTaskId extends ApiResource { @@ -28,6 +29,7 @@ public function __construct(array $args = [], ClientInterface $client = null) /** * @psalm-param ?object|array|string $body * @psalm-param array $headers + * @deprecated */ public function get($body = null, array $headers = []): ByProjectKeyMissingDataPricesStatusByTaskIdGet { diff --git a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendation.php b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendation.php index b54b1993c2f..c6037f52b12 100644 --- a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendation.php +++ b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendation.php @@ -21,6 +21,7 @@ interface ProjectCategoryRecommendation extends JsonObject /** *

    A category that is recommended for a product.

    * + * @return null|CategoryReference */ public function getCategory(); @@ -28,6 +29,7 @@ public function getCategory(); /** *

    Probability score for the category recommendation.

    * + * @return null|float */ public function getConfidence(); @@ -35,6 +37,7 @@ public function getConfidence(); /** *

    Breadcrumb path to the recommended category. This only picks up one language, not all available languages for the category. English is prioritized, but if English data is not available, an arbitrary language is selected. Do not use this to identify a category,use the category ID from the category reference instead.

    * + * @return null|string */ public function getPath(); diff --git a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationBuilder.php b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationBuilder.php index cf81957e00e..73004fd4313 100644 --- a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationBuilder.php +++ b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationBuilder.php @@ -23,16 +23,19 @@ final class ProjectCategoryRecommendationBuilder implements Builder { /** + * @var null|CategoryReference|CategoryReferenceBuilder */ private $category; /** + * @var ?float */ private $confidence; /** + * @var ?string */ private $path; @@ -40,6 +43,7 @@ final class ProjectCategoryRecommendationBuilder implements Builder /** *

    A category that is recommended for a product.

    * + * @return null|CategoryReference */ public function getCategory() @@ -50,6 +54,7 @@ public function getCategory() /** *

    Probability score for the category recommendation.

    * + * @return null|float */ public function getConfidence() @@ -60,6 +65,7 @@ public function getConfidence() /** *

    Breadcrumb path to the recommended category. This only picks up one language, not all available languages for the category. English is prioritized, but if English data is not available, an arbitrary language is selected. Do not use this to identify a category,use the category ID from the category reference instead.

    * + * @return null|string */ public function getPath() diff --git a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationMeta.php b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationMeta.php index 5cf73921409..6fbc4a132d2 100644 --- a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationMeta.php +++ b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationMeta.php @@ -20,6 +20,7 @@ interface ProjectCategoryRecommendationMeta extends JsonObject /** *

    The product name that was used to generate recommendations.

    * + * @return null|string */ public function getProductName(); @@ -27,6 +28,7 @@ public function getProductName(); /** *

    The product image that was used to generate recommendations.

    * + * @return null|string */ public function getProductImageUrl(); @@ -34,6 +36,7 @@ public function getProductImageUrl(); /** *

    Top 5 general categories that were used internally to generate the project-specific categories. These category names are not related to the categories defined in the project, but they provide additional information to understand the project-specific categories in the results section.

    * + * @return null|array */ public function getGeneralCategoryNames(); diff --git a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationMetaBuilder.php b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationMetaBuilder.php index e86545debbf..0fa73ac7591 100644 --- a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationMetaBuilder.php +++ b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationMetaBuilder.php @@ -21,16 +21,19 @@ final class ProjectCategoryRecommendationMetaBuilder implements Builder { /** + * @var ?string */ private $productName; /** + * @var ?string */ private $productImageUrl; /** + * @var ?array */ private $generalCategoryNames; @@ -38,6 +41,7 @@ final class ProjectCategoryRecommendationMetaBuilder implements Builder /** *

    The product name that was used to generate recommendations.

    * + * @return null|string */ public function getProductName() @@ -48,6 +52,7 @@ public function getProductName() /** *

    The product image that was used to generate recommendations.

    * + * @return null|string */ public function getProductImageUrl() @@ -58,6 +63,7 @@ public function getProductImageUrl() /** *

    Top 5 general categories that were used internally to generate the project-specific categories. These category names are not related to the categories defined in the project, but they provide additional information to understand the project-specific categories in the results section.

    * + * @return null|array */ public function getGeneralCategoryNames() diff --git a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationMetaModel.php b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationMetaModel.php index 85af9c5463e..825ffb6c6ef 100644 --- a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationMetaModel.php +++ b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationMetaModel.php @@ -20,16 +20,19 @@ final class ProjectCategoryRecommendationMetaModel extends JsonObjectModel implements ProjectCategoryRecommendationMeta { /** + * * @var ?string */ protected $productName; /** + * * @var ?string */ protected $productImageUrl; /** + * * @var ?array */ protected $generalCategoryNames; @@ -51,6 +54,7 @@ public function __construct( /** *

    The product name that was used to generate recommendations.

    * + * * @return null|string */ public function getProductName() @@ -70,6 +74,7 @@ public function getProductName() /** *

    The product image that was used to generate recommendations.

    * + * * @return null|string */ public function getProductImageUrl() @@ -89,6 +94,7 @@ public function getProductImageUrl() /** *

    Top 5 general categories that were used internally to generate the project-specific categories. These category names are not related to the categories defined in the project, but they provide additional information to understand the project-specific categories in the results section.

    * + * * @return null|array */ public function getGeneralCategoryNames() diff --git a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationModel.php b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationModel.php index a1a20a94b38..aca6c20ed4e 100644 --- a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationModel.php +++ b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationModel.php @@ -22,16 +22,19 @@ final class ProjectCategoryRecommendationModel extends JsonObjectModel implements ProjectCategoryRecommendation { /** + * * @var ?CategoryReference */ protected $category; /** + * * @var ?float */ protected $confidence; /** + * * @var ?string */ protected $path; @@ -53,6 +56,7 @@ public function __construct( /** *

    A category that is recommended for a product.

    * + * * @return null|CategoryReference */ public function getCategory() @@ -73,6 +77,7 @@ public function getCategory() /** *

    Probability score for the category recommendation.

    * + * * @return null|float */ public function getConfidence() @@ -92,6 +97,7 @@ public function getConfidence() /** *

    Breadcrumb path to the recommended category. This only picks up one language, not all available languages for the category. English is prioritized, but if English data is not available, an arbitrary language is selected. Do not use this to identify a category,use the category ID from the category reference instead.

    * + * * @return null|string */ public function getPath() diff --git a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationPagedQueryResponse.php b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationPagedQueryResponse.php index cf1bfa7e0af..43793637334 100644 --- a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationPagedQueryResponse.php +++ b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationPagedQueryResponse.php @@ -20,11 +20,13 @@ interface ProjectCategoryRecommendationPagedQueryResponse extends JsonObject public const FIELD_META = 'meta'; /** + * @return null|int */ public function getCount(); /** + * @return null|int */ public function getTotal(); @@ -32,16 +34,19 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); /** + * @return null|ProjectCategoryRecommendationCollection */ public function getResults(); /** + * @return null|ProjectCategoryRecommendationMeta */ public function getMeta(); diff --git a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationPagedQueryResponseBuilder.php b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationPagedQueryResponseBuilder.php index 4b086cfa70a..85992bcad31 100644 --- a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationPagedQueryResponseBuilder.php +++ b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationPagedQueryResponseBuilder.php @@ -21,31 +21,37 @@ final class ProjectCategoryRecommendationPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?ProjectCategoryRecommendationCollection */ private $results; /** + * @var null|ProjectCategoryRecommendationMeta|ProjectCategoryRecommendationMetaBuilder */ private $meta; /** + * @return null|int */ public function getCount() @@ -54,6 +60,7 @@ public function getCount() } /** + * @return null|int */ public function getTotal() @@ -64,6 +71,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -72,6 +80,7 @@ public function getOffset() } /** + * @return null|ProjectCategoryRecommendationCollection */ public function getResults() @@ -80,6 +89,7 @@ public function getResults() } /** + * @return null|ProjectCategoryRecommendationMeta */ public function getMeta() diff --git a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationPagedQueryResponseModel.php b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationPagedQueryResponseModel.php index 3ed7b794d0d..8cf6f76e6c2 100644 --- a/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationPagedQueryResponseModel.php +++ b/lib/commercetools-ml/src/Models/CategoryRecommendations/ProjectCategoryRecommendationPagedQueryResponseModel.php @@ -20,26 +20,31 @@ final class ProjectCategoryRecommendationPagedQueryResponseModel extends JsonObjectModel implements ProjectCategoryRecommendationPagedQueryResponse { /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?ProjectCategoryRecommendationCollection */ protected $results; /** + * * @var ?ProjectCategoryRecommendationMeta */ protected $meta; @@ -63,6 +68,7 @@ public function __construct( } /** + * * @return null|int */ public function getCount() @@ -80,6 +86,7 @@ public function getCount() } /** + * * @return null|int */ public function getTotal() @@ -99,6 +106,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -116,6 +124,7 @@ public function getOffset() } /** + * * @return null|ProjectCategoryRecommendationCollection */ public function getResults() @@ -133,6 +142,7 @@ public function getResults() } /** + * * @return null|ProjectCategoryRecommendationMeta */ public function getMeta() diff --git a/lib/commercetools-ml/src/Models/Common/CategoryReferenceBuilder.php b/lib/commercetools-ml/src/Models/Common/CategoryReferenceBuilder.php index 610063725b2..cf329ec4099 100644 --- a/lib/commercetools-ml/src/Models/Common/CategoryReferenceBuilder.php +++ b/lib/commercetools-ml/src/Models/Common/CategoryReferenceBuilder.php @@ -21,11 +21,13 @@ final class CategoryReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @return null|string */ public function getId() diff --git a/lib/commercetools-ml/src/Models/Common/CategoryReferenceModel.php b/lib/commercetools-ml/src/Models/Common/CategoryReferenceModel.php index 63f9a1319ea..728e8f3c8d9 100644 --- a/lib/commercetools-ml/src/Models/Common/CategoryReferenceModel.php +++ b/lib/commercetools-ml/src/Models/Common/CategoryReferenceModel.php @@ -21,11 +21,13 @@ final class CategoryReferenceModel extends JsonObjectModel implements CategoryRe { public const DISCRIMINATOR_VALUE = 'category'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; @@ -35,13 +37,15 @@ final class CategoryReferenceModel extends JsonObjectModel implements CategoryRe * @psalm-suppress MissingParamType */ public function __construct( - ?string $id = null + ?string $id = null, + ?string $typeId = null ) { $this->id = $id; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getTypeId() @@ -59,6 +63,7 @@ public function getTypeId() } /** + * * @return null|string */ public function getId() diff --git a/lib/commercetools-ml/src/Models/Common/Money.php b/lib/commercetools-ml/src/Models/Common/Money.php index 5e4b103625a..f5c287c5489 100644 --- a/lib/commercetools-ml/src/Models/Common/Money.php +++ b/lib/commercetools-ml/src/Models/Common/Money.php @@ -17,6 +17,7 @@ interface Money extends JsonObject public const FIELD_CURRENCY_CODE = 'currencyCode'; /** + * @return null|int */ public function getCentAmount(); @@ -24,6 +25,7 @@ public function getCentAmount(); /** *

    The currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode(); diff --git a/lib/commercetools-ml/src/Models/Common/MoneyBuilder.php b/lib/commercetools-ml/src/Models/Common/MoneyBuilder.php index 14cb35595cc..b64afc2476f 100644 --- a/lib/commercetools-ml/src/Models/Common/MoneyBuilder.php +++ b/lib/commercetools-ml/src/Models/Common/MoneyBuilder.php @@ -21,16 +21,19 @@ final class MoneyBuilder implements Builder { /** + * @var ?int */ private $centAmount; /** + * @var ?string */ private $currencyCode; /** + * @return null|int */ public function getCentAmount() @@ -41,6 +44,7 @@ public function getCentAmount() /** *

    The currency code compliant to ISO 4217.

    * + * @return null|string */ public function getCurrencyCode() diff --git a/lib/commercetools-ml/src/Models/Common/MoneyModel.php b/lib/commercetools-ml/src/Models/Common/MoneyModel.php index cffc0909a05..2a509542eb3 100644 --- a/lib/commercetools-ml/src/Models/Common/MoneyModel.php +++ b/lib/commercetools-ml/src/Models/Common/MoneyModel.php @@ -20,11 +20,13 @@ final class MoneyModel extends JsonObjectModel implements Money { /** + * * @var ?int */ protected $centAmount; /** + * * @var ?string */ protected $currencyCode; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|int */ public function getCentAmount() @@ -61,6 +64,7 @@ public function getCentAmount() /** *

    The currency code compliant to ISO 4217.

    * + * * @return null|string */ public function getCurrencyCode() diff --git a/lib/commercetools-ml/src/Models/Common/ProductReferenceBuilder.php b/lib/commercetools-ml/src/Models/Common/ProductReferenceBuilder.php index 9d4197818b9..31fbc2d4a21 100644 --- a/lib/commercetools-ml/src/Models/Common/ProductReferenceBuilder.php +++ b/lib/commercetools-ml/src/Models/Common/ProductReferenceBuilder.php @@ -21,11 +21,13 @@ final class ProductReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @return null|string */ public function getId() diff --git a/lib/commercetools-ml/src/Models/Common/ProductReferenceModel.php b/lib/commercetools-ml/src/Models/Common/ProductReferenceModel.php index 9853b0a9218..86a69b91c76 100644 --- a/lib/commercetools-ml/src/Models/Common/ProductReferenceModel.php +++ b/lib/commercetools-ml/src/Models/Common/ProductReferenceModel.php @@ -21,11 +21,13 @@ final class ProductReferenceModel extends JsonObjectModel implements ProductRefe { public const DISCRIMINATOR_VALUE = 'product'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; @@ -35,13 +37,15 @@ final class ProductReferenceModel extends JsonObjectModel implements ProductRefe * @psalm-suppress MissingParamType */ public function __construct( - ?string $id = null + ?string $id = null, + ?string $typeId = null ) { $this->id = $id; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getTypeId() @@ -59,6 +63,7 @@ public function getTypeId() } /** + * * @return null|string */ public function getId() diff --git a/lib/commercetools-ml/src/Models/Common/ProductTypeReferenceBuilder.php b/lib/commercetools-ml/src/Models/Common/ProductTypeReferenceBuilder.php index 1a357b25897..4fa9cdeb4c3 100644 --- a/lib/commercetools-ml/src/Models/Common/ProductTypeReferenceBuilder.php +++ b/lib/commercetools-ml/src/Models/Common/ProductTypeReferenceBuilder.php @@ -21,11 +21,13 @@ final class ProductTypeReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @return null|string */ public function getId() diff --git a/lib/commercetools-ml/src/Models/Common/ProductTypeReferenceModel.php b/lib/commercetools-ml/src/Models/Common/ProductTypeReferenceModel.php index ae7cde08ee4..35590c4228d 100644 --- a/lib/commercetools-ml/src/Models/Common/ProductTypeReferenceModel.php +++ b/lib/commercetools-ml/src/Models/Common/ProductTypeReferenceModel.php @@ -21,11 +21,13 @@ final class ProductTypeReferenceModel extends JsonObjectModel implements Product { public const DISCRIMINATOR_VALUE = 'product-type'; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; @@ -35,13 +37,15 @@ final class ProductTypeReferenceModel extends JsonObjectModel implements Product * @psalm-suppress MissingParamType */ public function __construct( - ?string $id = null + ?string $id = null, + ?string $typeId = null ) { $this->id = $id; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getTypeId() @@ -59,6 +63,7 @@ public function getTypeId() } /** + * * @return null|string */ public function getId() diff --git a/lib/commercetools-ml/src/Models/Common/ProductVariant.php b/lib/commercetools-ml/src/Models/Common/ProductVariant.php index 6e072b3d496..f39d07e2a9c 100644 --- a/lib/commercetools-ml/src/Models/Common/ProductVariant.php +++ b/lib/commercetools-ml/src/Models/Common/ProductVariant.php @@ -20,6 +20,7 @@ interface ProductVariant extends JsonObject /** *

    The product that contains this variant.

    * + * @return null|ProductReference */ public function getProduct(); @@ -27,6 +28,7 @@ public function getProduct(); /** *

    The state of the product variant.

    * + * @return null|bool */ public function getStaged(); @@ -34,6 +36,7 @@ public function getStaged(); /** *

    The id of the product variant.

    * + * @return null|int */ public function getVariantId(); diff --git a/lib/commercetools-ml/src/Models/Common/ProductVariantBuilder.php b/lib/commercetools-ml/src/Models/Common/ProductVariantBuilder.php index d27999adf0a..cf47fac58a7 100644 --- a/lib/commercetools-ml/src/Models/Common/ProductVariantBuilder.php +++ b/lib/commercetools-ml/src/Models/Common/ProductVariantBuilder.php @@ -21,16 +21,19 @@ final class ProductVariantBuilder implements Builder { /** + * @var null|ProductReference|ProductReferenceBuilder */ private $product; /** + * @var ?bool */ private $staged; /** + * @var ?int */ private $variantId; @@ -38,6 +41,7 @@ final class ProductVariantBuilder implements Builder /** *

    The product that contains this variant.

    * + * @return null|ProductReference */ public function getProduct() @@ -48,6 +52,7 @@ public function getProduct() /** *

    The state of the product variant.

    * + * @return null|bool */ public function getStaged() @@ -58,6 +63,7 @@ public function getStaged() /** *

    The id of the product variant.

    * + * @return null|int */ public function getVariantId() diff --git a/lib/commercetools-ml/src/Models/Common/ProductVariantModel.php b/lib/commercetools-ml/src/Models/Common/ProductVariantModel.php index f609d4789b7..0b550e74893 100644 --- a/lib/commercetools-ml/src/Models/Common/ProductVariantModel.php +++ b/lib/commercetools-ml/src/Models/Common/ProductVariantModel.php @@ -20,16 +20,19 @@ final class ProductVariantModel extends JsonObjectModel implements ProductVariant { /** + * * @var ?ProductReference */ protected $product; /** + * * @var ?bool */ protected $staged; /** + * * @var ?int */ protected $variantId; @@ -51,6 +54,7 @@ public function __construct( /** *

    The product that contains this variant.

    * + * * @return null|ProductReference */ public function getProduct() @@ -71,6 +75,7 @@ public function getProduct() /** *

    The state of the product variant.

    * + * * @return null|bool */ public function getStaged() @@ -90,6 +95,7 @@ public function getStaged() /** *

    The id of the product variant.

    * + * * @return null|int */ public function getVariantId() diff --git a/lib/commercetools-ml/src/Models/Common/Reference.php b/lib/commercetools-ml/src/Models/Common/Reference.php index 877f5aa247c..a940d2df9f0 100644 --- a/lib/commercetools-ml/src/Models/Common/Reference.php +++ b/lib/commercetools-ml/src/Models/Common/Reference.php @@ -18,11 +18,13 @@ interface Reference extends JsonObject public const FIELD_ID = 'id'; /** + * @return null|string */ public function getTypeId(); /** + * @return null|string */ public function getId(); diff --git a/lib/commercetools-ml/src/Models/Common/ReferenceBuilder.php b/lib/commercetools-ml/src/Models/Common/ReferenceBuilder.php index 7f32eb707ac..1c6aad153a7 100644 --- a/lib/commercetools-ml/src/Models/Common/ReferenceBuilder.php +++ b/lib/commercetools-ml/src/Models/Common/ReferenceBuilder.php @@ -21,11 +21,13 @@ final class ReferenceBuilder implements Builder { /** + * @var ?string */ private $id; /** + * @return null|string */ public function getId() diff --git a/lib/commercetools-ml/src/Models/Common/ReferenceModel.php b/lib/commercetools-ml/src/Models/Common/ReferenceModel.php index f9143c09ef1..3cf9e1c99ef 100644 --- a/lib/commercetools-ml/src/Models/Common/ReferenceModel.php +++ b/lib/commercetools-ml/src/Models/Common/ReferenceModel.php @@ -21,11 +21,13 @@ final class ReferenceModel extends JsonObjectModel implements Reference { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $typeId; /** + * * @var ?string */ protected $id; @@ -44,13 +46,15 @@ final class ReferenceModel extends JsonObjectModel implements Reference * @psalm-suppress MissingParamType */ public function __construct( - ?string $id = null + ?string $id = null, + ?string $typeId = null ) { $this->id = $id; - $this->typeId = static::DISCRIMINATOR_VALUE; + $this->typeId = $typeId; } /** + * * @return null|string */ public function getTypeId() @@ -68,6 +72,7 @@ public function getTypeId() } /** + * * @return null|string */ public function getId() diff --git a/lib/commercetools-ml/src/Models/Common/TaskToken.php b/lib/commercetools-ml/src/Models/Common/TaskToken.php index 9e6f04360ae..dc21ce445be 100644 --- a/lib/commercetools-ml/src/Models/Common/TaskToken.php +++ b/lib/commercetools-ml/src/Models/Common/TaskToken.php @@ -19,6 +19,7 @@ interface TaskToken extends JsonObject /** *

    The ID for the task. Used to find the status of the task.

    * + * @return null|string */ public function getTaskId(); @@ -26,6 +27,7 @@ public function getTaskId(); /** *

    The URI path to poll for the status of the task.

    * + * @return null|string */ public function getUriPath(); diff --git a/lib/commercetools-ml/src/Models/Common/TaskTokenBuilder.php b/lib/commercetools-ml/src/Models/Common/TaskTokenBuilder.php index 631b7df8da4..bc4397ba997 100644 --- a/lib/commercetools-ml/src/Models/Common/TaskTokenBuilder.php +++ b/lib/commercetools-ml/src/Models/Common/TaskTokenBuilder.php @@ -21,11 +21,13 @@ final class TaskTokenBuilder implements Builder { /** + * @var ?string */ private $taskId; /** + * @var ?string */ private $uriPath; @@ -33,6 +35,7 @@ final class TaskTokenBuilder implements Builder /** *

    The ID for the task. Used to find the status of the task.

    * + * @return null|string */ public function getTaskId() @@ -43,6 +46,7 @@ public function getTaskId() /** *

    The URI path to poll for the status of the task.

    * + * @return null|string */ public function getUriPath() diff --git a/lib/commercetools-ml/src/Models/Common/TaskTokenModel.php b/lib/commercetools-ml/src/Models/Common/TaskTokenModel.php index 47781a2442b..02b6fe0f4ec 100644 --- a/lib/commercetools-ml/src/Models/Common/TaskTokenModel.php +++ b/lib/commercetools-ml/src/Models/Common/TaskTokenModel.php @@ -20,11 +20,13 @@ final class TaskTokenModel extends JsonObjectModel implements TaskToken { /** + * * @var ?string */ protected $taskId; /** + * * @var ?string */ protected $uriPath; @@ -44,6 +46,7 @@ public function __construct( /** *

    The ID for the task. Used to find the status of the task.

    * + * * @return null|string */ public function getTaskId() @@ -63,6 +66,7 @@ public function getTaskId() /** *

    The URI path to poll for the status of the task.

    * + * * @return null|string */ public function getUriPath() diff --git a/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendation.php b/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendation.php index c56aa1b1d36..9a28f593cf3 100644 --- a/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendation.php +++ b/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendation.php @@ -19,6 +19,7 @@ interface GeneralCategoryRecommendation extends JsonObject /** *

    An English category name that is recommended for a product.

    * + * @return null|string */ public function getCategoryName(); @@ -26,6 +27,7 @@ public function getCategoryName(); /** *

    Probability score for the category recommendation.

    * + * @return null|float */ public function getConfidence(); diff --git a/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationBuilder.php b/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationBuilder.php index 396e93a6c35..e9417a365af 100644 --- a/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationBuilder.php +++ b/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationBuilder.php @@ -21,11 +21,13 @@ final class GeneralCategoryRecommendationBuilder implements Builder { /** + * @var ?string */ private $categoryName; /** + * @var ?float */ private $confidence; @@ -33,6 +35,7 @@ final class GeneralCategoryRecommendationBuilder implements Builder /** *

    An English category name that is recommended for a product.

    * + * @return null|string */ public function getCategoryName() @@ -43,6 +46,7 @@ public function getCategoryName() /** *

    Probability score for the category recommendation.

    * + * @return null|float */ public function getConfidence() diff --git a/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationModel.php b/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationModel.php index e8583cfec68..aa98b75b6b5 100644 --- a/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationModel.php +++ b/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationModel.php @@ -20,11 +20,13 @@ final class GeneralCategoryRecommendationModel extends JsonObjectModel implements GeneralCategoryRecommendation { /** + * * @var ?string */ protected $categoryName; /** + * * @var ?float */ protected $confidence; @@ -44,6 +46,7 @@ public function __construct( /** *

    An English category name that is recommended for a product.

    * + * * @return null|string */ public function getCategoryName() @@ -63,6 +66,7 @@ public function getCategoryName() /** *

    Probability score for the category recommendation.

    * + * * @return null|float */ public function getConfidence() diff --git a/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationPagedQueryResponse.php b/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationPagedQueryResponse.php index 002fa5940c8..4332ecc3cf0 100644 --- a/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationPagedQueryResponse.php +++ b/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationPagedQueryResponse.php @@ -19,11 +19,13 @@ interface GeneralCategoryRecommendationPagedQueryResponse extends JsonObject public const FIELD_RESULTS = 'results'; /** + * @return null|int */ public function getCount(); /** + * @return null|int */ public function getTotal(); @@ -31,11 +33,13 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); /** + * @return null|GeneralCategoryRecommendationCollection */ public function getResults(); diff --git a/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationPagedQueryResponseBuilder.php b/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationPagedQueryResponseBuilder.php index 7b9126ce3fb..eebf8c50f5d 100644 --- a/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationPagedQueryResponseBuilder.php +++ b/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationPagedQueryResponseBuilder.php @@ -21,26 +21,31 @@ final class GeneralCategoryRecommendationPagedQueryResponseBuilder implements Builder { /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?GeneralCategoryRecommendationCollection */ private $results; /** + * @return null|int */ public function getCount() @@ -49,6 +54,7 @@ public function getCount() } /** + * @return null|int */ public function getTotal() @@ -59,6 +65,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -67,6 +74,7 @@ public function getOffset() } /** + * @return null|GeneralCategoryRecommendationCollection */ public function getResults() diff --git a/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationPagedQueryResponseModel.php b/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationPagedQueryResponseModel.php index 391c5bfaa84..636ebf7d5d7 100644 --- a/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationPagedQueryResponseModel.php +++ b/lib/commercetools-ml/src/Models/GeneralCategoryRecommendations/GeneralCategoryRecommendationPagedQueryResponseModel.php @@ -20,21 +20,25 @@ final class GeneralCategoryRecommendationPagedQueryResponseModel extends JsonObjectModel implements GeneralCategoryRecommendationPagedQueryResponse { /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?GeneralCategoryRecommendationCollection */ protected $results; @@ -56,6 +60,7 @@ public function __construct( } /** + * * @return null|int */ public function getCount() @@ -73,6 +78,7 @@ public function getCount() } /** + * * @return null|int */ public function getTotal() @@ -92,6 +98,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -109,6 +116,7 @@ public function getOffset() } /** + * * @return null|GeneralCategoryRecommendationCollection */ public function getResults() diff --git a/lib/commercetools-ml/src/Models/ImageSearch/ImageSearchResponse.php b/lib/commercetools-ml/src/Models/ImageSearch/ImageSearchResponse.php index cb43f26b14a..4ccbbfe05f3 100644 --- a/lib/commercetools-ml/src/Models/ImageSearch/ImageSearchResponse.php +++ b/lib/commercetools-ml/src/Models/ImageSearch/ImageSearchResponse.php @@ -21,6 +21,7 @@ interface ImageSearchResponse extends JsonObject /** *

    The maximum number of results to return from a query.

    * + * @return null|int */ public function getCount(); @@ -28,6 +29,7 @@ public function getCount(); /** *

    Number of elements skipped.

    * + * @return null|float */ public function getOffset(); @@ -35,6 +37,7 @@ public function getOffset(); /** *

    The total number of product images that were have been analyzed.

    * + * @return null|int */ public function getTotal(); @@ -42,6 +45,7 @@ public function getTotal(); /** *

    An array of image URLs of images that are similar to the query image. If no matching images are found, results is empty.

    * + * @return null|ResultItemCollection */ public function getResults(); diff --git a/lib/commercetools-ml/src/Models/ImageSearch/ImageSearchResponseBuilder.php b/lib/commercetools-ml/src/Models/ImageSearch/ImageSearchResponseBuilder.php index ee0b5f5537b..c34930a6cd2 100644 --- a/lib/commercetools-ml/src/Models/ImageSearch/ImageSearchResponseBuilder.php +++ b/lib/commercetools-ml/src/Models/ImageSearch/ImageSearchResponseBuilder.php @@ -21,21 +21,25 @@ final class ImageSearchResponseBuilder implements Builder { /** + * @var ?int */ private $count; /** + * @var ?float */ private $offset; /** + * @var ?int */ private $total; /** + * @var ?ResultItemCollection */ private $results; @@ -43,6 +47,7 @@ final class ImageSearchResponseBuilder implements Builder /** *

    The maximum number of results to return from a query.

    * + * @return null|int */ public function getCount() @@ -53,6 +58,7 @@ public function getCount() /** *

    Number of elements skipped.

    * + * @return null|float */ public function getOffset() @@ -63,6 +69,7 @@ public function getOffset() /** *

    The total number of product images that were have been analyzed.

    * + * @return null|int */ public function getTotal() @@ -73,6 +80,7 @@ public function getTotal() /** *

    An array of image URLs of images that are similar to the query image. If no matching images are found, results is empty.

    * + * @return null|ResultItemCollection */ public function getResults() diff --git a/lib/commercetools-ml/src/Models/ImageSearch/ImageSearchResponseModel.php b/lib/commercetools-ml/src/Models/ImageSearch/ImageSearchResponseModel.php index 88b95c01d41..a4fda1e20a6 100644 --- a/lib/commercetools-ml/src/Models/ImageSearch/ImageSearchResponseModel.php +++ b/lib/commercetools-ml/src/Models/ImageSearch/ImageSearchResponseModel.php @@ -20,21 +20,25 @@ final class ImageSearchResponseModel extends JsonObjectModel implements ImageSearchResponse { /** + * * @var ?int */ protected $count; /** + * * @var ?float */ protected $offset; /** + * * @var ?int */ protected $total; /** + * * @var ?ResultItemCollection */ protected $results; @@ -58,6 +62,7 @@ public function __construct( /** *

    The maximum number of results to return from a query.

    * + * * @return null|int */ public function getCount() @@ -77,6 +82,7 @@ public function getCount() /** *

    Number of elements skipped.

    * + * * @return null|float */ public function getOffset() @@ -96,6 +102,7 @@ public function getOffset() /** *

    The total number of product images that were have been analyzed.

    * + * * @return null|int */ public function getTotal() @@ -115,6 +122,7 @@ public function getTotal() /** *

    An array of image URLs of images that are similar to the query image. If no matching images are found, results is empty.

    * + * * @return null|ResultItemCollection */ public function getResults() diff --git a/lib/commercetools-ml/src/Models/ImageSearch/ResultItem.php b/lib/commercetools-ml/src/Models/ImageSearch/ResultItem.php index b277a6366b1..9d8f9d5bcf4 100644 --- a/lib/commercetools-ml/src/Models/ImageSearch/ResultItem.php +++ b/lib/commercetools-ml/src/Models/ImageSearch/ResultItem.php @@ -20,6 +20,7 @@ interface ResultItem extends JsonObject /** *

    The URL of the image.

    * + * @return null|string */ public function getImageUrl(); @@ -27,6 +28,7 @@ public function getImageUrl(); /** *

    An array of product variants containing the image URL.

    * + * @return null|ProductVariantCollection */ public function getProductVariants(); diff --git a/lib/commercetools-ml/src/Models/ImageSearch/ResultItemBuilder.php b/lib/commercetools-ml/src/Models/ImageSearch/ResultItemBuilder.php index 6c6ea76b8a5..12368bb5485 100644 --- a/lib/commercetools-ml/src/Models/ImageSearch/ResultItemBuilder.php +++ b/lib/commercetools-ml/src/Models/ImageSearch/ResultItemBuilder.php @@ -22,11 +22,13 @@ final class ResultItemBuilder implements Builder { /** + * @var ?string */ private $imageUrl; /** + * @var ?ProductVariantCollection */ private $productVariants; @@ -34,6 +36,7 @@ final class ResultItemBuilder implements Builder /** *

    The URL of the image.

    * + * @return null|string */ public function getImageUrl() @@ -44,6 +47,7 @@ public function getImageUrl() /** *

    An array of product variants containing the image URL.

    * + * @return null|ProductVariantCollection */ public function getProductVariants() diff --git a/lib/commercetools-ml/src/Models/ImageSearch/ResultItemModel.php b/lib/commercetools-ml/src/Models/ImageSearch/ResultItemModel.php index 449c912839a..5019e217076 100644 --- a/lib/commercetools-ml/src/Models/ImageSearch/ResultItemModel.php +++ b/lib/commercetools-ml/src/Models/ImageSearch/ResultItemModel.php @@ -21,11 +21,13 @@ final class ResultItemModel extends JsonObjectModel implements ResultItem { /** + * * @var ?string */ protected $imageUrl; /** + * * @var ?ProductVariantCollection */ protected $productVariants; @@ -45,6 +47,7 @@ public function __construct( /** *

    The URL of the image.

    * + * * @return null|string */ public function getImageUrl() @@ -64,6 +67,7 @@ public function getImageUrl() /** *

    An array of product variants containing the image URL.

    * + * * @return null|ProductVariantCollection */ public function getProductVariants() diff --git a/lib/commercetools-ml/src/Models/ImageSearchConfig/ChangeStatusUpdateAction.php b/lib/commercetools-ml/src/Models/ImageSearchConfig/ChangeStatusUpdateAction.php index b98217c0b9b..989eae570a8 100644 --- a/lib/commercetools-ml/src/Models/ImageSearchConfig/ChangeStatusUpdateAction.php +++ b/lib/commercetools-ml/src/Models/ImageSearchConfig/ChangeStatusUpdateAction.php @@ -16,6 +16,7 @@ interface ChangeStatusUpdateAction extends ImageSearchConfigUpdateAction public const FIELD_STATUS = 'status'; /** + * @return null|string */ public function getStatus(); diff --git a/lib/commercetools-ml/src/Models/ImageSearchConfig/ChangeStatusUpdateActionBuilder.php b/lib/commercetools-ml/src/Models/ImageSearchConfig/ChangeStatusUpdateActionBuilder.php index 92433ce9d48..047c4b02a3d 100644 --- a/lib/commercetools-ml/src/Models/ImageSearchConfig/ChangeStatusUpdateActionBuilder.php +++ b/lib/commercetools-ml/src/Models/ImageSearchConfig/ChangeStatusUpdateActionBuilder.php @@ -21,11 +21,13 @@ final class ChangeStatusUpdateActionBuilder implements Builder { /** + * @var ?string */ private $status; /** + * @return null|string */ public function getStatus() diff --git a/lib/commercetools-ml/src/Models/ImageSearchConfig/ChangeStatusUpdateActionModel.php b/lib/commercetools-ml/src/Models/ImageSearchConfig/ChangeStatusUpdateActionModel.php index 0db38cb71d8..a961cfd57cb 100644 --- a/lib/commercetools-ml/src/Models/ImageSearchConfig/ChangeStatusUpdateActionModel.php +++ b/lib/commercetools-ml/src/Models/ImageSearchConfig/ChangeStatusUpdateActionModel.php @@ -21,11 +21,13 @@ final class ChangeStatusUpdateActionModel extends JsonObjectModel implements Cha { public const DISCRIMINATOR_VALUE = 'changeStatus'; /** + * * @var ?string */ protected $action; /** + * * @var ?string */ protected $status; @@ -35,13 +37,15 @@ final class ChangeStatusUpdateActionModel extends JsonObjectModel implements Cha * @psalm-suppress MissingParamType */ public function __construct( - ?string $status = null + ?string $status = null, + ?string $action = null ) { $this->status = $status; - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; } /** + * * @return null|string */ public function getAction() @@ -59,6 +63,7 @@ public function getAction() } /** + * * @return null|string */ public function getStatus() diff --git a/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigRequest.php b/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigRequest.php index 7f7a0f2f1bf..dcfb4bde3a0 100644 --- a/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigRequest.php +++ b/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigRequest.php @@ -18,6 +18,7 @@ interface ImageSearchConfigRequest extends JsonObject /** *

    The list of update actions to be performed on the project.

    * + * @return null|ImageSearchConfigUpdateActionCollection */ public function getActions(); diff --git a/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigRequestBuilder.php b/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigRequestBuilder.php index fa82169d54a..59bf75d762f 100644 --- a/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigRequestBuilder.php +++ b/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigRequestBuilder.php @@ -21,6 +21,7 @@ final class ImageSearchConfigRequestBuilder implements Builder { /** + * @var ?ImageSearchConfigUpdateActionCollection */ private $actions; @@ -28,6 +29,7 @@ final class ImageSearchConfigRequestBuilder implements Builder /** *

    The list of update actions to be performed on the project.

    * + * @return null|ImageSearchConfigUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigRequestModel.php b/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigRequestModel.php index 0731f672e45..cd88cd6f116 100644 --- a/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigRequestModel.php +++ b/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigRequestModel.php @@ -20,6 +20,7 @@ final class ImageSearchConfigRequestModel extends JsonObjectModel implements ImageSearchConfigRequest { /** + * * @var ?ImageSearchConfigUpdateActionCollection */ protected $actions; @@ -37,6 +38,7 @@ public function __construct( /** *

    The list of update actions to be performed on the project.

    * + * * @return null|ImageSearchConfigUpdateActionCollection */ public function getActions() diff --git a/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigResponse.php b/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigResponse.php index 64f1f185cfc..8be1b839898 100644 --- a/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigResponse.php +++ b/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigResponse.php @@ -20,11 +20,13 @@ interface ImageSearchConfigResponse extends JsonObject /** *

    The image search activation status.

    * + * @return null|string */ public function getStatus(); /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt(); diff --git a/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigResponseBuilder.php b/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigResponseBuilder.php index dcdccf8ce43..f283a5e6693 100644 --- a/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigResponseBuilder.php +++ b/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigResponseBuilder.php @@ -22,11 +22,13 @@ final class ImageSearchConfigResponseBuilder implements Builder { /** + * @var ?string */ private $status; /** + * @var ?DateTimeImmutable */ private $lastModifiedAt; @@ -34,6 +36,7 @@ final class ImageSearchConfigResponseBuilder implements Builder /** *

    The image search activation status.

    * + * @return null|string */ public function getStatus() @@ -42,6 +45,7 @@ public function getStatus() } /** + * @return null|DateTimeImmutable */ public function getLastModifiedAt() diff --git a/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigResponseModel.php b/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigResponseModel.php index e324fa0d62c..e701d9519f9 100644 --- a/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigResponseModel.php +++ b/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigResponseModel.php @@ -21,11 +21,13 @@ final class ImageSearchConfigResponseModel extends JsonObjectModel implements ImageSearchConfigResponse { /** + * * @var ?string */ protected $status; /** + * * @var ?DateTimeImmutable */ protected $lastModifiedAt; @@ -45,6 +47,7 @@ public function __construct( /** *

    The image search activation status.

    * + * * @return null|string */ public function getStatus() @@ -62,6 +65,7 @@ public function getStatus() } /** + * * @return null|DateTimeImmutable */ public function getLastModifiedAt() diff --git a/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigUpdateAction.php b/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigUpdateAction.php index 7e757e62ac4..4211129c31e 100644 --- a/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigUpdateAction.php +++ b/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigUpdateAction.php @@ -17,6 +17,7 @@ interface ImageSearchConfigUpdateAction extends JsonObject public const FIELD_ACTION = 'action'; /** + * @return null|string */ public function getAction(); diff --git a/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigUpdateActionModel.php b/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigUpdateActionModel.php index bbdf758a5a6..5e79e5fbcbd 100644 --- a/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigUpdateActionModel.php +++ b/lib/commercetools-ml/src/Models/ImageSearchConfig/ImageSearchConfigUpdateActionModel.php @@ -21,6 +21,7 @@ final class ImageSearchConfigUpdateActionModel extends JsonObjectModel implement { public const DISCRIMINATOR_VALUE = ''; /** + * * @var ?string */ protected $action; @@ -37,11 +38,13 @@ final class ImageSearchConfigUpdateActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( + ?string $action = null ) { - $this->action = static::DISCRIMINATOR_VALUE; + $this->action = $action; } /** + * * @return null|string */ public function getAction() diff --git a/lib/commercetools-ml/src/Models/MissingData/AttributeCount.php b/lib/commercetools-ml/src/Models/MissingData/AttributeCount.php index 28a7577f147..a9c4d1c0beb 100644 --- a/lib/commercetools-ml/src/Models/MissingData/AttributeCount.php +++ b/lib/commercetools-ml/src/Models/MissingData/AttributeCount.php @@ -20,6 +20,7 @@ interface AttributeCount extends JsonObject /** *

    Number of attributes defined in the product type.

    * + * @return null|int */ public function getProductTypeAttributes(); @@ -27,6 +28,7 @@ public function getProductTypeAttributes(); /** *

    Number of attributes defined in the variant.

    * + * @return null|int */ public function getVariantAttributes(); @@ -34,6 +36,7 @@ public function getVariantAttributes(); /** *

    Number of attributes missing values in the variant.

    * + * @return null|int */ public function getMissingAttributeValues(); diff --git a/lib/commercetools-ml/src/Models/MissingData/AttributeCountBuilder.php b/lib/commercetools-ml/src/Models/MissingData/AttributeCountBuilder.php index 11952060dbd..0645fb1cf97 100644 --- a/lib/commercetools-ml/src/Models/MissingData/AttributeCountBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/AttributeCountBuilder.php @@ -21,16 +21,19 @@ final class AttributeCountBuilder implements Builder { /** + * @var ?int */ private $productTypeAttributes; /** + * @var ?int */ private $variantAttributes; /** + * @var ?int */ private $missingAttributeValues; @@ -38,6 +41,7 @@ final class AttributeCountBuilder implements Builder /** *

    Number of attributes defined in the product type.

    * + * @return null|int */ public function getProductTypeAttributes() @@ -48,6 +52,7 @@ public function getProductTypeAttributes() /** *

    Number of attributes defined in the variant.

    * + * @return null|int */ public function getVariantAttributes() @@ -58,6 +63,7 @@ public function getVariantAttributes() /** *

    Number of attributes missing values in the variant.

    * + * @return null|int */ public function getMissingAttributeValues() diff --git a/lib/commercetools-ml/src/Models/MissingData/AttributeCountModel.php b/lib/commercetools-ml/src/Models/MissingData/AttributeCountModel.php index e0793460583..fb0bcef9f2e 100644 --- a/lib/commercetools-ml/src/Models/MissingData/AttributeCountModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/AttributeCountModel.php @@ -20,16 +20,19 @@ final class AttributeCountModel extends JsonObjectModel implements AttributeCount { /** + * * @var ?int */ protected $productTypeAttributes; /** + * * @var ?int */ protected $variantAttributes; /** + * * @var ?int */ protected $missingAttributeValues; @@ -51,6 +54,7 @@ public function __construct( /** *

    Number of attributes defined in the product type.

    * + * * @return null|int */ public function getProductTypeAttributes() @@ -70,6 +74,7 @@ public function getProductTypeAttributes() /** *

    Number of attributes defined in the variant.

    * + * * @return null|int */ public function getVariantAttributes() @@ -89,6 +94,7 @@ public function getVariantAttributes() /** *

    Number of attributes missing values in the variant.

    * + * * @return null|int */ public function getMissingAttributeValues() diff --git a/lib/commercetools-ml/src/Models/MissingData/AttributeCoverage.php b/lib/commercetools-ml/src/Models/MissingData/AttributeCoverage.php index d240fbd1b48..172f19d4dad 100644 --- a/lib/commercetools-ml/src/Models/MissingData/AttributeCoverage.php +++ b/lib/commercetools-ml/src/Models/MissingData/AttributeCoverage.php @@ -19,6 +19,7 @@ interface AttributeCoverage extends JsonObject /** *

    The percentage of attributes from the product type defined in the product variant. A value of 1.0 indicates a product variant contains all attributes defined in the product type.

    * + * @return null|float */ public function getNames(); @@ -26,6 +27,7 @@ public function getNames(); /** *

    Represents the percentage of attributes in the product variant that contain values.

    * + * @return null|float */ public function getValues(); diff --git a/lib/commercetools-ml/src/Models/MissingData/AttributeCoverageBuilder.php b/lib/commercetools-ml/src/Models/MissingData/AttributeCoverageBuilder.php index 4796a2d17ea..8f38bef742c 100644 --- a/lib/commercetools-ml/src/Models/MissingData/AttributeCoverageBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/AttributeCoverageBuilder.php @@ -21,11 +21,13 @@ final class AttributeCoverageBuilder implements Builder { /** + * @var ?float */ private $names; /** + * @var ?float */ private $values; @@ -33,6 +35,7 @@ final class AttributeCoverageBuilder implements Builder /** *

    The percentage of attributes from the product type defined in the product variant. A value of 1.0 indicates a product variant contains all attributes defined in the product type.

    * + * @return null|float */ public function getNames() @@ -43,6 +46,7 @@ public function getNames() /** *

    Represents the percentage of attributes in the product variant that contain values.

    * + * @return null|float */ public function getValues() diff --git a/lib/commercetools-ml/src/Models/MissingData/AttributeCoverageModel.php b/lib/commercetools-ml/src/Models/MissingData/AttributeCoverageModel.php index 5fa7e47b30f..d32c26cd507 100644 --- a/lib/commercetools-ml/src/Models/MissingData/AttributeCoverageModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/AttributeCoverageModel.php @@ -20,11 +20,13 @@ final class AttributeCoverageModel extends JsonObjectModel implements AttributeCoverage { /** + * * @var ?float */ protected $names; /** + * * @var ?float */ protected $values; @@ -44,6 +46,7 @@ public function __construct( /** *

    The percentage of attributes from the product type defined in the product variant. A value of 1.0 indicates a product variant contains all attributes defined in the product type.

    * + * * @return null|float */ public function getNames() @@ -63,6 +66,7 @@ public function getNames() /** *

    Represents the percentage of attributes in the product variant that contain values.

    * + * * @return null|float */ public function getValues() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingAttributes.php b/lib/commercetools-ml/src/Models/MissingData/MissingAttributes.php index 6ede107cd33..359d552687c 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingAttributes.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingAttributes.php @@ -24,11 +24,13 @@ interface MissingAttributes extends JsonObject public const FIELD_ATTRIBUTE_COVERAGE = 'attributeCoverage'; /** + * @return null|ProductReference */ public function getProduct(); /** + * @return null|ProductTypeReference */ public function getProductType(); @@ -36,6 +38,7 @@ public function getProductType(); /** *

    ID of a ProductVariant.

    * + * @return null|int */ public function getVariantId(); @@ -43,6 +46,7 @@ public function getVariantId(); /** *

    The names of the attributes of the product type that the variant is missing, sorted by attribute importance in descending order.

    * + * @return null|array */ public function getMissingAttributeValues(); @@ -50,16 +54,19 @@ public function getMissingAttributeValues(); /** *

    The names of the attributes of the product type that the variant is missing, sorted by attribute importance in descending order.

    * + * @return null|array */ public function getMissingAttributeNames(); /** + * @deprecated * @return null|AttributeCount */ public function getAttributeCount(); /** + * @deprecated * @return null|AttributeCoverage */ public function getAttributeCoverage(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesBuilder.php index e7fd30032bc..e698052b757 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesBuilder.php @@ -25,41 +25,49 @@ final class MissingAttributesBuilder implements Builder { /** + * @var null|ProductReference|ProductReferenceBuilder */ private $product; /** + * @var null|ProductTypeReference|ProductTypeReferenceBuilder */ private $productType; /** + * @var ?int */ private $variantId; /** + * @var ?array */ private $missingAttributeValues; /** + * @var ?array */ private $missingAttributeNames; /** + * @deprecated * @var null|AttributeCount|AttributeCountBuilder */ private $attributeCount; /** + * @deprecated * @var null|AttributeCoverage|AttributeCoverageBuilder */ private $attributeCoverage; /** + * @return null|ProductReference */ public function getProduct() @@ -68,6 +76,7 @@ public function getProduct() } /** + * @return null|ProductTypeReference */ public function getProductType() @@ -78,6 +87,7 @@ public function getProductType() /** *

    ID of a ProductVariant.

    * + * @return null|int */ public function getVariantId() @@ -88,6 +98,7 @@ public function getVariantId() /** *

    The names of the attributes of the product type that the variant is missing, sorted by attribute importance in descending order.

    * + * @return null|array */ public function getMissingAttributeValues() @@ -98,6 +109,7 @@ public function getMissingAttributeValues() /** *

    The names of the attributes of the product type that the variant is missing, sorted by attribute importance in descending order.

    * + * @return null|array */ public function getMissingAttributeNames() @@ -106,6 +118,7 @@ public function getMissingAttributeNames() } /** + * @deprecated * @return null|AttributeCount */ public function getAttributeCount() @@ -114,6 +127,7 @@ public function getAttributeCount() } /** + * @deprecated * @return null|AttributeCoverage */ public function getAttributeCoverage() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesDetails.php b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesDetails.php index 8e4eab4309f..70ac3974468 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesDetails.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesDetails.php @@ -20,6 +20,7 @@ interface MissingAttributesDetails extends JsonObject /** *

    Number of products scanned.

    * + * @return null|int */ public function getTotal(); @@ -27,6 +28,7 @@ public function getTotal(); /** *

    Number of products missing attribute names.

    * + * @return null|int */ public function getMissingAttributeNames(); @@ -34,6 +36,7 @@ public function getMissingAttributeNames(); /** *

    Number of products missing attribute values.

    * + * @return null|int */ public function getMissingAttributeValues(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesDetailsBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesDetailsBuilder.php index cede505e200..f923937d111 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesDetailsBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesDetailsBuilder.php @@ -21,16 +21,19 @@ final class MissingAttributesDetailsBuilder implements Builder { /** + * @var ?int */ private $total; /** + * @var ?int */ private $missingAttributeNames; /** + * @var ?int */ private $missingAttributeValues; @@ -38,6 +41,7 @@ final class MissingAttributesDetailsBuilder implements Builder /** *

    Number of products scanned.

    * + * @return null|int */ public function getTotal() @@ -48,6 +52,7 @@ public function getTotal() /** *

    Number of products missing attribute names.

    * + * @return null|int */ public function getMissingAttributeNames() @@ -58,6 +63,7 @@ public function getMissingAttributeNames() /** *

    Number of products missing attribute values.

    * + * @return null|int */ public function getMissingAttributeValues() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesDetailsModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesDetailsModel.php index d86a80ff452..785a797acbc 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesDetailsModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesDetailsModel.php @@ -20,16 +20,19 @@ final class MissingAttributesDetailsModel extends JsonObjectModel implements MissingAttributesDetails { /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $missingAttributeNames; /** + * * @var ?int */ protected $missingAttributeValues; @@ -51,6 +54,7 @@ public function __construct( /** *

    Number of products scanned.

    * + * * @return null|int */ public function getTotal() @@ -70,6 +74,7 @@ public function getTotal() /** *

    Number of products missing attribute names.

    * + * * @return null|int */ public function getMissingAttributeNames() @@ -89,6 +94,7 @@ public function getMissingAttributeNames() /** *

    Number of products missing attribute values.

    * + * * @return null|int */ public function getMissingAttributeValues() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesMeta.php b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesMeta.php index 6d95f96492c..124a2f63f6f 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesMeta.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesMeta.php @@ -18,11 +18,13 @@ interface MissingAttributesMeta extends JsonObject public const FIELD_PRODUCT_TYPE_IDS = 'productTypeIds'; /** + * @deprecated * @return null|MissingAttributesDetails */ public function getProductLevel(); /** + * @deprecated * @return null|MissingAttributesDetails */ public function getVariantLevel(); @@ -30,6 +32,7 @@ public function getVariantLevel(); /** *

    The IDs of the product types containing the requested attributeName.

    * + * @return null|array */ public function getProductTypeIds(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesMetaBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesMetaBuilder.php index 00a4f556511..edb1c607e71 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesMetaBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesMetaBuilder.php @@ -21,21 +21,25 @@ final class MissingAttributesMetaBuilder implements Builder { /** + * @deprecated * @var null|MissingAttributesDetails|MissingAttributesDetailsBuilder */ private $productLevel; /** + * @deprecated * @var null|MissingAttributesDetails|MissingAttributesDetailsBuilder */ private $variantLevel; /** + * @var ?array */ private $productTypeIds; /** + * @deprecated * @return null|MissingAttributesDetails */ public function getProductLevel() @@ -44,6 +48,7 @@ public function getProductLevel() } /** + * @deprecated * @return null|MissingAttributesDetails */ public function getVariantLevel() @@ -54,6 +59,7 @@ public function getVariantLevel() /** *

    The IDs of the product types containing the requested attributeName.

    * + * @return null|array */ public function getProductTypeIds() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesMetaModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesMetaModel.php index 34c46ccace3..81a2ca19713 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesMetaModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesMetaModel.php @@ -20,16 +20,19 @@ final class MissingAttributesMetaModel extends JsonObjectModel implements MissingAttributesMeta { /** + * @deprecated * @var ?MissingAttributesDetails */ protected $productLevel; /** + * @deprecated * @var ?MissingAttributesDetails */ protected $variantLevel; /** + * * @var ?array */ protected $productTypeIds; @@ -49,6 +52,7 @@ public function __construct( } /** + * @deprecated * @return null|MissingAttributesDetails */ public function getProductLevel() @@ -67,6 +71,7 @@ public function getProductLevel() } /** + * @deprecated * @return null|MissingAttributesDetails */ public function getVariantLevel() @@ -87,6 +92,7 @@ public function getVariantLevel() /** *

    The IDs of the product types containing the requested attributeName.

    * + * * @return null|array */ public function getProductTypeIds() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesModel.php index 386a42110df..59a91f37b31 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesModel.php @@ -24,36 +24,43 @@ final class MissingAttributesModel extends JsonObjectModel implements MissingAttributes { /** + * * @var ?ProductReference */ protected $product; /** + * * @var ?ProductTypeReference */ protected $productType; /** + * * @var ?int */ protected $variantId; /** + * * @var ?array */ protected $missingAttributeValues; /** + * * @var ?array */ protected $missingAttributeNames; /** + * @deprecated * @var ?AttributeCount */ protected $attributeCount; /** + * @deprecated * @var ?AttributeCoverage */ protected $attributeCoverage; @@ -81,6 +88,7 @@ public function __construct( } /** + * * @return null|ProductReference */ public function getProduct() @@ -99,6 +107,7 @@ public function getProduct() } /** + * * @return null|ProductTypeReference */ public function getProductType() @@ -119,6 +128,7 @@ public function getProductType() /** *

    ID of a ProductVariant.

    * + * * @return null|int */ public function getVariantId() @@ -138,6 +148,7 @@ public function getVariantId() /** *

    The names of the attributes of the product type that the variant is missing, sorted by attribute importance in descending order.

    * + * * @return null|array */ public function getMissingAttributeValues() @@ -157,6 +168,7 @@ public function getMissingAttributeValues() /** *

    The names of the attributes of the product type that the variant is missing, sorted by attribute importance in descending order.

    * + * * @return null|array */ public function getMissingAttributeNames() @@ -174,6 +186,7 @@ public function getMissingAttributeNames() } /** + * @deprecated * @return null|AttributeCount */ public function getAttributeCount() @@ -192,6 +205,7 @@ public function getAttributeCount() } /** + * @deprecated * @return null|AttributeCoverage */ public function getAttributeCoverage() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesPagedQueryResult.php b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesPagedQueryResult.php index 6adf74119ed..0e132ec385e 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesPagedQueryResult.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesPagedQueryResult.php @@ -20,11 +20,13 @@ interface MissingAttributesPagedQueryResult extends JsonObject public const FIELD_META = 'meta'; /** + * @return null|int */ public function getCount(); /** + * @return null|int */ public function getTotal(); @@ -32,16 +34,19 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); /** + * @return null|MissingAttributesCollection */ public function getResults(); /** + * @deprecated * @return null|MissingAttributesMeta */ public function getMeta(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesPagedQueryResultBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesPagedQueryResultBuilder.php index e186812fee9..bafd0682540 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesPagedQueryResultBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesPagedQueryResultBuilder.php @@ -21,31 +21,37 @@ final class MissingAttributesPagedQueryResultBuilder implements Builder { /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?MissingAttributesCollection */ private $results; /** + * @deprecated * @var null|MissingAttributesMeta|MissingAttributesMetaBuilder */ private $meta; /** + * @return null|int */ public function getCount() @@ -54,6 +60,7 @@ public function getCount() } /** + * @return null|int */ public function getTotal() @@ -64,6 +71,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -72,6 +80,7 @@ public function getOffset() } /** + * @return null|MissingAttributesCollection */ public function getResults() @@ -80,6 +89,7 @@ public function getResults() } /** + * @deprecated * @return null|MissingAttributesMeta */ public function getMeta() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesPagedQueryResultModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesPagedQueryResultModel.php index 345bcd5f45f..fb720da5a00 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesPagedQueryResultModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesPagedQueryResultModel.php @@ -20,26 +20,31 @@ final class MissingAttributesPagedQueryResultModel extends JsonObjectModel implements MissingAttributesPagedQueryResult { /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?MissingAttributesCollection */ protected $results; /** + * @deprecated * @var ?MissingAttributesMeta */ protected $meta; @@ -63,6 +68,7 @@ public function __construct( } /** + * * @return null|int */ public function getCount() @@ -80,6 +86,7 @@ public function getCount() } /** + * * @return null|int */ public function getTotal() @@ -99,6 +106,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -116,6 +124,7 @@ public function getOffset() } /** + * * @return null|MissingAttributesCollection */ public function getResults() @@ -133,6 +142,7 @@ public function getResults() } /** + * @deprecated * @return null|MissingAttributesMeta */ public function getMeta() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesSearchRequest.php b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesSearchRequest.php index 98423033161..810d8723c43 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesSearchRequest.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesSearchRequest.php @@ -29,6 +29,7 @@ interface MissingAttributesSearchRequest extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -36,6 +37,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -43,6 +45,7 @@ public function getOffset(); /** *

    If true, searches data from staged products in addition to published products.

    * + * @return null|bool */ public function getStaged(); @@ -50,6 +53,7 @@ public function getStaged(); /** *

    Maximum number of products to scan.

    * + * @return null|int */ public function getProductSetLimit(); @@ -57,6 +61,7 @@ public function getProductSetLimit(); /** *

    If true, searches all product variants. If false, only searches master variants.

    * + * @return null|bool */ public function getIncludeVariants(); @@ -64,6 +69,7 @@ public function getIncludeVariants(); /** *

    Minimum attribute coverage of variants to display, applied to both coverage types.

    * + * @return null|float */ public function getCoverageMin(); @@ -71,6 +77,7 @@ public function getCoverageMin(); /** *

    Maximum attribute coverage of variants to display, applied to both coverage types.

    * + * @return null|float */ public function getCoverageMax(); @@ -79,6 +86,7 @@ public function getCoverageMax(); *

    Default value: coverageAttributeValues - Allowed values: [coverageAttributeValues, coverageAttributeNames] * coverageAttributeValues shows the product variants with the most missing attribute values first and coverageAttributeNames the ones with the most missing attribute names.

    * + * @return null|string */ public function getSortBy(); @@ -86,6 +94,7 @@ public function getSortBy(); /** *

    If true, the missingAttributeNames will be included in the results.

    * + * @return null|bool */ public function getShowMissingAttributeNames(); @@ -94,6 +103,7 @@ public function getShowMissingAttributeNames(); *

    Filters results by the provided Product IDs. * Cannot be applied in combination with any other filter.

    * + * @return null|array */ public function getProductIds(); @@ -102,6 +112,7 @@ public function getProductIds(); *

    Filters results by the provided product type IDs. * Cannot be applied in combination with any other filter.

    * + * @return null|array */ public function getProductTypeIds(); @@ -110,6 +121,7 @@ public function getProductTypeIds(); *

    Filters results by the provided attribute name. If provided, products are only checked for this attribute. Therefore, only products of product types which define the attribute name are considered. These product type IDs * are then listed in MissingAttributesMeta. The attributeCount and attributeCoverage fields are not part of the response when using this filter. Cannot be applied in combination with any other filter.

    * + * @return null|string */ public function getAttributeName(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesSearchRequestBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesSearchRequestBuilder.php index 6fe7c3c24b5..17ebd85b8f5 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesSearchRequestBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesSearchRequestBuilder.php @@ -21,61 +21,73 @@ final class MissingAttributesSearchRequestBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?bool */ private $staged; /** + * @var ?int */ private $productSetLimit; /** + * @var ?bool */ private $includeVariants; /** + * @var ?float */ private $coverageMin; /** + * @var ?float */ private $coverageMax; /** + * @var ?string */ private $sortBy; /** + * @var ?bool */ private $showMissingAttributeNames; /** + * @var ?array */ private $productIds; /** + * @var ?array */ private $productTypeIds; /** + * @var ?string */ private $attributeName; @@ -83,6 +95,7 @@ final class MissingAttributesSearchRequestBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -93,6 +106,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -103,6 +117,7 @@ public function getOffset() /** *

    If true, searches data from staged products in addition to published products.

    * + * @return null|bool */ public function getStaged() @@ -113,6 +128,7 @@ public function getStaged() /** *

    Maximum number of products to scan.

    * + * @return null|int */ public function getProductSetLimit() @@ -123,6 +139,7 @@ public function getProductSetLimit() /** *

    If true, searches all product variants. If false, only searches master variants.

    * + * @return null|bool */ public function getIncludeVariants() @@ -133,6 +150,7 @@ public function getIncludeVariants() /** *

    Minimum attribute coverage of variants to display, applied to both coverage types.

    * + * @return null|float */ public function getCoverageMin() @@ -143,6 +161,7 @@ public function getCoverageMin() /** *

    Maximum attribute coverage of variants to display, applied to both coverage types.

    * + * @return null|float */ public function getCoverageMax() @@ -154,6 +173,7 @@ public function getCoverageMax() *

    Default value: coverageAttributeValues - Allowed values: [coverageAttributeValues, coverageAttributeNames] * coverageAttributeValues shows the product variants with the most missing attribute values first and coverageAttributeNames the ones with the most missing attribute names.

    * + * @return null|string */ public function getSortBy() @@ -164,6 +184,7 @@ public function getSortBy() /** *

    If true, the missingAttributeNames will be included in the results.

    * + * @return null|bool */ public function getShowMissingAttributeNames() @@ -175,6 +196,7 @@ public function getShowMissingAttributeNames() *

    Filters results by the provided Product IDs. * Cannot be applied in combination with any other filter.

    * + * @return null|array */ public function getProductIds() @@ -186,6 +208,7 @@ public function getProductIds() *

    Filters results by the provided product type IDs. * Cannot be applied in combination with any other filter.

    * + * @return null|array */ public function getProductTypeIds() @@ -197,6 +220,7 @@ public function getProductTypeIds() *

    Filters results by the provided attribute name. If provided, products are only checked for this attribute. Therefore, only products of product types which define the attribute name are considered. These product type IDs * are then listed in MissingAttributesMeta. The attributeCount and attributeCoverage fields are not part of the response when using this filter. Cannot be applied in combination with any other filter.

    * + * @return null|string */ public function getAttributeName() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesSearchRequestModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesSearchRequestModel.php index 2f2300c1b05..3f8d9fcb61d 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingAttributesSearchRequestModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingAttributesSearchRequestModel.php @@ -20,61 +20,73 @@ final class MissingAttributesSearchRequestModel extends JsonObjectModel implements MissingAttributesSearchRequest { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?bool */ protected $staged; /** + * * @var ?int */ protected $productSetLimit; /** + * * @var ?bool */ protected $includeVariants; /** + * * @var ?float */ protected $coverageMin; /** + * * @var ?float */ protected $coverageMax; /** + * * @var ?string */ protected $sortBy; /** + * * @var ?bool */ protected $showMissingAttributeNames; /** + * * @var ?array */ protected $productIds; /** + * * @var ?array */ protected $productTypeIds; /** + * * @var ?string */ protected $attributeName; @@ -114,6 +126,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -133,6 +146,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -152,6 +166,7 @@ public function getOffset() /** *

    If true, searches data from staged products in addition to published products.

    * + * * @return null|bool */ public function getStaged() @@ -171,6 +186,7 @@ public function getStaged() /** *

    Maximum number of products to scan.

    * + * * @return null|int */ public function getProductSetLimit() @@ -190,6 +206,7 @@ public function getProductSetLimit() /** *

    If true, searches all product variants. If false, only searches master variants.

    * + * * @return null|bool */ public function getIncludeVariants() @@ -209,6 +226,7 @@ public function getIncludeVariants() /** *

    Minimum attribute coverage of variants to display, applied to both coverage types.

    * + * * @return null|float */ public function getCoverageMin() @@ -228,6 +246,7 @@ public function getCoverageMin() /** *

    Maximum attribute coverage of variants to display, applied to both coverage types.

    * + * * @return null|float */ public function getCoverageMax() @@ -248,6 +267,7 @@ public function getCoverageMax() *

    Default value: coverageAttributeValues - Allowed values: [coverageAttributeValues, coverageAttributeNames] * coverageAttributeValues shows the product variants with the most missing attribute values first and coverageAttributeNames the ones with the most missing attribute names.

    * + * * @return null|string */ public function getSortBy() @@ -267,6 +287,7 @@ public function getSortBy() /** *

    If true, the missingAttributeNames will be included in the results.

    * + * * @return null|bool */ public function getShowMissingAttributeNames() @@ -287,6 +308,7 @@ public function getShowMissingAttributeNames() *

    Filters results by the provided Product IDs. * Cannot be applied in combination with any other filter.

    * + * * @return null|array */ public function getProductIds() @@ -307,6 +329,7 @@ public function getProductIds() *

    Filters results by the provided product type IDs. * Cannot be applied in combination with any other filter.

    * + * * @return null|array */ public function getProductTypeIds() @@ -327,6 +350,7 @@ public function getProductTypeIds() *

    Filters results by the provided attribute name. If provided, products are only checked for this attribute. Therefore, only products of product types which define the attribute name are considered. These product type IDs * are then listed in MissingAttributesMeta. The attributeCount and attributeCoverage fields are not part of the response when using this filter. Cannot be applied in combination with any other filter.

    * + * * @return null|string */ public function getAttributeName() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingDataTaskStatus.php b/lib/commercetools-ml/src/Models/MissingData/MissingDataTaskStatus.php index 048e31180ef..50e196f3132 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingDataTaskStatus.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingDataTaskStatus.php @@ -19,6 +19,7 @@ interface MissingDataTaskStatus extends JsonObject public const FIELD_RESULT = 'result'; /** + * @return null|string */ public function getState(); @@ -26,6 +27,7 @@ public function getState(); /** *

    The expiry date of the result. You cannot access the result after the expiry date. Default: 1 day after the result first becomes available. This is only available when the TaskStatus state is SUCCESS.

    * + * @return null|DateTimeImmutable */ public function getExpires(); @@ -33,6 +35,7 @@ public function getExpires(); /** *

    The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is SUCCESS.

    * + * @deprecated * @return null|MissingAttributesPagedQueryResult */ public function getResult(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingDataTaskStatusBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingDataTaskStatusBuilder.php index 6bff58b5891..048ee913282 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingDataTaskStatusBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingDataTaskStatusBuilder.php @@ -22,21 +22,25 @@ final class MissingDataTaskStatusBuilder implements Builder { /** + * @var ?string */ private $state; /** + * @var ?DateTimeImmutable */ private $expires; /** + * @deprecated * @var null|MissingAttributesPagedQueryResult|MissingAttributesPagedQueryResultBuilder */ private $result; /** + * @return null|string */ public function getState() @@ -47,6 +51,7 @@ public function getState() /** *

    The expiry date of the result. You cannot access the result after the expiry date. Default: 1 day after the result first becomes available. This is only available when the TaskStatus state is SUCCESS.

    * + * @return null|DateTimeImmutable */ public function getExpires() @@ -57,6 +62,7 @@ public function getExpires() /** *

    The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is SUCCESS.

    * + * @deprecated * @return null|MissingAttributesPagedQueryResult */ public function getResult() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingDataTaskStatusModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingDataTaskStatusModel.php index a72fbec08e8..86979a07677 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingDataTaskStatusModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingDataTaskStatusModel.php @@ -21,16 +21,19 @@ final class MissingDataTaskStatusModel extends JsonObjectModel implements MissingDataTaskStatus { /** + * * @var ?string */ protected $state; /** + * * @var ?DateTimeImmutable */ protected $expires; /** + * @deprecated * @var ?MissingAttributesPagedQueryResult */ protected $result; @@ -50,6 +53,7 @@ public function __construct( } /** + * * @return null|string */ public function getState() @@ -69,6 +73,7 @@ public function getState() /** *

    The expiry date of the result. You cannot access the result after the expiry date. Default: 1 day after the result first becomes available. This is only available when the TaskStatus state is SUCCESS.

    * + * * @return null|DateTimeImmutable */ public function getExpires() @@ -92,6 +97,7 @@ public function getExpires() /** *

    The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is SUCCESS.

    * + * @deprecated * @return null|MissingAttributesPagedQueryResult */ public function getResult() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImages.php b/lib/commercetools-ml/src/Models/MissingData/MissingImages.php index 2b6deb313ef..5a9e9d75e12 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImages.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImages.php @@ -19,6 +19,7 @@ interface MissingImages extends JsonObject public const FIELD_IMAGE_COUNT = 'imageCount'; /** + * @return null|ProductReference */ public function getProduct(); @@ -26,6 +27,7 @@ public function getProduct(); /** *

    ID of the variant

    * + * @return null|int */ public function getVariantId(); @@ -33,6 +35,7 @@ public function getVariantId(); /** *

    Number of images the variant contains.

    * + * @return null|int */ public function getImageCount(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesBuilder.php index 84ad6222ee4..0347cb945fb 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesBuilder.php @@ -23,21 +23,25 @@ final class MissingImagesBuilder implements Builder { /** + * @var null|ProductReference|ProductReferenceBuilder */ private $product; /** + * @var ?int */ private $variantId; /** + * @var ?int */ private $imageCount; /** + * @return null|ProductReference */ public function getProduct() @@ -48,6 +52,7 @@ public function getProduct() /** *

    ID of the variant

    * + * @return null|int */ public function getVariantId() @@ -58,6 +63,7 @@ public function getVariantId() /** *

    Number of images the variant contains.

    * + * @return null|int */ public function getImageCount() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesCount.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesCount.php index 98d1f62e1f8..a2064611640 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesCount.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesCount.php @@ -17,6 +17,7 @@ interface MissingImagesCount extends JsonObject public const FIELD_TOTAL = 'total'; /** + * @return null|int */ public function getMissingImages(); @@ -24,6 +25,7 @@ public function getMissingImages(); /** *

    Number of products scanned.

    * + * @return null|int */ public function getTotal(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesCountBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesCountBuilder.php index 3e1410dc815..83de0b823db 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesCountBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesCountBuilder.php @@ -21,16 +21,19 @@ final class MissingImagesCountBuilder implements Builder { /** + * @var ?int */ private $missingImages; /** + * @var ?int */ private $total; /** + * @return null|int */ public function getMissingImages() @@ -41,6 +44,7 @@ public function getMissingImages() /** *

    Number of products scanned.

    * + * @return null|int */ public function getTotal() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesCountModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesCountModel.php index 0d3f0399b46..928089b867f 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesCountModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesCountModel.php @@ -20,11 +20,13 @@ final class MissingImagesCountModel extends JsonObjectModel implements MissingImagesCount { /** + * * @var ?int */ protected $missingImages; /** + * * @var ?int */ protected $total; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|int */ public function getMissingImages() @@ -61,6 +64,7 @@ public function getMissingImages() /** *

    Number of products scanned.

    * + * * @return null|int */ public function getTotal() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesMeta.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesMeta.php index 4f8955eff0d..eecef7c2a16 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesMeta.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesMeta.php @@ -18,11 +18,13 @@ interface MissingImagesMeta extends JsonObject public const FIELD_THRESHOLD = 'threshold'; /** + * @deprecated * @return null|MissingImagesProductLevel */ public function getProductLevel(); /** + * @deprecated * @return null|MissingImagesVariantLevel */ public function getVariantLevel(); @@ -30,6 +32,7 @@ public function getVariantLevel(); /** *

    The minimum number of images a product variant must have. Anything below this value is considered a product variant with missing images.

    * + * @return null|int */ public function getThreshold(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesMetaBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesMetaBuilder.php index c93fd8c3d83..3b0a2846579 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesMetaBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesMetaBuilder.php @@ -21,21 +21,25 @@ final class MissingImagesMetaBuilder implements Builder { /** + * @deprecated * @var null|MissingImagesProductLevel|MissingImagesProductLevelBuilder */ private $productLevel; /** + * @deprecated * @var null|MissingImagesVariantLevel|MissingImagesVariantLevelBuilder */ private $variantLevel; /** + * @var ?int */ private $threshold; /** + * @deprecated * @return null|MissingImagesProductLevel */ public function getProductLevel() @@ -44,6 +48,7 @@ public function getProductLevel() } /** + * @deprecated * @return null|MissingImagesVariantLevel */ public function getVariantLevel() @@ -54,6 +59,7 @@ public function getVariantLevel() /** *

    The minimum number of images a product variant must have. Anything below this value is considered a product variant with missing images.

    * + * @return null|int */ public function getThreshold() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesMetaModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesMetaModel.php index 3f20b4f5c92..9a4d35a21f2 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesMetaModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesMetaModel.php @@ -20,16 +20,19 @@ final class MissingImagesMetaModel extends JsonObjectModel implements MissingImagesMeta { /** + * @deprecated * @var ?MissingImagesProductLevel */ protected $productLevel; /** + * @deprecated * @var ?MissingImagesVariantLevel */ protected $variantLevel; /** + * * @var ?int */ protected $threshold; @@ -49,6 +52,7 @@ public function __construct( } /** + * @deprecated * @return null|MissingImagesProductLevel */ public function getProductLevel() @@ -67,6 +71,7 @@ public function getProductLevel() } /** + * @deprecated * @return null|MissingImagesVariantLevel */ public function getVariantLevel() @@ -87,6 +92,7 @@ public function getVariantLevel() /** *

    The minimum number of images a product variant must have. Anything below this value is considered a product variant with missing images.

    * + * * @return null|int */ public function getThreshold() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesModel.php index 02d76af009a..08075a985fe 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesModel.php @@ -22,16 +22,19 @@ final class MissingImagesModel extends JsonObjectModel implements MissingImages { /** + * * @var ?ProductReference */ protected $product; /** + * * @var ?int */ protected $variantId; /** + * * @var ?int */ protected $imageCount; @@ -51,6 +54,7 @@ public function __construct( } /** + * * @return null|ProductReference */ public function getProduct() @@ -71,6 +75,7 @@ public function getProduct() /** *

    ID of the variant

    * + * * @return null|int */ public function getVariantId() @@ -90,6 +95,7 @@ public function getVariantId() /** *

    Number of images the variant contains.

    * + * * @return null|int */ public function getImageCount() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesPagedQueryResult.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesPagedQueryResult.php index ea540ed85ca..ed7133adb74 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesPagedQueryResult.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesPagedQueryResult.php @@ -20,11 +20,13 @@ interface MissingImagesPagedQueryResult extends JsonObject public const FIELD_META = 'meta'; /** + * @return null|int */ public function getCount(); /** + * @return null|int */ public function getTotal(); @@ -32,16 +34,19 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); /** + * @return null|MissingImagesCollection */ public function getResults(); /** + * @deprecated * @return null|MissingImagesMeta */ public function getMeta(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesPagedQueryResultBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesPagedQueryResultBuilder.php index 69c7b3e38fe..e6a0ea1cc8c 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesPagedQueryResultBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesPagedQueryResultBuilder.php @@ -21,31 +21,37 @@ final class MissingImagesPagedQueryResultBuilder implements Builder { /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?MissingImagesCollection */ private $results; /** + * @deprecated * @var null|MissingImagesMeta|MissingImagesMetaBuilder */ private $meta; /** + * @return null|int */ public function getCount() @@ -54,6 +60,7 @@ public function getCount() } /** + * @return null|int */ public function getTotal() @@ -64,6 +71,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -72,6 +80,7 @@ public function getOffset() } /** + * @return null|MissingImagesCollection */ public function getResults() @@ -80,6 +89,7 @@ public function getResults() } /** + * @deprecated * @return null|MissingImagesMeta */ public function getMeta() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesPagedQueryResultModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesPagedQueryResultModel.php index 9d4dc3b0753..f6b437a9c22 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesPagedQueryResultModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesPagedQueryResultModel.php @@ -20,26 +20,31 @@ final class MissingImagesPagedQueryResultModel extends JsonObjectModel implements MissingImagesPagedQueryResult { /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?MissingImagesCollection */ protected $results; /** + * @deprecated * @var ?MissingImagesMeta */ protected $meta; @@ -63,6 +68,7 @@ public function __construct( } /** + * * @return null|int */ public function getCount() @@ -80,6 +86,7 @@ public function getCount() } /** + * * @return null|int */ public function getTotal() @@ -99,6 +106,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -116,6 +124,7 @@ public function getOffset() } /** + * * @return null|MissingImagesCollection */ public function getResults() @@ -133,6 +142,7 @@ public function getResults() } /** + * @deprecated * @return null|MissingImagesMeta */ public function getMeta() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesProductLevel.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesProductLevel.php index 75dbc782e2c..9615188c1dc 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesProductLevel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesProductLevel.php @@ -16,6 +16,7 @@ interface MissingImagesProductLevel extends MissingImagesCount /** *

    Number of products missing images.

    * + * @return null|int */ public function getMissingImages(); @@ -23,6 +24,7 @@ public function getMissingImages(); /** *

    Number of products scanned.

    * + * @return null|int */ public function getTotal(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesProductLevelBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesProductLevelBuilder.php index 299951f7407..b407802dacd 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesProductLevelBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesProductLevelBuilder.php @@ -21,11 +21,13 @@ final class MissingImagesProductLevelBuilder implements Builder { /** + * @var ?int */ private $missingImages; /** + * @var ?int */ private $total; @@ -33,6 +35,7 @@ final class MissingImagesProductLevelBuilder implements Builder /** *

    Number of products missing images.

    * + * @return null|int */ public function getMissingImages() @@ -43,6 +46,7 @@ public function getMissingImages() /** *

    Number of products scanned.

    * + * @return null|int */ public function getTotal() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesProductLevelModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesProductLevelModel.php index 4c2e43d21b2..6b75c128555 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesProductLevelModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesProductLevelModel.php @@ -20,11 +20,13 @@ final class MissingImagesProductLevelModel extends JsonObjectModel implements MissingImagesProductLevel { /** + * * @var ?int */ protected $missingImages; /** + * * @var ?int */ protected $total; @@ -44,6 +46,7 @@ public function __construct( /** *

    Number of products missing images.

    * + * * @return null|int */ public function getMissingImages() @@ -63,6 +66,7 @@ public function getMissingImages() /** *

    Number of products scanned.

    * + * * @return null|int */ public function getTotal() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesSearchRequest.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesSearchRequest.php index 7032f9f103a..28484135b64 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesSearchRequest.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesSearchRequest.php @@ -26,6 +26,7 @@ interface MissingImagesSearchRequest extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -33,6 +34,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -40,6 +42,7 @@ public function getOffset(); /** *

    If true, searches data from staged products in addition to published products.

    * + * @return null|bool */ public function getStaged(); @@ -47,6 +50,7 @@ public function getStaged(); /** *

    Maximum number of products to scan.

    * + * @return null|int */ public function getProductSetLimit(); @@ -54,6 +58,7 @@ public function getProductSetLimit(); /** *

    If true, searches all product variants. If false, only searches master variants.

    * + * @return null|bool */ public function getIncludeVariants(); @@ -61,6 +66,7 @@ public function getIncludeVariants(); /** *

    If true, uses the median number of images per product variant as a threshold value.

    * + * @return null|bool */ public function getAutoThreshold(); @@ -68,6 +74,7 @@ public function getAutoThreshold(); /** *

    The minimum number of images a product variant must have. Anything below this value is considered a product variant with missing images.

    * + * @return null|int */ public function getThreshold(); @@ -75,6 +82,7 @@ public function getThreshold(); /** *

    Filters results by the provided Product IDs. Cannot be applied in combination with any other filter.

    * + * @return null|array */ public function getProductIds(); @@ -82,6 +90,7 @@ public function getProductIds(); /** *

    Filters results by the provided product type IDs. It cannot be applied in combination with any other filter.

    * + * @return null|array */ public function getProductTypeIds(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesSearchRequestBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesSearchRequestBuilder.php index d4f6209fa16..48a8d2fd7fb 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesSearchRequestBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesSearchRequestBuilder.php @@ -21,46 +21,55 @@ final class MissingImagesSearchRequestBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?bool */ private $staged; /** + * @var ?int */ private $productSetLimit; /** + * @var ?bool */ private $includeVariants; /** + * @var ?bool */ private $autoThreshold; /** + * @var ?int */ private $threshold; /** + * @var ?array */ private $productIds; /** + * @var ?array */ private $productTypeIds; @@ -68,6 +77,7 @@ final class MissingImagesSearchRequestBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -78,6 +88,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -88,6 +99,7 @@ public function getOffset() /** *

    If true, searches data from staged products in addition to published products.

    * + * @return null|bool */ public function getStaged() @@ -98,6 +110,7 @@ public function getStaged() /** *

    Maximum number of products to scan.

    * + * @return null|int */ public function getProductSetLimit() @@ -108,6 +121,7 @@ public function getProductSetLimit() /** *

    If true, searches all product variants. If false, only searches master variants.

    * + * @return null|bool */ public function getIncludeVariants() @@ -118,6 +132,7 @@ public function getIncludeVariants() /** *

    If true, uses the median number of images per product variant as a threshold value.

    * + * @return null|bool */ public function getAutoThreshold() @@ -128,6 +143,7 @@ public function getAutoThreshold() /** *

    The minimum number of images a product variant must have. Anything below this value is considered a product variant with missing images.

    * + * @return null|int */ public function getThreshold() @@ -138,6 +154,7 @@ public function getThreshold() /** *

    Filters results by the provided Product IDs. Cannot be applied in combination with any other filter.

    * + * @return null|array */ public function getProductIds() @@ -148,6 +165,7 @@ public function getProductIds() /** *

    Filters results by the provided product type IDs. It cannot be applied in combination with any other filter.

    * + * @return null|array */ public function getProductTypeIds() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesSearchRequestModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesSearchRequestModel.php index aa472c987e3..ad026f0a958 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesSearchRequestModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesSearchRequestModel.php @@ -20,46 +20,55 @@ final class MissingImagesSearchRequestModel extends JsonObjectModel implements MissingImagesSearchRequest { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?bool */ protected $staged; /** + * * @var ?int */ protected $productSetLimit; /** + * * @var ?bool */ protected $includeVariants; /** + * * @var ?bool */ protected $autoThreshold; /** + * * @var ?int */ protected $threshold; /** + * * @var ?array */ protected $productIds; /** + * * @var ?array */ protected $productTypeIds; @@ -93,6 +102,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -112,6 +122,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -131,6 +142,7 @@ public function getOffset() /** *

    If true, searches data from staged products in addition to published products.

    * + * * @return null|bool */ public function getStaged() @@ -150,6 +162,7 @@ public function getStaged() /** *

    Maximum number of products to scan.

    * + * * @return null|int */ public function getProductSetLimit() @@ -169,6 +182,7 @@ public function getProductSetLimit() /** *

    If true, searches all product variants. If false, only searches master variants.

    * + * * @return null|bool */ public function getIncludeVariants() @@ -188,6 +202,7 @@ public function getIncludeVariants() /** *

    If true, uses the median number of images per product variant as a threshold value.

    * + * * @return null|bool */ public function getAutoThreshold() @@ -207,6 +222,7 @@ public function getAutoThreshold() /** *

    The minimum number of images a product variant must have. Anything below this value is considered a product variant with missing images.

    * + * * @return null|int */ public function getThreshold() @@ -226,6 +242,7 @@ public function getThreshold() /** *

    Filters results by the provided Product IDs. Cannot be applied in combination with any other filter.

    * + * * @return null|array */ public function getProductIds() @@ -245,6 +262,7 @@ public function getProductIds() /** *

    Filters results by the provided product type IDs. It cannot be applied in combination with any other filter.

    * + * * @return null|array */ public function getProductTypeIds() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesTaskStatus.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesTaskStatus.php index 720f0331011..4d492852560 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesTaskStatus.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesTaskStatus.php @@ -19,6 +19,7 @@ interface MissingImagesTaskStatus extends JsonObject public const FIELD_RESULT = 'result'; /** + * @return null|string */ public function getState(); @@ -26,6 +27,7 @@ public function getState(); /** *

    The expiry date of the result. You cannot access the result after the expiry date. Default: 1 day after the result first becomes available. This is only available when the TaskStatus state is SUCCESS.

    * + * @return null|DateTimeImmutable */ public function getExpires(); @@ -33,6 +35,7 @@ public function getExpires(); /** *

    The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is SUCCESS.

    * + * @deprecated * @return null|MissingImagesPagedQueryResult */ public function getResult(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesTaskStatusBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesTaskStatusBuilder.php index 0e553382390..c41bed06191 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesTaskStatusBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesTaskStatusBuilder.php @@ -22,21 +22,25 @@ final class MissingImagesTaskStatusBuilder implements Builder { /** + * @var ?string */ private $state; /** + * @var ?DateTimeImmutable */ private $expires; /** + * @deprecated * @var null|MissingImagesPagedQueryResult|MissingImagesPagedQueryResultBuilder */ private $result; /** + * @return null|string */ public function getState() @@ -47,6 +51,7 @@ public function getState() /** *

    The expiry date of the result. You cannot access the result after the expiry date. Default: 1 day after the result first becomes available. This is only available when the TaskStatus state is SUCCESS.

    * + * @return null|DateTimeImmutable */ public function getExpires() @@ -57,6 +62,7 @@ public function getExpires() /** *

    The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is SUCCESS.

    * + * @deprecated * @return null|MissingImagesPagedQueryResult */ public function getResult() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesTaskStatusModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesTaskStatusModel.php index 77df1f9ce6d..bcd61e80fc0 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesTaskStatusModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesTaskStatusModel.php @@ -21,16 +21,19 @@ final class MissingImagesTaskStatusModel extends JsonObjectModel implements MissingImagesTaskStatus { /** + * * @var ?string */ protected $state; /** + * * @var ?DateTimeImmutable */ protected $expires; /** + * @deprecated * @var ?MissingImagesPagedQueryResult */ protected $result; @@ -50,6 +53,7 @@ public function __construct( } /** + * * @return null|string */ public function getState() @@ -69,6 +73,7 @@ public function getState() /** *

    The expiry date of the result. You cannot access the result after the expiry date. Default: 1 day after the result first becomes available. This is only available when the TaskStatus state is SUCCESS.

    * + * * @return null|DateTimeImmutable */ public function getExpires() @@ -92,6 +97,7 @@ public function getExpires() /** *

    The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is SUCCESS.

    * + * @deprecated * @return null|MissingImagesPagedQueryResult */ public function getResult() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesVariantLevel.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesVariantLevel.php index 87d81212cf6..20e91d40e72 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesVariantLevel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesVariantLevel.php @@ -16,6 +16,7 @@ interface MissingImagesVariantLevel extends MissingImagesCount /** *

    Number of product variants missing images.

    * + * @return null|int */ public function getMissingImages(); @@ -23,6 +24,7 @@ public function getMissingImages(); /** *

    Number of products scanned.

    * + * @return null|int */ public function getTotal(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesVariantLevelBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesVariantLevelBuilder.php index 47aeb3988b7..26a1b8707ba 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesVariantLevelBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesVariantLevelBuilder.php @@ -21,11 +21,13 @@ final class MissingImagesVariantLevelBuilder implements Builder { /** + * @var ?int */ private $missingImages; /** + * @var ?int */ private $total; @@ -33,6 +35,7 @@ final class MissingImagesVariantLevelBuilder implements Builder /** *

    Number of product variants missing images.

    * + * @return null|int */ public function getMissingImages() @@ -43,6 +46,7 @@ public function getMissingImages() /** *

    Number of products scanned.

    * + * @return null|int */ public function getTotal() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingImagesVariantLevelModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingImagesVariantLevelModel.php index 0bb20c04a6d..506d3c41c04 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingImagesVariantLevelModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingImagesVariantLevelModel.php @@ -20,11 +20,13 @@ final class MissingImagesVariantLevelModel extends JsonObjectModel implements MissingImagesVariantLevel { /** + * * @var ?int */ protected $missingImages; /** + * * @var ?int */ protected $total; @@ -44,6 +46,7 @@ public function __construct( /** *

    Number of product variants missing images.

    * + * * @return null|int */ public function getMissingImages() @@ -63,6 +66,7 @@ public function getMissingImages() /** *

    Number of products scanned.

    * + * * @return null|int */ public function getTotal() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPrices.php b/lib/commercetools-ml/src/Models/MissingData/MissingPrices.php index 6b995786eec..ccbf64b6b60 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPrices.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPrices.php @@ -18,6 +18,7 @@ interface MissingPrices extends JsonObject public const FIELD_VARIANT_ID = 'variantId'; /** + * @return null|ProductReference */ public function getProduct(); @@ -25,6 +26,7 @@ public function getProduct(); /** *

    Id of the ProductVariant.

    * + * @return null|int */ public function getVariantId(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesBuilder.php index ef3c949e584..74b610c4561 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesBuilder.php @@ -23,16 +23,19 @@ final class MissingPricesBuilder implements Builder { /** + * @var null|ProductReference|ProductReferenceBuilder */ private $product; /** + * @var ?int */ private $variantId; /** + * @return null|ProductReference */ public function getProduct() @@ -43,6 +46,7 @@ public function getProduct() /** *

    Id of the ProductVariant.

    * + * @return null|int */ public function getVariantId() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesMeta.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesMeta.php index fac7d0d61c6..f6c5b5c8ba4 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesMeta.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesMeta.php @@ -17,11 +17,13 @@ interface MissingPricesMeta extends JsonObject public const FIELD_VARIANT_LEVEL = 'variantLevel'; /** + * @deprecated * @return null|MissingPricesProductLevel */ public function getProductLevel(); /** + * @deprecated * @return null|MissingPricesVariantLevel */ public function getVariantLevel(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesMetaBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesMetaBuilder.php index 043969466c3..330350881df 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesMetaBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesMetaBuilder.php @@ -21,16 +21,19 @@ final class MissingPricesMetaBuilder implements Builder { /** + * @deprecated * @var null|MissingPricesProductLevel|MissingPricesProductLevelBuilder */ private $productLevel; /** + * @deprecated * @var null|MissingPricesVariantLevel|MissingPricesVariantLevelBuilder */ private $variantLevel; /** + * @deprecated * @return null|MissingPricesProductLevel */ public function getProductLevel() @@ -39,6 +42,7 @@ public function getProductLevel() } /** + * @deprecated * @return null|MissingPricesVariantLevel */ public function getVariantLevel() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesMetaModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesMetaModel.php index 9fc3ddb01c9..e5f72a6fd09 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesMetaModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesMetaModel.php @@ -20,11 +20,13 @@ final class MissingPricesMetaModel extends JsonObjectModel implements MissingPricesMeta { /** + * @deprecated * @var ?MissingPricesProductLevel */ protected $productLevel; /** + * @deprecated * @var ?MissingPricesVariantLevel */ protected $variantLevel; @@ -42,6 +44,7 @@ public function __construct( } /** + * @deprecated * @return null|MissingPricesProductLevel */ public function getProductLevel() @@ -60,6 +63,7 @@ public function getProductLevel() } /** + * @deprecated * @return null|MissingPricesVariantLevel */ public function getVariantLevel() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesModel.php index 6dfb771043c..b0fb020ff6d 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesModel.php @@ -22,11 +22,13 @@ final class MissingPricesModel extends JsonObjectModel implements MissingPrices { /** + * * @var ?ProductReference */ protected $product; /** + * * @var ?int */ protected $variantId; @@ -44,6 +46,7 @@ public function __construct( } /** + * * @return null|ProductReference */ public function getProduct() @@ -64,6 +67,7 @@ public function getProduct() /** *

    Id of the ProductVariant.

    * + * * @return null|int */ public function getVariantId() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesPagedQueryResult.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesPagedQueryResult.php index 5f7b2282364..a3db6a0477b 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesPagedQueryResult.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesPagedQueryResult.php @@ -20,11 +20,13 @@ interface MissingPricesPagedQueryResult extends JsonObject public const FIELD_META = 'meta'; /** + * @return null|int */ public function getCount(); /** + * @return null|int */ public function getTotal(); @@ -32,16 +34,19 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); /** + * @return null|MissingPricesCollection */ public function getResults(); /** + * @deprecated * @return null|MissingPricesMeta */ public function getMeta(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesPagedQueryResultBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesPagedQueryResultBuilder.php index f83263f200d..a5324039d8b 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesPagedQueryResultBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesPagedQueryResultBuilder.php @@ -21,31 +21,37 @@ final class MissingPricesPagedQueryResultBuilder implements Builder { /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?MissingPricesCollection */ private $results; /** + * @deprecated * @var null|MissingPricesMeta|MissingPricesMetaBuilder */ private $meta; /** + * @return null|int */ public function getCount() @@ -54,6 +60,7 @@ public function getCount() } /** + * @return null|int */ public function getTotal() @@ -64,6 +71,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -72,6 +80,7 @@ public function getOffset() } /** + * @return null|MissingPricesCollection */ public function getResults() @@ -80,6 +89,7 @@ public function getResults() } /** + * @deprecated * @return null|MissingPricesMeta */ public function getMeta() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesPagedQueryResultModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesPagedQueryResultModel.php index 3de2fa6e319..e12108147b6 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesPagedQueryResultModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesPagedQueryResultModel.php @@ -20,26 +20,31 @@ final class MissingPricesPagedQueryResultModel extends JsonObjectModel implements MissingPricesPagedQueryResult { /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?MissingPricesCollection */ protected $results; /** + * @deprecated * @var ?MissingPricesMeta */ protected $meta; @@ -63,6 +68,7 @@ public function __construct( } /** + * * @return null|int */ public function getCount() @@ -80,6 +86,7 @@ public function getCount() } /** + * * @return null|int */ public function getTotal() @@ -99,6 +106,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -116,6 +124,7 @@ public function getOffset() } /** + * * @return null|MissingPricesCollection */ public function getResults() @@ -133,6 +142,7 @@ public function getResults() } /** + * @deprecated * @return null|MissingPricesMeta */ public function getMeta() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductCount.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductCount.php index 16a3d41674e..de16d5c58e5 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductCount.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductCount.php @@ -17,11 +17,13 @@ interface MissingPricesProductCount extends JsonObject public const FIELD_MISSING_PRICES = 'missingPrices'; /** + * @return null|int */ public function getTotal(); /** + * @return null|int */ public function getMissingPrices(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductCountBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductCountBuilder.php index 7699d9d70a7..a54ef77adc1 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductCountBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductCountBuilder.php @@ -21,16 +21,19 @@ final class MissingPricesProductCountBuilder implements Builder { /** + * @var ?int */ private $total; /** + * @var ?int */ private $missingPrices; /** + * @return null|int */ public function getTotal() @@ -39,6 +42,7 @@ public function getTotal() } /** + * @return null|int */ public function getMissingPrices() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductCountModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductCountModel.php index 1b0091c7868..cefff32757f 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductCountModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductCountModel.php @@ -20,11 +20,13 @@ final class MissingPricesProductCountModel extends JsonObjectModel implements MissingPricesProductCount { /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $missingPrices; @@ -42,6 +44,7 @@ public function __construct( } /** + * * @return null|int */ public function getTotal() @@ -59,6 +62,7 @@ public function getTotal() } /** + * * @return null|int */ public function getMissingPrices() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductLevel.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductLevel.php index d3195b4b212..07e7f315cd2 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductLevel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductLevel.php @@ -16,6 +16,7 @@ interface MissingPricesProductLevel extends MissingPricesProductCount /** *

    Number of products scanned.

    * + * @return null|int */ public function getTotal(); @@ -23,6 +24,7 @@ public function getTotal(); /** *

    Number of products missing prices.

    * + * @return null|int */ public function getMissingPrices(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductLevelBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductLevelBuilder.php index ba662b8a7d6..1edab510d90 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductLevelBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductLevelBuilder.php @@ -21,11 +21,13 @@ final class MissingPricesProductLevelBuilder implements Builder { /** + * @var ?int */ private $total; /** + * @var ?int */ private $missingPrices; @@ -33,6 +35,7 @@ final class MissingPricesProductLevelBuilder implements Builder /** *

    Number of products scanned.

    * + * @return null|int */ public function getTotal() @@ -43,6 +46,7 @@ public function getTotal() /** *

    Number of products missing prices.

    * + * @return null|int */ public function getMissingPrices() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductLevelModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductLevelModel.php index 9fd027fa64f..16650124d6e 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductLevelModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesProductLevelModel.php @@ -20,11 +20,13 @@ final class MissingPricesProductLevelModel extends JsonObjectModel implements MissingPricesProductLevel { /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $missingPrices; @@ -44,6 +46,7 @@ public function __construct( /** *

    Number of products scanned.

    * + * * @return null|int */ public function getTotal() @@ -63,6 +66,7 @@ public function getTotal() /** *

    Number of products missing prices.

    * + * * @return null|int */ public function getMissingPrices() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesSearchRequest.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesSearchRequest.php index 775360c1895..61570c838b9 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesSearchRequest.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesSearchRequest.php @@ -29,6 +29,7 @@ interface MissingPricesSearchRequest extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -36,6 +37,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -43,6 +45,7 @@ public function getOffset(); /** *

    If true, searches data from staged products in addition to published products.

    * + * @return null|bool */ public function getStaged(); @@ -50,6 +53,7 @@ public function getStaged(); /** *

    Maximum number of products to scan.

    * + * @return null|int */ public function getProductSetLimit(); @@ -57,6 +61,7 @@ public function getProductSetLimit(); /** *

    If true, searches all product variants. If false, only searches master variants.

    * + * @return null|bool */ public function getIncludeVariants(); @@ -64,6 +69,7 @@ public function getIncludeVariants(); /** *

    If used, only checks if a product variant has a price in the provided currency code.

    * + * @return null|string */ public function getCurrencyCode(); @@ -71,6 +77,7 @@ public function getCurrencyCode(); /** *

    If true, checks if there are prices for the specified date range and time.

    * + * @return null|bool */ public function getCheckDate(); @@ -78,6 +85,7 @@ public function getCheckDate(); /** *

    Starting date of the range to check. If no value is given, checks prices valid at the time the search is initiated.

    * + * @return null|DateTimeImmutable */ public function getValidFrom(); @@ -85,6 +93,7 @@ public function getValidFrom(); /** *

    Ending date of the range to check. If no value is given, it is equal to validFrom.

    * + * @return null|DateTimeImmutable */ public function getValidUntil(); @@ -92,6 +101,7 @@ public function getValidUntil(); /** *

    Filters results by the provided Product IDs. Cannot be applied in combination with the productTypeIds filter.

    * + * @return null|array */ public function getProductIds(); @@ -99,6 +109,7 @@ public function getProductIds(); /** *

    Filters results by the provided product type IDs. Cannot be applied in combination with the productIds filter.

    * + * @return null|array */ public function getProductTypeIds(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesSearchRequestBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesSearchRequestBuilder.php index c0da611a749..a9fd83bd3cf 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesSearchRequestBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesSearchRequestBuilder.php @@ -22,56 +22,67 @@ final class MissingPricesSearchRequestBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?bool */ private $staged; /** + * @var ?int */ private $productSetLimit; /** + * @var ?bool */ private $includeVariants; /** + * @var ?string */ private $currencyCode; /** + * @var ?bool */ private $checkDate; /** + * @var ?DateTimeImmutable */ private $validFrom; /** + * @var ?DateTimeImmutable */ private $validUntil; /** + * @var ?array */ private $productIds; /** + * @var ?array */ private $productTypeIds; @@ -79,6 +90,7 @@ final class MissingPricesSearchRequestBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -89,6 +101,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -99,6 +112,7 @@ public function getOffset() /** *

    If true, searches data from staged products in addition to published products.

    * + * @return null|bool */ public function getStaged() @@ -109,6 +123,7 @@ public function getStaged() /** *

    Maximum number of products to scan.

    * + * @return null|int */ public function getProductSetLimit() @@ -119,6 +134,7 @@ public function getProductSetLimit() /** *

    If true, searches all product variants. If false, only searches master variants.

    * + * @return null|bool */ public function getIncludeVariants() @@ -129,6 +145,7 @@ public function getIncludeVariants() /** *

    If used, only checks if a product variant has a price in the provided currency code.

    * + * @return null|string */ public function getCurrencyCode() @@ -139,6 +156,7 @@ public function getCurrencyCode() /** *

    If true, checks if there are prices for the specified date range and time.

    * + * @return null|bool */ public function getCheckDate() @@ -149,6 +167,7 @@ public function getCheckDate() /** *

    Starting date of the range to check. If no value is given, checks prices valid at the time the search is initiated.

    * + * @return null|DateTimeImmutable */ public function getValidFrom() @@ -159,6 +178,7 @@ public function getValidFrom() /** *

    Ending date of the range to check. If no value is given, it is equal to validFrom.

    * + * @return null|DateTimeImmutable */ public function getValidUntil() @@ -169,6 +189,7 @@ public function getValidUntil() /** *

    Filters results by the provided Product IDs. Cannot be applied in combination with the productTypeIds filter.

    * + * @return null|array */ public function getProductIds() @@ -179,6 +200,7 @@ public function getProductIds() /** *

    Filters results by the provided product type IDs. Cannot be applied in combination with the productIds filter.

    * + * @return null|array */ public function getProductTypeIds() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesSearchRequestModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesSearchRequestModel.php index 73cd6186d23..7c94e2fddb4 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesSearchRequestModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesSearchRequestModel.php @@ -21,56 +21,67 @@ final class MissingPricesSearchRequestModel extends JsonObjectModel implements MissingPricesSearchRequest { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?bool */ protected $staged; /** + * * @var ?int */ protected $productSetLimit; /** + * * @var ?bool */ protected $includeVariants; /** + * * @var ?string */ protected $currencyCode; /** + * * @var ?bool */ protected $checkDate; /** + * * @var ?DateTimeImmutable */ protected $validFrom; /** + * * @var ?DateTimeImmutable */ protected $validUntil; /** + * * @var ?array */ protected $productIds; /** + * * @var ?array */ protected $productTypeIds; @@ -108,6 +119,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -127,6 +139,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -146,6 +159,7 @@ public function getOffset() /** *

    If true, searches data from staged products in addition to published products.

    * + * * @return null|bool */ public function getStaged() @@ -165,6 +179,7 @@ public function getStaged() /** *

    Maximum number of products to scan.

    * + * * @return null|int */ public function getProductSetLimit() @@ -184,6 +199,7 @@ public function getProductSetLimit() /** *

    If true, searches all product variants. If false, only searches master variants.

    * + * * @return null|bool */ public function getIncludeVariants() @@ -203,6 +219,7 @@ public function getIncludeVariants() /** *

    If used, only checks if a product variant has a price in the provided currency code.

    * + * * @return null|string */ public function getCurrencyCode() @@ -222,6 +239,7 @@ public function getCurrencyCode() /** *

    If true, checks if there are prices for the specified date range and time.

    * + * * @return null|bool */ public function getCheckDate() @@ -241,6 +259,7 @@ public function getCheckDate() /** *

    Starting date of the range to check. If no value is given, checks prices valid at the time the search is initiated.

    * + * * @return null|DateTimeImmutable */ public function getValidFrom() @@ -264,6 +283,7 @@ public function getValidFrom() /** *

    Ending date of the range to check. If no value is given, it is equal to validFrom.

    * + * * @return null|DateTimeImmutable */ public function getValidUntil() @@ -287,6 +307,7 @@ public function getValidUntil() /** *

    Filters results by the provided Product IDs. Cannot be applied in combination with the productTypeIds filter.

    * + * * @return null|array */ public function getProductIds() @@ -306,6 +327,7 @@ public function getProductIds() /** *

    Filters results by the provided product type IDs. Cannot be applied in combination with the productIds filter.

    * + * * @return null|array */ public function getProductTypeIds() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesTaskStatus.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesTaskStatus.php index 7cb3a8297cb..65958097f9d 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesTaskStatus.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesTaskStatus.php @@ -19,6 +19,7 @@ interface MissingPricesTaskStatus extends JsonObject public const FIELD_RESULT = 'result'; /** + * @return null|string */ public function getState(); @@ -26,6 +27,7 @@ public function getState(); /** *

    The expiry date of the result. You cannot access the result after the expiry date. Default: 1 day after the result first becomes available. This is only available when the TaskStatus state is SUCCESS.

    * + * @return null|DateTimeImmutable */ public function getExpires(); @@ -33,6 +35,7 @@ public function getExpires(); /** *

    The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is SUCCESS.

    * + * @deprecated * @return null|MissingPricesPagedQueryResult */ public function getResult(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesTaskStatusBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesTaskStatusBuilder.php index 91e05fecf02..f75e90f7be9 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesTaskStatusBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesTaskStatusBuilder.php @@ -22,21 +22,25 @@ final class MissingPricesTaskStatusBuilder implements Builder { /** + * @var ?string */ private $state; /** + * @var ?DateTimeImmutable */ private $expires; /** + * @deprecated * @var null|MissingPricesPagedQueryResult|MissingPricesPagedQueryResultBuilder */ private $result; /** + * @return null|string */ public function getState() @@ -47,6 +51,7 @@ public function getState() /** *

    The expiry date of the result. You cannot access the result after the expiry date. Default: 1 day after the result first becomes available. This is only available when the TaskStatus state is SUCCESS.

    * + * @return null|DateTimeImmutable */ public function getExpires() @@ -57,6 +62,7 @@ public function getExpires() /** *

    The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is SUCCESS.

    * + * @deprecated * @return null|MissingPricesPagedQueryResult */ public function getResult() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesTaskStatusModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesTaskStatusModel.php index fabb17a2436..b42360ace19 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesTaskStatusModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesTaskStatusModel.php @@ -21,16 +21,19 @@ final class MissingPricesTaskStatusModel extends JsonObjectModel implements MissingPricesTaskStatus { /** + * * @var ?string */ protected $state; /** + * * @var ?DateTimeImmutable */ protected $expires; /** + * @deprecated * @var ?MissingPricesPagedQueryResult */ protected $result; @@ -50,6 +53,7 @@ public function __construct( } /** + * * @return null|string */ public function getState() @@ -69,6 +73,7 @@ public function getState() /** *

    The expiry date of the result. You cannot access the result after the expiry date. Default: 1 day after the result first becomes available. This is only available when the TaskStatus state is SUCCESS.

    * + * * @return null|DateTimeImmutable */ public function getExpires() @@ -92,6 +97,7 @@ public function getExpires() /** *

    The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is SUCCESS.

    * + * @deprecated * @return null|MissingPricesPagedQueryResult */ public function getResult() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesVariantLevel.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesVariantLevel.php index 773a65bd08f..0007972bddd 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesVariantLevel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesVariantLevel.php @@ -16,6 +16,7 @@ interface MissingPricesVariantLevel extends MissingPricesProductCount /** *

    Number of product variants scanned.

    * + * @return null|int */ public function getTotal(); @@ -23,6 +24,7 @@ public function getTotal(); /** *

    Number of product variants missing prices.

    * + * @return null|int */ public function getMissingPrices(); diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesVariantLevelBuilder.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesVariantLevelBuilder.php index 0c563c322ab..f16bd332311 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesVariantLevelBuilder.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesVariantLevelBuilder.php @@ -21,11 +21,13 @@ final class MissingPricesVariantLevelBuilder implements Builder { /** + * @var ?int */ private $total; /** + * @var ?int */ private $missingPrices; @@ -33,6 +35,7 @@ final class MissingPricesVariantLevelBuilder implements Builder /** *

    Number of product variants scanned.

    * + * @return null|int */ public function getTotal() @@ -43,6 +46,7 @@ public function getTotal() /** *

    Number of product variants missing prices.

    * + * @return null|int */ public function getMissingPrices() diff --git a/lib/commercetools-ml/src/Models/MissingData/MissingPricesVariantLevelModel.php b/lib/commercetools-ml/src/Models/MissingData/MissingPricesVariantLevelModel.php index be8761ee957..efce8182a03 100644 --- a/lib/commercetools-ml/src/Models/MissingData/MissingPricesVariantLevelModel.php +++ b/lib/commercetools-ml/src/Models/MissingData/MissingPricesVariantLevelModel.php @@ -20,11 +20,13 @@ final class MissingPricesVariantLevelModel extends JsonObjectModel implements MissingPricesVariantLevel { /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $missingPrices; @@ -44,6 +46,7 @@ public function __construct( /** *

    Number of product variants scanned.

    * + * * @return null|int */ public function getTotal() @@ -63,6 +66,7 @@ public function getTotal() /** *

    Number of product variants missing prices.

    * + * * @return null|int */ public function getMissingPrices() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/ProductSetSelector.php b/lib/commercetools-ml/src/Models/SimilarProducts/ProductSetSelector.php index 8cbf2a1a882..b4f94eae41c 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/ProductSetSelector.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/ProductSetSelector.php @@ -23,6 +23,7 @@ interface ProductSetSelector extends JsonObject /** *

    The project containing the project set.

    * + * @return null|string */ public function getProjectKey(); @@ -30,6 +31,7 @@ public function getProjectKey(); /** *

    An array of Product IDs to compare. If unspecified, no Product ID filter is applied.

    * + * @return null|array */ public function getProductIds(); @@ -37,6 +39,7 @@ public function getProductIds(); /** *

    An array of product type IDs. Only products with product types in this array are compared. If unspecified, no product type filter is applied.

    * + * @return null|array */ public function getProductTypeIds(); @@ -44,6 +47,7 @@ public function getProductTypeIds(); /** *

    Specifies use of staged or current product data.

    * + * @return null|bool */ public function getStaged(); @@ -51,6 +55,7 @@ public function getStaged(); /** *

    Specifies use of product variants. If set to true, all product variants are compared, not just the master variant.

    * + * @return null|bool */ public function getIncludeVariants(); @@ -58,6 +63,7 @@ public function getIncludeVariants(); /** *

    Maximum number of products to check (if unspecified, all products are considered). Note that the maximum number of product comparisons between two productSets is 20,000,000. This limit cannot be exceeded. If you need a higher limit, contact https://support.commercetools.com

    * + * @return null|int */ public function getProductSetLimit(); diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/ProductSetSelectorBuilder.php b/lib/commercetools-ml/src/Models/SimilarProducts/ProductSetSelectorBuilder.php index 6d01921831f..da08c383343 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/ProductSetSelectorBuilder.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/ProductSetSelectorBuilder.php @@ -21,31 +21,37 @@ final class ProductSetSelectorBuilder implements Builder { /** + * @var ?string */ private $projectKey; /** + * @var ?array */ private $productIds; /** + * @var ?array */ private $productTypeIds; /** + * @var ?bool */ private $staged; /** + * @var ?bool */ private $includeVariants; /** + * @var ?int */ private $productSetLimit; @@ -53,6 +59,7 @@ final class ProductSetSelectorBuilder implements Builder /** *

    The project containing the project set.

    * + * @return null|string */ public function getProjectKey() @@ -63,6 +70,7 @@ public function getProjectKey() /** *

    An array of Product IDs to compare. If unspecified, no Product ID filter is applied.

    * + * @return null|array */ public function getProductIds() @@ -73,6 +81,7 @@ public function getProductIds() /** *

    An array of product type IDs. Only products with product types in this array are compared. If unspecified, no product type filter is applied.

    * + * @return null|array */ public function getProductTypeIds() @@ -83,6 +92,7 @@ public function getProductTypeIds() /** *

    Specifies use of staged or current product data.

    * + * @return null|bool */ public function getStaged() @@ -93,6 +103,7 @@ public function getStaged() /** *

    Specifies use of product variants. If set to true, all product variants are compared, not just the master variant.

    * + * @return null|bool */ public function getIncludeVariants() @@ -103,6 +114,7 @@ public function getIncludeVariants() /** *

    Maximum number of products to check (if unspecified, all products are considered). Note that the maximum number of product comparisons between two productSets is 20,000,000. This limit cannot be exceeded. If you need a higher limit, contact https://support.commercetools.com

    * + * @return null|int */ public function getProductSetLimit() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/ProductSetSelectorModel.php b/lib/commercetools-ml/src/Models/SimilarProducts/ProductSetSelectorModel.php index 2d081467815..c2cee6a86cb 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/ProductSetSelectorModel.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/ProductSetSelectorModel.php @@ -20,31 +20,37 @@ final class ProductSetSelectorModel extends JsonObjectModel implements ProductSetSelector { /** + * * @var ?string */ protected $projectKey; /** + * * @var ?array */ protected $productIds; /** + * * @var ?array */ protected $productTypeIds; /** + * * @var ?bool */ protected $staged; /** + * * @var ?bool */ protected $includeVariants; /** + * * @var ?int */ protected $productSetLimit; @@ -72,6 +78,7 @@ public function __construct( /** *

    The project containing the project set.

    * + * * @return null|string */ public function getProjectKey() @@ -91,6 +98,7 @@ public function getProjectKey() /** *

    An array of Product IDs to compare. If unspecified, no Product ID filter is applied.

    * + * * @return null|array */ public function getProductIds() @@ -110,6 +118,7 @@ public function getProductIds() /** *

    An array of product type IDs. Only products with product types in this array are compared. If unspecified, no product type filter is applied.

    * + * * @return null|array */ public function getProductTypeIds() @@ -129,6 +138,7 @@ public function getProductTypeIds() /** *

    Specifies use of staged or current product data.

    * + * * @return null|bool */ public function getStaged() @@ -148,6 +158,7 @@ public function getStaged() /** *

    Specifies use of product variants. If set to true, all product variants are compared, not just the master variant.

    * + * * @return null|bool */ public function getIncludeVariants() @@ -167,6 +178,7 @@ public function getIncludeVariants() /** *

    Maximum number of products to check (if unspecified, all products are considered). Note that the maximum number of product comparisons between two productSets is 20,000,000. This limit cannot be exceeded. If you need a higher limit, contact https://support.commercetools.com

    * + * * @return null|int */ public function getProductSetLimit() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProduct.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProduct.php index b7bf88cec52..abb9aae1ed4 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProduct.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProduct.php @@ -21,6 +21,7 @@ interface SimilarProduct extends JsonObject /** *

    Reference to Product

    * + * @return null|ProductReference */ public function getProduct(); @@ -28,6 +29,7 @@ public function getProduct(); /** *

    ID of the ProductVariant that was compared.

    * + * @return null|int */ public function getVariantId(); @@ -35,6 +37,7 @@ public function getVariantId(); /** *

    Supplementary information about the data used for similarity estimation. This information helps you understand the estimated confidence score, but it should not be used to identify a product.

    * + * @return null|SimilarProductMeta */ public function getMeta(); diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductBuilder.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductBuilder.php index 5d9b78a1f50..776815f8825 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductBuilder.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductBuilder.php @@ -23,16 +23,19 @@ final class SimilarProductBuilder implements Builder { /** + * @var null|ProductReference|ProductReferenceBuilder */ private $product; /** + * @var ?int */ private $variantId; /** + * @var null|SimilarProductMeta|SimilarProductMetaBuilder */ private $meta; @@ -40,6 +43,7 @@ final class SimilarProductBuilder implements Builder /** *

    Reference to Product

    * + * @return null|ProductReference */ public function getProduct() @@ -50,6 +54,7 @@ public function getProduct() /** *

    ID of the ProductVariant that was compared.

    * + * @return null|int */ public function getVariantId() @@ -60,6 +65,7 @@ public function getVariantId() /** *

    Supplementary information about the data used for similarity estimation. This information helps you understand the estimated confidence score, but it should not be used to identify a product.

    * + * @return null|SimilarProductMeta */ public function getMeta() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductMeta.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductMeta.php index 900d9fa6621..b21fb37c741 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductMeta.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductMeta.php @@ -23,6 +23,7 @@ interface SimilarProductMeta extends JsonObject /** *

    Localized product name used for similarity estimation.

    * + * @return null|LocalizedString */ public function getName(); @@ -30,6 +31,7 @@ public function getName(); /** *

    Localized product description used for similarity estimation.

    * + * @return null|LocalizedString */ public function getDescription(); @@ -37,6 +39,7 @@ public function getDescription(); /** *

    The product price in cents using the currency defined in SimilarProductSearchRequest If multiple prices exist, the median value is taken as a representative amount.

    * + * @return null|Money */ public function getPrice(); @@ -44,6 +47,7 @@ public function getPrice(); /** *

    Total number of variants associated with the product.

    * + * @return null|int */ public function getVariantCount(); diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductMetaBuilder.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductMetaBuilder.php index f9ac2ae062f..7ee7464d253 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductMetaBuilder.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductMetaBuilder.php @@ -25,21 +25,25 @@ final class SimilarProductMetaBuilder implements Builder { /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $name; /** + * @var null|LocalizedString|LocalizedStringBuilder */ private $description; /** + * @var null|Money|MoneyBuilder */ private $price; /** + * @var ?int */ private $variantCount; @@ -47,6 +51,7 @@ final class SimilarProductMetaBuilder implements Builder /** *

    Localized product name used for similarity estimation.

    * + * @return null|LocalizedString */ public function getName() @@ -57,6 +62,7 @@ public function getName() /** *

    Localized product description used for similarity estimation.

    * + * @return null|LocalizedString */ public function getDescription() @@ -67,6 +73,7 @@ public function getDescription() /** *

    The product price in cents using the currency defined in SimilarProductSearchRequest If multiple prices exist, the median value is taken as a representative amount.

    * + * @return null|Money */ public function getPrice() @@ -77,6 +84,7 @@ public function getPrice() /** *

    Total number of variants associated with the product.

    * + * @return null|int */ public function getVariantCount() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductMetaModel.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductMetaModel.php index 1135cb45d72..057e216d56f 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductMetaModel.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductMetaModel.php @@ -24,21 +24,25 @@ final class SimilarProductMetaModel extends JsonObjectModel implements SimilarProductMeta { /** + * * @var ?LocalizedString */ protected $name; /** + * * @var ?LocalizedString */ protected $description; /** + * * @var ?Money */ protected $price; /** + * * @var ?int */ protected $variantCount; @@ -62,6 +66,7 @@ public function __construct( /** *

    Localized product name used for similarity estimation.

    * + * * @return null|LocalizedString */ public function getName() @@ -82,6 +87,7 @@ public function getName() /** *

    Localized product description used for similarity estimation.

    * + * * @return null|LocalizedString */ public function getDescription() @@ -102,6 +108,7 @@ public function getDescription() /** *

    The product price in cents using the currency defined in SimilarProductSearchRequest If multiple prices exist, the median value is taken as a representative amount.

    * + * * @return null|Money */ public function getPrice() @@ -122,6 +129,7 @@ public function getPrice() /** *

    Total number of variants associated with the product.

    * + * * @return null|int */ public function getVariantCount() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductModel.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductModel.php index 46e78c240e4..3c8d5267fc0 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductModel.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductModel.php @@ -22,16 +22,19 @@ final class SimilarProductModel extends JsonObjectModel implements SimilarProduct { /** + * * @var ?ProductReference */ protected $product; /** + * * @var ?int */ protected $variantId; /** + * * @var ?SimilarProductMeta */ protected $meta; @@ -53,6 +56,7 @@ public function __construct( /** *

    Reference to Product

    * + * * @return null|ProductReference */ public function getProduct() @@ -73,6 +77,7 @@ public function getProduct() /** *

    ID of the ProductVariant that was compared.

    * + * * @return null|int */ public function getVariantId() @@ -92,6 +97,7 @@ public function getVariantId() /** *

    Supplementary information about the data used for similarity estimation. This information helps you understand the estimated confidence score, but it should not be used to identify a product.

    * + * * @return null|SimilarProductMeta */ public function getMeta() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductPair.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductPair.php index fb96d67f64c..112ae35ba8a 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductPair.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductPair.php @@ -19,11 +19,13 @@ interface SimilarProductPair extends JsonObject /** *

    The probability of product similarity.

    * + * @return null|float */ public function getConfidence(); /** + * @return null|SimilarProductCollection */ public function getProducts(); diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductPairBuilder.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductPairBuilder.php index 1904a15d4d9..68d069e4641 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductPairBuilder.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductPairBuilder.php @@ -21,11 +21,13 @@ final class SimilarProductPairBuilder implements Builder { /** + * @var ?float */ private $confidence; /** + * @var ?SimilarProductCollection */ private $products; @@ -33,6 +35,7 @@ final class SimilarProductPairBuilder implements Builder /** *

    The probability of product similarity.

    * + * @return null|float */ public function getConfidence() @@ -41,6 +44,7 @@ public function getConfidence() } /** + * @return null|SimilarProductCollection */ public function getProducts() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductPairModel.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductPairModel.php index 9b6773040e3..a78964d8523 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductPairModel.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductPairModel.php @@ -20,11 +20,13 @@ final class SimilarProductPairModel extends JsonObjectModel implements SimilarProductPair { /** + * * @var ?float */ protected $confidence; /** + * * @var ?SimilarProductCollection */ protected $products; @@ -44,6 +46,7 @@ public function __construct( /** *

    The probability of product similarity.

    * + * * @return null|float */ public function getConfidence() @@ -61,6 +64,7 @@ public function getConfidence() } /** + * * @return null|SimilarProductCollection */ public function getProducts() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequest.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequest.php index fd0db42d6f0..40a589e312e 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequest.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequest.php @@ -25,6 +25,7 @@ interface SimilarProductSearchRequest extends JsonObject /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit(); @@ -32,6 +33,7 @@ public function getLimit(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); @@ -39,6 +41,7 @@ public function getOffset(); /** *

    language tag used to prioritize language for text comparisons.

    * + * @return null|string */ public function getLanguage(); @@ -46,6 +49,7 @@ public function getLanguage(); /** *

    The three-digit currency code to compare prices in. When a product has multiple prices, all prices for the product are converted to the currency provided by the currency attribute and the median price is calculated for comparison. Currencies are converted using the ECB currency exchange rates at the time the request is made. Of the currency codes, only currencies with currency exchange rates provided by the ECB are supported.

    * + * @return null|string */ public function getCurrencyCode(); @@ -53,6 +57,7 @@ public function getCurrencyCode(); /** *

    similarityMeasures defines the attributes taken into account to measure product similarity.

    * + * @return null|SimilarityMeasures */ public function getSimilarityMeasures(); @@ -60,16 +65,19 @@ public function getSimilarityMeasures(); /** *

    Array of length 2 of ProductSetSelector

    * + * @return null|ProductSetSelectorCollection */ public function getProductSetSelectors(); /** + * @return null|float */ public function getConfidenceMin(); /** + * @return null|float */ public function getConfidenceMax(); diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestBuilder.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestBuilder.php index 03d9e62f5c3..63c145130cb 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestBuilder.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestBuilder.php @@ -21,41 +21,49 @@ final class SimilarProductSearchRequestBuilder implements Builder { /** + * @var ?int */ private $limit; /** + * @var ?int */ private $offset; /** + * @var ?string */ private $language; /** + * @var ?string */ private $currencyCode; /** + * @var null|SimilarityMeasures|SimilarityMeasuresBuilder */ private $similarityMeasures; /** + * @var ?ProductSetSelectorCollection */ private $productSetSelectors; /** + * @var ?float */ private $confidenceMin; /** + * @var ?float */ private $confidenceMax; @@ -63,6 +71,7 @@ final class SimilarProductSearchRequestBuilder implements Builder /** *

    Number of results requested.

    * + * @return null|int */ public function getLimit() @@ -73,6 +82,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -83,6 +93,7 @@ public function getOffset() /** *

    language tag used to prioritize language for text comparisons.

    * + * @return null|string */ public function getLanguage() @@ -93,6 +104,7 @@ public function getLanguage() /** *

    The three-digit currency code to compare prices in. When a product has multiple prices, all prices for the product are converted to the currency provided by the currency attribute and the median price is calculated for comparison. Currencies are converted using the ECB currency exchange rates at the time the request is made. Of the currency codes, only currencies with currency exchange rates provided by the ECB are supported.

    * + * @return null|string */ public function getCurrencyCode() @@ -103,6 +115,7 @@ public function getCurrencyCode() /** *

    similarityMeasures defines the attributes taken into account to measure product similarity.

    * + * @return null|SimilarityMeasures */ public function getSimilarityMeasures() @@ -113,6 +126,7 @@ public function getSimilarityMeasures() /** *

    Array of length 2 of ProductSetSelector

    * + * @return null|ProductSetSelectorCollection */ public function getProductSetSelectors() @@ -121,6 +135,7 @@ public function getProductSetSelectors() } /** + * @return null|float */ public function getConfidenceMin() @@ -129,6 +144,7 @@ public function getConfidenceMin() } /** + * @return null|float */ public function getConfidenceMax() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestMeta.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestMeta.php index db516357fdc..064624211a1 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestMeta.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestMeta.php @@ -18,6 +18,7 @@ interface SimilarProductSearchRequestMeta extends JsonObject /** *

    The SimilarityMeasures used in this search.

    * + * @return null|SimilarityMeasures */ public function getSimilarityMeasures(); diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestMetaBuilder.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestMetaBuilder.php index 1562206a83e..561c4d9315b 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestMetaBuilder.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestMetaBuilder.php @@ -21,6 +21,7 @@ final class SimilarProductSearchRequestMetaBuilder implements Builder { /** + * @var null|SimilarityMeasures|SimilarityMeasuresBuilder */ private $similarityMeasures; @@ -28,6 +29,7 @@ final class SimilarProductSearchRequestMetaBuilder implements Builder /** *

    The SimilarityMeasures used in this search.

    * + * @return null|SimilarityMeasures */ public function getSimilarityMeasures() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestMetaModel.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestMetaModel.php index 868d2099eaa..55872ec6bab 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestMetaModel.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestMetaModel.php @@ -20,6 +20,7 @@ final class SimilarProductSearchRequestMetaModel extends JsonObjectModel implements SimilarProductSearchRequestMeta { /** + * * @var ?SimilarityMeasures */ protected $similarityMeasures; @@ -37,6 +38,7 @@ public function __construct( /** *

    The SimilarityMeasures used in this search.

    * + * * @return null|SimilarityMeasures */ public function getSimilarityMeasures() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestModel.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestModel.php index bb2349681eb..029f96b72a6 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestModel.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductSearchRequestModel.php @@ -20,41 +20,49 @@ final class SimilarProductSearchRequestModel extends JsonObjectModel implements SimilarProductSearchRequest { /** + * * @var ?int */ protected $limit; /** + * * @var ?int */ protected $offset; /** + * * @var ?string */ protected $language; /** + * * @var ?string */ protected $currencyCode; /** + * * @var ?SimilarityMeasures */ protected $similarityMeasures; /** + * * @var ?ProductSetSelectorCollection */ protected $productSetSelectors; /** + * * @var ?float */ protected $confidenceMin; /** + * * @var ?float */ protected $confidenceMax; @@ -86,6 +94,7 @@ public function __construct( /** *

    Number of results requested.

    * + * * @return null|int */ public function getLimit() @@ -105,6 +114,7 @@ public function getLimit() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -124,6 +134,7 @@ public function getOffset() /** *

    language tag used to prioritize language for text comparisons.

    * + * * @return null|string */ public function getLanguage() @@ -143,6 +154,7 @@ public function getLanguage() /** *

    The three-digit currency code to compare prices in. When a product has multiple prices, all prices for the product are converted to the currency provided by the currency attribute and the median price is calculated for comparison. Currencies are converted using the ECB currency exchange rates at the time the request is made. Of the currency codes, only currencies with currency exchange rates provided by the ECB are supported.

    * + * * @return null|string */ public function getCurrencyCode() @@ -162,6 +174,7 @@ public function getCurrencyCode() /** *

    similarityMeasures defines the attributes taken into account to measure product similarity.

    * + * * @return null|SimilarityMeasures */ public function getSimilarityMeasures() @@ -182,6 +195,7 @@ public function getSimilarityMeasures() /** *

    Array of length 2 of ProductSetSelector

    * + * * @return null|ProductSetSelectorCollection */ public function getProductSetSelectors() @@ -199,6 +213,7 @@ public function getProductSetSelectors() } /** + * * @return null|float */ public function getConfidenceMin() @@ -216,6 +231,7 @@ public function getConfidenceMin() } /** + * * @return null|float */ public function getConfidenceMax() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsPagedQueryResult.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsPagedQueryResult.php index 9e62c448bc5..8c7ced34170 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsPagedQueryResult.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsPagedQueryResult.php @@ -20,11 +20,13 @@ interface SimilarProductsPagedQueryResult extends JsonObject public const FIELD_META = 'meta'; /** + * @return null|int */ public function getCount(); /** + * @return null|int */ public function getTotal(); @@ -32,16 +34,19 @@ public function getTotal(); /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset(); /** + * @return null|SimilarProductPairCollection */ public function getResults(); /** + * @return null|SimilarProductSearchRequestMeta */ public function getMeta(); diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsPagedQueryResultBuilder.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsPagedQueryResultBuilder.php index 4f1b519040f..44af86d725e 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsPagedQueryResultBuilder.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsPagedQueryResultBuilder.php @@ -21,31 +21,37 @@ final class SimilarProductsPagedQueryResultBuilder implements Builder { /** + * @var ?int */ private $count; /** + * @var ?int */ private $total; /** + * @var ?int */ private $offset; /** + * @var ?SimilarProductPairCollection */ private $results; /** + * @var null|SimilarProductSearchRequestMeta|SimilarProductSearchRequestMetaBuilder */ private $meta; /** + * @return null|int */ public function getCount() @@ -54,6 +60,7 @@ public function getCount() } /** + * @return null|int */ public function getTotal() @@ -64,6 +71,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * @return null|int */ public function getOffset() @@ -72,6 +80,7 @@ public function getOffset() } /** + * @return null|SimilarProductPairCollection */ public function getResults() @@ -80,6 +89,7 @@ public function getResults() } /** + * @return null|SimilarProductSearchRequestMeta */ public function getMeta() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsPagedQueryResultModel.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsPagedQueryResultModel.php index a361b2f5c02..444111c0175 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsPagedQueryResultModel.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsPagedQueryResultModel.php @@ -20,26 +20,31 @@ final class SimilarProductsPagedQueryResultModel extends JsonObjectModel implements SimilarProductsPagedQueryResult { /** + * * @var ?int */ protected $count; /** + * * @var ?int */ protected $total; /** + * * @var ?int */ protected $offset; /** + * * @var ?SimilarProductPairCollection */ protected $results; /** + * * @var ?SimilarProductSearchRequestMeta */ protected $meta; @@ -63,6 +68,7 @@ public function __construct( } /** + * * @return null|int */ public function getCount() @@ -80,6 +86,7 @@ public function getCount() } /** + * * @return null|int */ public function getTotal() @@ -99,6 +106,7 @@ public function getTotal() /** *

    Number of elements skipped.

    * + * * @return null|int */ public function getOffset() @@ -116,6 +124,7 @@ public function getOffset() } /** + * * @return null|SimilarProductPairCollection */ public function getResults() @@ -133,6 +142,7 @@ public function getResults() } /** + * * @return null|SimilarProductSearchRequestMeta */ public function getMeta() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsTaskStatus.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsTaskStatus.php index e3bc7d0dadb..98ca6f19d50 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsTaskStatus.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsTaskStatus.php @@ -19,6 +19,7 @@ interface SimilarProductsTaskStatus extends JsonObject public const FIELD_RESULT = 'result'; /** + * @return null|string */ public function getState(); @@ -26,6 +27,7 @@ public function getState(); /** *

    The expiry date of the result. You cannot access the result after the expiry date. Default: 1 day after the result first becomes available. This is only available when the TaskStatus state is SUCCESS.

    * + * @return null|DateTimeImmutable */ public function getExpires(); @@ -33,6 +35,7 @@ public function getExpires(); /** *

    The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is SUCCESS.

    * + * @return null|SimilarProductsPagedQueryResult */ public function getResult(); diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsTaskStatusBuilder.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsTaskStatusBuilder.php index 13cf1e054cc..59d6183fdc3 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsTaskStatusBuilder.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsTaskStatusBuilder.php @@ -22,21 +22,25 @@ final class SimilarProductsTaskStatusBuilder implements Builder { /** + * @var ?string */ private $state; /** + * @var ?DateTimeImmutable */ private $expires; /** + * @var null|SimilarProductsPagedQueryResult|SimilarProductsPagedQueryResultBuilder */ private $result; /** + * @return null|string */ public function getState() @@ -47,6 +51,7 @@ public function getState() /** *

    The expiry date of the result. You cannot access the result after the expiry date. Default: 1 day after the result first becomes available. This is only available when the TaskStatus state is SUCCESS.

    * + * @return null|DateTimeImmutable */ public function getExpires() @@ -57,6 +62,7 @@ public function getExpires() /** *

    The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is SUCCESS.

    * + * @return null|SimilarProductsPagedQueryResult */ public function getResult() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsTaskStatusModel.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsTaskStatusModel.php index 86e10b5d018..9d39e6d7e7a 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsTaskStatusModel.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarProductsTaskStatusModel.php @@ -21,16 +21,19 @@ final class SimilarProductsTaskStatusModel extends JsonObjectModel implements SimilarProductsTaskStatus { /** + * * @var ?string */ protected $state; /** + * * @var ?DateTimeImmutable */ protected $expires; /** + * * @var ?SimilarProductsPagedQueryResult */ protected $result; @@ -50,6 +53,7 @@ public function __construct( } /** + * * @return null|string */ public function getState() @@ -69,6 +73,7 @@ public function getState() /** *

    The expiry date of the result. You cannot access the result after the expiry date. Default: 1 day after the result first becomes available. This is only available when the TaskStatus state is SUCCESS.

    * + * * @return null|DateTimeImmutable */ public function getExpires() @@ -92,6 +97,7 @@ public function getExpires() /** *

    The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is SUCCESS.

    * + * * @return null|SimilarProductsPagedQueryResult */ public function getResult() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarityMeasures.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarityMeasures.php index 648047c65e3..cadaaff566c 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarityMeasures.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarityMeasures.php @@ -22,6 +22,7 @@ interface SimilarityMeasures extends JsonObject /** *

    Importance of the name attribute in overall similarity.

    * + * @return null|int */ public function getName(); @@ -29,6 +30,7 @@ public function getName(); /** *

    Importance of the description attribute in overall similarity.

    * + * @return null|int */ public function getDescription(); @@ -36,6 +38,7 @@ public function getDescription(); /** *

    Importance of the description attribute in overall similarity.

    * + * @return null|int */ public function getAttribute(); @@ -43,6 +46,7 @@ public function getAttribute(); /** *

    Importance of the number of product variants in overall similarity.

    * + * @return null|int */ public function getVariantCount(); @@ -50,6 +54,7 @@ public function getVariantCount(); /** *

    Importance of the price attribute in overall similarity.

    * + * @return null|int */ public function getPrice(); diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarityMeasuresBuilder.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarityMeasuresBuilder.php index 5cd7d0b6671..e51997a476d 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarityMeasuresBuilder.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarityMeasuresBuilder.php @@ -21,26 +21,31 @@ final class SimilarityMeasuresBuilder implements Builder { /** + * @var ?int */ private $name; /** + * @var ?int */ private $description; /** + * @var ?int */ private $attribute; /** + * @var ?int */ private $variantCount; /** + * @var ?int */ private $price; @@ -48,6 +53,7 @@ final class SimilarityMeasuresBuilder implements Builder /** *

    Importance of the name attribute in overall similarity.

    * + * @return null|int */ public function getName() @@ -58,6 +64,7 @@ public function getName() /** *

    Importance of the description attribute in overall similarity.

    * + * @return null|int */ public function getDescription() @@ -68,6 +75,7 @@ public function getDescription() /** *

    Importance of the description attribute in overall similarity.

    * + * @return null|int */ public function getAttribute() @@ -78,6 +86,7 @@ public function getAttribute() /** *

    Importance of the number of product variants in overall similarity.

    * + * @return null|int */ public function getVariantCount() @@ -88,6 +97,7 @@ public function getVariantCount() /** *

    Importance of the price attribute in overall similarity.

    * + * @return null|int */ public function getPrice() diff --git a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarityMeasuresModel.php b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarityMeasuresModel.php index efc2b508569..970cd2fed9d 100644 --- a/lib/commercetools-ml/src/Models/SimilarProducts/SimilarityMeasuresModel.php +++ b/lib/commercetools-ml/src/Models/SimilarProducts/SimilarityMeasuresModel.php @@ -20,26 +20,31 @@ final class SimilarityMeasuresModel extends JsonObjectModel implements SimilarityMeasures { /** + * * @var ?int */ protected $name; /** + * * @var ?int */ protected $description; /** + * * @var ?int */ protected $attribute; /** + * * @var ?int */ protected $variantCount; /** + * * @var ?int */ protected $price; @@ -65,6 +70,7 @@ public function __construct( /** *

    Importance of the name attribute in overall similarity.

    * + * * @return null|int */ public function getName() @@ -84,6 +90,7 @@ public function getName() /** *

    Importance of the description attribute in overall similarity.

    * + * * @return null|int */ public function getDescription() @@ -103,6 +110,7 @@ public function getDescription() /** *

    Importance of the description attribute in overall similarity.

    * + * * @return null|int */ public function getAttribute() @@ -122,6 +130,7 @@ public function getAttribute() /** *

    Importance of the number of product variants in overall similarity.

    * + * * @return null|int */ public function getVariantCount() @@ -141,6 +150,7 @@ public function getVariantCount() /** *

    Importance of the price attribute in overall similarity.

    * + * * @return null|int */ public function getPrice()